@analogjs/vite-plugin-angular 3.0.0-beta.9 → 3.0.1-beta.1

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 (164) hide show
  1. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js +3 -3
  2. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js.map +1 -1
  3. package/ngp/LICENSE +21 -0
  4. package/ngp/api.mjs +46806 -0
  5. package/ngp/build.json +4 -0
  6. package/ngp/ng_analyze.cjs +601 -0
  7. package/ngp/ng_analyze_bg.wasm +0 -0
  8. package/package.json +5 -2
  9. package/src/index.d.ts +2 -0
  10. package/src/index.js +4 -3
  11. package/src/index.js.map +1 -1
  12. package/src/lib/analog-plugin-interop.js +2 -3
  13. package/src/lib/angular-build-context.d.ts +217 -0
  14. package/src/lib/angular-build-context.js +374 -0
  15. package/src/lib/angular-build-context.js.map +1 -0
  16. package/src/lib/angular-build-optimizer-plugin.d.ts +6 -4
  17. package/src/lib/angular-build-optimizer-plugin.js +25 -11
  18. package/src/lib/angular-build-optimizer-plugin.js.map +1 -1
  19. package/src/lib/angular-jit-plugin.d.ts +5 -3
  20. package/src/lib/angular-jit-plugin.js +16 -9
  21. package/src/lib/angular-jit-plugin.js.map +1 -1
  22. package/src/lib/angular-vite-plugin.d.ts +6 -109
  23. package/src/lib/angular-vite-plugin.js +9 -1251
  24. package/src/lib/angular-vite-plugin.js.map +1 -1
  25. package/src/lib/angular-vitest-plugin.d.ts +3 -2
  26. package/src/lib/angular-vitest-plugin.js +7 -5
  27. package/src/lib/angular-vitest-plugin.js.map +1 -1
  28. package/src/lib/companion-plugins.d.ts +7 -0
  29. package/src/lib/companion-plugins.js +37 -0
  30. package/src/lib/companion-plugins.js.map +1 -0
  31. package/src/lib/compilation-api/compilation-api-plugin.d.ts +11 -2
  32. package/src/lib/compilation-api/compilation-api-plugin.js +164 -289
  33. package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -1
  34. package/src/lib/compilation-api/index.js +1 -2
  35. package/src/lib/compiler/angular-version.js +0 -1
  36. package/src/lib/compiler/class-field-lowering.js +1 -2
  37. package/src/lib/compiler/compile.d.ts +1 -1
  38. package/src/lib/compiler/compile.js +224 -151
  39. package/src/lib/compiler/compile.js.map +1 -1
  40. package/src/lib/compiler/constants.js +1 -2
  41. package/src/lib/compiler/debug.js +1 -2
  42. package/src/lib/compiler/defer.d.ts +2 -3
  43. package/src/lib/compiler/defer.js +13 -16
  44. package/src/lib/compiler/defer.js.map +1 -1
  45. package/src/lib/compiler/dts-reader.d.ts +6 -1
  46. package/src/lib/compiler/dts-reader.js +20 -12
  47. package/src/lib/compiler/dts-reader.js.map +1 -1
  48. package/src/lib/compiler/hmr.d.ts +4 -0
  49. package/src/lib/compiler/hmr.js +8 -4
  50. package/src/lib/compiler/hmr.js.map +1 -1
  51. package/src/lib/compiler/index.d.ts +2 -2
  52. package/src/lib/compiler/index.js +6 -6
  53. package/src/lib/compiler/jit-metadata.js +1 -2
  54. package/src/lib/compiler/jit-transform.js +37 -15
  55. package/src/lib/compiler/jit-transform.js.map +1 -1
  56. package/src/lib/compiler/js-emitter.d.ts +0 -3
  57. package/src/lib/compiler/js-emitter.js +4 -23
  58. package/src/lib/compiler/js-emitter.js.map +1 -1
  59. package/src/lib/compiler/metadata.js +2 -3
  60. package/src/lib/compiler/registry.d.ts +9 -1
  61. package/src/lib/compiler/registry.js +36 -8
  62. package/src/lib/compiler/registry.js.map +1 -1
  63. package/src/lib/compiler/resource-inliner.d.ts +8 -9
  64. package/src/lib/compiler/resource-inliner.js +11 -20
  65. package/src/lib/compiler/resource-inliner.js.map +1 -1
  66. package/src/lib/compiler/style-ast.d.ts +22 -1
  67. package/src/lib/compiler/style-ast.js +37 -20
  68. package/src/lib/compiler/style-ast.js.map +1 -1
  69. package/src/lib/compiler/type-elision.d.ts +4 -3
  70. package/src/lib/compiler/type-elision.js +11 -13
  71. package/src/lib/compiler/type-elision.js.map +1 -1
  72. package/src/lib/compiler/utils.d.ts +9 -7
  73. package/src/lib/compiler/utils.js +50 -11
  74. package/src/lib/compiler/utils.js.map +1 -1
  75. package/src/lib/compiler-plugin.js +1 -2
  76. package/src/lib/component-resolvers.js +1 -2
  77. package/src/lib/component-scanner.d.ts +101 -0
  78. package/src/lib/component-scanner.js +331 -0
  79. package/src/lib/component-scanner.js.map +1 -0
  80. package/src/lib/component-styles-plugin.d.ts +52 -0
  81. package/src/lib/component-styles-plugin.js +352 -0
  82. package/src/lib/component-styles-plugin.js.map +1 -0
  83. package/src/lib/compose-angular-plugins.d.ts +12 -0
  84. package/src/lib/compose-angular-plugins.js +30 -0
  85. package/src/lib/compose-angular-plugins.js.map +1 -0
  86. package/src/lib/dev-server-mode-plugin.d.ts +7 -0
  87. package/src/lib/dev-server-mode-plugin.js +22 -0
  88. package/src/lib/dev-server-mode-plugin.js.map +1 -0
  89. package/src/lib/encapsulation-plugin.js +1 -2
  90. package/src/lib/fast-compile-api.d.ts +62 -0
  91. package/src/lib/fast-compile-api.js +11 -0
  92. package/src/lib/fast-compile-api.js.map +1 -0
  93. package/src/lib/fast-compile-plugin.d.ts +6 -1
  94. package/src/lib/fast-compile-plugin.js +222 -117
  95. package/src/lib/fast-compile-plugin.js.map +1 -1
  96. package/src/lib/host.d.ts +3 -0
  97. package/src/lib/host.js +5 -4
  98. package/src/lib/host.js.map +1 -1
  99. package/src/lib/hot-update-batch.js +1 -2
  100. package/src/lib/live-reload-plugin.d.ts +8 -5
  101. package/src/lib/live-reload-plugin.js +45 -10
  102. package/src/lib/live-reload-plugin.js.map +1 -1
  103. package/src/lib/models.d.ts +4 -1
  104. package/src/lib/ngp-compile-api.d.ts +55 -0
  105. package/src/lib/ngp-compile-api.js +11 -0
  106. package/src/lib/ngp-compile-api.js.map +1 -0
  107. package/src/lib/ngp-compile-plugin.d.ts +4 -0
  108. package/src/lib/ngp-compile-plugin.js +680 -0
  109. package/src/lib/ngp-compile-plugin.js.map +1 -0
  110. package/src/lib/ngtsc-compile-plugin.d.ts +23 -0
  111. package/src/lib/ngtsc-compile-plugin.js +780 -0
  112. package/src/lib/ngtsc-compile-plugin.js.map +1 -0
  113. package/src/lib/nx-folder-plugin.d.ts +6 -5
  114. package/src/lib/nx-folder-plugin.js +13 -9
  115. package/src/lib/nx-folder-plugin.js.map +1 -1
  116. package/src/lib/plugins/file-replacements.plugin.d.ts +6 -0
  117. package/src/lib/plugins/file-replacements.plugin.js +2 -2
  118. package/src/lib/plugins/file-replacements.plugin.js.map +1 -1
  119. package/src/lib/router-plugin.d.ts +5 -1
  120. package/src/lib/router-plugin.js +14 -6
  121. package/src/lib/router-plugin.js.map +1 -1
  122. package/src/lib/style-preprocessor.js +1 -2
  123. package/src/lib/stylesheet-registry.js +1 -2
  124. package/src/lib/stylesheet-registry.js.map +1 -1
  125. package/src/lib/tools/src/builders/vite/vite-build.impl.js +2 -3
  126. package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
  127. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js +1 -2
  128. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js.map +1 -1
  129. package/src/lib/utils/compilation-shared.d.ts +1 -4
  130. package/src/lib/utils/compilation-shared.js +9 -8
  131. package/src/lib/utils/compilation-shared.js.map +1 -1
  132. package/src/lib/utils/css-extension-resolver.js +1 -2
  133. package/src/lib/utils/css-preprocessor-workers.js +1 -2
  134. package/src/lib/utils/debug-harness.js +1 -2
  135. package/src/lib/utils/debug-log-file.js +1 -2
  136. package/src/lib/utils/debug.js +1 -2
  137. package/src/lib/utils/devkit.js +2 -3
  138. package/src/lib/utils/hmr-component-updates.d.ts +7 -0
  139. package/src/lib/utils/hmr-component-updates.js +86 -0
  140. package/src/lib/utils/hmr-component-updates.js.map +1 -0
  141. package/src/lib/utils/jit-inline-styles.js +1 -2
  142. package/src/lib/utils/lsp-type-checker.d.ts +75 -0
  143. package/src/lib/utils/lsp-type-checker.js +532 -0
  144. package/src/lib/utils/lsp-type-checker.js.map +1 -0
  145. package/src/lib/utils/ngp-host-fs.d.ts +43 -0
  146. package/src/lib/utils/ngp-host-fs.js +128 -0
  147. package/src/lib/utils/ngp-host-fs.js.map +1 -0
  148. package/src/lib/utils/plugin-config.d.ts +15 -8
  149. package/src/lib/utils/plugin-config.js +19 -7
  150. package/src/lib/utils/plugin-config.js.map +1 -1
  151. package/src/lib/utils/rolldown.js +1 -2
  152. package/src/lib/utils/safe-module-paths.js +1 -2
  153. package/src/lib/utils/stylesheet-warning.d.ts +2 -0
  154. package/src/lib/utils/stylesheet-warning.js +10 -0
  155. package/src/lib/utils/stylesheet-warning.js.map +1 -0
  156. package/src/lib/utils/transform-cache.js +1 -2
  157. package/src/lib/utils/transform-cache.js.map +1 -1
  158. package/src/lib/utils/tsconfig-resolver.js +2 -3
  159. package/src/lib/utils/virtual-ids.js +1 -2
  160. package/src/lib/utils/virtual-resources.js +1 -2
  161. package/src/lib/utils/virtual-resources.js.map +1 -1
  162. package/src/lib/virtual-modules-plugin.d.ts +11 -3
  163. package/src/lib/virtual-modules-plugin.js +70 -15
  164. package/src/lib/virtual-modules-plugin.js.map +1 -1
