@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,56 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
|
|
6
|
+
let tmpDir: string;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "copy-public-unit-"));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe("copyPublicFiles — outDir 매개변수", () => {
|
|
17
|
+
it("outDir 지정 시 public/ 파일이 outDir에 복사된다", async () => {
|
|
18
|
+
const pkgDir = path.join(tmpDir, "pkg");
|
|
19
|
+
const publicDir = path.join(pkgDir, "public");
|
|
20
|
+
fs.mkdirSync(publicDir, { recursive: true });
|
|
21
|
+
fs.writeFileSync(path.join(publicDir, "test.txt"), "hello");
|
|
22
|
+
|
|
23
|
+
const outDir = path.join(tmpDir, "custom-out");
|
|
24
|
+
|
|
25
|
+
const { copyPublicFiles } = await import("../../src/utils/copy-public");
|
|
26
|
+
await copyPublicFiles(pkgDir, false, outDir);
|
|
27
|
+
|
|
28
|
+
expect(fs.readFileSync(path.join(outDir, "test.txt"), "utf-8")).toBe("hello");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("outDir 지정 시 dist/에는 복사되지 않는다", async () => {
|
|
32
|
+
const pkgDir = path.join(tmpDir, "pkg2");
|
|
33
|
+
const publicDir = path.join(pkgDir, "public");
|
|
34
|
+
fs.mkdirSync(publicDir, { recursive: true });
|
|
35
|
+
fs.writeFileSync(path.join(publicDir, "test.txt"), "hello");
|
|
36
|
+
|
|
37
|
+
const outDir = path.join(tmpDir, "custom-out2");
|
|
38
|
+
|
|
39
|
+
const { copyPublicFiles } = await import("../../src/utils/copy-public");
|
|
40
|
+
await copyPublicFiles(pkgDir, false, outDir);
|
|
41
|
+
|
|
42
|
+
expect(fs.existsSync(path.join(pkgDir, "dist", "test.txt"))).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("public/ 디렉토리가 없으면 outDir만 생성하고 에러 없이 완료된다", async () => {
|
|
46
|
+
const pkgDir = path.join(tmpDir, "pkg-empty");
|
|
47
|
+
fs.mkdirSync(pkgDir, { recursive: true });
|
|
48
|
+
|
|
49
|
+
const outDir = path.join(tmpDir, "custom-out-empty");
|
|
50
|
+
|
|
51
|
+
const { copyPublicFiles } = await import("../../src/utils/copy-public");
|
|
52
|
+
await copyPublicFiles(pkgDir, false, outDir);
|
|
53
|
+
|
|
54
|
+
expect(fs.existsSync(outDir)).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -50,29 +50,38 @@ describe("isWorkspaceDiagnostic", () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
describe("formatDiagnosticError", () => {
|
|
53
|
-
it("
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
it("파일 정보가 있는 diagnostic을 컬러+코드 컨텍스트로 포맷한다", () => {
|
|
54
|
+
const sourceFile = ts.createSourceFile(
|
|
55
|
+
"/workspace/src/index.ts",
|
|
56
|
+
"const x = 1;\nconst y: string = 123;\n",
|
|
57
|
+
ts.ScriptTarget.Latest,
|
|
58
|
+
);
|
|
59
|
+
const diag: ts.Diagnostic = {
|
|
60
|
+
file: sourceFile,
|
|
61
|
+
start: 27,
|
|
62
|
+
length: 3,
|
|
63
|
+
category: ts.DiagnosticCategory.Error,
|
|
60
64
|
code: 2345,
|
|
61
65
|
messageText: "Type error",
|
|
62
66
|
};
|
|
63
|
-
const result = formatDiagnosticError(diag
|
|
64
|
-
expect(result).
|
|
67
|
+
const result = formatDiagnosticError(diag, "/workspace");
|
|
68
|
+
expect(result).toContain("TS2345");
|
|
69
|
+
expect(result).toContain("Type error");
|
|
70
|
+
expect(result).toContain("index.ts");
|
|
65
71
|
});
|
|
66
72
|
|
|
67
|
-
it("
|
|
68
|
-
const diag = {
|
|
69
|
-
file:
|
|
70
|
-
start:
|
|
73
|
+
it("파일 정보가 없는 diagnostic을 포맷한다", () => {
|
|
74
|
+
const diag: ts.Diagnostic = {
|
|
75
|
+
file: undefined,
|
|
76
|
+
start: undefined,
|
|
77
|
+
length: undefined,
|
|
78
|
+
category: ts.DiagnosticCategory.Error,
|
|
71
79
|
code: 1001,
|
|
72
80
|
messageText: "Global error",
|
|
73
81
|
};
|
|
74
|
-
const result = formatDiagnosticError(diag
|
|
75
|
-
expect(result).
|
|
82
|
+
const result = formatDiagnosticError(diag, "/workspace");
|
|
83
|
+
expect(result).toContain("TS1001");
|
|
84
|
+
expect(result).toContain("Global error");
|
|
76
85
|
});
|
|
77
86
|
});
|
|
78
87
|
|
|
@@ -192,6 +192,65 @@ describe("setupWatchEvents (Acceptance)", () => {
|
|
|
192
192
|
await expect(promise).resolves.toBeUndefined();
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
+
it("build 성공 + warnings 시 ResultCollector에 warnings가 저장된다", () => {
|
|
196
|
+
const worker = new MockWorker();
|
|
197
|
+
const resultCollector = new ResultCollector();
|
|
198
|
+
|
|
199
|
+
setupWatchEvents(worker, {
|
|
200
|
+
name: "test-pkg",
|
|
201
|
+
target: "node",
|
|
202
|
+
resultCollector,
|
|
203
|
+
normalizeBuild: (d) => d as NormalizedBuildInfo,
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
worker.emit("build", { success: true, warnings: ["warn1"] });
|
|
207
|
+
|
|
208
|
+
const result = resultCollector.get("test-pkg:build");
|
|
209
|
+
expect(result).toMatchObject({
|
|
210
|
+
status: "success",
|
|
211
|
+
warnings: "warn1",
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("build 성공 + warnings 없음 시 ResultCollector에 warnings가 undefined이다", () => {
|
|
216
|
+
const worker = new MockWorker();
|
|
217
|
+
const resultCollector = new ResultCollector();
|
|
218
|
+
|
|
219
|
+
setupWatchEvents(worker, {
|
|
220
|
+
name: "test-pkg",
|
|
221
|
+
target: "node",
|
|
222
|
+
resultCollector,
|
|
223
|
+
normalizeBuild: (d) => d as NormalizedBuildInfo,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
worker.emit("build", { success: true });
|
|
227
|
+
|
|
228
|
+
const result = resultCollector.get("test-pkg:build");
|
|
229
|
+
expect(result?.status).toBe("success");
|
|
230
|
+
expect(result?.warnings).toBeUndefined();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("build 실패 + warnings 시 에러와 경고 모두 저장된다", () => {
|
|
234
|
+
const worker = new MockWorker();
|
|
235
|
+
const resultCollector = new ResultCollector();
|
|
236
|
+
|
|
237
|
+
setupWatchEvents(worker, {
|
|
238
|
+
name: "test-pkg",
|
|
239
|
+
target: "node",
|
|
240
|
+
resultCollector,
|
|
241
|
+
normalizeBuild: (d) => d as NormalizedBuildInfo,
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
worker.emit("build", { success: false, errors: ["err1"], warnings: ["warn1"] });
|
|
245
|
+
|
|
246
|
+
const result = resultCollector.get("test-pkg:build");
|
|
247
|
+
expect(result).toMatchObject({
|
|
248
|
+
status: "error",
|
|
249
|
+
message: "err1",
|
|
250
|
+
warnings: "warn1",
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
195
254
|
it("두 번째 build 이벤트에서는 waitForInitialBuild가 다시 resolve되지 않는다", async () => {
|
|
196
255
|
const worker = new MockWorker();
|
|
197
256
|
const resultCollector = new ResultCollector();
|
|
@@ -138,4 +138,62 @@ describe("setupWatchEvents", () => {
|
|
|
138
138
|
expect(() => resolveInitialBuild()).not.toThrow();
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
|
+
|
|
142
|
+
//#region Feature 1.1 Slice 1: engine-watch-events warnings 전달
|
|
143
|
+
|
|
144
|
+
describe("warnings 전달", () => {
|
|
145
|
+
it("build 이벤트의 warnings를 ResultCollector에 저장한다", () => {
|
|
146
|
+
const worker = new MockWorker();
|
|
147
|
+
const resultCollector = new ResultCollector();
|
|
148
|
+
|
|
149
|
+
setupWatchEvents(worker, {
|
|
150
|
+
name: "client-app",
|
|
151
|
+
target: "client",
|
|
152
|
+
resultCollector,
|
|
153
|
+
normalizeBuild: (d) => d as { success: boolean; warnings?: string[] },
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
worker.emit("build", { success: true, warnings: ["warn1"] });
|
|
157
|
+
|
|
158
|
+
const result = resultCollector.get("client-app:build");
|
|
159
|
+
expect(result?.status).toBe("success");
|
|
160
|
+
expect(result?.warnings).toBe("warn1");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("build 이벤트에 warnings가 없으면 undefined이다", () => {
|
|
164
|
+
const worker = new MockWorker();
|
|
165
|
+
const resultCollector = new ResultCollector();
|
|
166
|
+
|
|
167
|
+
setupWatchEvents(worker, {
|
|
168
|
+
name: "client-app",
|
|
169
|
+
target: "client",
|
|
170
|
+
resultCollector,
|
|
171
|
+
normalizeBuild: (d) => d as { success: boolean },
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
worker.emit("build", { success: true });
|
|
175
|
+
|
|
176
|
+
const result = resultCollector.get("client-app:build");
|
|
177
|
+
expect(result?.warnings).toBeUndefined();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("여러 warnings를 줄바꿈으로 결합하여 저장한다", () => {
|
|
181
|
+
const worker = new MockWorker();
|
|
182
|
+
const resultCollector = new ResultCollector();
|
|
183
|
+
|
|
184
|
+
setupWatchEvents(worker, {
|
|
185
|
+
name: "client-app",
|
|
186
|
+
target: "client",
|
|
187
|
+
resultCollector,
|
|
188
|
+
normalizeBuild: (d) => d as { success: boolean; warnings?: string[] },
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
worker.emit("build", { success: true, warnings: ["warn1", "warn2"] });
|
|
192
|
+
|
|
193
|
+
const result = resultCollector.get("client-app:build");
|
|
194
|
+
expect(result?.warnings).toBe("warn1\nwarn2");
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
141
199
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Feature 3.1 esbuild-client-config.ts 통합 — LLM 검증
|
|
2
|
+
|
|
3
|
+
## 검증 항목
|
|
4
|
+
|
|
5
|
+
- [x] `@angular/build/private`에서 `createCompilerPlugin`, `SourceFileCache`, `CompilerPluginOptions`, `BundleStylesheetOptions` import가 없다: grep 결과 `@angular/build/private` 매치 없음
|
|
6
|
+
- [x] `createAngularCompilerPlugin`이 `./esbuild-angular-compiler-plugin.js`에서 import되어 있다: line 10에서 import, line 119에서 호출 확인
|
|
7
|
+
- [x] `ClientSourceFileCache`가 `AngularSourceFileCache`를 확장하고 `typeScriptFileCache`, `loadResultCache` 프로퍼티를 가진다: line 46-49에서 `extends AngularSourceFileCache` + 두 프로퍼티 확인
|
|
8
|
+
- [x] `ClientEsbuildResult.sourceFileCache` 타입이 `ClientSourceFileCache`이다: line 53 확인
|
|
9
|
+
- [x] `client.worker.ts`의 `sourceFileCache.loadResultCache.watchFiles`, `sourceFileCache.typeScriptFileCache.keys()`, `sourceFileCache.invalidate()` 접근이 새 구조와 타입 호환된다: typecheck 0 에러로 타입 호환성 확인됨
|
|
@@ -15,23 +15,17 @@ vi.mock("esbuild", () => ({
|
|
|
15
15
|
},
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
loadResultCache: { name: "mockLoadResultCache" },
|
|
20
|
-
invalidate: vi.fn(),
|
|
21
|
-
modifiedFiles: new Set<string>(),
|
|
22
|
-
};
|
|
18
|
+
const mockAngularPlugin = { name: "sd-angular-compiler" };
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
vi.mock("../../src/esbuild/esbuild-angular-compiler-plugin", () => ({
|
|
21
|
+
createAngularCompilerPlugin: vi.fn(() => mockAngularPlugin),
|
|
22
|
+
}));
|
|
25
23
|
|
|
26
|
-
vi.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
createCompilerPlugin: vi.fn(() => mockAngularPlugin),
|
|
32
|
-
SourceFileCache: vi.fn(MockSourceFileCache),
|
|
33
|
-
};
|
|
34
|
-
});
|
|
24
|
+
const mockTransformStylesheet = vi.fn();
|
|
25
|
+
|
|
26
|
+
vi.mock("../../src/angular/client-transform-stylesheet", () => ({
|
|
27
|
+
createClientTransformStylesheet: vi.fn(() => mockTransformStylesheet),
|
|
28
|
+
}));
|
|
35
29
|
|
|
36
30
|
vi.mock("browserslist-to-esbuild", () => ({
|
|
37
31
|
default: vi.fn(() => ["chrome61"]),
|
|
@@ -52,11 +46,16 @@ vi.mock("module", async (importOriginal) => {
|
|
|
52
46
|
|
|
53
47
|
// --- Imports (after mocks) ---
|
|
54
48
|
|
|
55
|
-
const { createClientEsbuildContext } = await import(
|
|
49
|
+
const { createClientEsbuildContext, ClientSourceFileCache } = await import(
|
|
56
50
|
"../../src/esbuild/esbuild-client-config"
|
|
57
51
|
);
|
|
58
52
|
const esbuild = (await import("esbuild")).default;
|
|
59
|
-
const {
|
|
53
|
+
const { createAngularCompilerPlugin } = await import(
|
|
54
|
+
"../../src/esbuild/esbuild-angular-compiler-plugin"
|
|
55
|
+
);
|
|
56
|
+
const { createClientTransformStylesheet } = await import(
|
|
57
|
+
"../../src/angular/client-transform-stylesheet"
|
|
58
|
+
);
|
|
60
59
|
const browserslistToEsbuild = (await import("browserslist-to-esbuild")).default;
|
|
61
60
|
|
|
62
61
|
describe("createClientEsbuildContext — Acceptance", () => {
|
|
@@ -65,10 +64,10 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
// Scenario: Angular main.ts를 ESM 번들로 빌드
|
|
68
|
-
// +
|
|
69
|
-
// +
|
|
67
|
+
// + AngularCompilerPluginOptions로 플러그인 생성
|
|
68
|
+
// + ClientSourceFileCache로 증분 캐시
|
|
70
69
|
// + dev 모드 Angular 플래그 + 소스맵
|
|
71
|
-
it("dev 모드: ESM 번들 설정, Angular 플래그, 소스맵,
|
|
70
|
+
it("dev 모드: ESM 번들 설정, Angular 플래그, 소스맵, ClientSourceFileCache로 esbuild context 생성", async () => {
|
|
72
71
|
const result = await createClientEsbuildContext({
|
|
73
72
|
pkgDir: "/workspace/packages/my-app",
|
|
74
73
|
cwd: "/workspace",
|
|
@@ -102,16 +101,14 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
102
101
|
expect(esbuildOptions.define!["ngDevMode"]).toBeUndefined();
|
|
103
102
|
expect(esbuildOptions.define!["ngHmrMode"]).toBeUndefined();
|
|
104
103
|
|
|
105
|
-
//
|
|
106
|
-
expect(
|
|
107
|
-
path.join("/workspace/packages/my-app", ".angular", "cache"),
|
|
108
|
-
);
|
|
104
|
+
// ClientSourceFileCache 인스턴스
|
|
105
|
+
expect(result.sourceFileCache).toBeInstanceOf(ClientSourceFileCache);
|
|
109
106
|
|
|
110
|
-
//
|
|
111
|
-
expect(
|
|
112
|
-
const
|
|
107
|
+
// createAngularCompilerPlugin 호출 검증
|
|
108
|
+
expect(createAngularCompilerPlugin).toHaveBeenCalledOnce();
|
|
109
|
+
const pluginOpts = vi.mocked(createAngularCompilerPlugin).mock.calls[0][0];
|
|
113
110
|
|
|
114
|
-
//
|
|
111
|
+
// AngularCompilerPluginOptions
|
|
115
112
|
expect(pluginOpts.tsconfig).toBe(
|
|
116
113
|
path.join("/workspace/packages/my-app", "tsconfig.json"),
|
|
117
114
|
);
|
|
@@ -119,20 +116,20 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
119
116
|
expect(pluginOpts.advancedOptimizations).toBe(false);
|
|
120
117
|
expect(pluginOpts.thirdPartySourcemaps).toBe(true);
|
|
121
118
|
expect(pluginOpts.incremental).toBe(true);
|
|
122
|
-
expect(pluginOpts.sourceFileCache).toBe(
|
|
123
|
-
expect(pluginOpts.
|
|
119
|
+
expect(pluginOpts.sourceFileCache).toBe(result.sourceFileCache);
|
|
120
|
+
expect(pluginOpts.typeScriptFileCache).toBe(result.sourceFileCache.typeScriptFileCache);
|
|
121
|
+
expect(pluginOpts.loadResultCache).toBe(result.sourceFileCache.loadResultCache);
|
|
124
122
|
expect(pluginOpts.includeTestMetadata).toBe(true);
|
|
123
|
+
expect(pluginOpts.persistentCachePath).toBe(
|
|
124
|
+
path.join("/workspace/packages/my-app", ".angular", "cache"),
|
|
125
|
+
);
|
|
125
126
|
|
|
126
|
-
//
|
|
127
|
-
expect(
|
|
128
|
-
expect(
|
|
129
|
-
expect(styleOpts.sourcemap).toBe("linked");
|
|
130
|
-
expect(styleOpts.inlineStyleLanguage).toBe("scss");
|
|
131
|
-
expect(styleOpts.cacheOptions.enabled).toBe(true);
|
|
127
|
+
// transformStylesheet 콜백 전달
|
|
128
|
+
expect(pluginOpts.transformStylesheet).toBe(mockTransformStylesheet);
|
|
129
|
+
expect(createClientTransformStylesheet).toHaveBeenCalledOnce();
|
|
132
130
|
|
|
133
131
|
// 반환값
|
|
134
132
|
expect(result.context).toBe(mockContext);
|
|
135
|
-
expect(result.sourceFileCache).toBe(mockSourceFileCache);
|
|
136
133
|
|
|
137
134
|
// angularPlugin이 plugins에 포함됨
|
|
138
135
|
expect(esbuildOptions.plugins).toContainEqual(mockAngularPlugin);
|
|
@@ -169,18 +166,13 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
169
166
|
expect(esbuildOptions.define!["ngJitMode"]).toBe("false");
|
|
170
167
|
expect(esbuildOptions.define!["ngHmrMode"]).toBe("false");
|
|
171
168
|
|
|
172
|
-
//
|
|
173
|
-
const
|
|
169
|
+
// AngularCompilerPluginOptions
|
|
170
|
+
const pluginOpts = vi.mocked(createAngularCompilerPlugin).mock.calls[0][0];
|
|
174
171
|
expect(pluginOpts.sourcemap).toBe(false);
|
|
175
172
|
expect(pluginOpts.advancedOptimizations).toBe(true);
|
|
176
173
|
expect(pluginOpts.thirdPartySourcemaps).toBe(false);
|
|
177
174
|
expect(pluginOpts.incremental).toBe(false);
|
|
178
175
|
expect(pluginOpts.includeTestMetadata).toBe(false);
|
|
179
|
-
expect((pluginOpts as unknown as Record<string, unknown>)["browserOnlyBuild"]).toBeUndefined();
|
|
180
|
-
|
|
181
|
-
// BundleStylesheetOptions
|
|
182
|
-
expect(styleOpts.optimization).toBe(true);
|
|
183
|
-
expect(styleOpts.sourcemap).toBe(false);
|
|
184
176
|
});
|
|
185
177
|
|
|
186
178
|
// Scenario: 커스텀 env 주입
|
|
@@ -198,8 +190,8 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
198
190
|
);
|
|
199
191
|
});
|
|
200
192
|
|
|
201
|
-
// Scenario: PostCSS 설정 —
|
|
202
|
-
it("postcssPlugins 전달 시
|
|
193
|
+
// Scenario: PostCSS 설정 — sd-postcss 등록 + transformStylesheet에 postcssPlugins 전달
|
|
194
|
+
it("postcssPlugins 전달 시 sd-postcss 플러그인이 등록되고 transformStylesheet에도 전달된다", async () => {
|
|
203
195
|
await createClientEsbuildContext({
|
|
204
196
|
pkgDir: "/workspace/packages/my-app",
|
|
205
197
|
cwd: "/workspace",
|
|
@@ -207,12 +199,13 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
207
199
|
postcssPlugins: [["autoprefixer", {}]],
|
|
208
200
|
});
|
|
209
201
|
|
|
210
|
-
const [, styleOpts] = vi.mocked(createCompilerPlugin).mock.calls[0];
|
|
211
|
-
expect(styleOpts.postcssConfiguration).toBeUndefined();
|
|
212
|
-
|
|
213
202
|
const esbuildOptions = vi.mocked(esbuild.context).mock.calls[0][0];
|
|
214
203
|
const pluginNames = esbuildOptions.plugins!.map((p: any) => p.name);
|
|
215
204
|
expect(pluginNames).toContain("sd-postcss");
|
|
205
|
+
|
|
206
|
+
const transformOpts = vi.mocked(createClientTransformStylesheet).mock.calls[0][0];
|
|
207
|
+
expect(transformOpts.postcssPlugins).toBeDefined();
|
|
208
|
+
expect(transformOpts.postcssPlugins).toHaveLength(1);
|
|
216
209
|
});
|
|
217
210
|
|
|
218
211
|
// Scenario: 프로덕션 일회성 빌드
|
|
@@ -306,7 +299,7 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
306
299
|
});
|
|
307
300
|
|
|
308
301
|
// Scenario: browserslist 미설정 시 기본 target "es2022"
|
|
309
|
-
it("browserslist 미설정 시 esbuild target
|
|
302
|
+
it("browserslist 미설정 시 esbuild target이 [es2022]", async () => {
|
|
310
303
|
await createClientEsbuildContext({
|
|
311
304
|
pkgDir: "/workspace/packages/my-app",
|
|
312
305
|
cwd: "/workspace",
|
|
@@ -315,9 +308,6 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
315
308
|
|
|
316
309
|
const esbuildOptions = vi.mocked(esbuild.context).mock.calls[0][0];
|
|
317
310
|
expect(esbuildOptions.target).toEqual(["es2022"]);
|
|
318
|
-
|
|
319
|
-
const [, styleOpts] = vi.mocked(createCompilerPlugin).mock.calls[0];
|
|
320
|
-
expect(styleOpts.target).toEqual(["es2022"]);
|
|
321
311
|
});
|
|
322
312
|
|
|
323
313
|
// Scenario: browserslist 문자열 설정 시 변환
|
|
@@ -335,9 +325,6 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
335
325
|
|
|
336
326
|
const esbuildOptions = vi.mocked(esbuild.context).mock.calls[0][0];
|
|
337
327
|
expect(esbuildOptions.target).toEqual(["chrome61"]);
|
|
338
|
-
|
|
339
|
-
const [, styleOpts] = vi.mocked(createCompilerPlugin).mock.calls[0];
|
|
340
|
-
expect(styleOpts.target).toEqual(["chrome61"]);
|
|
341
328
|
});
|
|
342
329
|
|
|
343
330
|
// Scenario: polyfills 경로 전달 시 entryPoints에 추가
|
|
@@ -413,9 +400,6 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
413
400
|
|
|
414
401
|
const esbuildOptions = vi.mocked(esbuild.context).mock.calls[0][0];
|
|
415
402
|
expect(esbuildOptions.target).toEqual(["chrome61", "firefox60"]);
|
|
416
|
-
|
|
417
|
-
const [, styleOpts] = vi.mocked(createCompilerPlugin).mock.calls[0];
|
|
418
|
-
expect(styleOpts.target).toEqual(["chrome61", "firefox60"]);
|
|
419
403
|
});
|
|
420
404
|
|
|
421
405
|
// Scenario: esbuild context에 tsconfig 옵션이 전달된다
|
|
@@ -447,12 +431,12 @@ describe("createClientEsbuildContext — Acceptance", () => {
|
|
|
447
431
|
const pluginNames = esbuildOptions.plugins!.map((p: any) => p.name);
|
|
448
432
|
|
|
449
433
|
expect(pluginNames).toContain("custom");
|
|
450
|
-
expect(pluginNames).toContain("angular-compiler");
|
|
434
|
+
expect(pluginNames).toContain("sd-angular-compiler");
|
|
451
435
|
expect(pluginNames).toContain("sd-scss");
|
|
452
436
|
expect(pluginNames[pluginNames.length - 1]).toBe("sd-on-end");
|
|
453
437
|
|
|
454
438
|
const customIdx = pluginNames.indexOf("custom");
|
|
455
|
-
const angularIdx = pluginNames.indexOf("angular-compiler");
|
|
439
|
+
const angularIdx = pluginNames.indexOf("sd-angular-compiler");
|
|
456
440
|
const scssIdx = pluginNames.indexOf("sd-scss");
|
|
457
441
|
expect(customIdx).toBeLessThan(angularIdx);
|
|
458
442
|
expect(angularIdx).toBeLessThan(scssIdx);
|