@simplysm/sd-cli 14.0.42 โ 14.0.43
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/dist/angular/angular-compiler.d.ts +0 -35
- package/dist/angular/angular-compiler.d.ts.map +1 -1
- package/dist/angular/angular-compiler.js +0 -374
- package/dist/angular/angular-compiler.js.map +1 -1
- package/dist/angular/hmr-candidates.d.ts +13 -0
- package/dist/angular/hmr-candidates.d.ts.map +1 -0
- package/dist/angular/hmr-candidates.js +230 -0
- package/dist/angular/hmr-candidates.js.map +1 -0
- package/dist/angular/ngtsc-build-core.d.ts +29 -34
- package/dist/angular/ngtsc-build-core.d.ts.map +1 -1
- package/dist/angular/ngtsc-build-core.js +90 -51
- package/dist/angular/ngtsc-build-core.js.map +1 -1
- package/dist/angular/vite-angular-plugin.d.ts +1 -1
- package/dist/angular/vite-angular-plugin.d.ts.map +1 -1
- package/dist/angular/vite-angular-plugin.js +63 -56
- package/dist/angular/vite-angular-plugin.js.map +1 -1
- package/dist/angular/web-worker-transformer.d.ts +9 -0
- package/dist/angular/web-worker-transformer.d.ts.map +1 -0
- package/dist/angular/web-worker-transformer.js +73 -0
- package/dist/angular/web-worker-transformer.js.map +1 -0
- package/dist/capacitor/capacitor.d.ts.map +1 -1
- package/dist/capacitor/capacitor.js +6 -4
- package/dist/capacitor/capacitor.js.map +1 -1
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +15 -65
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/publish/deployment-phase.d.ts.map +1 -1
- package/dist/commands/publish/deployment-phase.js +13 -5
- package/dist/commands/publish/deployment-phase.js.map +1 -1
- package/dist/commands/publish/npm-publisher.js +1 -1
- package/dist/commands/publish/npm-publisher.js.map +1 -1
- package/dist/commands/publish/publish-command.js +1 -1
- package/dist/commands/publish/publish-command.js.map +1 -1
- package/dist/commands/publish/version-upgrade.js +1 -1
- package/dist/commands/publish/version-upgrade.js.map +1 -1
- package/dist/commands/replace-deps.d.ts.map +1 -1
- package/dist/commands/replace-deps.js +2 -1
- package/dist/commands/replace-deps.js.map +1 -1
- package/dist/deps/replace-deps/collect-deps.d.ts.map +1 -1
- package/dist/deps/replace-deps/collect-deps.js +5 -2
- package/dist/deps/replace-deps/collect-deps.js.map +1 -1
- package/dist/deps/replace-deps/replace-deps.d.ts +21 -3
- package/dist/deps/replace-deps/replace-deps.d.ts.map +1 -1
- package/dist/deps/replace-deps/replace-deps.js +107 -62
- package/dist/deps/replace-deps/replace-deps.js.map +1 -1
- package/dist/electron/electron.js +7 -7
- package/dist/electron/electron.js.map +1 -1
- package/dist/engines/BaseEngine.d.ts.map +1 -1
- package/dist/engines/BaseEngine.js +2 -5
- package/dist/engines/BaseEngine.js.map +1 -1
- package/dist/engines/EsbuildClientEngine.d.ts.map +1 -1
- package/dist/engines/EsbuildClientEngine.js +16 -9
- package/dist/engines/EsbuildClientEngine.js.map +1 -1
- package/dist/engines/NgtscEngine.d.ts +4 -4
- package/dist/engines/NgtscEngine.d.ts.map +1 -1
- package/dist/engines/NgtscEngine.js +5 -5
- package/dist/engines/NgtscEngine.js.map +1 -1
- package/dist/engines/TscEngine.d.ts.map +1 -1
- package/dist/engines/TscEngine.js +0 -2
- package/dist/engines/TscEngine.js.map +1 -1
- package/dist/engines/types.d.ts +2 -0
- package/dist/engines/types.d.ts.map +1 -1
- package/dist/esbuild/esbuild-angular-compiler-plugin.d.ts +36 -0
- package/dist/esbuild/esbuild-angular-compiler-plugin.d.ts.map +1 -0
- package/dist/esbuild/esbuild-angular-compiler-plugin.js +464 -0
- package/dist/esbuild/esbuild-angular-compiler-plugin.js.map +1 -0
- package/dist/esbuild/esbuild-client-config.d.ts +8 -2
- package/dist/esbuild/esbuild-client-config.d.ts.map +1 -1
- package/dist/esbuild/esbuild-client-config.js +48 -33
- package/dist/esbuild/esbuild-client-config.js.map +1 -1
- package/dist/esbuild/esbuild-tsc-plugin.d.ts +4 -1
- package/dist/esbuild/esbuild-tsc-plugin.d.ts.map +1 -1
- package/dist/esbuild/esbuild-tsc-plugin.js +27 -23
- package/dist/esbuild/esbuild-tsc-plugin.js.map +1 -1
- package/dist/esbuild/file-reference-tracker.d.ts +24 -0
- package/dist/esbuild/file-reference-tracker.d.ts.map +1 -0
- package/dist/esbuild/file-reference-tracker.js +57 -0
- package/dist/esbuild/file-reference-tracker.js.map +1 -0
- package/dist/esbuild/lmdb-cache-store.d.ts +18 -0
- package/dist/esbuild/lmdb-cache-store.d.ts.map +1 -0
- package/dist/esbuild/lmdb-cache-store.js +41 -0
- package/dist/esbuild/lmdb-cache-store.js.map +1 -0
- package/dist/esbuild/load-result-cache.d.ts +17 -0
- package/dist/esbuild/load-result-cache.d.ts.map +1 -0
- package/dist/esbuild/load-result-cache.js +61 -0
- package/dist/esbuild/load-result-cache.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lint/lint-core.js +7 -7
- package/dist/lint/lint-core.js.map +1 -1
- package/dist/orchestrators/BaseOrchestrator.js +2 -2
- package/dist/orchestrators/BaseOrchestrator.js.map +1 -1
- package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
- package/dist/orchestrators/BuildOrchestrator.js +5 -19
- package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
- package/dist/orchestrators/DevOrchestrator.js +5 -5
- package/dist/orchestrators/DevOrchestrator.js.map +1 -1
- package/dist/orchestrators/WatchOrchestrator.js +6 -6
- package/dist/orchestrators/WatchOrchestrator.js.map +1 -1
- package/dist/runtime/ResultCollector.d.ts +1 -0
- package/dist/runtime/ResultCollector.d.ts.map +1 -1
- package/dist/runtime/ResultCollector.js.map +1 -1
- package/dist/runtime/engine-watch-events.d.ts.map +1 -1
- package/dist/runtime/engine-watch-events.js +3 -0
- package/dist/runtime/engine-watch-events.js.map +1 -1
- package/dist/runtime/rebuild-manager.js +1 -1
- package/dist/runtime/rebuild-manager.js.map +1 -1
- package/dist/runtime/worker-utils.js +1 -1
- package/dist/runtime/worker-utils.js.map +1 -1
- package/dist/sd-cli-entry.d.ts.map +1 -1
- package/dist/sd-cli-entry.js +4 -3
- package/dist/sd-cli-entry.js.map +1 -1
- package/dist/sd-cli.js +3 -3
- package/dist/sd-cli.js.map +1 -1
- package/dist/ts-compiler/SdTsCompiler.d.ts +39 -0
- package/dist/ts-compiler/SdTsCompiler.d.ts.map +1 -0
- package/dist/ts-compiler/SdTsCompiler.js +593 -0
- package/dist/ts-compiler/SdTsCompiler.js.map +1 -0
- package/dist/ts-compiler/sd-ts-compiler-options.d.ts +40 -0
- package/dist/ts-compiler/sd-ts-compiler-options.d.ts.map +1 -0
- package/dist/ts-compiler/sd-ts-compiler-options.js +2 -0
- package/dist/ts-compiler/sd-ts-compiler-options.js.map +1 -0
- package/dist/ts-compiler/sd-ts-compiler-result.d.ts +34 -0
- package/dist/ts-compiler/sd-ts-compiler-result.d.ts.map +1 -0
- package/dist/ts-compiler/sd-ts-compiler-result.js +2 -0
- package/dist/ts-compiler/sd-ts-compiler-result.js.map +1 -0
- package/dist/utils/copy-public.d.ts +6 -4
- package/dist/utils/copy-public.d.ts.map +1 -1
- package/dist/utils/copy-public.js +9 -7
- package/dist/utils/copy-public.js.map +1 -1
- package/dist/utils/diagnostic-utils.d.ts +2 -3
- package/dist/utils/diagnostic-utils.d.ts.map +1 -1
- package/dist/utils/diagnostic-utils.js +8 -9
- package/dist/utils/diagnostic-utils.js.map +1 -1
- package/dist/utils/output-utils.d.ts +8 -2
- package/dist/utils/output-utils.d.ts.map +1 -1
- package/dist/utils/output-utils.js +32 -8
- package/dist/utils/output-utils.js.map +1 -1
- package/dist/workers/client.worker.d.ts +1 -1
- package/dist/workers/client.worker.d.ts.map +1 -1
- package/dist/workers/client.worker.js +136 -110
- package/dist/workers/client.worker.js.map +1 -1
- package/dist/workers/library-build.worker.d.ts +0 -2
- package/dist/workers/library-build.worker.d.ts.map +1 -1
- package/dist/workers/library-build.worker.js +147 -70
- package/dist/workers/library-build.worker.js.map +1 -1
- package/dist/workers/server-build.worker.d.ts.map +1 -1
- package/dist/workers/server-build.worker.js +30 -57
- package/dist/workers/server-build.worker.js.map +1 -1
- package/dist/workers/server-esbuild-context.d.ts +7 -0
- package/dist/workers/server-esbuild-context.d.ts.map +1 -1
- package/dist/workers/server-esbuild-context.js +11 -2
- package/dist/workers/server-esbuild-context.js.map +1 -1
- package/package.json +5 -4
- package/src/angular/angular-compiler.ts +0 -502
- package/src/angular/hmr-candidates.ts +295 -0
- package/src/angular/ngtsc-build-core.ts +125 -92
- package/src/angular/vite-angular-plugin.ts +71 -65
- package/src/angular/web-worker-transformer.ts +117 -0
- package/src/capacitor/capacitor.ts +6 -4
- package/src/commands/check.ts +17 -76
- package/src/commands/publish/deployment-phase.ts +11 -7
- package/src/commands/publish/npm-publisher.ts +1 -1
- package/src/commands/publish/publish-command.ts +1 -1
- package/src/commands/publish/version-upgrade.ts +1 -1
- package/src/commands/replace-deps.ts +3 -1
- package/src/deps/replace-deps/collect-deps.ts +4 -2
- package/src/deps/replace-deps/replace-deps.ts +114 -66
- package/src/electron/electron.ts +7 -7
- package/src/engines/BaseEngine.ts +2 -6
- package/src/engines/EsbuildClientEngine.ts +16 -10
- package/src/engines/NgtscEngine.ts +7 -7
- package/src/engines/TscEngine.ts +0 -2
- package/src/engines/types.ts +2 -0
- package/src/esbuild/esbuild-angular-compiler-plugin.ts +647 -0
- package/src/esbuild/esbuild-client-config.ts +57 -41
- package/src/esbuild/esbuild-tsc-plugin.ts +33 -23
- package/src/esbuild/file-reference-tracker.ts +61 -0
- package/src/esbuild/lmdb-cache-store.ts +46 -0
- package/src/esbuild/load-result-cache.ts +85 -0
- package/src/index.ts +5 -0
- package/src/lint/lint-core.ts +7 -7
- package/src/orchestrators/BaseOrchestrator.ts +2 -2
- package/src/orchestrators/BuildOrchestrator.ts +5 -24
- package/src/orchestrators/DevOrchestrator.ts +5 -5
- package/src/orchestrators/WatchOrchestrator.ts +6 -6
- package/src/runtime/ResultCollector.ts +1 -0
- package/src/runtime/engine-watch-events.ts +3 -0
- package/src/runtime/rebuild-manager.ts +1 -1
- package/src/runtime/worker-utils.ts +1 -1
- package/src/sd-cli-entry.ts +5 -3
- package/src/sd-cli.ts +4 -4
- package/src/ts-compiler/SdTsCompiler.ts +815 -0
- package/src/ts-compiler/sd-ts-compiler-options.ts +46 -0
- package/src/ts-compiler/sd-ts-compiler-result.ts +34 -0
- package/src/utils/copy-public.ts +9 -6
- package/src/utils/diagnostic-utils.ts +8 -9
- package/src/utils/output-utils.ts +38 -8
- package/src/workers/client.worker.ts +160 -126
- package/src/workers/library-build.worker.ts +187 -75
- package/src/workers/server-build.worker.ts +31 -61
- package/src/workers/server-esbuild-context.ts +14 -2
- package/tests/angular/fixtures/packages/basic-app/dist/styles.css +3 -0
- package/tests/angular/fixtures/packages/basic-app/scss/styles.scss +5 -0
- package/tests/angular/vite-angular-plugin-sdtscompiler.verify.md +13 -0
- package/tests/angular/web-worker-transformer.spec.ts +154 -0
- package/tests/capacitor/capacitor-build.spec.ts +1 -1
- package/tests/capacitor/capacitor-icon.spec.ts +1 -1
- package/tests/capacitor/capacitor-init.spec.ts +1 -1
- package/tests/commands/check.spec.ts +90 -104
- package/tests/commands/publish.spec.ts +12 -4
- package/tests/commands/slice3-severity-cleanup.verify.md +12 -0
- package/tests/deps/replace-deps/collect-deps.acc.spec.ts +62 -0
- package/tests/deps/replace-deps/collect-deps.spec.ts +49 -0
- package/tests/deps/replace-deps/replace-deps-filter.spec.ts +103 -0
- package/tests/deps/replace-deps/replace-deps-setup.acc.spec.ts +156 -0
- package/tests/electron/electron.spec.ts +4 -1
- package/tests/engines/engine-adapter-isolation.spec.ts +5 -6
- package/tests/engines/engine-duplicate-output-removal.verify.md +10 -0
- package/tests/engines/esbuild-client-engine.acc.spec.ts +79 -0
- package/tests/engines/esbuild-client-engine.spec.ts +73 -3
- package/tests/esbuild/esbuild-angular-compiler-plugin-hmr.verify.md +23 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin-onload.verify.md +21 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin-onstart-extraction.verify.md +16 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin-sdtscompiler.verify.md +15 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin-stylesheet.verify.md +31 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin-worker.verify.md +31 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin.spec.ts +397 -0
- package/tests/esbuild/esbuild-angular-compiler-plugin.verify.md +21 -0
- package/tests/esbuild/esbuild-tsc-plugin-imports.verify.md +13 -0
- package/tests/esbuild/esbuild-tsc-plugin.acc.spec.ts +56 -111
- package/tests/esbuild/esbuild-tsc-plugin.spec.ts +116 -52
- package/tests/esbuild/file-reference-tracker.spec.ts +99 -0
- package/tests/esbuild/lmdb-cache-store.spec.ts +58 -0
- package/tests/esbuild/load-result-cache.acc.spec.ts +55 -0
- package/tests/esbuild/load-result-cache.spec.ts +133 -0
- package/tests/orchestrators/build-orchestrator.spec.ts +4 -3
- package/tests/orchestrators/dev-orchestrator.spec.ts +5 -5
- package/tests/orchestrators/slice1-stdout-to-consola.verify.md +10 -0
- package/tests/orchestrators/typecheck-orchestrator.spec.ts +1 -1
- package/tests/orchestrators/watch-orchestrator.spec.ts +7 -7
- package/tests/runtime/result-collector.spec.ts +64 -0
- package/tests/sd-cli-entry.spec.ts +3 -4
- package/tests/sd-cli-log-tag.verify.md +11 -0
- package/tests/ts-compiler/SdTsCompiler-affected-files.verify.md +8 -0
- package/tests/ts-compiler/SdTsCompiler-diagnostics.verify.md +12 -0
- package/tests/ts-compiler/SdTsCompiler-emit.verify.md +9 -0
- package/tests/ts-compiler/SdTsCompiler.acc.spec.ts +603 -0
- package/tests/ts-compiler/SdTsCompiler.spec.ts +265 -0
- package/tests/ts-compiler/SdTsCompiler.verify.md +41 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/.cache/typecheck-browser.tsbuildinfo +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/.cache/typecheck-node.tsbuildinfo +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/.cache/typecheck.tsbuildinfo +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/index.d.ts +2 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/index.d.ts.map +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/index.js +4 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/index.js.map +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/util.d.ts +2 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/util.d.ts.map +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/util.js +4 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/dist/util.js.map +1 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/src/index.ts +3 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/src/util.ts +3 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/tests/sample.test-file.ts +3 -0
- package/tests/ts-compiler/fixtures/non-angular-pkg/tsconfig.json +12 -0
- package/tests/ts-compiler/scss-lint-integration.verify.md +14 -0
- package/tests/utils/angular-build.spec.ts +1 -1
- package/tests/utils/copy-public-outdir.verify.md +8 -0
- package/tests/utils/copy-public.acc.spec.ts +52 -0
- package/tests/utils/copy-public.spec.ts +56 -0
- package/tests/utils/diagnostic-utils.spec.ts +24 -15
- package/tests/utils/engine-watch-events.acc.spec.ts +59 -0
- package/tests/utils/engine-watch-events.spec.ts +58 -0
- package/tests/utils/esbuild-client-config-integration.verify.md +9 -0
- package/tests/utils/esbuild-client-config.acc.spec.ts +45 -61
- package/tests/utils/esbuild-client-config.spec.ts +70 -52
- package/tests/utils/ngtsc-build-core-write-emit.spec.ts +12 -12
- package/tests/utils/ngtsc-build-core.spec.ts +1 -44
- package/tests/utils/output-utils.spec.ts +133 -13
- package/tests/utils/replace-deps-watch.acc.spec.ts +7 -1
- package/tests/utils/replace-deps-watch.spec.ts +57 -1
- package/tests/utils/worker-utils.spec.ts +8 -2
- package/tests/workers/client-worker-initial-build-error.verify.md +2 -3
- package/tests/workers/client-worker-initial-build-warnings.verify.md +7 -0
- package/tests/workers/client-worker-refactor.verify.md +22 -0
- package/tests/workers/client-worker-ts-cache-invalidation.verify.md +12 -0
- package/tests/workers/client-worker.acc.spec.ts +6 -3
- package/tests/workers/library-build-lint.spec.ts +40 -45
- package/tests/workers/library-build-worker.spec.ts +294 -40
- package/tests/workers/server-build-lint.spec.ts +59 -45
- package/tests/workers/server-build-worker.spec.ts +63 -24
- package/tests/workers/server-esbuild-context.acc.spec.ts +2 -0
- package/tests/workers/server-esbuild-context.spec.ts +2 -0
- package/tests/workers/server-runtime-worker.spec.ts +1 -1
- package/tests/workers/shared-worker-lifecycle.acc.spec.ts +1 -1
- package/dist/angular/angular-build-pipeline.d.ts +0 -97
- package/dist/angular/angular-build-pipeline.d.ts.map +0 -1
- package/dist/angular/angular-build-pipeline.js +0 -285
- package/dist/angular/angular-build-pipeline.js.map +0 -1
- package/dist/utils/tsc-build.d.ts +0 -51
- package/dist/utils/tsc-build.d.ts.map +0 -1
- package/dist/utils/tsc-build.js +0 -156
- package/dist/utils/tsc-build.js.map +0 -1
- package/dist/workers/ngtsc-build.worker.d.ts +0 -23
- package/dist/workers/ngtsc-build.worker.d.ts.map +0 -1
- package/dist/workers/ngtsc-build.worker.js +0 -267
- package/dist/workers/ngtsc-build.worker.js.map +0 -1
- package/src/angular/angular-build-pipeline.ts +0 -406
- package/src/utils/tsc-build.ts +0 -226
- package/src/workers/ngtsc-build.worker.ts +0 -351
- package/tests/angular/angular-build-pipeline.spec.ts +0 -247
- package/tests/angular/angular-compiler-aot.acc.spec.ts +0 -68
- package/tests/angular/angular-compiler-aot.spec.ts +0 -80
- package/tests/utils/angular-compiler-emit.spec.ts +0 -666
- package/tests/utils/angular-compiler.spec.ts +0 -707
- package/tests/utils/tsc-build.spec.ts +0 -527
- package/tests/workers/ngtsc-build-lint.spec.ts +0 -141
- package/tests/workers/ngtsc-build-worker.spec.ts +0 -199
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import os from "os";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { collectDeps } from "../../../src/deps/replace-deps/collect-deps";
|
|
6
|
+
import { pathx } from "@simplysm/core-node";
|
|
7
|
+
|
|
8
|
+
describe("collectDeps", () => {
|
|
9
|
+
let tmpDir: string;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
tmpDir = pathx.posix(fs.mkdtempSync(path.join(os.tmpdir(), "sd-cli-test-")));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function createPkg(relDir: string, name: string, deps: Record<string, string> = {}): void {
|
|
20
|
+
const dir = pathx.posix(path.join(tmpDir, relDir));
|
|
21
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
22
|
+
fs.writeFileSync(
|
|
23
|
+
pathx.posix(path.join(dir, "package.json")),
|
|
24
|
+
JSON.stringify({ name, dependencies: deps }),
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
it("tests/ ํจํค์ง๋ง ์์กดํ๋ฉด workspaceDeps๊ฐ ๋น ๋ฐฐ์ด์ด๋ค", () => {
|
|
29
|
+
createPkg("tests/orm", "@test/orm");
|
|
30
|
+
createPkg("tests/service", "@test/service");
|
|
31
|
+
createPkg("packages/my-lib", "@test/my-lib", {
|
|
32
|
+
"@test/orm": "workspace:*",
|
|
33
|
+
"@test/service": "workspace:*",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const result = collectDeps(pathx.posix(path.join(tmpDir, "packages/my-lib")), tmpDir);
|
|
37
|
+
|
|
38
|
+
expect(result.workspaceDeps).toEqual([]);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("์์กด์ฑ์ด ์๋ ํจํค์ง๋ ๋น ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํ๋ค", () => {
|
|
42
|
+
createPkg("packages/my-lib", "@test/my-lib");
|
|
43
|
+
|
|
44
|
+
const result = collectDeps(pathx.posix(path.join(tmpDir, "packages/my-lib")), tmpDir);
|
|
45
|
+
|
|
46
|
+
expect(result.workspaceDeps).toEqual([]);
|
|
47
|
+
expect(result.replaceDeps).toEqual([]);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import { pathx } from "@simplysm/core-node";
|
|
6
|
+
import {
|
|
7
|
+
createCopyFilter,
|
|
8
|
+
loadFilesField,
|
|
9
|
+
NPM_DEFAULT_FILE_PATTERN,
|
|
10
|
+
} from "../../../src/deps/replace-deps/replace-deps";
|
|
11
|
+
|
|
12
|
+
describe("NPM_DEFAULT_FILE_PATTERN", () => {
|
|
13
|
+
it("README ๋ณํ์ ๋งค์นญํ๋ค", () => {
|
|
14
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("README")).toBe(true);
|
|
15
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("README.md")).toBe(true);
|
|
16
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("readme.txt")).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("LICENSE/LICENCE ๋ณํ์ ๋งค์นญํ๋ค", () => {
|
|
20
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("LICENSE")).toBe(true);
|
|
21
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("LICENCE")).toBe(true);
|
|
22
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("license.md")).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("CHANGELOG/HISTORY ๋ณํ์ ๋งค์นญํ๋ค", () => {
|
|
26
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("CHANGELOG")).toBe(true);
|
|
27
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("CHANGELOG.md")).toBe(true);
|
|
28
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("HISTORY.md")).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("๊ด๋ จ์๋ ํ์ผ๋ช
์ ๋งค์นญํ์ง ์๋๋ค", () => {
|
|
32
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("tsconfig.json")).toBe(false);
|
|
33
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("CLAUDE.md")).toBe(false);
|
|
34
|
+
expect(NPM_DEFAULT_FILE_PATTERN.test("package.json")).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("createCopyFilter", () => {
|
|
39
|
+
const sourcePath = "/source/pkg";
|
|
40
|
+
|
|
41
|
+
it("allowedNames์ ํฌํจ๋ ์ฒซ ๋ฒ์งธ ์ธ๊ทธ๋จผํธ๋ ํ์ฉํ๋ค", () => {
|
|
42
|
+
const filter = createCopyFilter(sourcePath, new Set(["dist", "src"]));
|
|
43
|
+
|
|
44
|
+
expect(filter(path.join(sourcePath, "dist"))).toBe(true);
|
|
45
|
+
expect(filter(path.join(sourcePath, "src"))).toBe(true);
|
|
46
|
+
expect(filter(path.join(sourcePath, "dist", "index.js"))).toBe(true);
|
|
47
|
+
expect(filter(path.join(sourcePath, "src", "utils", "helper.ts"))).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("allowedNames์ ์๋ ํญ๋ชฉ์ ๊ฑฐ๋ถํ๋ค", () => {
|
|
51
|
+
const filter = createCopyFilter(sourcePath, new Set(["dist", "src"]));
|
|
52
|
+
|
|
53
|
+
expect(filter(path.join(sourcePath, "tsconfig.json"))).toBe(false);
|
|
54
|
+
expect(filter(path.join(sourcePath, "CLAUDE.md"))).toBe(false);
|
|
55
|
+
expect(filter(path.join(sourcePath, "node_modules"))).toBe(false);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("package.json์ ํญ์ ๊ฑฐ๋ถํ๋ค", () => {
|
|
59
|
+
const filter = createCopyFilter(sourcePath, new Set(["dist", "src"]));
|
|
60
|
+
|
|
61
|
+
expect(filter(path.join(sourcePath, "package.json"))).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("npm ๊ธฐ๋ณธ ํ์ผ ํจํด์ allowedNames์ ์์ด๋ ํ์ฉํ๋ค", () => {
|
|
65
|
+
const filter = createCopyFilter(sourcePath, new Set(["dist"]));
|
|
66
|
+
|
|
67
|
+
expect(filter(path.join(sourcePath, "README.md"))).toBe(true);
|
|
68
|
+
expect(filter(path.join(sourcePath, "LICENSE"))).toBe(true);
|
|
69
|
+
expect(filter(path.join(sourcePath, "CHANGELOG.md"))).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe("loadFilesField", () => {
|
|
74
|
+
let tmpDir: string;
|
|
75
|
+
|
|
76
|
+
beforeEach(async () => {
|
|
77
|
+
tmpDir = pathx.posix(await fs.promises.mkdtemp(path.join(os.tmpdir(), "sd-load-files-")));
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
afterEach(async () => {
|
|
81
|
+
await fs.promises.rm(tmpDir, { recursive: true, force: true });
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("files ํ๋๊ฐ ์์ผ๋ฉด ๋ฌธ์์ด ๋ฐฐ์ด์ ๋ฐํํ๋ค", async () => {
|
|
85
|
+
await fs.promises.writeFile(
|
|
86
|
+
pathx.posix(path.join(tmpDir, "package.json")),
|
|
87
|
+
JSON.stringify({ name: "test", files: ["dist", "src"] }),
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const result = await loadFilesField(tmpDir);
|
|
91
|
+
expect(result).toEqual(["dist", "src"]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("files ํ๋๊ฐ ์์ผ๋ฉด undefined๋ฅผ ๋ฐํํ๋ค", async () => {
|
|
95
|
+
await fs.promises.writeFile(
|
|
96
|
+
pathx.posix(path.join(tmpDir, "package.json")),
|
|
97
|
+
JSON.stringify({ name: "test" }),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const result = await loadFilesField(tmpDir);
|
|
101
|
+
expect(result).toBeUndefined();
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import { setupReplaceDeps } from "../../../src/deps/replace-deps/replace-deps";
|
|
6
|
+
import { pathx } from "@simplysm/core-node";
|
|
7
|
+
|
|
8
|
+
describe("setupReplaceDeps ํ์ดํธ๋ฆฌ์คํธ ๋ณต์ฌ", () => {
|
|
9
|
+
let tmpDir: string;
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
tmpDir = pathx.posix(await fs.promises.mkdtemp(path.join(os.tmpdir(), "sd-replace-deps-")));
|
|
13
|
+
|
|
14
|
+
// pnpm-workspace.yaml
|
|
15
|
+
const projectRoot = pathx.posix(path.join(tmpDir, "project"));
|
|
16
|
+
await fs.promises.mkdir(projectRoot, { recursive: true });
|
|
17
|
+
await fs.promises.writeFile(
|
|
18
|
+
pathx.posix(path.join(projectRoot, "pnpm-workspace.yaml")),
|
|
19
|
+
"packages:\n",
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// ํ๊ฒ (node_modules์ ๊ธฐ์กด ํจํค์ง)
|
|
23
|
+
const targetPkgDir = pathx.posix(
|
|
24
|
+
path.join(projectRoot, "node_modules", "@test", "pkg"),
|
|
25
|
+
);
|
|
26
|
+
await fs.promises.mkdir(targetPkgDir, { recursive: true });
|
|
27
|
+
await fs.promises.writeFile(
|
|
28
|
+
pathx.posix(path.join(targetPkgDir, "package.json")),
|
|
29
|
+
JSON.stringify({ name: "@test/pkg", version: "2.0.0" }),
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
afterEach(async () => {
|
|
34
|
+
await fs.promises.rm(tmpDir, { recursive: true, force: true });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* ์์ค ํจํค์ง๋ฅผ ์์ฑํ๋ ํฌํผ
|
|
39
|
+
*/
|
|
40
|
+
async function createSourcePkg(opts: {
|
|
41
|
+
files?: string[];
|
|
42
|
+
extraFiles?: Record<string, string>;
|
|
43
|
+
}): Promise<string> {
|
|
44
|
+
const sourcePath = pathx.posix(path.join(tmpDir, "source-pkg"));
|
|
45
|
+
await fs.promises.mkdir(sourcePath, { recursive: true });
|
|
46
|
+
|
|
47
|
+
// package.json
|
|
48
|
+
const pkgJson: Record<string, unknown> = { name: "@test/pkg", version: "1.0.0" };
|
|
49
|
+
if (opts.files != null) {
|
|
50
|
+
pkgJson["files"] = opts.files;
|
|
51
|
+
}
|
|
52
|
+
await fs.promises.writeFile(
|
|
53
|
+
pathx.posix(path.join(sourcePath, "package.json")),
|
|
54
|
+
JSON.stringify(pkgJson),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// ๊ธฐ๋ณธ ๋๋ ํ ๋ฆฌ/ํ์ผ ์์ฑ
|
|
58
|
+
await fs.promises.mkdir(pathx.posix(path.join(sourcePath, "dist")), { recursive: true });
|
|
59
|
+
await fs.promises.writeFile(
|
|
60
|
+
pathx.posix(path.join(sourcePath, "dist", "index.js")),
|
|
61
|
+
"module.exports = {};",
|
|
62
|
+
);
|
|
63
|
+
await fs.promises.mkdir(pathx.posix(path.join(sourcePath, "src")), { recursive: true });
|
|
64
|
+
await fs.promises.writeFile(
|
|
65
|
+
pathx.posix(path.join(sourcePath, "src", "index.ts")),
|
|
66
|
+
"export const v = 1;",
|
|
67
|
+
);
|
|
68
|
+
// files์ ์๋ ํ์ผ๋ค
|
|
69
|
+
await fs.promises.writeFile(
|
|
70
|
+
pathx.posix(path.join(sourcePath, "tsconfig.json")),
|
|
71
|
+
"{}",
|
|
72
|
+
);
|
|
73
|
+
await fs.promises.writeFile(
|
|
74
|
+
pathx.posix(path.join(sourcePath, "CLAUDE.md")),
|
|
75
|
+
"# CLAUDE",
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// ์ถ๊ฐ ํ์ผ
|
|
79
|
+
if (opts.extraFiles != null) {
|
|
80
|
+
for (const [relPath, content] of Object.entries(opts.extraFiles)) {
|
|
81
|
+
const fullPath = pathx.posix(path.join(sourcePath, relPath));
|
|
82
|
+
await fs.promises.mkdir(pathx.posix(path.dirname(fullPath)), { recursive: true });
|
|
83
|
+
await fs.promises.writeFile(fullPath, content);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return sourcePath;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
it("files์ ํฌํจ๋ ๋๋ ํ ๋ฆฌ๊ฐ ๋ณต์ฌ๋๊ณ , files์ ์๋ ํ์ผ์ ๋ณต์ฌ๋์ง ์๋๋ค", async () => {
|
|
91
|
+
const sourcePath = await createSourcePkg({ files: ["dist", "src"] });
|
|
92
|
+
const projectRoot = pathx.posix(path.join(tmpDir, "project"));
|
|
93
|
+
const targetPkgDir = pathx.posix(
|
|
94
|
+
path.join(projectRoot, "node_modules", "@test", "pkg"),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
await setupReplaceDeps(projectRoot, { "@test/pkg": sourcePath });
|
|
98
|
+
|
|
99
|
+
// files์ ํฌํจ๋ ๋๋ ํ ๋ฆฌ๊ฐ ๋ณต์ฌ๋จ
|
|
100
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "dist", "index.js")))).toBe(true);
|
|
101
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "src", "index.ts")))).toBe(true);
|
|
102
|
+
|
|
103
|
+
// files์ ์๋ ํ์ผ์ ๋ณต์ฌ๋์ง ์์
|
|
104
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "tsconfig.json")))).toBe(false);
|
|
105
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "CLAUDE.md")))).toBe(false);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("npm ๊ธฐ๋ณธ ํฌํจ ํ์ผ(README, LICENSE)์ files์ ์์ด๋ ๋ณต์ฌ๋๋ค", async () => {
|
|
109
|
+
const sourcePath = await createSourcePkg({
|
|
110
|
+
files: ["dist", "src"],
|
|
111
|
+
extraFiles: {
|
|
112
|
+
"README.md": "# README",
|
|
113
|
+
"LICENSE": "MIT License",
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const projectRoot = pathx.posix(path.join(tmpDir, "project"));
|
|
117
|
+
const targetPkgDir = pathx.posix(
|
|
118
|
+
path.join(projectRoot, "node_modules", "@test", "pkg"),
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
await setupReplaceDeps(projectRoot, { "@test/pkg": sourcePath });
|
|
122
|
+
|
|
123
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "README.md")))).toBe(true);
|
|
124
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "LICENSE")))).toBe(true);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("package.json์ ๋ณต์ฌ๋์ง ์๊ณ ๋์์ ๊ธฐ์กด package.json์ด ๋ณด์กด๋๋ค", async () => {
|
|
128
|
+
const sourcePath = await createSourcePkg({ files: ["dist", "src"] });
|
|
129
|
+
const projectRoot = pathx.posix(path.join(tmpDir, "project"));
|
|
130
|
+
const targetPkgDir = pathx.posix(
|
|
131
|
+
path.join(projectRoot, "node_modules", "@test", "pkg"),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
await setupReplaceDeps(projectRoot, { "@test/pkg": sourcePath });
|
|
135
|
+
|
|
136
|
+
// ๋์์ ๊ธฐ์กด package.json์ด ๋ณด์กด๋จ (์์ค์ ๊ฒ์ผ๋ก ๋ฎ์ด์์์ง์ง ์์)
|
|
137
|
+
const targetPkgJson = JSON.parse(
|
|
138
|
+
fs.readFileSync(pathx.posix(path.join(targetPkgDir, "package.json")), "utf-8"),
|
|
139
|
+
);
|
|
140
|
+
expect(targetPkgJson.version).toBe("2.0.0");
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("files ํ๋๊ฐ ์๋ ํจํค์ง๋ ๊ฑด๋๋ฐ๊ณ ๋ณต์ฌํ์ง ์๋๋ค", async () => {
|
|
144
|
+
const sourcePath = await createSourcePkg({ files: undefined });
|
|
145
|
+
const projectRoot = pathx.posix(path.join(tmpDir, "project"));
|
|
146
|
+
const targetPkgDir = pathx.posix(
|
|
147
|
+
path.join(projectRoot, "node_modules", "@test", "pkg"),
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
await setupReplaceDeps(projectRoot, { "@test/pkg": sourcePath });
|
|
151
|
+
|
|
152
|
+
// ๋ณต์ฌ๊ฐ ์ํ๋์ง ์์
|
|
153
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "dist")))).toBe(false);
|
|
154
|
+
expect(fs.existsSync(pathx.posix(path.join(targetPkgDir, "src")))).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
@@ -70,7 +70,10 @@ vi.mock("esbuild", () => ({
|
|
|
70
70
|
const mockLoggerDebug = vi.fn();
|
|
71
71
|
const mockLoggerWarn = vi.fn();
|
|
72
72
|
const mockLoggerInfo = vi.fn();
|
|
73
|
-
vi.
|
|
73
|
+
const mockLoggerStart = vi.fn();
|
|
74
|
+
const mockLoggerSuccess = vi.fn();
|
|
75
|
+
const mockLoggerError = vi.fn();
|
|
76
|
+
vi.spyOn(consola, "withTag").mockReturnValue({ debug: mockLoggerDebug, warn: mockLoggerWarn, info: mockLoggerInfo, start: mockLoggerStart, success: mockLoggerSuccess, error: mockLoggerError } as any);
|
|
74
77
|
|
|
75
78
|
//#endregion
|
|
76
79
|
|
|
@@ -49,7 +49,6 @@ describe("NgtscEngine adapter isolation", () => {
|
|
|
49
49
|
|
|
50
50
|
const filesToCheck = [
|
|
51
51
|
path.join(sdCliSrc, "engines", "NgtscEngine.ts"),
|
|
52
|
-
path.join(sdCliSrc, "workers", "ngtsc-build.worker.ts"),
|
|
53
52
|
path.join(sdCliSrc, "angular", "ngtsc-build-core.ts"),
|
|
54
53
|
path.join(sdCliSrc, "utils", "output-path-rewriter.ts"),
|
|
55
54
|
];
|
|
@@ -68,13 +67,13 @@ describe("NgtscEngine adapter isolation", () => {
|
|
|
68
67
|
|
|
69
68
|
it("all Angular API access goes through angular-compiler.ts adapter", () => {
|
|
70
69
|
|
|
71
|
-
// Angular API ์ ๊ทผ์
|
|
72
|
-
const
|
|
70
|
+
// Angular API ์ ๊ทผ์ ngtsc-build-core.ts โ angular-compiler.ts ๋๋ SdTsCompiler โ angular-compiler.ts๋ก ์ด๋ฃจ์ด์ง๋ค
|
|
71
|
+
const compilerFile = path.resolve(
|
|
73
72
|
import.meta.dirname,
|
|
74
|
-
"../../src/
|
|
73
|
+
"../../src/ts-compiler/SdTsCompiler.ts",
|
|
75
74
|
);
|
|
76
|
-
const content = fs.readFileSync(
|
|
75
|
+
const content = fs.readFileSync(compilerFile, "utf-8");
|
|
77
76
|
|
|
78
|
-
expect(content).toContain("
|
|
77
|
+
expect(content).toContain("angular-compiler");
|
|
79
78
|
});
|
|
80
79
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# ์์ง๋ณ ์ค๋ณต ์ถ๋ ฅ ์ ๊ฑฐ โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
- [x] esbuild-client-config.ts logLevel์ด ๋ชจ๋ ๋ชจ๋์์ "silent"์ธ์ง: `esbuild-client-config.ts:191` โ `logLevel: "silent"` ํ์ธ. ๊ธฐ์กด `isDev ? "warning" : "silent"` ์ผํญ ์ฐ์ฐ์ ์ ๊ฑฐ๋จ
|
|
6
|
+
- [x] EsbuildClientEngine์ ์ค๋ณต error ํธ๋ค๋ฌ๊ฐ ์๋์ง: `EsbuildClientEngine.ts:103-110` โ setupWatchEvents๋ง error ์ด๋ฒคํธ ์ฒ๋ฆฌ. ๊ธฐ์กด `worker.on("error", ...)` ํธ๋ค๋ฌ(logger.error ํธ์ถ) ์ ๊ฑฐ๋จ
|
|
7
|
+
- [x] EsbuildClientEngine ์ด๊ธฐ ๋น๋ ์คํจ ์ logger.error ๋ฏธํธ์ถ: `EsbuildClientEngine.ts:129-138` โ `!result.success` ๋ถ๊ธฐ์์ `resultCollector.add()`๋ง ํธ์ถ. logger.error ์ค ์ ๊ฑฐ๋จ
|
|
8
|
+
- [x] BaseEngine์ logger.warn() ๋ธ๋ก์ด ์๋์ง: `BaseEngine.ts:166-180` โ build ์ด๋ฒคํธ ํธ๋ค๋ฌ์ lint ๊ฒฐ๊ณผ ๋ณด๊ณ ๋ง ์กด์ฌ. warnings์ ๋ํ logger.warn() ๋ธ๋ก ์ ๊ฑฐ๋จ
|
|
9
|
+
- [x] BaseEngine startWatch ์คํจ ์ logger.debug ์ฌ์ฉ: `BaseEngine.ts:182-183` โ `logger.debug(...)` ํ์ธ. ๊ธฐ์กด `logger.error(...)` โ `logger.debug(...)` ๋ณ๊ฒฝ๋จ
|
|
10
|
+
- [x] BaseEngine lint ๊ฒฐ๊ณผ ๋ณด๊ณ ๋ก์ง ์ ์ง: `BaseEngine.ts:170-179` โ `event.lint != null` ์กฐ๊ฑด์ ResultCollector ๋ณด๊ณ ๋ก์ง์ด ๊ทธ๋๋ก ์ ์ง๋จ
|
|
@@ -163,6 +163,85 @@ describe("EsbuildClientEngine Acceptance", () => {
|
|
|
163
163
|
await engine.stop();
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
+
//#region Feature 2.1: ์ด๊ธฐ ๋น๋ warnings โ ResultCollector
|
|
167
|
+
|
|
168
|
+
it("์ด๊ธฐ ๋น๋ ์ฑ๊ณต + warnings โ ResultCollector์ success + warnings ์ ์ฅ", async () => {
|
|
169
|
+
const mockResultCollector = { add: vi.fn() };
|
|
170
|
+
|
|
171
|
+
mockWorker.startWatch.mockResolvedValue({
|
|
172
|
+
success: true,
|
|
173
|
+
warnings: ["unused variable"],
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const engine = new EsbuildClientEngine({
|
|
177
|
+
cwd: "/root",
|
|
178
|
+
pkg: createMockPkg(),
|
|
179
|
+
resultCollector: mockResultCollector as any,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
await engine.startWatch({ js: true, dts: false });
|
|
183
|
+
|
|
184
|
+
const warningReport = mockResultCollector.add.mock.calls.find(
|
|
185
|
+
(c: any[]) => c[0].type === "build" && c[0].warnings != null,
|
|
186
|
+
);
|
|
187
|
+
expect(warningReport).toBeDefined();
|
|
188
|
+
expect(warningReport![0].status).toBe("success");
|
|
189
|
+
expect(warningReport![0].warnings).toBe("unused variable");
|
|
190
|
+
|
|
191
|
+
await engine.stop();
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("์ด๊ธฐ ๋น๋ ์คํจ + warnings โ ResultCollector์ error + warnings ๋ชจ๋ ์ ์ฅ", async () => {
|
|
195
|
+
const mockResultCollector = { add: vi.fn() };
|
|
196
|
+
|
|
197
|
+
mockWorker.startWatch.mockResolvedValue({
|
|
198
|
+
success: false,
|
|
199
|
+
errors: ["type error"],
|
|
200
|
+
warnings: ["deprecated API"],
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const engine = new EsbuildClientEngine({
|
|
204
|
+
cwd: "/root",
|
|
205
|
+
pkg: createMockPkg(),
|
|
206
|
+
resultCollector: mockResultCollector as any,
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
await engine.startWatch({ js: true, dts: false });
|
|
210
|
+
|
|
211
|
+
const errorReport = mockResultCollector.add.mock.calls.find(
|
|
212
|
+
(c: any[]) => c[0].type === "build" && c[0].status === "error",
|
|
213
|
+
);
|
|
214
|
+
expect(errorReport).toBeDefined();
|
|
215
|
+
expect(errorReport![0].message).toContain("type error");
|
|
216
|
+
expect(errorReport![0].warnings).toBe("deprecated API");
|
|
217
|
+
|
|
218
|
+
await engine.stop();
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it("์ด๊ธฐ ๋น๋ ์ฑ๊ณต + warnings ์์ โ ResultCollector์ ์ถ๊ฐ ์ ์ฅ ์์", async () => {
|
|
222
|
+
const mockResultCollector = { add: vi.fn() };
|
|
223
|
+
|
|
224
|
+
mockWorker.startWatch.mockResolvedValue({ success: true });
|
|
225
|
+
|
|
226
|
+
const engine = new EsbuildClientEngine({
|
|
227
|
+
cwd: "/root",
|
|
228
|
+
pkg: createMockPkg(),
|
|
229
|
+
resultCollector: mockResultCollector as any,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
await engine.startWatch({ js: true, dts: false });
|
|
233
|
+
|
|
234
|
+
// setupWatchEvents์ ์ํ ํธ์ถ์ ์์ ์ ์์ผ๋, startWatch ๊ฒฐ๊ณผ์ ์ํ ์ถ๊ฐ ์ ์ฅ์ ์์
|
|
235
|
+
const warningReport = mockResultCollector.add.mock.calls.find(
|
|
236
|
+
(c: any[]) => c[0].warnings != null,
|
|
237
|
+
);
|
|
238
|
+
expect(warningReport).toBeUndefined();
|
|
239
|
+
|
|
240
|
+
await engine.stop();
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
//#endregion
|
|
244
|
+
|
|
166
245
|
// Scenario: ์์ง ์ค์ง
|
|
167
246
|
it("stop()์ผ๋ก worker๋ฅผ ์ข
๋ฃํ๊ณ .dev-port๋ฅผ ์ญ์ ํ๋ค", async () => {
|
|
168
247
|
// Given: dev watch ๋ชจ๋๊ฐ ์คํ ์ค์ด๋ค
|
|
@@ -271,7 +271,7 @@ describe("EsbuildClientEngine", () => {
|
|
|
271
271
|
await engine.stop();
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
it("์ด๊ธฐ ๋น๋ ์คํจ ์
|
|
274
|
+
it("์ด๊ธฐ ๋น๋ ์คํจ ์ rejectํ์ง ์๊ณ ์ ์ ์๋ฃ๋๋ค", async () => {
|
|
275
275
|
mockWorker.startWatch.mockResolvedValue({
|
|
276
276
|
success: false,
|
|
277
277
|
errors: ["Module not found: @angular/core", "Syntax error in app.ts"],
|
|
@@ -280,8 +280,7 @@ describe("EsbuildClientEngine", () => {
|
|
|
280
280
|
const engine = new EsbuildClientEngine({ cwd: "/root", pkg: createMockPkg() });
|
|
281
281
|
await engine.startWatch({ js: true, dts: false });
|
|
282
282
|
|
|
283
|
-
// startWatch๊ฐ rejectํ์ง ์๊ณ ์ ์ ์๋ฃ๋๋์ง ํ์ธ
|
|
284
|
-
// ์๋ฌ ๋ก๊น
์ verify.md์์ ๊ฒ์ฆ
|
|
283
|
+
// startWatch๊ฐ rejectํ์ง ์๊ณ ์ ์ ์๋ฃ๋๋์ง ํ์ธ
|
|
285
284
|
expect(mockWorker.startWatch).toHaveBeenCalled();
|
|
286
285
|
|
|
287
286
|
await engine.stop();
|
|
@@ -297,6 +296,77 @@ describe("EsbuildClientEngine", () => {
|
|
|
297
296
|
await engine.stop();
|
|
298
297
|
});
|
|
299
298
|
|
|
299
|
+
it("์ด๊ธฐ ๋น๋ ๏ฟฝ๏ฟฝ๊ณต + warnings ์ ResultCollector์ success์ warnings๊ฐ ์ ์ฅ๋๋ค", async () => {
|
|
300
|
+
const mockResultCollector = { add: vi.fn(), get: vi.fn(), toMap: vi.fn() };
|
|
301
|
+
mockWorker.startWatch.mockResolvedValue({ success: true, warnings: ["w1", "w2"] });
|
|
302
|
+
|
|
303
|
+
const engine = new EsbuildClientEngine({
|
|
304
|
+
cwd: "/root",
|
|
305
|
+
pkg: createMockPkg(),
|
|
306
|
+
resultCollector: mockResultCollector as any,
|
|
307
|
+
});
|
|
308
|
+
await engine.startWatch({ js: true, dts: false });
|
|
309
|
+
|
|
310
|
+
const addCall = mockResultCollector.add.mock.calls.find(
|
|
311
|
+
(c: any[]) => c[0].warnings != null,
|
|
312
|
+
);
|
|
313
|
+
expect(addCall).toBeDefined();
|
|
314
|
+
expect(addCall![0]).toMatchObject({
|
|
315
|
+
status: "success",
|
|
316
|
+
warnings: "w1\nw2",
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
await engine.stop();
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("์ด๊ธฐ ๋น๋ ์คํจ + warnings ์ ResultCollector์ ์๋ฌ์ ๊ฒฝ๊ณ ๋ชจ๋ ์ ์ฅ๋๋ค", async () => {
|
|
323
|
+
const mockResultCollector = { add: vi.fn(), get: vi.fn(), toMap: vi.fn() };
|
|
324
|
+
mockWorker.startWatch.mockResolvedValue({
|
|
325
|
+
success: false,
|
|
326
|
+
errors: ["e1"],
|
|
327
|
+
warnings: ["w1"],
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const engine = new EsbuildClientEngine({
|
|
331
|
+
cwd: "/root",
|
|
332
|
+
pkg: createMockPkg(),
|
|
333
|
+
resultCollector: mockResultCollector as any,
|
|
334
|
+
});
|
|
335
|
+
await engine.startWatch({ js: true, dts: false });
|
|
336
|
+
|
|
337
|
+
const errorResult = mockResultCollector.add.mock.calls.find(
|
|
338
|
+
(c: any[]) => c[0].status === "error",
|
|
339
|
+
);
|
|
340
|
+
expect(errorResult).toBeDefined();
|
|
341
|
+
expect(errorResult![0]).toMatchObject({
|
|
342
|
+
status: "error",
|
|
343
|
+
message: "e1",
|
|
344
|
+
warnings: "w1",
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
await engine.stop();
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
it("์ด๊ธฐ ๋น๋ ์ฑ๊ณต + warnings ์์ ์ ResultCollector์ ์ถ๊ฐ ์ ์ฅํ์ง ์๋๋ค", async () => {
|
|
351
|
+
const mockResultCollector = { add: vi.fn(), get: vi.fn(), toMap: vi.fn() };
|
|
352
|
+
mockWorker.startWatch.mockResolvedValue({ success: true });
|
|
353
|
+
|
|
354
|
+
const engine = new EsbuildClientEngine({
|
|
355
|
+
cwd: "/root",
|
|
356
|
+
pkg: createMockPkg(),
|
|
357
|
+
resultCollector: mockResultCollector as any,
|
|
358
|
+
});
|
|
359
|
+
await engine.startWatch({ js: true, dts: false });
|
|
360
|
+
|
|
361
|
+
// setupWatchEvents์ ์ํ add ํธ์ถ๋ง ์๊ณ , ์ด๊ธฐ ๋น๋ ๊ฒฝ๋ก์ add ํธ์ถ์ ์์ด์ผ ํ๋ค
|
|
362
|
+
const directAdd = mockResultCollector.add.mock.calls.find(
|
|
363
|
+
(c: any[]) => c[0].target === "client" && (c[0].message != null || c[0].warnings != null),
|
|
364
|
+
);
|
|
365
|
+
expect(directAdd).toBeUndefined();
|
|
366
|
+
|
|
367
|
+
await engine.stop();
|
|
368
|
+
});
|
|
369
|
+
|
|
300
370
|
it("scopeRebuild ์ด๋ฒคํธ๋ฅผ ๊ตฌ๋
ํ์ง ์๋๋ค", async () => {
|
|
301
371
|
mockWorker.startWatch.mockResolvedValue({ success: true });
|
|
302
372
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# esbuild Angular Compiler Plugin โ ์ฆ๋ถ ๋น๋ + HMR โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
- [x] **์ฆ๋ถ ๋น๋ ์กฐ๊ฑด ํ๋จ**: `esbuild-angular-compiler-plugin.ts:200` โ `angularCompiler != null && sourceFileCache != null && sourceFileCache.modifiedFiles.size > 0`์ผ๋ก ์ฆ๋ถ ๋น๋ ๊ฐ์ง. ์ฒซ ๋น๋๋ `angularCompiler == null` ๊ฒฝ๋ก๋ก ์ง์
.
|
|
6
|
+
|
|
7
|
+
- [x] **staleSourceFiles ์บก์ฒ ํ์ด๋ฐ**: `esbuild-angular-compiler-plugin.ts:208-219` โ `invalidate()` ํธ์ถ ์ ์ ์ด์ `ts.Program`์์ stale source files๋ฅผ ์บก์ฒ. `invalidate` ํ์๋ ์บ์์์ ์ญ์ ๋๋ฏ๋ก ์์๊ฐ ์ค์.
|
|
8
|
+
|
|
9
|
+
- [x] **FileReferenceTracker.update โ sourceFileCache.invalidate**: `esbuild-angular-compiler-plugin.ts:221-224` โ `referencedFileTracker.update()`๋ก ์ ์ด์ ์์กด์ฑ ํ์ฅ ํ `invalidate()` ํธ์ถ. ํ์ฅ๋ ํ์ผ ์งํฉ์ด ์ ๋ฌ๋จ.
|
|
10
|
+
|
|
11
|
+
- [x] **stale additionalResults ์ ๊ฑฐ**: `esbuild-angular-compiler-plugin.ts:226-229` โ expandedModifiedFiles์ ๊ฐ ํ์ผ์ ๋ํด `additionalResults.delete()` ํธ์ถ.
|
|
12
|
+
|
|
13
|
+
- [x] **HMR ํ์ฑํ ์กฐ๊ฑด**: `esbuild-angular-compiler-plugin.ts:204-206` โ `templateUpdates != null && modifiedFiles.size <= 32`. 32๊ฐ ์ด๊ณผ ์ HMR ๊ฑด๋๋.
|
|
14
|
+
|
|
15
|
+
- [x] **collectHmrCandidates ํธ์ถ**: `esbuild-angular-compiler-plugin.ts:235-239` โ `ngtscProgram`๊ณผ `staleSourceFiles`๋ฅผ ์ ๋ฌ. `sourceFileCache.modifiedFiles`(ํ์ฅ ์ ์๋ณธ)์ ๋์์ผ๋ก ๋ถ์.
|
|
16
|
+
|
|
17
|
+
- [x] **emitHmrUpdateModule ํธ์ถ ๋ฐ null ์ฒ๋ฆฌ**: `esbuild-angular-compiler-plugin.ts:259-264` โ `emitHmrUpdateModule`์ด null/undefined ๋ฐํ ์ break (templateUpdates ์ ํ ์ค๋จ). NgCompiler API๋ฅผ Record ์บ์คํ
์ผ๋ก ์ ๊ทผ (ํ์
์ด private์ด๋ฏ๋ก).
|
|
18
|
+
|
|
19
|
+
- [x] **templateUpdates Map ์ ํ**: `esbuild-angular-compiler-plugin.ts:266` โ `pluginOptions.templateUpdates!.set(updateId, updateText)`๋ก ์ธ๋ถ Map์ ์ง์ ๊ธฐ๋ก.
|
|
20
|
+
|
|
21
|
+
- [x] **updateId ํ์**: `esbuild-angular-compiler-plugin.ts:256-258` โ `encodeURIComponent("{relativePath}@{className}")`. relativePath๋ hostDir ๊ธฐ์ค ์๋๊ฒฝ๋ก, ๋ฐฑ์ฌ๋์๋ฅผ ์ฌ๋์๋ก ๋ณํ.
|
|
22
|
+
|
|
23
|
+
- [x] **hmr-candidates.ts ๊ตฌ์กฐ**: `hmr-candidates.ts` โ `collectHmrCandidates` ํจ์๊ฐ ์๋ณธ `hmr-candidates.js`์ ๋ก์ง์ TypeScript๋ก ์ด์. `analyzeFileUpdates`, `analyzeMetaUpdates`, `equalRangeText` ํฌํผ ํฌํจ. SUPPORTED_FIELD_NAMES = {template, templateUrl, styles, styleUrl, stylesUrl}.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# onLoad ํ
โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
- [x] TS onLoad ํ
์ด `/\.[cm]?[jt]sx?$/` ํํฐ๋ก ๋ฑ๋ก๋๋ค: :517 `build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, ...)`
|
|
6
|
+
- [x] JS onLoad ํ
์ด `/\.[cm]?js$/` ํํฐ๋ก ๋ฑ๋ก๋๋ค: :584 `build.onLoad({ filter: /\.[cm]?js$/ }, ...)`
|
|
7
|
+
- [x] TS onLoad: shouldTsIgnoreJs=true์ด๊ณ JS ํ์ผ์ด๋ฉด undefined ๋ฐํ: :522 `if (shouldTsIgnoreJs && isJS) return undefined`
|
|
8
|
+
- [x] TS onLoad: ์บ์ ๋ฏธ์ค + hasCompilationErrors์ด๋ฉด `{ contents: '', loader: 'js' }` ๋ฐํ: :530
|
|
9
|
+
- [x] TS onLoad: ์บ์ ๋ฏธ์ค + allowJs + JS์ด๋ฉด undefined ๋ฐํ: :535
|
|
10
|
+
- [x] TS onLoad: ์บ์ ๋ฏธ์ค + Angular ๋ฐ์ฝ๋ ์ดํฐ ์์ผ๋ฉด warning ๋ฐํ: :541-547
|
|
11
|
+
- [x] TS onLoad: ์บ์ ๋ฏธ์ค + Angular ๋ฐ์ฝ๋ ์ดํฐ ์์ผ๋ฉด error ๋ฐํ: :550-552
|
|
12
|
+
- [x] TS onLoad: string ์บ์ + (useTypeScriptTranspilation || isJS)์ด๋ฉด transformData ํธ์ถ โ Uint8Array ์ฌ์บ์ฑ: :556-565
|
|
13
|
+
- [x] TS onLoad: Uint8Array ์บ์์ด๋ฉด ์ฌ๋ณํ ์์ด ๊ทธ๋๋ก ๋ฐํ: :556 ์กฐ๊ฑด `typeof contents === "string"` โ Uint8Array๋ ์กฐ๊ฑด ๋ถ์ผ์น๋ก ํต๊ณผ
|
|
14
|
+
- [x] TS onLoad: loader ๊ฒฐ์ โ (useTypeScriptTranspilation || isJS) โ 'js', .tsx โ 'tsx', ๊ธฐํ โ 'ts': :569-574
|
|
15
|
+
- [x] JS onLoad: createCachedLoad(loadResultCache, callback)์ผ๋ก ๋ํ: :586
|
|
16
|
+
- [x] JS onLoad: transformFile(request, false, sideEffects) ํธ์ถ: :589
|
|
17
|
+
- [x] hasSideEffects: advancedOptimizations=false โ undefined ๋ฐํ: :292-293
|
|
18
|
+
- [x] hasSideEffects: advancedOptimizations=true โ build.resolve() ํธ์ถ: :295-298
|
|
19
|
+
- [x] shouldTsIgnoreJs: onStart์์ !compilerOptions.allowJs๋ก ๊ฒฐ์ : :405
|
|
20
|
+
- [x] useTypeScriptTranspilation: !isolatedModules || !!sourceMap || !!inlineSourceMap์ผ๋ก ๊ฒฐ์ : :406-407
|
|
21
|
+
- [x] loadResultCache ์ต์
์ด AngularCompilerPluginOptions์ ์ถ๊ฐ๋จ: :33
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# onStart ์๋ธํจ์ ์ถ์ถ โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
- [x] **handleIncrementalBuild ํด๋ก์ ๋ณ์ ์ ๊ทผ**: `pluginOptions.sourceFileCache!` (314์ค), `pluginOptions.templateUpdates` (316์ค), `angularCompiler!` (322, 342, 345, 353์ค), `referencedFileTracker` (332์ค), `additionalResults` (339์ค), `cwd` (359์ค) โ ๋ชจ๋ setup ์ค์ฝํ(248-289์ค)์์ ์ ์ธ๋ ๋ณ์๋ฅผ ํ๋ผ๋ฏธํฐ ์์ด ์ง์ ์ ๊ทผ. ์๋ณธ์์ `errors`/`warnings`๋ฅผ ์ฌ์ฉํ์ง ์์ ํ๋ผ๋ฏธํฐ ๋ถํ์ (lint ์๋ฌ๋ก ํ์ธ, ์ ๊ฑฐ)
|
|
6
|
+
- [x] **handleFirstBuild ํด๋ก์ ๋ณ์ ์ ๊ทผ**: `pluginOptions` (378, 387-390์ค), `preserveSymlinks` (381์ค), `angularCompiler` (394์ค ๋์
), `shouldTsIgnoreJs` (398์ค ๋์
), `useTypeScriptTranspilation` (399์ค ๋์
) โ ๋ชจ๋ setup ์ค์ฝํ ๋ณ์ ์ง์ ์ ๊ทผ. ํ๋ผ๋ฏธํฐ ์์
|
|
7
|
+
- [x] **createWebWorkerProcessor ํด๋ก์ ๋ณ์ ์ ๊ทผ**: `build` (410์ค), `pluginOptions.sourcemap` (410์ค), `cwd` (422, 437์ค), `referencedFileTracker` (417, 435์ค), `additionalResults` (424, 428์ค) โ ๋ชจ๋ setup ์ค์ฝํ ๋ณ์ ์ง์ ์ ๊ทผ. `errors`/`warnings`๋ง ํ๋ผ๋ฏธํฐ๋ก ์ ๋ฌ
|
|
8
|
+
- [x] **onStart ๋ฐํ๊ฐ ๋์ผ**: onStart ์ฝ๋ฐฑ(456-526์ค)์ด ๋์ผํ `result` ๊ฐ์ฒด๋ฅผ ๋ฐํ (`errors`/`warnings` ํ ๋น ๋ก์ง 523-525์ค ์ ์ง). ์ถ์ถ ์ ๊ณผ ๋์ผํ `{errors, warnings}` ๊ตฌ์กฐ
|
|
9
|
+
- [x] **๋ด๋ถ ์ํ ๋ณํ ๋์ผ**: `handleIncrementalBuild`์์ `sourceFileCache.invalidate()` (328์ค), `additionalResults.delete()` (332์ค), `angularCompiler.update()` (335์ค), `templateUpdates.set()/clear()` (366, 370์ค) โ ์๋ณธ ์ฝ๋(316-383์ค)์ ๋์ผํ mutation ์์์ ๋ก์ง
|
|
10
|
+
- [x] **handleFirstBuild ์ํ ์ค์ **: `angularCompiler = compiler` (394์ค), `shouldTsIgnoreJs = !co.allowJs` (398์ค), `useTypeScriptTranspilation` (399-400์ค) โ ์๋ณธ ์ฝ๋(384-409์ค)์ ๋์ผ
|
|
11
|
+
- [x] **HMR ์คํจ ์ templateUpdates ์ด๊ธฐํ**: `updateText === null || updateText === undefined` ์กฐ๊ฑด(364์ค) โ `pluginOptions.templateUpdates!.clear()` (366์ค) + `break` (367์ค) โ ์๋ณธ๊ณผ ๋์ผ
|
|
12
|
+
- [x] **Worker ๋น๋ ์ฑ๊ณต ๊ฒฝ๋ก**: `additionalResults.set(fullWorkerPath, {outputFiles, metafile})` (428-431์ค) โ `workerCodeFile` ์ฐพ๊ธฐ (442-444์ค) โ ์๋ ๊ฒฝ๋ก ๋ฐํ (450-451์ค) โ ์๋ณธ๊ณผ ๋์ผ
|
|
13
|
+
- [x] **Worker ๋น๋ ์คํจ ๊ฒฝ๋ก**: `errors.push(...workerResult.errors)` (415์ค) โ `referencedFileTracker.add()` (417-423์ค) โ `additionalResults.set()` (424์ค) โ `return workerFile` (425์ค) โ ์๋ณธ๊ณผ ๋์ผ
|
|
14
|
+
- [x] **onStart ์ค์ผ์คํธ๋ ์ด์
์ถ์**: onStart ์ฝ๋ฐฑ์ด 456-526์ค = ~70์ค๋ก ์ถ์๋จ. ๊ตฌ์ฑ: stylesheetErrors ๋ฆฌ์
(4์ค) + ๋ถ๊ธฐ ํธ์ถ(5์ค) + processWebWorker ์์ฑ(1์ค) + emit(5์ค) + diagnostics(8์ค) + stylesheet ๋ธ๋ฆฟ์ง(12์ค) + ์๋ฌ ํธ๋ค๋ง(13์ค) + ๊ฒฐ๊ณผ ๋ฐํ(3์ค)
|
|
15
|
+
- [x] **onLoad/onEnd/onDispose ๋ฏธ๋ณ๊ฒฝ**: 528์ค ์ดํ์ onLoad(528-593์ค), onEnd(615-625์ค), onDispose(628-632์ค) ํธ๋ค๋ฌ๊ฐ ๋ณ๊ฒฝ๋์ง ์์
|
|
16
|
+
- [x] **๊ธฐ์กด ํ
์คํธ 26๊ฐ ํต๊ณผ**: vitest run ์คํ ๊ฒฐ๊ณผ 26 passed, 0 failed
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# esbuild-angular-compiler-plugin SdTsCompiler ์ ํ โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
- [x] SdTsCompiler ์ธ์คํด์ค ์์ฑ: `:402-414` โ `new SdTsCompiler({ pkgDir: path.dirname(pluginOptions.tsconfig), cwd, output: { js: true, dts: false }, sourceFileCache, transformStylesheet, externalStylesheets, compilerOptionsTransformer })` ์ฌ๋ฐ๋ฅด๊ฒ ๊ตฌ์ฑ
|
|
6
|
+
- [x] compileAsync ํธ์ถ: `:422-425` โ ์ฒซ ๋น๋ ์ `compileAsync(undefined, { additionalTransformers })`, ์ฆ๋ถ ๋น๋ ์ `compileAsync(expandedModifiedFiles, { additionalTransformers })`
|
|
7
|
+
- [x] emitResults โ typeScriptFileCache ๋งคํ: `:428-430` โ `compileResult.emitResults`๋ฅผ ์ํํ์ฌ `path.normalize(sourceFileName)` ํค๋ก ์ ์ฅ
|
|
8
|
+
- [x] diagnostics ๋ณํ: `:441-448` โ `convertSerializedDiagnosticToEsbuild(d, compileResult.program, cwd)` ์ฌ์ฉ, `d.category` ๊ธฐ๋ฐ ๋ถ๋ฅ
|
|
9
|
+
- [x] HMR staleSourceFiles ์บก์ฒ: `:380-388` โ `lastResult.program.getSourceFile(modifiedFile)` ์ฌ์ฉ, compileAsync ์ ์ ์ํ
|
|
10
|
+
- [x] HMR collectHmrCandidates: `:468-471` โ `compileResult.ngtscProgram` ์ฌ์ฉ, staleSourceFiles ์ ๋ฌ
|
|
11
|
+
- [x] SCSS bridging: `:451-462` โ `pluginOptions.stylesheetDependencies`/`stylesheetErrors` ์ง์ ์ฝ๊ธฐ (plugin-owned maps)
|
|
12
|
+
- [x] parseTsconfigFile ํจ์ ์ ๊ฑฐ ํ์ธ: ํ์ผ ์ ์ฒด์์ `parseTsconfigFile` ๋ฏธ๋ฐ๊ฒฌ
|
|
13
|
+
- [x] AngularCompiler import ์ ๊ฑฐ ํ์ธ: `:7` โ `import type { AngularSourceFileCache }` (type import๋ง ์ ์ง)
|
|
14
|
+
- [x] onDispose์์ ์ฐธ์กฐ ํด์ : `sdTsCompiler = undefined; lastResult = undefined;` ํ์ธ
|
|
15
|
+
- [x] onLoad ํ๋๊ทธ ๊ฒฐ์ : `:432-438` โ `lastResult == null` ์กฐ๊ฑด์ผ๋ก ์ฒซ ๋น๋์์๋ง ๊ฒฐ์
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Feature 2.1 ์ปดํฌ๋ํธ ์คํ์ผ์ํธ ๋ฒ๋ค๋ง โ LLM ๊ฒ์ฆ
|
|
2
|
+
|
|
3
|
+
## ๊ฒ์ฆ ํญ๋ชฉ
|
|
4
|
+
|
|
5
|
+
### AngularCompilerPluginOptions ์ธํฐํ์ด์ค ํ์ฅ
|
|
6
|
+
|
|
7
|
+
- [x] `stylesheetDependencies?: Map<string, Set<string>>` ํ๋ ์กด์ฌ: `esbuild-angular-compiler-plugin.ts:42` โ `Map<string, Set<string>>` ํ์
์ผ๋ก ์ ์ธ๋จ. `createClientTransformStylesheet`์ `scssDependencies` ํ์
๊ณผ ์ผ์น
|
|
8
|
+
- [x] `stylesheetErrors?: string[]` ํ๋ ์กด์ฌ: `esbuild-angular-compiler-plugin.ts:44` โ `string[]` ํ์
์ผ๋ก ์ ์ธ๋จ. `createClientTransformStylesheet`์ `scssErrors` ํ์
๊ณผ ์ผ์น
|
|
9
|
+
|
|
10
|
+
### onStart โ stylesheetErrors ๋ฆฌ์
|
|
11
|
+
|
|
12
|
+
- [x] ๋ฆฌ์
์ฝ๋๊ฐ try ๋ธ๋ก **์**์ ์์น: `esbuild-angular-compiler-plugin.ts:204-207` โ `if (pluginOptions.stylesheetErrors != null) { pluginOptions.stylesheetErrors.length = 0; }` ๊ฐ `try {` (`:209`) ์ด์ ์ ์์น. ์ปดํ์ผ ์คํจ ์์๋ ๋ฆฌ์
์ด ๋ณด์ฅ๋จ
|
|
13
|
+
- [x] null guard ์กด์ฌ: `pluginOptions.stylesheetErrors != null` ์ฒดํฌ๋ก ๋ฏธ์ ๊ณต ์ TypeError ๋ฐฉ์ง
|
|
14
|
+
|
|
15
|
+
### onStart โ stylesheetDependencies โ FileReferenceTracker ๋ธ๋ฆฟ์ง
|
|
16
|
+
|
|
17
|
+
- [x] ๋ธ๋ฆฟ์ง ์ฝ๋๊ฐ emit ํ, additionalResults ์์ง ์ ์ ์์น: `esbuild-angular-compiler-plugin.ts:315-320` โ `emitAffectedFiles` ๋ฃจํ(`:300-303`)์ `diagnostics ์์ง`(`:305-313`) ํ, `additionalResults ์๋ฌ ์์ง`(`:322`) ์ ์ ์์น
|
|
18
|
+
- [x] `referencedFileTracker.add(containingFile, deps)` ํธ์ถ: `:318` โ Map์ ๊ฐ ์ํธ๋ฆฌ์ ๋ํด `referencedFileTracker.add(containingFile, deps)` ํธ์ถ. `FileReferenceTracker.add()` ์๊ทธ๋์ฒ(`file-reference-tracker.ts:22`)์ ์ผ์น
|
|
19
|
+
- [x] null guard ์กด์ฌ: `:316` โ `pluginOptions.stylesheetDependencies != null` ์ฒดํฌ
|
|
20
|
+
|
|
21
|
+
### onStart โ stylesheetErrors โ esbuild errors ๋ณํ
|
|
22
|
+
|
|
23
|
+
- [x] ๋ณํ ์ฝ๋๊ฐ additionalResults ์๋ฌ ์์ง ํ์ ์์น: `esbuild-angular-compiler-plugin.ts:329-334` โ `additionalResults` ๋ฃจํ(`:322-327`) ํ์ ์์น
|
|
24
|
+
- [x] `{ text: errText, location: null }` ํ์์ผ๋ก push: `:332` โ `errors.push({ text: errText, location: null })`. esbuild `PartialMessage` ํ์์ ๋ถํฉ
|
|
25
|
+
- [x] null guard ์กด์ฌ: `:330` โ `pluginOptions.stylesheetErrors != null` ์ฒดํฌ
|
|
26
|
+
- [x] ๋น ๋ฐฐ์ด ์ push ์์: `for...of` ๋ฃจํ์ด๋ฏ๋ก ๋น ๋ฐฐ์ด์ผ ๋ ์์ฐ์ค๋ฝ๊ฒ 0ํ ์คํ
|
|
27
|
+
|
|
28
|
+
### ์ฆ๋ถ ๋น๋ ์ ์ด์ ์ฌ์ปดํ์ผ ๊ฒฝ๋ก
|
|
29
|
+
|
|
30
|
+
- [x] `referencedFileTracker.update(sourceFileCache.modifiedFiles)` ํธ์ถ: `:231-233` โ ์ฆ๋ถ ๋น๋ ๊ฒฝ๋ก์์ `referencedFileTracker.update()`๊ฐ ํธ์ถ๋จ. Feature 2.1์์ ๋ฑ๋กํ SCSS ์์กด์ฑ์ด ์ฌ๊ธฐ์ ์ ์ด์ ์ผ๋ก ํ์ฅ๋จ
|
|
31
|
+
- [x] ํ์ฅ๋ ํ์ผ์ด `sourceFileCache.invalidate()`์ ์ ๋ฌ๋จ: `:234` โ `sourceFileCache.invalidate(expandedModifiedFiles)`. SCSS ์์กด์ฑ ํ์ผ ๋ณ๊ฒฝ ์ ํด๋น ์คํ์ผ์ํธ ํ์ผ๋ ๋ฌดํจํ๋์ด Angular compiler๊ฐ ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ปดํ์ผ
|