diff --git a/package.json b/package.json index 3eaabde0..e3fe9a09 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "build": "pnpm -r do-build", "clean": "node ./scripts/clean.mjs", "preinstall": "node ./scripts/check.mjs && node ./scripts/prisma.mjs", - "start:ut": "pnpm -r do-start-ut", "migrate": "prisma migrate dev --schema ./packages/canyon-backend/prisma/schema.prisma" }, "devDependencies": { diff --git a/packages/canyon-ut/.gitignore b/packages/canyon-ut/.gitignore deleted file mode 100644 index 45630c9e..00000000 --- a/packages/canyon-ut/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/versions - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# env files (can opt-in for committing if needed) -.env* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - - -prisma/schema.prisma - -!src/app/api/coverage diff --git a/packages/canyon-ut/README.md b/packages/canyon-ut/README.md deleted file mode 100644 index e215bc4c..00000000 --- a/packages/canyon-ut/README.md +++ /dev/null @@ -1,36 +0,0 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). - -## Getting Started - -First, run the development server: - -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/packages/canyon-ut/eslint.config.mjs b/packages/canyon-ut/eslint.config.mjs deleted file mode 100644 index c85fb67c..00000000 --- a/packages/canyon-ut/eslint.config.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import { dirname } from "path"; -import { fileURLToPath } from "url"; -import { FlatCompat } from "@eslint/eslintrc"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -const compat = new FlatCompat({ - baseDirectory: __dirname, -}); - -const eslintConfig = [ - ...compat.extends("next/core-web-vitals", "next/typescript"), -]; - -export default eslintConfig; diff --git a/packages/canyon-ut/next.config.ts b/packages/canyon-ut/next.config.ts deleted file mode 100644 index f672e175..00000000 --- a/packages/canyon-ut/next.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { NextConfig } from "next"; -import { config } from "dotenv"; -import { resolve } from "node:path"; -config({ path: resolve(__dirname, "../../.env") }); - -// flag position, do not delete - -const nextConfig: NextConfig = { - /* config options here */ - typescript: { - ignoreBuildErrors: true, - }, - eslint: { - ignoreDuringBuilds: true, - }, -}; - -export default nextConfig; diff --git a/packages/canyon-ut/package.json b/packages/canyon-ut/package.json deleted file mode 100644 index 671138d4..00000000 --- a/packages/canyon-ut/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "canyon-ut", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev --turbopack", - "do-build": "next build", - "start": "next start", - "lint": "next lint", - "preinstall": "prisma generate", - "do-start-ut": "next start --port 8080" - }, - "dependencies": { - "@prisma/client": "5.16.1", - "ahooks": "^3.8.4", - "antd": "^5.23.1", - "axios": "^1.7.9", - "dotenv": "^16.4.7", - "next": "15.1.4", - "prisma": "5.16.1", - "react": "^19.0.0", - "react-dom": "^19.0.0" - }, - "devDependencies": { - "@eslint/eslintrc": "^3", - "@types/node": "^20", - "@types/react": "^19", - "@types/react-dom": "^19", - "eslint": "^9", - "eslint-config-next": "15.1.4", - "postcss": "^8", - "tailwindcss": "^3.4.1", - "typescript": "^5" - } -} diff --git a/packages/canyon-ut/postcss.config.mjs b/packages/canyon-ut/postcss.config.mjs deleted file mode 100644 index 1a69fd2a..00000000 --- a/packages/canyon-ut/postcss.config.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('postcss-load-config').Config} */ -const config = { - plugins: { - tailwindcss: {}, - }, -}; - -export default config; diff --git a/packages/canyon-ut/public/file.svg b/packages/canyon-ut/public/file.svg deleted file mode 100644 index 004145cd..00000000 --- a/packages/canyon-ut/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/canyon-ut/public/globe.svg b/packages/canyon-ut/public/globe.svg deleted file mode 100644 index 567f17b0..00000000 --- a/packages/canyon-ut/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/canyon-ut/public/next.svg b/packages/canyon-ut/public/next.svg deleted file mode 100644 index 5174b28c..00000000 --- a/packages/canyon-ut/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/canyon-ut/public/vercel.svg b/packages/canyon-ut/public/vercel.svg deleted file mode 100644 index 77053960..00000000 --- a/packages/canyon-ut/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/canyon-ut/public/window.svg b/packages/canyon-ut/public/window.svg deleted file mode 100644 index b2b2a44f..00000000 --- a/packages/canyon-ut/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/canyon-ut/src/app/api/coverage/map/route.ts b/packages/canyon-ut/src/app/api/coverage/map/route.ts deleted file mode 100644 index bfce7a0a..00000000 --- a/packages/canyon-ut/src/app/api/coverage/map/route.ts +++ /dev/null @@ -1,27 +0,0 @@ -import prisma from "@/lib/prisma"; -import { NextRequest } from "next/server"; -import zlib from "node:zlib"; - -async function decompressedData(compressedData: Buffer): Promise { - if (!compressedData || compressedData.length === 0) { - // @ts-ignore - return {}; - } - // console.log(compressedData.length,'compressedData') - const decompressed = zlib.brotliDecompressSync(compressedData); - return JSON.parse(decompressed.toString()); -} - - -export async function GET(request: NextRequest) { - const data=await prisma.utCoverage.findFirst({ - where: { - sha: "14219242515a546ebc74b7949b5a2faea8d91b0d", - // projectID: "456", - // covType: "agg", - // reportID: "789", - }, - // @ts-ignore - }).then(r=>decompressedData(r.hit)); - return Response.json(data); -} diff --git a/packages/canyon-ut/src/app/api/vi/health/route.ts b/packages/canyon-ut/src/app/api/vi/health/route.ts deleted file mode 100644 index b04b7bc6..00000000 --- a/packages/canyon-ut/src/app/api/vi/health/route.ts +++ /dev/null @@ -1,4 +0,0 @@ -// import { NextRequest } from "next/server"; -export async function GET() { - return Response.json("OK"); -} diff --git a/packages/canyon-ut/src/app/favicon.ico b/packages/canyon-ut/src/app/favicon.ico deleted file mode 100644 index 718d6fea..00000000 Binary files a/packages/canyon-ut/src/app/favicon.ico and /dev/null differ diff --git a/packages/canyon-ut/src/app/globals.css b/packages/canyon-ut/src/app/globals.css deleted file mode 100644 index 6b717ad3..00000000 --- a/packages/canyon-ut/src/app/globals.css +++ /dev/null @@ -1,21 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --background: #ffffff; - --foreground: #171717; -} - -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - -body { - color: var(--foreground); - background: var(--background); - font-family: Arial, Helvetica, sans-serif; -} diff --git a/packages/canyon-ut/src/app/layout.tsx b/packages/canyon-ut/src/app/layout.tsx deleted file mode 100644 index 7ca31de9..00000000 --- a/packages/canyon-ut/src/app/layout.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import type { Metadata } from "next"; -// import { Geist, Geist_Mono } from "next/font/google"; -import "./globals.css"; - -// const geistSans = Geist({ -// variable: "--font-geist-sans", -// subsets: ["latin"], -// }); -// -// const geistMono = Geist_Mono({ -// variable: "--font-geist-mono", -// subsets: ["latin"], -// }); - -export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", -}; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - - {children} - - - ); -} diff --git a/packages/canyon-ut/src/app/page.tsx b/packages/canyon-ut/src/app/page.tsx deleted file mode 100644 index 86fb0030..00000000 --- a/packages/canyon-ut/src/app/page.tsx +++ /dev/null @@ -1,25 +0,0 @@ -'use client'; -// import { Report } from "canyon-report"; -import {useRequest} from "ahooks"; -import axios from "axios"; -import {Table} from "antd"; - -export default function Home() { - const columns = [ - { - title: 'path', - dataIndex: 'path', - key: 'path', - }, - ] - const {data} = useRequest(()=>axios.get(`/api/coverage/map`).then(r=>{ - return r.data - }), {}); - - return
- { - data && - } - - -} diff --git a/packages/canyon-ut/src/lib/prisma.ts b/packages/canyon-ut/src/lib/prisma.ts deleted file mode 100644 index d2842e2b..00000000 --- a/packages/canyon-ut/src/lib/prisma.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PrismaClient } from "@prisma/client"; - -declare global { - // eslint-disable-next-line no-var - var prisma: PrismaClient | undefined; -} - -const prisma = global.prisma || new PrismaClient(); - -if (process.env.NODE_ENV === "development") global.prisma = prisma; - -export default prisma; diff --git a/packages/canyon-ut/tailwind.config.ts b/packages/canyon-ut/tailwind.config.ts deleted file mode 100644 index 109807be..00000000 --- a/packages/canyon-ut/tailwind.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Config } from "tailwindcss"; - -export default { - content: [ - "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", - "./src/components/**/*.{js,ts,jsx,tsx,mdx}", - "./src/app/**/*.{js,ts,jsx,tsx,mdx}", - ], - theme: { - extend: { - colors: { - background: "var(--background)", - foreground: "var(--foreground)", - }, - }, - }, - plugins: [], -} satisfies Config; diff --git a/packages/canyon-ut/tsconfig.json b/packages/canyon-ut/tsconfig.json deleted file mode 100644 index c1334095..00000000 --- a/packages/canyon-ut/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./src/*"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] -}