-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/canyon-project/canyon
- Loading branch information
Showing
22 changed files
with
329 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Canyon UT | ||
|
||
## 功能 | ||
1. 需要有上报接口,用于接收数据 | ||
2. 前端展示 | ||
3. docker容易部署 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
|
||
const prisma = global.prisma || new PrismaClient(); | ||
|
||
if (process.env.NODE_ENV === "development") global.prisma = prisma; | ||
|
||
export default prisma; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "canyon-ut", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint .", | ||
"preview": "vite preview", | ||
"serve": "node server.js", | ||
"preinstall": "prisma generate" | ||
}, | ||
"dependencies": { | ||
"@prisma/client": "5.16.1", | ||
"antd": "^5.22.5", | ||
"prisma": "5.16.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.17.0", | ||
"@types/react": "^18.3.17", | ||
"@types/react-dom": "^18.3.5", | ||
"@vitejs/plugin-react": "^4.3.4", | ||
"eslint": "^9.17.0", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"eslint-plugin-react-refresh": "^0.4.16", | ||
"express": "^4.21.2", | ||
"globals": "^15.13.0", | ||
"typescript": "~5.6.3", | ||
"typescript-eslint": "^8.18.1", | ||
"vite": "^6.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") // uses connection pooling | ||
} | ||
|
||
model User { | ||
id String @id | ||
username String | ||
password String | ||
nickname String | ||
avatar String | ||
refreshToken String @map("refresh_token") | ||
accessToken String @map("access_token") | ||
email String | ||
favor String | ||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) | ||
@@map("canyon_v3_user") | ||
} | ||
|
||
model Coverage { | ||
id String @id @default(cuid()) | ||
sha String | ||
branch String | ||
compareTarget String @map("compare_target") | ||
provider String | ||
buildProvider String @map("build_provider") // 通过侦测CI环境变量来判断 | ||
buildID String @map("build_id") | ||
projectID String @map("project_id") | ||
reporter String | ||
reportID String @map("report_id") // 未来聚合的一句,区分case | ||
covType String @map("cov_type") // 普通类型,all、agg | ||
// 代码覆盖率 | ||
statementsTotal Int @map("statements_total") | ||
statementsCovered Int @map("statements_covered") | ||
summary Bytes | ||
// 代码覆盖率详情 | ||
hit Bytes | ||
// 特殊逻辑,必须要有map数据,才能上报hit,并且存在cov_type上。 | ||
map Bytes | ||
instrumentCwd String @map("instrument_cwd") //是build时的路径,因为要与sourceMap对应 | ||
// 通用 | ||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) | ||
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamp(3) | ||
@@map("canyon_v3_coverage") | ||
} | ||
|
||
model SysSetting { | ||
id String @id @default(cuid()) | ||
key String | ||
value String | ||
@@map("sys_setting") | ||
} | ||
|
||
model GitProvider { | ||
id String @id | ||
url String | ||
type String | ||
name String | ||
disabled Boolean | ||
privateToken String @map("private_token") | ||
@@map("git_provider") | ||
} | ||
|
||
model Distributedlock { | ||
lockName String @id | ||
isLocked Boolean @default(false) | ||
lockTimestamp DateTime? | ||
lockExpiration DateTime? | ||
@@map("canyon_v3_distributedlock") | ||
} | ||
|
||
model Project { | ||
id String @id | ||
name String | ||
pathWithNamespace String @map("path_with_namespace") | ||
description String | ||
bu String | ||
tags Json | ||
members Json | ||
coverage String | ||
language String | ||
defaultBranch String @map("default_branch") | ||
instrumentCwd String @map("instrument_cwd") | ||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3) | ||
@@map("project") | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import express from 'express'; | ||
|
||
const app = express(); | ||
import prisma from './lib/prisma'; | ||
|
||
app.post('/coverage/client', (req, res) => { | ||
// prisma.coverage.findFirst | ||
res.send('Hello World'); | ||
}); | ||
|
||
app.get('/coverage/map', (req, res) => { | ||
// prisma.coverage.findFirst | ||
res.send('Hello World'); | ||
}); | ||
|
||
app.get('/coverage/summary', (req, res) => { | ||
|
||
}); | ||
|
||
app.listen(8080, () => { | ||
console.log('Server started on http://localhost:8080'); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import {Button} from "antd"; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<div> | ||
<Button type={'primary'}>你好</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export default App |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { StrictMode } from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import './index.css' | ||
import App from './App.tsx' | ||
|
||
createRoot(document.getElementById('root')!).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode>, | ||
) |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"compilerOptions": { | ||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"isolatedModules": true, | ||
"moduleDetection": "force", | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noUncheckedSideEffectImports": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"files": [], | ||
"references": [ | ||
{ "path": "./tsconfig.app.json" }, | ||
{ "path": "./tsconfig.node.json" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", | ||
"target": "ES2022", | ||
"lib": ["ES2023"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"isolatedModules": true, | ||
"moduleDetection": "force", | ||
"noEmit": true, | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noUncheckedSideEffectImports": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
|
||
// https://vite.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
}) |