@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_util_1 = require("@celljs/cli-common/lib/utils/config-util");
|
|
4
|
+
const js_yaml_1 = require("js-yaml");
|
|
5
|
+
const traverse = require("traverse");
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
exports.default = async (ctx, options) => {
|
|
8
|
+
try {
|
|
9
|
+
ctx.options = options;
|
|
10
|
+
let backendProps;
|
|
11
|
+
let frontendProps;
|
|
12
|
+
if (options.frontend) {
|
|
13
|
+
frontendProps = config_util_1.ConfigUtil.getFrontendConfig(ctx.cfg);
|
|
14
|
+
}
|
|
15
|
+
else if (options.backend) {
|
|
16
|
+
backendProps = config_util_1.ConfigUtil.getBackendConfig(ctx.cfg);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
frontendProps = config_util_1.ConfigUtil.getFrontendConfig(ctx.cfg);
|
|
20
|
+
backendProps = config_util_1.ConfigUtil.getBackendConfig(ctx.cfg);
|
|
21
|
+
}
|
|
22
|
+
if (frontendProps) {
|
|
23
|
+
console.log(chalk `{bold.magenta - Frontend: }`);
|
|
24
|
+
if (options.name) {
|
|
25
|
+
console.log(`${options.name}: ${traverse(frontendProps).get(options.name.split('.'))}`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
console.log((0, js_yaml_1.dump)(config_util_1.ConfigUtil.getFrontendConfig(ctx.cfg), { skipInvalid: true }));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (backendProps) {
|
|
32
|
+
console.log(chalk `{bold.magenta - Backend: }`);
|
|
33
|
+
if (options.name) {
|
|
34
|
+
console.log(`${options.name}: ${traverse(backendProps).get(options.name.split('.'))}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.log((0, js_yaml_1.dump)(config_util_1.ConfigUtil.getBackendConfig(ctx.cfg), { skipInvalid: true }));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error(error);
|
|
43
|
+
process.exit(-1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../src/props/props.ts"],"names":[],"mappings":";;AACA,0EAAsE;AACtE,qCAA+B;AAC/B,qCAAqC;AACrC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAQ/B,kBAAe,KAAK,EAAE,GAAe,EAAE,OAAqB,EAAE,EAAE;IAC5D,IAAI;QACA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QACtB,IAAI,YAAiB,CAAC;QACtB,IAAI,aAAkB,CAAC;QAEvB,IAAI,OAAO,CAAC,QAAQ,EAAE;YAClB,aAAa,GAAG,wBAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACzD;aAAM,IAAI,OAAO,CAAC,OAAO,EAAE;YACxB,YAAY,GAAG,wBAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACvD;aAAM;YACH,aAAa,GAAG,wBAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtD,YAAY,GAAG,wBAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACvD;QAED,IAAI,aAAa,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,6BAA6B,CAAC,CAAC;YAChD,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;aAC3F;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,wBAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;aACnF;SACJ;QACD,IAAI,YAAY,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,4BAA4B,CAAC,CAAC;YAC/C,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;aAC1F;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,wBAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;aAClF;SACJ;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KACpB;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CliContext } from '@celljs/cli-common/lib/context/context-protocol';
|
|
2
|
+
export declare class ServeManager {
|
|
3
|
+
protected readonly context: CliContext;
|
|
4
|
+
constructor(context: CliContext);
|
|
5
|
+
protected log(): void;
|
|
6
|
+
start(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=serve-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-manager.d.ts","sourceRoot":"","sources":["../../src/serve/serve-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAI7E,qBAAa,YAAY;IAGjB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU;gBAAnB,OAAO,EAAE,UAAU;IAG1C,SAAS,CAAC,GAAG;IAOP,KAAK;CA+Bd"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServeManager = void 0;
|
|
4
|
+
const logger_util_1 = require("@celljs/cli-common/lib/utils/logger-util");
|
|
5
|
+
const command_util_1 = require("@celljs/cli-common/lib/utils/command-util");
|
|
6
|
+
const hook_executor_1 = require("@celljs/cli-common/lib/hook/hook-executor");
|
|
7
|
+
const utils_1 = require("@celljs/cli-common/lib/utils");
|
|
8
|
+
class ServeManager {
|
|
9
|
+
constructor(context) {
|
|
10
|
+
this.context = context;
|
|
11
|
+
}
|
|
12
|
+
log() {
|
|
13
|
+
logger_util_1.LoggerUtil.printStage(this.context);
|
|
14
|
+
logger_util_1.LoggerUtil.printMode(this.context);
|
|
15
|
+
logger_util_1.LoggerUtil.printTargets(this.context);
|
|
16
|
+
logger_util_1.LoggerUtil.printComponents(this.context);
|
|
17
|
+
}
|
|
18
|
+
async start() {
|
|
19
|
+
this.log();
|
|
20
|
+
const commandRender = async (command, target) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const { cfg, port } = this.context;
|
|
23
|
+
const realPort = utils_1.ConfigUtil.getPort(cfg, target, port);
|
|
24
|
+
return command
|
|
25
|
+
.replace(/\$PATH/g, (_a = utils_1.ConfigUtil.getCellConfig(cfg, target).server) === null || _a === void 0 ? void 0 : _a.path)
|
|
26
|
+
.replace(/\$PORT/g, realPort);
|
|
27
|
+
};
|
|
28
|
+
const hookExecutor = new hook_executor_1.HookExecutor();
|
|
29
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.CompileCommand, command_util_1.CommandStage.before);
|
|
30
|
+
await hookExecutor.executeCompileHooks(this.context, hook_executor_1.HookStage.before);
|
|
31
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.CompileCommand);
|
|
32
|
+
await hookExecutor.executeCompileHooks(this.context);
|
|
33
|
+
await hookExecutor.executeCompileHooks(this.context, hook_executor_1.HookStage.after);
|
|
34
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.CompileCommand, command_util_1.CommandStage.after);
|
|
35
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.ServeCommand, command_util_1.CommandStage.before, commandRender);
|
|
36
|
+
await hookExecutor.executeServeHooks(this.context, hook_executor_1.HookStage.before);
|
|
37
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.ServeCommand, command_util_1.CommandStage.on, commandRender);
|
|
38
|
+
await hookExecutor.executeServeHooks(this.context);
|
|
39
|
+
await hookExecutor.executeServeHooks(this.context, hook_executor_1.HookStage.after);
|
|
40
|
+
await command_util_1.CommandUtil.executeCommand(this.context, command_util_1.CommandType.ServeCommand, command_util_1.CommandStage.after, commandRender);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ServeManager = ServeManager;
|
|
44
|
+
//# sourceMappingURL=serve-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-manager.js","sourceRoot":"","sources":["../../src/serve/serve-manager.ts"],"names":[],"mappings":";;;AAAA,0EAAsE;AACtE,4EAAmG;AAEnG,6EAAoF;AACpF,wDAA0D;AAE1D,MAAa,YAAY;IAErB,YACuB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAC1C,CAAC;IAES,GAAG;QACT,wBAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,wBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,wBAAU,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,wBAAU,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,KAAK;QAEP,IAAI,CAAC,GAAG,EAAE,CAAC;QAEX,MAAM,aAAa,GAAG,KAAK,EAAE,OAAe,EAAE,MAAc,EAAE,EAAE;;YAC5D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;YACnC,MAAM,QAAQ,GAAG,kBAAU,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACvD,OAAO,OAAO;iBACT,OAAO,CAAC,SAAS,EAAE,MAAA,kBAAU,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,MAAM,0CAAE,IAAI,CAAC;iBACtE,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC;QACxC,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,cAAc,EAAE,2BAAY,CAAC,MAAM,CAAC,CAAC;QAChG,MAAM,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAS,CAAC,MAAM,CAAC,CAAC;QAEvE,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,cAAc,CAAC,CAAC;QAC3E,MAAM,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErD,MAAM,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAS,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,cAAc,EAAE,2BAAY,CAAC,KAAK,CAAC,CAAC;QAE/F,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,YAAY,EAAE,2BAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7G,MAAM,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAS,CAAC,MAAM,CAAC,CAAC;QAErE,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,YAAY,EAAE,2BAAY,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACzG,MAAM,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEnD,MAAM,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAS,CAAC,KAAK,CAAC,CAAC;QACpE,MAAM,0BAAW,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,0BAAW,CAAC,YAAY,EAAE,2BAAY,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAChH,CAAC;CACJ;AA5CD,oCA4CC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CliContext } from '@celljs/cli-common/lib/context/context-protocol';
|
|
2
|
+
export interface ServeOptions {
|
|
3
|
+
port?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: (ctx: CliContext, options: ServeOptions) => Promise<void>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/serve/serve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAgB,MAAM,iDAAiD,CAAC;AAE3F,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;8BAE0B,UAAU,WAAW,YAAY;AAA5D,wBAUE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const serve_manager_1 = require("./serve-manager");
|
|
4
|
+
const context_protocol_1 = require("@celljs/cli-common/lib/context/context-protocol");
|
|
5
|
+
exports.default = async (ctx, options) => {
|
|
6
|
+
try {
|
|
7
|
+
ctx.options = options;
|
|
8
|
+
ctx = context_protocol_1.ContextUtils.mergeContext(ctx, Object.assign({ dev: true }, options));
|
|
9
|
+
await new serve_manager_1.ServeManager(ctx).start();
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error(error);
|
|
13
|
+
process.exit(-1);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/serve/serve.ts"],"names":[],"mappings":";;AACA,mDAA+C;AAC/C,sFAA2F;AAM3F,kBAAe,KAAK,EAAE,GAAe,EAAE,OAAqB,EAAE,EAAE;IAC5D,IAAI;QACA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QACtB,GAAG,GAAI,+BAAY,CAAC,YAAY,CAAC,GAAG,kBAAI,GAAG,EAAE,IAAI,IAAK,OAAO,EAAG,CAAC;QACjE,MAAM,IAAI,4BAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;KACvC;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KACpB;AAEL,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CliContext } from '@celljs/cli-common/lib/context/context-protocol';
|
|
2
|
+
export interface UpdateOptions {
|
|
3
|
+
version?: string;
|
|
4
|
+
distTag?: string;
|
|
5
|
+
skipIntallingComponent?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (ctx: CliContext, options: UpdateOptions) => Promise<void>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/update/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAO7E,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;8BA0B0B,UAAU,WAAW,aAAa;AAA7D,wBAsBE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@celljs/cli-common/lib/packager/utils");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const fs_extra_1 = require("fs-extra");
|
|
6
|
+
const updateNotifier = require('update-notifier');
|
|
7
|
+
const pkg = require('../../package.json');
|
|
8
|
+
const semver = require('semver');
|
|
9
|
+
async function updatePackage(version, skipIntallingComponent) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const packagePath = (0, path_1.join)(process.cwd(), 'package.json');
|
|
12
|
+
if ((0, fs_extra_1.existsSync)(packagePath)) {
|
|
13
|
+
const projectPkg = await (0, fs_extra_1.readJSON)(packagePath);
|
|
14
|
+
const dependencies = (_a = projectPkg.dependencies) !== null && _a !== void 0 ? _a : {};
|
|
15
|
+
const devDependencies = (_b = projectPkg.devDependencies) !== null && _b !== void 0 ? _b : {};
|
|
16
|
+
for (const name of Object.keys(dependencies)) {
|
|
17
|
+
if (name.startsWith('@celljs/')) {
|
|
18
|
+
dependencies[name] = version;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
for (const name of Object.keys(devDependencies)) {
|
|
22
|
+
if (name.startsWith('@celljs/')) {
|
|
23
|
+
devDependencies[name] = version;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
await (0, fs_extra_1.writeJSON)(packagePath, projectPkg, { spaces: 2 });
|
|
27
|
+
if (skipIntallingComponent) {
|
|
28
|
+
await (0, utils_1.getPackager)().install();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = async (ctx, options) => {
|
|
33
|
+
try {
|
|
34
|
+
ctx.options = options;
|
|
35
|
+
const version = options.version;
|
|
36
|
+
if (version) {
|
|
37
|
+
if (version !== pkg.version) {
|
|
38
|
+
await updatePackage(version, options.skipIntallingComponent);
|
|
39
|
+
await (0, utils_1.getPackager)('npm').add([`${pkg.name}@${version}`], { global: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const notifier = updateNotifier({ pkg, distTag: options.distTag });
|
|
44
|
+
const { latest, current } = await notifier.fetchInfo();
|
|
45
|
+
if (semver.gt(latest, current)) {
|
|
46
|
+
await updatePackage(latest, options.skipIntallingComponent);
|
|
47
|
+
await (0, utils_1.getPackager)('npm').add([`${pkg.name}@${latest}`], { global: true });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error(error);
|
|
53
|
+
process.exit(-1);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/update/update.ts"],"names":[],"mappings":";;AAAA,iEAAoE;AAEpE,+BAA4B;AAC5B,uCAA2D;AAC3D,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAQjC,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,sBAAgC;;IAC1E,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IACxD,IAAI,IAAA,qBAAU,EAAC,WAAW,CAAC,EAAE;QACzB,MAAM,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;QAC/C,MAAM,YAAY,GAAG,MAAA,UAAU,CAAC,YAAY,mCAAI,EAAE,CAAC;QACnD,MAAM,eAAe,GAAG,MAAA,UAAU,CAAC,eAAe,mCAAI,EAAE,CAAC;QACzD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;YAC1C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;gBAC7B,YAAY,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;aAChC;SACJ;QAED,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YAC7C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;gBAC7B,eAAe,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;aACnC;SACJ;QACD,MAAM,IAAA,oBAAS,EAAC,WAAW,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,sBAAsB,EAAE;YACxB,MAAM,IAAA,mBAAW,GAAE,CAAC,OAAO,EAAE,CAAC;SACjC;KACJ;AACL,CAAC;AAED,kBAAe,KAAK,EAAE,GAAe,EAAE,OAAsB,EAAE,EAAE;IAC7D,IAAI;QACA,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,OAAO,EAAE;YACT,IAAI,OAAO,KAAK,GAAG,CAAC,OAAO,EAAE;gBACzB,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAC7D,MAAM,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aAC9E;SACJ;aAAM;YACH,MAAM,QAAQ,GAAG,cAAc,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YACnE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,SAAS,EAAE,CAAC;YACvD,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;gBAC5B,MAAM,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAC5D,MAAM,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aAC7E;SACJ;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KACpB;AAEL,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Framework } from '@celljs/frameworks/lib/detector/detector-protocol';
|
|
2
|
+
import { Settings } from '@celljs/cli-common/lib/settings/settings-protocol';
|
|
3
|
+
export declare namespace BannerUtil {
|
|
4
|
+
function print(version: string, settings: Settings, runtime?: string, framework?: Framework): void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=banner-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-util.d.ts","sourceRoot":"","sources":["../../src/utils/banner-util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAI7E,yBAAiB,UAAU,CAAC;IACxB,SAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,QAgCjG;CACJ"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BannerUtil = void 0;
|
|
4
|
+
const runtime_protocol_1 = require("@celljs/cli-runtime/lib/runtime-protocol");
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
var BannerUtil;
|
|
7
|
+
(function (BannerUtil) {
|
|
8
|
+
function print(version, settings, runtime, framework) {
|
|
9
|
+
let runtimeStrLine = '';
|
|
10
|
+
let runtimeStr = '';
|
|
11
|
+
if (runtime && runtime !== runtime_protocol_1.Runtimes.empty) {
|
|
12
|
+
runtimeStr = runtime;
|
|
13
|
+
if (framework) {
|
|
14
|
+
runtimeStr = runtime === runtime_protocol_1.Runtimes.default ? framework.name : `${runtime}.${framework.name}`;
|
|
15
|
+
}
|
|
16
|
+
runtimeStr = `Runtime<${runtimeStr}>`;
|
|
17
|
+
runtimeStrLine = '\n│';
|
|
18
|
+
runtimeStrLine += chalk.yellow.bold(runtimeStr.padStart(20 + Math.floor(runtimeStr.length / 2)).padEnd(40)) + '│';
|
|
19
|
+
}
|
|
20
|
+
const banner = process.env.MALAGU_BANNER || settings.banner;
|
|
21
|
+
if (banner) {
|
|
22
|
+
console.log(banner.replace('{ version }', version).replace('{ runtime }', runtimeStr));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const versionStr = `@celljs/cli@${version}`;
|
|
26
|
+
const versionStrLine = `\n│${chalk.yellow.bold(versionStr.padStart(20 + Math.floor(versionStr.length / 2)).padEnd(40))}│`;
|
|
27
|
+
console.log(`
|
|
28
|
+
____ ___ ___
|
|
29
|
+
/\\ _\`\\ /\\_ \\ /\\_ \\
|
|
30
|
+
\\ \\ \\/\\_\\ __\\//\\ \\ \\//\\ \\
|
|
31
|
+
\\ \\ \\/_/_ /'__\`\\\\ \\ \\ \\ \\ \\
|
|
32
|
+
\\ \\ \\L\\ \\/\\ __/ \\_\\ \\_ \\_\\ \\_
|
|
33
|
+
\\ \\____/\\ \\____\\/\\____\\/\\____\\
|
|
34
|
+
\\/___/ \\/____/\\/____/\\/____/
|
|
35
|
+
|
|
36
|
+
╭────────────────────────────────────────╮
|
|
37
|
+
│ Cell Development Framework │${versionStrLine}${runtimeStrLine}
|
|
38
|
+
╰────────────────────────────────────────╯
|
|
39
|
+
`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
BannerUtil.print = print;
|
|
43
|
+
})(BannerUtil = exports.BannerUtil || (exports.BannerUtil = {}));
|
|
44
|
+
//# sourceMappingURL=banner-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-util.js","sourceRoot":"","sources":["../../src/utils/banner-util.ts"],"names":[],"mappings":";;;AAAA,+EAAoE;AAIpE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,IAAiB,UAAU,CAkC1B;AAlCD,WAAiB,UAAU;IACvB,SAAgB,KAAK,CAAC,OAAe,EAAE,QAAkB,EAAE,OAAgB,EAAE,SAAqB;QAC9F,IAAI,cAAc,GAAG,EAAE,CAAC;QACxB,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,OAAO,IAAI,OAAO,KAAK,2BAAQ,CAAC,KAAK,EAAE;YACvC,UAAU,GAAG,OAAO,CAAC;YACrB,IAAI,SAAS,EAAE;gBACX,UAAU,GAAG,OAAO,KAAK,2BAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;aAC/F;YACD,UAAU,GAAG,WAAW,UAAU,GAAG,CAAC;YACtC,cAAc,GAAG,KAAK,CAAC;YACvB,cAAc,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;SACrH;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,QAAQ,CAAC,MAAM,CAAC;QAC5D,IAAI,MAAM,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;SAC1F;aAAM;YACH,MAAM,UAAU,GAAG,eAAe,OAAO,EAAE,CAAC;YAC5C,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;YAC1H,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;4CAUoB,cAAc,GAAG,cAAc;;CAE1E,CAAC,CAAC;SACM;IACL,CAAC;IAhCe,gBAAK,QAgCpB,CAAA;AACL,CAAC,EAlCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAkC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./banner-util"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@celljs/cli",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Cell CLI.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"eslintIgnore": [
|
|
10
|
+
"templates"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/cellbang/cell.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/cellbang/cell/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/cellbang/cell",
|
|
20
|
+
"files": [
|
|
21
|
+
"bin",
|
|
22
|
+
"lib",
|
|
23
|
+
"src",
|
|
24
|
+
"templates"
|
|
25
|
+
],
|
|
26
|
+
"bin": {
|
|
27
|
+
"cell": "./bin/cell"
|
|
28
|
+
},
|
|
29
|
+
"main": "lib/index.js",
|
|
30
|
+
"typings": "lib/index.d.ts",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"lint": "cell-component lint",
|
|
33
|
+
"build": "cell-component build",
|
|
34
|
+
"watch": "cell-component watch",
|
|
35
|
+
"clean": "cell-component clean",
|
|
36
|
+
"test": "cell-component test:js"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@celljs/cli-common": "3.0.0",
|
|
40
|
+
"@celljs/cli-runtime": "3.0.0",
|
|
41
|
+
"@celljs/frameworks": "3.0.0",
|
|
42
|
+
"chalk": "^4.1.0",
|
|
43
|
+
"commander": "^11.0.0",
|
|
44
|
+
"dotenv": "^16.3.1",
|
|
45
|
+
"fs-extra": "^11.1.1",
|
|
46
|
+
"js-yaml": "^4.1.0",
|
|
47
|
+
"leven": "^3.1.0",
|
|
48
|
+
"minimist": "^1.2.8",
|
|
49
|
+
"ora": "^5.4.1",
|
|
50
|
+
"prompts": "2.4.2",
|
|
51
|
+
"rimraf": "^5.0.1",
|
|
52
|
+
"semver": "^7.5.3",
|
|
53
|
+
"traverse": "^0.6.7",
|
|
54
|
+
"update-notifier": "^5.0.1",
|
|
55
|
+
"watchpack": "^2.2.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@celljs/component": "3.0.0",
|
|
59
|
+
"@types/js-yaml": "^3.12.1",
|
|
60
|
+
"@types/prompts": "^2.4.4"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "c0ef8d269e33a795406bcbb240cac4b845c6c24c"
|
|
63
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
import { CommandUtil, CommandType, CommandStage } from '@celljs/cli-common/lib/utils/command-util';
|
|
3
|
+
import { HookExecutor, HookStage } from '@celljs/cli-common/lib/hook/hook-executor';
|
|
4
|
+
import { BuildContext } from '@celljs/cli-common/lib/context/context-protocol';
|
|
5
|
+
import { PathUtil } from '@celljs/cli-common/lib/utils/path-util';
|
|
6
|
+
import { LoggerUtil } from '@celljs/cli-common/lib/utils/logger-util';
|
|
7
|
+
const rimraf = require('rimraf');
|
|
8
|
+
|
|
9
|
+
export class BuildManager {
|
|
10
|
+
|
|
11
|
+
constructor(protected readonly ctx: BuildContext) {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
protected cleanDistDir() {
|
|
16
|
+
rimraf.sync(PathUtil.getProjectDistPath());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected log() {
|
|
20
|
+
LoggerUtil.printStage(this.ctx);
|
|
21
|
+
LoggerUtil.printMode(this.ctx);
|
|
22
|
+
LoggerUtil.printTargets(this.ctx);
|
|
23
|
+
LoggerUtil.printComponents(this.ctx);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async build(): Promise<void> {
|
|
27
|
+
this.log();
|
|
28
|
+
this.cleanDistDir();
|
|
29
|
+
|
|
30
|
+
const hookExecutor = new HookExecutor();
|
|
31
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.CompileCommand, CommandStage.before);
|
|
32
|
+
await hookExecutor.executeCompileHooks(this.ctx, HookStage.before);
|
|
33
|
+
|
|
34
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.CompileCommand);
|
|
35
|
+
await hookExecutor.executeCompileHooks(this.ctx);
|
|
36
|
+
|
|
37
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.CompileCommand, CommandStage.after);
|
|
38
|
+
await hookExecutor.executeCompileHooks(this.ctx, HookStage.after);
|
|
39
|
+
|
|
40
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.BuildCommand, CommandStage.before);
|
|
41
|
+
await hookExecutor.executeBuildHooks(this.ctx, HookStage.before);
|
|
42
|
+
|
|
43
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.BuildCommand);
|
|
44
|
+
await hookExecutor.executeBuildHooks(this.ctx);
|
|
45
|
+
|
|
46
|
+
await CommandUtil.executeCommand(this.ctx, CommandType.BuildCommand, CommandStage.after);
|
|
47
|
+
await hookExecutor.executeBuildHooks(this.ctx, HookStage.after);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { CliContext, ContextUtils } from '@celljs/cli-common/lib/context/context-protocol';
|
|
3
|
+
import { BuildManager } from './build-manager';
|
|
4
|
+
|
|
5
|
+
export interface BuildOptions {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default async (ctx: CliContext, options: BuildOptions) => {
|
|
9
|
+
try {
|
|
10
|
+
ctx.options = options;
|
|
11
|
+
ctx = ContextUtils.mergeContext(ctx, options);
|
|
12
|
+
await new BuildManager(ctx).build();
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error(error);
|
|
15
|
+
process.exit(-1);
|
|
16
|
+
}
|
|
17
|
+
};
|
package/src/cell-main.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { fork, ChildProcess } from 'child_process';
|
|
2
|
+
import { PathUtil } from '@celljs/cli-common/lib/utils/path-util';
|
|
3
|
+
import { Component, Module } from '@celljs/cli-common/lib/package/package-protocol';
|
|
4
|
+
import { CommandUtil } from '@celljs/cli-common/lib/utils/command-util';
|
|
5
|
+
import { sep, join, delimiter, dirname, resolve } from 'path';
|
|
6
|
+
import { RuntimeUtil } from '@celljs/cli-runtime/lib/util/runtime-util';
|
|
7
|
+
import { config } from 'dotenv';
|
|
8
|
+
const Watchpack = require('watchpack');
|
|
9
|
+
config();
|
|
10
|
+
|
|
11
|
+
const argv = [ ...process.argv ];
|
|
12
|
+
argv.shift();
|
|
13
|
+
argv.shift();
|
|
14
|
+
|
|
15
|
+
let current: ChildProcess;
|
|
16
|
+
|
|
17
|
+
interface Data {
|
|
18
|
+
components?: Component[];
|
|
19
|
+
configHookModules?: Module[];
|
|
20
|
+
webpackHookModules?: Module[];
|
|
21
|
+
serveHookModules?: Module[];
|
|
22
|
+
buildHookModules?: Module[];
|
|
23
|
+
deployHookModules?: Module[];
|
|
24
|
+
propsHookModules?: Module[];
|
|
25
|
+
infoHookModules?: Module[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const exitListener = (code: number | null) => {
|
|
29
|
+
// eslint-disable-next-line no-null/no-null
|
|
30
|
+
if (code !== null) {
|
|
31
|
+
process.exit(code);
|
|
32
|
+
} else {
|
|
33
|
+
process.exit(-1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
async function execute() {
|
|
39
|
+
const pkg = CommandUtil.getPkg();
|
|
40
|
+
let projectPath = pkg.rootComponentPackage.cellComponent?.projectPath;
|
|
41
|
+
projectPath = projectPath ? resolve(process.cwd(), projectPath) : process.cwd();
|
|
42
|
+
try {
|
|
43
|
+
const cellMainPath = require.resolve('@celljs/cli/lib/cell-main', { paths: [ projectPath ] });
|
|
44
|
+
if (dirname(cellMainPath) !== __dirname) {
|
|
45
|
+
const subprocess = fork(cellMainPath, argv, { stdio: 'inherit', cwd: projectPath });
|
|
46
|
+
subprocess.on('exit', exitListener);
|
|
47
|
+
subprocess.on('error', () => process.exit(-1));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (error?.code !== 'MODULE_NOT_FOUND') {
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (current?.killed === false) {
|
|
57
|
+
current.removeListener('exit', exitListener);
|
|
58
|
+
current.kill();
|
|
59
|
+
}
|
|
60
|
+
const { runtime, framework, settings } = await RuntimeUtil.initRuntime(projectPath);
|
|
61
|
+
|
|
62
|
+
const nodePaths = Array.from(new Set<string>([
|
|
63
|
+
join(projectPath, 'node_modules'),
|
|
64
|
+
join(projectPath, '..', 'node_modules'),
|
|
65
|
+
join(projectPath, '..', '..', 'node_modules'),
|
|
66
|
+
join(projectPath, '..', '..', '..', 'node_modules')
|
|
67
|
+
]));
|
|
68
|
+
|
|
69
|
+
process.env.MALAGU_RFS = JSON.stringify({ runtime, settings, framework });
|
|
70
|
+
const runtimePath = PathUtil.getRuntimePath(runtime);
|
|
71
|
+
if (runtimePath !== projectPath) {
|
|
72
|
+
nodePaths.push(join(runtimePath, 'node_modules'));
|
|
73
|
+
}
|
|
74
|
+
process.env.NODE_PATH = nodePaths.join(delimiter);
|
|
75
|
+
const cellPath = require.resolve('@celljs/cli/lib/cell', { paths: [ __dirname ] });
|
|
76
|
+
current = fork(cellPath, argv, { stdio: 'inherit', cwd: projectPath });
|
|
77
|
+
// eslint-disable-next-line no-null/no-null
|
|
78
|
+
current.on('exit', exitListener);
|
|
79
|
+
current.on('error', () => process.exit(-1));
|
|
80
|
+
current.on('message', (messageEvent: MessageEvent<Data>) => {
|
|
81
|
+
if (messageEvent.type === 'cliContext') {
|
|
82
|
+
const { components, webpackHookModules, configHookModules, buildHookModules,
|
|
83
|
+
serveHookModules, deployHookModules, propsHookModules, infoHookModules } = messageEvent.data;
|
|
84
|
+
const files = [
|
|
85
|
+
...(webpackHookModules || []).map(m => m.path),
|
|
86
|
+
...(configHookModules || []).map(m => m.path),
|
|
87
|
+
...(buildHookModules || []).map(m => m.path),
|
|
88
|
+
...(serveHookModules || []).map(m => m.path),
|
|
89
|
+
...(deployHookModules || []).map(m => m.path),
|
|
90
|
+
...(propsHookModules || []).map(m => m.path),
|
|
91
|
+
...(infoHookModules || []).map(m => m.path),
|
|
92
|
+
...(components || []).reduce<string[]>((prev, curr) => prev.concat(curr.configFiles), [])
|
|
93
|
+
];
|
|
94
|
+
const watchpack = new Watchpack({
|
|
95
|
+
aggregateTimeout: 1500
|
|
96
|
+
});
|
|
97
|
+
watchpack.watch({
|
|
98
|
+
files: files.map(f => f?.split('/').join(sep))
|
|
99
|
+
});
|
|
100
|
+
watchpack.on('aggregated', () => {
|
|
101
|
+
watchpack.close();
|
|
102
|
+
execute();
|
|
103
|
+
});
|
|
104
|
+
} else if (messageEvent.type === 'address') {
|
|
105
|
+
if (process.send) {
|
|
106
|
+
process.send(messageEvent);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function exit() {
|
|
113
|
+
if (current?.killed === false) {
|
|
114
|
+
current.kill();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
process.on('exit', exit);
|
|
119
|
+
process.on('SIGINT', exit);
|
|
120
|
+
try {
|
|
121
|
+
execute();
|
|
122
|
+
} catch (error) {
|
|
123
|
+
exit();
|
|
124
|
+
process.exit(-1);
|
|
125
|
+
}
|