package/ngp/build.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "revision": "943ec3bd8d609212d200158eedc8a513466a8368",
3
+ "wasmBindgen": "0.2.121"
4
+ }
@@ -0,0 +1,601 @@
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
+ * @param {string} paths_json
54
+ * @returns {string}
55
+ */
56
+ canonical_paths(paths_json) {
57
+ let deferred3_0;
58
+ let deferred3_1;
59
+ try {
60
+ const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
61
+ const len0 = WASM_VECTOR_LEN;
62
+ const ret = wasm.wasmanalyzer_canonical_paths(this.__wbg_ptr, ptr0, len0);
63
+ var ptr2 = ret[0];
64
+ var len2 = ret[1];
65
+ if (ret[3]) {
66
+ ptr2 = 0; len2 = 0;
67
+ throw takeFromExternrefTable0(ret[2]);
68
+ }
69
+ deferred3_0 = ptr2;
70
+ deferred3_1 = len2;
71
+ return getStringFromWasm0(ptr2, len2);
72
+ } finally {
73
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
74
+ }
75
+ }
76
+ /**
77
+ * @returns {string}
78
+ */
79
+ clear_resolution_cache() {
80
+ let deferred2_0;
81
+ let deferred2_1;
82
+ try {
83
+ const ret = wasm.wasmanalyzer_clear_resolution_cache(this.__wbg_ptr);
84
+ var ptr1 = ret[0];
85
+ var len1 = ret[1];
86
+ if (ret[3]) {
87
+ ptr1 = 0; len1 = 0;
88
+ throw takeFromExternrefTable0(ret[2]);
89
+ }
90
+ deferred2_0 = ptr1;
91
+ deferred2_1 = len1;
92
+ return getStringFromWasm0(ptr1, len1);
93
+ } finally {
94
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
95
+ }
96
+ }
97
+ /**
98
+ * Releases the stream or metadata request `id` when its consumer stops reading before it ends.
99
+ *
100
+ * Dropping the receiver closes the channel. The engine's sends to a closed channel
101
+ * are ignored, so the analysis is no longer observed but is not cancelled. The NAPI
102
+ * `AnalysisIterator` behaves the same way when it is dropped. Closing a stream that
103
+ * already ended, or an unknown id, does nothing.
104
+ * @param {number} id
105
+ */
106
+ close_stream(id) {
107
+ wasm.wasmanalyzer_close_stream(this.__wbg_ptr, id);
108
+ }
109
+ /**
110
+ * @returns {string}
111
+ */
112
+ get_compiler_options() {
113
+ let deferred1_0;
114
+ let deferred1_1;
115
+ try {
116
+ const ret = wasm.wasmanalyzer_get_compiler_options(this.__wbg_ptr);
117
+ deferred1_0 = ret[0];
118
+ deferred1_1 = ret[1];
119
+ return getStringFromWasm0(ret[0], ret[1]);
120
+ } finally {
121
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
122
+ }
123
+ }
124
+ /**
125
+ * @param {string} file_path
126
+ * @returns {string}
127
+ */
128
+ get_file_content(file_path) {
129
+ let deferred3_0;
130
+ let deferred3_1;
131
+ try {
132
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
133
+ const len0 = WASM_VECTOR_LEN;
134
+ const ret = wasm.wasmanalyzer_get_file_content(this.__wbg_ptr, ptr0, len0);
135
+ var ptr2 = ret[0];
136
+ var len2 = ret[1];
137
+ if (ret[3]) {
138
+ ptr2 = 0; len2 = 0;
139
+ throw takeFromExternrefTable0(ret[2]);
140
+ }
141
+ deferred3_0 = ptr2;
142
+ deferred3_1 = len2;
143
+ return getStringFromWasm0(ptr2, len2);
144
+ } finally {
145
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
146
+ }
147
+ }
148
+ /**
149
+ * @param {string} file_path
150
+ * @returns {string | undefined}
151
+ */
152
+ get_metadata_for_file(file_path) {
153
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
154
+ const len0 = WASM_VECTOR_LEN;
155
+ const ret = wasm.wasmanalyzer_get_metadata_for_file(this.__wbg_ptr, ptr0, len0);
156
+ let v2;
157
+ if (ret[0] !== 0) {
158
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
159
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
160
+ }
161
+ return v2;
162
+ }
163
+ /**
164
+ * @param {string} template_path
165
+ * @returns {string | undefined}
166
+ */
167
+ get_ts_file_for_template(template_path) {
168
+ const ptr0 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ const len0 = WASM_VECTOR_LEN;
170
+ const ret = wasm.wasmanalyzer_get_ts_file_for_template(this.__wbg_ptr, ptr0, len0);
171
+ let v2;
172
+ if (ret[0] !== 0) {
173
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
174
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
175
+ }
176
+ return v2;
177
+ }
178
+ /**
179
+ * @param {string} updates_json
180
+ * @returns {string}
181
+ */
182
+ invalidate_files(updates_json) {
183
+ let deferred3_0;
184
+ let deferred3_1;
185
+ try {
186
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
187
+ const len0 = WASM_VECTOR_LEN;
188
+ const ret = wasm.wasmanalyzer_invalidate_files(this.__wbg_ptr, ptr0, len0);
189
+ var ptr2 = ret[0];
190
+ var len2 = ret[1];
191
+ if (ret[3]) {
192
+ ptr2 = 0; len2 = 0;
193
+ throw takeFromExternrefTable0(ret[2]);
194
+ }
195
+ deferred3_0 = ptr2;
196
+ deferred3_1 = len2;
197
+ return getStringFromWasm0(ptr2, len2);
198
+ } finally {
199
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
200
+ }
201
+ }
202
+ /**
203
+ * Constructs an analyzer with an optional JavaScript filesystem bridge (`WasmHostFs`).
204
+ * Without `host_fs`, only `virtualFiles` are visible.
205
+ * @param {string} options_json
206
+ * @param {any | null} [host_fs]
207
+ */
208
+ constructor(options_json, host_fs) {
209
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
210
+ const len0 = WASM_VECTOR_LEN;
211
+ const ret = wasm.wasmanalyzer_new(ptr0, len0, isLikeNone(host_fs) ? 0 : addToExternrefTable0(host_fs));
212
+ if (ret[2]) {
213
+ throw takeFromExternrefTable0(ret[1]);
214
+ }
215
+ this.__wbg_ptr = ret[0];
216
+ WasmAnalyzerFinalization.register(this, this.__wbg_ptr, this);
217
+ return this;
218
+ }
219
+ /**
220
+ * @returns {string | undefined}
221
+ */
222
+ pump() {
223
+ const ret = wasm.wasmanalyzer_pump(this.__wbg_ptr);
224
+ let v1;
225
+ if (ret[0] !== 0) {
226
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
227
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
228
+ }
229
+ return v1;
230
+ }
231
+ /**
232
+ * @param {string} containing_file
233
+ * @param {string} url
234
+ * @returns {string | undefined}
235
+ */
236
+ read_resource(containing_file, url) {
237
+ const ptr0 = passStringToWasm0(containing_file, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
+ const len0 = WASM_VECTOR_LEN;
239
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len1 = WASM_VECTOR_LEN;
241
+ const ret = wasm.wasmanalyzer_read_resource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
242
+ let v3;
243
+ if (ret[0] !== 0) {
244
+ v3 = getStringFromWasm0(ret[0], ret[1]).slice();
245
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
246
+ }
247
+ return v3;
248
+ }
249
+ /**
250
+ * @param {string} module_ref_json
251
+ * @returns {number}
252
+ */
253
+ request_metadata(module_ref_json) {
254
+ const ptr0 = passStringToWasm0(module_ref_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ const ret = wasm.wasmanalyzer_request_metadata(this.__wbg_ptr, ptr0, len0);
257
+ if (ret[2]) {
258
+ throw takeFromExternrefTable0(ret[1]);
259
+ }
260
+ return ret[0] >>> 0;
261
+ }
262
+ /**
263
+ * @param {string} entry_points_json
264
+ * @returns {string}
265
+ */
266
+ set_entry_points(entry_points_json) {
267
+ let deferred3_0;
268
+ let deferred3_1;
269
+ try {
270
+ const ptr0 = passStringToWasm0(entry_points_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
271
+ const len0 = WASM_VECTOR_LEN;
272
+ const ret = wasm.wasmanalyzer_set_entry_points(this.__wbg_ptr, ptr0, len0);
273
+ var ptr2 = ret[0];
274
+ var len2 = ret[1];
275
+ if (ret[3]) {
276
+ ptr2 = 0; len2 = 0;
277
+ throw takeFromExternrefTable0(ret[2]);
278
+ }
279
+ deferred3_0 = ptr2;
280
+ deferred3_1 = len2;
281
+ return getStringFromWasm0(ptr2, len2);
282
+ } finally {
283
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
284
+ }
285
+ }
286
+ /**
287
+ * @param {string} updates_json
288
+ * @returns {string}
289
+ */
290
+ update_file_content(updates_json) {
291
+ let deferred3_0;
292
+ let deferred3_1;
293
+ try {
294
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
295
+ const len0 = WASM_VECTOR_LEN;
296
+ const ret = wasm.wasmanalyzer_update_file_content(this.__wbg_ptr, ptr0, len0);
297
+ var ptr2 = ret[0];
298
+ var len2 = ret[1];
299
+ if (ret[3]) {
300
+ ptr2 = 0; len2 = 0;
301
+ throw takeFromExternrefTable0(ret[2]);
302
+ }
303
+ deferred3_0 = ptr2;
304
+ deferred3_1 = len2;
305
+ return getStringFromWasm0(ptr2, len2);
306
+ } finally {
307
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
308
+ }
309
+ }
310
+ }
311
+ if (Symbol.dispose) WasmAnalyzer.prototype[Symbol.dispose] = WasmAnalyzer.prototype.free;
312
+ exports.WasmAnalyzer = WasmAnalyzer;
313
+ function __wbg_get_imports() {
314
+ const import0 = {
315
+ __proto__: null,
316
+ __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
317
+ const v = arg0;
318
+ const ret = typeof(v) === 'boolean' ? v : undefined;
319
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
320
+ },
321
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
322
+ const ret = debugString(arg1);
323
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
324
+ const len1 = WASM_VECTOR_LEN;
325
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
326
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
327
+ },
328
+ __wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
329
+ const ret = arg0 === null;
330
+ return ret;
331
+ },
332
+ __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
333
+ const ret = arg0 === undefined;
334
+ return ret;
335
+ },
336
+ __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
337
+ const obj = arg1;
338
+ const ret = typeof(obj) === 'string' ? obj : undefined;
339
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
340
+ var len1 = WASM_VECTOR_LEN;
341
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
342
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
343
+ },
344
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
345
+ throw new Error(getStringFromWasm0(arg0, arg1));
346
+ },
347
+ __wbg_canonicalize_340920d4ffabb5d7: function() { return handleError(function (arg0, arg1, arg2) {
348
+ const ret = arg0.canonicalize(getStringFromWasm0(arg1, arg2));
349
+ return ret;
350
+ }, arguments); },
351
+ __wbg_from_fa561fa561dc8031: function(arg0) {
352
+ const ret = Array.from(arg0);
353
+ return ret;
354
+ },
355
+ __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
356
+ const ret = Reflect.get(arg0, arg1);
357
+ return ret;
358
+ }, arguments); },
359
+ __wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
360
+ const ret = arg0[arg1 >>> 0];
361
+ return ret;
362
+ },
363
+ __wbg_length_2591a0f4f659a55c: function(arg0) {
364
+ const ret = arg0.length;
365
+ return ret;
366
+ },
367
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
368
+ const ret = arg0.length;
369
+ return ret;
370
+ },
371
+ __wbg_metadata_9dbea9662d5b857f: function() { return handleError(function (arg0, arg1, arg2) {
372
+ const ret = arg0.metadata(getStringFromWasm0(arg1, arg2));
373
+ return ret;
374
+ }, arguments); },
375
+ __wbg_new_7ddec6de44ff8f5d: function(arg0) {
376
+ const ret = new Uint8Array(arg0);
377
+ return ret;
378
+ },
379
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
380
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
381
+ },
382
+ __wbg_readDir_142b210d10f8f3d2: function() { return handleError(function (arg0, arg1, arg2) {
383
+ const ret = arg0.readDir(getStringFromWasm0(arg1, arg2));
384
+ return ret;
385
+ }, arguments); },
386
+ __wbg_readLink_78ad4263ae7a3799: function() { return handleError(function (arg0, arg1, arg2) {
387
+ const ret = arg0.readLink(getStringFromWasm0(arg1, arg2));
388
+ return ret;
389
+ }, arguments); },
390
+ __wbg_read_7626d62703703c40: function() { return handleError(function (arg0, arg1, arg2) {
391
+ const ret = arg0.read(getStringFromWasm0(arg1, arg2));
392
+ return ret;
393
+ }, arguments); },
394
+ __wbg_symlinkMetadata_0b868d79fad776f9: function() { return handleError(function (arg0, arg1, arg2) {
395
+ const ret = arg0.symlinkMetadata(getStringFromWasm0(arg1, arg2));
396
+ return ret;
397
+ }, arguments); },
398
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
399
+ // Cast intrinsic for `Ref(String) -> Externref`.
400
+ const ret = getStringFromWasm0(arg0, arg1);
401
+ return ret;
402
+ },
403
+ __wbindgen_init_externref_table: function() {
404
+ const table = wasm.__wbindgen_externrefs;
405
+ const offset = table.grow(4);
406
+ table.set(0, undefined);
407
+ table.set(offset + 0, undefined);
408
+ table.set(offset + 1, null);
409
+ table.set(offset + 2, true);
410
+ table.set(offset + 3, false);
411
+ },
412
+ };
413
+ return {
414
+ __proto__: null,
415
+ "./ng_analyze_bg.js": import0,
416
+ };
417
+ }
418
+
419
+ const WasmAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
420
+ ? { register: () => {}, unregister: () => {} }
421
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmanalyzer_free(ptr, 1));
422
+
423
+ function addToExternrefTable0(obj) {
424
+ const idx = wasm.__externref_table_alloc();
425
+ wasm.__wbindgen_externrefs.set(idx, obj);
426
+ return idx;
427
+ }
428
+
429
+ function debugString(val) {
430
+ // primitive types
431
+ const type = typeof val;
432
+ if (type == 'number' || type == 'boolean' || val == null) {
433
+ return `${val}`;
434
+ }
435
+ if (type == 'string') {
436
+ return `"${val}"`;
437
+ }
438
+ if (type == 'symbol') {
439
+ const description = val.description;
440
+ if (description == null) {
441
+ return 'Symbol';
442
+ } else {
443
+ return `Symbol(${description})`;
444
+ }
445
+ }
446
+ if (type == 'function') {
447
+ const name = val.name;
448
+ if (typeof name == 'string' && name.length > 0) {
449
+ return `Function(${name})`;
450
+ } else {
451
+ return 'Function';
452
+ }
453
+ }
454
+ // objects
455
+ if (Array.isArray(val)) {
456
+ const length = val.length;
457
+ let debug = '[';
458
+ if (length > 0) {
459
+ debug += debugString(val[0]);
460
+ }
461
+ for(let i = 1; i < length; i++) {
462
+ debug += ', ' + debugString(val[i]);
463
+ }
464
+ debug += ']';
465
+ return debug;
466
+ }
467
+ // Test for built-in
468
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
469
+ let className;
470
+ if (builtInMatches && builtInMatches.length > 1) {
471
+ className = builtInMatches[1];
472
+ } else {
473
+ // Failed to match the standard '[object ClassName]'
474
+ return toString.call(val);
475
+ }
476
+ if (className == 'Object') {
477
+ // we're a user defined class or Object
478
+ // JSON.stringify avoids problems with cycles, and is generally much
479
+ // easier than looping through ownProperties of `val`.
480
+ try {
481
+ return 'Object(' + JSON.stringify(val) + ')';
482
+ } catch (_) {
483
+ return 'Object';
484
+ }
485
+ }
486
+ // errors
487
+ if (val instanceof Error) {
488
+ return `${val.name}: ${val.message}\n${val.stack}`;
489
+ }
490
+ // TODO we could test for more things here, like `Set`s and `Map`s.
491
+ return className;
492
+ }
493
+
494
+ function getArrayU8FromWasm0(ptr, len) {
495
+ ptr = ptr >>> 0;
496
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
497
+ }
498
+
499
+ let cachedDataViewMemory0 = null;
500
+ function getDataViewMemory0() {
501
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
502
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
503
+ }
504
+ return cachedDataViewMemory0;
505
+ }
506
+
507
+ function getStringFromWasm0(ptr, len) {
508
+ return decodeText(ptr >>> 0, len);
509
+ }
510
+
511
+ let cachedUint8ArrayMemory0 = null;
512
+ function getUint8ArrayMemory0() {
513
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
514
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
515
+ }
516
+ return cachedUint8ArrayMemory0;
517
+ }
518
+
519
+ function handleError(f, args) {
520
+ try {
521
+ return f.apply(this, args);
522
+ } catch (e) {
523
+ const idx = addToExternrefTable0(e);
524
+ wasm.__wbindgen_exn_store(idx);
525
+ }
526
+ }
527
+
528
+ function isLikeNone(x) {
529
+ return x === undefined || x === null;
530
+ }
531
+
532
+ function passStringToWasm0(arg, malloc, realloc) {
533
+ if (realloc === undefined) {
534
+ const buf = cachedTextEncoder.encode(arg);
535
+ const ptr = malloc(buf.length, 1) >>> 0;
536
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
537
+ WASM_VECTOR_LEN = buf.length;
538
+ return ptr;
539
+ }
540
+
541
+ let len = arg.length;
542
+ let ptr = malloc(len, 1) >>> 0;
543
+
544
+ const mem = getUint8ArrayMemory0();
545
+
546
+ let offset = 0;
547
+
548
+ for (; offset < len; offset++) {
549
+ const code = arg.charCodeAt(offset);
550
+ if (code > 0x7F) break;
551
+ mem[ptr + offset] = code;
552
+ }
553
+ if (offset !== len) {
554
+ if (offset !== 0) {
555
+ arg = arg.slice(offset);
556
+ }
557
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
558
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
559
+ const ret = cachedTextEncoder.encodeInto(arg, view);
560
+
561
+ offset += ret.written;
562
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
563
+ }
564
+
565
+ WASM_VECTOR_LEN = offset;
566
+ return ptr;
567
+ }
568
+
569
+ function takeFromExternrefTable0(idx) {
570
+ const value = wasm.__wbindgen_externrefs.get(idx);
571
+ wasm.__externref_table_dealloc(idx);
572
+ return value;
573
+ }
574
+
575
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
576
+ cachedTextDecoder.decode();
577
+ function decodeText(ptr, len) {
578
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
579
+ }
580
+
581
+ const cachedTextEncoder = new TextEncoder();
582
+
583
+ if (!('encodeInto' in cachedTextEncoder)) {
584
+ cachedTextEncoder.encodeInto = function (arg, view) {
585
+ const buf = cachedTextEncoder.encode(arg);
586
+ view.set(buf);
587
+ return {
588
+ read: arg.length,
589
+ written: buf.length
590
+ };
591
+ };
592
+ }
593
+
594
+ let WASM_VECTOR_LEN = 0;
595
+
596
+ const wasmPath = `${__dirname}/ng_analyze_bg.wasm`;
597
+ const wasmBytes = require('fs').readFileSync(wasmPath);
598
+ const wasmModule = new WebAssembly.Module(wasmBytes);
599
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
600
+ let wasm = wasmInstance.exports;
601
+ 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.9",
3
+ "version": "3.0.1-beta.1",
4
4
  "description": "Vite Plugin for Angular",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -53,9 +53,12 @@
