@stencil/core 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (50) hide show
  1. package/dist/app-data/index.d.ts +2 -0
  2. package/dist/{runtime/app-data → app-data}/index.js +17 -12
  3. package/dist/{client-B1nuvCd2.mjs → client-aTQ7xHxx.mjs} +2432 -2278
  4. package/dist/compiler/index.d.mts +6 -6
  5. package/dist/compiler/index.mjs +2 -2
  6. package/dist/compiler/utils/index.d.mts +2 -2
  7. package/dist/compiler/utils/index.mjs +3 -3
  8. package/dist/{compiler-LX4_RKKd.mjs → compiler-DCN7Np2A.mjs} +14854 -13500
  9. package/dist/declarations/stencil-public-compiler.d.ts +4374 -2
  10. package/dist/declarations/stencil-public-compiler.js +2 -4
  11. package/dist/declarations/stencil-public-docs.d.ts +504 -1
  12. package/dist/declarations/stencil-public-runtime.d.ts +1982 -2
  13. package/dist/{index-fIuYTL9f.d.mts → index-BvkyxSY6.d.mts} +29 -2
  14. package/dist/{index-D-LlB2nw.d.mts → index-vY35H18z.d.mts} +795 -1188
  15. package/dist/{index-BONzXKJt.d.ts → index-xAkMgLX_.d.ts} +88 -39
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/jsx-runtime.d.mts +18 -0
  19. package/dist/jsx-runtime.mjs +2 -0
  20. package/dist/{node-SxQIOCZE.mjs → node--akYC-sG.mjs} +20 -30
  21. package/dist/regular-expression-CFVJOTUh.mjs +508 -0
  22. package/dist/{runtime-CF9DJtSu.js → runtime/client/lazy.js} +2675 -2493
  23. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +106 -78
  24. package/dist/runtime/client/{index.js → runtime.js} +2545 -2487
  25. package/dist/runtime/index.d.ts +58 -29
  26. package/dist/runtime/index.js +4795 -2
  27. package/dist/runtime/server/index.d.mts +103 -70
  28. package/dist/runtime/server/index.mjs +2545 -2350
  29. package/dist/runtime/server/runner.d.mts +44 -48
  30. package/dist/runtime/server/runner.mjs +347 -751
  31. package/dist/signals/index.d.ts +47 -0
  32. package/dist/signals/index.js +199 -0
  33. package/dist/sys/node/index.d.mts +1 -1
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.mjs +2 -2
  36. package/dist/testing/index.d.mts +97 -3
  37. package/dist/testing/index.mjs +367 -59
  38. package/dist/{validation-CaCgjw-f.mjs → validation-ByxKj8bC.mjs} +116 -99
  39. package/package.json +47 -38
  40. package/dist/index-CHjZtib0.d.ts +0 -30
  41. package/dist/jsx-runtime-DBzBJLKk.d.ts +0 -28
  42. package/dist/jsx-runtime.d.ts +0 -2
  43. package/dist/jsx-runtime.js +0 -2
  44. package/dist/runtime/app-data/index.d.ts +0 -2
  45. package/dist/serialize-BkYHk7Mi.mjs +0 -766
  46. package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
  47. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
  48. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  49. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
  50. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -1,7 +1,7 @@
1
- import { t as __exportAll } from "./chunk-CjcI7cDX.mjs";
2
- import { A as CUSTOM, B as DOCS_CUSTOM, C as toDashCase, D as CMP_FLAGS, F as DIST_GLOBAL_STYLES, H as DOCS_JSON, I as DIST_HYDRATE_SCRIPT, K as GENERATED_DTS, L as DIST_LAZY, M as DIST, N as DIST_COLLECTION, P as DIST_CUSTOM_ELEMENTS, R as DIST_LAZY_LOADER, U as DOCS_README, V as DOCS_CUSTOM_ELEMENTS_MANIFEST, W as DOCS_VSCODE, X as MEMBER_FLAGS, Y as LISTENER_FLAGS, _ as isString, c as flatOne, it as VALID_CONFIG_OUTPUT_TARGETS, k as COPY, m as isIterable, o as dashToPascalCase, ot as WATCH_FLAGS, s as escapeWithPattern, tt as STATS, w as toTitleCase, x as sortBy, z as DIST_TYPES } from "./serialize-BkYHk7Mi.mjs";
1
+ import { t as __exportAll } from "./chunk-z9aeyW2b.mjs";
2
+ import { $ as VALID_CONFIG_OUTPUT_TARGETS, C as ASSETS, F as DOCS_README, H as LISTENER_FLAGS, I as DOCS_VSCODE, J as STANDALONE, M as DOCS_CUSTOM, N as DOCS_CUSTOM_ELEMENTS_MANIFEST, O as COPY, P as DOCS_JSON, Q as TYPES, R as GENERATED_DTS, T as COLLECTION, U as LOADER_BUNDLE, W as MEMBER_FLAGS, Y as STATS, _ as sortBy, b as toTitleCase, et as WATCH_FLAGS, i as flatOne, j as DIST_LAZY, k as CUSTOM, n as dashToPascalCase, p as isString, q as SSR_WASM, r as escapeWithPattern, u as isIterable, w as CMP_FLAGS, y as toDashCase, z as GLOBAL_STYLE } from "./regular-expression-CFVJOTUh.mjs";
3
3
  import path, { basename, dirname, relative } from "node:path";
