@simplysm/sd-cli 12.16.27 → 13.0.0-beta.12
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 +529 -0
- package/dist/builders/BaseBuilder.js +86 -0
- package/dist/builders/BaseBuilder.js.map +7 -0
- package/dist/builders/DtsBuilder.js +109 -0
- package/dist/builders/DtsBuilder.js.map +7 -0
- package/dist/builders/LibraryBuilder.js +122 -0
- package/dist/builders/LibraryBuilder.js.map +7 -0
- package/dist/builders/index.js +9 -0
- package/dist/builders/index.js.map +7 -0
- package/dist/builders/types.js +1 -0
- package/dist/builders/types.js.map +7 -0
- package/dist/capacitor/capacitor.js +619 -0
- package/dist/capacitor/capacitor.js.map +7 -0
- package/dist/commands/add-client.js +83 -0
- package/dist/commands/add-client.js.map +7 -0
- package/dist/commands/add-server.js +91 -0
- package/dist/commands/add-server.js.map +7 -0
- package/dist/commands/build.js +310 -0
- package/dist/commands/build.js.map +7 -0
- package/dist/commands/dev.js +426 -0
- package/dist/commands/dev.js.map +7 -0
- package/dist/commands/device.js +107 -0
- package/dist/commands/device.js.map +7 -0
- package/dist/commands/init.js +58 -0
- package/dist/commands/init.js.map +7 -0
- package/dist/commands/lint.js +138 -0
- package/dist/commands/lint.js.map +7 -0
- package/dist/commands/publish.js +401 -0
- package/dist/commands/publish.js.map +7 -0
- package/dist/commands/typecheck.js +197 -0
- package/dist/commands/typecheck.js.map +7 -0
- package/dist/commands/watch.js +19 -0
- package/dist/commands/watch.js.map +7 -0
- package/dist/core-common/src/common.types.d.ts +74 -0
- package/dist/core-common/src/common.types.d.ts.map +1 -0
- package/dist/core-common/src/env.d.ts +6 -0
- package/dist/core-common/src/env.d.ts.map +1 -0
- package/dist/core-common/src/errors/argument-error.d.ts +25 -0
- package/dist/core-common/src/errors/argument-error.d.ts.map +1 -0
- package/dist/core-common/src/errors/not-implemented-error.d.ts +29 -0
- package/dist/core-common/src/errors/not-implemented-error.d.ts.map +1 -0
- package/dist/core-common/src/errors/sd-error.d.ts +27 -0
- package/dist/core-common/src/errors/sd-error.d.ts.map +1 -0
- package/dist/core-common/src/errors/timeout-error.d.ts +31 -0
- package/dist/core-common/src/errors/timeout-error.d.ts.map +1 -0
- package/dist/core-common/src/extensions/arr-ext.d.ts +15 -0
- package/dist/core-common/src/extensions/arr-ext.d.ts.map +1 -0
- package/dist/core-common/src/extensions/arr-ext.helpers.d.ts +19 -0
- package/dist/core-common/src/extensions/arr-ext.helpers.d.ts.map +1 -0
- package/dist/core-common/src/extensions/arr-ext.types.d.ts +215 -0
- package/dist/core-common/src/extensions/arr-ext.types.d.ts.map +1 -0
- package/dist/core-common/src/extensions/map-ext.d.ts +57 -0
- package/dist/core-common/src/extensions/map-ext.d.ts.map +1 -0
- package/dist/core-common/src/extensions/set-ext.d.ts +36 -0
- package/dist/core-common/src/extensions/set-ext.d.ts.map +1 -0
- package/dist/core-common/src/features/debounce-queue.d.ts +53 -0
- package/dist/core-common/src/features/debounce-queue.d.ts.map +1 -0
- package/dist/core-common/src/features/event-emitter.d.ts +66 -0
- package/dist/core-common/src/features/event-emitter.d.ts.map +1 -0
- package/dist/core-common/src/features/serial-queue.d.ts +47 -0
- package/dist/core-common/src/features/serial-queue.d.ts.map +1 -0
- package/dist/core-common/src/index.d.ts +32 -0
- package/dist/core-common/src/index.d.ts.map +1 -0
- package/dist/core-common/src/types/date-only.d.ts +152 -0
- package/dist/core-common/src/types/date-only.d.ts.map +1 -0
- package/dist/core-common/src/types/date-time.d.ts +96 -0
- package/dist/core-common/src/types/date-time.d.ts.map +1 -0
- package/dist/core-common/src/types/lazy-gc-map.d.ts +80 -0
- package/dist/core-common/src/types/lazy-gc-map.d.ts.map +1 -0
- package/dist/core-common/src/types/time.d.ts +68 -0
- package/dist/core-common/src/types/time.d.ts.map +1 -0
- package/dist/core-common/src/types/uuid.d.ts +35 -0
- package/dist/core-common/src/types/uuid.d.ts.map +1 -0
- package/dist/core-common/src/utils/bytes.d.ts +51 -0
- package/dist/core-common/src/utils/bytes.d.ts.map +1 -0
- package/dist/core-common/src/utils/date-format.d.ts +90 -0
- package/dist/core-common/src/utils/date-format.d.ts.map +1 -0
- package/dist/core-common/src/utils/json.d.ts +34 -0
- package/dist/core-common/src/utils/json.d.ts.map +1 -0
- package/dist/core-common/src/utils/num.d.ts +60 -0
- package/dist/core-common/src/utils/num.d.ts.map +1 -0
- package/dist/core-common/src/utils/obj.d.ts +258 -0
- package/dist/core-common/src/utils/obj.d.ts.map +1 -0
- package/dist/core-common/src/utils/path.d.ts +23 -0
- package/dist/core-common/src/utils/path.d.ts.map +1 -0
- package/dist/core-common/src/utils/primitive.d.ts +18 -0
- package/dist/core-common/src/utils/primitive.d.ts.map +1 -0
- package/dist/core-common/src/utils/str.d.ts +103 -0
- package/dist/core-common/src/utils/str.d.ts.map +1 -0
- package/dist/core-common/src/utils/template-strings.d.ts +84 -0
- package/dist/core-common/src/utils/template-strings.d.ts.map +1 -0
- package/dist/core-common/src/utils/transferable.d.ts +47 -0
- package/dist/core-common/src/utils/transferable.d.ts.map +1 -0
- package/dist/core-common/src/utils/wait.d.ts +19 -0
- package/dist/core-common/src/utils/wait.d.ts.map +1 -0
- package/dist/core-common/src/utils/xml.d.ts +36 -0
- package/dist/core-common/src/utils/xml.d.ts.map +1 -0
- package/dist/core-common/src/zip/sd-zip.d.ts +80 -0
- package/dist/core-common/src/zip/sd-zip.d.ts.map +1 -0
- package/dist/core-node/src/features/fs-watcher.d.ts +70 -0
- package/dist/core-node/src/features/fs-watcher.d.ts.map +1 -0
- package/dist/core-node/src/index.d.ts +7 -0
- package/dist/core-node/src/index.d.ts.map +1 -0
- package/dist/core-node/src/utils/fs.d.ts +197 -0
- package/dist/core-node/src/utils/fs.d.ts.map +1 -0
- package/dist/core-node/src/utils/path.d.ts +75 -0
- package/dist/core-node/src/utils/path.d.ts.map +1 -0
- package/dist/core-node/src/worker/create-worker.d.ts +23 -0
- package/dist/core-node/src/worker/create-worker.d.ts.map +1 -0
- package/dist/core-node/src/worker/types.d.ts +67 -0
- package/dist/core-node/src/worker/types.d.ts.map +1 -0
- package/dist/core-node/src/worker/worker.d.ts +27 -0
- package/dist/core-node/src/worker/worker.d.ts.map +1 -0
- package/dist/electron/electron.js +242 -0
- package/dist/electron/electron.js.map +7 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/infra/ResultCollector.js +59 -0
- package/dist/infra/ResultCollector.js.map +7 -0
- package/dist/infra/SignalHandler.js +44 -0
- package/dist/infra/SignalHandler.js.map +7 -0
- package/dist/infra/WorkerManager.js +56 -0
- package/dist/infra/WorkerManager.js.map +7 -0
- package/dist/infra/index.js +9 -0
- package/dist/infra/index.js.map +7 -0
- package/dist/orchestrators/WatchOrchestrator.js +135 -0
- package/dist/orchestrators/WatchOrchestrator.js.map +7 -0
- package/dist/orchestrators/index.js +5 -0
- package/dist/orchestrators/index.js.map +7 -0
- package/dist/sd-cli/src/builders/BaseBuilder.d.ts +77 -0
- package/dist/sd-cli/src/builders/BaseBuilder.d.ts.map +1 -0
- package/dist/sd-cli/src/builders/DtsBuilder.d.ts +22 -0
- package/dist/sd-cli/src/builders/DtsBuilder.d.ts.map +1 -0
- package/dist/sd-cli/src/builders/LibraryBuilder.d.ts +22 -0
- package/dist/sd-cli/src/builders/LibraryBuilder.d.ts.map +1 -0
- package/dist/sd-cli/src/builders/index.d.ts +5 -0
- package/dist/sd-cli/src/builders/index.d.ts.map +1 -0
- package/dist/sd-cli/src/builders/types.d.ts +49 -0
- package/dist/sd-cli/src/builders/types.d.ts.map +1 -0
- package/dist/sd-cli/src/capacitor/capacitor.d.ts +131 -0
- package/dist/sd-cli/src/capacitor/capacitor.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/add-client.d.ts +18 -0
- package/dist/sd-cli/src/commands/add-client.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/add-server.d.ts +18 -0
- package/dist/sd-cli/src/commands/add-server.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/build.d.ts +25 -0
- package/dist/sd-cli/src/commands/build.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/dev.d.ts +23 -0
- package/dist/sd-cli/src/commands/dev.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/device.d.ts +22 -0
- package/dist/sd-cli/src/commands/device.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/init.d.ts +15 -0
- package/dist/sd-cli/src/commands/init.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/lint.d.ts +31 -0
- package/dist/sd-cli/src/commands/lint.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/publish.d.ts +27 -0
- package/dist/sd-cli/src/commands/publish.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/typecheck.d.ts +39 -0
- package/dist/sd-cli/src/commands/typecheck.d.ts.map +1 -0
- package/dist/sd-cli/src/commands/watch.d.ts +20 -0
- package/dist/sd-cli/src/commands/watch.d.ts.map +1 -0
- package/dist/sd-cli/src/electron/electron.d.ts +79 -0
- package/dist/sd-cli/src/electron/electron.d.ts.map +1 -0
- package/dist/sd-cli/src/index.d.ts +2 -0
- package/dist/sd-cli/src/index.d.ts.map +1 -0
- package/dist/sd-cli/src/infra/ResultCollector.d.ts +56 -0
- package/dist/sd-cli/src/infra/ResultCollector.d.ts.map +1 -0
- package/dist/sd-cli/src/infra/SignalHandler.d.ts +26 -0
- package/dist/sd-cli/src/infra/SignalHandler.d.ts.map +1 -0
- package/dist/sd-cli/src/infra/WorkerManager.d.ts +40 -0
- package/dist/sd-cli/src/infra/WorkerManager.d.ts.map +1 -0
- package/dist/sd-cli/src/infra/index.d.ts +4 -0
- package/dist/sd-cli/src/infra/index.d.ts.map +1 -0
- package/dist/sd-cli/src/orchestrators/WatchOrchestrator.d.ts +48 -0
- package/dist/sd-cli/src/orchestrators/WatchOrchestrator.d.ts.map +1 -0
- package/dist/sd-cli/src/orchestrators/index.d.ts +2 -0
- package/dist/sd-cli/src/orchestrators/index.d.ts.map +1 -0
- package/dist/sd-cli/src/sd-cli.d.ts +9 -0
- package/dist/sd-cli/src/sd-cli.d.ts.map +1 -0
- package/dist/sd-cli/src/sd-config.types.d.ts +222 -0
- package/dist/sd-cli/src/sd-config.types.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/build-env.d.ts +5 -0
- package/dist/sd-cli/src/utils/build-env.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/config-editor.d.ts +17 -0
- package/dist/sd-cli/src/utils/config-editor.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/esbuild-config.d.ts +49 -0
- package/dist/sd-cli/src/utils/esbuild-config.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/listr-manager.d.ts +37 -0
- package/dist/sd-cli/src/utils/listr-manager.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/output-utils.d.ts +21 -0
- package/dist/sd-cli/src/utils/output-utils.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/package-utils.d.ts +29 -0
- package/dist/sd-cli/src/utils/package-utils.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/sd-config.d.ts +12 -0
- package/dist/sd-cli/src/utils/sd-config.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/spawn.d.ts +26 -0
- package/dist/sd-cli/src/utils/spawn.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/tailwind-config-deps.d.ts +8 -0
- package/dist/sd-cli/src/utils/tailwind-config-deps.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/template.d.ts +14 -0
- package/dist/sd-cli/src/utils/template.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/tsconfig.d.ts +35 -0
- package/dist/sd-cli/src/utils/tsconfig.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/typecheck-serialization.d.ts +28 -0
- package/dist/sd-cli/src/utils/typecheck-serialization.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/vite-config.d.ts +25 -0
- package/dist/sd-cli/src/utils/vite-config.d.ts.map +1 -0
- package/dist/sd-cli/src/utils/worker-events.d.ts +53 -0
- package/dist/sd-cli/src/utils/worker-events.d.ts.map +1 -0
- package/dist/sd-cli/src/workers/client.worker.d.ts +82 -0
- package/dist/sd-cli/src/workers/client.worker.d.ts.map +1 -0
- package/dist/sd-cli/src/workers/dts.worker.d.ts +73 -0
- package/dist/sd-cli/src/workers/dts.worker.d.ts.map +1 -0
- package/dist/sd-cli/src/workers/library.worker.d.ts +73 -0
- package/dist/sd-cli/src/workers/library.worker.d.ts.map +1 -0
- package/dist/sd-cli/src/workers/server-runtime.worker.d.ts +40 -0
- package/dist/sd-cli/src/workers/server-runtime.worker.d.ts.map +1 -0
- package/dist/sd-cli/src/workers/server.worker.d.ts +76 -0
- package/dist/sd-cli/src/workers/server.worker.d.ts.map +1 -0
- package/dist/sd-cli.js +239 -76
- package/dist/sd-cli.js.map +7 -0
- package/dist/sd-config.types.js +1 -0
- package/dist/sd-config.types.js.map +7 -0
- package/dist/storage/src/clients/ftp-storage-client.d.ts +56 -0
- package/dist/storage/src/clients/ftp-storage-client.d.ts.map +1 -0
- package/dist/storage/src/clients/sftp-storage-client.d.ts +48 -0
- package/dist/storage/src/clients/sftp-storage-client.d.ts.map +1 -0
- package/dist/storage/src/index.d.ts +7 -0
- package/dist/storage/src/index.d.ts.map +1 -0
- package/dist/storage/src/storage-factory.d.ts +20 -0
- package/dist/storage/src/storage-factory.d.ts.map +1 -0
- package/dist/storage/src/types/storage-conn-config.d.ts +7 -0
- package/dist/storage/src/types/storage-conn-config.d.ts.map +1 -0
- package/dist/storage/src/types/storage-type.d.ts +2 -0
- package/dist/storage/src/types/storage-type.d.ts.map +1 -0
- package/dist/storage/src/types/storage.d.ts +19 -0
- package/dist/storage/src/types/storage.d.ts.map +1 -0
- package/dist/utils/build-env.js +12 -0
- package/dist/utils/build-env.js.map +7 -0
- package/dist/utils/config-editor.js +77 -0
- package/dist/utils/config-editor.js.map +7 -0
- package/dist/utils/esbuild-config.js +44 -0
- package/dist/utils/esbuild-config.js.map +7 -0
- package/dist/utils/listr-manager.js +59 -0
- package/dist/utils/listr-manager.js.map +7 -0
- package/dist/utils/output-utils.js +40 -0
- package/dist/utils/output-utils.js.map +7 -0
- package/dist/utils/package-utils.js +28 -0
- package/dist/utils/package-utils.js.map +7 -0
- package/dist/utils/sd-config.js +24 -0
- package/dist/utils/sd-config.js.map +7 -0
- package/dist/utils/spawn.js +49 -0
- package/dist/utils/spawn.js.map +7 -0
- package/dist/utils/tailwind-config-deps.js +80 -0
- package/dist/utils/tailwind-config-deps.js.map +7 -0
- package/dist/utils/template.js +28 -0
- package/dist/utils/template.js.map +7 -0
- package/dist/utils/tsconfig.js +62 -0
- package/dist/utils/tsconfig.js.map +7 -0
- package/dist/utils/typecheck-serialization.js +46 -0
- package/dist/utils/typecheck-serialization.js.map +7 -0
- package/dist/utils/vite-config.js +108 -0
- package/dist/utils/vite-config.js.map +7 -0
- package/dist/utils/worker-events.js +38 -0
- package/dist/utils/worker-events.js.map +7 -0
- package/dist/workers/client.worker.js +94 -0
- package/dist/workers/client.worker.js.map +7 -0
- package/dist/workers/dts.worker.js +210 -0
- package/dist/workers/dts.worker.js.map +7 -0
- package/dist/workers/library.worker.js +118 -0
- package/dist/workers/library.worker.js.map +7 -0
- package/dist/workers/server-runtime.worker.js +85 -0
- package/dist/workers/server-runtime.worker.js.map +7 -0
- package/dist/workers/server.worker.js +114 -42
- package/dist/workers/server.worker.js.map +7 -0
- package/package.json +32 -29
- package/dist/entry/SdCliAiCommand.d.ts +0 -3
- package/dist/entry/SdCliAiCommand.js +0 -91
- package/dist/entry/SdCliCapacitor.d.ts +0 -35
- package/dist/entry/SdCliCapacitor.js +0 -565
- package/dist/entry/SdCliCordova.d.ts +0 -49
- package/dist/entry/SdCliCordova.js +0 -394
- package/dist/entry/SdCliElectron.d.ts +0 -22
- package/dist/entry/SdCliElectron.js +0 -128
- package/dist/entry/SdCliLocalUpdate.d.ts +0 -11
- package/dist/entry/SdCliLocalUpdate.js +0 -83
- package/dist/entry/SdCliPostInstall.d.ts +0 -3
- package/dist/entry/SdCliPostInstall.js +0 -48
- package/dist/entry/SdCliProject.d.ts +0 -24
- package/dist/entry/SdCliProject.js +0 -336
- package/dist/pkg-builders/SdBuildRunnerBase.d.ts +0 -14
- package/dist/pkg-builders/SdBuildRunnerBase.js +0 -22
- package/dist/pkg-builders/SdProjectBuildRunner.d.ts +0 -25
- package/dist/pkg-builders/SdProjectBuildRunner.js +0 -264
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.d.ts +0 -9
- package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.js +0 -89
- package/dist/pkg-builders/client/SdClientBuildRunner.d.ts +0 -10
- package/dist/pkg-builders/client/SdClientBuildRunner.js +0 -113
- package/dist/pkg-builders/client/SdNgBundler.d.ts +0 -38
- package/dist/pkg-builders/client/SdNgBundler.js +0 -525
- package/dist/pkg-builders/client/SdNgBundlerContext.d.ts +0 -25
- package/dist/pkg-builders/client/SdNgBundlerContext.js +0 -104
- package/dist/pkg-builders/client/createSdNgPlugin.d.ts +0 -5
- package/dist/pkg-builders/client/createSdNgPlugin.js +0 -133
- package/dist/pkg-builders/commons/SdWorkerPathPlugin.d.ts +0 -2
- package/dist/pkg-builders/commons/SdWorkerPathPlugin.js +0 -91
- package/dist/pkg-builders/lib/SdCliDbContextFileGenerator.d.ts +0 -9
- package/dist/pkg-builders/lib/SdCliDbContextFileGenerator.js +0 -138
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.d.ts +0 -11
- package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js +0 -79
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.d.ts +0 -8
- package/dist/pkg-builders/lib/SdJsLibBuildRunner.js +0 -44
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.d.ts +0 -8
- package/dist/pkg-builders/lib/SdTsLibBuildRunner.js +0 -34
- package/dist/pkg-builders/lib/SdTsLibBuilder.d.ts +0 -10
- package/dist/pkg-builders/lib/SdTsLibBuilder.js +0 -54
- package/dist/pkg-builders/server/SdServerBuildRunner.d.ts +0 -10
- package/dist/pkg-builders/server/SdServerBuildRunner.js +0 -228
- package/dist/pkg-builders/server/SdServerBundler.d.ts +0 -17
- package/dist/pkg-builders/server/SdServerBundler.js +0 -174
- package/dist/pkg-builders/server/createSdServerPlugin.d.ts +0 -5
- package/dist/pkg-builders/server/createSdServerPlugin.js +0 -53
- package/dist/sd-cli-entry.d.ts +0 -2
- package/dist/sd-cli-entry.js +0 -230
- package/dist/sd-cli.d.ts +0 -2
- package/dist/ts-compiler/ScopePathSet.d.ts +0 -7
- package/dist/ts-compiler/ScopePathSet.js +0 -12
- package/dist/ts-compiler/SdDepAnalyzer.d.ts +0 -15
- package/dist/ts-compiler/SdDepAnalyzer.js +0 -299
- package/dist/ts-compiler/SdDepCache.d.ts +0 -77
- package/dist/ts-compiler/SdDepCache.js +0 -248
- package/dist/ts-compiler/SdStyleBundler.d.ts +0 -23
- package/dist/ts-compiler/SdStyleBundler.js +0 -131
- package/dist/ts-compiler/SdTsCompiler.d.ts +0 -29
- package/dist/ts-compiler/SdTsCompiler.js +0 -420
- package/dist/types/build/ISdBuildMessage.d.ts +0 -10
- package/dist/types/build/ISdBuildMessage.js +0 -1
- package/dist/types/build/ISdBuildResult.d.ts +0 -8
- package/dist/types/build/ISdBuildResult.js +0 -1
- package/dist/types/build/ISdTsCompilerOptions.d.ts +0 -10
- package/dist/types/build/ISdTsCompilerOptions.js +0 -1
- package/dist/types/build/ISdTsCompilerResult.d.ts +0 -14
- package/dist/types/build/ISdTsCompilerResult.js +0 -1
- package/dist/types/build/TStylesheetBundlingResult.d.ts +0 -12
- package/dist/types/build/TStylesheetBundlingResult.js +0 -1
- package/dist/types/common-config/INpmConfig.d.ts +0 -17
- package/dist/types/common-config/INpmConfig.js +0 -1
- package/dist/types/common-config/ITsConfig.d.ts +0 -7
- package/dist/types/common-config/ITsConfig.js +0 -1
- package/dist/types/config/ISdProjectConfig.d.ts +0 -144
- package/dist/types/config/ISdProjectConfig.js +0 -1
- package/dist/types/plugin/ISdCliNgPluginResultCache.d.ts +0 -8
- package/dist/types/plugin/ISdCliNgPluginResultCache.js +0 -1
- package/dist/types/plugin/ISdCliServerPluginResultCache.d.ts +0 -8
- package/dist/types/plugin/ISdCliServerPluginResultCache.js +0 -1
- package/dist/types/worker/ISdBuildRunnerWorkerType.d.ts +0 -20
- package/dist/types/worker/ISdBuildRunnerWorkerType.js +0 -1
- package/dist/types/worker/IServerWorkerType.d.ts +0 -17
- package/dist/types/worker/IServerWorkerType.js +0 -1
- package/dist/utils/SdCliConvertMessageUtils.d.ts +0 -21
- package/dist/utils/SdCliConvertMessageUtils.js +0 -138
- package/dist/utils/SdCliPerformanceTimer.d.ts +0 -10
- package/dist/utils/SdCliPerformanceTimer.js +0 -50
- package/dist/utils/loadProjConfAsync.d.ts +0 -5
- package/dist/utils/loadProjConfAsync.js +0 -7
- package/dist/workers/build-runner.worker.d.ts +0 -1
- package/dist/workers/build-runner.worker.js +0 -37
- package/dist/workers/server.worker.d.ts +0 -1
- package/lib/cordova-entry.js +0 -29
- package/src/entry/SdCliAiCommand.ts +0 -105
- package/src/entry/SdCliCapacitor.ts +0 -760
- package/src/entry/SdCliCordova.ts +0 -550
- package/src/entry/SdCliElectron.ts +0 -197
- package/src/entry/SdCliLocalUpdate.ts +0 -106
- package/src/entry/SdCliPostInstall.ts +0 -51
- package/src/entry/SdCliProject.ts +0 -427
- package/src/pkg-builders/SdBuildRunnerBase.ts +0 -36
- package/src/pkg-builders/SdProjectBuildRunner.ts +0 -398
- package/src/pkg-builders/client/SdCliNgRoutesFileGenerator.ts +0 -112
- package/src/pkg-builders/client/SdClientBuildRunner.ts +0 -156
- package/src/pkg-builders/client/SdNgBundler.ts +0 -666
- package/src/pkg-builders/client/SdNgBundlerContext.ts +0 -138
- package/src/pkg-builders/client/createSdNgPlugin.ts +0 -186
- package/src/pkg-builders/commons/SdWorkerPathPlugin.ts +0 -117
- package/src/pkg-builders/lib/SdCliDbContextFileGenerator.ts +0 -177
- package/src/pkg-builders/lib/SdCliIndexFileGenerator.ts +0 -94
- package/src/pkg-builders/lib/SdJsLibBuildRunner.ts +0 -59
- package/src/pkg-builders/lib/SdTsLibBuildRunner.ts +0 -47
- package/src/pkg-builders/lib/SdTsLibBuilder.ts +0 -71
- package/src/pkg-builders/server/SdServerBuildRunner.ts +0 -299
- package/src/pkg-builders/server/SdServerBundler.ts +0 -208
- package/src/pkg-builders/server/createSdServerPlugin.ts +0 -80
- package/src/sd-cli-entry.ts +0 -292
- package/src/sd-cli.ts +0 -105
- package/src/ts-compiler/ScopePathSet.ts +0 -17
- package/src/ts-compiler/SdDepAnalyzer.ts +0 -372
- package/src/ts-compiler/SdDepCache.ts +0 -304
- package/src/ts-compiler/SdStyleBundler.ts +0 -169
- package/src/ts-compiler/SdTsCompiler.ts +0 -638
- package/src/types/build/ISdBuildMessage.ts +0 -11
- package/src/types/build/ISdBuildResult.ts +0 -9
- package/src/types/build/ISdTsCompilerOptions.ts +0 -11
- package/src/types/build/ISdTsCompilerResult.ts +0 -12
- package/src/types/build/TStylesheetBundlingResult.ts +0 -15
- package/src/types/common-config/INpmConfig.ts +0 -24
- package/src/types/common-config/ITsConfig.ts +0 -5
- package/src/types/config/ISdProjectConfig.ts +0 -174
- package/src/types/plugin/ISdCliNgPluginResultCache.ts +0 -9
- package/src/types/plugin/ISdCliServerPluginResultCache.ts +0 -9
- package/src/types/worker/ISdBuildRunnerWorkerType.ts +0 -19
- package/src/types/worker/IServerWorkerType.ts +0 -8
- package/src/utils/SdCliConvertMessageUtils.ts +0 -180
- package/src/utils/SdCliPerformanceTimer.ts +0 -62
- package/src/utils/loadProjConfAsync.ts +0 -16
- package/src/workers/build-runner.worker.ts +0 -54
- package/src/workers/server.worker.ts +0 -54
- package/tests/deps/sd-dependency-analyzer.spec.ts +0 -241
- package/tests/deps/sd-dependency-cache.spec.ts +0 -153
- package/tsconfig.json +0 -8
- package/tsconfig.test.json +0 -8
- package/vitest.config.js +0 -15
package/README.md
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
# @simplysm/sd-cli
|
|
2
|
+
|
|
3
|
+
The CLI tool for the Simplysm framework. It provides project initialization, ESLint linting, TypeScript type-checking, library/client/server package builds, development mode, deployment, Android device execution, and Electron desktop app build capabilities.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev @simplysm/sd-cli
|
|
9
|
+
# or
|
|
10
|
+
pnpm add -D @simplysm/sd-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Main Commands
|
|
14
|
+
|
|
15
|
+
The CLI binary name is `sd-cli`. All commands support the `--debug` option to output detailed logs.
|
|
16
|
+
|
|
17
|
+
### lint
|
|
18
|
+
|
|
19
|
+
Runs ESLint. It automatically extracts and applies globalIgnores patterns from `eslint.config.ts` and stores cache in `.cache/eslint.cache`.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Lint all
|
|
23
|
+
sd-cli lint
|
|
24
|
+
|
|
25
|
+
# Lint specific path
|
|
26
|
+
sd-cli lint packages/core-common
|
|
27
|
+
|
|
28
|
+
# Lint multiple paths
|
|
29
|
+
sd-cli lint packages/core-common tests/orm
|
|
30
|
+
|
|
31
|
+
# Auto-fix
|
|
32
|
+
sd-cli lint --fix
|
|
33
|
+
|
|
34
|
+
# Output rule execution times
|
|
35
|
+
sd-cli lint --timing
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Options:**
|
|
39
|
+
|
|
40
|
+
| Option | Description | Default |
|
|
41
|
+
| ---------- | ---------------------------------------------------------- | ------- |
|
|
42
|
+
| `--fix` | Auto-fix | `false` |
|
|
43
|
+
| `--timing` | Output rule execution times (sets ESLint `TIMING` env var) | `false` |
|
|
44
|
+
| `--debug` | Output debug logs | `false` |
|
|
45
|
+
|
|
46
|
+
### typecheck
|
|
47
|
+
|
|
48
|
+
Runs TypeScript type-checking. It performs parallel type-checking per package environment (`node`/`browser`) based on `tsconfig.json` and `sd.config.ts`. Uses worker threads to run concurrently up to 7/8 of CPU cores.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Type-check all
|
|
52
|
+
sd-cli typecheck
|
|
53
|
+
|
|
54
|
+
# Type-check specific path
|
|
55
|
+
sd-cli typecheck packages/core-common
|
|
56
|
+
|
|
57
|
+
# Type-check multiple paths
|
|
58
|
+
sd-cli typecheck packages/core-common tests/orm
|
|
59
|
+
|
|
60
|
+
# Pass options to sd.config.ts
|
|
61
|
+
sd-cli typecheck -o key=value
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Options:**
|
|
65
|
+
|
|
66
|
+
| Option | Description | Default |
|
|
67
|
+
| ----------------- | ---------------------------------------------------------- | ------- |
|
|
68
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
69
|
+
| `--debug` | Output debug logs | `false` |
|
|
70
|
+
|
|
71
|
+
**Type-check environment by target:**
|
|
72
|
+
|
|
73
|
+
| Target | Environment |
|
|
74
|
+
| ------------------- | ----------------------- |
|
|
75
|
+
| `node` | node environment once |
|
|
76
|
+
| `browser`, `client` | browser environment once |
|
|
77
|
+
| `neutral` | node + browser environment twice |
|
|
78
|
+
| `scripts` | Excluded from type-check |
|
|
79
|
+
|
|
80
|
+
### watch
|
|
81
|
+
|
|
82
|
+
Watches **library packages** (`node`/`browser`/`neutral` targets) in watch mode. Automatically rebuilds on file changes and generates `.d.ts` type definition files.
|
|
83
|
+
|
|
84
|
+
> **Note**: Use the `dev` command for `client`/`server` targets.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Watch all library packages
|
|
88
|
+
sd-cli watch
|
|
89
|
+
|
|
90
|
+
# Watch specific package
|
|
91
|
+
sd-cli watch solid
|
|
92
|
+
|
|
93
|
+
# Watch multiple packages
|
|
94
|
+
sd-cli watch solid core-common
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Options:**
|
|
98
|
+
|
|
99
|
+
| Option | Description | Default |
|
|
100
|
+
| ----------------- | ---------------------------------------------------------- | ------- |
|
|
101
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
102
|
+
| `--debug` | Output debug logs | `false` |
|
|
103
|
+
|
|
104
|
+
### dev
|
|
105
|
+
|
|
106
|
+
Runs **Client and Server packages** in development mode. `client` targets run with Vite dev server, and `server` targets run with Server Build Worker + Server Runtime Worker. Supports Server-Client proxy connection and Capacitor initialization.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Run all client/server packages
|
|
110
|
+
sd-cli dev
|
|
111
|
+
|
|
112
|
+
# Run specific package
|
|
113
|
+
sd-cli dev solid-demo
|
|
114
|
+
|
|
115
|
+
# Run multiple packages
|
|
116
|
+
sd-cli dev solid-demo my-server
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Options:**
|
|
120
|
+
|
|
121
|
+
| Option | Description | Default |
|
|
122
|
+
| ----------------- | ---------------------------------------------------------- | ------- |
|
|
123
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
124
|
+
| `--debug` | Output debug logs | `false` |
|
|
125
|
+
|
|
126
|
+
**How it works:**
|
|
127
|
+
|
|
128
|
+
- `client` target: Starts Vite dev server. If `server` config is a string (package name), connects proxy to that server
|
|
129
|
+
- `server` target: Builds in esbuild watch mode, then runs server runtime in separate Worker. Auto-rebuilds and restarts server on file changes
|
|
130
|
+
- Client packages with Capacitor config perform Capacitor initialization after build completes
|
|
131
|
+
- Client packages with Electron config launch Electron in dev mode after build completes
|
|
132
|
+
- Terminates on SIGINT/SIGTERM signals
|
|
133
|
+
|
|
134
|
+
### build
|
|
135
|
+
|
|
136
|
+
Runs production build. Performs lint, dist folder cleanup, and build sequentially.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Build all packages
|
|
140
|
+
sd-cli build
|
|
141
|
+
|
|
142
|
+
# Build specific packages
|
|
143
|
+
sd-cli build solid core-common
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Options:**
|
|
147
|
+
|
|
148
|
+
| Option | Description | Default |
|
|
149
|
+
| ----------------- | ---------------------------------------------------------- | ------- |
|
|
150
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
151
|
+
| `--debug` | Output debug logs | `false` |
|
|
152
|
+
|
|
153
|
+
**Build behavior by target:**
|
|
154
|
+
|
|
155
|
+
| Target | JS build | .d.ts generation | Type-check | Note |
|
|
156
|
+
| -------------------------- | --------------- | ---------------- | ---------- | ------------------------------------- |
|
|
157
|
+
| `node`/`browser`/`neutral` | esbuild | O | O | Library package |
|
|
158
|
+
| `client` | Vite production | X | O | Client app (+ Capacitor/Electron build) |
|
|
159
|
+
| `server` | esbuild | X | X | Server app |
|
|
160
|
+
| `scripts` | Excluded | Excluded | Excluded | - |
|
|
161
|
+
|
|
162
|
+
### publish
|
|
163
|
+
|
|
164
|
+
Publishes packages. For safety, proceeds in the following order:
|
|
165
|
+
|
|
166
|
+
1. Pre-validation (npm authentication, Git uncommitted changes check)
|
|
167
|
+
2. Version upgrade (increment prerelease if prerelease, otherwise patch)
|
|
168
|
+
3. Build (Git rollback on failure)
|
|
169
|
+
4. Git commit/tag/push (Git rollback on failure)
|
|
170
|
+
5. npm/FTP/local deployment
|
|
171
|
+
6. postPublish script execution
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Publish all packages with publish config
|
|
175
|
+
sd-cli publish
|
|
176
|
+
|
|
177
|
+
# Publish specific packages
|
|
178
|
+
sd-cli publish solid core-common
|
|
179
|
+
|
|
180
|
+
# Publish without build (dangerous)
|
|
181
|
+
sd-cli publish --no-build
|
|
182
|
+
|
|
183
|
+
# Simulate without actual deployment
|
|
184
|
+
sd-cli publish --dry-run
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Options:**
|
|
188
|
+
|
|
189
|
+
| Option | Description | Default |
|
|
190
|
+
| ------------------------ | ---------------------------------------------------------- | ------- |
|
|
191
|
+
| `--build` / `--no-build` | Whether to run build (skip with `--no-build`) | `true` |
|
|
192
|
+
| `--dry-run` | Simulate without actual deployment | `false` |
|
|
193
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
194
|
+
| `--debug` | Output debug logs | `false` |
|
|
195
|
+
|
|
196
|
+
### init
|
|
197
|
+
|
|
198
|
+
Initializes a new Simplysm project in the current directory. The directory must be empty and the directory name must be a valid npm scope name (lowercase, numbers, hyphens only).
|
|
199
|
+
|
|
200
|
+
Creates a skeleton project with:
|
|
201
|
+
- `sd.config.ts`, `tsconfig.json`, `eslint.config.ts`, `pnpm-workspace.yaml`
|
|
202
|
+
- `.gitignore`, `.prettierrc.yaml`, `.prettierignore`, `mise.toml`
|
|
203
|
+
|
|
204
|
+
After rendering templates, runs `pnpm install` automatically.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Create an empty directory and run init
|
|
208
|
+
mkdir my-project && cd my-project
|
|
209
|
+
sd-cli init
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
After initialization, use `sd-cli add client` and `sd-cli add server` to add packages.
|
|
213
|
+
|
|
214
|
+
> **Note**: To install Claude Code skills/agents, use `sd-claude install` from the separate `@simplysm/sd-claude` package.
|
|
215
|
+
|
|
216
|
+
### add client
|
|
217
|
+
|
|
218
|
+
Adds a client package to an existing project. Must be run from the project root (where `sd.config.ts` exists).
|
|
219
|
+
|
|
220
|
+
Runs an interactive prompt to collect:
|
|
221
|
+
1. Client package name suffix (creates `client-{suffix}` package)
|
|
222
|
+
2. Whether to use router
|
|
223
|
+
|
|
224
|
+
After collecting inputs, it:
|
|
225
|
+
1. Renders client package from Handlebars templates into `packages/client-{suffix}/`
|
|
226
|
+
2. Adds the package entry to `sd.config.ts` (via ts-morph AST editing)
|
|
227
|
+
3. Adds tailwind CSS settings to `eslint.config.ts` (if first client)
|
|
228
|
+
4. Runs `pnpm install`
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
sd-cli add client
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### add server
|
|
235
|
+
|
|
236
|
+
Adds a server package to an existing project. Must be run from the project root (where `sd.config.ts` exists).
|
|
237
|
+
|
|
238
|
+
Runs an interactive prompt to collect:
|
|
239
|
+
1. Server name suffix (leave empty for just `server`, otherwise creates `server-{suffix}`)
|
|
240
|
+
2. Which existing client packages this server should serve (multi-select)
|
|
241
|
+
|
|
242
|
+
After collecting inputs, it:
|
|
243
|
+
1. Renders server package from Handlebars templates into `packages/{server-name}/`
|
|
244
|
+
2. Adds the server package entry to `sd.config.ts`
|
|
245
|
+
3. Updates selected client packages' `server` field in `sd.config.ts`
|
|
246
|
+
4. Runs `pnpm install`
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
sd-cli add server
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### device
|
|
253
|
+
|
|
254
|
+
Runs Capacitor app on Android device. Only available for `client` target packages with `capacitor` config in `sd.config.ts`.
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Specify package (required)
|
|
258
|
+
sd-cli device -p my-app
|
|
259
|
+
|
|
260
|
+
# Specify dev server URL directly
|
|
261
|
+
sd-cli device -p my-app -u http://192.168.0.10:3000
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Options:**
|
|
265
|
+
|
|
266
|
+
| Option | Description | Default |
|
|
267
|
+
| ----------------- | ------------------------------------------------------------------------- | ------- |
|
|
268
|
+
| `--package`, `-p` | Package name (required) | - |
|
|
269
|
+
| `--url`, `-u` | Dev server URL (uses server port from sd.config.ts if not specified) | - |
|
|
270
|
+
| `--options`, `-o` | Additional options to pass to sd.config.ts (multi-use) | `[]` |
|
|
271
|
+
| `--debug` | Output debug logs | `false` |
|
|
272
|
+
|
|
273
|
+
## Configuration (sd.config.ts)
|
|
274
|
+
|
|
275
|
+
Create an `sd.config.ts` file in the project root to define build targets and deployment settings per package. Used by `typecheck`, `watch`, `dev`, `build`, `publish`, and `device` commands.
|
|
276
|
+
|
|
277
|
+
The `typecheck` command treats all packages as `neutral` target if no config file exists. The `watch`, `dev`, `build`, and `publish` commands require this file.
|
|
278
|
+
|
|
279
|
+
### Basic Example
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import type { SdConfigFn } from "@simplysm/sd-cli";
|
|
283
|
+
|
|
284
|
+
const config: SdConfigFn = () => ({
|
|
285
|
+
packages: {
|
|
286
|
+
"core-common": { target: "neutral" },
|
|
287
|
+
"core-node": { target: "node" },
|
|
288
|
+
"core-browser": { target: "browser" },
|
|
289
|
+
"solid": { target: "browser", publish: "npm" },
|
|
290
|
+
"solid-demo": { target: "client", server: "solid-demo-server" },
|
|
291
|
+
"solid-demo-server": { target: "server" },
|
|
292
|
+
"my-scripts": { target: "scripts" },
|
|
293
|
+
},
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
export default config;
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Target Types
|
|
300
|
+
|
|
301
|
+
| Target | Description | Type-check | watch | dev | build |
|
|
302
|
+
| --------- | ------------------------------------------------------------------ | ------------------ | ----- | --- | ------------ |
|
|
303
|
+
| `node` | Node.js-only package. Removes DOM lib, includes `@types/node` | O (node) | O | X | O (JS + dts) |
|
|
304
|
+
| `browser` | Browser-only package. Keeps DOM lib, excludes `@types/node` | O (browser) | O | X | O (JS + dts) |
|
|
305
|
+
| `neutral` | Node/browser common. Keeps DOM lib, includes `@types/node` | O (node + browser) | O | X | O (JS + dts) |
|
|
306
|
+
| `client` | Vite dev server-based client app | O (browser) | X | O | O (Vite) |
|
|
307
|
+
| `server` | Fastify-based server app | X | X | O | O (JS) |
|
|
308
|
+
| `scripts` | Excluded from typecheck/watch/build | X | X | X | X |
|
|
309
|
+
|
|
310
|
+
### Function Parameters
|
|
311
|
+
|
|
312
|
+
The `sd.config.ts` function receives a `SdConfigParams` object as an argument:
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
import type { SdConfigFn, SdConfigParams } from "@simplysm/sd-cli";
|
|
316
|
+
|
|
317
|
+
const config: SdConfigFn = (params: SdConfigParams) => {
|
|
318
|
+
// params.cwd - Current working directory
|
|
319
|
+
// params.dev - Whether in dev mode (true for dev command, false for build/publish)
|
|
320
|
+
// params.opt - Additional options array passed via CLI's -o flag
|
|
321
|
+
|
|
322
|
+
return {
|
|
323
|
+
packages: {
|
|
324
|
+
"my-app": {
|
|
325
|
+
target: "client",
|
|
326
|
+
server: params.dev ? 3000 : "my-server",
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export default config;
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Package Configuration Types
|
|
336
|
+
|
|
337
|
+
#### Library Package (SdBuildPackageConfig)
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
{
|
|
341
|
+
target: "node" | "browser" | "neutral";
|
|
342
|
+
publish?: SdPublishConfig; // Deployment config (optional)
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Client Package (SdClientPackageConfig)
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
{
|
|
350
|
+
target: "client";
|
|
351
|
+
server: string | number; // Server package name or direct port number
|
|
352
|
+
env?: Record<string, string>; // Environment variables to replace during build
|
|
353
|
+
publish?: SdPublishConfig; // Deployment config (optional)
|
|
354
|
+
capacitor?: SdCapacitorConfig; // Capacitor config (optional)
|
|
355
|
+
electron?: SdElectronConfig; // Electron config (optional)
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### Server Package (SdServerPackageConfig)
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
{
|
|
363
|
+
target: "server";
|
|
364
|
+
env?: Record<string, string>; // Environment variables to replace during build
|
|
365
|
+
publish?: SdPublishConfig; // Deployment config (optional)
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
#### Scripts Package (SdScriptsPackageConfig)
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
{
|
|
373
|
+
target: "scripts";
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Deployment Configuration (SdPublishConfig)
|
|
378
|
+
|
|
379
|
+
Three deployment methods are supported:
|
|
380
|
+
|
|
381
|
+
| Method | Config Value | Description |
|
|
382
|
+
| ---------------- | ----------------------------------------------------------------------- | ------------------------------------- |
|
|
383
|
+
| npm | `"npm"` | Deploy to npm registry |
|
|
384
|
+
| Local directory | `{ type: "local-directory", path: "..." }` | Copy dist to local path |
|
|
385
|
+
| Storage | `{ type: "ftp" \| "ftps" \| "sftp", host, port?, path?, user?, pass? }` | Upload to FTP/FTPS/SFTP server |
|
|
386
|
+
|
|
387
|
+
Environment variable substitution is supported in `path` for local directory and storage: `%VER%` (version), `%PROJECT%` (project path).
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
// npm deployment
|
|
391
|
+
"core-common": { target: "neutral", publish: "npm" },
|
|
392
|
+
|
|
393
|
+
// Local directory deployment
|
|
394
|
+
"my-app": {
|
|
395
|
+
target: "client",
|
|
396
|
+
server: 3000,
|
|
397
|
+
publish: { type: "local-directory", path: "/deploy/%VER%/my-app" },
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
// SFTP upload
|
|
401
|
+
"my-server": {
|
|
402
|
+
target: "server",
|
|
403
|
+
publish: {
|
|
404
|
+
type: "sftp",
|
|
405
|
+
host: "deploy.example.com",
|
|
406
|
+
port: 22,
|
|
407
|
+
path: "/opt/app",
|
|
408
|
+
user: "deploy",
|
|
409
|
+
pass: "secret",
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### postPublish Scripts
|
|
415
|
+
|
|
416
|
+
You can define scripts to run after deployment completes. Supports environment variable substitution (`%VER%`, `%PROJECT%`). On script failure, only a warning is printed and execution continues.
|
|
417
|
+
|
|
418
|
+
```typescript
|
|
419
|
+
const config: SdConfigFn = () => ({
|
|
420
|
+
packages: {
|
|
421
|
+
/* ... */
|
|
422
|
+
},
|
|
423
|
+
postPublish: [
|
|
424
|
+
{
|
|
425
|
+
type: "script",
|
|
426
|
+
cmd: "curl",
|
|
427
|
+
args: ["-X", "POST", "https://hooks.example.com/deploy?version=%VER%"],
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
});
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Capacitor Configuration (SdCapacitorConfig)
|
|
434
|
+
|
|
435
|
+
Capacitor configuration for Android app builds in `client` target packages.
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
"my-app": {
|
|
439
|
+
target: "client",
|
|
440
|
+
server: 3000,
|
|
441
|
+
capacitor: {
|
|
442
|
+
appId: "com.example.myapp",
|
|
443
|
+
appName: "My App",
|
|
444
|
+
icon: "resources/icon.png", // App icon (relative to package directory)
|
|
445
|
+
debug: true, // Whether debug build
|
|
446
|
+
plugins: { // Capacitor plugins
|
|
447
|
+
"@capacitor/camera": true,
|
|
448
|
+
"@capacitor/storage": { group: "myGroup" },
|
|
449
|
+
},
|
|
450
|
+
platform: {
|
|
451
|
+
android: {
|
|
452
|
+
config: { // AndroidManifest.xml application attributes
|
|
453
|
+
requestLegacyExternalStorage: "true",
|
|
454
|
+
},
|
|
455
|
+
bundle: true, // AAB bundle build (APK if false)
|
|
456
|
+
sdkVersion: 33, // Android SDK version
|
|
457
|
+
permissions: [ // Additional permissions
|
|
458
|
+
{ name: "CAMERA" },
|
|
459
|
+
{ name: "WRITE_EXTERNAL_STORAGE", maxSdkVersion: 29 },
|
|
460
|
+
],
|
|
461
|
+
intentFilters: [ // Intent Filters
|
|
462
|
+
{ action: "android.intent.action.VIEW", category: "android.intent.category.DEFAULT" },
|
|
463
|
+
],
|
|
464
|
+
sign: { // APK/AAB signing
|
|
465
|
+
keystore: "keystore.jks",
|
|
466
|
+
storePassword: "password",
|
|
467
|
+
alias: "key0",
|
|
468
|
+
password: "password",
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Electron Configuration (SdElectronConfig)
|
|
477
|
+
|
|
478
|
+
Electron configuration for Windows desktop app builds in `client` target packages. Requires `src/electron-main.ts` entry point in the package directory.
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
"my-app": {
|
|
482
|
+
target: "client",
|
|
483
|
+
server: 3000,
|
|
484
|
+
electron: {
|
|
485
|
+
appId: "com.example.myapp", // Electron app ID (required)
|
|
486
|
+
portable: false, // true: portable .exe, false: NSIS installer
|
|
487
|
+
installerIcon: "resources/icon.ico", // Installer icon (.ico, relative to package directory)
|
|
488
|
+
reinstallDependencies: ["better-sqlite3"], // npm packages to include (native modules etc.)
|
|
489
|
+
postInstallScript: "node scripts/setup.js", // npm postinstall script
|
|
490
|
+
nsisOptions: {}, // NSIS options (when portable is false)
|
|
491
|
+
env: { // Environment variables (accessible via process.env in electron-main.ts)
|
|
492
|
+
API_URL: "https://api.example.com",
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**How it works:**
|
|
499
|
+
|
|
500
|
+
- **Initialize**: Creates `.electron/src/package.json`, runs `npm install`, rebuilds native modules with `electron-rebuild`
|
|
501
|
+
- **Build**: Bundles `electron-main.ts` with esbuild, copies web assets, runs `electron-builder` for Windows
|
|
502
|
+
- **Dev mode**: Bundles `electron-main.ts`, launches Electron pointing to Vite dev server URL
|
|
503
|
+
|
|
504
|
+
## Cache
|
|
505
|
+
|
|
506
|
+
| Command | Cache Path | Description |
|
|
507
|
+
| ------------- | ---------------------------------------------------- | ------------------------------------------------------------------ |
|
|
508
|
+
| `lint` | `.cache/eslint.cache` | ESLint cache |
|
|
509
|
+
| `typecheck` | `packages/{pkg}/.cache/typecheck-{env}.tsbuildinfo` | Incremental type-check info (`{env}` is `node` or `browser`) |
|
|
510
|
+
| `watch` (dts) | `packages/{pkg}/.cache/dts.tsbuildinfo` | Incremental .d.ts build info |
|
|
511
|
+
|
|
512
|
+
To reset cache, delete the `.cache` directory:
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
# Delete all caches
|
|
516
|
+
rm -rf .cache packages/*/.cache
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
## Notes
|
|
520
|
+
|
|
521
|
+
- `sd.config.ts` is required for `watch`, `dev`, `build`, `publish`, and `device` commands. `typecheck` and `lint` work without a config file.
|
|
522
|
+
- The `publish` command automatically increments version and performs Git commit/tag/push. Execution is rejected if there are uncommitted changes.
|
|
523
|
+
- `publish --no-build` deploys already-built artifacts as-is, so use with caution.
|
|
524
|
+
- Before using the `device` command, run `sd-cli dev` or `sd-cli watch` first to initialize the Capacitor project.
|
|
525
|
+
- During build, `VER` (project version) and `DEV` (`"true"` or `"false"`) environment variables are automatically set.
|
|
526
|
+
|
|
527
|
+
## License
|
|
528
|
+
|
|
529
|
+
Apache-2.0
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { WorkerManager } from "../infra/WorkerManager";
|
|
2
|
+
class BaseBuilder {
|
|
3
|
+
workerManager;
|
|
4
|
+
resultCollector;
|
|
5
|
+
rebuildManager;
|
|
6
|
+
packages;
|
|
7
|
+
cwd;
|
|
8
|
+
isWatchMode = false;
|
|
9
|
+
/** 초기 빌드 Promise (패키지별) */
|
|
10
|
+
initialBuildPromises = /* @__PURE__ */ new Map();
|
|
11
|
+
/** 초기 빌드 resolver (패키지별) */
|
|
12
|
+
buildResolvers = /* @__PURE__ */ new Map();
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.cwd = options.cwd;
|
|
15
|
+
this.packages = options.packages;
|
|
16
|
+
this.resultCollector = options.resultCollector;
|
|
17
|
+
this.rebuildManager = options.rebuildManager;
|
|
18
|
+
this.workerManager = new WorkerManager();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Builder 초기화
|
|
22
|
+
*/
|
|
23
|
+
initialize() {
|
|
24
|
+
for (const pkg of this.packages) {
|
|
25
|
+
const key = this.getPackageKey(pkg);
|
|
26
|
+
this.initialBuildPromises.set(
|
|
27
|
+
key,
|
|
28
|
+
new Promise((resolve) => {
|
|
29
|
+
this.buildResolvers.set(key, resolve);
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
this.createWorkers();
|
|
34
|
+
this.registerEventHandlers();
|
|
35
|
+
return Promise.resolve();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 일회성 빌드 (프로덕션)
|
|
39
|
+
*/
|
|
40
|
+
async build() {
|
|
41
|
+
await Promise.all(this.packages.map((pkg) => this.buildPackage(pkg)));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Watch 모드 시작
|
|
45
|
+
*/
|
|
46
|
+
async startWatch() {
|
|
47
|
+
this.isWatchMode = true;
|
|
48
|
+
for (const pkg of this.packages) {
|
|
49
|
+
this.startWatchPackage(pkg);
|
|
50
|
+
}
|
|
51
|
+
await Promise.all(this.initialBuildPromises.values());
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Builder 종료
|
|
55
|
+
*/
|
|
56
|
+
async shutdown() {
|
|
57
|
+
await this.workerManager.terminateAll();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 초기 빌드 Promise 맵 반환
|
|
61
|
+
*/
|
|
62
|
+
getInitialBuildPromises() {
|
|
63
|
+
return this.initialBuildPromises;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 패키지 키 생성 (결과 저장용)
|
|
67
|
+
*/
|
|
68
|
+
getPackageKey(pkg) {
|
|
69
|
+
return `${pkg.name}:${this.getBuilderType()}`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 빌드 완료 처리
|
|
73
|
+
*/
|
|
74
|
+
completeBuild(pkg) {
|
|
75
|
+
const key = this.getPackageKey(pkg);
|
|
76
|
+
const resolver = this.buildResolvers.get(key);
|
|
77
|
+
if (resolver != null) {
|
|
78
|
+
resolver();
|
|
79
|
+
this.buildResolvers.delete(key);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
BaseBuilder
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=BaseBuilder.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/builders/BaseBuilder.ts"],
|
|
4
|
+
"sourcesContent": ["import { WorkerManager } from \"../infra/WorkerManager\";\nimport type { ResultCollector } from \"../infra/ResultCollector\";\nimport type { RebuildListrManager } from \"../utils/listr-manager\";\nimport type { IBuilder, PackageInfo } from \"./types\";\n\n/**\n * Builder \uCD94\uC0C1 \uBCA0\uC774\uC2A4 \uD074\uB798\uC2A4\n *\n * \uBAA8\uB4E0 Builder\uC758 \uACF5\uD1B5 \uB85C\uC9C1\uC744 \uC81C\uACF5\uD558\uACE0,\n * \uC11C\uBE0C\uD074\uB798\uC2A4\uC5D0\uC11C \uAD6C\uD604\uD574\uC57C \uD560 \uCD94\uC0C1 \uBA54\uC11C\uB4DC\uB97C \uC815\uC758\uD55C\uB2E4.\n */\nexport abstract class BaseBuilder implements IBuilder {\n protected readonly workerManager: WorkerManager;\n protected readonly resultCollector: ResultCollector;\n protected readonly rebuildManager: RebuildListrManager | undefined;\n protected readonly packages: PackageInfo[];\n protected readonly cwd: string;\n protected isWatchMode = false;\n\n /** \uCD08\uAE30 \uBE4C\uB4DC Promise (\uD328\uD0A4\uC9C0\uBCC4) */\n protected readonly initialBuildPromises = new Map<string, Promise<void>>();\n /** \uCD08\uAE30 \uBE4C\uB4DC resolver (\uD328\uD0A4\uC9C0\uBCC4) */\n protected readonly buildResolvers = new Map<string, () => void>();\n\n constructor(options: {\n cwd: string;\n packages: PackageInfo[];\n resultCollector: ResultCollector;\n rebuildManager?: RebuildListrManager;\n }) {\n this.cwd = options.cwd;\n this.packages = options.packages;\n this.resultCollector = options.resultCollector;\n this.rebuildManager = options.rebuildManager;\n this.workerManager = new WorkerManager();\n }\n\n /**\n * Builder \uCD08\uAE30\uD654\n */\n initialize(): Promise<void> {\n // \uCD08\uAE30 \uBE4C\uB4DC Promise \uC0DD\uC131\n for (const pkg of this.packages) {\n const key = this.getPackageKey(pkg);\n this.initialBuildPromises.set(\n key,\n new Promise<void>((resolve) => {\n this.buildResolvers.set(key, resolve);\n }),\n );\n }\n\n // Worker \uC0DD\uC131\n this.createWorkers();\n\n // \uC774\uBCA4\uD2B8 \uD578\uB4E4\uB7EC \uB4F1\uB85D\n this.registerEventHandlers();\n\n return Promise.resolve();\n }\n\n /**\n * \uC77C\uD68C\uC131 \uBE4C\uB4DC (\uD504\uB85C\uB355\uC158)\n */\n async build(): Promise<void> {\n await Promise.all(this.packages.map((pkg) => this.buildPackage(pkg)));\n }\n\n /**\n * Watch \uBAA8\uB4DC \uC2DC\uC791\n */\n async startWatch(): Promise<void> {\n this.isWatchMode = true;\n\n // \uBAA8\uB4E0 \uD328\uD0A4\uC9C0\uC758 watch \uC2DC\uC791 (await \uC5C6\uC774 - \uBC31\uADF8\uB77C\uC6B4\uB4DC \uC2E4\uD589)\n for (const pkg of this.packages) {\n this.startWatchPackage(pkg);\n }\n\n // \uCD08\uAE30 \uBE4C\uB4DC \uC644\uB8CC\uAE4C\uC9C0 \uB300\uAE30\n await Promise.all(this.initialBuildPromises.values());\n }\n\n /**\n * Builder \uC885\uB8CC\n */\n async shutdown(): Promise<void> {\n await this.workerManager.terminateAll();\n }\n\n /**\n * \uCD08\uAE30 \uBE4C\uB4DC Promise \uB9F5 \uBC18\uD658\n */\n getInitialBuildPromises(): Map<string, Promise<void>> {\n return this.initialBuildPromises;\n }\n\n /**\n * \uD328\uD0A4\uC9C0 \uD0A4 \uC0DD\uC131 (\uACB0\uACFC \uC800\uC7A5\uC6A9)\n */\n protected getPackageKey(pkg: PackageInfo): string {\n return `${pkg.name}:${this.getBuilderType()}`;\n }\n\n /**\n * \uBE4C\uB4DC \uC644\uB8CC \uCC98\uB9AC\n */\n protected completeBuild(pkg: PackageInfo): void {\n const key = this.getPackageKey(pkg);\n const resolver = this.buildResolvers.get(key);\n if (resolver != null) {\n resolver();\n this.buildResolvers.delete(key);\n }\n }\n\n /**\n * Builder \uD0C0\uC785 (\uACB0\uACFC \uD0A4 \uC0DD\uC131\uC6A9)\n */\n protected abstract getBuilderType(): string;\n\n /**\n * Worker \uC0DD\uC131\n */\n protected abstract createWorkers(): void;\n\n /**\n * \uC774\uBCA4\uD2B8 \uD578\uB4E4\uB7EC \uB4F1\uB85D\n */\n protected abstract registerEventHandlers(): void;\n\n /**\n * \uB2E8\uC77C \uD328\uD0A4\uC9C0 \uBE4C\uB4DC (\uD504\uB85C\uB355\uC158)\n */\n protected abstract buildPackage(pkg: PackageInfo): Promise<void>;\n\n /**\n * \uB2E8\uC77C \uD328\uD0A4\uC9C0 watch \uC2DC\uC791\n */\n protected abstract startWatchPackage(pkg: PackageInfo): void;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAWvB,MAAe,YAAgC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,cAAc;AAAA;AAAA,EAGL,uBAAuB,oBAAI,IAA2B;AAAA;AAAA,EAEtD,iBAAiB,oBAAI,IAAwB;AAAA,EAEhE,YAAY,SAKT;AACD,SAAK,MAAM,QAAQ;AACnB,SAAK,WAAW,QAAQ;AACxB,SAAK,kBAAkB,QAAQ;AAC/B,SAAK,iBAAiB,QAAQ;AAC9B,SAAK,gBAAgB,IAAI,cAAc;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAKA,aAA4B;AAE1B,eAAW,OAAO,KAAK,UAAU;AAC/B,YAAM,MAAM,KAAK,cAAc,GAAG;AAClC,WAAK,qBAAqB;AAAA,QACxB;AAAA,QACA,IAAI,QAAc,CAAC,YAAY;AAC7B,eAAK,eAAe,IAAI,KAAK,OAAO;AAAA,QACtC,CAAC;AAAA,MACH;AAAA,IACF;AAGA,SAAK,cAAc;AAGnB,SAAK,sBAAsB;AAE3B,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAC3B,UAAM,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ,KAAK,aAAa,GAAG,CAAC,CAAC;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aAA4B;AAChC,SAAK,cAAc;AAGnB,eAAW,OAAO,KAAK,UAAU;AAC/B,WAAK,kBAAkB,GAAG;AAAA,IAC5B;AAGA,UAAM,QAAQ,IAAI,KAAK,qBAAqB,OAAO,CAAC;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAA0B;AAC9B,UAAM,KAAK,cAAc,aAAa;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA,EAKA,0BAAsD;AACpD,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKU,cAAc,KAA0B;AAChD,WAAO,GAAG,IAAI,IAAI,IAAI,KAAK,eAAe,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKU,cAAc,KAAwB;AAC9C,UAAM,MAAM,KAAK,cAAc,GAAG;AAClC,UAAM,WAAW,KAAK,eAAe,IAAI,GAAG;AAC5C,QAAI,YAAY,MAAM;AACpB,eAAS;AACT,WAAK,eAAe,OAAO,GAAG;AAAA,IAChC;AAAA,EACF;AA0BF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|