53
53
  "obug": "^2.1.1",
54
54
  "oxc-parser": "^0.124.0",
55
55
  "oxc-resolver": "^11.19.1",
56
- "rolldown": "^1.0.0-rc.13",
56
+ "rolldown": "^1.3.1",
57
57
  "tinyglobby": "^0.2.15"
58
58
  },
59
+ "devDependencies": {
60
+ "@angular/build": "22.3.0"
61
+ },
59
62
  "builders": "./src/lib/tools/builders.json",
60
63
  "ng-update": {
61
64
  "packageGroup": [
package/src/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { angular } from "./lib/angular-vite-plugin.js";
3
3
  export { angular } from "./lib/angular-vite-plugin.js";
4
4
  export type { PluginOptions } from "./lib/angular-vite-plugin.js";
5
5
  export type { AnalogIntegrationPlugin, AnalogPluginContext, AnalogPluginHooks, ComponentRegistryEntries, StylesheetRegistryConfigurator, StylesheetRegistryContext, TransformFilter } from "./lib/analog-plugin-interop.js";
6
+ export { findFastCompileApi, type FastCompileApi, type FastCompileOptions, type FastCompileResolve, type FastCompileSourceFormat, type SourceMapInput } from "./lib/fast-compile-api.js";
7
+ export { findNgpCompileApi, type NgpCompileApi, type NgpLowerContext, type NgpLoweredModule, type NgpSourceFormat } from "./lib/ngp-compile-api.js";
6
8
  export type { RegistryEntry as ComponentRegistryEntry, RegistryInput as ComponentRegistryInput } from "./lib/compiler/registry.js";
7
9
  export type { StylePreprocessor, StylesheetDependency, StylesheetDiagnostic, StylesheetRegistryReader, StylesheetTransformContext, StylesheetTransformResult } from "./lib/style-preprocessor.js";
8
10
  export default angular;
package/src/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { angularCompilationPlugin } from "./lib/compilation-api/compilation-api-plugin.js";
2
2
  import "./lib/compilation-api/index.js";
3
3
  import { angular } from "./lib/angular-vite-plugin.js";
4
- //#region packages/vite-plugin-angular/src/index.ts
4
+ import { findFastCompileApi } from "./lib/fast-compile-api.js";
5
+ import { findNgpCompileApi } from "./lib/ngp-compile-api.js";
6
+ // packages/vite-plugin-angular/src/index.ts
5
7
  var src_default = angular;
6
- //#endregion
7
- export { angular, angularCompilationPlugin, src_default as default };
8
+ export { angular, angularCompilationPlugin, src_default as default, findFastCompileApi, findNgpCompileApi };
8
9
 
9
10
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {\n angularCompilationPlugin,\n type AngularCompilationPluginOptions,\n} from './lib/compilation-api/index.js';\nimport { angular } from './lib/angular-vite-plugin.js';\nexport { angular } from './lib/angular-vite-plugin.js';\nexport type { PluginOptions } from './lib/angular-vite-plugin.js';\nexport type {\n AnalogIntegrationPlugin,\n AnalogPluginContext,\n AnalogPluginHooks,\n ComponentRegistryEntries,\n StylesheetRegistryConfigurator,\n StylesheetRegistryContext,\n TransformFilter,\n} from './lib/analog-plugin-interop.js';\nexport type {\n RegistryEntry as ComponentRegistryEntry,\n RegistryInput as ComponentRegistryInput,\n} from './lib/compiler/registry.js';\nexport type {\n StylePreprocessor,\n StylesheetDependency,\n StylesheetDiagnostic,\n StylesheetRegistryReader,\n StylesheetTransformContext,\n StylesheetTransformResult,\n} from './lib/style-preprocessor.js';\n\nexport default angular;\n"],"mappings":";;;;AA6BA,IAAA,cAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {\n angularCompilationPlugin,\n type AngularCompilationPluginOptions,\n} from './lib/compilation-api/index.js';\nimport { angular } from './lib/angular-vite-plugin.js';\nexport { angular } from './lib/angular-vite-plugin.js';\nexport type { PluginOptions } from './lib/angular-vite-plugin.js';\nexport type {\n AnalogIntegrationPlugin,\n AnalogPluginContext,\n AnalogPluginHooks,\n ComponentRegistryEntries,\n StylesheetRegistryConfigurator,\n StylesheetRegistryContext,\n TransformFilter,\n} from './lib/analog-plugin-interop.js';\nexport {\n findFastCompileApi,\n type FastCompileApi,\n type FastCompileOptions,\n type FastCompileResolve,\n type FastCompileSourceFormat,\n type SourceMapInput,\n} from './lib/fast-compile-api.js';\nexport {\n findNgpCompileApi,\n type NgpCompileApi,\n type NgpLowerContext,\n type NgpLoweredModule,\n type NgpSourceFormat,\n} from './lib/ngp-compile-api.js';\nexport type {\n RegistryEntry as ComponentRegistryEntry,\n RegistryInput as ComponentRegistryInput,\n} from './lib/compiler/registry.js';\nexport type {\n StylePreprocessor,\n StylesheetDependency,\n StylesheetDiagnostic,\n StylesheetRegistryReader,\n StylesheetTransformContext,\n StylesheetTransformResult,\n} from './lib/style-preprocessor.js';\n\nexport default angular;\n"],"mappings":";;;;;;AA4CA,IAAA,cAAe"}
@@ -1,6 +1,6 @@
1
- import { debugStylePipeline } from "./utils/debug.js";
2
1
  import { composeStylePreprocessors } from "./style-preprocessor.js";
3
- //#region packages/vite-plugin-angular/src/lib/analog-plugin-interop.ts
2
+ import { debugStylePipeline } from "./utils/debug.js";
3
+ // packages/vite-plugin-angular/src/lib/analog-plugin-interop.ts
4
4
  var integrationsByConfig = /* @__PURE__ */ new WeakMap();
5
5
  /**
6
6
  * Runs every `analog.setup()` hook found in the resolved Vite plugin list,
@@ -91,7 +91,6 @@ function wrapRegistryConfigurator(pluginName, configure) {
91
91
  function describeError(error) {
92
92
  return error instanceof Error ? error.message : String(error);
93
93
  }
94
- //#endregion
95
94
  export { discoverAnalogIntegrations, runAnalogSetupHooks };
96
95
 
97
96
  //# sourceMappingURL=analog-plugin-interop.js.map