@simplysm/sd-cli 12.16.24 → 13.0.0-beta.11
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,48 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from "url";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
export class SdCliPostInstall {
|
|
4
|
-
static run() {
|
|
5
|
-
{
|
|
6
|
-
const filePath = fileURLToPath(import.meta.resolve("@angular/build/package.json"));
|
|
7
|
-
const contents = JSON.parse(fs.readFileSync(filePath).toString());
|
|
8
|
-
delete contents.exports;
|
|
9
|
-
fs.writeFileSync(filePath, JSON.stringify(contents, undefined, 2));
|
|
10
|
-
}
|
|
11
|
-
/*{
|
|
12
|
-
const fortawesomeDirPath = path.resolve(
|
|
13
|
-
path.dirname(
|
|
14
|
-
fileURLToPath(import.meta.resolve("@fortawesome/fontawesome-svg-core/package.json")),
|
|
15
|
-
),
|
|
16
|
-
"..",
|
|
17
|
-
);
|
|
18
|
-
const iconsDirNames = fs
|
|
19
|
-
.readdirSync(fortawesomeDirPath)
|
|
20
|
-
.filter((item) => item.endsWith("-icons"));
|
|
21
|
-
for (const iconsDirName of iconsDirNames) {
|
|
22
|
-
const dirPath = path.resolve(fortawesomeDirPath, iconsDirName);
|
|
23
|
-
|
|
24
|
-
const contents = JSON.parse(
|
|
25
|
-
fs.readFileSync(path.resolve(dirPath, "package.json")).toString(),
|
|
26
|
-
);
|
|
27
|
-
contents.exports = {
|
|
28
|
-
"./package.json": "./package.json",
|
|
29
|
-
"./!*": "./!*.js",
|
|
30
|
-
};
|
|
31
|
-
fs.writeFileSync(
|
|
32
|
-
path.resolve(dirPath, "package.json"),
|
|
33
|
-
JSON.stringify(contents, undefined, 2),
|
|
34
|
-
);
|
|
35
|
-
fs.rmSync(path.resolve(dirPath, "index.d.ts"), { force: true });
|
|
36
|
-
fs.rmSync(path.resolve(dirPath, "index.js"), { force: true });
|
|
37
|
-
fs.rmSync(path.resolve(dirPath, "index.mjs"), { force: true });
|
|
38
|
-
}
|
|
39
|
-
}*/
|
|
40
|
-
{
|
|
41
|
-
const filePath = fileURLToPath(import.meta.resolve("cordova/bin/cordova"));
|
|
42
|
-
let contents = fs.readFileSync(filePath).toString();
|
|
43
|
-
contents = contents.replace("process.exitCode = err.code || 1;", "process.exitCode = 1;");
|
|
44
|
-
contents = contents.replace("console.error(err.message);", "console.error(err);");
|
|
45
|
-
fs.writeFileSync(filePath, contents);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare class SdCliProject {
|
|
2
|
-
static watchAsync(opt: {
|
|
3
|
-
config: string;
|
|
4
|
-
options?: string[];
|
|
5
|
-
packages?: string[];
|
|
6
|
-
emitOnly?: boolean;
|
|
7
|
-
noEmit?: boolean;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
static buildAsync(opt: {
|
|
10
|
-
config: string;
|
|
11
|
-
options?: string[];
|
|
12
|
-
packages?: string[];
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
static publishAsync(opt: {
|
|
15
|
-
config: string;
|
|
16
|
-
options?: string[];
|
|
17
|
-
packages?: string[];
|
|
18
|
-
noBuild?: boolean;
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
private static _publishPkgAsync;
|
|
21
|
-
private static _waitSecMessageAsync;
|
|
22
|
-
private static _upgradeVersion;
|
|
23
|
-
private static _logging;
|
|
24
|
-
}
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { FsUtils, PathUtils, SdLogger, SdProcess } from "@simplysm/sd-core-node";
|
|
3
|
-
import semver from "semver";
|
|
4
|
-
import { NeverEntryError, StringUtils, Wait } from "@simplysm/sd-core-common";
|
|
5
|
-
import { SdStorage } from "@simplysm/sd-storage";
|
|
6
|
-
import { SdCliLocalUpdate } from "./SdCliLocalUpdate";
|
|
7
|
-
import { SdCliConvertMessageUtils } from "../utils/SdCliConvertMessageUtils";
|
|
8
|
-
import { loadProjConfAsync } from "../utils/loadProjConfAsync";
|
|
9
|
-
import { SdProjectBuildRunner } from "../pkg-builders/SdProjectBuildRunner";
|
|
10
|
-
export class SdCliProject {
|
|
11
|
-
static async watchAsync(opt) {
|
|
12
|
-
const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "watchAsync"]);
|
|
13
|
-
logger.debug("프로젝트 설정 가져오기...");
|
|
14
|
-
const projConf = await loadProjConfAsync(process.cwd(), true, opt);
|
|
15
|
-
if (!opt.noEmit) {
|
|
16
|
-
if (projConf.localUpdates) {
|
|
17
|
-
logger.debug("로컬 라이브러리 업데이트 변경감지 시작...");
|
|
18
|
-
await SdCliLocalUpdate.watchAsync(opt);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
logger.debug("프로젝트 package.json 가져오기...");
|
|
22
|
-
const projNpmConf = (await FsUtils.readJsonAsync(path.resolve(process.cwd(), "package.json")));
|
|
23
|
-
logger.debug("패키지 목록 구성...");
|
|
24
|
-
if (!projNpmConf.workspaces) {
|
|
25
|
-
throw new Error("프로젝트 package.json에 workspaces가 설정되어있지 않습니다.");
|
|
26
|
-
}
|
|
27
|
-
const allPkgPaths = (await projNpmConf.workspaces.mapManyAsync(async (item) => await FsUtils.globAsync(item)))
|
|
28
|
-
.filter((item) => !item.includes("."))
|
|
29
|
-
.map((item) => PathUtils.norm(item));
|
|
30
|
-
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
31
|
-
if (opt.packages) {
|
|
32
|
-
pkgPaths = pkgPaths.filter((pkgPath) => opt.packages.includes(path.basename(pkgPath)));
|
|
33
|
-
}
|
|
34
|
-
logger.debug("패키지 존재 확인...");
|
|
35
|
-
const notExistsPkgs = Object.keys(projConf.packages).filter((pkgConfKey) => allPkgPaths.every((pkgPath) => path.basename(pkgPath) !== pkgConfKey));
|
|
36
|
-
if (notExistsPkgs.length > 0) {
|
|
37
|
-
throw new Error("패키지를 찾을 수 없습니다. (" + notExistsPkgs.join(", ") + ")");
|
|
38
|
-
}
|
|
39
|
-
await SdProjectBuildRunner.watchAsync({
|
|
40
|
-
allPkgPaths,
|
|
41
|
-
pkgPaths,
|
|
42
|
-
projConf,
|
|
43
|
-
emitOnly: opt.emitOnly ?? false,
|
|
44
|
-
noEmit: opt.noEmit ?? false,
|
|
45
|
-
onChange: () => {
|
|
46
|
-
logger.debug("빌드를 시작합니다...");
|
|
47
|
-
},
|
|
48
|
-
onComplete: (messages) => {
|
|
49
|
-
this._logging(messages, logger);
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
static async buildAsync(opt) {
|
|
54
|
-
const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "watchAsync"]);
|
|
55
|
-
logger.debug("프로젝트 설정 가져오기...");
|
|
56
|
-
const projConf = await loadProjConfAsync(process.cwd(), false, opt);
|
|
57
|
-
logger.debug("프로젝트 package.json 가져오기...");
|
|
58
|
-
const projNpmConf = (await FsUtils.readJsonAsync(path.resolve(process.cwd(), "package.json")));
|
|
59
|
-
logger.debug("패키지 목록 구성...");
|
|
60
|
-
if (!projNpmConf.workspaces) {
|
|
61
|
-
throw new Error("프로젝트 package.json에 workspaces가 설정되어있지 않습니다.");
|
|
62
|
-
}
|
|
63
|
-
const allPkgPaths = (await projNpmConf.workspaces.mapManyAsync(async (item) => await FsUtils.globAsync(item)))
|
|
64
|
-
.filter((item) => !item.includes("."))
|
|
65
|
-
.map((item) => PathUtils.norm(item));
|
|
66
|
-
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
67
|
-
if (opt.packages) {
|
|
68
|
-
pkgPaths = pkgPaths.filter((pkgPath) => opt.packages.includes(path.basename(pkgPath)));
|
|
69
|
-
}
|
|
70
|
-
logger.debug("패키지 존재 확인...");
|
|
71
|
-
const notExistsPkgs = Object.keys(projConf.packages).filter((pkgConfKey) => allPkgPaths.every((pkgPath) => path.basename(pkgPath) !== pkgConfKey));
|
|
72
|
-
if (notExistsPkgs.length > 0) {
|
|
73
|
-
throw new Error("패키지를 찾을 수 없습니다. (" + notExistsPkgs.join(", ") + ")");
|
|
74
|
-
}
|
|
75
|
-
logger.debug("프로젝트 및 패키지 버전 설정...");
|
|
76
|
-
this._upgradeVersion(projNpmConf, allPkgPaths);
|
|
77
|
-
logger.debug("빌드 프로세스 시작...");
|
|
78
|
-
const messages = await SdProjectBuildRunner.buildAsync({
|
|
79
|
-
allPkgPaths,
|
|
80
|
-
pkgPaths,
|
|
81
|
-
projConf,
|
|
82
|
-
});
|
|
83
|
-
this._logging(messages, logger);
|
|
84
|
-
}
|
|
85
|
-
static async publishAsync(opt) {
|
|
86
|
-
const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "publishAsync"]);
|
|
87
|
-
logger.debug("프로젝트 설정 가져오기...");
|
|
88
|
-
const projConf = await loadProjConfAsync(process.cwd(), false, opt);
|
|
89
|
-
if (Object.values(projConf.packages).some((item) => item?.publish === "npm")) {
|
|
90
|
-
logger.debug("npm/yarn 토큰 유효성 체크...");
|
|
91
|
-
try {
|
|
92
|
-
const npmWhoami = await SdProcess.spawnAsync("npm", ["whoami"]);
|
|
93
|
-
if (StringUtils.isNullOrEmpty(npmWhoami.trim())) {
|
|
94
|
-
throw new Error();
|
|
95
|
-
}
|
|
96
|
-
logger.debug(`npm 로그인 확인: ${npmWhoami.trim()}`);
|
|
97
|
-
const yarnWhoami = await SdProcess.spawnAsync("yarn", ["npm", "whoami"]);
|
|
98
|
-
if (StringUtils.isNullOrEmpty(yarnWhoami.trim())) {
|
|
99
|
-
throw new Error();
|
|
100
|
-
}
|
|
101
|
-
logger.debug(`yarn 로그인 확인: ${yarnWhoami.trim()}`);
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
throw new Error("npm 토큰이 유효하지 않거나 만료되었습니다.\n" +
|
|
105
|
-
"https://www.npmjs.com/settings/~/tokens 에서 Granular Access Token 생성 후:\n" +
|
|
106
|
-
" npm config set //registry.npmjs.org/:_authToken <토큰>\n" +
|
|
107
|
-
" yarn config set npmAuthToken <토큰> --home");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
logger.debug("프로젝트 package.json 가져오기...");
|
|
111
|
-
const projNpmConf = FsUtils.readJson(path.resolve(process.cwd(), "package.json"));
|
|
112
|
-
if (opt.noBuild) {
|
|
113
|
-
logger.warn("빌드하지 않고, 배포하는것은 상당히 위험합니다.");
|
|
114
|
-
await this._waitSecMessageAsync("프로세스를 중지하려면, 'CTRL+C'를 누르세요.", 5);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
// GIT 사용중일 경우, 커밋되지 않은 수정사항이 있는지 확인
|
|
118
|
-
if (FsUtils.exists(path.resolve(process.cwd(), ".git"))) {
|
|
119
|
-
logger.debug("GIT 커밋여부 확인...");
|
|
120
|
-
const diff = await SdProcess.spawnAsync("git", [
|
|
121
|
-
"diff",
|
|
122
|
-
"--name-only",
|
|
123
|
-
"--",
|
|
124
|
-
".",
|
|
125
|
-
`:(exclude).*`,
|
|
126
|
-
`:(exclude)_*`,
|
|
127
|
-
`:(exclude)yarn.lock`,
|
|
128
|
-
`:(exclude)packages/*/styles.css`,
|
|
129
|
-
`:(exclude)packages/*/package.json`,
|
|
130
|
-
`:(exclude)package.json`,
|
|
131
|
-
]);
|
|
132
|
-
if (!StringUtils.isNullOrEmpty(diff.trim())) {
|
|
133
|
-
throw new Error("커밋되지 않은 정보가 있습니다.\n" + diff);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
logger.debug("패키지 목록 구성...");
|
|
138
|
-
if (!projNpmConf.workspaces) {
|
|
139
|
-
throw new Error("프로젝트 package.json에 workspaces가 설정되어있지 않습니다.");
|
|
140
|
-
}
|
|
141
|
-
const allPkgPaths = projNpmConf.workspaces
|
|
142
|
-
.mapMany((item) => FsUtils.glob(item))
|
|
143
|
-
.filter((item) => !item.includes("."))
|
|
144
|
-
.map((item) => PathUtils.norm(item));
|
|
145
|
-
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
146
|
-
if (opt.packages) {
|
|
147
|
-
pkgPaths = pkgPaths.filter((pkgPath) => opt.packages.includes(path.basename(pkgPath)));
|
|
148
|
-
}
|
|
149
|
-
logger.debug("패키지 존재 확인...");
|
|
150
|
-
const notExistsPkgs = Object.keys(projConf.packages).filter((pkgConfKey) => allPkgPaths.every((pkgPath) => path.basename(pkgPath) !== pkgConfKey));
|
|
151
|
-
if (notExistsPkgs.length > 0) {
|
|
152
|
-
throw new Error("패키지를 찾을 수 없습니다. (" + notExistsPkgs.join(", ") + ")");
|
|
153
|
-
}
|
|
154
|
-
if (!opt.noBuild) {
|
|
155
|
-
logger.debug("프로젝트 및 패키지 버전 설정...");
|
|
156
|
-
this._upgradeVersion(projNpmConf, allPkgPaths);
|
|
157
|
-
// 빌드
|
|
158
|
-
try {
|
|
159
|
-
logger.debug("빌드 프로세스 시작...");
|
|
160
|
-
const messages = await SdProjectBuildRunner.buildAsync({
|
|
161
|
-
allPkgPaths,
|
|
162
|
-
pkgPaths,
|
|
163
|
-
projConf,
|
|
164
|
-
});
|
|
165
|
-
this._logging(messages, logger);
|
|
166
|
-
}
|
|
167
|
-
catch (err) {
|
|
168
|
-
await SdProcess.spawnAsync("git", ["checkout", "."]);
|
|
169
|
-
throw err;
|
|
170
|
-
}
|
|
171
|
-
// GIT 사용중일경우, 새 버전 커밋 및 TAG 생성
|
|
172
|
-
if (FsUtils.exists(path.resolve(process.cwd(), ".git"))) {
|
|
173
|
-
logger.debug("새 버전 커밋 및 TAG 생성...");
|
|
174
|
-
await SdProcess.spawnAsync("git", ["add", "."]);
|
|
175
|
-
await SdProcess.spawnAsync("git", ["commit", "-m", `v${projNpmConf.version}`]);
|
|
176
|
-
await SdProcess.spawnAsync("git", [
|
|
177
|
-
"tag",
|
|
178
|
-
"-a",
|
|
179
|
-
`v${projNpmConf.version}`,
|
|
180
|
-
"-m",
|
|
181
|
-
`v${projNpmConf.version}`,
|
|
182
|
-
]);
|
|
183
|
-
logger.debug("새 버전 푸쉬...");
|
|
184
|
-
await SdProcess.spawnAsync("git", ["push"]);
|
|
185
|
-
await SdProcess.spawnAsync("git", ["push", "--tags"]);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
logger.debug("배포 시작...");
|
|
189
|
-
await pkgPaths.parallelAsync(async (pkgPath) => {
|
|
190
|
-
const pkgName = path.basename(pkgPath);
|
|
191
|
-
const pkgConf = projConf.packages[pkgName];
|
|
192
|
-
if (pkgConf?.publish == null)
|
|
193
|
-
return;
|
|
194
|
-
logger.debug(`[${pkgName}] 배포 시작...`);
|
|
195
|
-
await this._publishPkgAsync(pkgPath, pkgConf.publish);
|
|
196
|
-
logger.debug(`[${pkgName}] 배포 완료`);
|
|
197
|
-
});
|
|
198
|
-
if (projConf.postPublish && projConf.postPublish.length > 0) {
|
|
199
|
-
logger.debug("배포후 작업...");
|
|
200
|
-
for (const postPublishItem of projConf.postPublish) {
|
|
201
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
202
|
-
if (postPublishItem.type === "script") {
|
|
203
|
-
const replaceEnvPath = (str) => str.replace(/%([^%]*)%/g, (item) => {
|
|
204
|
-
const envName = item.replace(/%/g, "");
|
|
205
|
-
if (!StringUtils.isNullOrEmpty(projNpmConf.version) && envName === "SD_VERSION") {
|
|
206
|
-
return projNpmConf.version;
|
|
207
|
-
}
|
|
208
|
-
if (envName === "SD_PROJECT_PATH") {
|
|
209
|
-
return process.cwd();
|
|
210
|
-
}
|
|
211
|
-
return process.env[envName] ?? item;
|
|
212
|
-
});
|
|
213
|
-
const cmd = replaceEnvPath(postPublishItem.cmd);
|
|
214
|
-
const args = postPublishItem.args.map((arg) => replaceEnvPath(arg));
|
|
215
|
-
await SdProcess.spawnAsync(cmd, args);
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
throw new NeverEntryError();
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
logger.info(`모든 배포가 완료되었습니다. (v${projNpmConf.version})`);
|
|
223
|
-
}
|
|
224
|
-
static async _publishPkgAsync(pkgPath, pkgPubConf) {
|
|
225
|
-
if (pkgPubConf === "npm") {
|
|
226
|
-
await SdProcess.spawnAsync("yarn", ["npm", "publish", "--access", "public"], {
|
|
227
|
-
cwd: pkgPath,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
else if (pkgPubConf?.type === "local-directory") {
|
|
231
|
-
const pkgNpmConf = FsUtils.readJson(path.resolve(pkgPath, "package.json"));
|
|
232
|
-
const targetRootPath = pkgPubConf.path.replace(/%([^%]*)%/g, (item) => {
|
|
233
|
-
const envName = item.replace(/%/g, "");
|
|
234
|
-
if (!StringUtils.isNullOrEmpty(pkgNpmConf.version) && envName === "SD_VERSION") {
|
|
235
|
-
return pkgNpmConf.version;
|
|
236
|
-
}
|
|
237
|
-
if (envName === "SD_PROJECT_PATH") {
|
|
238
|
-
return process.cwd();
|
|
239
|
-
}
|
|
240
|
-
return process.env[envName] ?? item;
|
|
241
|
-
});
|
|
242
|
-
const filePaths = FsUtils.glob(path.resolve(pkgPath, "dist", "**", "*"), {
|
|
243
|
-
dot: true,
|
|
244
|
-
nodir: true,
|
|
245
|
-
});
|
|
246
|
-
await filePaths.parallelAsync(async (filePath) => {
|
|
247
|
-
const relativeFilePath = path.relative(path.resolve(pkgPath, "dist"), filePath);
|
|
248
|
-
const targetPath = PathUtils.posix(targetRootPath, relativeFilePath);
|
|
249
|
-
await FsUtils.copyAsync(filePath, targetPath);
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
else if (pkgPubConf?.type === "ftp" ||
|
|
253
|
-
pkgPubConf?.type === "ftps" ||
|
|
254
|
-
pkgPubConf?.type === "sftp") {
|
|
255
|
-
await SdStorage.connectAsync(pkgPubConf.type, {
|
|
256
|
-
host: pkgPubConf.host,
|
|
257
|
-
port: pkgPubConf.port,
|
|
258
|
-
user: pkgPubConf.user,
|
|
259
|
-
pass: pkgPubConf.pass,
|
|
260
|
-
}, async (storage) => {
|
|
261
|
-
await storage.uploadDirAsync(path.resolve(pkgPath, "dist"), pkgPubConf.path ?? "/");
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
throw new NeverEntryError();
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
static async _waitSecMessageAsync(msg, sec) {
|
|
269
|
-
for (let i = sec; i > 0; i--) {
|
|
270
|
-
if (i !== sec) {
|
|
271
|
-
process.stdout.cursorTo(0);
|
|
272
|
-
}
|
|
273
|
-
process.stdout.write(`${msg} ${i}`);
|
|
274
|
-
await Wait.time(1000);
|
|
275
|
-
}
|
|
276
|
-
process.stdout.cursorTo(0);
|
|
277
|
-
process.stdout.clearLine(0);
|
|
278
|
-
}
|
|
279
|
-
static _upgradeVersion(projNpmConf, allPkgPaths) {
|
|
280
|
-
// 작업공간 package.json 버전 설정
|
|
281
|
-
const newVersion = semver.inc(projNpmConf.version, "patch");
|
|
282
|
-
projNpmConf.version = newVersion;
|
|
283
|
-
const pkgNames = allPkgPaths.map((pkgPath) => {
|
|
284
|
-
const pkgNpmConf = FsUtils.readJson(path.resolve(pkgPath, "package.json"));
|
|
285
|
-
return pkgNpmConf.name;
|
|
286
|
-
});
|
|
287
|
-
const updateDepVersion = (deps) => {
|
|
288
|
-
if (!deps)
|
|
289
|
-
return;
|
|
290
|
-
for (const depName of Object.keys(deps)) {
|
|
291
|
-
if (pkgNames.includes(depName)) {
|
|
292
|
-
deps[depName] = newVersion;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
updateDepVersion(projNpmConf.dependencies);
|
|
297
|
-
updateDepVersion(projNpmConf.optionalDependencies);
|
|
298
|
-
updateDepVersion(projNpmConf.devDependencies);
|
|
299
|
-
updateDepVersion(projNpmConf.peerDependencies);
|
|
300
|
-
const projNpmConfFilePath = path.resolve(process.cwd(), "package.json");
|
|
301
|
-
FsUtils.writeJson(projNpmConfFilePath, projNpmConf, { space: 2 });
|
|
302
|
-
// 각 패키지 package.json 버전 설정
|
|
303
|
-
for (const pkgPath of allPkgPaths) {
|
|
304
|
-
const pkgNpmConfFilePath = path.resolve(pkgPath, "package.json");
|
|
305
|
-
const pkgNpmConf = FsUtils.readJson(pkgNpmConfFilePath);
|
|
306
|
-
pkgNpmConf.version = newVersion;
|
|
307
|
-
updateDepVersion(pkgNpmConf.dependencies);
|
|
308
|
-
updateDepVersion(pkgNpmConf.optionalDependencies);
|
|
309
|
-
updateDepVersion(pkgNpmConf.devDependencies);
|
|
310
|
-
updateDepVersion(pkgNpmConf.peerDependencies);
|
|
311
|
-
FsUtils.writeJson(pkgNpmConfFilePath, pkgNpmConf, { space: 2 });
|
|
312
|
-
if (FsUtils.exists(path.resolve(pkgPath, "plugin.xml"))) {
|
|
313
|
-
const cordovaPluginConfFilePath = path.resolve(pkgPath, "plugin.xml");
|
|
314
|
-
const cordovaPluginConfContent = FsUtils.readFile(cordovaPluginConfFilePath);
|
|
315
|
-
const newCordovaPluginConfContent = cordovaPluginConfContent.replace(/(<plugin\s[^>]*\bversion\s*=\s*")[^"]+(")/, `$1${newVersion}$2`);
|
|
316
|
-
FsUtils.writeFile(cordovaPluginConfFilePath, newCordovaPluginConfContent);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
static _logging(buildResults, logger) {
|
|
321
|
-
const messageMap = buildResults.toSetMap((item) => item.severity, (item) => SdCliConvertMessageUtils.getBuildMessageString(item));
|
|
322
|
-
if (messageMap.has("message")) {
|
|
323
|
-
logger.log(`알림\n${Array.from(messageMap.get("message")).join("\n")}`);
|
|
324
|
-
}
|
|
325
|
-
if (messageMap.has("suggestion")) {
|
|
326
|
-
logger.info(`제안\n${Array.from(messageMap.get("suggestion")).join("\n")}`);
|
|
327
|
-
}
|
|
328
|
-
if (messageMap.has("warning")) {
|
|
329
|
-
logger.warn(`경고\n${Array.from(messageMap.get("warning")).join("\n")}`);
|
|
330
|
-
}
|
|
331
|
-
if (messageMap.has("error")) {
|
|
332
|
-
logger.error(`오류\n${Array.from(messageMap.get("error")).join("\n")}`);
|
|
333
|
-
}
|
|
334
|
-
logger.info("모든 빌드가 완료되었습니다.");
|
|
335
|
-
}
|
|
336
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SdLogger, TNormPath } from "@simplysm/sd-core-node";
|
|
2
|
-
import { TSdPackageConfig } from "../types/config/ISdProjectConfig";
|
|
3
|
-
import { ISdBuildResult } from "../types/build/ISdBuildResult";
|
|
4
|
-
import { ISdTsCompilerOptions } from "../types/build/ISdTsCompilerOptions";
|
|
5
|
-
export declare abstract class SdBuildRunnerBase<T extends "server" | "library" | "client"> {
|
|
6
|
-
protected _opt: ISdTsCompilerOptions;
|
|
7
|
-
protected _pkgConf: TSdPackageConfig<T>;
|
|
8
|
-
protected abstract _logger: SdLogger;
|
|
9
|
-
protected _pkgName: string;
|
|
10
|
-
constructor(_opt: ISdTsCompilerOptions, _pkgConf: TSdPackageConfig<T>);
|
|
11
|
-
rebuildAsync(modifiedFileSet?: Set<TNormPath>): Promise<ISdBuildResult>;
|
|
12
|
-
protected abstract _runAsync(modifiedFileSet?: Set<TNormPath>): Promise<ISdBuildResult>;
|
|
13
|
-
protected _debug(msg: string): void;
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FsUtils } from "@simplysm/sd-core-node";
|
|
2
|
-
import path from "path";
|
|
3
|
-
export class SdBuildRunnerBase {
|
|
4
|
-
constructor(_opt, _pkgConf) {
|
|
5
|
-
this._opt = _opt;
|
|
6
|
-
this._pkgConf = _pkgConf;
|
|
7
|
-
this._pkgName = path.basename(_opt.pkgPath);
|
|
8
|
-
}
|
|
9
|
-
async rebuildAsync(modifiedFileSet) {
|
|
10
|
-
if (!modifiedFileSet && !this._opt.watch?.noEmit) {
|
|
11
|
-
const distPath = path.resolve(this._opt.pkgPath, "dist");
|
|
12
|
-
if (FsUtils.exists(distPath)) {
|
|
13
|
-
this._debug("dist 초기화...");
|
|
14
|
-
await FsUtils.removeAsync(distPath);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return await this._runAsync(modifiedFileSet);
|
|
18
|
-
}
|
|
19
|
-
_debug(msg) {
|
|
20
|
-
this._logger.debug(`[${path.basename(this._opt.pkgPath)}] ${msg}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { TNormPath } from "@simplysm/sd-core-node";
|
|
2
|
-
import { ISdProjectConfig } from "../types/config/ISdProjectConfig";
|
|
3
|
-
import { ISdBuildMessage } from "../types/build/ISdBuildMessage";
|
|
4
|
-
export declare class SdProjectBuildRunner {
|
|
5
|
-
private static readonly _logger;
|
|
6
|
-
private static readonly _buildInfoMap;
|
|
7
|
-
private static readonly _serverInfoMap;
|
|
8
|
-
private static readonly _resultCache;
|
|
9
|
-
static watchAsync(opt: {
|
|
10
|
-
allPkgPaths: TNormPath[];
|
|
11
|
-
pkgPaths: TNormPath[];
|
|
12
|
-
projConf: ISdProjectConfig;
|
|
13
|
-
emitOnly: boolean;
|
|
14
|
-
noEmit: boolean;
|
|
15
|
-
onChange: () => void;
|
|
16
|
-
onComplete: (buildMessages: ISdBuildMessage[]) => void;
|
|
17
|
-
}): Promise<void>;
|
|
18
|
-
static buildAsync(opt: {
|
|
19
|
-
allPkgPaths: TNormPath[];
|
|
20
|
-
pkgPaths: TNormPath[];
|
|
21
|
-
projConf: ISdProjectConfig;
|
|
22
|
-
}): Promise<ISdBuildMessage[]>;
|
|
23
|
-
private static _getScopePathSetAsync;
|
|
24
|
-
private static _restartServerAsync;
|
|
25
|
-
}
|