@simplysm/sd-cli 14.0.15 → 14.0.17

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.
Files changed (216) hide show
  1. package/README.md +4 -3
  2. package/dist/angular/client-transform-stylesheet.d.ts +2 -0
  3. package/dist/angular/client-transform-stylesheet.d.ts.map +1 -1
  4. package/dist/angular/client-transform-stylesheet.js +88 -2
  5. package/dist/angular/client-transform-stylesheet.js.map +1 -1
  6. package/dist/angular/vite-angular-plugin.d.ts +7 -0
  7. package/dist/angular/vite-angular-plugin.d.ts.map +1 -1
  8. package/dist/angular/vite-angular-plugin.js +78 -16
  9. package/dist/angular/vite-angular-plugin.js.map +1 -1
  10. package/dist/capacitor/capacitor.d.ts.map +1 -1
  11. package/dist/capacitor/capacitor.js +24 -13
  12. package/dist/capacitor/capacitor.js.map +1 -1
  13. package/dist/commands/check.d.ts.map +1 -1
  14. package/dist/commands/check.js +8 -9
  15. package/dist/commands/check.js.map +1 -1
  16. package/dist/commands/device.d.ts +1 -1
  17. package/dist/commands/device.d.ts.map +1 -1
  18. package/dist/commands/device.js +61 -12
  19. package/dist/commands/device.js.map +1 -1
  20. package/dist/commands/lint.d.ts +0 -1
  21. package/dist/commands/lint.d.ts.map +1 -1
  22. package/dist/commands/lint.js +2 -3
  23. package/dist/commands/lint.js.map +1 -1
  24. package/dist/commands/publish.js +3 -3
  25. package/dist/commands/publish.js.map +1 -1
  26. package/dist/commands/replace-deps.js +1 -1
  27. package/dist/commands/replace-deps.js.map +1 -1
  28. package/dist/commands/typecheck.d.ts.map +1 -1
  29. package/dist/commands/typecheck.js +1 -2
  30. package/dist/commands/typecheck.js.map +1 -1
  31. package/dist/electron/electron.d.ts +3 -2
  32. package/dist/electron/electron.d.ts.map +1 -1
  33. package/dist/electron/electron.js +54 -31
  34. package/dist/electron/electron.js.map +1 -1
  35. package/dist/engines/BaseEngine.js +1 -1
  36. package/dist/engines/BaseEngine.js.map +1 -1
  37. package/dist/engines/NgtscEngine.d.ts.map +1 -1
  38. package/dist/engines/NgtscEngine.js +0 -1
  39. package/dist/engines/NgtscEngine.js.map +1 -1
  40. package/dist/engines/ServerEsbuildEngine.d.ts.map +1 -1
  41. package/dist/engines/ServerEsbuildEngine.js +0 -1
  42. package/dist/engines/ServerEsbuildEngine.js.map +1 -1
  43. package/dist/engines/TscEngine.d.ts.map +1 -1
  44. package/dist/engines/TscEngine.js +0 -1
  45. package/dist/engines/TscEngine.js.map +1 -1
  46. package/dist/engines/ViteEngine.d.ts.map +1 -1
  47. package/dist/engines/ViteEngine.js +10 -1
  48. package/dist/engines/ViteEngine.js.map +1 -1
  49. package/dist/engines/index.d.ts +0 -10
  50. package/dist/engines/index.d.ts.map +1 -1
  51. package/dist/engines/index.js +0 -5
  52. package/dist/engines/index.js.map +1 -1
  53. package/dist/engines/types.d.ts +0 -1
  54. package/dist/engines/types.d.ts.map +1 -1
  55. package/dist/infra/SignalHandler.d.ts +1 -6
  56. package/dist/infra/SignalHandler.d.ts.map +1 -1
  57. package/dist/infra/SignalHandler.js +4 -13
  58. package/dist/infra/SignalHandler.js.map +1 -1
  59. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  60. package/dist/orchestrators/BuildOrchestrator.js +7 -12
  61. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  62. package/dist/orchestrators/DevWatchOrchestrator.d.ts.map +1 -1
  63. package/dist/orchestrators/DevWatchOrchestrator.js +18 -11
  64. package/dist/orchestrators/DevWatchOrchestrator.js.map +1 -1
  65. package/dist/sd-cli-entry.d.ts +0 -1
  66. package/dist/sd-cli-entry.d.ts.map +1 -1
  67. package/dist/sd-cli-entry.js +13 -16
  68. package/dist/sd-cli-entry.js.map +1 -1
  69. package/dist/sd-cli.js +1 -1
  70. package/dist/sd-cli.js.map +1 -1
  71. package/dist/sd-config.types.d.ts +12 -2
  72. package/dist/sd-config.types.d.ts.map +1 -1
  73. package/dist/utils/angular-compiler.d.ts.map +1 -1
  74. package/dist/utils/angular-compiler.js +20 -13
  75. package/dist/utils/angular-compiler.js.map +1 -1
  76. package/dist/utils/esbuild-config.d.ts +1 -1
  77. package/dist/utils/esbuild-config.d.ts.map +1 -1
  78. package/dist/utils/esbuild-config.js +1 -4
  79. package/dist/utils/esbuild-config.js.map +1 -1
  80. package/dist/utils/ngtsc-build-core.d.ts.map +1 -1
  81. package/dist/utils/ngtsc-build-core.js +3 -0
  82. package/dist/utils/ngtsc-build-core.js.map +1 -1
  83. package/dist/utils/orchestrator-utils.js +1 -1
  84. package/dist/utils/orchestrator-utils.js.map +1 -1
  85. package/dist/utils/tsc-build.d.ts +5 -0
  86. package/dist/utils/tsc-build.d.ts.map +1 -1
  87. package/dist/utils/tsc-build.js +2 -1
  88. package/dist/utils/tsc-build.js.map +1 -1
  89. package/dist/utils/vite-config.d.ts +1 -1
  90. package/dist/utils/vite-config.d.ts.map +1 -1
  91. package/dist/utils/vite-config.js +22 -53
  92. package/dist/utils/vite-config.js.map +1 -1
  93. package/dist/utils/vite-pwa-plugin.d.ts +9 -0
  94. package/dist/utils/vite-pwa-plugin.d.ts.map +1 -0
  95. package/dist/utils/vite-pwa-plugin.js +139 -0
  96. package/dist/utils/vite-pwa-plugin.js.map +1 -0
  97. package/dist/utils/worker-utils.d.ts +2 -5
  98. package/dist/utils/worker-utils.d.ts.map +1 -1
  99. package/dist/utils/worker-utils.js +5 -11
  100. package/dist/utils/worker-utils.js.map +1 -1
  101. package/dist/workers/client.worker.d.ts.map +1 -1
  102. package/dist/workers/client.worker.js +9 -3
  103. package/dist/workers/client.worker.js.map +1 -1
  104. package/dist/workers/library-build.worker.d.ts.map +1 -1
  105. package/dist/workers/library-build.worker.js +6 -2
  106. package/dist/workers/library-build.worker.js.map +1 -1
  107. package/dist/workers/ngtsc-build.worker.js +2 -2
  108. package/dist/workers/ngtsc-build.worker.js.map +1 -1
  109. package/dist/workers/server-build.worker.d.ts.map +1 -1
  110. package/dist/workers/server-build.worker.js +6 -2
  111. package/dist/workers/server-build.worker.js.map +1 -1
  112. package/dist/workers/server-runtime.worker.js +4 -4
  113. package/dist/workers/server-runtime.worker.js.map +1 -1
  114. package/docs/config.md +30 -2
  115. package/docs/pwa-configuration-types.md +1 -1
  116. package/package.json +8 -10
  117. package/src/angular/client-transform-stylesheet.ts +104 -2
  118. package/src/angular/vite-angular-plugin.ts +92 -31
  119. package/src/capacitor/capacitor.ts +25 -26
  120. package/src/commands/check.ts +8 -11
  121. package/src/commands/device.ts +71 -17
  122. package/src/commands/lint.ts +2 -3
  123. package/src/commands/publish.ts +3 -3
  124. package/src/commands/replace-deps.ts +1 -1
  125. package/src/commands/typecheck.ts +1 -2
  126. package/src/electron/electron.ts +62 -43
  127. package/src/engines/BaseEngine.ts +1 -1
  128. package/src/engines/NgtscEngine.ts +0 -1
  129. package/src/engines/ServerEsbuildEngine.ts +0 -1
  130. package/src/engines/TscEngine.ts +0 -1
  131. package/src/engines/ViteEngine.ts +9 -1
  132. package/src/engines/index.ts +0 -10
  133. package/src/engines/types.ts +0 -1
  134. package/src/infra/SignalHandler.ts +4 -14
  135. package/src/orchestrators/BuildOrchestrator.ts +7 -9
  136. package/src/orchestrators/DevWatchOrchestrator.ts +22 -10
  137. package/src/sd-cli-entry.ts +17 -24
  138. package/src/sd-cli.ts +1 -1
  139. package/src/sd-config.types.ts +13 -2
  140. package/src/utils/angular-compiler.ts +21 -21
  141. package/src/utils/esbuild-config.ts +2 -5
  142. package/src/utils/ngtsc-build-core.ts +7 -0
  143. package/src/utils/orchestrator-utils.ts +1 -1
  144. package/src/utils/tsc-build.ts +7 -0
  145. package/src/utils/vite-config.ts +23 -55
  146. package/src/utils/vite-pwa-plugin.ts +168 -0
  147. package/src/utils/worker-utils.ts +5 -11
  148. package/src/workers/client.worker.ts +11 -3
  149. package/src/workers/library-build.worker.ts +6 -2
  150. package/src/workers/ngtsc-build.worker.ts +2 -2
  151. package/src/workers/server-build.worker.ts +7 -2
  152. package/src/workers/server-runtime.worker.ts +4 -4
  153. package/tests/angular/client-transform-stylesheet.spec.ts +43 -0
  154. package/tests/angular/find-affected-by-scss.spec.ts +37 -0
  155. package/tests/angular/fixtures/basic-app/scss/_colors.scss +1 -0
  156. package/tests/angular/fixtures/basic-app/scss/_variables.scss +3 -0
  157. package/tests/angular/fixtures/basic-app/src/styled.component.ts +14 -0
  158. package/tests/angular/linker-disk-cache.spec.ts +158 -0
  159. package/tests/angular/scss-disk-cache.spec.ts +162 -0
  160. package/tests/angular/vite-angular-plugin-hmr-fallback.spec.ts +15 -15
  161. package/tests/angular/vite-angular-plugin-hmr.spec.ts +9 -9
  162. package/tests/angular/vite-angular-plugin-lint.spec.ts +4 -4
  163. package/tests/angular/vite-angular-plugin-scss-hmr.spec.ts +87 -0
  164. package/tests/angular/vite-angular-plugin.spec.ts +15 -15
  165. package/tests/capacitor/capacitor-icon.spec.ts +2 -4
  166. package/tests/capacitor/capacitor-init.spec.ts +2 -4
  167. package/tests/capacitor/capacitor-workspace.spec.ts +2 -4
  168. package/tests/commands/device.spec.ts +108 -8
  169. package/tests/commands/publish.spec.ts +2 -2
  170. package/tests/commands/typecheck.spec.ts +1 -1
  171. package/tests/electron/electron.spec.ts +24 -17
  172. package/tests/engines/ngtsc-engine.spec.ts +0 -3
  173. package/tests/engines/server-esbuild-engine.spec.ts +0 -3
  174. package/tests/engines/tsc-engine.spec.ts +1 -2
  175. package/tests/engines/vite-engine.spec.ts +0 -2
  176. package/tests/infra/signal-handler.spec.ts +1 -12
  177. package/tests/orchestrators/build-orchestrator.spec.ts +1 -7
  178. package/tests/orchestrators/dev-watch-orchestrator.spec.ts +24 -66
  179. package/tests/utils/angular-compiler.spec.ts +1396 -32
  180. package/tests/utils/esbuild-config.spec.ts +4 -7
  181. package/tests/utils/{ngtsc-build-core-angular-compiler.spec.ts → ngtsc-build-core.spec.ts} +142 -11
  182. package/tests/utils/orchestrator-utils.spec.ts +2 -2
  183. package/tests/utils/sd-config.spec.ts +2 -2
  184. package/tests/utils/tsc-build.spec.ts +4 -1
  185. package/tests/utils/vite-config.spec.ts +130 -261
  186. package/tests/utils/vite-pwa-plugin.acc.spec.ts +143 -0
  187. package/tests/utils/vite-pwa-plugin.spec.ts +350 -0
  188. package/tests/utils/worker-utils.spec.ts +8 -7
  189. package/tests/workers/client-worker.spec.ts +50 -1
  190. package/tests/workers/dev-port-file.verify.md +6 -0
  191. package/tests/workers/library-build-lint.spec.ts +1 -1
  192. package/tests/workers/library-build-worker.spec.ts +1 -1
  193. package/tests/workers/ngtsc-build-lint.spec.ts +1 -1
  194. package/tests/workers/server-build-lint.spec.ts +1 -1
  195. package/tests/workers/server-build-worker.spec.ts +1 -1
  196. package/tests/workers/server-runtime-worker.spec.ts +8 -1
  197. package/dist/infra/WorkerManager.d.ts +0 -40
  198. package/dist/infra/WorkerManager.d.ts.map +0 -1
  199. package/dist/infra/WorkerManager.js +0 -59
  200. package/dist/infra/WorkerManager.js.map +0 -1
  201. package/dist/utils/SdCliReporter.d.ts +0 -18
  202. package/dist/utils/SdCliReporter.d.ts.map +0 -1
  203. package/dist/utils/SdCliReporter.js +0 -144
  204. package/dist/utils/SdCliReporter.js.map +0 -1
  205. package/src/infra/WorkerManager.ts +0 -65
  206. package/src/utils/SdCliReporter.ts +0 -177
  207. package/tests/angular/scss-compiler-async.spec.ts +0 -54
  208. package/tests/commands/dev.spec.ts +0 -53
  209. package/tests/commands/watch.spec.ts +0 -53
  210. package/tests/infra/worker-manager.spec.ts +0 -63
  211. package/tests/utils/angular-compiler-emit.spec.ts +0 -570
  212. package/tests/utils/angular-compiler-init.spec.ts +0 -705
  213. package/tests/utils/angular-compiler-update.spec.ts +0 -293
  214. package/tests/utils/build-env.spec.ts +0 -33
  215. package/tests/utils/ngtsc-build-core-transform-stylesheet.spec.ts +0 -124
  216. package/tests/utils/ngtsc-scss-refactor.spec.ts +0 -47
