@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
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import esbuild from "esbuild";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { FsUtils, HashUtils, PathUtils, SdLogger, TNormPath } from "@simplysm/sd-core-node";
|
|
4
|
-
import { SdCliConvertMessageUtils } from "../../utils/SdCliConvertMessageUtils";
|
|
5
|
-
import { createSdServerPlugin } from "./createSdServerPlugin";
|
|
6
|
-
import {
|
|
7
|
-
BuildOutputFile,
|
|
8
|
-
BuildOutputFileType,
|
|
9
|
-
} from "@angular/build/src/tools/esbuild/bundler-context";
|
|
10
|
-
import { convertOutputFile } from "@angular/build/src/tools/esbuild/utils";
|
|
11
|
-
import { resolveAssets } from "@angular/build/src/utils/resolve-assets";
|
|
12
|
-
import { ISdCliServerPluginResultCache } from "../../types/plugin/ISdCliServerPluginResultCache";
|
|
13
|
-
import { ISdBuildResult } from "../../types/build/ISdBuildResult";
|
|
14
|
-
import { ISdTsCompilerOptions } from "../../types/build/ISdTsCompilerOptions";
|
|
15
|
-
import { SdWorkerPathPlugin } from "../commons/SdWorkerPathPlugin";
|
|
16
|
-
|
|
17
|
-
export class SdServerBundler {
|
|
18
|
-
private readonly _logger = SdLogger.get(["simplysm", "sd-cli", "SdServerBundler"]);
|
|
19
|
-
|
|
20
|
-
private _context?: esbuild.BuildContext;
|
|
21
|
-
|
|
22
|
-
private readonly _modifiedFileSet = new Set<TNormPath>();
|
|
23
|
-
private readonly _resultCache: ISdCliServerPluginResultCache = {};
|
|
24
|
-
|
|
25
|
-
private readonly _outputHashCache = new Map<TNormPath, string>();
|
|
26
|
-
|
|
27
|
-
private readonly _esbuildOptions: esbuild.BuildOptions;
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
30
|
-
private readonly _opt: ISdTsCompilerOptions,
|
|
31
|
-
private readonly _conf: { external: string[] },
|
|
32
|
-
) {
|
|
33
|
-
this._esbuildOptions = {
|
|
34
|
-
entryPoints: [
|
|
35
|
-
path.resolve(this._opt.pkgPath, "src/main.ts"),
|
|
36
|
-
// ...FsUtils.glob(path.resolve(this._opt.pkgPath, "src/workers/*.ts")),
|
|
37
|
-
],
|
|
38
|
-
keepNames: true,
|
|
39
|
-
bundle: true,
|
|
40
|
-
sourcemap: !!this._opt.watch?.dev,
|
|
41
|
-
target: "node18",
|
|
42
|
-
mainFields: ["es2020", "es2015", "module", "main"],
|
|
43
|
-
conditions: ["es2020", "es2015", "module"],
|
|
44
|
-
tsconfig: path.resolve(this._opt.pkgPath, "tsconfig.json"),
|
|
45
|
-
write: false,
|
|
46
|
-
metafile: true,
|
|
47
|
-
legalComments: this._opt.watch?.dev ? "eof" : "none",
|
|
48
|
-
minifyIdentifiers: !this._opt.watch?.dev,
|
|
49
|
-
minifySyntax: !this._opt.watch?.dev,
|
|
50
|
-
minifyWhitespace: !this._opt.watch?.dev,
|
|
51
|
-
outdir: path.resolve(this._opt.pkgPath, "dist"),
|
|
52
|
-
format: "esm",
|
|
53
|
-
resolveExtensions: [".js", ".mjs", ".cjs", ".ts"],
|
|
54
|
-
preserveSymlinks: false,
|
|
55
|
-
loader: {
|
|
56
|
-
".png": "file",
|
|
57
|
-
".jpeg": "file",
|
|
58
|
-
".jpg": "file",
|
|
59
|
-
".jfif": "file",
|
|
60
|
-
".gif": "file",
|
|
61
|
-
".svg": "file",
|
|
62
|
-
".woff": "file",
|
|
63
|
-
".woff2": "file",
|
|
64
|
-
".ttf": "file",
|
|
65
|
-
".ttc": "file",
|
|
66
|
-
".eot": "file",
|
|
67
|
-
".ico": "file",
|
|
68
|
-
".otf": "file",
|
|
69
|
-
".csv": "file",
|
|
70
|
-
".xlsx": "file",
|
|
71
|
-
".xls": "file",
|
|
72
|
-
".pptx": "file",
|
|
73
|
-
".ppt": "file",
|
|
74
|
-
".docx": "file",
|
|
75
|
-
".doc": "file",
|
|
76
|
-
".zip": "file",
|
|
77
|
-
".pfx": "file",
|
|
78
|
-
".pkl": "file",
|
|
79
|
-
".mp3": "file",
|
|
80
|
-
".ogg": "file",
|
|
81
|
-
},
|
|
82
|
-
platform: "node",
|
|
83
|
-
logLevel: "silent",
|
|
84
|
-
external: this._conf.external,
|
|
85
|
-
banner: {
|
|
86
|
-
js: `
|
|
87
|
-
import __path__ from 'path';
|
|
88
|
-
import { fileURLToPath as __fileURLToPath__ } from 'url';
|
|
89
|
-
import { createRequire as __createRequire__ } from 'module';
|
|
90
|
-
|
|
91
|
-
const require = __createRequire__(import.meta.url);
|
|
92
|
-
const __filename = __fileURLToPath__(import.meta.url);
|
|
93
|
-
const __dirname = __path__.dirname(__filename);`.trim(),
|
|
94
|
-
},
|
|
95
|
-
plugins: [
|
|
96
|
-
createSdServerPlugin(this._opt, this._modifiedFileSet, this._resultCache),
|
|
97
|
-
SdWorkerPathPlugin(path.resolve(this._opt.pkgPath, "dist")),
|
|
98
|
-
],
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async bundleAsync(modifiedFileSet?: Set<TNormPath>): Promise<ISdBuildResult> {
|
|
103
|
-
this._modifiedFileSet.clear();
|
|
104
|
-
if (modifiedFileSet) {
|
|
105
|
-
this._modifiedFileSet.adds(...modifiedFileSet);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
let esbuildResult: esbuild.BuildResult;
|
|
109
|
-
if (this._opt.watch) {
|
|
110
|
-
if (this._context == null) {
|
|
111
|
-
this._context = await esbuild.context(this._esbuildOptions);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
try {
|
|
115
|
-
esbuildResult = await this._context.rebuild();
|
|
116
|
-
} catch (err) {
|
|
117
|
-
if ("warnings" in err || "errors" in err) {
|
|
118
|
-
esbuildResult = err;
|
|
119
|
-
} else {
|
|
120
|
-
throw err;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
try {
|
|
125
|
-
esbuildResult = await esbuild.build(this._esbuildOptions);
|
|
126
|
-
} catch (err) {
|
|
127
|
-
if ("warnings" in err || "errors" in err) {
|
|
128
|
-
esbuildResult = err;
|
|
129
|
-
} else {
|
|
130
|
-
throw err;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (this._opt.watch?.noEmit) {
|
|
136
|
-
return {
|
|
137
|
-
buildMessages: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(
|
|
138
|
-
esbuildResult,
|
|
139
|
-
this._opt.pkgPath,
|
|
140
|
-
),
|
|
141
|
-
|
|
142
|
-
watchFileSet: this._resultCache.watchFileSet!,
|
|
143
|
-
affectedFileSet: this._resultCache.affectedFileSet!,
|
|
144
|
-
emitFileSet: new Set<TNormPath>(),
|
|
145
|
-
};
|
|
146
|
-
} else {
|
|
147
|
-
const emitFileSet = new Set<TNormPath>();
|
|
148
|
-
|
|
149
|
-
try {
|
|
150
|
-
const outputFiles: BuildOutputFile[] =
|
|
151
|
-
esbuildResult.outputFiles?.map((file) =>
|
|
152
|
-
convertOutputFile(file, BuildOutputFileType.Root),
|
|
153
|
-
) ?? [];
|
|
154
|
-
|
|
155
|
-
for (const outputFile of outputFiles) {
|
|
156
|
-
const distFilePath = PathUtils.norm(this._opt.pkgPath, outputFile.path);
|
|
157
|
-
const prevHash = this._outputHashCache.get(distFilePath);
|
|
158
|
-
const currHash = HashUtils.get(Buffer.from(outputFile.contents));
|
|
159
|
-
if (prevHash !== currHash) {
|
|
160
|
-
FsUtils.writeFile(distFilePath, outputFile.contents);
|
|
161
|
-
this._outputHashCache.set(distFilePath, currHash);
|
|
162
|
-
emitFileSet.add(distFilePath);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
//-- copy assets
|
|
167
|
-
const assetFiles = await resolveAssets(
|
|
168
|
-
[
|
|
169
|
-
{ input: "public", glob: "**/*", output: "." },
|
|
170
|
-
...(this._opt.watch?.dev ? [{ input: "public-dev", glob: "**/*", output: "." }] : []),
|
|
171
|
-
],
|
|
172
|
-
this._opt.pkgPath,
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
for (const assetFile of assetFiles) {
|
|
176
|
-
const prevHash = this._outputHashCache.get(PathUtils.norm(assetFile.source));
|
|
177
|
-
const currHash = HashUtils.get(FsUtils.readFileBuffer(assetFile.source));
|
|
178
|
-
if (prevHash !== currHash) {
|
|
179
|
-
FsUtils.copy(
|
|
180
|
-
assetFile.source,
|
|
181
|
-
path.resolve(this._opt.pkgPath, "dist", assetFile.destination),
|
|
182
|
-
);
|
|
183
|
-
this._outputHashCache.set(PathUtils.norm(assetFile.source), currHash);
|
|
184
|
-
emitFileSet.add(PathUtils.norm(this._opt.pkgPath, "dist", assetFile.destination));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
esbuildResult = err;
|
|
189
|
-
for (const e of err.errors) {
|
|
190
|
-
if (e.detail != null) {
|
|
191
|
-
this._logger.error(e.detail);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return {
|
|
197
|
-
buildMessages: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(
|
|
198
|
-
esbuildResult,
|
|
199
|
-
this._opt.pkgPath,
|
|
200
|
-
),
|
|
201
|
-
|
|
202
|
-
watchFileSet: this._resultCache.watchFileSet!,
|
|
203
|
-
affectedFileSet: this._resultCache.affectedFileSet!,
|
|
204
|
-
emitFileSet: emitFileSet,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import esbuild from "esbuild";
|
|
2
|
-
import { SdCliConvertMessageUtils } from "../../utils/SdCliConvertMessageUtils";
|
|
3
|
-
import { PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
4
|
-
import { SdTsCompiler } from "../../ts-compiler/SdTsCompiler";
|
|
5
|
-
import { ISdCliServerPluginResultCache } from "../../types/plugin/ISdCliServerPluginResultCache";
|
|
6
|
-
import { ISdTsCompilerResult } from "../../types/build/ISdTsCompilerResult";
|
|
7
|
-
import { ISdTsCompilerOptions } from "../../types/build/ISdTsCompilerOptions";
|
|
8
|
-
|
|
9
|
-
export function createSdServerPlugin(
|
|
10
|
-
conf: ISdTsCompilerOptions,
|
|
11
|
-
modifiedFileSet: Set<TNormPath>,
|
|
12
|
-
resultCache: ISdCliServerPluginResultCache,
|
|
13
|
-
): esbuild.Plugin {
|
|
14
|
-
return {
|
|
15
|
-
name: "sd-server-plugin",
|
|
16
|
-
setup: (build: esbuild.PluginBuild) => {
|
|
17
|
-
const tsCompiler = new SdTsCompiler(conf, true);
|
|
18
|
-
|
|
19
|
-
let tsCompileResult: ISdTsCompilerResult;
|
|
20
|
-
|
|
21
|
-
build.onStart(async () => {
|
|
22
|
-
tsCompileResult = await tsCompiler.compileAsync(modifiedFileSet);
|
|
23
|
-
|
|
24
|
-
resultCache.watchFileSet = tsCompileResult.watchFileSet;
|
|
25
|
-
resultCache.affectedFileSet = tsCompileResult.affectedFileSet;
|
|
26
|
-
|
|
27
|
-
//-- return err/warn
|
|
28
|
-
return SdCliConvertMessageUtils.convertToEsbuildFromBuildMessages(
|
|
29
|
-
tsCompileResult.messages,
|
|
30
|
-
conf.pkgPath,
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
build.onLoad({ filter: /\.ts$/ }, (args) => {
|
|
35
|
-
const emittedJsFile = tsCompileResult.emittedFilesCacheMap
|
|
36
|
-
.get(PathUtils.norm(args.path))
|
|
37
|
-
?.last();
|
|
38
|
-
/*if (!emittedJsFile) {
|
|
39
|
-
return {
|
|
40
|
-
errors: [
|
|
41
|
-
{
|
|
42
|
-
text: `ts 빌더 결과 emit 파일이 존재하지 않습니다. ${args.path}`,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
|
-
}*/
|
|
47
|
-
|
|
48
|
-
return { contents: emittedJsFile?.text, loader: "js" };
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
build.onLoad({ filter: /\.[cm]?js$/ }, (args) => {
|
|
52
|
-
resultCache.watchFileSet!.add(PathUtils.norm(args.path));
|
|
53
|
-
return null;
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
build.onLoad(
|
|
57
|
-
{
|
|
58
|
-
filter: new RegExp(
|
|
59
|
-
"(" +
|
|
60
|
-
Object.keys(build.initialOptions.loader!)
|
|
61
|
-
.map((item) => "\\" + item)
|
|
62
|
-
.join("|") +
|
|
63
|
-
")$",
|
|
64
|
-
),
|
|
65
|
-
},
|
|
66
|
-
(args) => {
|
|
67
|
-
resultCache.watchFileSet!.add(PathUtils.norm(args.path));
|
|
68
|
-
return null;
|
|
69
|
-
},
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
build.onEnd((result) => {
|
|
73
|
-
resultCache.outputFiles = result.outputFiles;
|
|
74
|
-
resultCache.metafile = result.metafile;
|
|
75
|
-
|
|
76
|
-
modifiedFileSet.clear();
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
}
|
package/src/sd-cli-entry.ts
DELETED
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-console */
|
|
4
|
-
|
|
5
|
-
import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
6
|
-
import { EventEmitter } from "events";
|
|
7
|
-
import yargs from "yargs";
|
|
8
|
-
import { hideBin } from "yargs/helpers";
|
|
9
|
-
import { SdCliAiCommand } from "./entry/SdCliAiCommand";
|
|
10
|
-
import { SdCliCordova } from "./entry/SdCliCordova";
|
|
11
|
-
import { SdCliElectron } from "./entry/SdCliElectron";
|
|
12
|
-
import { SdCliLocalUpdate } from "./entry/SdCliLocalUpdate";
|
|
13
|
-
import { SdCliPostInstall } from "./entry/SdCliPostInstall";
|
|
14
|
-
import { SdCliProject } from "./entry/SdCliProject";
|
|
15
|
-
import { SdCliCapacitor } from "./entry/SdCliCapacitor";
|
|
16
|
-
|
|
17
|
-
Error.stackTraceLimit = Infinity;
|
|
18
|
-
EventEmitter.defaultMaxListeners = 0;
|
|
19
|
-
|
|
20
|
-
await yargs(hideBin(process.argv))
|
|
21
|
-
.help("help", "도움말")
|
|
22
|
-
.alias("help", "h")
|
|
23
|
-
.options({
|
|
24
|
-
debug: {
|
|
25
|
-
type: "boolean",
|
|
26
|
-
describe: "디버그 로그를 표시할 것인지 여부",
|
|
27
|
-
default: false,
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
.middleware((argv) => {
|
|
31
|
-
if (argv.debug) {
|
|
32
|
-
process.env["SD_DEBUG"] = "true";
|
|
33
|
-
SdLogger.setConfig({
|
|
34
|
-
console: { level: SdLoggerSeverity.debug },
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
SdLogger.setConfig({ dot: true });
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
.command(
|
|
41
|
-
"local-update",
|
|
42
|
-
"로컬 라이브러리 업데이트를 수행합니다.",
|
|
43
|
-
(cmd) =>
|
|
44
|
-
cmd
|
|
45
|
-
.version(false)
|
|
46
|
-
.hide("help")
|
|
47
|
-
.hide("debug")
|
|
48
|
-
.options({
|
|
49
|
-
config: {
|
|
50
|
-
string: true,
|
|
51
|
-
describe: "설정 파일 경로",
|
|
52
|
-
default: "simplysm.js",
|
|
53
|
-
},
|
|
54
|
-
options: {
|
|
55
|
-
string: true,
|
|
56
|
-
array: true,
|
|
57
|
-
describe: "옵션 설정",
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
async (argv) => await SdCliLocalUpdate.runAsync(argv),
|
|
61
|
-
)
|
|
62
|
-
.command(
|
|
63
|
-
"watch",
|
|
64
|
-
"프로젝트의 각 패키지에 대한 변경감지 빌드를 수행합니다.",
|
|
65
|
-
(cmd) =>
|
|
66
|
-
cmd
|
|
67
|
-
.version(false)
|
|
68
|
-
.hide("help")
|
|
69
|
-
.hide("debug")
|
|
70
|
-
.options({
|
|
71
|
-
config: {
|
|
72
|
-
string: true,
|
|
73
|
-
describe: "설정 파일 경로",
|
|
74
|
-
default: "simplysm.js",
|
|
75
|
-
},
|
|
76
|
-
options: {
|
|
77
|
-
string: true,
|
|
78
|
-
array: true,
|
|
79
|
-
describe: "옵션 설정",
|
|
80
|
-
},
|
|
81
|
-
packages: {
|
|
82
|
-
string: true,
|
|
83
|
-
array: true,
|
|
84
|
-
describe: "수행할 패키지 설정",
|
|
85
|
-
},
|
|
86
|
-
emitOnly: {
|
|
87
|
-
type: "boolean",
|
|
88
|
-
describe: "emit만 수행",
|
|
89
|
-
default: false,
|
|
90
|
-
},
|
|
91
|
-
noEmit: {
|
|
92
|
-
type: "boolean",
|
|
93
|
-
describe: "emit만 수행",
|
|
94
|
-
default: false,
|
|
95
|
-
},
|
|
96
|
-
}),
|
|
97
|
-
async (argv) => await SdCliProject.watchAsync(argv),
|
|
98
|
-
)
|
|
99
|
-
.command(
|
|
100
|
-
"build",
|
|
101
|
-
"프로젝트의 각 패키지에 대한 빌드를 수행합니다.",
|
|
102
|
-
(cmd) =>
|
|
103
|
-
cmd
|
|
104
|
-
.version(false)
|
|
105
|
-
.hide("help")
|
|
106
|
-
.hide("debug")
|
|
107
|
-
.options({
|
|
108
|
-
config: {
|
|
109
|
-
string: true,
|
|
110
|
-
describe: "설정 파일 경로",
|
|
111
|
-
default: "simplysm.js",
|
|
112
|
-
},
|
|
113
|
-
options: {
|
|
114
|
-
string: true,
|
|
115
|
-
array: true,
|
|
116
|
-
describe: "옵션 설정",
|
|
117
|
-
},
|
|
118
|
-
packages: {
|
|
119
|
-
string: true,
|
|
120
|
-
array: true,
|
|
121
|
-
describe: "수행할 패키지 설정",
|
|
122
|
-
},
|
|
123
|
-
}),
|
|
124
|
-
async (argv) => {
|
|
125
|
-
await SdCliProject.buildAsync(argv);
|
|
126
|
-
},
|
|
127
|
-
)
|
|
128
|
-
.command(
|
|
129
|
-
"publish",
|
|
130
|
-
"프로젝트의 각 패키지를 배포합니다.",
|
|
131
|
-
(cmd) =>
|
|
132
|
-
cmd
|
|
133
|
-
.version(false)
|
|
134
|
-
.hide("help")
|
|
135
|
-
.hide("debug")
|
|
136
|
-
.options({
|
|
137
|
-
noBuild: {
|
|
138
|
-
type: "boolean",
|
|
139
|
-
describe: "빌드를 하지않고 배포합니다.",
|
|
140
|
-
default: false,
|
|
141
|
-
},
|
|
142
|
-
config: {
|
|
143
|
-
type: "string",
|
|
144
|
-
describe: "설정 파일 경로",
|
|
145
|
-
default: "simplysm.js",
|
|
146
|
-
},
|
|
147
|
-
options: {
|
|
148
|
-
type: "string",
|
|
149
|
-
array: true,
|
|
150
|
-
describe: "옵션 설정",
|
|
151
|
-
},
|
|
152
|
-
packages: {
|
|
153
|
-
type: "string",
|
|
154
|
-
array: true,
|
|
155
|
-
describe: "수행할 패키지 설정",
|
|
156
|
-
},
|
|
157
|
-
}),
|
|
158
|
-
async (argv) => {
|
|
159
|
-
await SdCliProject.publishAsync(argv);
|
|
160
|
-
process.exit(0);
|
|
161
|
-
},
|
|
162
|
-
)
|
|
163
|
-
.command(
|
|
164
|
-
"run-electron <package>",
|
|
165
|
-
"변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.",
|
|
166
|
-
(cmd) =>
|
|
167
|
-
cmd
|
|
168
|
-
.version(false)
|
|
169
|
-
.hide("help")
|
|
170
|
-
.hide("debug")
|
|
171
|
-
.positional("package", {
|
|
172
|
-
type: "string",
|
|
173
|
-
describe: "패키지명",
|
|
174
|
-
demandOption: true,
|
|
175
|
-
})
|
|
176
|
-
.options({
|
|
177
|
-
config: {
|
|
178
|
-
type: "string",
|
|
179
|
-
describe: "설정 파일 경로",
|
|
180
|
-
default: "simplysm.js",
|
|
181
|
-
},
|
|
182
|
-
options: {
|
|
183
|
-
type: "string",
|
|
184
|
-
array: true,
|
|
185
|
-
describe: "옵션 설정",
|
|
186
|
-
},
|
|
187
|
-
}),
|
|
188
|
-
async (argv) => await SdCliElectron.runAsync(argv),
|
|
189
|
-
)
|
|
190
|
-
.command(
|
|
191
|
-
"build-electron-for-dev <package>",
|
|
192
|
-
"변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.",
|
|
193
|
-
(cmd) =>
|
|
194
|
-
cmd
|
|
195
|
-
.version(false)
|
|
196
|
-
.hide("help")
|
|
197
|
-
.hide("debug")
|
|
198
|
-
.positional("package", {
|
|
199
|
-
type: "string",
|
|
200
|
-
describe: "패키지명",
|
|
201
|
-
demandOption: true,
|
|
202
|
-
})
|
|
203
|
-
.options({
|
|
204
|
-
config: {
|
|
205
|
-
type: "string",
|
|
206
|
-
describe: "설정 파일 경로",
|
|
207
|
-
default: "simplysm.js",
|
|
208
|
-
},
|
|
209
|
-
options: {
|
|
210
|
-
type: "string",
|
|
211
|
-
array: true,
|
|
212
|
-
describe: "옵션 설정",
|
|
213
|
-
},
|
|
214
|
-
}),
|
|
215
|
-
async (argv) => await SdCliElectron.buildForDevAsync(argv),
|
|
216
|
-
)
|
|
217
|
-
.command(
|
|
218
|
-
"run-cordova <platform> <package> [url]",
|
|
219
|
-
"변경감지중인 플랫폼을 코도바 디바이스에 앱 형태로 띄웁니다.",
|
|
220
|
-
(cmd) =>
|
|
221
|
-
cmd
|
|
222
|
-
.version(false)
|
|
223
|
-
.hide("help")
|
|
224
|
-
.hide("debug")
|
|
225
|
-
.positional("platform", {
|
|
226
|
-
type: "string",
|
|
227
|
-
describe: "빌드 플랫폼(android,...)",
|
|
228
|
-
demandOption: true,
|
|
229
|
-
})
|
|
230
|
-
.positional("package", {
|
|
231
|
-
type: "string",
|
|
232
|
-
describe: "패키지명",
|
|
233
|
-
demandOption: true,
|
|
234
|
-
})
|
|
235
|
-
.positional("url", {
|
|
236
|
-
type: "string",
|
|
237
|
-
describe: "Webview로 오픈할 URL",
|
|
238
|
-
demandOption: true,
|
|
239
|
-
}),
|
|
240
|
-
async (argv) => await SdCliCordova.runWebviewOnDeviceAsync(argv),
|
|
241
|
-
)
|
|
242
|
-
.command(
|
|
243
|
-
"run-capacitor <platform> <package> [url]",
|
|
244
|
-
"변경감지중인 플랫폼을 Capacitor 디바이스에 앱 형태로 띄웁니다.",
|
|
245
|
-
(cmd) =>
|
|
246
|
-
cmd
|
|
247
|
-
.version(false)
|
|
248
|
-
.hide("help")
|
|
249
|
-
.hide("debug")
|
|
250
|
-
.positional("platform", {
|
|
251
|
-
type: "string",
|
|
252
|
-
describe: "빌드 플랫폼(android,...)",
|
|
253
|
-
demandOption: true,
|
|
254
|
-
})
|
|
255
|
-
.positional("package", {
|
|
256
|
-
type: "string",
|
|
257
|
-
describe: "패키지명",
|
|
258
|
-
demandOption: true,
|
|
259
|
-
})
|
|
260
|
-
.positional("url", {
|
|
261
|
-
type: "string",
|
|
262
|
-
describe: "Webview로 오픈할 URL",
|
|
263
|
-
demandOption: true,
|
|
264
|
-
}),
|
|
265
|
-
async (argv) => await SdCliCapacitor.runWebviewOnDeviceAsync(argv),
|
|
266
|
-
)
|
|
267
|
-
.command(
|
|
268
|
-
"commit",
|
|
269
|
-
"AI를 통해 변경사항에 대한 커밋 메시지를 작성하여, 커밋 및 푸쉬를 수행합니다.",
|
|
270
|
-
(cmd) => cmd.version(false).hide("help").hide("debug"),
|
|
271
|
-
async () => await SdCliAiCommand.commitAsync(),
|
|
272
|
-
)
|
|
273
|
-
.command(
|
|
274
|
-
"postinstall",
|
|
275
|
-
"설치후 자동실행할 작업",
|
|
276
|
-
(cmd) => cmd.version(false).hide("help").hide("debug"),
|
|
277
|
-
() => SdCliPostInstall.run(),
|
|
278
|
-
)
|
|
279
|
-
.strict()
|
|
280
|
-
.recommendCommands()
|
|
281
|
-
.fail((msg, err, cmd) => {
|
|
282
|
-
if (Boolean(err)) {
|
|
283
|
-
throw err;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
console.error("지원되지 않는 명령입니다.");
|
|
287
|
-
console.error(msg);
|
|
288
|
-
console.log("\n명령어 목록:");
|
|
289
|
-
cmd.showHelp();
|
|
290
|
-
process.exit(1);
|
|
291
|
-
})
|
|
292
|
-
.parseAsync();
|
package/src/sd-cli.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { exec, spawn } from "child_process";
|
|
4
|
-
import os from "os";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
7
|
-
|
|
8
|
-
// CLI 경로 확인
|
|
9
|
-
const cliPath = import.meta.resolve("./sd-cli-entry");
|
|
10
|
-
|
|
11
|
-
if (path.extname(cliPath) === ".ts") {
|
|
12
|
-
// .ts 바로실행 (개발)
|
|
13
|
-
|
|
14
|
-
// 현재 프로세스에 affinity 적용
|
|
15
|
-
configureProcessorAffinityAndPriority(process.pid);
|
|
16
|
-
|
|
17
|
-
await import(cliPath);
|
|
18
|
-
} else {
|
|
19
|
-
// .js 번들 실행 (배포본)
|
|
20
|
-
|
|
21
|
-
// 로컬 업데이트
|
|
22
|
-
// if (process.argv.slice(2).includes("watch") && !process.argv.slice(2).includes("--noEmit")) {
|
|
23
|
-
if (!process.argv.slice(2).includes("local-update")) {
|
|
24
|
-
await spawnWaitAsync(`node`, [
|
|
25
|
-
"--import=specifier-resolution-node/register",
|
|
26
|
-
fileURLToPath(cliPath),
|
|
27
|
-
"local-update",
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
// }
|
|
31
|
-
|
|
32
|
-
// 프로세스 실행
|
|
33
|
-
const child = spawn(
|
|
34
|
-
"node",
|
|
35
|
-
[
|
|
36
|
-
"--import=specifier-resolution-node/register",
|
|
37
|
-
"--max-old-space-size=8192",
|
|
38
|
-
// "--initial-old-space-size=2048",
|
|
39
|
-
"--max-semi-space-size=16", //128
|
|
40
|
-
// "--stack-size=16384",
|
|
41
|
-
fileURLToPath(cliPath),
|
|
42
|
-
...process.argv.slice(2),
|
|
43
|
-
],
|
|
44
|
-
{ stdio: "inherit" },
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// 실행된 프로세스에 Affinity 적용
|
|
48
|
-
child.on("spawn", () => {
|
|
49
|
-
if (child.pid == null) return;
|
|
50
|
-
configureProcessorAffinityAndPriority(child.pid);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function configureProcessorAffinityAndPriority(pid: number) {
|
|
55
|
-
const cpuCount = os.cpus().length;
|
|
56
|
-
const affinityMask = calculateAffinityMask(cpuCount);
|
|
57
|
-
|
|
58
|
-
const commands = [
|
|
59
|
-
`$p = Get-Process -Id ${pid}`,
|
|
60
|
-
`$p.ProcessorAffinity = ${affinityMask}`,
|
|
61
|
-
`$p.PriorityClass = 'BelowNormal'`,
|
|
62
|
-
].join("; ");
|
|
63
|
-
|
|
64
|
-
const command = `powershell -Command "${commands}"`;
|
|
65
|
-
|
|
66
|
-
exec(command, (err) => {
|
|
67
|
-
if (err) {
|
|
68
|
-
// eslint-disable-next-line no-console
|
|
69
|
-
console.error("Affinity 또는 우선순위 설정 실패:", err.message);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// ProcessorAffinity 마스크 계산 (앞 코어 빼기)
|
|
75
|
-
function calculateAffinityMask(cpuCount: number): string {
|
|
76
|
-
const exclude = cpuCount <= 1 ? 0 : Math.ceil(cpuCount / 4); // 예: 4개당 1개 제외
|
|
77
|
-
const usableStart = exclude;
|
|
78
|
-
const usableEnd = cpuCount;
|
|
79
|
-
|
|
80
|
-
if (usableEnd - usableStart <= 0) {
|
|
81
|
-
throw new Error(`CPU 사용 가능 개수가 0 이하입니다 (총: ${cpuCount}, 제외: ${exclude})`);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
let mask = 0n;
|
|
85
|
-
|
|
86
|
-
for (let i = usableStart; i < usableEnd; i++) {
|
|
87
|
-
mask |= 1n << BigInt(i);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return "0x" + mask.toString(16).toUpperCase();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async function spawnWaitAsync(command: string, args: string[]) {
|
|
94
|
-
await new Promise<void>((resolve) => {
|
|
95
|
-
const child = spawn(command, args, {
|
|
96
|
-
cwd: process.cwd(),
|
|
97
|
-
env: { ...process.env },
|
|
98
|
-
stdio: "inherit",
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
child.on("close", () => {
|
|
102
|
-
resolve();
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
2
|
-
|
|
3
|
-
export class ScopePathSet {
|
|
4
|
-
private readonly _data: Set<TNormPath>;
|
|
5
|
-
|
|
6
|
-
constructor(arrOrSet?: TNormPath[] | Set<TNormPath>) {
|
|
7
|
-
this._data = arrOrSet instanceof Set ? arrOrSet : new Set(arrOrSet);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
inScope(filePath: string) {
|
|
11
|
-
return Array.from(this._data).some((scope) => PathUtils.isChildPath(filePath, scope));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
toArray() {
|
|
15
|
-
return Array.from(this._data);
|
|
16
|
-
}
|
|
17
|
-
}
|