@celljs/cli 3.8.0 → 4.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/README.md +442 -1
- package/agent/guide.md +39 -0
- package/bin/cell.js +2 -0
- package/lib/agent/agent-guide.d.ts +39 -0
- package/lib/agent/agent-guide.d.ts.map +1 -0
- package/lib/agent/agent-guide.js +67 -0
- package/lib/agent/agent-guide.js.map +1 -0
- package/lib/build/executable-compiler.d.ts +44 -0
- package/lib/build/executable-compiler.d.ts.map +1 -0
- package/lib/build/executable-compiler.js +145 -0
- package/lib/build/executable-compiler.js.map +1 -0
- package/lib/build/executable-compiler.spec.d.ts +2 -0
- package/lib/build/executable-compiler.spec.d.ts.map +1 -0
- package/lib/build/executable-compiler.spec.js +71 -0
- package/lib/build/executable-compiler.spec.js.map +1 -0
- package/lib/build/single-compile.spec.d.ts +2 -0
- package/lib/build/single-compile.spec.d.ts.map +1 -0
- package/lib/build/single-compile.spec.js +135 -0
- package/lib/build/single-compile.spec.js.map +1 -0
- package/lib/check/project-checker.d.ts +85 -0
- package/lib/check/project-checker.d.ts.map +1 -0
- package/lib/check/project-checker.js +332 -0
- package/lib/check/project-checker.js.map +1 -0
- package/lib/check/project-checker.spec.d.ts +2 -0
- package/lib/check/project-checker.spec.d.ts.map +1 -0
- package/lib/check/project-checker.spec.js +147 -0
- package/lib/check/project-checker.spec.js.map +1 -0
- package/lib/cli/agent-command.d.ts +15 -0
- package/lib/cli/agent-command.d.ts.map +1 -0
- package/lib/cli/agent-command.js +42 -0
- package/lib/cli/agent-command.js.map +1 -0
- package/lib/cli/build-command.d.ts +84 -0
- package/lib/cli/build-command.d.ts.map +1 -0
- package/lib/cli/build-command.js +170 -0
- package/lib/cli/build-command.js.map +1 -0
- package/lib/cli/cell-cli.d.ts +35 -0
- package/lib/cli/cell-cli.d.ts.map +1 -0
- package/lib/cli/cell-cli.js +159 -0
- package/lib/cli/cell-cli.js.map +1 -0
- package/lib/cli/cell-cli.spec.d.ts +2 -0
- package/lib/cli/cell-cli.spec.d.ts.map +1 -0
- package/lib/cli/cell-cli.spec.js +195 -0
- package/lib/cli/cell-cli.spec.js.map +1 -0
- package/lib/cli/check-command.d.ts +31 -0
- package/lib/cli/check-command.d.ts.map +1 -0
- package/lib/cli/check-command.js +67 -0
- package/lib/cli/check-command.js.map +1 -0
- package/lib/cli/command.d.ts +24 -0
- package/lib/cli/command.d.ts.map +1 -0
- package/lib/cli/command.js +10 -0
- package/lib/cli/command.js.map +1 -0
- package/lib/cli/config-command.d.ts +29 -0
- package/lib/cli/config-command.d.ts.map +1 -0
- package/lib/cli/config-command.js +71 -0
- package/lib/cli/config-command.js.map +1 -0
- package/lib/cli/config-command.spec.d.ts +2 -0
- package/lib/cli/config-command.spec.d.ts.map +1 -0
- package/lib/cli/config-command.spec.js +79 -0
- package/lib/cli/config-command.spec.js.map +1 -0
- package/lib/cli/deploy-command.d.ts +41 -0
- package/lib/cli/deploy-command.d.ts.map +1 -0
- package/lib/cli/deploy-command.js +114 -0
- package/lib/cli/deploy-command.js.map +1 -0
- package/lib/cli/dev-command.d.ts +47 -0
- package/lib/cli/dev-command.d.ts.map +1 -0
- package/lib/cli/dev-command.js +219 -0
- package/lib/cli/dev-command.js.map +1 -0
- package/lib/cli/dev-command.spec.d.ts +2 -0
- package/lib/cli/dev-command.spec.d.ts.map +1 -0
- package/lib/cli/dev-command.spec.js +149 -0
- package/lib/cli/dev-command.spec.js.map +1 -0
- package/lib/cli/docs-command.d.ts +19 -0
- package/lib/cli/docs-command.d.ts.map +1 -0
- package/lib/cli/docs-command.js +47 -0
- package/lib/cli/docs-command.js.map +1 -0
- package/lib/cli/info-command.d.ts +44 -0
- package/lib/cli/info-command.d.ts.map +1 -0
- package/lib/cli/info-command.js +39 -0
- package/lib/cli/info-command.js.map +1 -0
- package/lib/cli/info-command.spec.d.ts +2 -0
- package/lib/cli/info-command.spec.d.ts.map +1 -0
- package/lib/cli/info-command.spec.js +236 -0
- package/lib/cli/info-command.spec.js.map +1 -0
- package/lib/cli/init-command.d.ts +20 -0
- package/lib/cli/init-command.d.ts.map +1 -0
- package/lib/cli/init-command.js +43 -0
- package/lib/cli/init-command.js.map +1 -0
- package/lib/cli/main.d.ts +2 -0
- package/lib/cli/main.d.ts.map +1 -0
- package/lib/cli/main.js +3 -0
- package/lib/cli/main.js.map +1 -0
- package/lib/cli/mcp-command.d.ts +34 -0
- package/lib/cli/mcp-command.d.ts.map +1 -0
- package/lib/cli/mcp-command.js +85 -0
- package/lib/cli/mcp-command.js.map +1 -0
- package/lib/cli/mcp-command.spec.d.ts +2 -0
- package/lib/cli/mcp-command.spec.d.ts.map +1 -0
- package/lib/cli/mcp-command.spec.js +132 -0
- package/lib/cli/mcp-command.spec.js.map +1 -0
- package/lib/cli/preview-command.d.ts +24 -0
- package/lib/cli/preview-command.d.ts.map +1 -0
- package/lib/cli/preview-command.js +91 -0
- package/lib/cli/preview-command.js.map +1 -0
- package/lib/cli/reporter.d.ts +26 -0
- package/lib/cli/reporter.d.ts.map +1 -0
- package/lib/cli/reporter.js +58 -0
- package/lib/cli/reporter.js.map +1 -0
- package/lib/config/config-build.spec.d.ts +2 -0
- package/lib/config/config-build.spec.d.ts.map +1 -0
- package/lib/config/config-build.spec.js +111 -0
- package/lib/config/config-build.spec.js.map +1 -0
- package/lib/config/config-explainer.d.ts +48 -0
- package/lib/config/config-explainer.d.ts.map +1 -0
- package/lib/config/config-explainer.js +130 -0
- package/lib/config/config-explainer.js.map +1 -0
- package/lib/config/config-file-loader.d.ts +22 -0
- package/lib/config/config-file-loader.d.ts.map +1 -0
- package/lib/config/config-file-loader.js +63 -0
- package/lib/config/config-file-loader.js.map +1 -0
- package/lib/config/config-resolver.d.ts +111 -0
- package/lib/config/config-resolver.d.ts.map +1 -0
- package/lib/config/config-resolver.js +215 -0
- package/lib/config/config-resolver.js.map +1 -0
- package/lib/config/config-resolver.spec.d.ts +2 -0
- package/lib/config/config-resolver.spec.d.ts.map +1 -0
- package/lib/config/config-resolver.spec.js +159 -0
- package/lib/config/config-resolver.spec.js.map +1 -0
- package/lib/config/config-validator.d.ts +35 -0
- package/lib/config/config-validator.d.ts.map +1 -0
- package/lib/config/config-validator.js +160 -0
- package/lib/config/config-validator.js.map +1 -0
- package/lib/config/config-validator.spec.d.ts +2 -0
- package/lib/config/config-validator.spec.d.ts.map +1 -0
- package/lib/config/config-validator.spec.js +77 -0
- package/lib/config/config-validator.spec.js.map +1 -0
- package/lib/config/define-config.d.ts +4 -0
- package/lib/config/define-config.d.ts.map +1 -0
- package/lib/config/define-config.js +5 -0
- package/lib/config/define-config.js.map +1 -0
- package/lib/config/types.d.ts +53 -0
- package/lib/config/types.d.ts.map +1 -0
- package/lib/config/types.js +2 -0
- package/lib/config/types.js.map +1 -0
- package/lib/deploy/cloud-api.d.ts +58 -0
- package/lib/deploy/cloud-api.d.ts.map +1 -0
- package/lib/deploy/cloud-api.js +189 -0
- package/lib/deploy/cloud-api.js.map +1 -0
- package/lib/deploy/code-package.d.ts +15 -0
- package/lib/deploy/code-package.d.ts.map +1 -0
- package/lib/deploy/code-package.js +40 -0
- package/lib/deploy/code-package.js.map +1 -0
- package/lib/deploy/deploy-utils.spec.d.ts +2 -0
- package/lib/deploy/deploy-utils.spec.d.ts.map +1 -0
- package/lib/deploy/deploy-utils.spec.js +56 -0
- package/lib/deploy/deploy-utils.spec.js.map +1 -0
- package/lib/deploy/deployer-registry.d.ts +11 -0
- package/lib/deploy/deployer-registry.d.ts.map +1 -0
- package/lib/deploy/deployer-registry.js +40 -0
- package/lib/deploy/deployer-registry.js.map +1 -0
- package/lib/deploy/request-signer.d.ts +51 -0
- package/lib/deploy/request-signer.d.ts.map +1 -0
- package/lib/deploy/request-signer.js +109 -0
- package/lib/deploy/request-signer.js.map +1 -0
- package/lib/deploy/zip-writer.d.ts +32 -0
- package/lib/deploy/zip-writer.d.ts.map +1 -0
- package/lib/deploy/zip-writer.js +114 -0
- package/lib/deploy/zip-writer.js.map +1 -0
- package/lib/docs/docs-index.d.ts +54 -0
- package/lib/docs/docs-index.d.ts.map +1 -0
- package/lib/docs/docs-index.js +140 -0
- package/lib/docs/docs-index.js.map +1 -0
- package/lib/docs/docs-index.spec.d.ts +2 -0
- package/lib/docs/docs-index.spec.d.ts.map +1 -0
- package/lib/docs/docs-index.spec.js +52 -0
- package/lib/docs/docs-index.spec.js.map +1 -0
- package/lib/events/event-bus.d.ts +30 -0
- package/lib/events/event-bus.d.ts.map +1 -0
- package/lib/events/event-bus.js +81 -0
- package/lib/events/event-bus.js.map +1 -0
- package/lib/events/event-bus.spec.d.ts +2 -0
- package/lib/events/event-bus.spec.d.ts.map +1 -0
- package/lib/events/event-bus.spec.js +69 -0
- package/lib/events/event-bus.spec.js.map +1 -0
- package/lib/events/hook-runner.d.ts +27 -0
- package/lib/events/hook-runner.d.ts.map +1 -0
- package/lib/events/hook-runner.js +65 -0
- package/lib/events/hook-runner.js.map +1 -0
- package/lib/events/hook-runner.spec.d.ts +2 -0
- package/lib/events/hook-runner.spec.d.ts.map +1 -0
- package/lib/events/hook-runner.spec.js +36 -0
- package/lib/events/hook-runner.spec.js.map +1 -0
- package/lib/index.d.ts +57 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +57 -2
- package/lib/index.js.map +1 -1
- package/lib/info/project-inspector.d.ts +143 -0
- package/lib/info/project-inspector.d.ts.map +1 -0
- package/lib/info/project-inspector.js +244 -0
- package/lib/info/project-inspector.js.map +1 -0
- package/lib/init/project-initializer.d.ts +44 -0
- package/lib/init/project-initializer.d.ts.map +1 -0
- package/lib/init/project-initializer.js +90 -0
- package/lib/init/project-initializer.js.map +1 -0
- package/lib/init/project-initializer.spec.d.ts +2 -0
- package/lib/init/project-initializer.spec.d.ts.map +1 -0
- package/lib/init/project-initializer.spec.js +88 -0
- package/lib/init/project-initializer.spec.js.map +1 -0
- package/lib/mcp/dev-activity.d.ts +34 -0
- package/lib/mcp/dev-activity.d.ts.map +1 -0
- package/lib/mcp/dev-activity.js +46 -0
- package/lib/mcp/dev-activity.js.map +1 -0
- package/lib/mcp/dev-mcp-endpoint.d.ts +62 -0
- package/lib/mcp/dev-mcp-endpoint.d.ts.map +1 -0
- package/lib/mcp/dev-mcp-endpoint.js +280 -0
- package/lib/mcp/dev-mcp-endpoint.js.map +1 -0
- package/lib/mcp/dev-mcp-endpoint.spec.d.ts +2 -0
- package/lib/mcp/dev-mcp-endpoint.spec.d.ts.map +1 -0
- package/lib/mcp/dev-mcp-endpoint.spec.js +143 -0
- package/lib/mcp/dev-mcp-endpoint.spec.js.map +1 -0
- package/lib/mcp/mcp-server.d.ts +64 -0
- package/lib/mcp/mcp-server.d.ts.map +1 -0
- package/lib/mcp/mcp-server.js +201 -0
- package/lib/mcp/mcp-server.js.map +1 -0
- package/lib/mcp/mcp-server.spec.d.ts +2 -0
- package/lib/mcp/mcp-server.spec.d.ts.map +1 -0
- package/lib/mcp/mcp-server.spec.js +136 -0
- package/lib/mcp/mcp-server.spec.js.map +1 -0
- package/lib/mcp/project-mcp-tools.d.ts +35 -0
- package/lib/mcp/project-mcp-tools.d.ts.map +1 -0
- package/lib/mcp/project-mcp-tools.js +199 -0
- package/lib/mcp/project-mcp-tools.js.map +1 -0
- package/lib/modules/module-host.d.ts +118 -0
- package/lib/modules/module-host.d.ts.map +1 -0
- package/lib/modules/module-host.js +405 -0
- package/lib/modules/module-host.js.map +1 -0
- package/lib/modules/module-host.spec.d.ts +2 -0
- package/lib/modules/module-host.spec.d.ts.map +1 -0
- package/lib/modules/module-host.spec.js +220 -0
- package/lib/modules/module-host.spec.js.map +1 -0
- package/lib/preset/builtin-presets.d.ts +9 -0
- package/lib/preset/builtin-presets.d.ts.map +1 -0
- package/lib/preset/builtin-presets.js +24 -0
- package/lib/preset/builtin-presets.js.map +1 -0
- package/lib/preset/cloudflare/cloudflare-deployer.d.ts +26 -0
- package/lib/preset/cloudflare/cloudflare-deployer.d.ts.map +1 -0
- package/lib/preset/cloudflare/cloudflare-deployer.js +116 -0
- package/lib/preset/cloudflare/cloudflare-deployer.js.map +1 -0
- package/lib/preset/cloudflare/cloudflare-preset.d.ts +16 -0
- package/lib/preset/cloudflare/cloudflare-preset.d.ts.map +1 -0
- package/lib/preset/cloudflare/cloudflare-preset.js +97 -0
- package/lib/preset/cloudflare/cloudflare-preset.js.map +1 -0
- package/lib/preset/cloudflare/cloudflare.spec.d.ts +2 -0
- package/lib/preset/cloudflare/cloudflare.spec.d.ts.map +1 -0
- package/lib/preset/cloudflare/cloudflare.spec.js +212 -0
- package/lib/preset/cloudflare/cloudflare.spec.js.map +1 -0
- package/lib/preset/cloudflare/wrangler-config.d.ts +50 -0
- package/lib/preset/cloudflare/wrangler-config.d.ts.map +1 -0
- package/lib/preset/cloudflare/wrangler-config.js +160 -0
- package/lib/preset/cloudflare/wrangler-config.js.map +1 -0
- package/lib/preset/cloudflare/wrangler-config.spec.d.ts +2 -0
- package/lib/preset/cloudflare/wrangler-config.spec.d.ts.map +1 -0
- package/lib/preset/cloudflare/wrangler-config.spec.js +112 -0
- package/lib/preset/cloudflare/wrangler-config.spec.js.map +1 -0
- package/lib/preset/cloudflare/wrangler.d.ts +38 -0
- package/lib/preset/cloudflare/wrangler.d.ts.map +1 -0
- package/lib/preset/cloudflare/wrangler.js +90 -0
- package/lib/preset/cloudflare/wrangler.js.map +1 -0
- package/lib/preset/cloudflare/wrangler.spec.d.ts +2 -0
- package/lib/preset/cloudflare/wrangler.spec.d.ts.map +1 -0
- package/lib/preset/cloudflare/wrangler.spec.js +64 -0
- package/lib/preset/cloudflare/wrangler.spec.js.map +1 -0
- package/lib/preset/fc/fc-deployer.d.ts +50 -0
- package/lib/preset/fc/fc-deployer.d.ts.map +1 -0
- package/lib/preset/fc/fc-deployer.js +209 -0
- package/lib/preset/fc/fc-deployer.js.map +1 -0
- package/lib/preset/fc/fc-preset.d.ts +20 -0
- package/lib/preset/fc/fc-preset.d.ts.map +1 -0
- package/lib/preset/fc/fc-preset.js +46 -0
- package/lib/preset/fc/fc-preset.js.map +1 -0
- package/lib/preset/lambda/lambda-deployer.d.ts +50 -0
- package/lib/preset/lambda/lambda-deployer.d.ts.map +1 -0
- package/lib/preset/lambda/lambda-deployer.js +274 -0
- package/lib/preset/lambda/lambda-deployer.js.map +1 -0
- package/lib/preset/lambda/lambda-preset.d.ts +14 -0
- package/lib/preset/lambda/lambda-preset.d.ts.map +1 -0
- package/lib/preset/lambda/lambda-preset.js +44 -0
- package/lib/preset/lambda/lambda-preset.js.map +1 -0
- package/lib/preset/preset-output.d.ts +19 -0
- package/lib/preset/preset-output.d.ts.map +1 -0
- package/lib/preset/preset-output.js +45 -0
- package/lib/preset/preset-output.js.map +1 -0
- package/lib/preset/preset-registry.d.ts +16 -0
- package/lib/preset/preset-registry.d.ts.map +1 -0
- package/lib/preset/preset-registry.js +58 -0
- package/lib/preset/preset-registry.js.map +1 -0
- package/lib/preset/preset-registry.spec.d.ts +2 -0
- package/lib/preset/preset-registry.spec.d.ts.map +1 -0
- package/lib/preset/preset-registry.spec.js +28 -0
- package/lib/preset/preset-registry.spec.js.map +1 -0
- package/lib/preset/scf/scf-deployer.d.ts +54 -0
- package/lib/preset/scf/scf-deployer.d.ts.map +1 -0
- package/lib/preset/scf/scf-deployer.js +202 -0
- package/lib/preset/scf/scf-deployer.js.map +1 -0
- package/lib/preset/scf/scf-preset.d.ts +19 -0
- package/lib/preset/scf/scf-preset.d.ts.map +1 -0
- package/lib/preset/scf/scf-preset.js +43 -0
- package/lib/preset/scf/scf-preset.js.map +1 -0
- package/lib/preset/serverless-deployers.spec.d.ts +2 -0
- package/lib/preset/serverless-deployers.spec.d.ts.map +1 -0
- package/lib/preset/serverless-deployers.spec.js +307 -0
- package/lib/preset/serverless-deployers.spec.js.map +1 -0
- package/lib/preset/serverless-presets.spec.d.ts +2 -0
- package/lib/preset/serverless-presets.spec.d.ts.map +1 -0
- package/lib/preset/serverless-presets.spec.js +280 -0
- package/lib/preset/serverless-presets.spec.js.map +1 -0
- package/lib/preset/serverless-scripts.d.ts +29 -0
- package/lib/preset/serverless-scripts.d.ts.map +1 -0
- package/lib/preset/serverless-scripts.js +120 -0
- package/lib/preset/serverless-scripts.js.map +1 -0
- package/lib/preset/vercel/vercel-deployer.d.ts +38 -0
- package/lib/preset/vercel/vercel-deployer.d.ts.map +1 -0
- package/lib/preset/vercel/vercel-deployer.js +160 -0
- package/lib/preset/vercel/vercel-deployer.js.map +1 -0
- package/lib/preset/vercel/vercel-preset.d.ts +19 -0
- package/lib/preset/vercel/vercel-preset.d.ts.map +1 -0
- package/lib/preset/vercel/vercel-preset.js +102 -0
- package/lib/preset/vercel/vercel-preset.js.map +1 -0
- package/lib/test/fixture-project.d.ts +17 -0
- package/lib/test/fixture-project.d.ts.map +1 -0
- package/lib/test/fixture-project.js +43 -0
- package/lib/test/fixture-project.js.map +1 -0
- package/lib/testing/create-test-app.d.ts +27 -0
- package/lib/testing/create-test-app.d.ts.map +1 -0
- package/lib/testing/create-test-app.js +54 -0
- package/lib/testing/create-test-app.js.map +1 -0
- package/lib/testing/create-test-app.spec.d.ts +2 -0
- package/lib/testing/create-test-app.spec.d.ts.map +1 -0
- package/lib/testing/create-test-app.spec.js +66 -0
- package/lib/testing/create-test-app.spec.js.map +1 -0
- package/lib/toolchain/toolchain.d.ts +49 -0
- package/lib/toolchain/toolchain.d.ts.map +1 -0
- package/lib/toolchain/toolchain.js +100 -0
- package/lib/toolchain/toolchain.js.map +1 -0
- package/lib/utils/json-util.d.ts +11 -0
- package/lib/utils/json-util.d.ts.map +1 -0
- package/lib/utils/json-util.js +73 -0
- package/lib/utils/json-util.js.map +1 -0
- package/lib/utils/json-util.spec.d.ts +2 -0
- package/lib/utils/json-util.spec.d.ts.map +1 -0
- package/lib/utils/json-util.spec.js +18 -0
- package/lib/utils/json-util.spec.js.map +1 -0
- package/lib/utils/text-util.d.ts +19 -0
- package/lib/utils/text-util.d.ts.map +1 -0
- package/lib/utils/text-util.js +66 -0
- package/lib/utils/text-util.js.map +1 -0
- package/lib/utils/text-util.spec.d.ts +2 -0
- package/lib/utils/text-util.spec.d.ts.map +1 -0
- package/lib/utils/text-util.spec.js +22 -0
- package/lib/utils/text-util.spec.js.map +1 -0
- package/package.json +28 -30
- package/src/agent/agent-guide.ts +90 -0
- package/src/build/executable-compiler.ts +179 -0
- package/src/check/project-checker.ts +365 -0
- package/src/cli/agent-command.ts +46 -0
- package/src/cli/build-command.ts +189 -0
- package/src/cli/cell-cli.ts +174 -0
- package/src/cli/check-command.ts +74 -0
- package/src/cli/command.ts +29 -0
- package/src/cli/config-command.ts +73 -0
- package/src/cli/deploy-command.ts +122 -0
- package/src/cli/dev-command.ts +232 -0
- package/src/cli/docs-command.ts +53 -0
- package/src/cli/info-command.ts +40 -0
- package/src/cli/init-command.ts +53 -0
- package/src/cli/main.ts +3 -0
- package/src/cli/mcp-command.ts +98 -0
- package/src/cli/preview-command.ts +98 -0
- package/src/cli/reporter.ts +67 -0
- package/src/config/config-explainer.ts +158 -0
- package/src/config/config-file-loader.ts +76 -0
- package/src/config/config-resolver.ts +300 -0
- package/src/config/config-validator.ts +208 -0
- package/src/config/define-config.ts +6 -0
- package/src/config/types.ts +57 -0
- package/src/deploy/cloud-api.ts +194 -0
- package/src/deploy/code-package.ts +44 -0
- package/src/deploy/deployer-registry.ts +44 -0
- package/src/deploy/request-signer.ts +155 -0
- package/src/deploy/zip-writer.ts +132 -0
- package/src/docs/docs-index.ts +174 -0
- package/src/events/event-bus.ts +94 -0
- package/src/events/hook-runner.ts +78 -0
- package/src/index.ts +57 -0
- package/src/info/project-inspector.ts +352 -0
- package/src/init/project-initializer.ts +111 -0
- package/src/mcp/dev-activity.ts +71 -0
- package/src/mcp/dev-mcp-endpoint.ts +323 -0
- package/src/mcp/mcp-server.ts +251 -0
- package/src/mcp/project-mcp-tools.ts +216 -0
- package/src/modules/module-host.ts +489 -0
- package/src/preset/builtin-presets.ts +26 -0
- package/src/preset/cloudflare/cloudflare-deployer.ts +126 -0
- package/src/preset/cloudflare/cloudflare-preset.ts +97 -0
- package/src/preset/cloudflare/wrangler-config.ts +173 -0
- package/src/preset/cloudflare/wrangler.ts +113 -0
- package/src/preset/fc/fc-deployer.ts +237 -0
- package/src/preset/fc/fc-preset.ts +51 -0
- package/src/preset/lambda/lambda-deployer.ts +317 -0
- package/src/preset/lambda/lambda-preset.ts +45 -0
- package/src/preset/preset-output.ts +55 -0
- package/src/preset/preset-registry.ts +65 -0
- package/src/preset/scf/scf-deployer.ts +232 -0
- package/src/preset/scf/scf-preset.ts +45 -0
- package/src/preset/serverless-scripts.ts +132 -0
- package/src/preset/vercel/vercel-deployer.ts +168 -0
- package/src/preset/vercel/vercel-preset.ts +111 -0
- package/src/test/fixture-project.ts +50 -0
- package/src/testing/create-test-app.ts +73 -0
- package/src/toolchain/toolchain.ts +121 -0
- package/src/utils/json-util.ts +67 -0
- package/src/utils/text-util.ts +68 -0
- package/templates/backend/README.md +13 -0
- package/templates/backend/_gitignore +5 -0
- package/templates/backend/cell.yml +3 -0
- package/templates/backend/package.json +23 -0
- package/templates/{file-service/src → backend/src/node}/home-controller.ts +5 -2
- package/templates/{file-service/src → backend/src/node}/module.ts +0 -1
- package/templates/backend/template.json +3 -0
- package/templates/backend/test/app.spec.ts +19 -0
- package/templates/backend/tsconfig.json +25 -0
- package/templates/fullstack/README.md +13 -0
- package/templates/fullstack/_gitignore +5 -0
- package/templates/fullstack/cell.yml +6 -0
- package/templates/fullstack/package.json +27 -0
- package/templates/fullstack/src/browser/home.view.tsx +19 -0
- package/templates/{cell-component/src → fullstack/src/browser}/module.ts +1 -1
- package/templates/fullstack/src/common/greeting-protocol.ts +5 -0
- package/templates/fullstack/src/node/greeting-server.ts +13 -0
- package/templates/{admin-app/src/browser → fullstack/src/node}/module.ts +2 -1
- package/templates/fullstack/template.json +3 -0
- package/templates/fullstack/test/app.spec.ts +18 -0
- package/templates/fullstack/tsconfig.json +27 -0
- package/bin/cell +0 -2
- package/lib/build/build-manager.d.ts +0 -9
- package/lib/build/build-manager.d.ts.map +0 -1
- package/lib/build/build-manager.js +0 -41
- package/lib/build/build-manager.js.map +0 -1
- package/lib/build/build.d.ts +0 -6
- package/lib/build/build.d.ts.map +0 -1
- package/lib/build/build.js +0 -16
- package/lib/build/build.js.map +0 -1
- package/lib/cell-main.d.ts +0 -2
- package/lib/cell-main.d.ts.map +0 -1
- package/lib/cell-main.js +0 -110
- package/lib/cell-main.js.map +0 -1
- package/lib/cell.d.ts +0 -2
- package/lib/cell.d.ts.map +0 -1
- package/lib/cell.js +0 -194
- package/lib/cell.js.map +0 -1
- package/lib/config/config.d.ts +0 -12
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js +0 -48
- package/lib/config/config.js.map +0 -1
- package/lib/deploy/deploy.d.ts +0 -7
- package/lib/deploy/deploy.d.ts.map +0 -1
- package/lib/deploy/deploy.js +0 -30
- package/lib/deploy/deploy.js.map +0 -1
- package/lib/info/info.d.ts +0 -6
- package/lib/info/info.d.ts.map +0 -1
- package/lib/info/info.js +0 -21
- package/lib/info/info.js.map +0 -1
- package/lib/init/init-manager.d.ts +0 -33
- package/lib/init/init-manager.d.ts.map +0 -1
- package/lib/init/init-manager.js +0 -141
- package/lib/init/init-manager.js.map +0 -1
- package/lib/init/init.d.ts +0 -4
- package/lib/init/init.d.ts.map +0 -1
- package/lib/init/init.js +0 -17
- package/lib/init/init.js.map +0 -1
- package/lib/init/templates.d.ts +0 -2
- package/lib/init/templates.d.ts.map +0 -1
- package/lib/init/templates.js +0 -23
- package/lib/init/templates.js.map +0 -1
- package/lib/package.spec.d.ts +0 -2
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -7
- package/lib/package.spec.js.map +0 -1
- package/lib/props/props.d.ts +0 -9
- package/lib/props/props.d.ts.map +0 -1
- package/lib/props/props.js +0 -49
- package/lib/props/props.js.map +0 -1
- package/lib/serve/serve-manager.d.ts +0 -8
- package/lib/serve/serve-manager.d.ts.map +0 -1
- package/lib/serve/serve-manager.js +0 -44
- package/lib/serve/serve-manager.js.map +0 -1
- package/lib/serve/serve.d.ts +0 -8
- package/lib/serve/serve.d.ts.map +0 -1
- package/lib/serve/serve.js +0 -25
- package/lib/serve/serve.js.map +0 -1
- package/lib/update/update.d.ts +0 -9
- package/lib/update/update.d.ts.map +0 -1
- package/lib/update/update.js +0 -56
- package/lib/update/update.js.map +0 -1
- package/lib/utils/banner-util.d.ts +0 -6
- package/lib/utils/banner-util.d.ts.map +0 -1
- package/lib/utils/banner-util.js +0 -44
- package/lib/utils/banner-util.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -18
- package/lib/utils/index.js.map +0 -1
- package/src/build/build-manager.ts +0 -50
- package/src/build/build.ts +0 -17
- package/src/cell-main.ts +0 -125
- package/src/cell.ts +0 -215
- package/src/config/config.ts +0 -56
- package/src/deploy/deploy.ts +0 -31
- package/src/info/info.ts +0 -23
- package/src/init/init-manager.ts +0 -163
- package/src/init/init.ts +0 -15
- package/src/init/templates.ts +0 -19
- package/src/package.spec.ts +0 -5
- package/src/props/props.ts +0 -48
- package/src/serve/serve-manager.ts +0 -51
- package/src/serve/serve.ts +0 -29
- package/src/update/update.ts +0 -61
- package/src/utils/banner-util.ts +0 -41
- package/src/utils/index.ts +0 -1
- package/templates/accounts/README.md +0 -92
- package/templates/accounts/cell-database.yml +0 -17
- package/templates/accounts/cell-locale.yml +0 -17
- package/templates/accounts/cell-oauth2.0.yml +0 -8
- package/templates/accounts/cell-theme.yml +0 -9
- package/templates/accounts/cell.yml +0 -10
- package/templates/accounts/favicon.ico +0 -0
- package/templates/accounts/package.json +0 -48
- package/templates/accounts/src/browser/home.view.tsx +0 -86
- package/templates/accounts/src/browser/index.ts +0 -3
- package/templates/accounts/src/browser/login.view.tsx +0 -78
- package/templates/accounts/src/browser/module.ts +0 -3
- package/templates/accounts/src/common/entity-protocol.ts +0 -7
- package/templates/accounts/src/common/index.ts +0 -1
- package/templates/accounts/src/node/authentication/authentication-success-handler.ts +0 -69
- package/templates/accounts/src/node/authentication/index.ts +0 -1
- package/templates/accounts/src/node/entity/base-entity.ts +0 -13
- package/templates/accounts/src/node/entity/connection.ts +0 -52
- package/templates/accounts/src/node/entity/index.ts +0 -1
- package/templates/accounts/src/node/entity/user.ts +0 -73
- package/templates/accounts/src/node/error/error.ts +0 -14
- package/templates/accounts/src/node/error/index.ts +0 -1
- package/templates/accounts/src/node/index.ts +0 -2
- package/templates/accounts/src/node/module.ts +0 -9
- package/templates/accounts/src/node/user/index.ts +0 -4
- package/templates/accounts/src/node/user/user-protocol.ts +0 -19
- package/templates/accounts/src/node/user/user-repository.ts +0 -72
- package/templates/accounts/src/node/user/user-service.ts +0 -36
- package/templates/accounts/tsconfig.json +0 -32
- package/templates/admin-app/.github/workflows/deploy.yml +0 -25
- package/templates/admin-app/.vscode/launch.json +0 -23
- package/templates/admin-app/README.md +0 -92
- package/templates/admin-app/cell-database.yml +0 -7
- package/templates/admin-app/cell.yml +0 -93
- package/templates/admin-app/package.json +0 -37
- package/templates/admin-app/src/browser/user.view.tsx +0 -40
- package/templates/admin-app/src/common/index.ts +0 -1
- package/templates/admin-app/src/common/user-protocol.ts +0 -23
- package/templates/admin-app/src/node/entity/index.ts +0 -1
- package/templates/admin-app/src/node/entity/user.ts +0 -15
- package/templates/admin-app/src/node/module.ts +0 -8
- package/templates/admin-app/src/node/user-service.ts +0 -41
- package/templates/admin-app/tsconfig.json +0 -32
- package/templates/backend-app/.github/workflows/deploy.yml +0 -25
- package/templates/backend-app/.vscode/launch.json +0 -23
- package/templates/backend-app/README.md +0 -92
- package/templates/backend-app/cell.yml +0 -0
- package/templates/backend-app/package.json +0 -33
- package/templates/backend-app/src/home-controller.ts +0 -11
- package/templates/backend-app/src/module.ts +0 -4
- package/templates/backend-app/src/user-controller.ts +0 -48
- package/templates/backend-app/test/home-controller.spec.ts +0 -19
- package/templates/backend-app/tsconfig.json +0 -32
- package/templates/cell-component/README.md +0 -27
- package/templates/cell-component/cell.yml +0 -0
- package/templates/cell-component/package.json +0 -29
- package/templates/cell-component/src/echo-service.ts +0 -16
- package/templates/cell-component/src/index.ts +0 -1
- package/templates/cell-component/src/package.spec.ts +0 -5
- package/templates/cell-component/tsconfig.json +0 -37
- package/templates/database-app/.github/workflows/deploy.yml +0 -25
- package/templates/database-app/.vscode/launch.json +0 -23
- package/templates/database-app/README.md +0 -92
- package/templates/database-app/cell.yml +0 -17
- package/templates/database-app/package.json +0 -31
- package/templates/database-app/src/entity/index.ts +0 -1
- package/templates/database-app/src/entity/user.ts +0 -13
- package/templates/database-app/src/home-controller.ts +0 -11
- package/templates/database-app/src/module.ts +0 -8
- package/templates/database-app/src/user-controller.ts +0 -43
- package/templates/database-app/tsconfig.json +0 -32
- package/templates/docker-app/.github/workflows/deploy.yml +0 -25
- package/templates/docker-app/.vscode/launch.json +0 -23
- package/templates/docker-app/Dockerfile +0 -27
- package/templates/docker-app/README.md +0 -93
- package/templates/docker-app/cell.yml +0 -0
- package/templates/docker-app/package.json +0 -31
- package/templates/docker-app/src/browser/assets/logo.png +0 -0
- package/templates/docker-app/src/browser/css-shims.d.ts +0 -30
- package/templates/docker-app/src/browser/hello.view.tsx +0 -31
- package/templates/docker-app/src/browser/module.ts +0 -3
- package/templates/docker-app/src/browser/style/hello.module.scss +0 -4
- package/templates/docker-app/src/common/welcome-protocol.ts +0 -5
- package/templates/docker-app/src/node/module.ts +0 -3
- package/templates/docker-app/src/node/welcome-server.ts +0 -9
- package/templates/docker-app/tsconfig.json +0 -33
- package/templates/file-service/.github/workflows/deploy.yml +0 -25
- package/templates/file-service/.vscode/launch.json +0 -23
- package/templates/file-service/README.md +0 -92
- package/templates/file-service/cell.yml +0 -12
- package/templates/file-service/package.json +0 -34
- package/templates/file-service/src/file-controller.ts +0 -47
- package/templates/file-service/tsconfig.json +0 -32
- package/templates/jwt-app/.github/workflows/deploy.yml +0 -25
- package/templates/jwt-app/.vscode/launch.json +0 -23
- package/templates/jwt-app/README.md +0 -92
- package/templates/jwt-app/cell.yml +0 -4
- package/templates/jwt-app/package.json +0 -36
- package/templates/jwt-app/src/context.ts +0 -16
- package/templates/jwt-app/src/error-handler.ts +0 -30
- package/templates/jwt-app/src/error.ts +0 -4
- package/templates/jwt-app/src/home-controller.ts +0 -23
- package/templates/jwt-app/src/index.ts +0 -5
- package/templates/jwt-app/src/jwt-middleware.ts +0 -36
- package/templates/jwt-app/src/module.ts +0 -3
- package/templates/jwt-app/test/home-controller.spec.ts +0 -19
- package/templates/jwt-app/tsconfig.json +0 -32
- package/templates/koa-app/app.js +0 -8
- package/templates/koa-app/package.json +0 -9
- package/templates/microservice/.github/workflows/deploy.yml +0 -28
- package/templates/microservice/.vscode/launch.json +0 -24
- package/templates/microservice/README.md +0 -92
- package/templates/microservice/examples/backend-app/README.md +0 -92
- package/templates/microservice/examples/backend-app/cell-remote.yml +0 -4
- package/templates/microservice/examples/backend-app/cell.yml +0 -3
- package/templates/microservice/examples/backend-app/package.json +0 -32
- package/templates/microservice/examples/backend-app/src/api-controller.ts +0 -31
- package/templates/microservice/examples/backend-app/src/module.ts +0 -3
- package/templates/microservice/examples/backend-app/tsconfig.json +0 -32
- package/templates/microservice/package.json +0 -20
- package/templates/microservice/packages/api/README.md +0 -92
- package/templates/microservice/packages/api/cell.yml +0 -0
- package/templates/microservice/packages/api/package.json +0 -25
- package/templates/microservice/packages/api/src/common/api-protocol.ts +0 -10
- package/templates/microservice/packages/api/src/common/index.ts +0 -1
- package/templates/microservice/packages/api/tsconfig.json +0 -30
- package/templates/microservice/packages/serviceA/.vscode/launch.json +0 -23
- package/templates/microservice/packages/serviceA/README.md +0 -92
- package/templates/microservice/packages/serviceA/cell.yml +0 -6
- package/templates/microservice/packages/serviceA/package.json +0 -29
- package/templates/microservice/packages/serviceA/src/node/module.ts +0 -3
- package/templates/microservice/packages/serviceA/src/node/service-a.ts +0 -9
- package/templates/microservice/packages/serviceA/tsconfig.json +0 -30
- package/templates/microservice/packages/serviceB/README.md +0 -92
- package/templates/microservice/packages/serviceB/cell.yml +0 -5
- package/templates/microservice/packages/serviceB/package.json +0 -29
- package/templates/microservice/packages/serviceB/src/node/module.ts +0 -3
- package/templates/microservice/packages/serviceB/src/node/service-b.ts +0 -9
- package/templates/microservice/packages/serviceB/tsconfig.json +0 -30
- package/templates/microservice/tsconfig.json +0 -32
- package/templates/mycli/.vscode/launch.json +0 -33
- package/templates/mycli/bin/mycli +0 -2
- package/templates/mycli/bin/mycli-deploy +0 -2
- package/templates/mycli/bin/mycli-init +0 -2
- package/templates/mycli/package.json +0 -33
- package/templates/mycli/src/bootstrap.ts +0 -7
- package/templates/mycli/src/constants.ts +0 -1
- package/templates/mycli/src/deploy/deploy-manager.ts +0 -12
- package/templates/mycli/src/deploy/deploy.ts +0 -16
- package/templates/mycli/src/deploy/index.ts +0 -1
- package/templates/mycli/src/index.ts +0 -2
- package/templates/mycli/src/init/index.ts +0 -1
- package/templates/mycli/src/init/init-manager.ts +0 -85
- package/templates/mycli/src/init/init.ts +0 -25
- package/templates/mycli/src/init/templates.ts +0 -3
- package/templates/mycli/src/module.ts +0 -3
- package/templates/mycli/src/mycli.ts +0 -13
- package/templates/mycli/templates/application-template/README.md +0 -0
- package/templates/mycli/tsconfig.json +0 -32
- package/templates/nest-app/.eslintrc.js +0 -25
- package/templates/nest-app/.prettierrc +0 -4
- package/templates/nest-app/README.md +0 -73
- package/templates/nest-app/nest-cli.json +0 -8
- package/templates/nest-app/package.json +0 -69
- package/templates/nest-app/src/app.controller.spec.ts +0 -22
- package/templates/nest-app/src/app.controller.ts +0 -12
- package/templates/nest-app/src/app.module.ts +0 -10
- package/templates/nest-app/src/app.service.ts +0 -8
- package/templates/nest-app/src/main.ts +0 -8
- package/templates/nest-app/test/app.e2e-spec.ts +0 -24
- package/templates/nest-app/test/jest-e2e.json +0 -9
- package/templates/nest-app/tsconfig.build.json +0 -12
- package/templates/nest-app/tsconfig.json +0 -25
- package/templates/nextjs-app/.eslintrc.json +0 -3
- package/templates/nextjs-app/README.md +0 -34
- package/templates/nextjs-app/next.config.js +0 -6
- package/templates/nextjs-app/package.json +0 -20
- package/templates/nextjs-app/pages/_app.js +0 -7
- package/templates/nextjs-app/pages/api/hello.js +0 -5
- package/templates/nextjs-app/pages/index.js +0 -69
- package/templates/nextjs-app/public/favicon.ico +0 -0
- package/templates/nextjs-app/public/vercel.svg +0 -4
- package/templates/nextjs-app/styles/Home.module.css +0 -116
- package/templates/nextjs-app/styles/globals.css +0 -16
- package/templates/sample-app/.github/workflows/deploy.yml +0 -25
- package/templates/sample-app/.vscode/launch.json +0 -23
- package/templates/sample-app/README.md +0 -92
- package/templates/sample-app/cell.yml +0 -0
- package/templates/sample-app/package.json +0 -31
- package/templates/sample-app/src/browser/assets/logo.png +0 -0
- package/templates/sample-app/src/browser/css-shims.d.ts +0 -30
- package/templates/sample-app/src/browser/hello.view.tsx +0 -31
- package/templates/sample-app/src/browser/module.ts +0 -3
- package/templates/sample-app/src/browser/style/hello.module.scss +0 -4
- package/templates/sample-app/src/common/welcome-protocol.ts +0 -5
- package/templates/sample-app/src/node/module.ts +0 -3
- package/templates/sample-app/src/node/welcome-server.ts +0 -9
- package/templates/sample-app/tsconfig.json +0 -32
- package/templates/schedule/.github/workflows/deploy.yml +0 -25
- package/templates/schedule/.vscode/launch.json +0 -23
- package/templates/schedule/README.md +0 -92
- package/templates/schedule/cell.yml +0 -1
- package/templates/schedule/package.json +0 -29
- package/templates/schedule/src/module.ts +0 -3
- package/templates/schedule/src/scheduler.ts +0 -10
- package/templates/schedule/tsconfig.json +0 -32
- package/templates/standalone-app/package.json +0 -17
- package/templates/standalone-app/src/app.service.ts +0 -10
- package/templates/standalone-app/src/main.ts +0 -14
- package/templates/standalone-app/src/module.ts +0 -3
- package/templates/standalone-app/tsconfig.json +0 -30
- package/templates/vue-app/.github/workflows/deploy.yml +0 -25
- package/templates/vue-app/.vscode/launch.json +0 -23
- package/templates/vue-app/README.md +0 -92
- package/templates/vue-app/cell.yml +0 -0
- package/templates/vue-app/package.json +0 -32
- package/templates/vue-app/src/browser/App.vue +0 -32
- package/templates/vue-app/src/browser/app.ts +0 -7
- package/templates/vue-app/src/browser/components/HelloWorld.vue +0 -42
- package/templates/vue-app/src/browser/declare.d.ts +0 -7
- package/templates/vue-app/src/browser/images/logo.png +0 -0
- package/templates/vue-app/src/browser/module.ts +0 -3
- package/templates/vue-app/src/browser/router.ts +0 -13
- package/templates/vue-app/src/browser/shims-vue.d.ts +0 -5
- package/templates/vue-app/src/browser/views/About.vue +0 -5
- package/templates/vue-app/src/browser/views/Root.vue +0 -37
- package/templates/vue-app/src/common/welcome-protocol.ts +0 -5
- package/templates/vue-app/src/node/module.ts +0 -3
- package/templates/vue-app/src/node/welcome-server.ts +0 -9
- package/templates/vue-app/tsconfig.json +0 -32
package/lib/update/update.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
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
|
package/lib/update/update.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;QAC1B,MAAM,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;QAC/C,MAAM,YAAY,SAAG,UAAU,CAAC,YAAY,mCAAI,EAAE,CAAC;QACnD,MAAM,eAAe,SAAG,UAAU,CAAC,eAAe,mCAAI,EAAE,CAAC;QACzD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,YAAY,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;YACjC,CAAC;QACL,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YAC9C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,eAAe,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;YACpC,CAAC;QACL,CAAC;QACD,MAAM,IAAA,oBAAS,EAAC,WAAW,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,sBAAsB,EAAE,CAAC;YACzB,MAAM,IAAA,mBAAW,GAAE,CAAC,OAAO,EAAE,CAAC;QAClC,CAAC;IACL,CAAC;AACL,CAAC;kBAEc,KAAK,EAAE,GAAe,EAAE,OAAsB,EAAE,EAAE;IAC7D,IAAI,CAAC;QACD,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,OAAO,EAAE,CAAC;YACV,IAAI,OAAO,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;gBAC1B,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;YAC/E,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,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,CAAC;gBAC7B,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;YAC9E,CAAC;QACL,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;AAEL,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/utils/banner-util.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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.CELL_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 = BannerUtil = {}));
|
|
44
|
-
//# sourceMappingURL=banner-util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;YACxC,UAAU,GAAG,OAAO,CAAC;YACrB,IAAI,SAAS,EAAE,CAAC;gBACZ,UAAU,GAAG,OAAO,KAAK,2BAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YAChG,CAAC;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;QACtH,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,MAAM,CAAC;QAC1D,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;QAC3F,CAAC;aAAM,CAAC;YACJ,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;QACK,CAAC;IACL,CAAC;IAhCe,WAAA,KAAK,QAgCpB,CAAA;AACL,CAAC,EAlCgB,UAAU,aAAV,UAAU,GAAV,UAAU,QAkC1B"}
|
package/lib/utils/index.d.ts
DELETED
package/lib/utils/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/lib/utils/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
package/lib/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -1,50 +0,0 @@
|
|
|
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.BuildCommand, CommandStage.before);
|
|
38
|
-
await hookExecutor.executeBuildHooks(this.ctx, HookStage.before);
|
|
39
|
-
|
|
40
|
-
await CommandUtil.executeCommand(this.ctx, CommandType.BuildCommand);
|
|
41
|
-
await hookExecutor.executeBuildHooks(this.ctx);
|
|
42
|
-
|
|
43
|
-
await CommandUtil.executeCommand(this.ctx, CommandType.CompileCommand, CommandStage.after);
|
|
44
|
-
await hookExecutor.executeCompileHooks(this.ctx, HookStage.after);
|
|
45
|
-
|
|
46
|
-
await CommandUtil.executeCommand(this.ctx, CommandType.BuildCommand, CommandStage.after);
|
|
47
|
-
await hookExecutor.executeBuildHooks(this.ctx, HookStage.after);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|
package/src/build/build.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
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.CELL_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' || messageEvent.type === 'entry') {
|
|
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
|
-
}
|
package/src/cell.ts
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
const leven = require('leven');
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
import { HookExecutor, HookStage } from '@celljs/cli-common/lib/hook/hook-executor';
|
|
4
|
-
import { CommandUtil } from '@celljs/cli-common/lib/utils/command-util';
|
|
5
|
-
import { program, Command } from '@celljs/cli-common/lib/command/command-protocol';
|
|
6
|
-
import { BannerUtil } from './utils/banner-util';
|
|
7
|
-
import build from './build/build';
|
|
8
|
-
import serve from './serve/serve';
|
|
9
|
-
import deploy from './deploy/deploy';
|
|
10
|
-
const chalk = require('chalk');
|
|
11
|
-
const updateNotifier = require('update-notifier');
|
|
12
|
-
const pkg = require('../package.json');
|
|
13
|
-
|
|
14
|
-
const version = pkg.version;
|
|
15
|
-
updateNotifier({ pkg }).notify();
|
|
16
|
-
|
|
17
|
-
const spinner = ora({ text: chalk.italic.gray('loading command line context...\n'), discardStdin: false });
|
|
18
|
-
|
|
19
|
-
(async () => {
|
|
20
|
-
const { runtime, framework, settings } = JSON.parse(process.env.CELL_RFS!);
|
|
21
|
-
BannerUtil.print(version, settings, runtime, framework);
|
|
22
|
-
|
|
23
|
-
spinner.start();
|
|
24
|
-
const context = await CommandUtil.loadContext(settings, framework, runtime, undefined, spinner);
|
|
25
|
-
await new HookExecutor().executeHooks(context, 'cliHooks', HookStage.before);
|
|
26
|
-
const { componentPackages, configHookModules, webpackHookModules, serveHookModules, buildHookModules, deployHookModules, infoHookModules, propsHookModules } = context.pkg;
|
|
27
|
-
|
|
28
|
-
if (CommandUtil.includesCommand(context.args, settings.compileCommands)) {
|
|
29
|
-
process.send!({
|
|
30
|
-
type: 'cliContext',
|
|
31
|
-
data: {
|
|
32
|
-
components: componentPackages.map(c => c.cellComponent),
|
|
33
|
-
configHookModules,
|
|
34
|
-
webpackHookModules,
|
|
35
|
-
serveHookModules,
|
|
36
|
-
buildHookModules,
|
|
37
|
-
deployHookModules,
|
|
38
|
-
infoHookModules,
|
|
39
|
-
propsHookModules
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
program
|
|
45
|
-
.version(version, '-V, --version', 'version for cell')
|
|
46
|
-
.option('-t, --targets [targets]', 'targets for cell', value => value ? value.split(',') : [])
|
|
47
|
-
.option('-m, --mode [mode]', 'mode for cell', value => value ? value.split(',') : [])
|
|
48
|
-
.option('--props-dir [propsDir]', 'props directory for cell')
|
|
49
|
-
.option('--props-file [propsFile]', 'props file for cell')
|
|
50
|
-
.option('--skip-auto-install [skipAutoInstall]', 'skip automatic installation of components for cell')
|
|
51
|
-
.usage('<command> [options]');
|
|
52
|
-
|
|
53
|
-
program
|
|
54
|
-
.command('init [template]')
|
|
55
|
-
.option('-o, --output-dir [path]', 'output directory')
|
|
56
|
-
.option('-p --packager [packager]', 'package manager(pnpm, yarn, npm)')
|
|
57
|
-
.description('init a application')
|
|
58
|
-
.action((template, options) => {
|
|
59
|
-
require('./init/init').default({ template, ...options });
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
program
|
|
63
|
-
.command('serve')
|
|
64
|
-
.option('-p, --port [port]', 'port used by the server')
|
|
65
|
-
.option('-c, --command [command]', 'override default serve arguments with a custom command (e.g. "start --dev"), keeping original node and script path for compatibility')
|
|
66
|
-
.description('serve a applicaton')
|
|
67
|
-
.action((entry, options) => {
|
|
68
|
-
serve(context, { entry, ...options });
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
program
|
|
72
|
-
.command('build')
|
|
73
|
-
.description('build a application')
|
|
74
|
-
.action((entry, options) => {
|
|
75
|
-
build(context, { entry, ...options });
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
program
|
|
79
|
-
.command('deploy')
|
|
80
|
-
.option('-s, --skip-build [skipBuild]', 'skip the build process')
|
|
81
|
-
.description('deploy a applicaton')
|
|
82
|
-
.action((entry, options) => {
|
|
83
|
-
deploy(context, { entry, ...options });
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
program
|
|
87
|
-
.command('props')
|
|
88
|
-
.description('display properties about application')
|
|
89
|
-
.option('-n, --name [name]', 'get the property value of the specified name')
|
|
90
|
-
.option('-f, --frontend [frontend]', 'frontend properties')
|
|
91
|
-
.option('-b, --backend [backend]', 'backend properties')
|
|
92
|
-
.action(options => {
|
|
93
|
-
require('./props/props').default(context, { ...options });
|
|
94
|
-
});
|
|
95
|
-
program
|
|
96
|
-
.command('info')
|
|
97
|
-
.description('display information about application')
|
|
98
|
-
.action(options => {
|
|
99
|
-
require('./info/info').default(context, { ...options });
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
program
|
|
103
|
-
.command('config')
|
|
104
|
-
.option('--default-runtime [defaultRuntime]', 'default runtime')
|
|
105
|
-
.option('--default-mode [defaultMode]', 'default mode', value => value ? value.split(',') : [])
|
|
106
|
-
.option('--frameworks-url [frameworksUrl]', 'frameworks url')
|
|
107
|
-
.option('--frameworks-upstream-url [frameworksUpStreamUrl]', 'frameworks upstream url')
|
|
108
|
-
.option('--config-file-alias [configFileAlias]', 'config file alias')
|
|
109
|
-
.option('--show [show]', 'show properties for the application')
|
|
110
|
-
.description('configure properties for the application')
|
|
111
|
-
.action(options => {
|
|
112
|
-
require('./config/config').default(context, { ...options });
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
program
|
|
116
|
-
.command('update')
|
|
117
|
-
.option('-v, --version [version]', 'version for cell')
|
|
118
|
-
.option('-d, --dist-tag [distTag]', 'Which dist-tag to use to find the latest version')
|
|
119
|
-
.option('-s, --skip-installing-component [skipIntallingComponent]', 'skip installing components')
|
|
120
|
-
.description('update cell cli and current project\'s cell components')
|
|
121
|
-
.action(options => {
|
|
122
|
-
require('./update/update').default(context, { ...options });
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const runtimeCmd = program
|
|
126
|
-
.command('runtime [command]')
|
|
127
|
-
.alias('r')
|
|
128
|
-
.description('management runtime');
|
|
129
|
-
runtimeCmd
|
|
130
|
-
.command('install [runtime] [alias]')
|
|
131
|
-
.alias('i')
|
|
132
|
-
.description('install a runtime')
|
|
133
|
-
.option('-f, --force-installing-component [forceInstallingComponent]', 'force installing component')
|
|
134
|
-
.option('-o, --overwrite [overwrite]', 'overwrite existing runtime')
|
|
135
|
-
.option('-v, --version [version]', 'specify runtime version', 'latest')
|
|
136
|
-
.action((r, alias, options) => {
|
|
137
|
-
require('@celljs/cli-runtime/lib/install/install').default({ runtime: r, alias, ...options });
|
|
138
|
-
});
|
|
139
|
-
runtimeCmd
|
|
140
|
-
.command('use [runtime]')
|
|
141
|
-
.description('use a runtime')
|
|
142
|
-
.action(r => {
|
|
143
|
-
require('@celljs/cli-runtime/lib/use/use').default({ runtime: r });
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
runtimeCmd
|
|
147
|
-
.command('list')
|
|
148
|
-
.alias('ls')
|
|
149
|
-
.description('list all runtimes')
|
|
150
|
-
.action(() => {
|
|
151
|
-
require('@celljs/cli-runtime/lib/list/list').default({});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
runtimeCmd
|
|
155
|
-
.command('uninstall [runtime]')
|
|
156
|
-
.alias('u')
|
|
157
|
-
.description('uninstall a runtime')
|
|
158
|
-
.action(r => {
|
|
159
|
-
require('@celljs/cli-runtime/lib/uninstall/uninstall').default({ runtime: r });
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
await new HookExecutor().executeHooks(context, 'cliHooks');
|
|
163
|
-
spinner.stop();
|
|
164
|
-
|
|
165
|
-
program
|
|
166
|
-
.arguments('[command]')
|
|
167
|
-
.action(cmd => {
|
|
168
|
-
program.outputHelp();
|
|
169
|
-
if (cmd) {
|
|
170
|
-
console.log();
|
|
171
|
-
console.log(chalk.red(`Unknown command ${chalk.yellow(cmd)}.`));
|
|
172
|
-
console.log();
|
|
173
|
-
suggestCommands(cmd, program);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
runtimeCmd
|
|
179
|
-
.arguments('[command]')
|
|
180
|
-
.action(cmd => {
|
|
181
|
-
runtimeCmd.outputHelp();
|
|
182
|
-
if (cmd) {
|
|
183
|
-
console.log();
|
|
184
|
-
console.log(chalk.red(`Unknown command ${chalk.yellow(cmd)}.`));
|
|
185
|
-
console.log();
|
|
186
|
-
suggestCommands(cmd, runtimeCmd);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
});
|
|
190
|
-
program.addHelpText('after', '\nUse "cell [command] --help" for more information about a command.');
|
|
191
|
-
program.parse(process.argv);
|
|
192
|
-
|
|
193
|
-
})().catch(error => {
|
|
194
|
-
spinner.stop();
|
|
195
|
-
console.error(error);
|
|
196
|
-
process.exit(-1);
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
function suggestCommands(unknownCommand: string, main: Command) {
|
|
200
|
-
const availableCommands = main.commands.map((cmd: Command) => cmd.name());
|
|
201
|
-
|
|
202
|
-
let suggestion = '';
|
|
203
|
-
|
|
204
|
-
availableCommands.forEach((cmd: string) => {
|
|
205
|
-
const isBestMatch = leven(cmd, unknownCommand) < leven(suggestion, unknownCommand);
|
|
206
|
-
if (leven(cmd, unknownCommand) <= 3 && isBestMatch) {
|
|
207
|
-
suggestion = cmd;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
if (suggestion) {
|
|
212
|
-
console.log(` ${chalk.yellow(`Did you mean ${chalk.green(suggestion)}?`)}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
package/src/config/config.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CliContext } from '@celljs/cli-common/lib/context/context-protocol';
|
|
3
|
-
import { HookExecutor, HookStage } from '@celljs/cli-common/lib/hook/hook-executor';
|
|
4
|
-
import { SettingsUtil } from '@celljs/cli-common/lib/settings/settings-util';
|
|
5
|
-
|
|
6
|
-
import { dump } from 'js-yaml';
|
|
7
|
-
|
|
8
|
-
export interface ConfigOptions {
|
|
9
|
-
frameworksUrl?: string;
|
|
10
|
-
frameworksUpstreamUrl?: boolean;
|
|
11
|
-
configFileAlias?: string;
|
|
12
|
-
defaultMode?: string[];
|
|
13
|
-
defaultRuntime?: string[];
|
|
14
|
-
show?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default async (ctx: CliContext, options: ConfigOptions) => {
|
|
18
|
-
try {
|
|
19
|
-
ctx.options = options;
|
|
20
|
-
const hookExecutor = new HookExecutor();
|
|
21
|
-
await hookExecutor.executeConfigHooks(ctx, HookStage.before);
|
|
22
|
-
if (options.defaultMode?.length) {
|
|
23
|
-
SettingsUtil.updateSettings({
|
|
24
|
-
defaultMode: options.defaultMode
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
if (options.defaultRuntime) {
|
|
28
|
-
SettingsUtil.updateSettings({
|
|
29
|
-
defaultRuntime: options.defaultRuntime
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
if (options.frameworksUpstreamUrl || options.frameworksUrl) {
|
|
33
|
-
SettingsUtil.updateSettings({
|
|
34
|
-
frameworks: {
|
|
35
|
-
url: options.frameworksUrl,
|
|
36
|
-
upstreamUrl: options.frameworksUpstreamUrl
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (options.configFileAlias) {
|
|
41
|
-
SettingsUtil.updateSettings({
|
|
42
|
-
configFileAlias: options.configFileAlias
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
if (options.show) {
|
|
46
|
-
ctx.output.settings = SettingsUtil.getSettings();
|
|
47
|
-
}
|
|
48
|
-
await hookExecutor.executeConfigHooks(ctx);
|
|
49
|
-
if (options.show) {
|
|
50
|
-
console.log(dump(ctx.output));
|
|
51
|
-
}
|
|
52
|
-
} catch (error) {
|
|
53
|
-
console.error(error);
|
|
54
|
-
process.exit(-1);
|
|
55
|
-
}
|
|
56
|
-
};
|
package/src/deploy/deploy.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import build from '../build/build';
|
|
3
|
-
import { HookExecutor, HookStage } from '@celljs/cli-common/lib/hook/hook-executor';
|
|
4
|
-
import { CliContext, ContextUtils } from '@celljs/cli-common/lib/context/context-protocol';
|
|
5
|
-
import { CommandUtil, CommandType, CommandStage } from '@celljs/cli-common/lib/utils/command-util';
|
|
6
|
-
|
|
7
|
-
export interface DeplyOptions {
|
|
8
|
-
skipBuild?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default async (ctx: CliContext, options: DeplyOptions) => {
|
|
12
|
-
try {
|
|
13
|
-
ctx.options = options;
|
|
14
|
-
ctx = ContextUtils.mergeContext(ctx, options);
|
|
15
|
-
const hookExecutor = new HookExecutor();
|
|
16
|
-
await CommandUtil.executeCommand(ctx, CommandType.DeployCommand, CommandStage.before);
|
|
17
|
-
await hookExecutor.executeDeployHooks(ctx, HookStage.before);
|
|
18
|
-
if (!options.skipBuild) {
|
|
19
|
-
await build(ctx, options);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
await CommandUtil.executeCommand(ctx, CommandType.DeployCommand);
|
|
23
|
-
|
|
24
|
-
await hookExecutor.executeDeployHooks(ctx);
|
|
25
|
-
await hookExecutor.executeDeployHooks(ctx, HookStage.after);
|
|
26
|
-
await CommandUtil.executeCommand(ctx, CommandType.DeployCommand, CommandStage.after);
|
|
27
|
-
} catch (error) {
|
|
28
|
-
console.error(error);
|
|
29
|
-
process.exit(-1);
|
|
30
|
-
}
|
|
31
|
-
};
|