@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,241 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
import * as ts from "typescript";
|
|
3
|
-
import { PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
4
|
-
import { SdDepCache } from "../../src/ts-compiler/SdDepCache";
|
|
5
|
-
import { SdDepAnalyzer } from "../../src/ts-compiler/SdDepAnalyzer";
|
|
6
|
-
|
|
7
|
-
function createMockProgram(sources: Record<string, string>) {
|
|
8
|
-
const fileNames = Object.keys(sources);
|
|
9
|
-
const compilerHost = ts.createCompilerHost({});
|
|
10
|
-
compilerHost.readFile = (fileName: string) => sources[fileName] ?? "";
|
|
11
|
-
compilerHost.fileExists = (fileName: string) => fileName in sources;
|
|
12
|
-
compilerHost.getSourceFile = (fileName, languageVersion) => {
|
|
13
|
-
const sourceText = sources[fileName];
|
|
14
|
-
if (!sourceText) return undefined;
|
|
15
|
-
return ts.createSourceFile(fileName, sourceText, languageVersion);
|
|
16
|
-
};
|
|
17
|
-
const program = ts.createProgram(fileNames, {}, compilerHost);
|
|
18
|
-
return { program, compilerHost };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function norm(path: string): TNormPath {
|
|
22
|
-
return PathUtils.norm(path);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
describe("DependencyAnalyzer", () => {
|
|
26
|
-
const scope = PathUtils.norm("/");
|
|
27
|
-
let depCache: SdDepCache;
|
|
28
|
-
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
depCache = new SdDepCache();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("1레벨 의존성 추적", () => {
|
|
34
|
-
const files = {
|
|
35
|
-
"/a.ts": `export const A = 1;`,
|
|
36
|
-
"/b.ts": `import { A } from "./a";`,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
40
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
41
|
-
|
|
42
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
43
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts")]));
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("2레벨 의존성 추적", () => {
|
|
47
|
-
const files = {
|
|
48
|
-
"/a.ts": `export const A = 1;`,
|
|
49
|
-
"/b.ts": `export * from "./a";`,
|
|
50
|
-
"/c.ts": `import { A } from "./b";`,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
54
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
58
|
-
expect(result).toEqual(
|
|
59
|
-
new Set([
|
|
60
|
-
norm("/a.ts"),
|
|
61
|
-
norm("/b.ts"), // a파일이 사라지거나 하면 b가 오류를 뱉어야 하므로
|
|
62
|
-
norm("/c.ts"),
|
|
63
|
-
]),
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/b.ts")]));
|
|
69
|
-
expect(result).toEqual(new Set([norm("/b.ts"), norm("/c.ts")]));
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("2레벨 Rename 의존성 추적", () => {
|
|
74
|
-
const files = {
|
|
75
|
-
"/a.ts": `export const A = 1;`,
|
|
76
|
-
"/b.ts": `export { A as B } from "./a";`,
|
|
77
|
-
"/c.ts": `import { B } from "./b";`,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
81
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
85
|
-
expect(result).toEqual(
|
|
86
|
-
new Set([
|
|
87
|
-
norm("/a.ts"),
|
|
88
|
-
norm("/b.ts"), // a파일이 사라지거나 하면 b가 오류를 뱉어야 하므로
|
|
89
|
-
norm("/c.ts"),
|
|
90
|
-
]),
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/b.ts")]));
|
|
96
|
-
expect(result).toEqual(new Set([norm("/b.ts"), norm("/c.ts")]));
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("2레벨 선택적 의존성 추적", () => {
|
|
101
|
-
const files = {
|
|
102
|
-
"/a.ts": `export const A = 1;`,
|
|
103
|
-
"/a_1.ts": `export const A_1 = 1;`,
|
|
104
|
-
"/b.ts": `export * from "./a"; export * from "./a_1";`,
|
|
105
|
-
"/c.ts": `import { A } from "./b";`,
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
109
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
113
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts"), norm("/c.ts")]));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
{
|
|
117
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a_1.ts")]));
|
|
118
|
-
expect(result).toEqual(new Set([norm("/a_1.ts"), norm("/b.ts")]));
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it("A.b.c와같은 간접 의존성 추적", () => {
|
|
123
|
-
const files = {
|
|
124
|
-
"/a.ts": `
|
|
125
|
-
import { B } from "./b";
|
|
126
|
-
export class A {
|
|
127
|
-
b: B = new B();
|
|
128
|
-
}
|
|
129
|
-
`,
|
|
130
|
-
"/b.ts": `
|
|
131
|
-
export class B {
|
|
132
|
-
c: string = "hello";
|
|
133
|
-
}
|
|
134
|
-
`,
|
|
135
|
-
"/c.ts": `
|
|
136
|
-
import { A } from "./a";
|
|
137
|
-
|
|
138
|
-
function doSomething() {
|
|
139
|
-
// A.b.c 속성 접근을 통해 B에 간접 의존
|
|
140
|
-
console.log(new A().b.c);
|
|
141
|
-
}
|
|
142
|
-
`,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
146
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
147
|
-
|
|
148
|
-
// B가 변경되면 A와 C 모두 영향 받는지 확인
|
|
149
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/b.ts")]));
|
|
150
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts"), norm("/c.ts")]));
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("A['b'].c와같은 Element 간접 의존성 추적", () => {
|
|
154
|
-
const files = {
|
|
155
|
-
"/a.ts": `
|
|
156
|
-
import { B } from "./b";
|
|
157
|
-
export class A {
|
|
158
|
-
b: B = new B();
|
|
159
|
-
}
|
|
160
|
-
`,
|
|
161
|
-
"/b.ts": `
|
|
162
|
-
export class B {
|
|
163
|
-
c: string = "hello";
|
|
164
|
-
}
|
|
165
|
-
`,
|
|
166
|
-
"/c.ts": `
|
|
167
|
-
import { A } from "./a";
|
|
168
|
-
|
|
169
|
-
function doSomething() {
|
|
170
|
-
// A['b'].c 속성 접근을 통해 B에 간접 의존
|
|
171
|
-
console.log(new A()['b'].c);
|
|
172
|
-
}
|
|
173
|
-
`,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
177
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
178
|
-
|
|
179
|
-
// B가 변경되면 A와 C 모두 영향 받는지 확인
|
|
180
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/b.ts")]));
|
|
181
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts"), norm("/c.ts")]));
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it("타입만 사용하는 경우에도 의존성으로 추적된다", () => {
|
|
185
|
-
const files = {
|
|
186
|
-
"/a.ts": `export interface IA { value: string; }`,
|
|
187
|
-
"/b.ts": `import { IA } from "./a"; const val: IA = { value: "hi" };`,
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
191
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
192
|
-
|
|
193
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
194
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts")]));
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("함수 반환 타입을 통한 간접 의존성도 추적된다", () => {
|
|
198
|
-
const files = {
|
|
199
|
-
"/a.ts": `export class A { value = 1; }`,
|
|
200
|
-
"/b.ts": `import { A } from "./a"; export function getA(): A { return new A(); }`,
|
|
201
|
-
"/c.ts": `import { getA } from "./b"; console.log(getA().value);`,
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
205
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
206
|
-
|
|
207
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
208
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts"), norm("/c.ts")]));
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
it("optional chaining으로 접근해도 의존성은 추적된다", () => {
|
|
212
|
-
const files = {
|
|
213
|
-
"/a.ts": `export class A { b?: { c: number }; }`,
|
|
214
|
-
"/b.ts": `import { A } from "./a"; const a = new A(); console.log(a.b?.c);`,
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
218
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
219
|
-
|
|
220
|
-
const result = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
221
|
-
expect(result).toEqual(new Set([norm("/a.ts"), norm("/b.ts")]));
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
it("invalidates()는 영향 받은 모든 파일을 캐시에서 제거한다", () => {
|
|
225
|
-
const files = {
|
|
226
|
-
"/a.ts": `export const A = 1;`,
|
|
227
|
-
"/b.ts": `import { A } from "./a";`,
|
|
228
|
-
"/c.ts": `import { A } from "./a";`,
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const { program, compilerHost } = createMockProgram(files);
|
|
232
|
-
SdDepAnalyzer.analyze(program, compilerHost, [scope], depCache);
|
|
233
|
-
|
|
234
|
-
// invalidate 처리
|
|
235
|
-
depCache.invalidates(new Set([norm("/a.ts")]));
|
|
236
|
-
|
|
237
|
-
const affected = depCache.getAffectedFileSet(new Set([norm("/a.ts")]));
|
|
238
|
-
// 분석 안된 상태이므로, a만 남아야 함
|
|
239
|
-
expect(affected).toEqual(new Set([norm("/a.ts")]));
|
|
240
|
-
});
|
|
241
|
-
});
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import "@simplysm/sd-core-common";
|
|
2
|
-
import { PathUtils } from "@simplysm/sd-core-node";
|
|
3
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
4
|
-
import { ISdAffectedFileTreeNode, SdDepCache } from "../../src/ts-compiler/SdDepCache";
|
|
5
|
-
|
|
6
|
-
describe("SdDependencyCache", () => {
|
|
7
|
-
const a = PathUtils.norm("/a.ts");
|
|
8
|
-
const b = PathUtils.norm("/b.ts");
|
|
9
|
-
const c = PathUtils.norm("/c.ts");
|
|
10
|
-
const html = PathUtils.norm("/comp.html");
|
|
11
|
-
// const style = PathUtils.norm("/style.scss");
|
|
12
|
-
|
|
13
|
-
let depCache: SdDepCache;
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
depCache = new SdDepCache();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("export * from 구문으로 재export된 심볼이 정확히 전파된다", () => {
|
|
20
|
-
// a.ts → export const A
|
|
21
|
-
depCache.addExport(a, "A");
|
|
22
|
-
|
|
23
|
-
// b.ts → export * from './a.ts'
|
|
24
|
-
depCache.addReexport(b, a, 0);
|
|
25
|
-
|
|
26
|
-
// c.ts → import { A } from './b.ts'
|
|
27
|
-
depCache.addImport(c, b, "A");
|
|
28
|
-
|
|
29
|
-
const result = depCache.getAffectedFileSet(new Set([a]));
|
|
30
|
-
expect(result).toEqual(new Set([a, b, c]));
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("export { A as B } from 구문으로 이름이 바뀐 심볼도 추적된다", () => {
|
|
34
|
-
// a.ts → export const A
|
|
35
|
-
depCache.addExport(a, "A");
|
|
36
|
-
|
|
37
|
-
// b.ts → export { A as B } from './a.ts'
|
|
38
|
-
depCache.addReexport(b, a, {
|
|
39
|
-
importSymbol: "A",
|
|
40
|
-
exportSymbol: "B",
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// c.ts → import { B } from './b.ts'
|
|
44
|
-
depCache.addImport(c, b, "B");
|
|
45
|
-
|
|
46
|
-
const result = depCache.getAffectedFileSet(new Set([a]));
|
|
47
|
-
expect(result).toEqual(new Set([a, b, c]));
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("import { X } 구문은 정확히 사용한 심볼만 추적한다", () => {
|
|
51
|
-
// b.ts → export const Foo
|
|
52
|
-
depCache.addExport(b, "Foo");
|
|
53
|
-
|
|
54
|
-
// a.ts → import { Foo } from './b.ts'
|
|
55
|
-
depCache.addImport(a, b, "Foo");
|
|
56
|
-
|
|
57
|
-
const result = depCache.getAffectedFileSet(new Set([b]));
|
|
58
|
-
expect(result).toEqual(new Set([b, a]));
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("import * (namespace import)은 모든 export의 영향을 받는다", () => {
|
|
62
|
-
// b.ts → export const Bar
|
|
63
|
-
depCache.addExport(b, "Bar");
|
|
64
|
-
|
|
65
|
-
// a.ts → import * as B from './b.ts'
|
|
66
|
-
depCache.addImport(a, b, 0);
|
|
67
|
-
|
|
68
|
-
const result = depCache.getAffectedFileSet(new Set([b]));
|
|
69
|
-
expect(result).toEqual(new Set([b, a]));
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("심볼이 일치하지 않으면 영향이 전파되지 않는다", () => {
|
|
73
|
-
// b.ts → export const Foo
|
|
74
|
-
depCache.addExport(b, "Foo");
|
|
75
|
-
|
|
76
|
-
// a.ts → import { NotFoo } from './b.ts'
|
|
77
|
-
depCache.addImport(a, b, "NotFoo");
|
|
78
|
-
|
|
79
|
-
const result = depCache.getAffectedFileSet(new Set([b]));
|
|
80
|
-
expect(result).toEqual(new Set([b])); // a.ts는 영향 없음
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("리소스 의존은 역의존만 추적되고 심볼 전파는 없다", () => {
|
|
84
|
-
// a.ts → templateUrl: "comp.html"
|
|
85
|
-
depCache.addImport(a, html, 0);
|
|
86
|
-
|
|
87
|
-
const result = depCache.getAffectedFileSet(new Set([html]));
|
|
88
|
-
expect(result).toEqual(new Set([html, a])); // 단순 역참조만 전파
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("reexport 후 재import된 경로의 역의존도 정확히 추적된다", () => {
|
|
92
|
-
depCache.addExport(a, "X");
|
|
93
|
-
depCache.addReexport(b, a, { importSymbol: "X", exportSymbol: "Y" });
|
|
94
|
-
depCache.addImport(c, b, "Y");
|
|
95
|
-
|
|
96
|
-
const result = depCache.getAffectedFileSet(new Set([a]));
|
|
97
|
-
expect(result).toEqual(new Set([a, b, c]));
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("invalidates()는 캐시에서 모든 관련 정보를 제거한다", () => {
|
|
101
|
-
depCache.addExport(a, "X");
|
|
102
|
-
depCache.addImport(b, a, "X");
|
|
103
|
-
|
|
104
|
-
depCache.invalidates(new Set([a]));
|
|
105
|
-
|
|
106
|
-
// 내부 캐시 확인
|
|
107
|
-
expect(depCache["_exportCache"].has(a)).toBe(false);
|
|
108
|
-
expect(depCache["#revDepCache"].get(a)?.has(b)).toBeFalsy(); // unefined
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("getAffectedFileTree()는 영향도를 트리 형태로 표현한다", () => {
|
|
112
|
-
// a.ts → export A
|
|
113
|
-
depCache.addExport(a, "A");
|
|
114
|
-
|
|
115
|
-
// b.ts → export { A as B } from './a.ts'
|
|
116
|
-
depCache.addReexport(b, a, {
|
|
117
|
-
importSymbol: "A",
|
|
118
|
-
exportSymbol: "B",
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// c.ts → import { B } from './b.ts'
|
|
122
|
-
depCache.addImport(c, b, "B");
|
|
123
|
-
|
|
124
|
-
const trees = depCache.getAffectedFileTree(new Set([a]));
|
|
125
|
-
|
|
126
|
-
expect(trees.length).toBeGreaterThan(0);
|
|
127
|
-
const aNode = trees.find((t) => t.fileNPath === a)!;
|
|
128
|
-
expect(aNode.children.some((c1) => c1.fileNPath === b)).toBeTruthy();
|
|
129
|
-
const bNode = aNode.children.find((c1) => c1.fileNPath === b)!;
|
|
130
|
-
expect(bNode.children.some((c2) => c2.fileNPath === c)).toBeTruthy();
|
|
131
|
-
|
|
132
|
-
const printTree = (node: ISdAffectedFileTreeNode, indent = "") => {
|
|
133
|
-
console.log(indent + node.fileNPath);
|
|
134
|
-
for (const child of node.children) {
|
|
135
|
-
printTree(child, indent + " ");
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
console.log(printTree(trees[0]));
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it("d.ts를 입력하면 js도 함께 영향을 받는다", () => {
|
|
143
|
-
const dts = PathUtils.norm("/mod.d.ts");
|
|
144
|
-
const js = PathUtils.norm("/mod.js");
|
|
145
|
-
const consumer = PathUtils.norm("/consumer.ts");
|
|
146
|
-
|
|
147
|
-
depCache.addExport(dts, "Foo");
|
|
148
|
-
depCache.addImport(consumer, js, "Foo"); // js 경로로 import
|
|
149
|
-
|
|
150
|
-
const result = depCache.getAffectedFileSet(new Set([dts]));
|
|
151
|
-
expect(result).toEqual(new Set([dts, js, consumer]));
|
|
152
|
-
});
|
|
153
|
-
});
|
package/tsconfig.json
DELETED
package/tsconfig.test.json
DELETED
package/vitest.config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
import tsconfigPaths from "vite-tsconfig-paths";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
plugins: [
|
|
6
|
-
tsconfigPaths({
|
|
7
|
-
projects: ["../../tsconfig.base.json"],
|
|
8
|
-
}),
|
|
9
|
-
],
|
|
10
|
-
test: {
|
|
11
|
-
globals: true,
|
|
12
|
-
environment: "node",
|
|
13
|
-
include: ["tests/**/*.spec.ts"],
|
|
14
|
-
},
|
|
15
|
-
});
|