4
- import { minimatch } from "minimatch";
4
+ import picomatch from "picomatch";
5
5
  //#region src/utils/byte-size.ts
6
6
  /**
7
7
  * Used to learn the size of a string in bytes.
@@ -29,12 +29,19 @@ const formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
29
29
  flags |= CMP_FLAGS.shadowDomEncapsulation;
30
30
  if (compilerMeta.shadowDelegatesFocus) flags |= CMP_FLAGS.shadowDelegatesFocus;
31
31
  if (compilerMeta.slotAssignment === "manual") flags |= CMP_FLAGS.shadowSlotAssignmentManual;
32
+ if (compilerMeta.shadowMode === "closed") flags |= CMP_FLAGS.shadowModeClosed;
32
33
  } else if (compilerMeta.encapsulation === "scoped") flags |= CMP_FLAGS.scopedCssEncapsulation;
33
34
  if (compilerMeta.formAssociated) flags |= CMP_FLAGS.formAssociated;
34
35
  if (compilerMeta.encapsulation !== "shadow" && compilerMeta.htmlTagNames.includes("slot")) flags |= CMP_FLAGS.hasSlotRelocation;
35
36
  if (compilerMeta.hasSlot) flags |= CMP_FLAGS.hasSlot;
36
37
  if (compilerMeta.hasMode) flags |= CMP_FLAGS.hasMode;
37
38
  if (compilerMeta.hasModernPropertyDecls) flags |= CMP_FLAGS.hasModernPropertyDecls;
39
+ if (compilerMeta.patches) {
40
+ if (compilerMeta.patches.all) flags |= CMP_FLAGS.patchAll;
41
+ if (compilerMeta.patches.children) flags |= CMP_FLAGS.patchChildren;
42
+ if (compilerMeta.patches.clone) flags |= CMP_FLAGS.patchClone;
43
+ if (compilerMeta.patches.insert) flags |= CMP_FLAGS.patchInsert;
44
+ }
38
45
  const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
39
46
  const hostListeners = formatHostListeners(compilerMeta);
40
47
  const watchers = formatComponentRuntimeReactiveHandlers(compilerMeta, "watchers");
@@ -153,9 +160,6 @@ const computeListenerFlags = (listener) => {
153
160
  case "body":
154
161
  flags |= LISTENER_FLAGS.TargetBody;
155
162
  break;
156
- case "parent":
157
- flags |= LISTENER_FLAGS.TargetParent;
158
- break;
159
163
  }
160
164
  return flags;
161
165
  };
@@ -263,7 +267,8 @@ const buildWarn = (diagnostics) => {
263
267
  * @param jsonFilePath the path to the JSON file where the error occurred
264
268
  * @param msg the error message
265
269
  * @param jsonField the key for the field which caused the error, used for finding
266
- * the error line in the original JSON file
270
+ * the error line in the original JSON file. Only root-level keys (with minimal
271
+ * indentation, typically 2 spaces) are highlighted to avoid matching nested keys.
267
272
  * @returns a reference to the newly-created diagnostic
268
273
  */
