@analogjs/vite-plugin-angular 3.0.0-beta.12 → 3.0.0-beta.14

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/ngp/build.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "revision": "457071571225970890bd5a6baee21373d3960c37",
3
+ "wasmBindgen": "0.2.121"
4
+ }
@@ -0,0 +1,504 @@
1
+ class WasmAnalyzer {
2
+ __destroy_into_raw() {
3
+ const ptr = this.__wbg_ptr;
4
+ this.__wbg_ptr = 0;
5
+ WasmAnalyzerFinalization.unregister(this);
6
+ return ptr;
7
+ }
8
+ free() {
9
+ const ptr = this.__destroy_into_raw();
10
+ wasm.__wbg_wasmanalyzer_free(ptr, 0);
11
+ }
12
+ /**
13
+ * @returns {number}
14
+ */
15
+ analyze() {
16
+ const ret = wasm.wasmanalyzer_analyze(this.__wbg_ptr);
17
+ if (ret[2]) {
18
+ throw takeFromExternrefTable0(ret[1]);
19
+ }
20
+ return ret[0] >>> 0;
21
+ }
22
+ /**
23
+ * @returns {number}
24
+ */
25
+ analyze_delta() {
26
+ const ret = wasm.wasmanalyzer_analyze_delta(this.__wbg_ptr);
27
+ if (ret[2]) {
28
+ throw takeFromExternrefTable0(ret[1]);
29
+ }
30
+ return ret[0] >>> 0;
31
+ }
32
+ /**
33
+ * @returns {number}
34
+ */
35
+ analyze_optimized() {
36
+ const ret = wasm.wasmanalyzer_analyze_optimized(this.__wbg_ptr);
37
+ if (ret[2]) {
38
+ throw takeFromExternrefTable0(ret[1]);
39
+ }
40
+ return ret[0] >>> 0;
41
+ }
42
+ /**
43
+ * @returns {number}
44
+ */
45
+ analyze_optimized_delta() {
46
+ const ret = wasm.wasmanalyzer_analyze_optimized_delta(this.__wbg_ptr);
47
+ if (ret[2]) {
48
+ throw takeFromExternrefTable0(ret[1]);
49
+ }
50
+ return ret[0] >>> 0;
51
+ }
52
+ /**
53
+ * Releases the stream `id` when its consumer stops reading before it ends.
54
+ *
55
+ * Dropping the receiver closes the channel. The engine's sends to a closed channel
56
+ * are ignored, so the analysis is no longer observed but is not cancelled. The NAPI
57
+ * `AnalysisIterator` behaves the same way when it is dropped. Closing a stream that
58
+ * already ended, or an unknown id, does nothing.
59
+ * @param {number} id
60
+ */
61
+ close_stream(id) {
62
+ wasm.wasmanalyzer_close_stream(this.__wbg_ptr, id);
63
+ }
64
+ /**
65
+ * @param {string} file_path
66
+ * @returns {string}
67
+ */
68
+ get_file_content(file_path) {
69
+ let deferred3_0;
70
+ let deferred3_1;
71
+ try {
72
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
+ const len0 = WASM_VECTOR_LEN;
74
+ const ret = wasm.wasmanalyzer_get_file_content(this.__wbg_ptr, ptr0, len0);
75
+ var ptr2 = ret[0];
76
+ var len2 = ret[1];
77
+ if (ret[3]) {
78
+ ptr2 = 0; len2 = 0;
79
+ throw takeFromExternrefTable0(ret[2]);
80
+ }
81
+ deferred3_0 = ptr2;
82
+ deferred3_1 = len2;
83
+ return getStringFromWasm0(ptr2, len2);
84
+ } finally {
85
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
86
+ }
87
+ }
88
+ /**
89
+ * @param {string} file_path
90
+ * @returns {string | undefined}
91
+ */
92
+ get_metadata_for_file(file_path) {
93
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ const ret = wasm.wasmanalyzer_get_metadata_for_file(this.__wbg_ptr, ptr0, len0);
96
+ let v2;
97
+ if (ret[0] !== 0) {
98
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
99
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
100
+ }
101
+ return v2;
102
+ }
103
+ /**
104
+ * @param {string} template_path
105
+ * @returns {string | undefined}
106
+ */
107
+ get_ts_file_for_template(template_path) {
108
+ const ptr0 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
109
+ const len0 = WASM_VECTOR_LEN;
110
+ const ret = wasm.wasmanalyzer_get_ts_file_for_template(this.__wbg_ptr, ptr0, len0);
111
+ let v2;
112
+ if (ret[0] !== 0) {
113
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
114
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
115
+ }
116
+ return v2;
117
+ }
118
+ /**
119
+ * @param {string} updates_json
120
+ * @returns {string}
121
+ */
122
+ invalidate_files(updates_json) {
123
+ let deferred3_0;
124
+ let deferred3_1;
125
+ try {
126
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
127
+ const len0 = WASM_VECTOR_LEN;
128
+ const ret = wasm.wasmanalyzer_invalidate_files(this.__wbg_ptr, ptr0, len0);
129
+ var ptr2 = ret[0];
130
+ var len2 = ret[1];
131
+ if (ret[3]) {
132
+ ptr2 = 0; len2 = 0;
133
+ throw takeFromExternrefTable0(ret[2]);
134
+ }
135
+ deferred3_0 = ptr2;
136
+ deferred3_1 = len2;
137
+ return getStringFromWasm0(ptr2, len2);
138
+ } finally {
139
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
140
+ }
141
+ }
142
+ /**
143
+ * Constructs an analyzer with an optional JavaScript filesystem bridge (`WasmHostFs`).
144
+ * Without `host_fs`, only `virtualFiles` are visible.
145
+ * @param {string} options_json
146
+ * @param {any | null} [host_fs]
147
+ */
148
+ constructor(options_json, host_fs) {
149
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
150
+ const len0 = WASM_VECTOR_LEN;
151
+ const ret = wasm.wasmanalyzer_new(ptr0, len0, isLikeNone(host_fs) ? 0 : addToExternrefTable0(host_fs));
152
+ if (ret[2]) {
153
+ throw takeFromExternrefTable0(ret[1]);
154
+ }
155
+ this.__wbg_ptr = ret[0];
156
+ WasmAnalyzerFinalization.register(this, this.__wbg_ptr, this);
157
+ return this;
158
+ }
159
+ /**
160
+ * @returns {string | undefined}
161
+ */
162
+ pump() {
163
+ const ret = wasm.wasmanalyzer_pump(this.__wbg_ptr);
164
+ let v1;
165
+ if (ret[0] !== 0) {
166
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
167
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
168
+ }
169
+ return v1;
170
+ }
171
+ /**
172
+ * @param {string} containing_file
173
+ * @param {string} url
174
+ * @returns {string | undefined}
175
+ */
176
+ read_resource(containing_file, url) {
177
+ const ptr0 = passStringToWasm0(containing_file, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
180
+ const len1 = WASM_VECTOR_LEN;
181
+ const ret = wasm.wasmanalyzer_read_resource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
182
+ let v3;
183
+ if (ret[0] !== 0) {
184
+ v3 = getStringFromWasm0(ret[0], ret[1]).slice();
185
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
186
+ }
187
+ return v3;
188
+ }
189
+ /**
190
+ * @param {string} updates_json
191
+ * @returns {string}
192
+ */
193
+ update_file_content(updates_json) {
194
+ let deferred3_0;
195
+ let deferred3_1;
196
+ try {
197
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
198
+ const len0 = WASM_VECTOR_LEN;
199
+ const ret = wasm.wasmanalyzer_update_file_content(this.__wbg_ptr, ptr0, len0);
200
+ var ptr2 = ret[0];
201
+ var len2 = ret[1];
202
+ if (ret[3]) {
203
+ ptr2 = 0; len2 = 0;
204
+ throw takeFromExternrefTable0(ret[2]);
205
+ }
206
+ deferred3_0 = ptr2;
207
+ deferred3_1 = len2;
208
+ return getStringFromWasm0(ptr2, len2);
209
+ } finally {
210
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
211
+ }
212
+ }
213
+ }
214
+ if (Symbol.dispose) WasmAnalyzer.prototype[Symbol.dispose] = WasmAnalyzer.prototype.free;
215
+ exports.WasmAnalyzer = WasmAnalyzer;
216
+ function __wbg_get_imports() {
217
+ const import0 = {
218
+ __proto__: null,
219
+ __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
220
+ const v = arg0;
221
+ const ret = typeof(v) === 'boolean' ? v : undefined;
222
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
223
+ },
224
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
225
+ const ret = debugString(arg1);
226
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
227
+ const len1 = WASM_VECTOR_LEN;
228
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
229
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
230
+ },
231
+ __wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
232
+ const ret = arg0 === null;
233
+ return ret;
234
+ },
235
+ __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
236
+ const ret = arg0 === undefined;
237
+ return ret;
238
+ },
239
+ __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
240
+ const obj = arg1;
241
+ const ret = typeof(obj) === 'string' ? obj : undefined;
242
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
243
+ var len1 = WASM_VECTOR_LEN;
244
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
245
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
246
+ },
247
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
248
+ throw new Error(getStringFromWasm0(arg0, arg1));
249
+ },
250
+ __wbg_canonicalize_340920d4ffabb5d7: function() { return handleError(function (arg0, arg1, arg2) {
251
+ const ret = arg0.canonicalize(getStringFromWasm0(arg1, arg2));
252
+ return ret;
253
+ }, arguments); },
254
+ __wbg_from_fa561fa561dc8031: function(arg0) {
255
+ const ret = Array.from(arg0);
256
+ return ret;
257
+ },
258
+ __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
259
+ const ret = Reflect.get(arg0, arg1);
260
+ return ret;
261
+ }, arguments); },
262
+ __wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
263
+ const ret = arg0[arg1 >>> 0];
264
+ return ret;
265
+ },
266
+ __wbg_length_2591a0f4f659a55c: function(arg0) {
267
+ const ret = arg0.length;
268
+ return ret;
269
+ },
270
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
271
+ const ret = arg0.length;
272
+ return ret;
273
+ },
274
+ __wbg_metadata_9dbea9662d5b857f: function() { return handleError(function (arg0, arg1, arg2) {
275
+ const ret = arg0.metadata(getStringFromWasm0(arg1, arg2));
276
+ return ret;
277
+ }, arguments); },
278
+ __wbg_new_7ddec6de44ff8f5d: function(arg0) {
279
+ const ret = new Uint8Array(arg0);
280
+ return ret;
281
+ },
282
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
283
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
284
+ },
285
+ __wbg_readDir_142b210d10f8f3d2: function() { return handleError(function (arg0, arg1, arg2) {
286
+ const ret = arg0.readDir(getStringFromWasm0(arg1, arg2));
287
+ return ret;
288
+ }, arguments); },
289
+ __wbg_readLink_78ad4263ae7a3799: function() { return handleError(function (arg0, arg1, arg2) {
290
+ const ret = arg0.readLink(getStringFromWasm0(arg1, arg2));
291
+ return ret;
292
+ }, arguments); },
293
+ __wbg_read_7626d62703703c40: function() { return handleError(function (arg0, arg1, arg2) {
294
+ const ret = arg0.read(getStringFromWasm0(arg1, arg2));
295
+ return ret;
296
+ }, arguments); },
297
+ __wbg_symlinkMetadata_0b868d79fad776f9: function() { return handleError(function (arg0, arg1, arg2) {
298
+ const ret = arg0.symlinkMetadata(getStringFromWasm0(arg1, arg2));
299
+ return ret;
300
+ }, arguments); },
301
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
302
+ // Cast intrinsic for `Ref(String) -> Externref`.
303
+ const ret = getStringFromWasm0(arg0, arg1);
304
+ return ret;
305
+ },
306
+ __wbindgen_init_externref_table: function() {
307
+ const table = wasm.__wbindgen_externrefs;
308
+ const offset = table.grow(4);
309
+ table.set(0, undefined);
310
+ table.set(offset + 0, undefined);
311
+ table.set(offset + 1, null);
312
+ table.set(offset + 2, true);
313
+ table.set(offset + 3, false);
314
+ },
315
+ };
316
+ return {
317
+ __proto__: null,
318
+ "./ng_analyze_bg.js": import0,
319
+ };
320
+ }
321
+
322
+ const WasmAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
323
+ ? { register: () => {}, unregister: () => {} }
324
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmanalyzer_free(ptr, 1));
325
+
326
+ function addToExternrefTable0(obj) {
327
+ const idx = wasm.__externref_table_alloc();
328
+ wasm.__wbindgen_externrefs.set(idx, obj);
329
+ return idx;
330
+ }
331
+
332
+ function debugString(val) {
333
+ // primitive types
334
+ const type = typeof val;
335
+ if (type == 'number' || type == 'boolean' || val == null) {
336
+ return `${val}`;
337
+ }
338
+ if (type == 'string') {
339
+ return `"${val}"`;
340
+ }
341
+ if (type == 'symbol') {
342
+ const description = val.description;
343
+ if (description == null) {
344
+ return 'Symbol';
345
+ } else {
346
+ return `Symbol(${description})`;
347
+ }
348
+ }
349
+ if (type == 'function') {
350
+ const name = val.name;
351
+ if (typeof name == 'string' && name.length > 0) {
352
+ return `Function(${name})`;
353
+ } else {
354
+ return 'Function';
355
+ }
356
+ }
357
+ // objects
358
+ if (Array.isArray(val)) {
359
+ const length = val.length;
360
+ let debug = '[';
361
+ if (length > 0) {
362
+ debug += debugString(val[0]);
363
+ }
364
+ for(let i = 1; i < length; i++) {
365
+ debug += ', ' + debugString(val[i]);
366
+ }
367
+ debug += ']';
368
+ return debug;
369
+ }
370
+ // Test for built-in
371
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
372
+ let className;
373
+ if (builtInMatches && builtInMatches.length > 1) {
374
+ className = builtInMatches[1];
375
+ } else {
376
+ // Failed to match the standard '[object ClassName]'
377
+ return toString.call(val);
378
+ }
379
+ if (className == 'Object') {
380
+ // we're a user defined class or Object
381
+ // JSON.stringify avoids problems with cycles, and is generally much
382
+ // easier than looping through ownProperties of `val`.
383
+ try {
384
+ return 'Object(' + JSON.stringify(val) + ')';
385
+ } catch (_) {
386
+ return 'Object';
387
+ }
388
+ }
389
+ // errors
390
+ if (val instanceof Error) {
391
+ return `${val.name}: ${val.message}\n${val.stack}`;
392
+ }
393
+ // TODO we could test for more things here, like `Set`s and `Map`s.
394
+ return className;
395
+ }
396
+
397
+ function getArrayU8FromWasm0(ptr, len) {
398
+ ptr = ptr >>> 0;
399
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
400
+ }
401
+
402
+ let cachedDataViewMemory0 = null;
403
+ function getDataViewMemory0() {
404
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
405
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
406
+ }
407
+ return cachedDataViewMemory0;
408
+ }
409
+
410
+ function getStringFromWasm0(ptr, len) {
411
+ return decodeText(ptr >>> 0, len);
412
+ }
413
+
414
+ let cachedUint8ArrayMemory0 = null;
415
+ function getUint8ArrayMemory0() {
416
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
417
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
418
+ }
419
+ return cachedUint8ArrayMemory0;
420
+ }
421
+
422
+ function handleError(f, args) {
423
+ try {
424
+ return f.apply(this, args);
425
+ } catch (e) {
426
+ const idx = addToExternrefTable0(e);
427
+ wasm.__wbindgen_exn_store(idx);
428
+ }
429
+ }
430
+
431
+ function isLikeNone(x) {
432
+ return x === undefined || x === null;
433
+ }
434
+
435
+ function passStringToWasm0(arg, malloc, realloc) {
436
+ if (realloc === undefined) {
437
+ const buf = cachedTextEncoder.encode(arg);
438
+ const ptr = malloc(buf.length, 1) >>> 0;
439
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
440
+ WASM_VECTOR_LEN = buf.length;
441
+ return ptr;
442
+ }
443
+
444
+ let len = arg.length;
445
+ let ptr = malloc(len, 1) >>> 0;
446
+
447
+ const mem = getUint8ArrayMemory0();
448
+
449
+ let offset = 0;
450
+
451
+ for (; offset < len; offset++) {
452
+ const code = arg.charCodeAt(offset);
453
+ if (code > 0x7F) break;
454
+ mem[ptr + offset] = code;
455
+ }
456
+ if (offset !== len) {
457
+ if (offset !== 0) {
458
+ arg = arg.slice(offset);
459
+ }
460
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
461
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
462
+ const ret = cachedTextEncoder.encodeInto(arg, view);
463
+
464
+ offset += ret.written;
465
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
466
+ }
467
+
468
+ WASM_VECTOR_LEN = offset;
469
+ return ptr;
470
+ }
471
+
472
+ function takeFromExternrefTable0(idx) {
473
+ const value = wasm.__wbindgen_externrefs.get(idx);
474
+ wasm.__externref_table_dealloc(idx);
475
+ return value;
476
+ }
477
+
478
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
479
+ cachedTextDecoder.decode();
480
+ function decodeText(ptr, len) {
481
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
482
+ }
483
+
484
+ const cachedTextEncoder = new TextEncoder();
485
+
486
+ if (!('encodeInto' in cachedTextEncoder)) {
487
+ cachedTextEncoder.encodeInto = function (arg, view) {
488
+ const buf = cachedTextEncoder.encode(arg);
489
+ view.set(buf);
490
+ return {
491
+ read: arg.length,
492
+ written: buf.length
493
+ };
494
+ };
495
+ }
496
+
497
+ let WASM_VECTOR_LEN = 0;
498
+
499
+ const wasmPath = `${__dirname}/ng_analyze_bg.wasm`;
500
+ const wasmBytes = require('fs').readFileSync(wasmPath);
501
+ const wasmModule = new WebAssembly.Module(wasmBytes);
502
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
503
+ let wasm = wasmInstance.exports;
504
+ wasm.__wbindgen_start();
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/vite-plugin-angular",
3
- "version": "3.0.0-beta.12",
3
+ "version": "3.0.0-beta.14",
4
4
  "description": "Vite Plugin for Angular",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -44,7 +44,8 @@ export interface PluginOptions {
44
44
  liveReload?: boolean;
45
45
  /**
46
46
  * Skip semantic and Angular template diagnostics during compilation.
47
- * Defaults to `true`.
47
+ * Defaults to `true`, or `false` with `compilation: 'ngp'`, which requires
48
+ * `@typescript/native-preview`.
48
49
  */
49
50
  disableTypeChecking?: boolean;
50
51
  /**
@@ -54,11 +55,17 @@ export interface PluginOptions {
54
55
  fileReplacements?: FileReplacement[];
55
56
  /**
56
57
  * Opt into the fast compile path. Skips Angular's template type-checking
57
- * and routes compilation through an internal single-pass transform.
58
+ * and routes compilation through an internal single-pass transform when
59
+ * `compilation` is not specified.
58
60
  * Defaults to `false`.
59
61
  */
60
62
  fastCompile?: boolean;
61
63
  /**
64
+ * Selects the compilation path, overriding fastCompile. Defaults to 'ngtsc';
65
+ * 'ngp' is experimental and falls back to 'ngtsc' under Vitest's JIT default.
66
+ */
67
+ compilation?: "ngtsc" | "ngp";
68
+ /**
62
69
  * Compilation output mode used when `fastCompile` is enabled.
63
70
  * - `'full'` (default): Emit final Ivy definitions for application builds.
64
71
  * - `'partial'`: Emit partial declarations for library publishing.
@@ -26,6 +26,7 @@ import { StyleUrlsResolver, TemplateUrlsResolver } from "./component-resolvers.j
26
26
  import { augmentHostWithCaching, augmentHostWithModuleResolution, augmentHostWithResources, augmentProgramWithVersioning, mergeTransformers } from "./host.js";
27
27
  import { markStylePathSafe } from "./utils/safe-module-paths.js";
28
28
  import { fastCompilePlugin } from "./fast-compile-plugin.js";
29
+ import { ngpCompilePlugin } from "./ngp-compile-plugin.js";
29
30
  import { union } from "es-toolkit";
30
31
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
31
32
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -46,6 +47,8 @@ function angular(options) {
46
47
  let externalizeStylesRequested = false;
47
48
  let configureStylesheetRegistry;
48
49
  let transformFilter;
50
+ const isTest = process.env.NODE_ENV === "test" || !!process.env["VITEST"];
51
+ const compilation = options?.compilation === "ngp" && !(isTest && options.jit === void 0) ? "ngp" : "ngtsc";
49
52
  /**
50
53
  * Normalize plugin options so defaults
51
54
  * are used for values not provided.
@@ -57,9 +60,10 @@ function angular(options) {
57
60
  jit: options?.jit,
58
61
  include: options?.include ?? [],
59
62
  liveReload,
60
- disableTypeChecking: options?.disableTypeChecking ?? true,
63
+ disableTypeChecking: options?.disableTypeChecking ?? compilation !== "ngp",
61
64
  fileReplacements: options?.fileReplacements ?? [],
62
- fastCompile: options?.fastCompile ?? false,
65
+ fastCompile: options?.compilation === void 0 && (options?.fastCompile ?? false),
66
+ compilation,
63
67
  fastCompileMode: options?.fastCompileMode ?? "full",
64
68
  stylePreprocessor: void 0
65
69
  };
@@ -70,7 +74,6 @@ function angular(options) {
70
74
  let nextProgram;
71
75
  let cachedHost;
72
76
  let cachedHostKey;
73
- const isTest = process.env.NODE_ENV === "test" || !!process.env["VITEST"];
74
77
  const tsconfigResolver = new TsconfigResolver({
75
78
  workspaceRoot: pluginOptions.workspaceRoot,
76
79
  include: pluginOptions.include,
@@ -734,7 +737,8 @@ function angular(options) {
734
737
  delete sourceMap.sourceRoot;
735
738
  return JSON.stringify(sourceMap);
736
739
  }
737
- const compilationPlugin = pluginOptions.fastCompile ? fastCompilePlugin({
740
+ const createFastCompilePlugin = pluginOptions.compilation === "ngp" ? ngpCompilePlugin : fastCompilePlugin;
741
+ const compilationPlugin = pluginOptions.compilation === "ngp" || pluginOptions.fastCompile ? createFastCompilePlugin({
738
742
  tsconfigGetter: pluginOptions.tsconfigGetter,
739
743
  workspaceRoot: pluginOptions.workspaceRoot,
740
744
  inlineStylesExtension: pluginOptions.inlineStylesExtension,
@@ -742,7 +746,8 @@ function angular(options) {
742
746
  liveReload: pluginOptions.liveReload,
743
747
  isTest,
744
748
  isAstroIntegration,
745
- fastCompileMode: pluginOptions.fastCompileMode
749
+ fastCompileMode: pluginOptions.fastCompileMode,
750
+ disableTypeChecking: pluginOptions.disableTypeChecking
746
751
  }) : angularPlugin();
747
752
  return [
748
753
  cssExtensionStyleResolverPlugin(),
@@ -753,7 +758,7 @@ function angular(options) {
753
758
  fileEmitter
754
759
  }),
755
760
  compilationPlugin,
756
- !pluginOptions.fastCompile && pluginOptions.liveReload && liveReloadPlugin({
761
+ !pluginOptions.fastCompile && pluginOptions.compilation === "ngtsc" && pluginOptions.liveReload && liveReloadPlugin({
757
762
  classNames,
758
763
  fileEmitter
759
764
  }),