@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.
- package/dist/app-data/index.d.ts +2 -0
- package/dist/{runtime/app-data → app-data}/index.js +17 -12
- package/dist/{client-B1nuvCd2.mjs → client-aTQ7xHxx.mjs} +2432 -2278
- package/dist/compiler/index.d.mts +6 -6
- package/dist/compiler/index.mjs +2 -2
- package/dist/compiler/utils/index.d.mts +2 -2
- package/dist/compiler/utils/index.mjs +3 -3
- package/dist/{compiler-LX4_RKKd.mjs → compiler-DCN7Np2A.mjs} +14854 -13500
- package/dist/declarations/stencil-public-compiler.d.ts +4374 -2
- package/dist/declarations/stencil-public-compiler.js +2 -4
- package/dist/declarations/stencil-public-docs.d.ts +504 -1
- package/dist/declarations/stencil-public-runtime.d.ts +1982 -2
- package/dist/{index-fIuYTL9f.d.mts → index-BvkyxSY6.d.mts} +29 -2
- package/dist/{index-D-LlB2nw.d.mts → index-vY35H18z.d.mts} +795 -1188
- package/dist/{index-BONzXKJt.d.ts → index-xAkMgLX_.d.ts} +88 -39
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/jsx-runtime.d.mts +18 -0
- package/dist/jsx-runtime.mjs +2 -0
- package/dist/{node-SxQIOCZE.mjs → node--akYC-sG.mjs} +20 -30
- package/dist/regular-expression-CFVJOTUh.mjs +508 -0
- package/dist/{runtime-CF9DJtSu.js → runtime/client/lazy.js} +2675 -2493
- package/dist/runtime/client/{index.d.ts → runtime.d.ts} +106 -78
- package/dist/runtime/client/{index.js → runtime.js} +2545 -2487
- package/dist/runtime/index.d.ts +58 -29
- package/dist/runtime/index.js +4795 -2
- package/dist/runtime/server/index.d.mts +103 -70
- package/dist/runtime/server/index.mjs +2545 -2350
- package/dist/runtime/server/runner.d.mts +44 -48
- package/dist/runtime/server/runner.mjs +347 -751
- package/dist/signals/index.d.ts +47 -0
- package/dist/signals/index.js +199 -0
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +97 -3
- package/dist/testing/index.mjs +367 -59
- package/dist/{validation-CaCgjw-f.mjs → validation-ByxKj8bC.mjs} +116 -99
- package/package.json +47 -38
- package/dist/index-CHjZtib0.d.ts +0 -30
- package/dist/jsx-runtime-DBzBJLKk.d.ts +0 -28
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -2
- package/dist/runtime/app-data/index.d.ts +0 -2
- package/dist/serialize-BkYHk7Mi.mjs +0 -766
- package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
- package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
- /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
- /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
errorCharStart: txtIndex,
|
|
284
|
-
errorLength: jsonField.length
|
|
296
|
+
charIndex: txtIndex,
|
|
297
|
+
indentation
|
|
285
298
|
};
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
462
486
|
};
|
|
463
487
|
//#endregion
|
|
464
|
-
//#region src/utils/logger/logger-
|
|
465
|
-
const
|
|
466
|
-
|
|
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:
|
|
472
|
-
header: `
|
|
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" &&
|
|
479
|
-
else if (
|
|
480
|
-
if (
|
|
481
|
-
const 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 ||
|
|
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
|
|
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 ===
|
|
665
|
+
if (ch0 === 47 || ch0 === 92) {
|
|
641
666
|
if (path.charCodeAt(1) !== ch0) return 1;
|
|
642
|
-
const p1 = path.indexOf(ch0 ===
|
|
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) ===
|
|
671
|
+
if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
|
|
647
672
|
const ch2 = path.charCodeAt(2);
|
|
648
|
-
if (ch2 ===
|
|
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) ===
|
|
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 >=
|
|
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 ===
|
|
675
|
-
if (ch0 ===
|
|
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 ===
|
|
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
|
|
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
|
|
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
|
|
1038
|
+
* @param typesDir the directory where types are generated
|
|
1028
1039
|
* @returns a properly-formatted path
|
|
1029
1040
|
*/
|
|
1030
|
-
const getComponentsDtsTypesFilePath = (
|
|
1031
|
-
const
|
|
1032
|
-
const
|
|
1033
|
-
const
|
|
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
|
|
1145
|
-
if (!
|
|
1161
|
+
function rolldownToStencilSourceMap(rolldownSourceMap) {
|
|
1162
|
+
if (!rolldownSourceMap || !rolldownSourceMap.file) return null;
|
|
1146
1163
|
return {
|
|
1147
|
-
file:
|
|
1148
|
-
mappings:
|
|
1149
|
-
names:
|
|
1150
|
-
sources:
|
|
1151
|
-
sourcesContent:
|
|
1152
|
-
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 {
|
|
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.
|
|
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.
|
|
48
|
-
"import": "./dist/jsx-runtime.
|
|
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.
|
|
52
|
-
"import": "./dist/jsx-runtime.
|
|
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
|
-
"./
|
|
64
|
-
"types": "./dist/
|
|
65
|
-
"import": "./dist/
|
|
67
|
+
"./app-data": {
|
|
68
|
+
"types": "./dist/app-data/index.d.ts",
|
|
69
|
+
"import": "./dist/app-data/index.js"
|
|
66
70
|
},
|
|
67
|
-
"./
|
|
68
|
-
"types": "./dist/
|
|
69
|
-
"import": "./dist/
|
|
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/
|
|
73
|
-
"import": "./dist/runtime/client/
|
|
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.
|
|
94
|
-
"@
|
|
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
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"chalk": "^5.6.2",
|
|
108
|
+
"browserslist": "^4.0.0",
|
|
109
|
+
"chalk": "^5.0.0",
|
|
102
110
|
"css-what": "^7.0.0",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
111
|
+
"jiti": "^2.0.0",
|
|
112
|
+
"lightningcss": "^1.0.0",
|
|
105
113
|
"magic-string": "^0.30.0",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"postcss": "^
|
|
109
|
-
"postcss-
|
|
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
|
-
"
|
|
113
|
-
"semver": "^7.
|
|
114
|
-
"terser": "5.
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"@stencil/
|
|
118
|
-
"@stencil/
|
|
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": "
|
|
124
|
-
"vitest": "^4.1.
|
|
125
|
-
"vitest-environment-stencil": "^1.
|
|
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"
|
package/dist/index-CHjZtib0.d.ts
DELETED
|
@@ -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 };
|
package/dist/jsx-runtime.d.ts
DELETED
package/dist/jsx-runtime.js
DELETED