269
274
  const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, jsonField) => {
@@ -272,41 +277,60 @@ const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, jsonFie
272
277
  err.absFilePath = jsonFilePath;
273
278
  if (typeof jsonField === "string") try {
274
279
  const lines = compilerCtx.fs.readFileSync(jsonFilePath).replace(/\r/g, "\n").split("\n");
280
+ let bestMatch = null;
281
+ const ROOT_LEVEL_INDENTATION = 2;
275
282
  for (let i = 0; i < lines.length; i++) {
276
283
  const txtLine = lines[i];
277
284
  const txtIndex = txtLine.indexOf(jsonField);
278
285
  if (txtIndex > -1) {
279
- const warnLine = {
286
+ const indentation = txtLine.search(/\S/);
287
+ if (indentation === ROOT_LEVEL_INDENTATION) {
288
+ bestMatch = {
289
+ lineIndex: i,
290
+ charIndex: txtIndex,
291
+ indentation
292
+ };
293
+ break;
294
+ } else if (bestMatch === null || indentation < bestMatch.indentation) bestMatch = {
280
295
  lineIndex: i,
281
- lineNumber: i + 1,
282
- text: txtLine,
283
- errorCharStart: txtIndex,
284
- errorLength: jsonField.length
296
+ charIndex: txtIndex,
297
+ indentation
285
298
  };
286
- err.lineNumber = warnLine.lineNumber;
287
- err.columnNumber = txtIndex + 1;
288
- err.lines.push(warnLine);
289
- if (i >= 0) {
290
- const beforeWarnLine = {
291
- lineIndex: warnLine.lineIndex - 1,
292
- lineNumber: warnLine.lineNumber - 1,
293
- text: lines[i - 1],
294
- errorCharStart: -1,
295
- errorLength: -1
296
- };
297
- err.lines.unshift(beforeWarnLine);
298
- }
299
- if (i < lines.length) {
300
- const afterWarnLine = {
301
- lineIndex: warnLine.lineIndex + 1,
302
- lineNumber: warnLine.lineNumber + 1,
303
- text: lines[i + 1],
304
- errorCharStart: -1,
305
- errorLength: -1
306
- };
307
- err.lines.push(afterWarnLine);
308
- }
309
- break;
299
+ }
300
+ }
301
+ if (bestMatch !== null && bestMatch.indentation === ROOT_LEVEL_INDENTATION) {
302
+ const i = bestMatch.lineIndex;
303
+ const txtIndex = bestMatch.charIndex;
304
+ const txtLine = lines[i];
305
+ const warnLine = {
306
+ lineIndex: i,
307
+ lineNumber: i + 1,
308
+ text: txtLine,
309
+ errorCharStart: txtIndex,
310
+ errorLength: jsonField.length
311
+ };
312
+ err.lineNumber = warnLine.lineNumber;
313
+ err.columnNumber = txtIndex + 1;
314
+ err.lines.push(warnLine);
315
+ if (i > 0) {
316
+ const beforeWarnLine = {
317
+ lineIndex: warnLine.lineIndex - 1,
318
+ lineNumber: warnLine.lineNumber - 1,
319
+ text: lines[i - 1],
320
+ errorCharStart: -1,
321
+ errorLength: -1
322
+ };
323
+ err.lines.unshift(beforeWarnLine);
324
+ }
325
+ if (i < lines.length - 1) {
326
+ const afterWarnLine = {
327
+ lineIndex: warnLine.lineIndex + 1,
328
+ lineNumber: warnLine.lineNumber + 1,
329
+ text: lines[i + 1],
330
+ errorCharStart: -1,
331
+ errorLength: -1
332
+ };
333
+ err.lines.push(afterWarnLine);
310
334
  }
311
335
  }
312
336
  } catch {}
@@ -461,26 +485,27 @@ const escapeHtml = (unsafe) => {
461
485
  return unsafe.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
462
486
  };
463
487
  //#endregion
464
- //#region src/utils/logger/logger-rollup.ts
465
- const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
466
- const formattedCode = formatErrorCode(rollupError.code);
488
+ //#region src/utils/logger/logger-rolldown.ts
489
+ const isRolldownError = (e) => typeof e === "object" && e !== null && "message" in e;
490
+ const loadRolldownDiagnostics = (config, compilerCtx, buildCtx, rolldownError) => {
491
+ const formattedCode = formatErrorCode(rolldownError.code);
467
492
  const diagnostic = {
468
493
  level: "error",
469
494
  type: "bundling",
470
495
  language: "javascript",
471
- code: rollupError.code,
472
- header: `Rollup${formattedCode.length > 0 ? ": " + formattedCode : ""}`,
496
+ code: rolldownError.code,
497
+ header: `Rolldown${formattedCode.length > 0 ? ": " + formattedCode : ""}`,
473
498
  messageText: formattedCode,
474
499
  relFilePath: void 0,
475
500
  absFilePath: void 0,
476
501
  lines: []
477
502
  };
478
- if (config.logLevel === "debug" && rollupError.stack) diagnostic.messageText = rollupError.stack;
479
- else if (rollupError.message) diagnostic.messageText = rollupError.message;
480
- if (rollupError.plugin) diagnostic.messageText += ` (plugin: ${rollupError.plugin}${rollupError.hook ? `, ${rollupError.hook}` : ""})`;
481
- const loc = rollupError.loc;
503
+ if (config.logLevel === "debug" && rolldownError.stack) diagnostic.messageText = rolldownError.stack;
504
+ else if (rolldownError.message) diagnostic.messageText = rolldownError.message;
505
+ if (rolldownError.plugin) diagnostic.messageText += ` (plugin: ${rolldownError.plugin}${rolldownError.hook ? `, ${rolldownError.hook}` : ""})`;
506
+ const loc = rolldownError.loc;
482
507
  if (loc != null) {
483
- const srcFile = loc.file || rollupError.id;
508
+ const srcFile = loc.file || rolldownError.id;
484
509
  if (isString(srcFile)) try {
485
510
  const sourceText = compilerCtx.fs.readFileSync(srcFile);
486
511
  if (sourceText) {
@@ -530,7 +555,7 @@ const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
530
555
  diagnostic.messageText += `\nError parsing: ${diagnostic.absFilePath}, line: ${loc.line}, column: ${loc.column}`;
531
556
  diagnostic.debugText = sourceText;
532
557
  }
533
- } else if (typeof rollupError.frame === "string") diagnostic.messageText += "\n" + rollupError.frame;
558
+ } else if (typeof rolldownError.frame === "string") diagnostic.messageText += "\n" + rolldownError.frame;
534
559
  } catch {}
535
560
  }
536
561
  buildCtx.diagnostics.push(diagnostic);
@@ -637,15 +662,15 @@ const getRootLength = (path) => {
637
662
  const getEncodedRootLength = (path) => {
638
663
  if (!path) return 0;
639
664
  const ch0 = path.charCodeAt(0);
640
- if (ch0 === CharacterCodes.slash || ch0 === CharacterCodes.backslash) {
665
+ if (ch0 === 47 || ch0 === 92) {
641
666
  if (path.charCodeAt(1) !== ch0) return 1;
642
- const p1 = path.indexOf(ch0 === CharacterCodes.slash ? "/" : altDirectorySeparator, 2);
667
+ const p1 = path.indexOf(ch0 === 47 ? "/" : altDirectorySeparator, 2);
643
668
  if (p1 < 0) return path.length;
644
669
  return p1 + 1;
645
670
  }
646
- if (isVolumeCharacter(ch0) && path.charCodeAt(1) === CharacterCodes.colon) {
671
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
647
672
  const ch2 = path.charCodeAt(2);
648
- if (ch2 === CharacterCodes.slash || ch2 === CharacterCodes.backslash) return 3;
673
+ if (ch2 === 47 || ch2 === 92) return 3;
649
674
  if (path.length === 2) return 2;
650
675
  }
651
676
  const schemeEnd = path.indexOf(urlSchemeSeparator);
@@ -658,7 +683,7 @@ const getEncodedRootLength = (path) => {
658
683
  if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
659
684
  const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
660
685
  if (volumeSeparatorEnd !== -1) {
661
- if (path.charCodeAt(volumeSeparatorEnd) === CharacterCodes.slash) return ~(volumeSeparatorEnd + 1);
686
+ if (path.charCodeAt(volumeSeparatorEnd) === 47) return ~(volumeSeparatorEnd + 1);
662
687
  if (volumeSeparatorEnd === path.length) return ~volumeSeparatorEnd;
663
688
  }
664
689
  }
@@ -668,13 +693,13 @@ const getEncodedRootLength = (path) => {
668
693
  }
669
694
  return 0;
670
695
  };
671
- const isVolumeCharacter = (charCode) => charCode >= CharacterCodes.a && charCode <= CharacterCodes.z || charCode >= CharacterCodes.A && charCode <= CharacterCodes.Z;
696
+ const isVolumeCharacter = (charCode) => charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
672
697
  const getFileUrlVolumeSeparatorEnd = (url, start) => {
673
698
  const ch0 = url.charCodeAt(start);
674
- if (ch0 === CharacterCodes.colon) return start + 1;
675
- if (ch0 === CharacterCodes.percent && url.charCodeAt(start + 1) === CharacterCodes._3) {
699
+ if (ch0 === 58) return start + 1;
700
+ if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
676
701
  const ch2 = url.charCodeAt(start + 2);
677
- if (ch2 === CharacterCodes.a || ch2 === CharacterCodes.A) return start + 3;
702
+ if (ch2 === 97 || ch2 === 65) return start + 3;
678
703
  }
679
704
  return -1;
680
705
  };
@@ -704,19 +729,6 @@ const normalizeFsPathQuery = (importPath) => {
704
729
  format: params ? params.get("format") : null
705
730
  };
706
731
  };
707
- var CharacterCodes = /* @__PURE__ */ function(CharacterCodes) {
708
- CharacterCodes[CharacterCodes["a"] = 97] = "a";
709
- CharacterCodes[CharacterCodes["A"] = 65] = "A";
710
- CharacterCodes[CharacterCodes["z"] = 122] = "z";
711
- CharacterCodes[CharacterCodes["Z"] = 90] = "Z";
712
- CharacterCodes[CharacterCodes["_3"] = 51] = "_3";
713
- CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash";
714
- CharacterCodes[CharacterCodes["colon"] = 58] = "colon";
715
- CharacterCodes[CharacterCodes["dot"] = 46] = "dot";
716
- CharacterCodes[CharacterCodes["percent"] = 37] = "percent";
717
- CharacterCodes[CharacterCodes["slash"] = 47] = "slash";
718
- return CharacterCodes;
719
- }(CharacterCodes || {});
720
732
  /**
721
733
  * A wrapped version of node.js' {@link path.relative} which adds our custom
722
734
  * normalization logic. This solves the relative path between `from` and `to`!
@@ -772,7 +784,7 @@ function join$1(...paths) {
772
784
  * @param paths a path or path fragments to resolve
773
785
  * @returns a resolved path!
774
786
  */
775
- function resolve(...paths) {
787
+ function resolve$1(...paths) {
776
788
  /**
777
789
  * When normalizing, we should _not_ attempt to relativize the path returned by the native Node `resolve` method. When
778
790
  * calculating the path from each of the string-based parts, Node does not prepend './' to the calculated path.
@@ -969,7 +981,7 @@ const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
969
981
  const shouldExcludeComponent = (tagName, excludePatterns) => {
970
982
  if (!excludePatterns || excludePatterns.length === 0) return false;
971
983
  return excludePatterns.some((pattern) => {
972
- if (isGlob(pattern)) return minimatch(tagName, pattern);
984
+ if (isGlob(pattern)) return picomatch.isMatch(tagName, pattern);
973
985
  return pattern === tagName;
974
986
  });
975
987
  };
@@ -1021,21 +1033,22 @@ const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
1021
1033
  };
1022
1034
  const getComponentsDtsSrcFilePath = (config) => join$1(config.srcDir, GENERATED_DTS);
1023
1035
  /**
1024
- * Helper to get an appropriate file path for `components.d.ts` for a `"dist"`
1025
- * or `"dist-types"` output target.
1036
+ * Helper to get an appropriate file path for `components.d.ts` for an output target.
1026
1037
  *
1027
- * @param outputTarget the output target of interest
1038
+ * @param typesDir the directory where types are generated
1028
1039
  * @returns a properly-formatted path
1029
1040
  */
1030
- const getComponentsDtsTypesFilePath = (outputTarget) => join$1(outputTarget.typesDir, GENERATED_DTS);
1031
- const isOutputTargetDist = (o) => o.type === DIST;
1032
- const isOutputTargetDistCollection = (o) => o.type === DIST_COLLECTION;
1033
- const isOutputTargetDistCustomElements = (o) => o.type === DIST_CUSTOM_ELEMENTS;
1041
+ const getComponentsDtsTypesFilePath = (typesDir) => join$1(typesDir, GENERATED_DTS);
1042
+ const isOutputTargetLoaderBundle = (o) => o.type === LOADER_BUNDLE;
1043
+ const isOutputTargetStandalone = (o) => o.type === STANDALONE;
1044
+ const isOutputTargetSsr = (o) => o.type === "ssr";
1045
+ const isOutputTargetSsrWasm = (o) => o.type === SSR_WASM;
1046
+ const isOutputTargetCollection = (o) => o.type === COLLECTION;
1047
+ const isOutputTargetTypes = (o) => o.type === TYPES;
1048
+ const isOutputTargetGlobalStyle = (o) => o.type === GLOBAL_STYLE;
1049
+ const isOutputTargetAssets = (o) => o.type === ASSETS;
1034
1050
  const isOutputTargetCopy = (o) => o.type === COPY;
1035
1051
  const isOutputTargetDistLazy = (o) => o.type === DIST_LAZY;
1036
- const isOutputTargetDistLazyLoader = (o) => o.type === DIST_LAZY_LOADER;
1037
- const isOutputTargetDistGlobalStyles = (o) => o.type === DIST_GLOBAL_STYLES;
1038
- const isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
1039
1052
  const isOutputTargetCustom = (o) => o.type === CUSTOM;
1040
1053
  const isOutputTargetDocs = (o) => o.type === "docs-readme" || o.type === "docs-json" || o.type === "docs-custom" || o.type === "docs-vscode" || o.type === "docs-custom-elements-manifest";
1041
1054
  const isOutputTargetDocsReadme = (o) => o.type === DOCS_README;
@@ -1045,15 +1058,6 @@ const isOutputTargetDocsVscode = (o) => o.type === DOCS_VSCODE;
1045
1058
  const isOutputTargetDocsCustomElementsManifest = (o) => o.type === DOCS_CUSTOM_ELEMENTS_MANIFEST;
1046
1059
  const isOutputTargetWww = (o) => o.type === "www";
1047
1060
  const isOutputTargetStats = (o) => o.type === STATS;
1048
- const isOutputTargetDistTypes = (o) => o.type === DIST_TYPES;
1049
- /**
1050
- * Checks whether or not the supplied output target's type matches one of the eligible primary
1051
- * package output target types (i.e. it can have `isPrimaryPackageOutputTarget: true` in its config).
1052
- *
1053
- * @param o The output target to check.
1054
- * @returns Whether the output target type is one of the "primary" output targets.
1055
- */
1056
- const isEligiblePrimaryPackageOutputTarget = (o) => isOutputTargetDist(o) || isOutputTargetDistCollection(o) || isOutputTargetDistCustomElements(o) || isOutputTargetDistTypes(o);
1057
1061
  /**
1058
1062
  * Retrieve the Stencil component compiler metadata from a collection of Stencil {@link d.Module}s
1059
1063
  * @param moduleFiles the collection of `Module`s to retrieve the metadata from
@@ -1069,6 +1073,19 @@ const getComponentsFromModules = (moduleFiles) => sortBy(flatOne(moduleFiles.map
1069
1073
  function isValidConfigOutputTarget(targetType) {
1070
1074
  return VALID_CONFIG_OUTPUT_TARGETS.includes(targetType);
1071
1075
  }
1076
+ /**
1077
+ * Filter output targets based on devMode and their skipInDev setting.
1078
+ * In dev mode, targets with `skipInDev: true` are filtered out.
1079
+ * In prod mode, all targets are included.
1080
+ *
1081
+ * @param targets Array of output targets to filter
1082
+ * @param devMode Whether we're in dev mode
1083
+ * @returns Filtered array of active targets
1084
+ */
1085
+ const filterActiveTargets = (targets, devMode) => {
1086
+ if (!devMode) return targets;
1087
+ return targets.filter((t) => !t.skipInDev);
1088
+ };
1072
1089
  //#endregion
1073
1090
  //#region src/utils/result.ts
1074
1091
  var result_exports = /* @__PURE__ */ __exportAll({
@@ -1141,15 +1158,15 @@ const unwrapErr = (result) => {
1141
1158
  };
1142
1159
  //#endregion
1143
1160
  //#region src/utils/sourcemaps.ts
1144
- function rollupToStencilSourceMap(rollupSourceMap) {
1145
- if (!rollupSourceMap || !rollupSourceMap.file) return null;
1161
+ function rolldownToStencilSourceMap(rolldownSourceMap) {
1162
+ if (!rolldownSourceMap || !rolldownSourceMap.file) return null;
1146
1163
  return {
1147
- file: rollupSourceMap.file,
1148
- mappings: rollupSourceMap.mappings,
1149
- names: rollupSourceMap.names,
1150
- sources: rollupSourceMap.sources,
1151
- sourcesContent: rollupSourceMap.sourcesContent,
1152
- version: rollupSourceMap.version
1164
+ file: rolldownSourceMap.file,
1165
+ mappings: rolldownSourceMap.mappings,
1166
+ names: rolldownSourceMap.names,
1167
+ sources: rolldownSourceMap.sources,
1168
+ sourcesContent: rolldownSourceMap.sourcesContent,
1169
+ version: rolldownSourceMap.version
1153
1170
  };
1154
1171
  }
1155
1172
  /**
@@ -1438,4 +1455,4 @@ const validateComponentTag = (tag) => {
1438
1455
  if (tag.lastIndexOf("-") === tag.length - 1) return `"${tag}" tag cannot end with a dash (-)`;
1439
1456
  };
1440
1457
  //#endregion
1441
- export { join$1 as $, isOutputTargetCustom as A, isOutputTargetDocsCustomElementsManifest as B, result_exports as C, stringifyRuntimeData as Ct, getComponentsFromModules as D, getComponentsDtsTypesFilePath as E, isOutputTargetDistLazy as F, isOutputTargetStats as G, isOutputTargetDocsReadme as H, isOutputTargetDistLazyLoader as I, relativeImport as J, isOutputTargetWww as K, isOutputTargetDistTypes as L, isOutputTargetDistCollection as M, isOutputTargetDistCustomElements as N, isEligiblePrimaryPackageOutputTarget as O, isOutputTargetDistGlobalStyles as P, loadTypeScriptDiagnostics as Q, isOutputTargetDocs as R, ok as S, formatLazyBundleRuntimeMeta as St, getComponentsDtsSrcFilePath as T, isOutputTargetDocsVscode as U, isOutputTargetDocsJson as V, isOutputTargetHydrate as W, augmentDiagnosticWithNode as X, shouldExcludeComponent as Y, loadTypeScriptDiagnostic as Z, getSourceMappingUrlForEndOfFile as _, hasWarning as _t, getTextDocs as a, resolve as at, err as b, isGlob as bt, isJsFile as c, escapeHtml as ct, isTsxFile as d, TASK_CANCELED_MSG as dt, normalize as et, parsePackageJson as f, buildError as ft, getInlineSourceMappingUrlLinker as g, hasError as gt, isRemoteUrl as h, catchError as ht, generatePreamble as i, relative$1 as it, isOutputTargetDist as j, isOutputTargetCopy as k, isJsxFile as l, normalizeDiagnostics as lt, readPackageJson as m, buildWarn as mt, addDocBlock as n, normalizeFsPathQuery as nt, hasDependency as o, createOnWarnFn as ot, readOnlyArrayHasStringMember as p, buildJsonFileError as pt, isValidConfigOutputTarget as q, createJsVarName as r, normalizePath as rt, isDtsFile as s, loadRollupDiagnostics as st, validateComponentTag as t, normalizeFsPath as tt, isTsFile as u, splitLineBreaks as ut, getSourceMappingUrlLinker as v, shouldIgnoreError as vt, filterExcludedComponents as w, byteSize as wt, map as x, formatComponentRuntimeMeta as xt, rollupToStencilSourceMap as y, isRootPath as yt, isOutputTargetDocsCustom as z };
1458
+ export { loadTypeScriptDiagnostics as $, isOutputTargetCollection as A, isOutputTargetGlobalStyle as B, result_exports as C, formatComponentRuntimeMeta as Ct, getComponentsDtsTypesFilePath as D, getComponentsDtsSrcFilePath as E, byteSize as Et, isOutputTargetDocsCustom as F, isOutputTargetStats as G, isOutputTargetSsr as H, isOutputTargetDocsCustomElementsManifest as I, isValidConfigOutputTarget as J, isOutputTargetTypes as K, isOutputTargetDocsJson as L, isOutputTargetCustom as M, isOutputTargetDistLazy as N, getComponentsFromModules as O, isOutputTargetDocs as P, loadTypeScriptDiagnostic as Q, isOutputTargetDocsReadme as R, ok as S, isGlob as St, filterExcludedComponents as T, stringifyRuntimeData as Tt, isOutputTargetSsrWasm as U, isOutputTargetLoaderBundle as V, isOutputTargetStandalone as W, shouldExcludeComponent as X, relativeImport as Y, augmentDiagnosticWithNode as Z, getSourceMappingUrlForEndOfFile as _, catchError as _t, getTextDocs as a, relative$1 as at, err as b, shouldIgnoreError as bt, isJsFile as c, isRolldownError as ct, isTsxFile as d, normalizeDiagnostics as dt, join$1 as et, parsePackageJson as f, splitLineBreaks as ft, getInlineSourceMappingUrlLinker as g, buildWarn as gt, isRemoteUrl as h, buildJsonFileError as ht, generatePreamble as i, normalizePath as it, isOutputTargetCopy as j, isOutputTargetAssets as k, isJsxFile as l, loadRolldownDiagnostics as lt, readPackageJson as m, buildError as mt, addDocBlock as n, normalizeFsPath as nt, hasDependency as o, resolve$1 as ot, readOnlyArrayHasStringMember as p, TASK_CANCELED_MSG as pt, isOutputTargetWww as q, createJsVarName as r, normalizeFsPathQuery as rt, isDtsFile as s, createOnWarnFn as st, validateComponentTag as t, normalize as tt, isTsFile as u, escapeHtml as ut, getSourceMappingUrlLinker as v, hasError as vt, filterActiveTargets as w, formatLazyBundleRuntimeMeta as wt, map as x, isRootPath as xt, rolldownToStencilSourceMap as y, hasWarning as yt, isOutputTargetDocsVscode as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-alpha.1",
3
+ "version": "5.0.0-alpha.11",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -44,33 +44,45 @@
44
44
  "import": "./dist/compiler/utils/index.mjs"
45
45
  },
46
46
  "./jsx-runtime": {
47
- "types": "./dist/jsx-runtime.d.ts",
48
- "import": "./dist/jsx-runtime.js"
47
+ "types": "./dist/jsx-runtime.d.mts",
48
+ "import": "./dist/jsx-runtime.mjs"
49
49
  },
50
50
  "./jsx-dev-runtime": {
51
- "types": "./dist/jsx-runtime.d.ts",
52
- "import": "./dist/jsx-runtime.js"
51
+ "types": "./dist/jsx-runtime.d.mts",
52
+ "import": "./dist/jsx-runtime.mjs"
53
53
  },
54
54
  "./mock-doc": {
55
55
  "types": "./dist/mock-doc.d.mts",
56
56
  "import": "./dist/mock-doc.mjs",
57
57
  "default": "./dist/mock-doc.mjs"
58
58
  },
59
+ "./signals": {
60
+ "types": "./dist/signals/index.d.ts",
61
+ "import": "./dist/signals/index.js"
62
+ },
59
63
  "./runtime": {
60
64
  "types": "./dist/runtime/index.d.ts",
61
65
  "import": "./dist/runtime/index.js"
62
66
  },
63
- "./runtime/app-data": {
64
- "types": "./dist/runtime/app-data/index.d.ts",
65
- "import": "./dist/runtime/app-data/index.js"
67
+ "./app-data": {
68
+ "types": "./dist/app-data/index.d.ts",
69
+ "import": "./dist/app-data/index.js"
66
70
  },
67
- "./runtime/app-globals": {
68
- "types": "./dist/runtime/app-globals/index.d.ts",
69
- "import": "./dist/runtime/app-globals/index.js"
71
+ "./app-globals": {
72
+ "types": "./dist/app-globals/index.d.ts",
73
+ "import": "./dist/app-globals/index.js"
70
74
  },
71
75
  "./runtime/client": {
72
- "types": "./dist/runtime/client/index.d.ts",
73
- "import": "./dist/runtime/client/index.js"
76
+ "types": "./dist/runtime/client/runtime.d.ts",
77
+ "import": "./dist/runtime/client/runtime.js"
78
+ },
79
+ "./runtime/client/standalone": {
80
+ "types": "./dist/runtime/client/runtime.d.ts",
81
+ "import": "./dist/runtime/client/runtime.js"
82
+ },
83
+ "./runtime/client/lazy": {
84
+ "types": "./dist/runtime/client/runtime.d.ts",
85
+ "import": "./dist/runtime/client/lazy.js"
74
86
  },
75
87
  "./runtime/server": {
76
88
  "types": "./dist/runtime/server/index.d.mts",
@@ -90,39 +102,36 @@
90
102
  }
91
103
  },
92
104
  "dependencies": {
93
- "@parcel/watcher": "^2.5.1",
94
- "@rollup/plugin-commonjs": "^29.0.0",
95
- "@rollup/plugin-json": "^6.1.0",
96
- "@rollup/plugin-node-resolve": "^16.0.3",
97
- "@rollup/plugin-replace": "^6.0.3",
105
+ "@parcel/watcher": "^2.0.0",
106
+ "@preact/signals-core": "^1.0.0",
98
107
  "@rollup/pluginutils": "^5.3.0",
99
- "@stencil/vitest": "^1.9.3",
100
- "autoprefixer": "^10.4.24",
101
- "chalk": "^5.6.2",
108
+ "browserslist": "^4.0.0",
109
+ "chalk": "^5.0.0",
102
110
  "css-what": "^7.0.0",
103
- "glob": "^10.0.0",
104
- "graceful-fs": "^4.2.11",
111
+ "jiti": "^2.0.0",
112
+ "lightningcss": "^1.0.0",
105
113
  "magic-string": "^0.30.0",
106
- "merge-source-map": "^1.1.0",
107
- "minimatch": "^10.1.2",
108
- "postcss": "^8.5.6",
109
- "postcss-safe-parser": "^7.0.1",
110
- "postcss-selector-parser": "^7.1.1",
114
+ "picomatch": "^4.0.0",
115
+ "postcss": "^8.0.0",
116
+ "postcss-safe-parser": "^7.0.0",
117
+ "postcss-selector-parser": "^7.0.0",
111
118
  "resolve": "^1.22.0",
112
- "rollup": "^4.0.0",
113
- "semver": "^7.7.4",
114
- "terser": "5.37.0",
115
- "typescript": "~6.0.2",
116
- "@stencil/dev-server": "5.0.0-alpha.1",
117
- "@stencil/cli": "5.0.0-alpha.1",
118
- "@stencil/mock-doc": "5.0.0-alpha.1"
119
+ "rolldown": "^1.0.0",
120
+ "semver": "^7.0.0",
121
+ "terser": "^5.0.0",
122
+ "tinyglobby": "^0.2.0",
123
+ "typescript": ">4.0.0 <7.0.0",
124
+ "@stencil/mock-doc": "5.0.0-alpha.11",
125
+ "@stencil/cli": "5.0.0-alpha.11",
126
+ "@stencil/dev-server": "5.0.0-alpha.11"
119
127
  },
120
128
  "devDependencies": {
121
129
  "@ionic/prettier-config": "^4.0.0",
130
+ "@stencil/vitest": "^1.12.1",
122
131
  "prettier": "^3.5.0",
123
- "tsdown": "^0.21.6",
124
- "vitest": "^4.1.1",
125
- "vitest-environment-stencil": "^1.9.3"
132
+ "tsdown": ">=0.21.0 <1.0.0",
133
+ "vitest": "^4.1.7",
134
+ "vitest-environment-stencil": "^1.12.1"
126
135
  },
127
136
  "volta": {
128
137
  "extends": "../../package.json"
@@ -1,30 +0,0 @@
1
- import { t as BuildConditionals } from "./index-BONzXKJt.js";
2
-
3
- //#region src/app-data/index.d.ts
4
- /**
5
- * A collection of default build flags for a Stencil project.
6
- *
7
- * This collection can be found throughout the Stencil codebase, often imported from the `virtual:app-data` module like so:
8
- * ```ts
9
- * import { BUILD } from 'virtual:app-data';
10
- * ```
11
- * and is used to determine if a portion of the output of a Stencil _project_'s compilation step can be eliminated.
12
- *
13
- * e.g. When `BUILD.allRenderFn` evaluates to `false`, the compiler will eliminate conditional statements like:
14
- * ```ts
15
- * if (BUILD.allRenderFn) {
16
- * // some code that will be eliminated if BUILD.allRenderFn is false
17
- * }
18
- * ```
19
- *
20
- * `virtual:app-data`, the module that `BUILD` is imported from, is an alias for the `@stencil/core/runtime/app-data`, and is
21
- * partially referenced by {@link STENCIL_APP_DATA_ID}. The `src/compiler/bundle/app-data-plugin.ts` references
22
- * `STENCIL_APP_DATA_ID` uses it to replace these defaults with {@link BuildConditionals} that are derived from a
23
- * Stencil project's contents (i.e. metadata from the components). This replacement happens at a Stencil project's
24
- * compile time. Such code can be found at `src/compiler/app-core/app-data.ts`.
25
- */
26
- declare const BUILD: BuildConditionals;
27
- declare const Env: {};
28
- declare const NAMESPACE: string;
29
- //#endregion
30
- export { Env as n, NAMESPACE as r, BUILD as t };
@@ -1,28 +0,0 @@
1
- import { m as FunctionalComponent, y as VNode } from "./index-BONzXKJt.js";
2
-
3
- //#region src/runtime/fragment.d.ts
4
- declare const Fragment: FunctionalComponent;
5
- //#endregion
6
- //#region src/runtime/vdom/jsx-runtime.d.ts
7
- /**
8
- * JSX runtime function for creating elements in production mode.
9
- * Called by TypeScript's jsx transform for elements without static children.
10
- *
11
- * @param type - The element type (string tag name or functional component)
12
- * @param props - The element props (includes children)
13
- * @param key - Optional key for the element
14
- * @returns A virtual DOM node
15
- */
16
- declare function jsx(type: any, props: any, key?: string): VNode;
17
- /**
18
- * JSX runtime function for creating elements with static children.
19
- * Called by TypeScript's jsx transform as an optimization when children are static.
20
- *
21
- * @param type - The element type (string tag name or functional component)
22
- * @param props - The element props (includes children)
23
- * @param key - Optional key for the element
24
- * @returns A virtual DOM node
25
- */
26
- declare function jsxs(type: any, props: any, key?: string): VNode;
27
- //#endregion
28
- export { jsxs as n, Fragment as r, jsx as t };
@@ -1,2 +0,0 @@
1
- import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-DBzBJLKk.js";
2
- export { Fragment, jsx, jsxs };
@@ -1,2 +0,0 @@
1
- import { d as Fragment, n as jsx, r as jsxs } from "./runtime-CF9DJtSu.js";
2
- export { Fragment, jsx, jsxs };
@@ -1,2 +0,0 @@
1
- import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-CHjZtib0.js";
2
- export { BUILD, Env, NAMESPACE };