@@ -162,7 +162,7 @@ describe("writeChangedOutputFiles", () => {
162
162
  it("skips writing when transformed content matches existing file", async () => {
163
163
  vi.mocked(mockFs.readFile).mockResolvedValue('import { bar } from "./bar.js";' as any);
164
164
 
165
- const hasChanges = await writeChangedOutputFiles([
165
+ await writeChangedOutputFiles([
166
166
  {
167
167
  path: "/pkg/dist/foo.js",
168
168
  text: 'import { bar } from "./bar";',
@@ -170,13 +170,12 @@ describe("writeChangedOutputFiles", () => {
170
170
  ] as any);
171
171
 
172
172
  expect(mockFs.writeFile).not.toHaveBeenCalled();
173
- expect(hasChanges).toBe(false);
174
173
  });
175
174
 
176
- it("writes file and returns true when content changed", async () => {
175
+ it("writes file when content changed", async () => {
177
176
  vi.mocked(mockFs.readFile).mockResolvedValue('import { old } from "./old.js";' as any);
178
177
 
179
- const hasChanges = await writeChangedOutputFiles([
178
+ await writeChangedOutputFiles([
180
179
  {
181
180
  path: "/pkg/dist/foo.js",
182
181
  text: 'import { bar } from "./bar";',
@@ -184,13 +183,12 @@ describe("writeChangedOutputFiles", () => {
184
183
  ] as any);
185
184
 
186
185
  expect(mockFs.writeFile).toHaveBeenCalled();
187
- expect(hasChanges).toBe(true);
188
186
  });
189
187
 
190
188
  it("writes new file when existing file does not exist", async () => {
191
189
  vi.mocked(mockFs.readFile).mockRejectedValue(new Error("ENOENT"));
192
190
 
193
- const hasChanges = await writeChangedOutputFiles([
191
+ await writeChangedOutputFiles([
194
192
  {
195
193
  path: "/pkg/dist/foo.js",
196
194
  text: 'const x = 1;',
@@ -199,7 +197,6 @@ describe("writeChangedOutputFiles", () => {
199
197
 
200
198
  expect(mockFs.mkdir).toHaveBeenCalledWith(path.dirname("/pkg/dist/foo.js"), { recursive: true });
201
199
  expect(mockFs.writeFile).toHaveBeenCalledWith("/pkg/dist/foo.js", "const x = 1;");
202
- expect(hasChanges).toBe(true);
203
200
  });
204
201
 
205
202
  it("does not transform non-.js files", async () => {
@@ -1,9 +1,8 @@
1
1
  import { describe, it, expect, vi, beforeEach } from "vitest";
2
2
  import ts from "typescript";
3
3
 
4
- // --- Unit Tests: runNgtscBuild가 AngularCompiler를 사용하는지 검증 ---
4
+ // --- Mock: AngularCompiler를 사용하는지 검증 ---
5
5
 
6
- // Mock AngularCompiler to verify runNgtscBuild uses it
7
6
  const mockInitialize = vi.fn().mockResolvedValue({ affectedFiles: new Set() });
8
7
  const mockCollectDiagnostics = vi.fn().mockReturnValue([]);
9
8
  const mockEmitAffectedFiles = vi.fn().mockReturnValue([]);
@@ -42,7 +41,6 @@ vi.mock("../../src/utils/angular-compiler", () => {
42
41
  };
43
42
  });
44
43
 
45
- // Mock tsconfig module to avoid filesystem access
46
44
  vi.mock("../../src/utils/tsconfig", () => ({
47
45
  parseTsconfig: vi.fn().mockReturnValue({
48
46
  options: {
@@ -60,7 +58,6 @@ vi.mock("../../src/utils/tsconfig", () => ({
60
58
  getCompilerOptionsForEnv: vi.fn().mockImplementation((opts: ts.CompilerOptions) => opts),
61
59
  }));
62
60
 
63
- // Mock NgtscProgram should NOT be used after migration
64
61
  const ngtscProgramSpy = vi.fn();
65
62
  vi.mock("../../src/utils/angular-build", () => {
66
63
  class NgtscProgram {
@@ -90,11 +87,18 @@ vi.mock("../../src/utils/angular-build", () => {
90
87
  };
91
88
  });
92
89
 
93
- const { runNgtscBuild } = await import("../../src/utils/ngtsc-build-core");
90
+ const {
91
+ runNgtscBuild,
92
+ createLibraryTransformStylesheet,
93
+ buildScssLoadPaths,
94
+ } = await import("../../src/utils/ngtsc-build-core");
95
+
96
+ import { resolve, join } from "node:path";
94
97
 
95
- // Use real workspace root so ts.readConfigFile can find tsconfig.json
96
- const { resolve } = await import("node:path");
97
98
  const workspaceRoot = resolve(import.meta.dirname, "../../../..");
99
+ const angularPkgDir = resolve(workspaceRoot, "packages/angular");
100
+
101
+ // ─── runNgtscBuild가 AngularCompiler를 사용한다 ───
98
102
 
99
103
  describe("runNgtscBuild가 AngularCompiler를 사용한다", () => {
100
104
  beforeEach(() => {
@@ -111,14 +115,10 @@ describe("runNgtscBuild가 AngularCompiler를 사용한다", () => {
111
115
  output: { js: true, dts: true },
112
116
  });
113
117
 
114
- // AngularCompiler가 생성됨
115
118
  expect(angularCompilerConstructorSpy).toHaveBeenCalledTimes(1);
116
- // initialize()가 호출됨
117
119
  expect(mockInitialize).toHaveBeenCalledTimes(1);
118
- // NgtscProgram이 직접 생성되지 않음
119
120
  expect(ngtscProgramSpy).not.toHaveBeenCalled();
120
121
 
121
- // 결과 구조 확인
122
122
  expect(result.build).toHaveProperty("success");
123
123
  expect(result.build).toHaveProperty("diagnostics");
124
124
  });
@@ -170,3 +170,134 @@ describe("runNgtscBuild가 AngularCompiler를 사용한다", () => {
170
170
  expect(options.compilerOptions.noEmit).toBe(true);
171
171
  });
172
172
  });
173
+
174
+ // ─── createLibraryTransformStylesheet ───
175
+
176
+ describe("createLibraryTransformStylesheet", () => {
177
+ beforeEach(() => {
178
+ vi.restoreAllMocks();
179
+ });
180
+
181
+ it("외부 .scss 파일이면 compileScssFile로 CSS를 반환하고 의존성을 기록한다", async () => {
182
+ const loadPaths = ["/pkg/scss", "/cwd/node_modules"];
183
+ const scssErrors: string[] = [];
184
+ const scssDependencies = new Map<string, Set<string>>();
185
+
186
+ const transform = createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies);
187
+
188
+ const result = await transform(
189
+ ".host { color: red; }",
190
+ "/project/src/app.component.ts",
191
+ "/project/src/app.component.scss",
192
+ );
193
+
194
+ expect(scssErrors.length).toBeGreaterThan(0);
195
+ expect(result).toBe("/* SCSS compilation error */");
196
+ });
197
+
198
+ it("외부 .css 파일이면 null을 반환한다", async () => {
199
+ const loadPaths = ["/pkg/scss"];
200
+ const scssErrors: string[] = [];
201
+ const scssDependencies = new Map<string, Set<string>>();
202
+
203
+ const transform = createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies);
204
+
205
+ const result = await transform(
206
+ ".host { color: red; }",
207
+ "/project/src/app.component.ts",
208
+ "/project/src/app.component.css",
209
+ );
210
+
211
+ expect(result).toBeNull();
212
+ expect(scssErrors.length).toBe(0);
213
+ });
214
+
215
+ it("인라인 SCSS(stylesheetFile 미지정)이면 compileScssString으로 CSS를 반환한다", async () => {
216
+ const loadPaths: string[] = [];
217
+ const scssErrors: string[] = [];
218
+ const scssDependencies = new Map<string, Set<string>>();
219
+
220
+ const transform = createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies);
221
+
222
+ const result = await transform(
223
+ ".host { color: red; }",
224
+ "/project/src/app.component.ts",
225
+ undefined,
226
+ );
227
+
228
+ expect(typeof result).toBe("string");
229
+ expect(result).toContain("color: red");
230
+ expect(scssErrors.length).toBe(0);
231
+ });
232
+
233
+ it("SCSS 컴파일 에러 시 scssErrors에 에러를 추가하고 에러 주석을 반환한다", async () => {
234
+ const loadPaths: string[] = [];
235
+ const scssErrors: string[] = [];
236
+ const scssDependencies = new Map<string, Set<string>>();
237
+
238
+ const transform = createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies);
239
+
240
+ const result = await transform(
241
+ "",
242
+ "/project/src/broken.component.ts",
243
+ "/nonexistent/path/broken.scss",
244
+ );
245
+
246
+ expect(result).toBe("/* SCSS compilation error */");
247
+ expect(scssErrors.length).toBeGreaterThan(0);
248
+ expect(scssErrors[0]).toContain("SCSS error");
249
+ });
250
+
251
+ it("SCSS 의존성이 scssDependencies에 기록된다", async () => {
252
+ const loadPaths: string[] = [];
253
+ const scssErrors: string[] = [];
254
+ const scssDependencies = new Map<string, Set<string>>();
255
+
256
+ const transform = createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies);
257
+
258
+ await transform(
259
+ ".host { color: red; }",
260
+ "/project/src/app.component.ts",
261
+ undefined,
262
+ );
263
+
264
+ expect(scssDependencies.has("/project/src/app.component.ts")).toBe(true);
265
+ });
266
+ });
267
+
268
+ // ─── buildScssLoadPaths ───
269
+
270
+ describe("buildScssLoadPaths", () => {
271
+ it("returns [pkgDir/scss, cwd/node_modules] for given NgtscBuildInfo", () => {
272
+ const info = {
273
+ name: "angular",
274
+ cwd: workspaceRoot,
275
+ pkgDir: angularPkgDir,
276
+ output: { js: true, dts: false },
277
+ };
278
+
279
+ const result = buildScssLoadPaths(info);
280
+
281
+ expect(result).toEqual([
282
+ join(angularPkgDir, "scss"),
283
+ join(workspaceRoot, "node_modules"),
284
+ ]);
285
+ });
286
+
287
+ it("uses cwd from info to construct node_modules path", () => {
288
+ const customCwd = "/custom/workspace";
289
+ const customPkgDir = "/custom/workspace/packages/my-pkg";
290
+
291
+ const result = buildScssLoadPaths({
292
+ name: "test",
293
+ cwd: customCwd,
294
+ pkgDir: customPkgDir,
295
+ output: { js: true, dts: false },
296
+ });
297
+
298
+ expect(result).toEqual([
299
+ join(customPkgDir, "scss"),
300
+ join(customCwd, "node_modules"),
301
+ ]);
302
+ });
303
+ });
@@ -57,7 +57,7 @@ describe("loadAndValidateConfig", () => {
57
57
  expect(mocks.loadSdConfig).toHaveBeenCalledWith({
58
58
  cwd: "/test",
59
59
  dev: false,
60
- options: [],
60
+ opt: [],
61
61
  });
62
62
  expect(mocks.validateTargets).toHaveBeenCalledWith(
63
63
  ["core-common"],
@@ -83,7 +83,7 @@ describe("loadAndValidateConfig", () => {
83
83
  expect(mocks.loadSdConfig).toHaveBeenCalledWith({
84
84
  cwd: "/test",
85
85
  dev: true,
86
- options: ["key=value"],
86
+ opt: ["key=value"],
87
87
  });
88
88
  expect(mocks.validateTargets).toHaveBeenCalledWith([], config.packages);
89
89
  expect(result).toBe(config);
@@ -22,7 +22,7 @@ vi.mock("jiti", () => ({
22
22
  const { loadSdConfig } = await import("../../src/utils/sd-config");
23
23
 
24
24
  describe("loadSdConfig", () => {
25
- const baseParams = { cwd: "/project", dev: true, options: [] as string[] };
25
+ const baseParams = { cwd: "/project", dev: true, opt: [] as string[] };
26
26
 
27
27
  beforeEach(() => {
28
28
  vi.clearAllMocks();
@@ -73,7 +73,7 @@ describe("loadSdConfig", () => {
73
73
  mockExists.mockResolvedValue(true);
74
74
  mockJitiImport.mockResolvedValue({ default: configFn });
75
75
 
76
- const params = { cwd: "/project", dev: true, options: ["key=val"] };
76
+ const params = { cwd: "/project", dev: true, opt: ["key=val"] };
77
77
  await loadSdConfig(params);
78
78
 
79
79
  expect(configFn).toHaveBeenCalledWith(params);
@@ -176,11 +176,12 @@ describe("runTscPackageBuild", () => {
176
176
  output: { js: true, dts: true },
177
177
  });
178
178
 
179
- // createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, options, host)
179
+ // createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, options, host, oldBuilderProgram)
180
180
  expect(vi.mocked(tsModule.default.createEmitAndSemanticDiagnosticsBuilderProgram)).toHaveBeenCalledWith(
181
181
  [SRC_INDEX, SRC_UTIL],
182
182
  expect.any(Object),
183
183
  expect.any(Object),
184
+ undefined,
184
185
  );
185
186
  });
186
187
 
@@ -198,6 +199,7 @@ describe("runTscPackageBuild", () => {
198
199
  [SRC_INDEX, SRC_UTIL],
199
200
  expect.any(Object),
200
201
  expect.any(Object),
202
+ undefined,
201
203
  );
202
204
  });
203
205
 
@@ -216,6 +218,7 @@ describe("runTscPackageBuild", () => {
216
218
  [SRC_INDEX, SRC_UTIL, TEST_INDEX],
217
219
  expect.any(Object),
218
220
  expect.any(Object),
221
+ undefined,
219
222
  );
220
223
  });
221
224