@simplysm/sd-cli 14.0.41 → 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 +7 -6
- 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
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
2
|
-
import path, { resolve } from "node:path";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import { pathx } from "@simplysm/core-node";
|
|
5
|
-
import { AngularBuildPipeline } from "../../src/angular/angular-build-pipeline";
|
|
6
|
-
import { buildCompilerOptions, buildScssLoadPaths, compileGlobalScss } from "../../src/angular/ngtsc-build-core";
|
|
7
|
-
import { parseTsconfig, getPackageSourceFiles } from "../../src/utils/tsconfig";
|
|
8
|
-
|
|
9
|
-
const FIXTURE_DIR = resolve(import.meta.dirname, "../angular/fixtures/packages/basic-lib");
|
|
10
|
-
const distDir = resolve(FIXTURE_DIR, "dist");
|
|
11
|
-
|
|
12
|
-
async function buildWithPipeline(options: {
|
|
13
|
-
js: boolean;
|
|
14
|
-
dts: boolean;
|
|
15
|
-
}): Promise<{ success: boolean; errors?: string[] }> {
|
|
16
|
-
const parsedConfig = parseTsconfig(FIXTURE_DIR);
|
|
17
|
-
const sourceFiles = getPackageSourceFiles(FIXTURE_DIR, parsedConfig);
|
|
18
|
-
const compilerOptions = buildCompilerOptions(parsedConfig.options, FIXTURE_DIR, {
|
|
19
|
-
js: options.js,
|
|
20
|
-
dts: options.dts,
|
|
21
|
-
});
|
|
22
|
-
const angularOptions = (parsedConfig.raw?.angularCompilerOptions ?? {}) as Record<string, unknown>;
|
|
23
|
-
|
|
24
|
-
const pipeline = new AngularBuildPipeline({
|
|
25
|
-
mode: "library",
|
|
26
|
-
pkgDir: FIXTURE_DIR,
|
|
27
|
-
cwd: FIXTURE_DIR,
|
|
28
|
-
rootNames: sourceFiles,
|
|
29
|
-
compilerOptions,
|
|
30
|
-
angularCompilerOptions: angularOptions,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const result = await pipeline.initialize();
|
|
34
|
-
const normalizedSrcDir = pathx.posix(path.join(FIXTURE_DIR, "src"));
|
|
35
|
-
pipeline.writeEmitResults({
|
|
36
|
-
pkgDir: FIXTURE_DIR,
|
|
37
|
-
sourceFilter: (fileName) => pathx.posix(fileName).startsWith(normalizedSrcDir + "/"),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const errors = result.diagnostics.errors.map((e) => e.message);
|
|
41
|
-
return {
|
|
42
|
-
success: result.diagnostics.errors.length === 0 && result.scssErrors.length === 0,
|
|
43
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
describe("ngtsc-build-core: NgtscProgram AOT compilation", () => {
|
|
48
|
-
beforeAll(() => {
|
|
49
|
-
// Clean dist before tests
|
|
50
|
-
if (fs.existsSync(distDir)) {
|
|
51
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
afterAll(() => {
|
|
56
|
-
// Clean up dist after tests
|
|
57
|
-
if (fs.existsSync(distDir)) {
|
|
58
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// Acceptance: Scenario "@Injectable 데코레이터가 런타임 코드로 변환된다"
|
|
63
|
-
it("transforms @Injectable decorator to runtime ɵprov factory", async () => {
|
|
64
|
-
const result = await buildWithPipeline({ js: true, dts: false });
|
|
65
|
-
|
|
66
|
-
// Debug: print errors if build failed
|
|
67
|
-
if (!result.success) {
|
|
68
|
-
console.error("Build errors:", result.errors);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
expect(result.success).toBe(true);
|
|
72
|
-
|
|
73
|
-
// Find the provider file output
|
|
74
|
-
const providerJsPath = resolve(distDir, "test-provider.js");
|
|
75
|
-
expect(fs.existsSync(providerJsPath)).toBe(true);
|
|
76
|
-
|
|
77
|
-
const content = fs.readFileSync(providerJsPath, "utf-8");
|
|
78
|
-
// ɵprov is the Angular injectable factory
|
|
79
|
-
expect(content).toContain("ɵprov");
|
|
80
|
-
// Original @Injectable decorator should be removed
|
|
81
|
-
expect(content).not.toContain("@Injectable");
|
|
82
|
-
}, 60_000);
|
|
83
|
-
|
|
84
|
-
// Acceptance: Scenario "@Directive 데코레이터가 런타임 코드로 변환된다"
|
|
85
|
-
it("transforms @Directive decorator to runtime ɵdir definition", () => {
|
|
86
|
-
// dist already populated from prior test, check directive
|
|
87
|
-
const directiveJsPath = resolve(distDir, "test-directive.js");
|
|
88
|
-
expect(fs.existsSync(directiveJsPath)).toBe(true);
|
|
89
|
-
|
|
90
|
-
const content = fs.readFileSync(directiveJsPath, "utf-8");
|
|
91
|
-
expect(content).toContain("ɵdir");
|
|
92
|
-
}, 60_000);
|
|
93
|
-
|
|
94
|
-
// Acceptance: Scenario ".d.ts 파일이 Angular 메타데이터를 포함하여 출력된다"
|
|
95
|
-
it("outputs .d.ts files with Angular type metadata", async () => {
|
|
96
|
-
// Clean dist and run with dts: true
|
|
97
|
-
if (fs.existsSync(distDir)) {
|
|
98
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const result = await buildWithPipeline({ js: true, dts: true });
|
|
102
|
-
|
|
103
|
-
expect(result.success).toBe(true);
|
|
104
|
-
|
|
105
|
-
const providerDtsPath = resolve(distDir, "test-provider.d.ts");
|
|
106
|
-
expect(fs.existsSync(providerDtsPath)).toBe(true);
|
|
107
|
-
|
|
108
|
-
const content = fs.readFileSync(providerDtsPath, "utf-8");
|
|
109
|
-
// Angular .d.ts includes ɵ metadata fields
|
|
110
|
-
expect(content).toMatch(/ɵ(prov|fac)/);
|
|
111
|
-
}, 60_000);
|
|
112
|
-
|
|
113
|
-
// Acceptance: Scenario "run()으로 one-time 빌드를 수행한다"
|
|
114
|
-
it("produces both JS and .d.ts when output is {js: true, dts: true}", () => {
|
|
115
|
-
// dist already populated from prior test
|
|
116
|
-
const jsExists = fs.existsSync(resolve(distDir, "test-provider.js"));
|
|
117
|
-
const dtsExists = fs.existsSync(resolve(distDir, "test-provider.d.ts"));
|
|
118
|
-
|
|
119
|
-
expect(jsExists).toBe(true);
|
|
120
|
-
expect(dtsExists).toBe(true);
|
|
121
|
-
}, 60_000);
|
|
122
|
-
|
|
123
|
-
// Acceptance: Scenario "run()에서 dts: false면 .d.ts를 생략한다"
|
|
124
|
-
it("omits .d.ts when output is {js: true, dts: false}", async () => {
|
|
125
|
-
if (fs.existsSync(distDir)) {
|
|
126
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const result = await buildWithPipeline({ js: true, dts: false });
|
|
130
|
-
|
|
131
|
-
expect(result.success).toBe(true);
|
|
132
|
-
|
|
133
|
-
const jsExists = fs.existsSync(resolve(distDir, "test-provider.js"));
|
|
134
|
-
expect(jsExists).toBe(true);
|
|
135
|
-
|
|
136
|
-
// Should NOT have .d.ts files
|
|
137
|
-
const dtsExists = fs.existsSync(resolve(distDir, "test-provider.d.ts"));
|
|
138
|
-
expect(dtsExists).toBe(false);
|
|
139
|
-
}, 60_000);
|
|
140
|
-
|
|
141
|
-
// Acceptance: Scenario "TypeScript + Angular diagnostics를 통합 수집한다"
|
|
142
|
-
it("collects diagnostics from both TypeScript and Angular compiler", async () => {
|
|
143
|
-
if (fs.existsSync(distDir)) {
|
|
144
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const result = await buildWithPipeline({ js: true, dts: true });
|
|
148
|
-
|
|
149
|
-
// Angular package should compile cleanly
|
|
150
|
-
expect(result).toHaveProperty("success");
|
|
151
|
-
expect(result.success).toBe(true);
|
|
152
|
-
}, 60_000);
|
|
153
|
-
|
|
154
|
-
// Acceptance: Scenario "빌드 결과 구조가 항상 반환된다"
|
|
155
|
-
it("returns complete result structure even when build succeeds", async () => {
|
|
156
|
-
const result = await buildWithPipeline({ js: true, dts: true });
|
|
157
|
-
|
|
158
|
-
// Verify result structure completeness
|
|
159
|
-
expect(result).toHaveProperty("success");
|
|
160
|
-
expect(typeof result.success).toBe("boolean");
|
|
161
|
-
}, 60_000);
|
|
162
|
-
|
|
163
|
-
// Acceptance: Scenario "scss/styles.scss가 CSS로 컴파일되어 dist에 출력된다"
|
|
164
|
-
it("compiles scss/styles.scss to dist/styles.css", async () => {
|
|
165
|
-
if (fs.existsSync(distDir)) {
|
|
166
|
-
fs.rmSync(distDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const result = await buildWithPipeline({ js: true, dts: false });
|
|
170
|
-
expect(result.success).toBe(true);
|
|
171
|
-
|
|
172
|
-
// global SCSS는 Pipeline 외부에서 별도 호출
|
|
173
|
-
const loadPaths = buildScssLoadPaths({
|
|
174
|
-
name: "basic-lib",
|
|
175
|
-
cwd: FIXTURE_DIR,
|
|
176
|
-
pkgDir: FIXTURE_DIR,
|
|
177
|
-
output: { js: true, dts: false },
|
|
178
|
-
});
|
|
179
|
-
const globalErrors = compileGlobalScss(FIXTURE_DIR, loadPaths);
|
|
180
|
-
expect(globalErrors).toEqual([]);
|
|
181
|
-
|
|
182
|
-
const stylesCssPath = resolve(distDir, "styles.css");
|
|
183
|
-
expect(fs.existsSync(stylesCssPath)).toBe(true);
|
|
184
|
-
|
|
185
|
-
const content = fs.readFileSync(stylesCssPath, "utf-8");
|
|
186
|
-
expect(content.length).toBeGreaterThan(0);
|
|
187
|
-
}, 60_000);
|
|
188
|
-
|
|
189
|
-
// Acceptance: Scenario "scss/styles.scss가 없으면 전역 스타일 컴파일을 건너뛴다"
|
|
190
|
-
it("skips global SCSS when scss/styles.scss does not exist", () => {
|
|
191
|
-
const nonExistentPkgDir = resolve(import.meta.dirname, "__nonexistent_pkg__");
|
|
192
|
-
|
|
193
|
-
const errors = compileGlobalScss(nonExistentPkgDir, []);
|
|
194
|
-
|
|
195
|
-
// No errors and no dist/styles.css created
|
|
196
|
-
expect(errors).toEqual([]);
|
|
197
|
-
expect(fs.existsSync(resolve(nonExistentPkgDir, "dist", "styles.css"))).toBe(false);
|
|
198
|
-
});
|
|
199
|
-
});
|