From 415ef43e60db554629e48e5c3ed29a0919676a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Wed, 10 Apr 2024 15:35:27 +0800 Subject: [PATCH] feat: init --- .editorconfig | 11 + .env.example | 10 + .github/workflows/build-canyon-cli.yml | 46 ++ .github/workflows/npm-publish-canyon-ui.yml | 30 + .github/workflows/publish-docker-image.yml | 30 + .github/workflows/test.yml | 23 + .gitignore | 35 ++ CHANGELOG.md | 3 + CODE_OF_CONDUCT.md | 132 +++++ Dockerfile | 14 + LICENSE | 21 + README.md | 47 ++ SECURITY.md | 27 + examples/config/coverage.json | 9 + examples/playwright-test/.gitignore | 3 + examples/playwright-test/main.js | 36 ++ examples/playwright-test/package.json | 15 + examples/todomvc-react/.eslintrc | 13 + examples/todomvc-react/.gitignore | 3 + examples/todomvc-react/babel.config.js | 3 + examples/todomvc-react/package.json | 42 ++ examples/todomvc-react/public/index.html | 18 + examples/todomvc-react/src/index.js | 15 + examples/todomvc-react/src/todo/app.css | 24 + examples/todomvc-react/src/todo/app.jsx | 20 + .../src/todo/components/footer.jsx | 43 ++ .../src/todo/components/header.jsx | 15 + .../src/todo/components/input.jsx | 49 ++ .../src/todo/components/item.jsx | 53 ++ .../src/todo/components/main.jsx | 45 ++ examples/todomvc-react/src/todo/constants.js | 7 + examples/todomvc-react/src/todo/reducer.js | 64 +++ examples/todomvc-react/webpack.common.js | 43 ++ examples/todomvc-react/webpack.dev.js | 18 + examples/todomvc-react/webpack.prod.js | 30 + examples/vite-react-swc/.eslintrc.cjs | 18 + examples/vite-react-swc/.gitignore | 24 + examples/vite-react-swc/README.md | 30 + examples/vite-react-swc/index.html | 13 + examples/vite-react-swc/package.json | 29 + examples/vite-react-swc/public/vite.svg | 1 + examples/vite-react-swc/src/App.css | 42 ++ examples/vite-react-swc/src/App.tsx | 35 ++ examples/vite-react-swc/src/assets/react.svg | 1 + examples/vite-react-swc/src/index.css | 68 +++ examples/vite-react-swc/src/main.tsx | 10 + examples/vite-react-swc/src/vite-env.d.ts | 1 + examples/vite-react-swc/tsconfig.json | 25 + examples/vite-react-swc/tsconfig.node.json | 10 + examples/vite-react-swc/vite.config.ts | 11 + examples/vite-vue/.gitignore | 24 + examples/vite-vue/README.md | 18 + examples/vite-vue/index.html | 13 + examples/vite-vue/package.json | 21 + examples/vite-vue/public/vite.svg | 1 + examples/vite-vue/src/App.vue | 30 + examples/vite-vue/src/assets/vue.svg | 1 + .../vite-vue/src/components/HelloWorld.vue | 38 ++ examples/vite-vue/src/main.ts | 5 + examples/vite-vue/src/style.css | 79 +++ examples/vite-vue/src/vite-env.d.ts | 1 + examples/vite-vue/tsconfig.json | 25 + examples/vite-vue/tsconfig.node.json | 10 + examples/vite-vue/vite.config.ts | 12 + examples/webpack-babel-ts/.gitignore | 37 ++ examples/webpack-babel-ts/babel.config.js | 3 + examples/webpack-babel-ts/index.html | 14 + examples/webpack-babel-ts/package.json | 20 + examples/webpack-babel-ts/src/main.ts | 7 + examples/webpack-babel-ts/tsconfig.json | 12 + examples/webpack-babel-ts/webpack.config.js | 19 + examples/webpack-demo/.editorconfig | 11 + examples/webpack-demo/.gitignore | 30 + examples/webpack-demo/README.md | 0 examples/webpack-demo/babel.config.json | 11 + .../webpack-demo/config/webpack.config.js | 68 +++ examples/webpack-demo/package.json | 44 ++ examples/webpack-demo/public/index.html | 15 + examples/webpack-demo/public/logo.svg | 1 + examples/webpack-demo/scripts/build.js | 19 + examples/webpack-demo/scripts/start.js | 14 + examples/webpack-demo/src/App.tsx | 22 + examples/webpack-demo/src/assets/logo.png | Bin 0 -> 3416 bytes examples/webpack-demo/src/main.tsx | 7 + examples/webpack-demo/src/pages/about.tsx | 5 + examples/webpack-demo/src/pages/home.tsx | 10 + examples/webpack-demo/tsconfig.json | 26 + package.json | 17 + packages/canyon-backend/.eslintrc.js | 25 + packages/canyon-backend/.gitignore | 37 ++ packages/canyon-backend/.prettierrc | 4 + packages/canyon-backend/README.md | 0 packages/canyon-backend/gen/main.js | 33 ++ .../gen/template/organization.model.ejs | 10 + .../gen/template/organization.module.ejs | 11 + .../gen/template/organization.resolver.ejs | 19 + .../gen/template/organization.service.ejs | 14 + packages/canyon-backend/nest-cli.json | 8 + packages/canyon-backend/package.json | 112 ++++ .../canyon-backend/prisma/create-table.sql | 87 +++ .../20240407130953_upd/migration.sql | 85 +++ .../prisma/migrations/migration_lock.toml | 3 + packages/canyon-backend/prisma/schema.prisma | 95 ++++ packages/canyon-backend/schema.gql | 229 ++++++++ .../src/adapter/gitlab.adapter.ts | 189 ++++++ packages/canyon-backend/src/app.controller.ts | 23 + packages/canyon-backend/src/app.module.ts | 59 ++ packages/canyon-backend/src/app.service.ts | 8 + .../src/auth/auth.controller.ts | 17 + .../canyon-backend/src/auth/auth.module.ts | 24 + .../canyon-backend/src/auth/auth.service.ts | 121 ++++ packages/canyon-backend/src/auth/constants.ts | 3 + .../src/auth/guards/jwt-auth.guard.ts | 20 + .../src/auth/guards/local-auth.guard.ts | 5 + .../src/auth/strategies/jwt.strategy.ts | 19 + .../src/auth/strategies/local.strategy.ts | 23 + .../src/codechange/codechange.controller.ts | 13 + .../src/codechange/codechange.module.ts | 10 + .../src/codechange/codechange.service.ts | 39 ++ .../src/common/models/page-info.model.ts | 5 + packages/canyon-backend/src/constant.ts | 26 + .../src/coverage/coverage.controller.ts | 152 +++++ .../src/coverage/coverage.module.ts | 48 ++ .../src/coverage/coveragedisk.entity.ts | 22 + .../src/coverage/dto/coverage-client.dto.ts | 55 ++ .../src/coverage/models/common.model.ts | 13 + .../src/coverage/models/coverage-summary.ts | 18 + .../coverage/schemas/coverage-data.schema.ts | 17 + .../coverage/schemas/coverage-log.schema.ts | 17 + .../services/consumer-coverage.service.ts | 216 +++++++ .../services/coverage-client.service.ts | 174 ++++++ .../services/coverage-data-adapter.service.ts | 66 +++ .../src/coverage/services/coverage.service.ts | 86 +++ .../coverage/services/coveragedisk.service.ts | 64 +++ .../pull-change-code-and-insert-db.service.ts | 36 ++ .../retrieve-coverage-tree-summary.service.ts | 94 +++ .../src/coverage/valids/is-valid-coverage.ts | 55 ++ .../coveragedata/coveragedata.controller.ts | 38 ++ .../src/coveragedata/coveragedata.module.ts | 10 + .../src/decorators/gql-user.decorator.ts | 10 + .../src/decorators/public.decorator.ts | 4 + .../src/guards/gql-auth.guard.ts | 12 + packages/canyon-backend/src/logger/index.ts | 3 + packages/canyon-backend/src/main.ts | 27 + .../src/prisma/prisma.module.ts | 8 + .../src/prisma/prisma.service.ts | 21 + .../models/project-chart-data.model.ts | 17 + .../models/project-compartment-data.model.ts | 14 + .../src/project/models/project-pages.model.ts | 14 + .../models/project-record-detail.model.ts | 47 ++ .../models/project-records-pages.model.ts | 12 + .../project/models/project-records.model.ts | 98 ++++ .../models/update-project-response.model.ts | 0 .../src/project/project.model.ts | 53 ++ .../src/project/project.module.ts | 27 + .../src/project/project.resolver.ts | 176 ++++++ .../src/project/project2.model.ts | 16 + .../get-project-chart-data.service.ts | 39 ++ .../get-project-compartment-data.service.ts | 70 +++ ...et-project-record-detail-by-sha.service.ts | 54 ++ .../services/get-project-records.service.ts | 94 +++ .../services/get-projects-no-data.service.ts | 32 ++ .../project/services/get-projects.service.ts | 117 ++++ .../src/project/services/project.service.ts | 178 ++++++ .../src/role/enums/role.enum.ts | 4 + .../src/role/guard/roles.guard.ts | 21 + .../src/role/roles.decorator.ts | 5 + .../src/sourcecode/sourcecode.controller.ts | 12 + .../src/sourcecode/sourcecode.module.ts | 14 + .../src/sourcecode/sourcecode.service.ts | 33 ++ packages/canyon-backend/src/types/AuthUser.ts | 3 + .../src/types/input-types.args.ts | 29 + .../src/upload/helpers/uploadAnalyze.ts | 34 ++ .../src/upload/raw-body.middleware.ts | 25 + .../src/upload/upload.controller.ts | 81 +++ .../src/upload/upload.module.ts | 21 + .../src/upload/upload.service.ts | 4 + .../src/user/user.controller.ts | 17 + .../canyon-backend/src/user/user.model.ts | 31 + .../canyon-backend/src/user/user.module.ts | 13 + .../canyon-backend/src/user/user.resolver.ts | 20 + .../canyon-backend/src/user/user.service.ts | 21 + packages/canyon-backend/src/utils/coverage.ts | 103 ++++ packages/canyon-backend/src/utils/diffline.ts | 182 ++++++ packages/canyon-backend/src/utils/download.ts | 29 + packages/canyon-backend/src/utils/summary.ts | 31 + packages/canyon-backend/src/utils/utils.ts | 56 ++ packages/canyon-backend/src/utils/zstd.ts | 12 + packages/canyon-backend/test/app.e2e-spec.ts | 24 + packages/canyon-backend/test/jest-e2e.json | 9 + packages/canyon-backend/tsconfig.build.json | 4 + packages/canyon-backend/tsconfig.json | 21 + packages/canyon-cli/.eslintignore | 2 + packages/canyon-cli/.eslintrc.js | 18 + packages/canyon-cli/.gitignore | 79 +++ packages/canyon-cli/.prettierignore | 1 + packages/canyon-cli/.prettierrc | 14 + packages/canyon-cli/README.md | 7 + packages/canyon-cli/bin/canyon.ts | 33 ++ packages/canyon-cli/jest.config.js | 15 + packages/canyon-cli/package.json | 56 ++ packages/canyon-cli/src/ci_providers/index.ts | 14 + .../src/ci_providers/provider_gitlabci.ts | 83 +++ .../src/ci_providers/provider_jenkinsci.ts | 87 +++ .../src/ci_providers/provider_local.ts | 101 ++++ .../src/ci_providers/provider_template.ts | 154 +++++ packages/canyon-cli/src/helpers/cli.ts | 259 +++++++++ packages/canyon-cli/src/helpers/constants.ts | 3 + packages/canyon-cli/src/helpers/coveragepy.ts | 25 + packages/canyon-cli/src/helpers/files.ts | 369 ++++++++++++ packages/canyon-cli/src/helpers/fixes.ts | 85 +++ packages/canyon-cli/src/helpers/gcov.ts | 22 + packages/canyon-cli/src/helpers/git.ts | 38 ++ packages/canyon-cli/src/helpers/logger.ts | 64 +++ packages/canyon-cli/src/helpers/provider.ts | 72 +++ packages/canyon-cli/src/helpers/proxy.ts | 37 ++ packages/canyon-cli/src/helpers/swift.ts | 103 ++++ packages/canyon-cli/src/helpers/token.ts | 111 ++++ packages/canyon-cli/src/helpers/util.ts | 36 ++ packages/canyon-cli/src/helpers/validate.ts | 55 ++ packages/canyon-cli/src/helpers/web.ts | 251 ++++++++ packages/canyon-cli/src/helpers/xcode.ts | 63 ++ packages/canyon-cli/src/index.ts | 469 +++++++++++++++ packages/canyon-cli/src/types.ts | 90 +++ packages/canyon-cli/tsconfig.json | 18 + packages/canyon-data/.gitignore | 26 + packages/canyon-data/README.md | 0 packages/canyon-data/package.json | 31 + packages/canyon-data/src/coverage/index.ts | 12 + .../src/coverage/test/coverage.test.ts | 8 + .../test/mock-coverage-data-merged.json | 536 ++++++++++++++++++ .../src/coverage/test/mock-coverage-data.json | 536 ++++++++++++++++++ packages/canyon-data/src/index.ts | 2 + packages/canyon-data/src/summary/helpers.ts | 32 ++ packages/canyon-data/src/summary/index.ts | 133 +++++ packages/canyon-data/src/utils/line.ts | 39 ++ packages/canyon-data/src/utils/percent.ts | 9 + packages/canyon-data/tsconfig.json | 23 + packages/canyon-data/vite.config.ts | 16 + packages/canyon-platform/.eslintignore | 5 + packages/canyon-platform/.eslintrc | 75 +++ packages/canyon-platform/.gitignore | 28 + packages/canyon-platform/.prettierrc | 12 + packages/canyon-platform/README.md | 30 + packages/canyon-platform/codegen.ts | 17 + packages/canyon-platform/index.html | 19 + packages/canyon-platform/languages.json | 14 + packages/canyon-platform/locales/cn.json | 75 +++ packages/canyon-platform/locales/en.json | 76 +++ packages/canyon-platform/package.json | 69 +++ packages/canyon-platform/postcss.config.js | 6 + .../canyon-platform/public/light-logo.svg | 1 + packages/canyon-platform/public/logo.svg | 1 + .../canyon-platform/public/welcome-bg.svg | 25 + packages/canyon-platform/src/App.tsx | 22 + .../canyon-platform/src/ScrollBasedLayout.tsx | 65 +++ packages/canyon-platform/src/assets/book.svg | 1 + .../canyon-platform/src/assets/light-logo.svg | 1 + packages/canyon-platform/src/assets/logo.svg | 1 + packages/canyon-platform/src/assets/react.svg | 1 + .../canyon-platform/src/assets/users-icon.tsx | 6 + .../src/components/TagSelect.tsx | 42 ++ .../src/components/app/CopyCode.css | 3 + .../src/components/app/CopyCode.tsx | 34 ++ .../app/ProjectRecordDetailDrawer.tsx | 106 ++++ .../src/components/app/app.json | 56 ++ .../src/components/app/footer.tsx | 39 ++ .../components/app/getting-started-content.ts | 9 + .../src/components/app/project/nodata.tsx | 79 +++ .../canyon-platform/src/components/sha.tsx | 6 + .../src/helpers/backend/GQLClient.ts | 12 + .../gql/mutations/CreateProject.graphql | 8 + .../gql/mutations/DeleteProject.graphql | 8 + .../gql/mutations/UpdateProject.graphql | 5 + .../gql/queries/CheckProjectUrl.graphql | 8 + .../gql/queries/GetProjectByID.graphql | 14 + .../gql/queries/GetProjectChartData.graphql | 7 + .../queries/GetProjectCompartmentData.graphql | 6 + .../GetProjectRecordDetailBySha.graphql | 21 + .../gql/queries/GetProjectRecords.graphql | 17 + .../backend/gql/queries/GetProjects.graphql | 15 + .../gql/queries/GetProjectsBuOptions.graphql | 6 + .../gql/queries/GetProjectsNoData.graphql | 12 + .../helpers/backend/gql/queries/Me.graphql | 13 + .../src/helpers/backend/types/Email.ts | 16 + .../src/helpers/backend/types/TeamName.ts | 13 + packages/canyon-platform/src/i18n.ts | 38 ++ packages/canyon-platform/src/index.css | 44 ++ .../src/layouts/genBreadcrumbItems.tsx | 79 +++ packages/canyon-platform/src/main.tsx | 64 +++ .../canyon-platform/src/pages/index-copy.tsx | 215 +++++++ packages/canyon-platform/src/pages/index.tsx | 232 ++++++++ .../src/pages/index/billing/cart.json | 75 +++ .../src/pages/index/billing/cart.tsx | 91 +++ .../src/pages/index/billing/index.tsx | 164 ++++++ .../src/pages/index/members/index.tsx | 5 + .../index/projects/[id]/commits/[sha].tsx | 104 ++++ .../projects/[id]/commits/helper/index.ts | 64 +++ .../[id]/configure/helper/BasicForms.tsx | 127 +++++ .../helper/icons/SolarUserIdLinear.tsx | 6 + .../index/projects/[id]/configure/index.tsx | 178 ++++++ .../index/projects/[id]/getting-started.tsx | 46 ++ .../src/pages/index/projects/[id]/index.tsx | 396 +++++++++++++ .../src/pages/index/projects/index.tsx | 273 +++++++++ .../src/pages/index/projects/new.tsx | 85 +++ .../src/pages/index/settings/index.tsx | 159 ++++++ .../src/pages/index/usage/index.tsx | 54 ++ .../canyon-platform/src/pages/login/index.tsx | 49 ++ .../canyon-platform/src/pages/oauth/index.tsx | 20 + packages/canyon-platform/src/useWorker.ts | 30 + packages/canyon-platform/src/vite-env.d.ts | 4 + packages/canyon-platform/tailwind.config.js | 17 + packages/canyon-platform/tsconfig.json | 25 + packages/canyon-platform/tsconfig.node.json | 10 + packages/canyon-platform/vite.config.ts | 51 ++ packages/canyon-report/.eslintrc | 67 +++ packages/canyon-report/.gitignore | 24 + packages/canyon-report/README.md | 9 + packages/canyon-report/demo/index.html | 17 + packages/canyon-report/index.html | 14 + packages/canyon-report/package.json | 38 ++ .../src/Report/components/IstanbulReport.tsx | 179 ++++++ .../src/Report/components/Line.tsx | 56 ++ .../src/Report/components/Mask.tsx | 162 ++++++ .../src/Report/components/Th.tsx | 91 +++ .../src/Report/components/Tr.tsx | 90 +++ .../src/Report/components/code.tsx | 106 ++++ .../src/Report/components/line/coverage.tsx | 53 ++ .../src/Report/components/line/new.tsx | 15 + .../src/Report/components/line/number.tsx | 20 + packages/canyon-report/src/Report/index.ts | 5 + packages/canyon-report/src/Report/init.tsx | 36 ++ packages/canyon-report/src/Report/loadcss.ts | 492 ++++++++++++++++ packages/canyon-report/src/Report/types.ts | 46 ++ .../src/assets/css/index-dark.css | 11 + .../src/assets/css/index-light.css | 11 + .../canyon-report/src/assets/css/index.css | 481 ++++++++++++++++ .../canyon-report/src/assets/css/reset.css | 253 +++++++++ packages/canyon-report/src/helper.ts | 183 ++++++ packages/canyon-report/src/index.ts | 5 + packages/canyon-report/src/main.tsx | 45 ++ packages/canyon-report/src/mock.ts | 535 +++++++++++++++++ packages/canyon-report/src/reset.css | 253 +++++++++ packages/canyon-report/tsconfig.json | 25 + packages/canyon-report/vite.config.ts | 25 + packages/canyon-ui/.eslintignore | 5 + packages/canyon-ui/.eslintrc | 75 +++ packages/canyon-ui/.gitignore | 28 + packages/canyon-ui/.prettierrc | 12 + packages/canyon-ui/README.md | 30 + packages/canyon-ui/index.html | 18 + packages/canyon-ui/languages.json | 14 + packages/canyon-ui/locales/cn.json | 72 +++ packages/canyon-ui/locales/en.json | 72 +++ packages/canyon-ui/package.json | 73 +++ packages/canyon-ui/postcss.config.js | 6 + packages/canyon-ui/public/light-logo.svg | 1 + packages/canyon-ui/public/logo.svg | 1 + packages/canyon-ui/public/welcome-bg.svg | 25 + .../canyon-ui/src/assets/icons/EpTopRight.tsx | 6 + packages/canyon-ui/src/assets/img/github.svg | 1 + packages/canyon-ui/src/assets/img/gitlab.svg | 1 + packages/canyon-ui/src/assets/img/google.svg | 1 + packages/canyon-ui/src/assets/img/img.png | Bin 0 -> 32413 bytes .../canyon-ui/src/components/card/Primary.tsx | 26 + .../canyon-ui/src/components/card/index.ts | 1 + packages/canyon-ui/src/components/index.ts | 5 + .../canyon-ui/src/components/layout/Base.tsx | 208 +++++++ .../components/layout/ScrollBasedLayout.tsx | 65 +++ .../canyon-ui/src/components/layout/app.json | 56 ++ .../src/components/layout/footer.tsx | 39 ++ .../canyon-ui/src/components/layout/index.ts | 1 + .../src/components/modal/GlobalSearch.tsx | 37 ++ .../canyon-ui/src/components/modal/index.ts | 1 + .../src/components/page/BillingCollapse.tsx | 107 ++++ .../src/components/page/BillingRadio.tsx | 42 ++ .../src/components/page/BillingUpdateCard.tsx | 41 ++ .../canyon-ui/src/components/page/Oauth.tsx | 42 ++ .../canyon-ui/src/components/page/index.ts | 5 + .../src/components/page/login/LoginBtn.tsx | 35 ++ .../src/components/page/login/LoginForm.tsx | 94 +++ .../src/components/page/login/index.tsx | 77 +++ .../canyon-ui/src/components/text/Title.tsx | 20 + .../canyon-ui/src/components/text/index.ts | 1 + packages/canyon-ui/src/index.ts | 1 + packages/canyon-ui/src/main.tsx | 8 + packages/canyon-ui/src/vite-env.d.ts | 2 + packages/canyon-ui/tailwind.config.js | 12 + packages/canyon-ui/tsconfig.json | 25 + packages/canyon-ui/tsconfig.node.json | 10 + packages/canyon-ui/vite.config.ts | 40 ++ pnpm-workspace.yaml | 4 + screenshots/ci1.jpg | Bin 0 -> 1132448 bytes screenshots/codechange1.jpg | Bin 0 -> 609510 bytes screenshots/demo1.jpg | Bin 0 -> 547178 bytes screenshots/overview1.jpg | Bin 0 -> 800138 bytes screenshots/report1.jpg | Bin 0 -> 696885 bytes scripts/check.js | 19 + tools/coverage-merge/README.md | 7 + tools/coverage-merge/data/first.json | 405 +++++++++++++ tools/coverage-merge/data/second.json | 439 ++++++++++++++ tools/coverage-merge/node.js | 97 ++++ tools/coverage-merge/python.py | 49 ++ 403 files changed, 20420 insertions(+) create mode 100755 .editorconfig create mode 100755 .env.example create mode 100644 .github/workflows/build-canyon-cli.yml create mode 100755 .github/workflows/npm-publish-canyon-ui.yml create mode 100755 .github/workflows/publish-docker-image.yml create mode 100755 .github/workflows/test.yml create mode 100755 .gitignore create mode 100644 CHANGELOG.md create mode 100755 CODE_OF_CONDUCT.md create mode 100755 Dockerfile create mode 100755 LICENSE create mode 100755 README.md create mode 100755 SECURITY.md create mode 100644 examples/config/coverage.json create mode 100644 examples/playwright-test/.gitignore create mode 100644 examples/playwright-test/main.js create mode 100644 examples/playwright-test/package.json create mode 100644 examples/todomvc-react/.eslintrc create mode 100644 examples/todomvc-react/.gitignore create mode 100644 examples/todomvc-react/babel.config.js create mode 100755 examples/todomvc-react/package.json create mode 100644 examples/todomvc-react/public/index.html create mode 100644 examples/todomvc-react/src/index.js create mode 100644 examples/todomvc-react/src/todo/app.css create mode 100644 examples/todomvc-react/src/todo/app.jsx create mode 100644 examples/todomvc-react/src/todo/components/footer.jsx create mode 100644 examples/todomvc-react/src/todo/components/header.jsx create mode 100644 examples/todomvc-react/src/todo/components/input.jsx create mode 100644 examples/todomvc-react/src/todo/components/item.jsx create mode 100644 examples/todomvc-react/src/todo/components/main.jsx create mode 100644 examples/todomvc-react/src/todo/constants.js create mode 100644 examples/todomvc-react/src/todo/reducer.js create mode 100644 examples/todomvc-react/webpack.common.js create mode 100644 examples/todomvc-react/webpack.dev.js create mode 100644 examples/todomvc-react/webpack.prod.js create mode 100644 examples/vite-react-swc/.eslintrc.cjs create mode 100644 examples/vite-react-swc/.gitignore create mode 100644 examples/vite-react-swc/README.md create mode 100644 examples/vite-react-swc/index.html create mode 100644 examples/vite-react-swc/package.json create mode 100644 examples/vite-react-swc/public/vite.svg create mode 100644 examples/vite-react-swc/src/App.css create mode 100644 examples/vite-react-swc/src/App.tsx create mode 100644 examples/vite-react-swc/src/assets/react.svg create mode 100644 examples/vite-react-swc/src/index.css create mode 100644 examples/vite-react-swc/src/main.tsx create mode 100644 examples/vite-react-swc/src/vite-env.d.ts create mode 100644 examples/vite-react-swc/tsconfig.json create mode 100644 examples/vite-react-swc/tsconfig.node.json create mode 100644 examples/vite-react-swc/vite.config.ts create mode 100644 examples/vite-vue/.gitignore create mode 100644 examples/vite-vue/README.md create mode 100644 examples/vite-vue/index.html create mode 100644 examples/vite-vue/package.json create mode 100644 examples/vite-vue/public/vite.svg create mode 100644 examples/vite-vue/src/App.vue create mode 100644 examples/vite-vue/src/assets/vue.svg create mode 100644 examples/vite-vue/src/components/HelloWorld.vue create mode 100644 examples/vite-vue/src/main.ts create mode 100644 examples/vite-vue/src/style.css create mode 100644 examples/vite-vue/src/vite-env.d.ts create mode 100644 examples/vite-vue/tsconfig.json create mode 100644 examples/vite-vue/tsconfig.node.json create mode 100644 examples/vite-vue/vite.config.ts create mode 100755 examples/webpack-babel-ts/.gitignore create mode 100644 examples/webpack-babel-ts/babel.config.js create mode 100644 examples/webpack-babel-ts/index.html create mode 100644 examples/webpack-babel-ts/package.json create mode 100644 examples/webpack-babel-ts/src/main.ts create mode 100644 examples/webpack-babel-ts/tsconfig.json create mode 100644 examples/webpack-babel-ts/webpack.config.js create mode 100644 examples/webpack-demo/.editorconfig create mode 100644 examples/webpack-demo/.gitignore create mode 100644 examples/webpack-demo/README.md create mode 100644 examples/webpack-demo/babel.config.json create mode 100644 examples/webpack-demo/config/webpack.config.js create mode 100644 examples/webpack-demo/package.json create mode 100644 examples/webpack-demo/public/index.html create mode 100755 examples/webpack-demo/public/logo.svg create mode 100644 examples/webpack-demo/scripts/build.js create mode 100644 examples/webpack-demo/scripts/start.js create mode 100644 examples/webpack-demo/src/App.tsx create mode 100644 examples/webpack-demo/src/assets/logo.png create mode 100644 examples/webpack-demo/src/main.tsx create mode 100644 examples/webpack-demo/src/pages/about.tsx create mode 100644 examples/webpack-demo/src/pages/home.tsx create mode 100644 examples/webpack-demo/tsconfig.json create mode 100755 package.json create mode 100755 packages/canyon-backend/.eslintrc.js create mode 100755 packages/canyon-backend/.gitignore create mode 100755 packages/canyon-backend/.prettierrc create mode 100755 packages/canyon-backend/README.md create mode 100644 packages/canyon-backend/gen/main.js create mode 100755 packages/canyon-backend/gen/template/organization.model.ejs create mode 100755 packages/canyon-backend/gen/template/organization.module.ejs create mode 100755 packages/canyon-backend/gen/template/organization.resolver.ejs create mode 100644 packages/canyon-backend/gen/template/organization.service.ejs create mode 100755 packages/canyon-backend/nest-cli.json create mode 100755 packages/canyon-backend/package.json create mode 100644 packages/canyon-backend/prisma/create-table.sql create mode 100644 packages/canyon-backend/prisma/migrations/20240407130953_upd/migration.sql create mode 100644 packages/canyon-backend/prisma/migrations/migration_lock.toml create mode 100755 packages/canyon-backend/prisma/schema.prisma create mode 100644 packages/canyon-backend/schema.gql create mode 100755 packages/canyon-backend/src/adapter/gitlab.adapter.ts create mode 100755 packages/canyon-backend/src/app.controller.ts create mode 100755 packages/canyon-backend/src/app.module.ts create mode 100755 packages/canyon-backend/src/app.service.ts create mode 100755 packages/canyon-backend/src/auth/auth.controller.ts create mode 100755 packages/canyon-backend/src/auth/auth.module.ts create mode 100755 packages/canyon-backend/src/auth/auth.service.ts create mode 100755 packages/canyon-backend/src/auth/constants.ts create mode 100755 packages/canyon-backend/src/auth/guards/jwt-auth.guard.ts create mode 100755 packages/canyon-backend/src/auth/guards/local-auth.guard.ts create mode 100755 packages/canyon-backend/src/auth/strategies/jwt.strategy.ts create mode 100755 packages/canyon-backend/src/auth/strategies/local.strategy.ts create mode 100644 packages/canyon-backend/src/codechange/codechange.controller.ts create mode 100644 packages/canyon-backend/src/codechange/codechange.module.ts create mode 100644 packages/canyon-backend/src/codechange/codechange.service.ts create mode 100644 packages/canyon-backend/src/common/models/page-info.model.ts create mode 100644 packages/canyon-backend/src/constant.ts create mode 100755 packages/canyon-backend/src/coverage/coverage.controller.ts create mode 100755 packages/canyon-backend/src/coverage/coverage.module.ts create mode 100644 packages/canyon-backend/src/coverage/coveragedisk.entity.ts create mode 100755 packages/canyon-backend/src/coverage/dto/coverage-client.dto.ts create mode 100755 packages/canyon-backend/src/coverage/models/common.model.ts create mode 100755 packages/canyon-backend/src/coverage/models/coverage-summary.ts create mode 100644 packages/canyon-backend/src/coverage/schemas/coverage-data.schema.ts create mode 100644 packages/canyon-backend/src/coverage/schemas/coverage-log.schema.ts create mode 100644 packages/canyon-backend/src/coverage/services/consumer-coverage.service.ts create mode 100755 packages/canyon-backend/src/coverage/services/coverage-client.service.ts create mode 100755 packages/canyon-backend/src/coverage/services/coverage-data-adapter.service.ts create mode 100755 packages/canyon-backend/src/coverage/services/coverage.service.ts create mode 100644 packages/canyon-backend/src/coverage/services/coveragedisk.service.ts create mode 100644 packages/canyon-backend/src/coverage/services/pull-change-code-and-insert-db.service.ts create mode 100755 packages/canyon-backend/src/coverage/services/retrieve-coverage-tree-summary.service.ts create mode 100755 packages/canyon-backend/src/coverage/valids/is-valid-coverage.ts create mode 100755 packages/canyon-backend/src/coveragedata/coveragedata.controller.ts create mode 100644 packages/canyon-backend/src/coveragedata/coveragedata.module.ts create mode 100755 packages/canyon-backend/src/decorators/gql-user.decorator.ts create mode 100755 packages/canyon-backend/src/decorators/public.decorator.ts create mode 100755 packages/canyon-backend/src/guards/gql-auth.guard.ts create mode 100644 packages/canyon-backend/src/logger/index.ts create mode 100755 packages/canyon-backend/src/main.ts create mode 100755 packages/canyon-backend/src/prisma/prisma.module.ts create mode 100755 packages/canyon-backend/src/prisma/prisma.service.ts create mode 100644 packages/canyon-backend/src/project/models/project-chart-data.model.ts create mode 100644 packages/canyon-backend/src/project/models/project-compartment-data.model.ts create mode 100644 packages/canyon-backend/src/project/models/project-pages.model.ts create mode 100644 packages/canyon-backend/src/project/models/project-record-detail.model.ts create mode 100644 packages/canyon-backend/src/project/models/project-records-pages.model.ts create mode 100644 packages/canyon-backend/src/project/models/project-records.model.ts create mode 100644 packages/canyon-backend/src/project/models/update-project-response.model.ts create mode 100755 packages/canyon-backend/src/project/project.model.ts create mode 100755 packages/canyon-backend/src/project/project.module.ts create mode 100755 packages/canyon-backend/src/project/project.resolver.ts create mode 100755 packages/canyon-backend/src/project/project2.model.ts create mode 100644 packages/canyon-backend/src/project/services/get-project-chart-data.service.ts create mode 100644 packages/canyon-backend/src/project/services/get-project-compartment-data.service.ts create mode 100644 packages/canyon-backend/src/project/services/get-project-record-detail-by-sha.service.ts create mode 100644 packages/canyon-backend/src/project/services/get-project-records.service.ts create mode 100644 packages/canyon-backend/src/project/services/get-projects-no-data.service.ts create mode 100644 packages/canyon-backend/src/project/services/get-projects.service.ts create mode 100755 packages/canyon-backend/src/project/services/project.service.ts create mode 100755 packages/canyon-backend/src/role/enums/role.enum.ts create mode 100755 packages/canyon-backend/src/role/guard/roles.guard.ts create mode 100755 packages/canyon-backend/src/role/roles.decorator.ts create mode 100644 packages/canyon-backend/src/sourcecode/sourcecode.controller.ts create mode 100644 packages/canyon-backend/src/sourcecode/sourcecode.module.ts create mode 100644 packages/canyon-backend/src/sourcecode/sourcecode.service.ts create mode 100755 packages/canyon-backend/src/types/AuthUser.ts create mode 100644 packages/canyon-backend/src/types/input-types.args.ts create mode 100644 packages/canyon-backend/src/upload/helpers/uploadAnalyze.ts create mode 100644 packages/canyon-backend/src/upload/raw-body.middleware.ts create mode 100755 packages/canyon-backend/src/upload/upload.controller.ts create mode 100755 packages/canyon-backend/src/upload/upload.module.ts create mode 100755 packages/canyon-backend/src/upload/upload.service.ts create mode 100755 packages/canyon-backend/src/user/user.controller.ts create mode 100755 packages/canyon-backend/src/user/user.model.ts create mode 100755 packages/canyon-backend/src/user/user.module.ts create mode 100755 packages/canyon-backend/src/user/user.resolver.ts create mode 100755 packages/canyon-backend/src/user/user.service.ts create mode 100755 packages/canyon-backend/src/utils/coverage.ts create mode 100755 packages/canyon-backend/src/utils/diffline.ts create mode 100644 packages/canyon-backend/src/utils/download.ts create mode 100755 packages/canyon-backend/src/utils/summary.ts create mode 100755 packages/canyon-backend/src/utils/utils.ts create mode 100755 packages/canyon-backend/src/utils/zstd.ts create mode 100755 packages/canyon-backend/test/app.e2e-spec.ts create mode 100755 packages/canyon-backend/test/jest-e2e.json create mode 100755 packages/canyon-backend/tsconfig.build.json create mode 100755 packages/canyon-backend/tsconfig.json create mode 100755 packages/canyon-cli/.eslintignore create mode 100755 packages/canyon-cli/.eslintrc.js create mode 100755 packages/canyon-cli/.gitignore create mode 100755 packages/canyon-cli/.prettierignore create mode 100755 packages/canyon-cli/.prettierrc create mode 100755 packages/canyon-cli/README.md create mode 100755 packages/canyon-cli/bin/canyon.ts create mode 100755 packages/canyon-cli/jest.config.js create mode 100755 packages/canyon-cli/package.json create mode 100755 packages/canyon-cli/src/ci_providers/index.ts create mode 100755 packages/canyon-cli/src/ci_providers/provider_gitlabci.ts create mode 100755 packages/canyon-cli/src/ci_providers/provider_jenkinsci.ts create mode 100755 packages/canyon-cli/src/ci_providers/provider_local.ts create mode 100755 packages/canyon-cli/src/ci_providers/provider_template.ts create mode 100755 packages/canyon-cli/src/helpers/cli.ts create mode 100755 packages/canyon-cli/src/helpers/constants.ts create mode 100755 packages/canyon-cli/src/helpers/coveragepy.ts create mode 100755 packages/canyon-cli/src/helpers/files.ts create mode 100755 packages/canyon-cli/src/helpers/fixes.ts create mode 100755 packages/canyon-cli/src/helpers/gcov.ts create mode 100755 packages/canyon-cli/src/helpers/git.ts create mode 100755 packages/canyon-cli/src/helpers/logger.ts create mode 100755 packages/canyon-cli/src/helpers/provider.ts create mode 100755 packages/canyon-cli/src/helpers/proxy.ts create mode 100755 packages/canyon-cli/src/helpers/swift.ts create mode 100755 packages/canyon-cli/src/helpers/token.ts create mode 100755 packages/canyon-cli/src/helpers/util.ts create mode 100755 packages/canyon-cli/src/helpers/validate.ts create mode 100755 packages/canyon-cli/src/helpers/web.ts create mode 100755 packages/canyon-cli/src/helpers/xcode.ts create mode 100755 packages/canyon-cli/src/index.ts create mode 100755 packages/canyon-cli/src/types.ts create mode 100755 packages/canyon-cli/tsconfig.json create mode 100755 packages/canyon-data/.gitignore create mode 100755 packages/canyon-data/README.md create mode 100755 packages/canyon-data/package.json create mode 100755 packages/canyon-data/src/coverage/index.ts create mode 100755 packages/canyon-data/src/coverage/test/coverage.test.ts create mode 100755 packages/canyon-data/src/coverage/test/mock-coverage-data-merged.json create mode 100755 packages/canyon-data/src/coverage/test/mock-coverage-data.json create mode 100755 packages/canyon-data/src/index.ts create mode 100755 packages/canyon-data/src/summary/helpers.ts create mode 100755 packages/canyon-data/src/summary/index.ts create mode 100755 packages/canyon-data/src/utils/line.ts create mode 100755 packages/canyon-data/src/utils/percent.ts create mode 100755 packages/canyon-data/tsconfig.json create mode 100755 packages/canyon-data/vite.config.ts create mode 100755 packages/canyon-platform/.eslintignore create mode 100755 packages/canyon-platform/.eslintrc create mode 100755 packages/canyon-platform/.gitignore create mode 100755 packages/canyon-platform/.prettierrc create mode 100644 packages/canyon-platform/README.md create mode 100755 packages/canyon-platform/codegen.ts create mode 100644 packages/canyon-platform/index.html create mode 100644 packages/canyon-platform/languages.json create mode 100644 packages/canyon-platform/locales/cn.json create mode 100644 packages/canyon-platform/locales/en.json create mode 100644 packages/canyon-platform/package.json create mode 100755 packages/canyon-platform/postcss.config.js create mode 100755 packages/canyon-platform/public/light-logo.svg create mode 100755 packages/canyon-platform/public/logo.svg create mode 100755 packages/canyon-platform/public/welcome-bg.svg create mode 100644 packages/canyon-platform/src/App.tsx create mode 100644 packages/canyon-platform/src/ScrollBasedLayout.tsx create mode 100644 packages/canyon-platform/src/assets/book.svg create mode 100755 packages/canyon-platform/src/assets/light-logo.svg create mode 100755 packages/canyon-platform/src/assets/logo.svg create mode 100644 packages/canyon-platform/src/assets/react.svg create mode 100644 packages/canyon-platform/src/assets/users-icon.tsx create mode 100644 packages/canyon-platform/src/components/TagSelect.tsx create mode 100755 packages/canyon-platform/src/components/app/CopyCode.css create mode 100755 packages/canyon-platform/src/components/app/CopyCode.tsx create mode 100644 packages/canyon-platform/src/components/app/ProjectRecordDetailDrawer.tsx create mode 100644 packages/canyon-platform/src/components/app/app.json create mode 100644 packages/canyon-platform/src/components/app/footer.tsx create mode 100755 packages/canyon-platform/src/components/app/getting-started-content.ts create mode 100644 packages/canyon-platform/src/components/app/project/nodata.tsx create mode 100644 packages/canyon-platform/src/components/sha.tsx create mode 100755 packages/canyon-platform/src/helpers/backend/GQLClient.ts create mode 100755 packages/canyon-platform/src/helpers/backend/gql/mutations/CreateProject.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/gql/mutations/DeleteProject.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/mutations/UpdateProject.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/gql/queries/CheckProjectUrl.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectByID.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectChartData.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectCompartmentData.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectRecordDetailBySha.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectRecords.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjects.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectsBuOptions.graphql create mode 100644 packages/canyon-platform/src/helpers/backend/gql/queries/GetProjectsNoData.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/gql/queries/Me.graphql create mode 100755 packages/canyon-platform/src/helpers/backend/types/Email.ts create mode 100755 packages/canyon-platform/src/helpers/backend/types/TeamName.ts create mode 100644 packages/canyon-platform/src/i18n.ts create mode 100644 packages/canyon-platform/src/index.css create mode 100755 packages/canyon-platform/src/layouts/genBreadcrumbItems.tsx create mode 100644 packages/canyon-platform/src/main.tsx create mode 100644 packages/canyon-platform/src/pages/index-copy.tsx create mode 100644 packages/canyon-platform/src/pages/index.tsx create mode 100644 packages/canyon-platform/src/pages/index/billing/cart.json create mode 100644 packages/canyon-platform/src/pages/index/billing/cart.tsx create mode 100644 packages/canyon-platform/src/pages/index/billing/index.tsx create mode 100644 packages/canyon-platform/src/pages/index/members/index.tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/[id]/commits/helper/index.ts create mode 100644 packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/BasicForms.tsx create mode 100644 packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/icons/SolarUserIdLinear.tsx create mode 100644 packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/[id]/getting-started.tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/[id]/index.tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/index.tsx create mode 100755 packages/canyon-platform/src/pages/index/projects/new.tsx create mode 100644 packages/canyon-platform/src/pages/index/settings/index.tsx create mode 100644 packages/canyon-platform/src/pages/index/usage/index.tsx create mode 100755 packages/canyon-platform/src/pages/login/index.tsx create mode 100755 packages/canyon-platform/src/pages/oauth/index.tsx create mode 100644 packages/canyon-platform/src/useWorker.ts create mode 100644 packages/canyon-platform/src/vite-env.d.ts create mode 100755 packages/canyon-platform/tailwind.config.js create mode 100644 packages/canyon-platform/tsconfig.json create mode 100644 packages/canyon-platform/tsconfig.node.json create mode 100644 packages/canyon-platform/vite.config.ts create mode 100755 packages/canyon-report/.eslintrc create mode 100755 packages/canyon-report/.gitignore create mode 100755 packages/canyon-report/README.md create mode 100755 packages/canyon-report/demo/index.html create mode 100755 packages/canyon-report/index.html create mode 100755 packages/canyon-report/package.json create mode 100755 packages/canyon-report/src/Report/components/IstanbulReport.tsx create mode 100755 packages/canyon-report/src/Report/components/Line.tsx create mode 100755 packages/canyon-report/src/Report/components/Mask.tsx create mode 100755 packages/canyon-report/src/Report/components/Th.tsx create mode 100755 packages/canyon-report/src/Report/components/Tr.tsx create mode 100755 packages/canyon-report/src/Report/components/code.tsx create mode 100644 packages/canyon-report/src/Report/components/line/coverage.tsx create mode 100644 packages/canyon-report/src/Report/components/line/new.tsx create mode 100644 packages/canyon-report/src/Report/components/line/number.tsx create mode 100755 packages/canyon-report/src/Report/index.ts create mode 100755 packages/canyon-report/src/Report/init.tsx create mode 100755 packages/canyon-report/src/Report/loadcss.ts create mode 100755 packages/canyon-report/src/Report/types.ts create mode 100644 packages/canyon-report/src/assets/css/index-dark.css create mode 100644 packages/canyon-report/src/assets/css/index-light.css create mode 100644 packages/canyon-report/src/assets/css/index.css create mode 100755 packages/canyon-report/src/assets/css/reset.css create mode 100755 packages/canyon-report/src/helper.ts create mode 100755 packages/canyon-report/src/index.ts create mode 100755 packages/canyon-report/src/main.tsx create mode 100755 packages/canyon-report/src/mock.ts create mode 100755 packages/canyon-report/src/reset.css create mode 100755 packages/canyon-report/tsconfig.json create mode 100755 packages/canyon-report/vite.config.ts create mode 100755 packages/canyon-ui/.eslintignore create mode 100755 packages/canyon-ui/.eslintrc create mode 100755 packages/canyon-ui/.gitignore create mode 100755 packages/canyon-ui/.prettierrc create mode 100644 packages/canyon-ui/README.md create mode 100644 packages/canyon-ui/index.html create mode 100644 packages/canyon-ui/languages.json create mode 100644 packages/canyon-ui/locales/cn.json create mode 100644 packages/canyon-ui/locales/en.json create mode 100644 packages/canyon-ui/package.json create mode 100755 packages/canyon-ui/postcss.config.js create mode 100755 packages/canyon-ui/public/light-logo.svg create mode 100755 packages/canyon-ui/public/logo.svg create mode 100755 packages/canyon-ui/public/welcome-bg.svg create mode 100644 packages/canyon-ui/src/assets/icons/EpTopRight.tsx create mode 100644 packages/canyon-ui/src/assets/img/github.svg create mode 100644 packages/canyon-ui/src/assets/img/gitlab.svg create mode 100644 packages/canyon-ui/src/assets/img/google.svg create mode 100644 packages/canyon-ui/src/assets/img/img.png create mode 100644 packages/canyon-ui/src/components/card/Primary.tsx create mode 100644 packages/canyon-ui/src/components/card/index.ts create mode 100644 packages/canyon-ui/src/components/index.ts create mode 100644 packages/canyon-ui/src/components/layout/Base.tsx create mode 100644 packages/canyon-ui/src/components/layout/ScrollBasedLayout.tsx create mode 100644 packages/canyon-ui/src/components/layout/app.json create mode 100644 packages/canyon-ui/src/components/layout/footer.tsx create mode 100644 packages/canyon-ui/src/components/layout/index.ts create mode 100644 packages/canyon-ui/src/components/modal/GlobalSearch.tsx create mode 100644 packages/canyon-ui/src/components/modal/index.ts create mode 100644 packages/canyon-ui/src/components/page/BillingCollapse.tsx create mode 100644 packages/canyon-ui/src/components/page/BillingRadio.tsx create mode 100644 packages/canyon-ui/src/components/page/BillingUpdateCard.tsx create mode 100644 packages/canyon-ui/src/components/page/Oauth.tsx create mode 100644 packages/canyon-ui/src/components/page/index.ts create mode 100644 packages/canyon-ui/src/components/page/login/LoginBtn.tsx create mode 100644 packages/canyon-ui/src/components/page/login/LoginForm.tsx create mode 100644 packages/canyon-ui/src/components/page/login/index.tsx create mode 100644 packages/canyon-ui/src/components/text/Title.tsx create mode 100644 packages/canyon-ui/src/components/text/index.ts create mode 100644 packages/canyon-ui/src/index.ts create mode 100644 packages/canyon-ui/src/main.tsx create mode 100644 packages/canyon-ui/src/vite-env.d.ts create mode 100755 packages/canyon-ui/tailwind.config.js create mode 100644 packages/canyon-ui/tsconfig.json create mode 100644 packages/canyon-ui/tsconfig.node.json create mode 100644 packages/canyon-ui/vite.config.ts create mode 100755 pnpm-workspace.yaml create mode 100755 screenshots/ci1.jpg create mode 100755 screenshots/codechange1.jpg create mode 100755 screenshots/demo1.jpg create mode 100755 screenshots/overview1.jpg create mode 100755 screenshots/report1.jpg create mode 100755 scripts/check.js create mode 100644 tools/coverage-merge/README.md create mode 100644 tools/coverage-merge/data/first.json create mode 100644 tools/coverage-merge/data/second.json create mode 100644 tools/coverage-merge/node.js create mode 100644 tools/coverage-merge/python.py diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 00000000..a1c0c006 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# EditorConfig is awesome: https://EditorConfig.org + +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.env.example b/.env.example new file mode 100755 index 00000000..4057de09 --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +# Prisma Config +DATABASE_URL=postgress://canyon:canyon@localhost:5432/canyon + +# Gitlab Config +GITLAB_URL="***" +GITLAB_CLIENT_ID="***" +GITLAB_CLIENT_SECRET="***" +REDIRECT_URI=http://localhost:3000/login + +PRIVATE_TOKEN=*** diff --git a/.github/workflows/build-canyon-cli.yml b/.github/workflows/build-canyon-cli.yml new file mode 100644 index 00000000..d258c180 --- /dev/null +++ b/.github/workflows/build-canyon-cli.yml @@ -0,0 +1,46 @@ +name: Build canyon-cli + +on: + push: + branches: [ "*" ] + tags: + - "v*.*.*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - run: pnpm i + - run: pnpm --filter canyon-cli exec -- npm run build + - run: pnpm --filter canyon-cli exec -- npm run build-linux + - uses: actions/upload-artifact@v3 + with: + name: Build + path: packages/canyon-cli/out + + release: + runs-on: ubuntu-latest + permissions: + contents: write + + needs: build + + steps: + - uses: actions/download-artifact@v3 + with: + name: Build + path: packages/canyon-cli/out + - run: mv packages/canyon-cli/out build + - run: zip -r canyon-cli.zip build/ + - uses: ncipollo/release-action@v1 + with: + artifacts: "canyon-cli.zip" diff --git a/.github/workflows/npm-publish-canyon-ui.yml b/.github/workflows/npm-publish-canyon-ui.yml new file mode 100755 index 00000000..9675eae2 --- /dev/null +++ b/.github/workflows/npm-publish-canyon-ui.yml @@ -0,0 +1,30 @@ +name: Npm Publish canyon-ui + +on: + push: + branches: [ "*" ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - uses: pnpm/action-setup@v2 + with: + version: 8 + + publish-npm: + needs: [install] + runs-on: ubuntu-latest + steps: + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + - run: pnpm install + - run: pnpm --filter=canyon-ui publish -f --no-git-checks --access=public --filter + env: + NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml new file mode 100755 index 00000000..9204c2f3 --- /dev/null +++ b/.github/workflows/publish-docker-image.yml @@ -0,0 +1,30 @@ +name: Push Docker Image + +on: + push: + branches: + - '*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64 + push: true + tags: zhangtao25/canyon:main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100755 index 00000000..1215ae20 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Test + +on: + push: + branches: + - '*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: pnpm install + - run: pnpm test diff --git a/.gitignore b/.gitignore new file mode 100755 index 00000000..6daa74da --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# 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? + +# IDE / Editor +.idea/* +!.idea/rcb-settings.xml + +# PNPM +.pnpm-store + + +pnpm-lock.yaml + +.env \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e6b9ef93 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + +Visit [releases](https://github.com/canyon-project/canyon/releases) for full changelog. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100755 index 00000000..661609dd --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,132 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +wr_zhang25@163.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 00000000..cb77a0f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:lts + +MAINTAINER wr_zhang25 + +RUN mkdir -p /app +COPY . /app/ +WORKDIR /app + +RUN npm install pnpm -g +RUN pnpm i +RUN pnpm run build + +EXPOSE 8080 +CMD ["node", "packages/canyon-backend/dist/main.js" ] diff --git a/LICENSE b/LICENSE new file mode 100755 index 00000000..bff8f57b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Canyon Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 00000000..9c1d8389 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# Canyon [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/canyon-project/canyon/blob/main/LICENSE) [![build status](https://github.com/canyon-project/canyon/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/canyon-project/canyon/actions/workflows/ci.yml) + +👋 Canyon is a JavaScript code coverage solution + +![](./screenshots/overview1.jpg) + +### **Introduction** + +JavaScript 代码覆盖率解决方案。在前端工程构建阶段,将代码探针及工程信息插桩进产物中;在前端应用运行时,将内存中的覆盖率数据上报至服务端。支持覆盖率聚合、报告生成、新增行覆盖率。 + +主要用于端到端的UI测试用例覆盖率数据收集(也支持node或者UT覆盖率上报收集)。 + +### **Features** + +**Bundling:** 多种生态的bundling方案。 + +- `vite` - vite-plugin-istanbul +- `babel` - babel-plugin-istanbul +- `swc` - swc-coverage-instrument + +**React Native:** 支持React Native覆盖率数据收集。 + +**File:** 支持多种文件类型,例如js、jsx、ts、tsx。 + +**源码回溯:** 开启sourceMap选项来回溯源码覆盖率信息。 + +**CI** 提供覆盖率接口,方便CI工具集成。 + +**变更代码:** 通过配置想要对比的基线Commit Sha或者分支名,过滤筛选出变更代码文件的覆盖率以及计算出整体新增代码行覆盖率。 + +**Commit:** 使用oauth2登陆与github、gitlab等代码仓库链接,根据Commit Sha拉取代码进行覆盖率详情绘制。 + +**聚合:** 根据上报的报告ID进行实时聚合覆盖率数据聚合。 + +**报告组件:** 构建最小原生JavasScript的npm包,提供现代化前端报告水合方案以代替传统istanbul report。 + +**浏览器插件:** 提供浏览器插件,供开发人员实时检测应用覆盖率详情。 + +### Screenshots + +![报告](./screenshots/report1.jpg) + +![覆盖率](./screenshots/demo1.jpg) + +![新增行](./screenshots/codechange1.jpg) + +![配置](./screenshots/ci1.jpg) diff --git a/SECURITY.md b/SECURITY.md new file mode 100755 index 00000000..68b9ea83 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +This document outlines security procedures and general policies for the Canyon project. + +- [Security Policy](#security-policy) + - [Reporting a security vulnerability](#reporting-a-security-vulnerability) + - [Incident response process](#incident-response-process) + +## Reporting a security vulnerability + +Report security vulnerabilities by emailing the Canyon Support team at wr_zhang25@163.com. + +The primary security point of contact from Canyon Support team will acknowledge your email within 48 hours, and will send a more detailed response within 48 hours indicating the next steps in handling your report. After the initial reply to your report, the security team will endeavor to keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. + +**Do not create a GitHub issue ticket to report a security vulnerability.** + +The Canyon team and community take all security vulnerability reports in Canyon seriously. Thank you for improving the security of Canyon. We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions. + +Report security bugs in third-party modules to the person or team maintaining the module. + +## Incident response process + +In case an incident is discovered or reported, we will follow the following process to contain, respond, and remediate: + +1. Confirm the problem and determine the affected versions. +2. Audit code to find any potential similar problems. +3. Prepare fixes for all releases still under maintenance. These fixes will be deployed as fast as possible to production. diff --git a/examples/config/coverage.json b/examples/config/coverage.json new file mode 100644 index 00000000..2de386f4 --- /dev/null +++ b/examples/config/coverage.json @@ -0,0 +1,9 @@ +{ + "include": [ + "src/**/*.js" + ], + "exclude": [ + "**/*.spec.js" + ], + "extensions": [".js"] +} diff --git a/examples/playwright-test/.gitignore b/examples/playwright-test/.gitignore new file mode 100644 index 00000000..67f66f2e --- /dev/null +++ b/examples/playwright-test/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +/node_modules +package-lock.json diff --git a/examples/playwright-test/main.js b/examples/playwright-test/main.js new file mode 100644 index 00000000..fdb5eb06 --- /dev/null +++ b/examples/playwright-test/main.js @@ -0,0 +1,36 @@ +const {chromium} = require('playwright'); +const main = async () => { + const browser = await chromium.launch({headless: false}) + const page = await browser.newPage(); + + // 进入被测页面 + await page.goto('https://test.com') + + // 监听visibilityChange事件 + page.on('visibilitychange', async () => { + const coverage = await page.evaluate(`window.__coverage__`) + const canyon = await page.evaluate(`window.__canyon__`) + + await fetch('{{dsn}}/coverage/client', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer {{token}}' + }, + body: JSON.stringify({ + coverage, + ...canyon + }) + }) + }) + + // 执行测试用例 + // 用例 + await page.click('button') + await page.fill('input', 'test') + await page.click('text=submit') + + browser.close() +} + +main() diff --git a/examples/playwright-test/package.json b/examples/playwright-test/package.json new file mode 100644 index 00000000..26f08bdf --- /dev/null +++ b/examples/playwright-test/package.json @@ -0,0 +1,15 @@ +{ + "name": "play-write", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node ./main.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "playwright": "^1.42.1" + } +} diff --git a/examples/todomvc-react/.eslintrc b/examples/todomvc-react/.eslintrc new file mode 100644 index 00000000..0ce034b4 --- /dev/null +++ b/examples/todomvc-react/.eslintrc @@ -0,0 +1,13 @@ +{ + "extends": ["eslint:recommended", "plugin:react/recommended"], + "settings": { + "react": { + "version": "17.0.2" + } + }, + "rules": { + "no-extra-parens": 0, + "react/prop-types": 0, + "react/react-in-jsx-scope": 0 + } +} diff --git a/examples/todomvc-react/.gitignore b/examples/todomvc-react/.gitignore new file mode 100644 index 00000000..67f66f2e --- /dev/null +++ b/examples/todomvc-react/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +/node_modules +package-lock.json diff --git a/examples/todomvc-react/babel.config.js b/examples/todomvc-react/babel.config.js new file mode 100644 index 00000000..0d39533c --- /dev/null +++ b/examples/todomvc-react/babel.config.js @@ -0,0 +1,3 @@ +module.exports={ + plugins: ['istanbul'] +} diff --git a/examples/todomvc-react/package.json b/examples/todomvc-react/package.json new file mode 100755 index 00000000..14e8fad3 --- /dev/null +++ b/examples/todomvc-react/package.json @@ -0,0 +1,42 @@ +{ + "name": "todomvc-react", + "version": "1.0.0", + "description": "A TodoMVC written in React.", + "private": true, + "engines": { + "node": ">=18.13.0", + "npm": ">=8.19.3" + }, + "scripts": { + "build": "webpack --config webpack.prod.js", + "dev": "webpack serve --open --config webpack.dev.js", + "serve": "http-server ./dist -p 7002 -c-1 --cors", + "test": "jest" + }, + "devDependencies": { + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", + "@babel/preset-react": "^7.23.3", + "babel-loader": "^9.1.3", + "babel-plugin-istanbul": "^6.1.1", + "css-loader": "^6.10.0", + "css-minimizer-webpack-plugin": "^4.2.2", + "eslint-plugin-react": "^7.34.0", + "html-webpack-plugin": "^5.6.0", + "http-server": "^14.1.1", + "mini-css-extract-plugin": "^2.8.1", + "style-loader": "^3.3.4", + "webpack": "^5.90.3", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^4.15.1", + "webpack-merge": "^5.10.0" + }, + "dependencies": { + "classnames": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-router-dom": "^6.22.2", + "todomvc-app-css": "^2.4.3", + "todomvc-common": "^1.0.5" + } +} diff --git a/examples/todomvc-react/public/index.html b/examples/todomvc-react/public/index.html new file mode 100644 index 00000000..ca4cc7a7 --- /dev/null +++ b/examples/todomvc-react/public/index.html @@ -0,0 +1,18 @@ + + + + + + + + TodoMVC: React + + +
+ + + diff --git a/examples/todomvc-react/src/index.js b/examples/todomvc-react/src/index.js new file mode 100644 index 00000000..9c929424 --- /dev/null +++ b/examples/todomvc-react/src/index.js @@ -0,0 +1,15 @@ +import React from "react"; +import { render } from "react-dom"; +import { HashRouter, Route, Routes } from "react-router-dom"; + +import { App } from "./todo/app"; +import "todomvc-app-css/index.css"; + +render( + + + } /> + + , + document.getElementById("root") +); diff --git a/examples/todomvc-react/src/todo/app.css b/examples/todomvc-react/src/todo/app.css new file mode 100644 index 00000000..bfa6617e --- /dev/null +++ b/examples/todomvc-react/src/todo/app.css @@ -0,0 +1,24 @@ +/* used for things that should be hidden in the ui, +but useful for people who use screen readers */ +.visually-hidden { + border: 0; + clip: rect(0 0 0 0); + clip-path: inset(50%); + height: 1px; + width: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + position: absolute; + white-space: nowrap; +} + +.toggle-all { + width: 40px !important; + height: 60px !important; + right: auto !important; +} + +.toggle-all-label { + pointer-events: none; +} diff --git a/examples/todomvc-react/src/todo/app.jsx b/examples/todomvc-react/src/todo/app.jsx new file mode 100644 index 00000000..4ae2b60d --- /dev/null +++ b/examples/todomvc-react/src/todo/app.jsx @@ -0,0 +1,20 @@ +import { useReducer } from "react"; +import { Header } from "./components/header"; +import { Main } from "./components/main"; +import { Footer } from "./components/footer"; + +import { todoReducer } from "./reducer"; + +import "./app.css"; + +export function App() { + const [todos, dispatch] = useReducer(todoReducer, []); + + return ( + <> +
+
+