@celljs/cli 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/bin/cell +2 -0
- package/lib/build/build-manager.d.ts +9 -0
- package/lib/build/build-manager.d.ts.map +1 -0
- package/lib/build/build-manager.js +41 -0
- package/lib/build/build-manager.js.map +1 -0
- package/lib/build/build.d.ts +6 -0
- package/lib/build/build.d.ts.map +1 -0
- package/lib/build/build.js +16 -0
- package/lib/build/build.js.map +1 -0
- package/lib/cell-main.d.ts +2 -0
- package/lib/cell-main.d.ts.map +1 -0
- package/lib/cell-main.js +110 -0
- package/lib/cell-main.js.map +1 -0
- package/lib/cell.d.ts +2 -0
- package/lib/cell.d.ts.map +1 -0
- package/lib/cell.js +190 -0
- package/lib/cell.js.map +1 -0
- package/lib/config/config.d.ts +12 -0
- package/lib/config/config.d.ts.map +1 -0
- package/lib/config/config.js +48 -0
- package/lib/config/config.js.map +1 -0
- package/lib/deploy/deploy.d.ts +7 -0
- package/lib/deploy/deploy.d.ts.map +1 -0
- package/lib/deploy/deploy.js +27 -0
- package/lib/deploy/deploy.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/info/info.d.ts +6 -0
- package/lib/info/info.d.ts.map +1 -0
- package/lib/info/info.js +21 -0
- package/lib/info/info.js.map +1 -0
- package/lib/init/init-manager.d.ts +33 -0
- package/lib/init/init-manager.d.ts.map +1 -0
- package/lib/init/init-manager.js +138 -0
- package/lib/init/init-manager.js.map +1 -0
- package/lib/init/init.d.ts +4 -0
- package/lib/init/init.d.ts.map +1 -0
- package/lib/init/init.js +17 -0
- package/lib/init/init.js.map +1 -0
- package/lib/init/templates.d.ts +2 -0
- package/lib/init/templates.d.ts.map +1 -0
- package/lib/init/templates.js +25 -0
- package/lib/init/templates.js.map +1 -0
- package/lib/malagu-main.d.ts +2 -0
- package/lib/malagu-main.d.ts.map +1 -0
- package/lib/malagu-main.js +110 -0
- package/lib/malagu-main.js.map +1 -0
- package/lib/malagu.d.ts +2 -0
- package/lib/malagu.d.ts.map +1 -0
- package/lib/malagu.js +190 -0
- package/lib/malagu.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +4 -0
- package/lib/package.spec.js.map +1 -0
- package/lib/props/props.d.ts +9 -0
- package/lib/props/props.d.ts.map +1 -0
- package/lib/props/props.js +46 -0
- package/lib/props/props.js.map +1 -0
- package/lib/serve/serve-manager.d.ts +8 -0
- package/lib/serve/serve-manager.d.ts.map +1 -0
- package/lib/serve/serve-manager.js +44 -0
- package/lib/serve/serve-manager.js.map +1 -0
- package/lib/serve/serve.d.ts +7 -0
- package/lib/serve/serve.d.ts.map +1 -0
- package/lib/serve/serve.js +16 -0
- package/lib/serve/serve.js.map +1 -0
- package/lib/update/update.d.ts +9 -0
- package/lib/update/update.d.ts.map +1 -0
- package/lib/update/update.js +56 -0
- package/lib/update/update.js.map +1 -0
- package/lib/utils/banner-util.d.ts +6 -0
- package/lib/utils/banner-util.d.ts.map +1 -0
- package/lib/utils/banner-util.js +44 -0
- package/lib/utils/banner-util.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +18 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +63 -0
- package/src/build/build-manager.ts +50 -0
- package/src/build/build.ts +17 -0
- package/src/cell-main.ts +125 -0
- package/src/cell.ts +214 -0
- package/src/config/config.ts +56 -0
- package/src/deploy/deploy.ts +31 -0
- package/src/index.ts +0 -0
- package/src/info/info.ts +23 -0
- package/src/init/init-manager.ts +163 -0
- package/src/init/init.ts +15 -0
- package/src/init/templates.ts +21 -0
- package/src/package.spec.ts +4 -0
- package/src/props/props.ts +48 -0
- package/src/serve/serve-manager.ts +51 -0
- package/src/serve/serve.ts +19 -0
- package/src/update/update.ts +61 -0
- package/src/utils/banner-util.ts +41 -0
- package/src/utils/index.ts +1 -0
- package/templates/accounts/README.md +92 -0
- package/templates/accounts/cell-database.yml +17 -0
- package/templates/accounts/cell-locale.yml +17 -0
- package/templates/accounts/cell-oauth2.0.yml +8 -0
- package/templates/accounts/cell-theme.yml +9 -0
- package/templates/accounts/cell.yml +10 -0
- package/templates/accounts/favicon.ico +0 -0
- package/templates/accounts/package.json +48 -0
- package/templates/accounts/src/browser/home.view.tsx +86 -0
- package/templates/accounts/src/browser/index.ts +3 -0
- package/templates/accounts/src/browser/login.view.tsx +78 -0
- package/templates/accounts/src/browser/module.ts +3 -0
- package/templates/accounts/src/common/entity-protocol.ts +7 -0
- package/templates/accounts/src/common/index.ts +1 -0
- package/templates/accounts/src/node/authentication/authentication-success-handler.ts +69 -0
- package/templates/accounts/src/node/authentication/index.ts +1 -0
- package/templates/accounts/src/node/entity/base-entity.ts +13 -0
- package/templates/accounts/src/node/entity/connection.ts +52 -0
- package/templates/accounts/src/node/entity/index.ts +1 -0
- package/templates/accounts/src/node/entity/user.ts +73 -0
- package/templates/accounts/src/node/error/error.ts +14 -0
- package/templates/accounts/src/node/error/index.ts +1 -0
- package/templates/accounts/src/node/index.ts +2 -0
- package/templates/accounts/src/node/module.ts +9 -0
- package/templates/accounts/src/node/user/index.ts +4 -0
- package/templates/accounts/src/node/user/user-protocol.ts +19 -0
- package/templates/accounts/src/node/user/user-repository.ts +72 -0
- package/templates/accounts/src/node/user/user-service.ts +36 -0
- package/templates/accounts/tsconfig.json +29 -0
- package/templates/admin-app/.github/workflows/deploy.yml +25 -0
- package/templates/admin-app/.vscode/launch.json +23 -0
- package/templates/admin-app/README.md +92 -0
- package/templates/admin-app/cell-database.yml +7 -0
- package/templates/admin-app/cell.yml +93 -0
- package/templates/admin-app/package.json +37 -0
- package/templates/admin-app/src/browser/module.ts +3 -0
- package/templates/admin-app/src/browser/user.view.tsx +40 -0
- package/templates/admin-app/src/common/index.ts +1 -0
- package/templates/admin-app/src/common/user-protocol.ts +23 -0
- package/templates/admin-app/src/node/entity/index.ts +1 -0
- package/templates/admin-app/src/node/entity/user.ts +15 -0
- package/templates/admin-app/src/node/module.ts +8 -0
- package/templates/admin-app/src/node/user-service.ts +41 -0
- package/templates/admin-app/tsconfig.json +29 -0
- package/templates/backend-app/.github/workflows/deploy.yml +25 -0
- package/templates/backend-app/.vscode/launch.json +23 -0
- package/templates/backend-app/README.md +92 -0
- package/templates/backend-app/cell.yml +0 -0
- package/templates/backend-app/package.json +33 -0
- package/templates/backend-app/src/home-controller.ts +11 -0
- package/templates/backend-app/src/module.ts +4 -0
- package/templates/backend-app/src/user-controller.ts +48 -0
- package/templates/backend-app/test/home-controller.spec.ts +16 -0
- package/templates/backend-app/tsconfig.json +29 -0
- package/templates/cell-component/.eslintrc.js +10 -0
- package/templates/cell-component/README.md +36 -0
- package/templates/cell-component/cell.yml +0 -0
- package/templates/cell-component/package.json +29 -0
- package/templates/cell-component/src/echo-service.ts +16 -0
- package/templates/cell-component/src/index.ts +1 -0
- package/templates/cell-component/src/module.ts +4 -0
- package/templates/cell-component/src/package.spec.ts +4 -0
- package/templates/cell-component/tsconfig.json +11 -0
- package/templates/database-app/.github/workflows/deploy.yml +25 -0
- package/templates/database-app/.vscode/launch.json +23 -0
- package/templates/database-app/README.md +92 -0
- package/templates/database-app/cell.yml +17 -0
- package/templates/database-app/package.json +31 -0
- package/templates/database-app/src/entity/index.ts +1 -0
- package/templates/database-app/src/entity/user.ts +13 -0
- package/templates/database-app/src/home-controller.ts +11 -0
- package/templates/database-app/src/module.ts +8 -0
- package/templates/database-app/src/user-controller.ts +43 -0
- package/templates/database-app/tsconfig.json +29 -0
- package/templates/docker-app/.github/workflows/deploy.yml +25 -0
- package/templates/docker-app/.vscode/launch.json +23 -0
- package/templates/docker-app/Dockerfile +27 -0
- package/templates/docker-app/README.md +93 -0
- package/templates/docker-app/cell.yml +0 -0
- package/templates/docker-app/package.json +31 -0
- package/templates/docker-app/src/browser/assets/logo.png +0 -0
- package/templates/docker-app/src/browser/css-shims.d.ts +30 -0
- package/templates/docker-app/src/browser/hello.view.tsx +31 -0
- package/templates/docker-app/src/browser/module.ts +3 -0
- package/templates/docker-app/src/browser/style/hello.module.scss +4 -0
- package/templates/docker-app/src/common/welcome-protocol.ts +5 -0
- package/templates/docker-app/src/node/module.ts +3 -0
- package/templates/docker-app/src/node/welcome-server.ts +9 -0
- package/templates/docker-app/tsconfig.json +30 -0
- package/templates/file-service/.github/workflows/deploy.yml +25 -0
- package/templates/file-service/.vscode/launch.json +23 -0
- package/templates/file-service/README.md +92 -0
- package/templates/file-service/cell.yml +12 -0
- package/templates/file-service/package.json +34 -0
- package/templates/file-service/src/file-controller.ts +47 -0
- package/templates/file-service/src/home-controller.ts +11 -0
- package/templates/file-service/src/module.ts +5 -0
- package/templates/file-service/tsconfig.json +29 -0
- package/templates/jwt-app/.github/workflows/deploy.yml +25 -0
- package/templates/jwt-app/.vscode/launch.json +23 -0
- package/templates/jwt-app/README.md +92 -0
- package/templates/jwt-app/cell.yml +4 -0
- package/templates/jwt-app/package.json +36 -0
- package/templates/jwt-app/src/context.ts +16 -0
- package/templates/jwt-app/src/error-handler.ts +30 -0
- package/templates/jwt-app/src/error.ts +4 -0
- package/templates/jwt-app/src/home-controller.ts +23 -0
- package/templates/jwt-app/src/index.ts +5 -0
- package/templates/jwt-app/src/jwt-middleware.ts +36 -0
- package/templates/jwt-app/src/module.ts +3 -0
- package/templates/jwt-app/test/home-controller.spec.ts +16 -0
- package/templates/jwt-app/tsconfig.json +29 -0
- package/templates/koa-app/app.js +8 -0
- package/templates/koa-app/package.json +9 -0
- package/templates/microservice/.github/workflows/deploy.yml +28 -0
- package/templates/microservice/.vscode/launch.json +24 -0
- package/templates/microservice/README.md +92 -0
- package/templates/microservice/examples/backend-app/README.md +92 -0
- package/templates/microservice/examples/backend-app/cell-remote.yml +4 -0
- package/templates/microservice/examples/backend-app/cell.yml +3 -0
- package/templates/microservice/examples/backend-app/package.json +32 -0
- package/templates/microservice/examples/backend-app/src/api-controller.ts +31 -0
- package/templates/microservice/examples/backend-app/src/module.ts +3 -0
- package/templates/microservice/examples/backend-app/tsconfig.json +29 -0
- package/templates/microservice/lerna.json +19 -0
- package/templates/microservice/package.json +23 -0
- package/templates/microservice/packages/api/README.md +92 -0
- package/templates/microservice/packages/api/cell.yml +0 -0
- package/templates/microservice/packages/api/package.json +25 -0
- package/templates/microservice/packages/api/src/common/api-protocol.ts +10 -0
- package/templates/microservice/packages/api/src/common/index.ts +1 -0
- package/templates/microservice/packages/api/tsconfig.json +27 -0
- package/templates/microservice/packages/serviceA/.vscode/launch.json +23 -0
- package/templates/microservice/packages/serviceA/README.md +92 -0
- package/templates/microservice/packages/serviceA/cell.yml +6 -0
- package/templates/microservice/packages/serviceA/package.json +29 -0
- package/templates/microservice/packages/serviceA/src/node/module.ts +3 -0
- package/templates/microservice/packages/serviceA/src/node/service-a.ts +9 -0
- package/templates/microservice/packages/serviceA/tsconfig.json +27 -0
- package/templates/microservice/packages/serviceB/README.md +92 -0
- package/templates/microservice/packages/serviceB/cell.yml +5 -0
- package/templates/microservice/packages/serviceB/package.json +29 -0
- package/templates/microservice/packages/serviceB/src/node/module.ts +3 -0
- package/templates/microservice/packages/serviceB/src/node/service-b.ts +9 -0
- package/templates/microservice/packages/serviceB/tsconfig.json +27 -0
- package/templates/microservice/tsconfig.json +29 -0
- package/templates/monorepo/.editorconfig +12 -0
- package/templates/monorepo/.eslintrc.js +18 -0
- package/templates/monorepo/.yarnrc +1 -0
- package/templates/monorepo/CHANGELOG.md +5 -0
- package/templates/monorepo/README.md +0 -0
- package/templates/monorepo/apps/sample-app/cell.yml +0 -0
- package/templates/monorepo/apps/sample-app/package.json +33 -0
- package/templates/monorepo/apps/sample-app/src/browser/assets/logo.png +0 -0
- package/templates/monorepo/apps/sample-app/src/browser/css-shims.d.ts +30 -0
- package/templates/monorepo/apps/sample-app/src/browser/hello.view.tsx +31 -0
- package/templates/monorepo/apps/sample-app/src/browser/module.ts +3 -0
- package/templates/monorepo/apps/sample-app/src/browser/style/hello.module.scss +4 -0
- package/templates/monorepo/apps/sample-app/src/common/welcome-protocol.ts +5 -0
- package/templates/monorepo/apps/sample-app/src/node/module.ts +3 -0
- package/templates/monorepo/apps/sample-app/src/node/welcome-server.ts +9 -0
- package/templates/monorepo/apps/sample-app/tsconfig.json +30 -0
- package/templates/monorepo/configs/root-compilation.tsconfig.json +14 -0
- package/templates/monorepo/configs/typedoc-tsconfig.json +6 -0
- package/templates/monorepo/configs/typedoc.json +23 -0
- package/templates/monorepo/lerna.json +17 -0
- package/templates/monorepo/package.json +46 -0
- package/templates/monorepo/packages/core/.eslintrc.js +10 -0
- package/templates/monorepo/packages/core/README.md +1 -0
- package/templates/monorepo/packages/core/cell.yml +0 -0
- package/templates/monorepo/packages/core/compile.tsconfig.json +13 -0
- package/templates/monorepo/packages/core/package.json +40 -0
- package/templates/monorepo/packages/core/src/browser/index.ts +0 -0
- package/templates/monorepo/packages/core/src/browser/module.ts +4 -0
- package/templates/monorepo/packages/core/src/common/index.ts +0 -0
- package/templates/monorepo/packages/core/src/common/module.ts +4 -0
- package/templates/monorepo/packages/core/src/node/index.ts +0 -0
- package/templates/monorepo/packages/core/src/node/module.ts +4 -0
- package/templates/monorepo/packages/core/src/package.spec.ts +4 -0
- package/templates/monorepo/scripts/check-publish.js +40 -0
- package/templates/monorepo/scripts/compile-references.js +286 -0
- package/templates/monorepo/tsconfig.json +20 -0
- package/templates/monorepo/tsfmt.json +3 -0
- package/templates/mycli/.vscode/launch.json +33 -0
- package/templates/mycli/bin/mycli +2 -0
- package/templates/mycli/bin/mycli-deploy +2 -0
- package/templates/mycli/bin/mycli-init +2 -0
- package/templates/mycli/package.json +33 -0
- package/templates/mycli/src/bootstrap.ts +7 -0
- package/templates/mycli/src/constants.ts +1 -0
- package/templates/mycli/src/deploy/deploy-manager.ts +12 -0
- package/templates/mycli/src/deploy/deploy.ts +16 -0
- package/templates/mycli/src/deploy/index.ts +1 -0
- package/templates/mycli/src/index.ts +2 -0
- package/templates/mycli/src/init/index.ts +1 -0
- package/templates/mycli/src/init/init-manager.ts +85 -0
- package/templates/mycli/src/init/init.ts +25 -0
- package/templates/mycli/src/init/templates.ts +3 -0
- package/templates/mycli/src/module.ts +3 -0
- package/templates/mycli/src/mycli.ts +13 -0
- package/templates/mycli/templates/application-template/README.md +0 -0
- package/templates/mycli/tsconfig.json +29 -0
- package/templates/nest-app/.eslintrc.js +25 -0
- package/templates/nest-app/.prettierrc +4 -0
- package/templates/nest-app/README.md +73 -0
- package/templates/nest-app/nest-cli.json +8 -0
- package/templates/nest-app/package.json +69 -0
- package/templates/nest-app/src/app.controller.spec.ts +22 -0
- package/templates/nest-app/src/app.controller.ts +12 -0
- package/templates/nest-app/src/app.module.ts +10 -0
- package/templates/nest-app/src/app.service.ts +8 -0
- package/templates/nest-app/src/main.ts +8 -0
- package/templates/nest-app/test/app.e2e-spec.ts +24 -0
- package/templates/nest-app/test/jest-e2e.json +9 -0
- package/templates/nest-app/tsconfig.build.json +4 -0
- package/templates/nest-app/tsconfig.json +21 -0
- package/templates/nextjs-app/.eslintrc.json +3 -0
- package/templates/nextjs-app/README.md +34 -0
- package/templates/nextjs-app/next.config.js +6 -0
- package/templates/nextjs-app/package.json +20 -0
- package/templates/nextjs-app/pages/_app.js +7 -0
- package/templates/nextjs-app/pages/api/hello.js +5 -0
- package/templates/nextjs-app/pages/index.js +69 -0
- package/templates/nextjs-app/public/favicon.ico +0 -0
- package/templates/nextjs-app/public/vercel.svg +4 -0
- package/templates/nextjs-app/styles/Home.module.css +116 -0
- package/templates/nextjs-app/styles/globals.css +16 -0
- package/templates/puppeteer/.github/workflows/deploy.yml +25 -0
- package/templates/puppeteer/.vscode/launch.json +23 -0
- package/templates/puppeteer/README.md +92 -0
- package/templates/puppeteer/cell.yml +11 -0
- package/templates/puppeteer/package.json +31 -0
- package/templates/puppeteer/src/home-controller.ts +11 -0
- package/templates/puppeteer/src/module.ts +5 -0
- package/templates/puppeteer/src/puppeteer-controller.ts +26 -0
- package/templates/puppeteer/tsconfig.json +29 -0
- package/templates/sample-app/.github/workflows/deploy.yml +25 -0
- package/templates/sample-app/.vscode/launch.json +23 -0
- package/templates/sample-app/README.md +92 -0
- package/templates/sample-app/cell.yml +0 -0
- package/templates/sample-app/package.json +31 -0
- package/templates/sample-app/src/browser/assets/logo.png +0 -0
- package/templates/sample-app/src/browser/css-shims.d.ts +30 -0
- package/templates/sample-app/src/browser/hello.view.tsx +31 -0
- package/templates/sample-app/src/browser/module.ts +3 -0
- package/templates/sample-app/src/browser/style/hello.module.scss +4 -0
- package/templates/sample-app/src/common/welcome-protocol.ts +5 -0
- package/templates/sample-app/src/node/module.ts +3 -0
- package/templates/sample-app/src/node/welcome-server.ts +9 -0
- package/templates/sample-app/tsconfig.json +29 -0
- package/templates/schedule/.github/workflows/deploy.yml +25 -0
- package/templates/schedule/.vscode/launch.json +23 -0
- package/templates/schedule/README.md +92 -0
- package/templates/schedule/cell.yml +1 -0
- package/templates/schedule/package.json +29 -0
- package/templates/schedule/src/module.ts +3 -0
- package/templates/schedule/src/scheduler.ts +10 -0
- package/templates/schedule/tsconfig.json +29 -0
- package/templates/standalone-app/package.json +17 -0
- package/templates/standalone-app/src/app.service.ts +10 -0
- package/templates/standalone-app/src/main.ts +14 -0
- package/templates/standalone-app/src/module.ts +3 -0
- package/templates/standalone-app/tsconfig.json +27 -0
- package/templates/vue-app/.github/workflows/deploy.yml +25 -0
- package/templates/vue-app/.vscode/launch.json +23 -0
- package/templates/vue-app/README.md +92 -0
- package/templates/vue-app/cell.yml +0 -0
- package/templates/vue-app/package.json +32 -0
- package/templates/vue-app/src/browser/App.vue +32 -0
- package/templates/vue-app/src/browser/app.ts +7 -0
- package/templates/vue-app/src/browser/components/HelloWorld.vue +42 -0
- package/templates/vue-app/src/browser/declare.d.ts +7 -0
- package/templates/vue-app/src/browser/images/logo.png +0 -0
- package/templates/vue-app/src/browser/module.ts +3 -0
- package/templates/vue-app/src/browser/router.ts +13 -0
- package/templates/vue-app/src/browser/shims-vue.d.ts +5 -0
- package/templates/vue-app/src/browser/views/About.vue +5 -0
- package/templates/vue-app/src/browser/views/Root.vue +37 -0
- package/templates/vue-app/src/common/welcome-protocol.ts +5 -0
- package/templates/vue-app/src/node/module.ts +3 -0
- package/templates/vue-app/src/node/welcome-server.ts +9 -0
- package/templates/vue-app/tsconfig.json +30 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# 开发说明
|
|
2
|
+
|
|
3
|
+
## 安装依赖
|
|
4
|
+
|
|
5
|
+
以下使用 yarn 工具来说明,你也可以使用 npm。
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 通过 cell init 初始化应用的时候已经自动安装了依赖,所以你只需要安装你额外需要的依赖即可
|
|
9
|
+
|
|
10
|
+
$ yarn add xxxx
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 本地运行
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
# 启动本地服务,端口默认 3000
|
|
17
|
+
# 在终端中会输出本地服务的 URL 链接
|
|
18
|
+
|
|
19
|
+
$ yarn start # 或者执行 cell serve 命令
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 构建部署
|
|
23
|
+
|
|
24
|
+
模板默认提供了四套隔离环境:本地(local)、测试(test)、预发(pre)、线上(prod)。每个环境对应着一个 cell 配置文件(可选),类似 cell-test.yml。而 cell.yml 文件一般用于放所有环境的公共配置。第一次部署的时候可能会提示你填写相关云厂商 ak 信息。如果是 Vercel 云平台的模板,会提示你需要登录到 Vercel 平台。你也可以在项目通过 .env 提供云厂商的 ak 信息。
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
|
|
28
|
+
$ cell deploy -m scf # 部署到腾讯云函数测试环境
|
|
29
|
+
$ cell deploy -m scf -m test # 部署到腾讯云测试环境
|
|
30
|
+
$ cell deploy -m scf -m pre # 部署到腾讯云预发环境
|
|
31
|
+
$ cell deploy -m scf -m prod # 部署到腾讯云线上环境
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 关于 Cell Framework
|
|
36
|
+
|
|
37
|
+
Cell 是基于 TypeScript 的 Serverless First、组件化、平台无关的渐进式应用框架。
|
|
38
|
+
|
|
39
|
+
## 特征
|
|
40
|
+
|
|
41
|
+
- 约定大于配置,零配置,开箱即用
|
|
42
|
+
- TypeScript 版 Spring Boot
|
|
43
|
+
- Serverless First
|
|
44
|
+
- 平台不锁定
|
|
45
|
+
- 支持前后端一体化,前端框架不锁定
|
|
46
|
+
- 支持微服务
|
|
47
|
+
- 组件化,渐进式
|
|
48
|
+
- 命令行工具插件化
|
|
49
|
+
- 依赖注入
|
|
50
|
+
- 面向切面编程(AOP)
|
|
51
|
+
- 集成了流行的 ORM 框架,使用装饰器声明式事务管理
|
|
52
|
+
- 支持 OIDC 认证
|
|
53
|
+
- 支持 OAuth2 授权
|
|
54
|
+
- 使用 rxjs 管理状态
|
|
55
|
+
- 提供 REST 和 RPC 两种接口风格
|
|
56
|
+
|
|
57
|
+
Cell 名字由来:在我的家乡,谐音“吗啦咕”是小石头的意思,小石头堆砌起来可以建成高楼大厦、道路桥梁,而 Cell 组件编排可以实现千变万化的应用。
|
|
58
|
+
|
|
59
|
+
## 快速开始
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# 安装命令行工具
|
|
63
|
+
npm install -g @celljs/cli
|
|
64
|
+
|
|
65
|
+
# 初始化
|
|
66
|
+
cell init -o project-name
|
|
67
|
+
cd project-name # 进入项目根目录
|
|
68
|
+
|
|
69
|
+
# 运行
|
|
70
|
+
cell serve
|
|
71
|
+
|
|
72
|
+
# 部署
|
|
73
|
+
cell deploy
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
[](https://asciinema.org/a/474104?speed=2.5&autoplay=1)
|
|
77
|
+
|
|
78
|
+
### 文档
|
|
79
|
+
|
|
80
|
+
- [介绍](https://cell.cellbang.com/guide/%E4%BB%8B%E7%BB%8D)
|
|
81
|
+
- [创建第一个应用](https://cell.cellbang.com/guide/%E5%88%9B%E5%BB%BA%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%BA%94%E7%94%A8)
|
|
82
|
+
- [命令行工具](https://cell.cellbang.com/guide/%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7)
|
|
83
|
+
- [控制器](https://cell.cellbang.com/guide/%E6%8E%A7%E5%88%B6%E5%99%A8)
|
|
84
|
+
- [数据库操作](https://cell.cellbang.com/guide/%E6%95%B0%E6%8D%AE%E5%BA%93typeorm)
|
|
85
|
+
- [微服务](https://cell.cellbang.com/dev/%E5%BE%AE%E6%9C%8D%E5%8A%A1)
|
|
86
|
+
- [认证与授权](https://cell.cellbang.com/guide/%E8%AE%A4%E8%AF%81%E4%B8%8E%E6%8E%88%E6%9D%83)
|
|
87
|
+
- [云平台适配](https://cell.cellbang.com/cloud/%E4%BA%91%E5%B9%B3%E5%8F%B0%E9%80%82%E9%85%8D)
|
|
88
|
+
- [依赖注入](https://cell.cellbang.com/guide/%E4%BE%9D%E8%B5%96%E6%B3%A8%E5%85%A5)
|
|
89
|
+
- [组件设计](https://cell.cellbang.com/guide/%E7%BB%84%E4%BB%B6%E8%AE%BE%E8%AE%A1)
|
|
90
|
+
- [前端架构](https://cell.cellbang.com/guide/%E5%89%8D%E7%AB%AF%E6%9E%B6%E6%9E%84)
|
|
91
|
+
- [React 开发](https://cell.cellbang.com/dev/react)
|
|
92
|
+
- [前后端一体化开发](https://cell.cellbang.com/dev/%E5%89%8D%E5%90%8E%E7%AB%AF%E4%B8%80%E4%BD%93%E5%8C%96%E5%BC%80%E5%8F%91)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microservice/service-b",
|
|
3
|
+
"keywords": [
|
|
4
|
+
"cell-component"
|
|
5
|
+
],
|
|
6
|
+
"version": "0.0.0",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@celljs/core": "{{ version }}",
|
|
14
|
+
"@celljs/rpc": "{{ version }}",
|
|
15
|
+
"@microservice/api": "0.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@celljs/cli": "{{ version }}"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"clean": "rimraf lib dist .cell",
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"start": "cell serve",
|
|
24
|
+
"deploy": "cell deploy -m scf -m test",
|
|
25
|
+
"deploy:test": "cell deploy -m scf -m test",
|
|
26
|
+
"deploy:pre": "cell deploy -m scf -m pre",
|
|
27
|
+
"deploy:prod": "cell deploy -m scf -m prod"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"skipLibCheck": true,
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"noImplicitAny": true,
|
|
7
|
+
"noEmitOnError": false,
|
|
8
|
+
"noImplicitThis": true,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"emitDecoratorMetadata": true,
|
|
13
|
+
"downlevelIteration": true,
|
|
14
|
+
"module": "commonjs",
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"target": "ES2017",
|
|
17
|
+
"lib": [
|
|
18
|
+
"ES2017"
|
|
19
|
+
],
|
|
20
|
+
"sourceMap": true,
|
|
21
|
+
"rootDir": "src",
|
|
22
|
+
"outDir": "lib"
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"src"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"skipLibCheck": true,
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"noImplicitAny": true,
|
|
7
|
+
"noEmitOnError": false,
|
|
8
|
+
"noImplicitThis": true,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"emitDecoratorMetadata": true,
|
|
13
|
+
"downlevelIteration": true,
|
|
14
|
+
"module": "commonjs",
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"jsx": "react",
|
|
17
|
+
"target": "ES2017",
|
|
18
|
+
"lib": [
|
|
19
|
+
"ES2017",
|
|
20
|
+
"dom"
|
|
21
|
+
],
|
|
22
|
+
"sourceMap": true,
|
|
23
|
+
"rootDir": "src",
|
|
24
|
+
"outDir": "lib"
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @type {import('eslint').Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
root: true,
|
|
4
|
+
extends: [
|
|
5
|
+
require.resolve('@celljs/component/configs/base.eslintrc.json'),
|
|
6
|
+
require.resolve('@celljs/component/configs/warnings.eslintrc.json'),
|
|
7
|
+
require.resolve('@celljs/component/configs/errors.eslintrc.json'),
|
|
8
|
+
require.resolve('@celljs/component/configs/xss.eslintrc.json')
|
|
9
|
+
],
|
|
10
|
+
ignorePatterns: [
|
|
11
|
+
'**/{node_modules,lib}',
|
|
12
|
+
'plugins'
|
|
13
|
+
],
|
|
14
|
+
parserOptions: {
|
|
15
|
+
tsconfigRootDir: __dirname,
|
|
16
|
+
project: 'tsconfig.json'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
unsafe-disable-integrity-migration true
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "@app/sample-app",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"cell-component"
|
|
6
|
+
],
|
|
7
|
+
"version": "0.0.0",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@celljs/core": "2.42.0",
|
|
15
|
+
"@celljs/react": "2.42.0",
|
|
16
|
+
"@celljs/rpc": "2.42.0",
|
|
17
|
+
"@celljs/serve-static": "2.42.0",
|
|
18
|
+
"react": "^18.2.0",
|
|
19
|
+
"@app/core": "0.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@celljs/cli": "2.42.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"clean": "rimraf lib dist .cell",
|
|
26
|
+
"build": "cell build",
|
|
27
|
+
"start": "cell serve",
|
|
28
|
+
"deploy": "cell deploy -m scf -m test",
|
|
29
|
+
"deploy:test": "cell deploy -m scf -m test",
|
|
30
|
+
"deploy:pre": "cell deploy -m scf -m pre",
|
|
31
|
+
"deploy:prod": "cell deploy -m scf -m prod"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare module '*.css' {
|
|
2
|
+
const styles: {
|
|
3
|
+
[key: string]: string
|
|
4
|
+
}
|
|
5
|
+
export default styles
|
|
6
|
+
}
|
|
7
|
+
declare module '*.scss' {
|
|
8
|
+
const styles: {
|
|
9
|
+
[key: string]: string
|
|
10
|
+
}
|
|
11
|
+
export default styles
|
|
12
|
+
}
|
|
13
|
+
declare module '*.sass' {
|
|
14
|
+
const styles: {
|
|
15
|
+
[key: string]: string
|
|
16
|
+
}
|
|
17
|
+
export default styles
|
|
18
|
+
}
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const styles: {
|
|
21
|
+
[key: string]: string
|
|
22
|
+
}
|
|
23
|
+
export default styles
|
|
24
|
+
}
|
|
25
|
+
declare module '*.styl' {
|
|
26
|
+
const styles: {
|
|
27
|
+
[key: string]: string
|
|
28
|
+
}
|
|
29
|
+
export default styles
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RpcUtil } from '@celljs/rpc/lib/common';
|
|
3
|
+
import { WelcomeServer } from '../common/welcome-protocol';
|
|
4
|
+
import { View } from '@celljs/react';
|
|
5
|
+
import styles from './style/hello.module.scss';
|
|
6
|
+
|
|
7
|
+
const Hello = () => {
|
|
8
|
+
const [ response, setResponse ] = React.useState('Loading');
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const welcomeServer = RpcUtil.get<WelcomeServer>(WelcomeServer);
|
|
11
|
+
const init = async () => {
|
|
12
|
+
setResponse(await welcomeServer.say());
|
|
13
|
+
}
|
|
14
|
+
init();
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
return <div className={ styles.hello }>
|
|
18
|
+
<img alt="cell logo" src="./assets/logo.png"></img>
|
|
19
|
+
<div className="hello">
|
|
20
|
+
<h1>{response}</h1>
|
|
21
|
+
<p>
|
|
22
|
+
For a guide and recipes on how to configure / customize this project,<br />
|
|
23
|
+
check out the <a href="https://cell.cellbang.com/" target="_blank" rel="noopener">cell documentation</a>.
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@View({ index: true, component: Hello })
|
|
31
|
+
export default class {}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"skipLibCheck": true,
|
|
4
|
+
"esModuleInterop": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"noImplicitAny": true,
|
|
8
|
+
"noEmitOnError": false,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"noUnusedLocals": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"emitDecoratorMetadata": true,
|
|
14
|
+
"downlevelIteration": true,
|
|
15
|
+
"module": "commonjs",
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"jsx": "react",
|
|
18
|
+
"target": "ES2017",
|
|
19
|
+
"lib": [
|
|
20
|
+
"ES2017",
|
|
21
|
+
"dom"
|
|
22
|
+
],
|
|
23
|
+
"sourceMap": true,
|
|
24
|
+
"rootDir": "src",
|
|
25
|
+
"outDir": "lib"
|
|
26
|
+
},
|
|
27
|
+
"include": [
|
|
28
|
+
"src"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@celljs/component/configs/base.tsconfig.json",
|
|
3
|
+
"include": [],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"composite": true,
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "lib"
|
|
8
|
+
},
|
|
9
|
+
"references": [
|
|
10
|
+
{
|
|
11
|
+
"path": "../packages/core/compile.tsconfig.json"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emit": "none",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"ignoreCompilerErrors": true,
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"allowJs": true
|
|
8
|
+
},
|
|
9
|
+
"exclude": [
|
|
10
|
+
"../+(apps|typings|scripts)/**",
|
|
11
|
+
"../packages/*/lib/**",
|
|
12
|
+
"**/node_modules/**",
|
|
13
|
+
"**/*.tsx",
|
|
14
|
+
"**/*spec.ts"
|
|
15
|
+
],
|
|
16
|
+
"excludeExternals": true,
|
|
17
|
+
"external-modulemap": ".*\/(packages)\/([\\w\\-_]+)\/",
|
|
18
|
+
"hideGenerator": true,
|
|
19
|
+
"name": "App TypeDoc",
|
|
20
|
+
"out": "../gh-pages/docs/next",
|
|
21
|
+
"readme": "../README.md",
|
|
22
|
+
"entryPointStrategy": "expand"
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lerna": "2.2.0",
|
|
3
|
+
"npmClient": "yarn",
|
|
4
|
+
"useWorkspaces": true,
|
|
5
|
+
"version": "0.0.0",
|
|
6
|
+
"command": {
|
|
7
|
+
"run": {
|
|
8
|
+
"stream": true
|
|
9
|
+
},
|
|
10
|
+
"publish": {
|
|
11
|
+
"graphType": "all",
|
|
12
|
+
"forcePublish": true,
|
|
13
|
+
"skipGit": true,
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "monorepo",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"engines": {
|
|
6
|
+
"yarn": ">=1.7.0 <2",
|
|
7
|
+
"node": ">=16"
|
|
8
|
+
},
|
|
9
|
+
"resolutions": {
|
|
10
|
+
"**/@types/node": "18"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"lerna": "^5.6.2",
|
|
14
|
+
"typedoc": "^0.23.21",
|
|
15
|
+
"typedoc-plugin-external-module-map": "~1.3.2",
|
|
16
|
+
"typedoc-plugin-remove-references": "^0.0.6",
|
|
17
|
+
"chai": "4.3.4",
|
|
18
|
+
"chai-spies": "1.0.0",
|
|
19
|
+
"chai-string": "^1.4.0"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"bootstrap": "lerna bootstrap",
|
|
23
|
+
"prepare": "yarn run prepare:references && yarn run prepare:build",
|
|
24
|
+
"prepare:references": "node scripts/compile-references.js",
|
|
25
|
+
"prepare:build": "yarn build && yarn run lint",
|
|
26
|
+
"build": "tsc -b configs/root-compilation.tsconfig.json",
|
|
27
|
+
"watch": "tsc -b configs/root-compilation.tsconfig.json -w",
|
|
28
|
+
"clean": "yarn lint:clean && lerna run clean",
|
|
29
|
+
"build:clean": "lerna run prepare",
|
|
30
|
+
"lint": "lerna run lint",
|
|
31
|
+
"lint:clean": "rimraf .eslintcache",
|
|
32
|
+
"lint:oneshot": "node --max-old-space-size=4096 node_modules/eslint/bin/eslint.js --cache=true \"{dev-packages,packages,examples}/**/*.{ts,tsx}\"",
|
|
33
|
+
"docs": "rimraf gh-pages/docs/next && typedoc --tsconfig tsconfig.json --options configs/typedoc.json .",
|
|
34
|
+
"test": "yarn test:references && yarn test:app",
|
|
35
|
+
"test:references": "node scripts/compile-references --dry-run",
|
|
36
|
+
"test:app": "lerna run test --scope \"@app/*!(-app)\" --stream --concurrency=1",
|
|
37
|
+
"publish": "yarn && yarn test && yarn publish:latest",
|
|
38
|
+
"publish:latest": "lerna publish --exact --ignore-scripts --yes --no-push && yarn -s publish:check",
|
|
39
|
+
"publish:next": "lerna publish preminor --exact --ignore-scripts --canary --preid next --dist-tag next --no-git-reset --no-git-tag-version --no-push --ignore-scripts --yes && yarn publish:check",
|
|
40
|
+
"publish:check": "node scripts/check-publish.js"
|
|
41
|
+
},
|
|
42
|
+
"workspaces": [
|
|
43
|
+
"packages/*",
|
|
44
|
+
"apps/*"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# App - Core Component
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app/core",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/common/index.js",
|
|
6
|
+
"typings": "lib/common/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@celljs/core": "2.42.0"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cell-component"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/xxx/app.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/xxx/app/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/xxx/app",
|
|
25
|
+
"files": [
|
|
26
|
+
"lib",
|
|
27
|
+
"src",
|
|
28
|
+
"cell.yml"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"lint": "cell-component lint",
|
|
32
|
+
"build": "cell-component build",
|
|
33
|
+
"watch": "cell-component watch",
|
|
34
|
+
"clean": "cell-component clean",
|
|
35
|
+
"test": "cell-component test:js"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@celljs/component": "2.42.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|