@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
package/dist/sd-cli-entry.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
4
|
-
import { EventEmitter } from "events";
|
|
5
|
-
import yargs from "yargs";
|
|
6
|
-
import { hideBin } from "yargs/helpers";
|
|
7
|
-
import { SdCliAiCommand } from "./entry/SdCliAiCommand";
|
|
8
|
-
import { SdCliCordova } from "./entry/SdCliCordova";
|
|
9
|
-
import { SdCliElectron } from "./entry/SdCliElectron";
|
|
10
|
-
import { SdCliLocalUpdate } from "./entry/SdCliLocalUpdate";
|
|
11
|
-
import { SdCliPostInstall } from "./entry/SdCliPostInstall";
|
|
12
|
-
import { SdCliProject } from "./entry/SdCliProject";
|
|
13
|
-
import { SdCliCapacitor } from "./entry/SdCliCapacitor";
|
|
14
|
-
Error.stackTraceLimit = Infinity;
|
|
15
|
-
EventEmitter.defaultMaxListeners = 0;
|
|
16
|
-
await yargs(hideBin(process.argv))
|
|
17
|
-
.help("help", "도움말")
|
|
18
|
-
.alias("help", "h")
|
|
19
|
-
.options({
|
|
20
|
-
debug: {
|
|
21
|
-
type: "boolean",
|
|
22
|
-
describe: "디버그 로그를 표시할 것인지 여부",
|
|
23
|
-
default: false,
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
.middleware((argv) => {
|
|
27
|
-
if (argv.debug) {
|
|
28
|
-
process.env["SD_DEBUG"] = "true";
|
|
29
|
-
SdLogger.setConfig({
|
|
30
|
-
console: { level: SdLoggerSeverity.debug },
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
SdLogger.setConfig({ dot: true });
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
.command("local-update", "로컬 라이브러리 업데이트를 수행합니다.", (cmd) => cmd
|
|
38
|
-
.version(false)
|
|
39
|
-
.hide("help")
|
|
40
|
-
.hide("debug")
|
|
41
|
-
.options({
|
|
42
|
-
config: {
|
|
43
|
-
string: true,
|
|
44
|
-
describe: "설정 파일 경로",
|
|
45
|
-
default: "simplysm.js",
|
|
46
|
-
},
|
|
47
|
-
options: {
|
|
48
|
-
string: true,
|
|
49
|
-
array: true,
|
|
50
|
-
describe: "옵션 설정",
|
|
51
|
-
},
|
|
52
|
-
}), async (argv) => await SdCliLocalUpdate.runAsync(argv))
|
|
53
|
-
.command("watch", "프로젝트의 각 패키지에 대한 변경감지 빌드를 수행합니다.", (cmd) => cmd
|
|
54
|
-
.version(false)
|
|
55
|
-
.hide("help")
|
|
56
|
-
.hide("debug")
|
|
57
|
-
.options({
|
|
58
|
-
config: {
|
|
59
|
-
string: true,
|
|
60
|
-
describe: "설정 파일 경로",
|
|
61
|
-
default: "simplysm.js",
|
|
62
|
-
},
|
|
63
|
-
options: {
|
|
64
|
-
string: true,
|
|
65
|
-
array: true,
|
|
66
|
-
describe: "옵션 설정",
|
|
67
|
-
},
|
|
68
|
-
packages: {
|
|
69
|
-
string: true,
|
|
70
|
-
array: true,
|
|
71
|
-
describe: "수행할 패키지 설정",
|
|
72
|
-
},
|
|
73
|
-
emitOnly: {
|
|
74
|
-
type: "boolean",
|
|
75
|
-
describe: "emit만 수행",
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
noEmit: {
|
|
79
|
-
type: "boolean",
|
|
80
|
-
describe: "emit만 수행",
|
|
81
|
-
default: false,
|
|
82
|
-
},
|
|
83
|
-
}), async (argv) => await SdCliProject.watchAsync(argv))
|
|
84
|
-
.command("build", "프로젝트의 각 패키지에 대한 빌드를 수행합니다.", (cmd) => cmd
|
|
85
|
-
.version(false)
|
|
86
|
-
.hide("help")
|
|
87
|
-
.hide("debug")
|
|
88
|
-
.options({
|
|
89
|
-
config: {
|
|
90
|
-
string: true,
|
|
91
|
-
describe: "설정 파일 경로",
|
|
92
|
-
default: "simplysm.js",
|
|
93
|
-
},
|
|
94
|
-
options: {
|
|
95
|
-
string: true,
|
|
96
|
-
array: true,
|
|
97
|
-
describe: "옵션 설정",
|
|
98
|
-
},
|
|
99
|
-
packages: {
|
|
100
|
-
string: true,
|
|
101
|
-
array: true,
|
|
102
|
-
describe: "수행할 패키지 설정",
|
|
103
|
-
},
|
|
104
|
-
}), async (argv) => {
|
|
105
|
-
await SdCliProject.buildAsync(argv);
|
|
106
|
-
})
|
|
107
|
-
.command("publish", "프로젝트의 각 패키지를 배포합니다.", (cmd) => cmd
|
|
108
|
-
.version(false)
|
|
109
|
-
.hide("help")
|
|
110
|
-
.hide("debug")
|
|
111
|
-
.options({
|
|
112
|
-
noBuild: {
|
|
113
|
-
type: "boolean",
|
|
114
|
-
describe: "빌드를 하지않고 배포합니다.",
|
|
115
|
-
default: false,
|
|
116
|
-
},
|
|
117
|
-
config: {
|
|
118
|
-
type: "string",
|
|
119
|
-
describe: "설정 파일 경로",
|
|
120
|
-
default: "simplysm.js",
|
|
121
|
-
},
|
|
122
|
-
options: {
|
|
123
|
-
type: "string",
|
|
124
|
-
array: true,
|
|
125
|
-
describe: "옵션 설정",
|
|
126
|
-
},
|
|
127
|
-
packages: {
|
|
128
|
-
type: "string",
|
|
129
|
-
array: true,
|
|
130
|
-
describe: "수행할 패키지 설정",
|
|
131
|
-
},
|
|
132
|
-
}), async (argv) => {
|
|
133
|
-
await SdCliProject.publishAsync(argv);
|
|
134
|
-
process.exit(0);
|
|
135
|
-
})
|
|
136
|
-
.command("run-electron <package>", "변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
137
|
-
.version(false)
|
|
138
|
-
.hide("help")
|
|
139
|
-
.hide("debug")
|
|
140
|
-
.positional("package", {
|
|
141
|
-
type: "string",
|
|
142
|
-
describe: "패키지명",
|
|
143
|
-
demandOption: true,
|
|
144
|
-
})
|
|
145
|
-
.options({
|
|
146
|
-
config: {
|
|
147
|
-
type: "string",
|
|
148
|
-
describe: "설정 파일 경로",
|
|
149
|
-
default: "simplysm.js",
|
|
150
|
-
},
|
|
151
|
-
options: {
|
|
152
|
-
type: "string",
|
|
153
|
-
array: true,
|
|
154
|
-
describe: "옵션 설정",
|
|
155
|
-
},
|
|
156
|
-
}), async (argv) => await SdCliElectron.runAsync(argv))
|
|
157
|
-
.command("build-electron-for-dev <package>", "변경감지중인 플랫폼을 ELECTRON 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
158
|
-
.version(false)
|
|
159
|
-
.hide("help")
|
|
160
|
-
.hide("debug")
|
|
161
|
-
.positional("package", {
|
|
162
|
-
type: "string",
|
|
163
|
-
describe: "패키지명",
|
|
164
|
-
demandOption: true,
|
|
165
|
-
})
|
|
166
|
-
.options({
|
|
167
|
-
config: {
|
|
168
|
-
type: "string",
|
|
169
|
-
describe: "설정 파일 경로",
|
|
170
|
-
default: "simplysm.js",
|
|
171
|
-
},
|
|
172
|
-
options: {
|
|
173
|
-
type: "string",
|
|
174
|
-
array: true,
|
|
175
|
-
describe: "옵션 설정",
|
|
176
|
-
},
|
|
177
|
-
}), async (argv) => await SdCliElectron.buildForDevAsync(argv))
|
|
178
|
-
.command("run-cordova <platform> <package> [url]", "변경감지중인 플랫폼을 코도바 디바이스에 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
179
|
-
.version(false)
|
|
180
|
-
.hide("help")
|
|
181
|
-
.hide("debug")
|
|
182
|
-
.positional("platform", {
|
|
183
|
-
type: "string",
|
|
184
|
-
describe: "빌드 플랫폼(android,...)",
|
|
185
|
-
demandOption: true,
|
|
186
|
-
})
|
|
187
|
-
.positional("package", {
|
|
188
|
-
type: "string",
|
|
189
|
-
describe: "패키지명",
|
|
190
|
-
demandOption: true,
|
|
191
|
-
})
|
|
192
|
-
.positional("url", {
|
|
193
|
-
type: "string",
|
|
194
|
-
describe: "Webview로 오픈할 URL",
|
|
195
|
-
demandOption: true,
|
|
196
|
-
}), async (argv) => await SdCliCordova.runWebviewOnDeviceAsync(argv))
|
|
197
|
-
.command("run-capacitor <platform> <package> [url]", "변경감지중인 플랫폼을 Capacitor 디바이스에 앱 형태로 띄웁니다.", (cmd) => cmd
|
|
198
|
-
.version(false)
|
|
199
|
-
.hide("help")
|
|
200
|
-
.hide("debug")
|
|
201
|
-
.positional("platform", {
|
|
202
|
-
type: "string",
|
|
203
|
-
describe: "빌드 플랫폼(android,...)",
|
|
204
|
-
demandOption: true,
|
|
205
|
-
})
|
|
206
|
-
.positional("package", {
|
|
207
|
-
type: "string",
|
|
208
|
-
describe: "패키지명",
|
|
209
|
-
demandOption: true,
|
|
210
|
-
})
|
|
211
|
-
.positional("url", {
|
|
212
|
-
type: "string",
|
|
213
|
-
describe: "Webview로 오픈할 URL",
|
|
214
|
-
demandOption: true,
|
|
215
|
-
}), async (argv) => await SdCliCapacitor.runWebviewOnDeviceAsync(argv))
|
|
216
|
-
.command("commit", "AI를 통해 변경사항에 대한 커밋 메시지를 작성하여, 커밋 및 푸쉬를 수행합니다.", (cmd) => cmd.version(false).hide("help").hide("debug"), async () => await SdCliAiCommand.commitAsync())
|
|
217
|
-
.command("postinstall", "설치후 자동실행할 작업", (cmd) => cmd.version(false).hide("help").hide("debug"), () => SdCliPostInstall.run())
|
|
218
|
-
.strict()
|
|
219
|
-
.recommendCommands()
|
|
220
|
-
.fail((msg, err, cmd) => {
|
|
221
|
-
if (Boolean(err)) {
|
|
222
|
-
throw err;
|
|
223
|
-
}
|
|
224
|
-
console.error("지원되지 않는 명령입니다.");
|
|
225
|
-
console.error(msg);
|
|
226
|
-
console.log("\n명령어 목록:");
|
|
227
|
-
cmd.showHelp();
|
|
228
|
-
process.exit(1);
|
|
229
|
-
})
|
|
230
|
-
.parseAsync();
|
package/dist/sd-cli.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PathUtils } from "@simplysm/sd-core-node";
|
|
2
|
-
export class ScopePathSet {
|
|
3
|
-
constructor(arrOrSet) {
|
|
4
|
-
this._data = arrOrSet instanceof Set ? arrOrSet : new Set(arrOrSet);
|
|
5
|
-
}
|
|
6
|
-
inScope(filePath) {
|
|
7
|
-
return Array.from(this._data).some((scope) => PathUtils.isChildPath(filePath, scope));
|
|
8
|
-
}
|
|
9
|
-
toArray() {
|
|
10
|
-
return Array.from(this._data);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { SdDepCache } from "./SdDepCache";
|
|
3
|
-
import { TNormPath } from "@simplysm/sd-core-node";
|
|
4
|
-
import { NgtscProgram } from "@angular/compiler-cli";
|
|
5
|
-
import { ScopePathSet } from "./ScopePathSet";
|
|
6
|
-
export declare class SdDepAnalyzer {
|
|
7
|
-
static analyze(program: ts.Program, compilerHost: ts.CompilerHost, scopePathSet: ScopePathSet, cache: {
|
|
8
|
-
dep: SdDepCache;
|
|
9
|
-
type: WeakMap<ts.Node, ts.Type | undefined>;
|
|
10
|
-
prop: WeakMap<ts.Type, Map<string, ts.Symbol | undefined>>;
|
|
11
|
-
declFiles: WeakMap<ts.Symbol, TNormPath[]>;
|
|
12
|
-
ngOrg: Map<TNormPath, ts.SourceFile>;
|
|
13
|
-
}): void;
|
|
14
|
-
static analyzeAngularResources(ngProgram: NgtscProgram, scopePathSet: ScopePathSet, depCache: SdDepCache): void;
|
|
15
|
-
}
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { PathUtils } from "@simplysm/sd-core-node";
|
|
3
|
-
import path from "path";
|
|
4
|
-
export class SdDepAnalyzer {
|
|
5
|
-
static analyze(program, compilerHost, scopePathSet, cache) {
|
|
6
|
-
const compilerOpts = program.getCompilerOptions();
|
|
7
|
-
const typeChecker = program.getTypeChecker();
|
|
8
|
-
const moduleResolutionCache = compilerHost.getModuleResolutionCache();
|
|
9
|
-
const resolveModule = (text, base) => {
|
|
10
|
-
const res = ts.resolveModuleName(text, base, compilerOpts, compilerHost, moduleResolutionCache);
|
|
11
|
-
if (res.resolvedModule) {
|
|
12
|
-
return [PathUtils.norm(res.resolvedModule.resolvedFileName)];
|
|
13
|
-
}
|
|
14
|
-
const absPath = path.resolve(path.dirname(base), text);
|
|
15
|
-
if (!scopePathSet.inScope(absPath)) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
else if (
|
|
19
|
-
// 지원되게할 .png등이면 그냥 가져오고 (bundling loader에 들어가는것들과 .ts, .json등)
|
|
20
|
-
// fallback일때는 absPath에 .ts, .d.ts, .js, .json 등 다붙여서 가져와야함
|
|
21
|
-
[
|
|
22
|
-
".ts",
|
|
23
|
-
".d.ts",
|
|
24
|
-
".js",
|
|
25
|
-
".json",
|
|
26
|
-
".html",
|
|
27
|
-
".scss",
|
|
28
|
-
".css",
|
|
29
|
-
".png",
|
|
30
|
-
".jpeg",
|
|
31
|
-
".jpg",
|
|
32
|
-
".jfif",
|
|
33
|
-
".gif",
|
|
34
|
-
".svg",
|
|
35
|
-
".woff",
|
|
36
|
-
".woff2",
|
|
37
|
-
".ttf",
|
|
38
|
-
".ttc",
|
|
39
|
-
".eot",
|
|
40
|
-
".ico",
|
|
41
|
-
".otf",
|
|
42
|
-
".csv",
|
|
43
|
-
".xlsx",
|
|
44
|
-
".xls",
|
|
45
|
-
".pptx",
|
|
46
|
-
".ppt",
|
|
47
|
-
".docx",
|
|
48
|
-
".doc",
|
|
49
|
-
".zip",
|
|
50
|
-
".pfx",
|
|
51
|
-
".pkl",
|
|
52
|
-
".mp3",
|
|
53
|
-
".ogg",
|
|
54
|
-
].some((ext) => absPath.endsWith(ext))) {
|
|
55
|
-
return [PathUtils.norm(absPath)];
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return [
|
|
59
|
-
PathUtils.norm(absPath + ".ts"),
|
|
60
|
-
PathUtils.norm(absPath + ".js"),
|
|
61
|
-
PathUtils.norm(absPath + ".d.ts"),
|
|
62
|
-
PathUtils.norm(absPath + ".json"),
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const isInImportOrExport = (node) => {
|
|
67
|
-
const p = node.parent;
|
|
68
|
-
return (ts.isImportDeclaration(p) ||
|
|
69
|
-
ts.isExportDeclaration(p) ||
|
|
70
|
-
ts.isImportSpecifier(p) ||
|
|
71
|
-
ts.isExportSpecifier(p) ||
|
|
72
|
-
ts.isNamespaceImport(p));
|
|
73
|
-
};
|
|
74
|
-
const isDeclarationIdentifier = (id) => {
|
|
75
|
-
const p = id.parent;
|
|
76
|
-
return ((ts.isParameter(p) && p.name === id) ||
|
|
77
|
-
(ts.isVariableDeclaration(p) && p.name === id) ||
|
|
78
|
-
(ts.isFunctionDeclaration(p) && p.name === id) ||
|
|
79
|
-
(ts.isClassDeclaration(p) && p.name === id) ||
|
|
80
|
-
(ts.isInterfaceDeclaration(p) && p.name === id) ||
|
|
81
|
-
(ts.isTypeAliasDeclaration(p) && p.name === id) ||
|
|
82
|
-
(ts.isEnumDeclaration(p) && p.name === id) ||
|
|
83
|
-
(ts.isPropertySignature(p) && p.name === id) ||
|
|
84
|
-
(ts.isPropertyDeclaration(p) && p.name === id) ||
|
|
85
|
-
(ts.isMethodSignature(p) && p.name === id) ||
|
|
86
|
-
(ts.isMethodDeclaration(p) && p.name === id));
|
|
87
|
-
};
|
|
88
|
-
// const typeCache = new WeakMap<ts.Node, ts.Type | undefined>();
|
|
89
|
-
const getCachedType = (node) => {
|
|
90
|
-
if (cache.type.has(node))
|
|
91
|
-
return cache.type.get(node);
|
|
92
|
-
const type = typeChecker.getTypeAtLocation(node);
|
|
93
|
-
if (!type)
|
|
94
|
-
return undefined;
|
|
95
|
-
const skipMask = ts.TypeFlags.Any |
|
|
96
|
-
ts.TypeFlags.Unknown |
|
|
97
|
-
ts.TypeFlags.Never |
|
|
98
|
-
ts.TypeFlags.Null |
|
|
99
|
-
ts.TypeFlags.Undefined |
|
|
100
|
-
ts.TypeFlags.BooleanLike |
|
|
101
|
-
ts.TypeFlags.NumberLike |
|
|
102
|
-
ts.TypeFlags.StringLike |
|
|
103
|
-
ts.TypeFlags.BigIntLike |
|
|
104
|
-
ts.TypeFlags.ESSymbolLike;
|
|
105
|
-
const result = (type.flags & skipMask) !== 0 ? undefined : type;
|
|
106
|
-
cache.type.set(node, result);
|
|
107
|
-
return result;
|
|
108
|
-
};
|
|
109
|
-
// const propCache = new WeakMap<ts.Type, Map<string, ts.Symbol | undefined>>();
|
|
110
|
-
const getCachedProp = (type, name) => {
|
|
111
|
-
if (!type)
|
|
112
|
-
return undefined;
|
|
113
|
-
let map = cache.prop.get(type);
|
|
114
|
-
if (!map) {
|
|
115
|
-
map = new Map();
|
|
116
|
-
cache.prop.set(type, map);
|
|
117
|
-
}
|
|
118
|
-
if (map.has(name))
|
|
119
|
-
return map.get(name);
|
|
120
|
-
const s = type.getProperty(name);
|
|
121
|
-
map.set(name, s);
|
|
122
|
-
return s;
|
|
123
|
-
};
|
|
124
|
-
const getDeclFileNPaths = (sym) => {
|
|
125
|
-
if (!sym)
|
|
126
|
-
return [];
|
|
127
|
-
const c = cache.declFiles.get(sym);
|
|
128
|
-
if (c)
|
|
129
|
-
return c;
|
|
130
|
-
const paths = (sym.getDeclarations() ?? []).map((d) => PathUtils.norm(d.getSourceFile().fileName));
|
|
131
|
-
cache.declFiles.set(sym, paths);
|
|
132
|
-
return paths;
|
|
133
|
-
};
|
|
134
|
-
const collectDeps = (sf) => {
|
|
135
|
-
const sfNPath = PathUtils.norm(sf.fileName);
|
|
136
|
-
if (cache.dep.hasCollected(sfNPath))
|
|
137
|
-
return;
|
|
138
|
-
cache.dep.addCollected(sfNPath);
|
|
139
|
-
if (!scopePathSet.inScope(sfNPath))
|
|
140
|
-
return;
|
|
141
|
-
const visit = (node) => {
|
|
142
|
-
// --- import ... from '...'
|
|
143
|
-
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
144
|
-
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
145
|
-
for (const resolvedNPath of resolvedNPaths) {
|
|
146
|
-
if (!scopePathSet.inScope(resolvedNPath))
|
|
147
|
-
continue;
|
|
148
|
-
if (node.importClause &&
|
|
149
|
-
node.importClause.namedBindings &&
|
|
150
|
-
ts.isNamedImports(node.importClause.namedBindings)) {
|
|
151
|
-
// import ... from '...'
|
|
152
|
-
for (const element of node.importClause.namedBindings.elements) {
|
|
153
|
-
cache.dep.addImport(sfNPath, resolvedNPath, element.propertyName?.text ?? element.name.text);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
cache.dep.addImport(sfNPath, resolvedNPath, 0);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
// --- export * from '...'
|
|
163
|
-
else if (ts.isExportDeclaration(node) &&
|
|
164
|
-
!node.exportClause &&
|
|
165
|
-
node.moduleSpecifier &&
|
|
166
|
-
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
167
|
-
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
168
|
-
for (const resolvedNPath of resolvedNPaths) {
|
|
169
|
-
if (!scopePathSet.inScope(resolvedNPath))
|
|
170
|
-
continue;
|
|
171
|
-
cache.dep.addReexport(sfNPath, resolvedNPath, 0);
|
|
172
|
-
}
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
// --- export { A as B } from '...'
|
|
176
|
-
else if (ts.isExportDeclaration(node) &&
|
|
177
|
-
node.exportClause &&
|
|
178
|
-
ts.isNamedExports(node.exportClause) &&
|
|
179
|
-
node.moduleSpecifier &&
|
|
180
|
-
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
181
|
-
const resolvedNPaths = resolveModule(node.moduleSpecifier.text, sf.fileName);
|
|
182
|
-
for (const resolvedNPath of resolvedNPaths) {
|
|
183
|
-
if (!scopePathSet.inScope(resolvedNPath))
|
|
184
|
-
continue;
|
|
185
|
-
for (const element of node.exportClause.elements) {
|
|
186
|
-
const local = element.propertyName?.text ?? element.name.text;
|
|
187
|
-
const exported = element.name.text;
|
|
188
|
-
cache.dep.addReexport(sfNPath, resolvedNPath, {
|
|
189
|
-
importSymbol: local,
|
|
190
|
-
exportSymbol: exported,
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
// --- export const A = ...
|
|
197
|
-
else if (ts.isVariableStatement(node) &&
|
|
198
|
-
node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword)) {
|
|
199
|
-
for (const decl of node.declarationList.declarations) {
|
|
200
|
-
if (ts.isIdentifier(decl.name)) {
|
|
201
|
-
cache.dep.addExport(sfNPath, decl.name.text);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// --- export function/class/interface A ...
|
|
206
|
-
if ((ts.isFunctionDeclaration(node) ||
|
|
207
|
-
ts.isClassDeclaration(node) ||
|
|
208
|
-
ts.isInterfaceDeclaration(node) ||
|
|
209
|
-
ts.isTypeAliasDeclaration(node) ||
|
|
210
|
-
ts.isEnumDeclaration(node)) &&
|
|
211
|
-
node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword) &&
|
|
212
|
-
node.name) {
|
|
213
|
-
cache.dep.addExport(sfNPath, node.name.text);
|
|
214
|
-
}
|
|
215
|
-
else if (ts.isIdentifier(node) &&
|
|
216
|
-
isDeclarationIdentifier(node) &&
|
|
217
|
-
!isInImportOrExport(node)) {
|
|
218
|
-
const orgValSymbol = typeChecker.getSymbolAtLocation(node);
|
|
219
|
-
let valSymbol = orgValSymbol;
|
|
220
|
-
if (orgValSymbol && orgValSymbol.flags & ts.SymbolFlags.Alias) {
|
|
221
|
-
// 현 파일 선언으로 확정되면 굳이 치환 불필요
|
|
222
|
-
const declNPaths = getDeclFileNPaths(orgValSymbol);
|
|
223
|
-
const external = declNPaths.some((declNPath) => declNPath !== sfNPath);
|
|
224
|
-
if (external) {
|
|
225
|
-
valSymbol = typeChecker.getAliasedSymbol(orgValSymbol);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
for (const declNPath of getDeclFileNPaths(valSymbol)) {
|
|
229
|
-
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
230
|
-
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
else if (ts.isPropertyAccessExpression(node)) {
|
|
235
|
-
const type = getCachedType(node.expression);
|
|
236
|
-
const propSymbol = getCachedProp(type, node.name.text);
|
|
237
|
-
if (propSymbol) {
|
|
238
|
-
for (const declNPath of getDeclFileNPaths(propSymbol)) {
|
|
239
|
-
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
240
|
-
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
else if (ts.isElementAccessExpression(node) &&
|
|
246
|
-
ts.isStringLiteral(node.argumentExpression)) {
|
|
247
|
-
const type = getCachedType(node.expression);
|
|
248
|
-
const propSymbol = getCachedProp(type, node.argumentExpression.text);
|
|
249
|
-
if (propSymbol) {
|
|
250
|
-
for (const declNPath of getDeclFileNPaths(propSymbol)) {
|
|
251
|
-
if (declNPath !== sfNPath && scopePathSet.inScope(declNPath)) {
|
|
252
|
-
cache.dep.addImport(sfNPath, declNPath, 0);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
ts.forEachChild(node, visit);
|
|
258
|
-
};
|
|
259
|
-
ts.forEachChild(sf, visit);
|
|
260
|
-
};
|
|
261
|
-
const getOrgSourceFile = (sf) => {
|
|
262
|
-
if (sf.fileName.endsWith(".ngtypecheck.ts")) {
|
|
263
|
-
const sfNPath = PathUtils.norm(sf.fileName);
|
|
264
|
-
let org = cache.ngOrg.get(sfNPath);
|
|
265
|
-
if (!org) {
|
|
266
|
-
const orgPath = sf.fileName.slice(0, -15) + ".ts";
|
|
267
|
-
org = program.getSourceFile(orgPath) ?? sf;
|
|
268
|
-
const realOrg = program.getSourceFile(orgPath);
|
|
269
|
-
if (realOrg)
|
|
270
|
-
cache.ngOrg.set(sfNPath, realOrg);
|
|
271
|
-
}
|
|
272
|
-
return org;
|
|
273
|
-
}
|
|
274
|
-
return sf;
|
|
275
|
-
};
|
|
276
|
-
const sourceFileSet = new Set(program
|
|
277
|
-
.getSourceFiles()
|
|
278
|
-
.filter((sf) => scopePathSet.inScope(sf.fileName))
|
|
279
|
-
.map((sf) => getOrgSourceFile(sf))
|
|
280
|
-
.filterExists());
|
|
281
|
-
for (const sf of sourceFileSet) {
|
|
282
|
-
collectDeps(sf);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
static analyzeAngularResources(ngProgram, scopePathSet, depCache) {
|
|
286
|
-
for (const sf of ngProgram.getTsProgram().getSourceFiles()) {
|
|
287
|
-
const fileNPath = PathUtils.norm(sf.fileName);
|
|
288
|
-
if (!scopePathSet.inScope(fileNPath))
|
|
289
|
-
continue;
|
|
290
|
-
const dependencies = ngProgram.compiler.getResourceDependencies(sf);
|
|
291
|
-
for (const dep of dependencies) {
|
|
292
|
-
const depNPath = PathUtils.norm(dep);
|
|
293
|
-
if (!scopePathSet.inScope(depNPath))
|
|
294
|
-
continue;
|
|
295
|
-
depCache.addImport(fileNPath, depNPath, 0);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { TNormPath } from "@simplysm/sd-core-node";
|
|
2
|
-
export declare class SdDepCache {
|
|
3
|
-
/**
|
|
4
|
-
* 각 파일이 export한 심볼 집합 (예: export const A → "A")
|
|
5
|
-
*/
|
|
6
|
-
private readonly _exportCache;
|
|
7
|
-
/**
|
|
8
|
-
* import한 타겟과 그 심볼 정보
|
|
9
|
-
* - 값이 0이면 전체 import(import * 또는 리소스 import)
|
|
10
|
-
* - 값이 Set이면 선택적 심볼 import (예: import { A } ...)
|
|
11
|
-
*/
|
|
12
|
-
private readonly _importCache;
|
|
13
|
-
/**
|
|
14
|
-
* re-export한 타겟과 그 심볼 정보
|
|
15
|
-
* - export * from ...
|
|
16
|
-
* - export { A as B } from ...
|
|
17
|
-
* - 값이 0이면 전체 reexport(export * from ...)
|
|
18
|
-
*/
|
|
19
|
-
private readonly _reexportCache;
|
|
20
|
-
/**
|
|
21
|
-
* 역의존 정보 (revDep)
|
|
22
|
-
* - 특정 파일이 어떤 파일에게 의존(참조)되는지
|
|
23
|
-
* - symbol 기반 추적
|
|
24
|
-
*/
|
|
25
|
-
private readonly _revDepCache;
|
|
26
|
-
/**
|
|
27
|
-
* 분석이 완료된 파일 경로
|
|
28
|
-
*/
|
|
29
|
-
private readonly _collectedCache;
|
|
30
|
-
private readonly _exportSymbolCache;
|
|
31
|
-
/**
|
|
32
|
-
* .d.ts 또는 .js가 입력되었을 때 쌍으로 존재하는 파일 경로를 반환
|
|
33
|
-
* 예: "/a.d.ts" → ["/a.d.ts", "/a.js"]
|
|
34
|
-
*/
|
|
35
|
-
private _getRelatedNPaths;
|
|
36
|
-
/**
|
|
37
|
-
* 분석이 완료된 파일로 표시
|
|
38
|
-
*/
|
|
39
|
-
addCollected(fileNPath: TNormPath): void;
|
|
40
|
-
hasCollected(fileNPath: TNormPath): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* export한 심볼 등록
|
|
43
|
-
* 예: export const A → "A"
|
|
44
|
-
*/
|
|
45
|
-
addExport(fileNPath: TNormPath, exportSymbol: string): void;
|
|
46
|
-
/**
|
|
47
|
-
* import 구문 등록
|
|
48
|
-
* - import * from ... → symbol = 0
|
|
49
|
-
* - import { A } from ... → symbol = "A"
|
|
50
|
-
*/
|
|
51
|
-
addImport(fileNPath: TNormPath, targetNPath: TNormPath, targetSymbol: string | 0): void;
|
|
52
|
-
/**
|
|
53
|
-
* export * or export { A as B } from ... 구문 등록
|
|
54
|
-
* ※ export/import에 자동 등록되지 않으므로 외부에서 명시적으로 따로 입력해야 함
|
|
55
|
-
*/
|
|
56
|
-
addReexport(fileNPath: TNormPath, targetNPath: TNormPath, targetSymbolInfo: {
|
|
57
|
-
importSymbol: string;
|
|
58
|
-
exportSymbol: string;
|
|
59
|
-
} | 0): void;
|
|
60
|
-
/**
|
|
61
|
-
* 역의존 관계 등록 (revDep)
|
|
62
|
-
*/
|
|
63
|
-
private _addRevDep;
|
|
64
|
-
getAffectedFileMap(modifiedNPathSet: Set<TNormPath>): Map<TNormPath, Set<TNormPath>>;
|
|
65
|
-
/**
|
|
66
|
-
* 주어진 파일들 및 그 영향 범위에 해당하는 모든 캐시를 무효화
|
|
67
|
-
*/
|
|
68
|
-
invalidates(fileNPathSet: Set<TNormPath>): void;
|
|
69
|
-
/**
|
|
70
|
-
* reexport된 경우 importSymbol → exportSymbol로 변환
|
|
71
|
-
*/
|
|
72
|
-
private _convertImportSymbolToExportSymbol;
|
|
73
|
-
/**
|
|
74
|
-
* 해당 파일에서 export된 모든 심볼 (직접 + 재export 포함)
|
|
75
|
-
*/
|
|
76
|
-
private _getExportSymbols;
|
|
77
|
-
}
|