@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,394 +0,0 @@
|
|
|
1
|
-
import * as path from "path";
|
|
2
|
-
import { FsUtils, PathUtils, SdLogger, SdProcess } from "@simplysm/sd-core-node";
|
|
3
|
-
import { SdZip, XmlConvert } from "@simplysm/sd-core-common";
|
|
4
|
-
export class SdCliCordova {
|
|
5
|
-
constructor(_opt) {
|
|
6
|
-
this._opt = _opt;
|
|
7
|
-
// 상수 정의
|
|
8
|
-
this._CORDOVA_DIR_NAME = ".cordova";
|
|
9
|
-
this._PLATFORMS_DIR_NAME = "platforms";
|
|
10
|
-
this._WWW_DIR_NAME = "www";
|
|
11
|
-
this._PLUGINS_DIR_NAME = "plugins";
|
|
12
|
-
this._PLUGINS_FETCH_FILE = "fetch.json";
|
|
13
|
-
this._ANDROID_SDK_VERSION = "35"; //cordova-android@14
|
|
14
|
-
this._KEYSTORE_FILE_NAME = "android.keystore";
|
|
15
|
-
this._CONFIG_XML_FILE_NAME = "config.xml";
|
|
16
|
-
this._CONFIG_XML_BACKUP_FILE_NAME = "config.xml.bak";
|
|
17
|
-
this._BUILD_JSON_FILE_NAME = "build.json";
|
|
18
|
-
this._ANDROID_SIGNING_PROP_PATH = "platforms/android/release-signing.properties";
|
|
19
|
-
this._ICON_DIR_PATH = "res/icons";
|
|
20
|
-
this._SPLASH_SCREEN_DIR_PATH = "res/screen/android";
|
|
21
|
-
this._SPLASH_SCREEN_XML_FILE = "splashscreen.xml";
|
|
22
|
-
this._platforms = Object.keys(this._opt.config.platform ?? { browser: {} });
|
|
23
|
-
this._npmConfig = FsUtils.readJson(path.resolve(this._opt.pkgPath, "package.json"));
|
|
24
|
-
}
|
|
25
|
-
static { this._logger = SdLogger.get(["simplysm", "sd-cli", "SdCliCordova"]); }
|
|
26
|
-
static async _execAsync(cmd, args, cwd) {
|
|
27
|
-
this._logger.debug(`실행 명령: ${cmd + " " + args.join(" ")}`);
|
|
28
|
-
const msg = await SdProcess.spawnAsync(cmd, args, { cwd });
|
|
29
|
-
this._logger.debug(`실행 결과: ${msg}`);
|
|
30
|
-
}
|
|
31
|
-
async initializeAsync() {
|
|
32
|
-
const cordovaPath = path.resolve(this._opt.pkgPath, this._CORDOVA_DIR_NAME);
|
|
33
|
-
// 1. Cordova 프로젝트 초기화
|
|
34
|
-
await this._initializeCordovaProjectAsync(cordovaPath);
|
|
35
|
-
// 2. 플랫폼 관리
|
|
36
|
-
await this._managePlatformsAsync(cordovaPath);
|
|
37
|
-
// 3. 플러그인 관리
|
|
38
|
-
await this._managePluginsAsync(cordovaPath);
|
|
39
|
-
// 4. 안드로이드 서명 설정
|
|
40
|
-
this._setupAndroidSign(cordovaPath);
|
|
41
|
-
// 5. 빌드 설정 파일 생성
|
|
42
|
-
this._createBuildConfig(cordovaPath);
|
|
43
|
-
// 6. 아이콘 및 스플래시 스크린 설정
|
|
44
|
-
this._setupIconAndSplashScreen(cordovaPath);
|
|
45
|
-
// 7. XML 설정 구성
|
|
46
|
-
this._configureXml(cordovaPath);
|
|
47
|
-
// 8. 각 플랫폼 www 준비
|
|
48
|
-
await SdCliCordova._execAsync("npx", ["cordova", "prepare"], cordovaPath);
|
|
49
|
-
}
|
|
50
|
-
// 1. Cordova 프로젝트 초기화
|
|
51
|
-
async _initializeCordovaProjectAsync(cordovaPath) {
|
|
52
|
-
if (FsUtils.exists(cordovaPath)) {
|
|
53
|
-
SdCliCordova._logger.log("이미 생성되어있는 '.cordova'를 사용합니다.");
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
// await SdCliCordova.#execAsync("npx", ["cordova", "telemetry", "on"], this._opt.pkgPath);
|
|
57
|
-
// 프로젝트 생성
|
|
58
|
-
await SdCliCordova._execAsync("npx", ["cordova", "create", cordovaPath, this._opt.config.appId, this._opt.config.appName], process.cwd());
|
|
59
|
-
}
|
|
60
|
-
// platforms 폴더 혹시 없으면 생성
|
|
61
|
-
FsUtils.mkdirs(path.resolve(cordovaPath, this._PLATFORMS_DIR_NAME));
|
|
62
|
-
// www 폴더 혹시 없으면 생성
|
|
63
|
-
FsUtils.mkdirs(path.resolve(cordovaPath, this._WWW_DIR_NAME));
|
|
64
|
-
}
|
|
65
|
-
// 2. 플랫폼 관리
|
|
66
|
-
async _managePlatformsAsync(cordovaPath) {
|
|
67
|
-
const alreadyPlatforms = FsUtils.readdir(path.resolve(cordovaPath, this._PLATFORMS_DIR_NAME));
|
|
68
|
-
// 미설치 빌드 플랫폼 신규 생성
|
|
69
|
-
for (const platform of this._platforms) {
|
|
70
|
-
if (alreadyPlatforms.includes(platform))
|
|
71
|
-
continue;
|
|
72
|
-
await SdCliCordova._execAsync("npx", ["cordova", "platform", "add", platform], cordovaPath);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// 3. 플러그인 관리
|
|
76
|
-
async _managePluginsAsync(cordovaPath) {
|
|
77
|
-
const pluginsFetchPath = path.resolve(cordovaPath, this._PLUGINS_DIR_NAME, this._PLUGINS_FETCH_FILE);
|
|
78
|
-
const pluginsFetch = FsUtils.exists(pluginsFetchPath) ? FsUtils.readJson(pluginsFetchPath) : {};
|
|
79
|
-
const alreadyPlugins = Object.keys(pluginsFetch).map((key) => ({
|
|
80
|
-
name: key,
|
|
81
|
-
id: pluginsFetch[key].source.id,
|
|
82
|
-
dependencies: pluginsFetch[key].dependencies,
|
|
83
|
-
}));
|
|
84
|
-
const usePlugins = (this._opt.config.plugins ?? []).distinct();
|
|
85
|
-
// 사용하지 않는 플러그인 제거 및 새 플러그인 설치 - 의존성 때문에 순차 처리
|
|
86
|
-
await this._removeUnusedPluginsAsync(cordovaPath, alreadyPlugins, usePlugins);
|
|
87
|
-
await this._installNewPluginsAsync(cordovaPath, alreadyPlugins, usePlugins);
|
|
88
|
-
}
|
|
89
|
-
async _removeUnusedPluginsAsync(cordovaPath, alreadyPlugins, usePlugins) {
|
|
90
|
-
for (const alreadyPlugin of alreadyPlugins) {
|
|
91
|
-
if (!usePlugins.includes(alreadyPlugin.id) && !usePlugins.includes(alreadyPlugin.name)) {
|
|
92
|
-
try {
|
|
93
|
-
await SdCliCordova._execAsync("npx", ["cordova", "plugin", "remove", alreadyPlugin.name], cordovaPath);
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
// 의존성으로 인한 skip 메시지는 무시 (로그 생략)
|
|
97
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
98
|
-
if (!msg.includes("is required by") || !msg.includes("skipping uninstallation")) {
|
|
99
|
-
throw err;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async _installNewPluginsAsync(cordovaPath, alreadyPlugins, usePlugins) {
|
|
106
|
-
// 병렬로 플러그인을 설치하면 충돌이 발생할 수 있으므로 순차 처리
|
|
107
|
-
for (const usePlugin of usePlugins) {
|
|
108
|
-
const isPluginAlreadyInstalled = alreadyPlugins.some((plugin) => usePlugin === plugin.id || usePlugin === plugin.name);
|
|
109
|
-
if (!isPluginAlreadyInstalled) {
|
|
110
|
-
await SdCliCordova._execAsync("npx", ["cordova", "plugin", "add", usePlugin], cordovaPath);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// 4. 안드로이드 서명 설정
|
|
115
|
-
_setupAndroidSign(cordovaPath) {
|
|
116
|
-
const keystorePath = path.resolve(cordovaPath, this._KEYSTORE_FILE_NAME);
|
|
117
|
-
const signingPropsPath = path.resolve(cordovaPath, this._ANDROID_SIGNING_PROP_PATH);
|
|
118
|
-
if (this._opt.config.platform?.android?.sign) {
|
|
119
|
-
FsUtils.copy(path.resolve(this._opt.pkgPath, this._opt.config.platform.android.sign.keystore), keystorePath);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
FsUtils.remove(keystorePath);
|
|
123
|
-
// SIGN을 안쓸경우 아래 파일이 생성되어 있으면 오류남
|
|
124
|
-
FsUtils.remove(signingPropsPath);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
// 5. 빌드 설정 파일 생성
|
|
128
|
-
_createBuildConfig(cordovaPath) {
|
|
129
|
-
const buildJsonPath = path.resolve(cordovaPath, this._BUILD_JSON_FILE_NAME);
|
|
130
|
-
const keystorePath = path.resolve(cordovaPath, this._KEYSTORE_FILE_NAME);
|
|
131
|
-
const androidConfig = this._opt.config.platform?.android
|
|
132
|
-
? {
|
|
133
|
-
android: {
|
|
134
|
-
release: {
|
|
135
|
-
packageType: this._opt.config.platform.android.bundle ? "bundle" : "apk",
|
|
136
|
-
...(this._opt.config.platform.android.sign
|
|
137
|
-
? {
|
|
138
|
-
keystore: keystorePath,
|
|
139
|
-
storePassword: this._opt.config.platform.android.sign.storePassword,
|
|
140
|
-
alias: this._opt.config.platform.android.sign.alias,
|
|
141
|
-
password: this._opt.config.platform.android.sign.password,
|
|
142
|
-
keystoreType: this._opt.config.platform.android.sign.keystoreType,
|
|
143
|
-
}
|
|
144
|
-
: {}),
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
}
|
|
148
|
-
: {};
|
|
149
|
-
FsUtils.writeJson(buildJsonPath, androidConfig);
|
|
150
|
-
}
|
|
151
|
-
// 6. 아이콘 및 스플래시 스크린 설정
|
|
152
|
-
_setupIconAndSplashScreen(cordovaPath) {
|
|
153
|
-
const iconDirPath = path.resolve(cordovaPath, this._ICON_DIR_PATH);
|
|
154
|
-
const splashScreenPath = path.resolve(cordovaPath, this._SPLASH_SCREEN_DIR_PATH);
|
|
155
|
-
const splashScreenXmlPath = path.resolve(splashScreenPath, this._SPLASH_SCREEN_XML_FILE);
|
|
156
|
-
// ICON 파일 복사
|
|
157
|
-
if (this._opt.config.icon != null) {
|
|
158
|
-
FsUtils.mkdirs(iconDirPath);
|
|
159
|
-
FsUtils.copy(path.resolve(this._opt.pkgPath, this._opt.config.icon), path.resolve(iconDirPath, path.basename(this._opt.config.icon)));
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
FsUtils.remove(iconDirPath);
|
|
163
|
-
}
|
|
164
|
-
// SplashScreen 파일 생성
|
|
165
|
-
if (this._opt.config.platform?.android && this._opt.config.icon != null) {
|
|
166
|
-
FsUtils.mkdirs(splashScreenPath);
|
|
167
|
-
FsUtils.writeFile(splashScreenXmlPath, `
|
|
168
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
169
|
-
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
170
|
-
<item
|
|
171
|
-
android:width="48dp"
|
|
172
|
-
android:height="48dp"
|
|
173
|
-
android:drawable="@mipmap/ic_launcher"
|
|
174
|
-
android:gravity="center" />
|
|
175
|
-
</layer-list>`.trim());
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
// 7. XML 설정 구성
|
|
179
|
-
_configureXml(cordovaPath) {
|
|
180
|
-
// CONFIG: 초기값 백업
|
|
181
|
-
const configFilePath = path.resolve(cordovaPath, this._CONFIG_XML_FILE_NAME);
|
|
182
|
-
const configBackFilePath = path.resolve(cordovaPath, this._CONFIG_XML_BACKUP_FILE_NAME);
|
|
183
|
-
if (!FsUtils.exists(configBackFilePath)) {
|
|
184
|
-
FsUtils.copy(configFilePath, configBackFilePath);
|
|
185
|
-
}
|
|
186
|
-
// CONFIG: 초기값 읽기
|
|
187
|
-
const configFileContent = FsUtils.readFile(configBackFilePath);
|
|
188
|
-
const configXml = XmlConvert.parse(configFileContent);
|
|
189
|
-
// CONFIG: 기본 설정
|
|
190
|
-
this._configureBasicXmlSettings(configXml);
|
|
191
|
-
// CONFIG: 안드로이드 설정
|
|
192
|
-
if (this._opt.config.platform?.android) {
|
|
193
|
-
this._configureAndroidXmlSettings(configXml);
|
|
194
|
-
}
|
|
195
|
-
// CONFIG: 파일 새로 쓰기
|
|
196
|
-
const configResultContent = XmlConvert.stringify(configXml, {
|
|
197
|
-
format: true,
|
|
198
|
-
});
|
|
199
|
-
FsUtils.writeFile(configFilePath, configResultContent);
|
|
200
|
-
}
|
|
201
|
-
_configureBasicXmlSettings(configXml) {
|
|
202
|
-
// 버전 설정
|
|
203
|
-
configXml.widget.$.version = this._npmConfig.version;
|
|
204
|
-
// ICON 설정
|
|
205
|
-
if (this._opt.config.icon != null) {
|
|
206
|
-
configXml.widget.icon = [
|
|
207
|
-
{
|
|
208
|
-
$: {
|
|
209
|
-
src: `${this._ICON_DIR_PATH}/${path.basename(this._opt.config.icon)}`,
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
];
|
|
213
|
-
}
|
|
214
|
-
// 접근허용 세팅
|
|
215
|
-
configXml.widget.content = [{ $: { src: "http://localhost/index.html" } }];
|
|
216
|
-
configXml.widget.access = [{ $: { origin: "*" } }];
|
|
217
|
-
configXml.widget["allow-navigation"] = [{ $: { href: "*" } }];
|
|
218
|
-
configXml.widget["allow-intent"] = [{ $: { href: "*" } }];
|
|
219
|
-
configXml.widget.preference = [{ $: { name: "MixedContentMode", value: "1" } }];
|
|
220
|
-
}
|
|
221
|
-
_configureAndroidXmlSettings(configXml) {
|
|
222
|
-
configXml.widget.$["xmlns:android"] = "http://schemas.android.com/apk/res/android";
|
|
223
|
-
configXml.widget.$["xmlns:tools"] = "http://schemas.android.com/tools";
|
|
224
|
-
configXml.widget.platform = configXml.widget.platform ?? [];
|
|
225
|
-
const androidPlatform = {
|
|
226
|
-
"$": {
|
|
227
|
-
name: "android",
|
|
228
|
-
},
|
|
229
|
-
"preference": [
|
|
230
|
-
{
|
|
231
|
-
$: {
|
|
232
|
-
name: "AndroidWindowSplashScreenAnimatedIcon",
|
|
233
|
-
value: `${this._SPLASH_SCREEN_DIR_PATH}/${this._SPLASH_SCREEN_XML_FILE}`,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
"edit-config": [
|
|
238
|
-
{
|
|
239
|
-
$: {
|
|
240
|
-
file: "app/src/main/AndroidManifest.xml",
|
|
241
|
-
mode: "merge",
|
|
242
|
-
target: "/manifest",
|
|
243
|
-
},
|
|
244
|
-
manifest: [
|
|
245
|
-
{
|
|
246
|
-
$: {
|
|
247
|
-
"xmlns:tools": "http://schemas.android.com/tools",
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
],
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
$: {
|
|
254
|
-
file: "app/src/main/AndroidManifest.xml",
|
|
255
|
-
mode: "merge",
|
|
256
|
-
target: "/manifest/application",
|
|
257
|
-
},
|
|
258
|
-
application: [
|
|
259
|
-
{
|
|
260
|
-
$: {
|
|
261
|
-
"android:usesCleartextTraffic": "true",
|
|
262
|
-
...(this._opt.config.platform.android.config
|
|
263
|
-
? Object.keys(this._opt.config.platform.android.config).toObject((key) => "android:" + key, (key) => this._opt.config.platform.android.config[key])
|
|
264
|
-
: {}),
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
],
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
};
|
|
271
|
-
// SDK 버전 설정
|
|
272
|
-
if (this._opt.config.platform.android.sdkVersion != null) {
|
|
273
|
-
androidPlatform.preference.push(...[
|
|
274
|
-
{
|
|
275
|
-
$: {
|
|
276
|
-
name: "android-maxSdkVersion",
|
|
277
|
-
value: `${this._opt.config.platform.android.sdkVersion}`,
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
$: {
|
|
282
|
-
name: "android-minSdkVersion",
|
|
283
|
-
value: `${this._opt.config.platform.android.sdkVersion}`,
|
|
284
|
-
},
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
$: {
|
|
288
|
-
name: "android-targetSdkVersion",
|
|
289
|
-
value: `${this._opt.config.platform.android.sdkVersion}`,
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
$: {
|
|
294
|
-
name: "android-compileSdkVersion",
|
|
295
|
-
value: this._ANDROID_SDK_VERSION,
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
]);
|
|
299
|
-
}
|
|
300
|
-
// 권한 설정
|
|
301
|
-
if (this._opt.config.platform.android.permissions) {
|
|
302
|
-
androidPlatform["config-file"] = androidPlatform["config-file"] ?? [];
|
|
303
|
-
androidPlatform["config-file"].push({
|
|
304
|
-
"$": {
|
|
305
|
-
target: "AndroidManifest.xml",
|
|
306
|
-
parent: "/*",
|
|
307
|
-
},
|
|
308
|
-
"uses-permission": this._opt.config.platform.android.permissions.map((perm) => ({
|
|
309
|
-
$: {
|
|
310
|
-
"android:name": `android.permission.${perm.name}`,
|
|
311
|
-
...(perm.maxSdkVersion != null
|
|
312
|
-
? {
|
|
313
|
-
"android:maxSdkVersion": `${perm.maxSdkVersion}`,
|
|
314
|
-
}
|
|
315
|
-
: {}),
|
|
316
|
-
...(perm.ignore != null
|
|
317
|
-
? {
|
|
318
|
-
"tools:ignore": `${perm.ignore}`,
|
|
319
|
-
}
|
|
320
|
-
: {}),
|
|
321
|
-
},
|
|
322
|
-
})),
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
configXml.widget.platform.push(androidPlatform);
|
|
326
|
-
}
|
|
327
|
-
async buildAsync(outPath) {
|
|
328
|
-
const cordovaPath = path.resolve(this._opt.pkgPath, this._CORDOVA_DIR_NAME);
|
|
329
|
-
// 빌드 실행 - 병렬 처리로 개선
|
|
330
|
-
const buildType = this._opt.config.debug ? "debug" : "release";
|
|
331
|
-
// 모든 플랫폼 동시에 빌드
|
|
332
|
-
await Promise.all(this._platforms.map((platform) => SdCliCordova._execAsync("npx", ["cordova", "build", platform, `--${buildType}`], cordovaPath)));
|
|
333
|
-
// 결과물 복사 및 ZIP 파일 생성 - 병렬 처리
|
|
334
|
-
await Promise.all(Object.keys(this._opt.config.platform ?? {}).map(async (platform) => {
|
|
335
|
-
await this._processBuildOutputAsync(cordovaPath, outPath, platform, buildType);
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
async _processBuildOutputAsync(cordovaPath, outPath, platform, buildType) {
|
|
339
|
-
const targetOutPath = path.resolve(outPath, platform);
|
|
340
|
-
// 결과물 복사: ANDROID
|
|
341
|
-
if (platform === "android") {
|
|
342
|
-
this._copyAndroidBuildOutput(cordovaPath, targetOutPath, buildType);
|
|
343
|
-
}
|
|
344
|
-
// 자동업데이트를 위한 파일 생성
|
|
345
|
-
await this._createUpdateZipAsync(cordovaPath, outPath, platform);
|
|
346
|
-
}
|
|
347
|
-
_copyAndroidBuildOutput(cordovaPath, targetOutPath, buildType) {
|
|
348
|
-
const apkFileName = this._opt.config.platform.android.sign
|
|
349
|
-
? `app-${buildType}.apk`
|
|
350
|
-
: `app-${buildType}-unsigned.apk`;
|
|
351
|
-
const latestDistApkFileName = path.basename(`${this._opt.config.appName}${this._opt.config.platform.android.sign ? "" : "-unsigned"}-latest.apk`);
|
|
352
|
-
FsUtils.mkdirs(targetOutPath);
|
|
353
|
-
FsUtils.copy(path.resolve(cordovaPath, "platforms/android/app/build/outputs/apk", buildType, apkFileName), path.resolve(targetOutPath, latestDistApkFileName));
|
|
354
|
-
// 업데이트파일
|
|
355
|
-
FsUtils.copy(path.resolve(cordovaPath, "platforms/android/app/build/outputs/apk", buildType, apkFileName), path.resolve(targetOutPath, "updates", `${this._npmConfig.version}.apk`));
|
|
356
|
-
}
|
|
357
|
-
/** @deprecated */
|
|
358
|
-
async _createUpdateZipAsync(cordovaPath, outPath, platform) {
|
|
359
|
-
const zip = new SdZip();
|
|
360
|
-
const wwwPath = path.resolve(cordovaPath, this._WWW_DIR_NAME);
|
|
361
|
-
const platformWwwPath = path.resolve(cordovaPath, this._PLATFORMS_DIR_NAME, platform, "platform_www");
|
|
362
|
-
this._addFilesToZip(zip, wwwPath);
|
|
363
|
-
this._addFilesToZip(zip, platformWwwPath);
|
|
364
|
-
// ZIP 파일 생성
|
|
365
|
-
const updateDirPath = path.resolve(outPath, platform, "updates");
|
|
366
|
-
FsUtils.mkdirs(updateDirPath);
|
|
367
|
-
FsUtils.writeFile(path.resolve(updateDirPath, this._npmConfig.version + ".zip"), await zip.compressAsync());
|
|
368
|
-
}
|
|
369
|
-
_addFilesToZip(zip, dirPath) {
|
|
370
|
-
const files = FsUtils.glob(path.resolve(dirPath, "**/*"), { nodir: true });
|
|
371
|
-
for (const file of files) {
|
|
372
|
-
const relFilePath = path.relative(dirPath, file);
|
|
373
|
-
const fileBuffer = FsUtils.readFileBuffer(file);
|
|
374
|
-
zip.write(relFilePath, fileBuffer);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
static async runWebviewOnDeviceAsync(opt) {
|
|
378
|
-
const projNpmConf = FsUtils.readJson(path.resolve(process.cwd(), "package.json"));
|
|
379
|
-
const allPkgPaths = projNpmConf.workspaces.mapMany((item) => FsUtils.glob(PathUtils.posix(process.cwd(), item)));
|
|
380
|
-
const cordovaPath = path.resolve(allPkgPaths.single((item) => item.endsWith(opt.package)), ".cordova");
|
|
381
|
-
if (opt.url !== undefined) {
|
|
382
|
-
FsUtils.remove(path.resolve(cordovaPath, "www"));
|
|
383
|
-
FsUtils.mkdirs(path.resolve(cordovaPath, "www"));
|
|
384
|
-
FsUtils.writeFile(path.resolve(cordovaPath, "www/index.html"), `
|
|
385
|
-
'${opt.url}'로 이동중...
|
|
386
|
-
<script>
|
|
387
|
-
setTimeout(function () {
|
|
388
|
-
window.location.href = "${opt.url.replace(/\/$/, "")}/${opt.package}/cordova/";
|
|
389
|
-
}, 3000);
|
|
390
|
-
</script>`.trim());
|
|
391
|
-
}
|
|
392
|
-
await this._execAsync("npx", ["cordova", "run", opt.platform, "--device"], cordovaPath);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ISdClientBuilderElectronConfig } from "../types/config/ISdProjectConfig";
|
|
2
|
-
export declare class SdCliElectron {
|
|
3
|
-
private static readonly _logger;
|
|
4
|
-
static runAsync(opt: {
|
|
5
|
-
package: string;
|
|
6
|
-
config: string;
|
|
7
|
-
options?: string[];
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
static buildForDevAsync(opt: {
|
|
10
|
-
package: string;
|
|
11
|
-
config: string;
|
|
12
|
-
options?: string[];
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
static buildAsync(opt: {
|
|
15
|
-
pkgPath: string;
|
|
16
|
-
electronConfig: ISdClientBuilderElectronConfig;
|
|
17
|
-
}): Promise<void>;
|
|
18
|
-
private static _loadDevConfig;
|
|
19
|
-
private static _prepareAsync;
|
|
20
|
-
private static _buildAsync;
|
|
21
|
-
private static _canCreateSymlink;
|
|
22
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { FsUtils, SdLogger, SdProcess } from "@simplysm/sd-core-node";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import os from "os";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { loadProjConfAsync } from "../utils/loadProjConfAsync";
|
|
6
|
-
export class SdCliElectron {
|
|
7
|
-
static { this._logger = SdLogger.get(["simplysm", "sd-cli", "SdCliElectron"]); }
|
|
8
|
-
static async runAsync(opt) {
|
|
9
|
-
this._logger.log("설정 가져오기...");
|
|
10
|
-
const { pkgPath, electronPath, electronConfig } = await this._loadDevConfig(opt);
|
|
11
|
-
this._logger.log("준비...");
|
|
12
|
-
await this._prepareAsync({ pkgPath, electronPath, electronConfig });
|
|
13
|
-
this._logger.log("실행...");
|
|
14
|
-
await SdProcess.spawnAsync("npx", ["electron", "."], { cwd: electronPath, showMessage: true });
|
|
15
|
-
}
|
|
16
|
-
static async buildForDevAsync(opt) {
|
|
17
|
-
this._logger.log("설정 가져오기...");
|
|
18
|
-
const { pkgPath, electronPath, electronConfig } = await this._loadDevConfig(opt);
|
|
19
|
-
this._logger.log("준비...");
|
|
20
|
-
const { npmConfig } = await this._prepareAsync({ pkgPath, electronPath, electronConfig });
|
|
21
|
-
this._logger.log("빌드...");
|
|
22
|
-
const electronDistPath = path.resolve(pkgPath, ".electron/dist");
|
|
23
|
-
await this._buildAsync({ pkgPath, electronPath, electronDistPath, npmConfig, electronConfig });
|
|
24
|
-
}
|
|
25
|
-
static async buildAsync(opt) {
|
|
26
|
-
this._logger.log("준비...");
|
|
27
|
-
const electronPath = path.resolve(opt.pkgPath, ".electron/src");
|
|
28
|
-
const { npmConfig } = await this._prepareAsync({ ...opt, electronPath });
|
|
29
|
-
this._logger.log("빌드...");
|
|
30
|
-
const electronDistPath = path.resolve(opt.pkgPath, ".electron/dist");
|
|
31
|
-
await this._buildAsync({
|
|
32
|
-
pkgPath: opt.pkgPath,
|
|
33
|
-
electronPath,
|
|
34
|
-
electronDistPath,
|
|
35
|
-
npmConfig,
|
|
36
|
-
electronConfig: opt.electronConfig,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
static async _loadDevConfig(opt) {
|
|
40
|
-
const projConf = await loadProjConfAsync(process.cwd(), true, opt);
|
|
41
|
-
const pkgConf = projConf.packages[opt.package];
|
|
42
|
-
if (pkgConf?.type !== "client" || pkgConf.builder?.electron === undefined) {
|
|
43
|
-
throw new Error();
|
|
44
|
-
}
|
|
45
|
-
const pkgPath = path.resolve(process.cwd(), `packages/${opt.package}`);
|
|
46
|
-
const electronPath = path.resolve(pkgPath, "dist/electron");
|
|
47
|
-
return {
|
|
48
|
-
pkgPath,
|
|
49
|
-
electronPath,
|
|
50
|
-
electronConfig: pkgConf.builder.electron,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
static async _prepareAsync(opt) {
|
|
54
|
-
const npmConfig = FsUtils.readJson(path.resolve(opt.pkgPath, `package.json`));
|
|
55
|
-
const reinstallPkgNames = opt.electronConfig.reinstallDependencies ?? [];
|
|
56
|
-
FsUtils.writeJson(path.resolve(opt.electronPath, `package.json`), {
|
|
57
|
-
name: npmConfig.name.replace(/^@/, "").replace(/\//, "-"),
|
|
58
|
-
version: npmConfig.version,
|
|
59
|
-
description: npmConfig.description,
|
|
60
|
-
main: "electron-main.js",
|
|
61
|
-
...(opt.electronConfig.postInstallScript !== undefined
|
|
62
|
-
? {
|
|
63
|
-
scripts: {
|
|
64
|
-
postinstall: opt.electronConfig.postInstallScript,
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
: {}),
|
|
68
|
-
dependencies: reinstallPkgNames.toObject((item) => item, (item) => npmConfig.dependencies[item]),
|
|
69
|
-
});
|
|
70
|
-
await SdProcess.spawnAsync("npm", ["install"], { cwd: opt.electronPath, showMessage: true });
|
|
71
|
-
await SdProcess.spawnAsync("npx", ["electron-rebuild"], {
|
|
72
|
-
cwd: opt.electronPath,
|
|
73
|
-
showMessage: true,
|
|
74
|
-
});
|
|
75
|
-
return { npmConfig };
|
|
76
|
-
}
|
|
77
|
-
static async _buildAsync(opt) {
|
|
78
|
-
if (!this._canCreateSymlink()) {
|
|
79
|
-
throw new Error("'Electron 빌드'를 위해서는 'Symlink 생성' 권한이 필요합니다. 윈도우의 개발자모드를 활성화하세요.");
|
|
80
|
-
}
|
|
81
|
-
const electronConfig = {
|
|
82
|
-
appId: opt.electronConfig.appId,
|
|
83
|
-
productName: opt.npmConfig.description,
|
|
84
|
-
asar: false,
|
|
85
|
-
win: {
|
|
86
|
-
target: opt.electronConfig.portable ? "portable" : "nsis",
|
|
87
|
-
},
|
|
88
|
-
nsis: opt.electronConfig.nsisOptions ?? {},
|
|
89
|
-
directories: {
|
|
90
|
-
app: opt.electronPath,
|
|
91
|
-
output: opt.electronDistPath,
|
|
92
|
-
},
|
|
93
|
-
...(opt.electronConfig.installerIcon !== undefined
|
|
94
|
-
? {
|
|
95
|
-
icon: path.resolve(opt.pkgPath, opt.electronConfig.installerIcon),
|
|
96
|
-
}
|
|
97
|
-
: {}),
|
|
98
|
-
removePackageScripts: false,
|
|
99
|
-
npmRebuild: false,
|
|
100
|
-
forceCodeSigning: false,
|
|
101
|
-
};
|
|
102
|
-
const configFilePath = path.resolve(opt.pkgPath, ".electron/builder-config.json");
|
|
103
|
-
FsUtils.writeJson(configFilePath, electronConfig);
|
|
104
|
-
await SdProcess.spawnAsync("npx", ["electron-builder", "--win", "--config", configFilePath]);
|
|
105
|
-
FsUtils.copy(path.resolve(opt.electronDistPath, `${opt.npmConfig.description} ${opt.electronConfig.portable ? "" : "Setup "}${opt.npmConfig.version}.exe`), path.resolve(opt.pkgPath, `dist/electron/${opt.npmConfig.description}${opt.electronConfig.portable ? "-portable" : ""}-latest.exe`));
|
|
106
|
-
FsUtils.copy(path.resolve(opt.electronDistPath, `${opt.npmConfig.description} ${opt.electronConfig.portable ? "" : "Setup "}${opt.npmConfig.version}.exe`), path.resolve(opt.pkgPath, `dist/electron/updates/${opt.npmConfig.version}.exe`));
|
|
107
|
-
}
|
|
108
|
-
static _canCreateSymlink() {
|
|
109
|
-
const tmpDir = os.tmpdir();
|
|
110
|
-
const testTarget = path.join(tmpDir, "symlink-test-target.txt");
|
|
111
|
-
const testLink = path.join(tmpDir, "symlink-test-link.txt");
|
|
112
|
-
try {
|
|
113
|
-
// 대상 파일 생성
|
|
114
|
-
fs.writeFileSync(testTarget, "test");
|
|
115
|
-
// symlink 시도
|
|
116
|
-
fs.symlinkSync(testTarget, testLink, "file");
|
|
117
|
-
// symlink 성공 여부 확인
|
|
118
|
-
const isSymlink = fs.lstatSync(testLink).isSymbolicLink();
|
|
119
|
-
// 정리
|
|
120
|
-
fs.unlinkSync(testLink);
|
|
121
|
-
fs.unlinkSync(testTarget);
|
|
122
|
-
return isSymlink;
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { FsUtils, PathUtils, SdFsWatcher, SdLogger } from "@simplysm/sd-core-node";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { loadProjConfAsync } from "../utils/loadProjConfAsync";
|
|
4
|
-
export class SdCliLocalUpdate {
|
|
5
|
-
static async runAsync(opt) {
|
|
6
|
-
const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "runAsync"]);
|
|
7
|
-
logger.debug("프로젝트 설정 가져오기...");
|
|
8
|
-
const projConf = await loadProjConfAsync(process.cwd(), true, opt);
|
|
9
|
-
if (!projConf.localUpdates)
|
|
10
|
-
return;
|
|
11
|
-
const updatePathInfos = this._getUpdatePathInfos(projConf.localUpdates);
|
|
12
|
-
logger.debug("로컬 업데이트 구성");
|
|
13
|
-
logger.log("로컬 라이브러리 업데이트 시작...");
|
|
14
|
-
await updatePathInfos.parallelAsync(async (updatePathInfo) => {
|
|
15
|
-
if (!FsUtils.exists(updatePathInfo.source)) {
|
|
16
|
-
logger.warn(`소스경로를 찾을 수 없어 무시됩니다(${updatePathInfo.source})`);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
// 소스경로에서 대상경로로 파일 복사
|
|
20
|
-
await FsUtils.copyAsync(updatePathInfo.source, updatePathInfo.target, (src) => {
|
|
21
|
-
return !src.includes("node_modules") && !src.endsWith("package.json");
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
logger.info("로컬 라이브러리 업데이트 완료");
|
|
25
|
-
}
|
|
26
|
-
static async watchAsync(opt) {
|
|
27
|
-
const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "watchAsync"]);
|
|
28
|
-
logger.debug("프로젝트 설정 가져오기...");
|
|
29
|
-
const projConf = await loadProjConfAsync(process.cwd(), true, opt);
|
|
30
|
-
if (!projConf.localUpdates)
|
|
31
|
-
return;
|
|
32
|
-
const updatePathInfos = this._getUpdatePathInfos(projConf.localUpdates);
|
|
33
|
-
logger.debug("로컬 업데이트 구성");
|
|
34
|
-
const watcher = await SdFsWatcher.watchAsync(updatePathInfos.map((item) => item.source));
|
|
35
|
-
watcher.onChange({ delay: 300 }, async (changedInfos) => {
|
|
36
|
-
const changedFileInfos = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event));
|
|
37
|
-
if (changedFileInfos.length === 0)
|
|
38
|
-
return;
|
|
39
|
-
logger.log("로컬 라이브러리 변경감지...");
|
|
40
|
-
await changedFileInfos.parallelAsync(async (changedFileInfo) => {
|
|
41
|
-
await updatePathInfos.parallelAsync(async (updatePathInfo) => {
|
|
42
|
-
if (!PathUtils.isChildPath(changedFileInfo.path, updatePathInfo.source))
|
|
43
|
-
return;
|
|
44
|
-
const sourceRelPath = path.relative(updatePathInfo.source, changedFileInfo.path);
|
|
45
|
-
const targetFilePath = path.resolve(updatePathInfo.target, sourceRelPath);
|
|
46
|
-
if (changedFileInfo.event === "unlink") {
|
|
47
|
-
logger.debug(`변경파일감지(삭제): ${targetFilePath}`);
|
|
48
|
-
await FsUtils.removeAsync(targetFilePath);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
logger.debug(`변경파일감지(복사): ${changedFileInfo.path} => ${targetFilePath}`);
|
|
52
|
-
await FsUtils.copyAsync(changedFileInfo.path, targetFilePath);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
logger.info("로컬 라이브러리 복사 완료");
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
static _getUpdatePathInfos(record) {
|
|
60
|
-
const result = [];
|
|
61
|
-
for (const pkgGlobPath of Object.keys(record)) {
|
|
62
|
-
// "node_modules'에서 로컬업데이트 설정에 맞는 패키지를 "glob"하여 대상 패키지경로 목록 가져오기
|
|
63
|
-
const targetPaths = [
|
|
64
|
-
...FsUtils.glob(path.resolve(process.cwd(), "node_modules", pkgGlobPath)),
|
|
65
|
-
...FsUtils.glob(path.resolve(process.cwd(), "packages", "*", "node_modules", pkgGlobPath)),
|
|
66
|
-
];
|
|
67
|
-
result.push(...targetPaths
|
|
68
|
-
.map((targetPath) => {
|
|
69
|
-
// 대상의 명칭 추출
|
|
70
|
-
const regexpText = pkgGlobPath.replace(/[\\/.*]/g, (item) => item === "/" ? "[\\\\\\/]" : item === "." ? "\\." : item === "*" ? "(.*)" : item);
|
|
71
|
-
const targetNameMatch = new RegExp(regexpText).exec(targetPath);
|
|
72
|
-
if (!targetNameMatch || typeof targetNameMatch[1] === "undefined")
|
|
73
|
-
return undefined;
|
|
74
|
-
const targetName = targetNameMatch[1];
|
|
75
|
-
// 가져올 소스 경로 추출
|
|
76
|
-
const sourcePath = path.resolve(record[pkgGlobPath].replace(/\*/g, targetName));
|
|
77
|
-
return { source: sourcePath, target: targetPath };
|
|
78
|
-
})
|
|
79
|
-
.filterExists());
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
}
|