@stencil/core 2.16.0 → 2.16.1-0
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/cli/index.cjs +30 -12
- package/cli/index.js +30 -12
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +209 -147
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +4 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +3 -3
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-public-compiler.d.ts +1 -0
- package/internal/testing/index.js +1 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +3 -1
- package/mock-doc/index.d.ts +1 -0
- package/mock-doc/index.js +3 -1
- package/mock-doc/package.json +1 -1
- package/package.json +2 -1
- package/screenshot/index.js +2 -0
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +335 -331
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v2.16.0 | MIT Licensed | https://stenciljs.com
|
|
2
|
+
Stencil Compiler v2.16.1-0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
(function(exports) {
|
|
5
5
|
'use strict';
|
|
@@ -717,7 +717,7 @@ const computeListenerFlags = (listener) => {
|
|
|
717
717
|
};
|
|
718
718
|
const trimFalsy = (data) => {
|
|
719
719
|
const arr = data;
|
|
720
|
-
for (
|
|
720
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
721
721
|
if (arr[i]) {
|
|
722
722
|
break;
|
|
723
723
|
}
|
|
@@ -826,136 +826,15 @@ const isGlob = (str) => {
|
|
|
826
826
|
};
|
|
827
827
|
|
|
828
828
|
/**
|
|
829
|
-
* Checks if the path is the OS root path, such as "/" or "C:\"
|
|
829
|
+
* Checks if the path is the Operating System (OS) root path, such as "/" or "C:\". This function does not take the OS
|
|
830
|
+
* the code is running on into account when performing this evaluation.
|
|
831
|
+
* @param p the path to check
|
|
832
|
+
* @returns `true` if the path is an OS root path, `false` otherwise
|
|
830
833
|
*/
|
|
831
834
|
const isRootPath = (p) => p === '/' || windowsPathRegex.test(p);
|
|
832
835
|
// https://github.com/nodejs/node/blob/5883a59b21a97e8b7339f435c977155a2c29ba8d/lib/path.js#L43
|
|
833
836
|
const windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/;
|
|
834
837
|
|
|
835
|
-
/**
|
|
836
|
-
* Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
|
|
837
|
-
* @param compilerCtx the current compiler context
|
|
838
|
-
* @param diagnostics the diagnostics to normalize
|
|
839
|
-
* @returns the normalize documents
|
|
840
|
-
*/
|
|
841
|
-
const normalizeDiagnostics = (compilerCtx, diagnostics) => {
|
|
842
|
-
const normalizedErrors = [];
|
|
843
|
-
const normalizedOthers = [];
|
|
844
|
-
const dups = new Set();
|
|
845
|
-
for (let i = 0; i < diagnostics.length; i++) {
|
|
846
|
-
const d = normalizeDiagnostic(compilerCtx, diagnostics[i]);
|
|
847
|
-
const key = d.absFilePath + d.code + d.messageText + d.type;
|
|
848
|
-
if (dups.has(key)) {
|
|
849
|
-
continue;
|
|
850
|
-
}
|
|
851
|
-
dups.add(key);
|
|
852
|
-
const total = normalizedErrors.length + normalizedOthers.length;
|
|
853
|
-
if (d.level === 'error') {
|
|
854
|
-
normalizedErrors.push(d);
|
|
855
|
-
}
|
|
856
|
-
else if (total < MAX_ERRORS) {
|
|
857
|
-
normalizedOthers.push(d);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
return [...normalizedErrors, ...normalizedOthers];
|
|
861
|
-
};
|
|
862
|
-
/**
|
|
863
|
-
* Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
|
|
864
|
-
* updating build failure contexts
|
|
865
|
-
* @param compilerCtx the current compiler
|
|
866
|
-
* @param diagnostic the diagnostic to normalize
|
|
867
|
-
* @returns the altered diagnostic
|
|
868
|
-
*/
|
|
869
|
-
const normalizeDiagnostic = (compilerCtx, diagnostic) => {
|
|
870
|
-
if (diagnostic.messageText) {
|
|
871
|
-
if (typeof diagnostic.messageText.message === 'string') {
|
|
872
|
-
diagnostic.messageText = diagnostic.messageText.message;
|
|
873
|
-
}
|
|
874
|
-
else if (typeof diagnostic.messageText === 'string' && diagnostic.messageText.indexOf('Error: ') === 0) {
|
|
875
|
-
diagnostic.messageText = diagnostic.messageText.slice(7);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
if (diagnostic.messageText) {
|
|
879
|
-
if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
|
|
880
|
-
diagnostic.header = `Missing "h" import for JSX types`;
|
|
881
|
-
diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
|
|
882
|
-
try {
|
|
883
|
-
const sourceText = compilerCtx.fs.readFileSync(diagnostic.absFilePath);
|
|
884
|
-
const srcLines = splitLineBreaks(sourceText);
|
|
885
|
-
for (let i = 0; i < srcLines.length; i++) {
|
|
886
|
-
const srcLine = srcLines[i];
|
|
887
|
-
if (srcLine.includes('@stencil/core')) {
|
|
888
|
-
const msgLines = [];
|
|
889
|
-
const beforeLineIndex = i - 1;
|
|
890
|
-
if (beforeLineIndex > -1) {
|
|
891
|
-
const beforeLine = {
|
|
892
|
-
lineIndex: beforeLineIndex,
|
|
893
|
-
lineNumber: beforeLineIndex + 1,
|
|
894
|
-
text: srcLines[beforeLineIndex],
|
|
895
|
-
errorCharStart: -1,
|
|
896
|
-
errorLength: -1,
|
|
897
|
-
};
|
|
898
|
-
msgLines.push(beforeLine);
|
|
899
|
-
}
|
|
900
|
-
const errorLine = {
|
|
901
|
-
lineIndex: i,
|
|
902
|
-
lineNumber: i + 1,
|
|
903
|
-
text: srcLine,
|
|
904
|
-
errorCharStart: 0,
|
|
905
|
-
errorLength: -1,
|
|
906
|
-
};
|
|
907
|
-
msgLines.push(errorLine);
|
|
908
|
-
diagnostic.lineNumber = errorLine.lineNumber;
|
|
909
|
-
diagnostic.columnNumber = srcLine.indexOf('}');
|
|
910
|
-
const afterLineIndex = i + 1;
|
|
911
|
-
if (afterLineIndex < srcLines.length) {
|
|
912
|
-
const afterLine = {
|
|
913
|
-
lineIndex: afterLineIndex,
|
|
914
|
-
lineNumber: afterLineIndex + 1,
|
|
915
|
-
text: srcLines[afterLineIndex],
|
|
916
|
-
errorCharStart: -1,
|
|
917
|
-
errorLength: -1,
|
|
918
|
-
};
|
|
919
|
-
msgLines.push(afterLine);
|
|
920
|
-
}
|
|
921
|
-
diagnostic.lines = msgLines;
|
|
922
|
-
break;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
catch (e) { }
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
return diagnostic;
|
|
930
|
-
};
|
|
931
|
-
/**
|
|
932
|
-
* Split a corpus by newlines. Carriage returns are treated a newlines.
|
|
933
|
-
* @param sourceText the corpus to split
|
|
934
|
-
* @returns the split text
|
|
935
|
-
*/
|
|
936
|
-
const splitLineBreaks = (sourceText) => {
|
|
937
|
-
if (typeof sourceText !== 'string')
|
|
938
|
-
return [];
|
|
939
|
-
sourceText = sourceText.replace(/\\r/g, '\n');
|
|
940
|
-
return sourceText.split('\n');
|
|
941
|
-
};
|
|
942
|
-
const escapeHtml = (unsafe) => {
|
|
943
|
-
if (unsafe === undefined)
|
|
944
|
-
return 'undefined';
|
|
945
|
-
if (unsafe === null)
|
|
946
|
-
return 'null';
|
|
947
|
-
if (typeof unsafe !== 'string') {
|
|
948
|
-
unsafe = unsafe.toString();
|
|
949
|
-
}
|
|
950
|
-
return unsafe
|
|
951
|
-
.replace(/&/g, '&')
|
|
952
|
-
.replace(/</g, '<')
|
|
953
|
-
.replace(/>/g, '>')
|
|
954
|
-
.replace(/"/g, '"')
|
|
955
|
-
.replace(/'/g, ''');
|
|
956
|
-
};
|
|
957
|
-
const MAX_ERRORS = 25;
|
|
958
|
-
|
|
959
838
|
/**
|
|
960
839
|
* Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
|
|
961
840
|
* detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
|
|
@@ -1120,6 +999,130 @@ const shouldIgnoreError = (msg) => {
|
|
|
1120
999
|
};
|
|
1121
1000
|
const TASK_CANCELED_MSG = `task canceled`;
|
|
1122
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
|
|
1004
|
+
* @param compilerCtx the current compiler context
|
|
1005
|
+
* @param diagnostics the diagnostics to normalize
|
|
1006
|
+
* @returns the normalize documents
|
|
1007
|
+
*/
|
|
1008
|
+
const normalizeDiagnostics = (compilerCtx, diagnostics) => {
|
|
1009
|
+
const maxErrorsToNormalize = 25;
|
|
1010
|
+
const normalizedErrors = [];
|
|
1011
|
+
const normalizedOthers = [];
|
|
1012
|
+
const dups = new Set();
|
|
1013
|
+
for (let i = 0; i < diagnostics.length; i++) {
|
|
1014
|
+
const d = normalizeDiagnostic(compilerCtx, diagnostics[i]);
|
|
1015
|
+
const key = d.absFilePath + d.code + d.messageText + d.type;
|
|
1016
|
+
if (dups.has(key)) {
|
|
1017
|
+
continue;
|
|
1018
|
+
}
|
|
1019
|
+
dups.add(key);
|
|
1020
|
+
const total = normalizedErrors.length + normalizedOthers.length;
|
|
1021
|
+
if (d.level === 'error') {
|
|
1022
|
+
normalizedErrors.push(d);
|
|
1023
|
+
}
|
|
1024
|
+
else if (total < maxErrorsToNormalize) {
|
|
1025
|
+
normalizedOthers.push(d);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
return [...normalizedErrors, ...normalizedOthers];
|
|
1029
|
+
};
|
|
1030
|
+
/**
|
|
1031
|
+
* Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
|
|
1032
|
+
* updating build failure contexts
|
|
1033
|
+
* @param compilerCtx the current compiler
|
|
1034
|
+
* @param diagnostic the diagnostic to normalize
|
|
1035
|
+
* @returns the altered diagnostic
|
|
1036
|
+
*/
|
|
1037
|
+
const normalizeDiagnostic = (compilerCtx, diagnostic) => {
|
|
1038
|
+
if (diagnostic.messageText) {
|
|
1039
|
+
if (typeof diagnostic.messageText.message === 'string') {
|
|
1040
|
+
diagnostic.messageText = diagnostic.messageText.message;
|
|
1041
|
+
}
|
|
1042
|
+
else if (typeof diagnostic.messageText === 'string' && diagnostic.messageText.indexOf('Error: ') === 0) {
|
|
1043
|
+
diagnostic.messageText = diagnostic.messageText.slice(7);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
if (diagnostic.messageText) {
|
|
1047
|
+
if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
|
|
1048
|
+
diagnostic.header = `Missing "h" import for JSX types`;
|
|
1049
|
+
diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
|
|
1050
|
+
try {
|
|
1051
|
+
const sourceText = compilerCtx.fs.readFileSync(diagnostic.absFilePath);
|
|
1052
|
+
const srcLines = splitLineBreaks(sourceText);
|
|
1053
|
+
for (let i = 0; i < srcLines.length; i++) {
|
|
1054
|
+
const srcLine = srcLines[i];
|
|
1055
|
+
if (srcLine.includes('@stencil/core')) {
|
|
1056
|
+
const msgLines = [];
|
|
1057
|
+
const beforeLineIndex = i - 1;
|
|
1058
|
+
if (beforeLineIndex > -1) {
|
|
1059
|
+
const beforeLine = {
|
|
1060
|
+
lineIndex: beforeLineIndex,
|
|
1061
|
+
lineNumber: beforeLineIndex + 1,
|
|
1062
|
+
text: srcLines[beforeLineIndex],
|
|
1063
|
+
errorCharStart: -1,
|
|
1064
|
+
errorLength: -1,
|
|
1065
|
+
};
|
|
1066
|
+
msgLines.push(beforeLine);
|
|
1067
|
+
}
|
|
1068
|
+
const errorLine = {
|
|
1069
|
+
lineIndex: i,
|
|
1070
|
+
lineNumber: i + 1,
|
|
1071
|
+
text: srcLine,
|
|
1072
|
+
errorCharStart: 0,
|
|
1073
|
+
errorLength: -1,
|
|
1074
|
+
};
|
|
1075
|
+
msgLines.push(errorLine);
|
|
1076
|
+
diagnostic.lineNumber = errorLine.lineNumber;
|
|
1077
|
+
diagnostic.columnNumber = srcLine.indexOf('}');
|
|
1078
|
+
const afterLineIndex = i + 1;
|
|
1079
|
+
if (afterLineIndex < srcLines.length) {
|
|
1080
|
+
const afterLine = {
|
|
1081
|
+
lineIndex: afterLineIndex,
|
|
1082
|
+
lineNumber: afterLineIndex + 1,
|
|
1083
|
+
text: srcLines[afterLineIndex],
|
|
1084
|
+
errorCharStart: -1,
|
|
1085
|
+
errorLength: -1,
|
|
1086
|
+
};
|
|
1087
|
+
msgLines.push(afterLine);
|
|
1088
|
+
}
|
|
1089
|
+
diagnostic.lines = msgLines;
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
catch (e) { }
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return diagnostic;
|
|
1098
|
+
};
|
|
1099
|
+
/**
|
|
1100
|
+
* Split a corpus by newlines. Carriage returns are treated a newlines.
|
|
1101
|
+
* @param sourceText the corpus to split
|
|
1102
|
+
* @returns the split text
|
|
1103
|
+
*/
|
|
1104
|
+
const splitLineBreaks = (sourceText) => {
|
|
1105
|
+
if (typeof sourceText !== 'string')
|
|
1106
|
+
return [];
|
|
1107
|
+
sourceText = sourceText.replace(/\\r/g, '\n');
|
|
1108
|
+
return sourceText.split('\n');
|
|
1109
|
+
};
|
|
1110
|
+
const escapeHtml = (unsafe) => {
|
|
1111
|
+
if (unsafe === undefined)
|
|
1112
|
+
return 'undefined';
|
|
1113
|
+
if (unsafe === null)
|
|
1114
|
+
return 'null';
|
|
1115
|
+
if (typeof unsafe !== 'string') {
|
|
1116
|
+
unsafe = unsafe.toString();
|
|
1117
|
+
}
|
|
1118
|
+
return unsafe
|
|
1119
|
+
.replace(/&/g, '&')
|
|
1120
|
+
.replace(/</g, '<')
|
|
1121
|
+
.replace(/>/g, '>')
|
|
1122
|
+
.replace(/"/g, '"')
|
|
1123
|
+
.replace(/'/g, ''');
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1123
1126
|
const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
|
|
1124
1127
|
const formattedCode = formatErrorCode(rollupError.code);
|
|
1125
1128
|
const diagnostic = {
|
|
@@ -1258,6 +1261,8 @@ const formatErrorCode = (errorCode) => {
|
|
|
1258
1261
|
* Forward-slash paths can be used in Windows as long as they're not
|
|
1259
1262
|
* extended-length paths and don't contain any non-ascii characters.
|
|
1260
1263
|
* This was created since the path methods in Node.js outputs \\ paths on Windows.
|
|
1264
|
+
* @param path the Windows-based path to convert
|
|
1265
|
+
* @returns the converted path
|
|
1261
1266
|
*/
|
|
1262
1267
|
const normalizePath$1 = (path) => {
|
|
1263
1268
|
if (typeof path !== 'string') {
|
|
@@ -1393,8 +1398,10 @@ const pathComponents = (path, rootLength) => {
|
|
|
1393
1398
|
return [root, ...rest];
|
|
1394
1399
|
};
|
|
1395
1400
|
/**
|
|
1396
|
-
* Same as normalizePath(), expect it'll also strip any
|
|
1401
|
+
* Same as normalizePath(), expect it'll also strip any query strings
|
|
1397
1402
|
* from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
|
|
1403
|
+
* @param p the path to normalize
|
|
1404
|
+
* @returns the normalized path, sans any query strings
|
|
1398
1405
|
*/
|
|
1399
1406
|
const normalizeFsPath = (p) => normalizePath$1(p.split('?')[0].replace(/\0/g, ''));
|
|
1400
1407
|
const normalizeFsPathQuery = (importPath) => {
|
|
@@ -1570,6 +1577,15 @@ const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
|
|
|
1570
1577
|
return result.trim();
|
|
1571
1578
|
};
|
|
1572
1579
|
|
|
1580
|
+
/**
|
|
1581
|
+
* Determines whether a string should be considered a remote url or not.
|
|
1582
|
+
*
|
|
1583
|
+
* This helper only checks the provided string to evaluate is one of a few pre-defined schemes, and should not be
|
|
1584
|
+
* considered all-encompassing
|
|
1585
|
+
*
|
|
1586
|
+
* @param p the string to evaluate
|
|
1587
|
+
* @returns `true` if the provided string is a remote url, `false` otherwise
|
|
1588
|
+
*/
|
|
1573
1589
|
const isRemoteUrl = (p) => {
|
|
1574
1590
|
if (isString$1(p)) {
|
|
1575
1591
|
p = p.toLowerCase();
|
|
@@ -1639,12 +1655,23 @@ ${docs.tags
|
|
|
1639
1655
|
.map((tag) => `@${tag.name} ${(tag.text || '').replace(lineBreakRegex, ' ')}`)
|
|
1640
1656
|
.join('\n')}`.trim();
|
|
1641
1657
|
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Retrieve a project's dependencies from the current build context
|
|
1660
|
+
* @param buildCtx the current build context to query for a specific package
|
|
1661
|
+
* @returns a list of package names the project is dependent on
|
|
1662
|
+
*/
|
|
1642
1663
|
const getDependencies = (buildCtx) => {
|
|
1643
1664
|
if (buildCtx.packageJson != null && buildCtx.packageJson.dependencies != null) {
|
|
1644
1665
|
return Object.keys(buildCtx.packageJson.dependencies).filter((pkgName) => !SKIP_DEPS.includes(pkgName));
|
|
1645
1666
|
}
|
|
1646
1667
|
return [];
|
|
1647
1668
|
};
|
|
1669
|
+
/**
|
|
1670
|
+
* Utility to determine whether a project has a dependency on a package
|
|
1671
|
+
* @param buildCtx the current build context to query for a specific package
|
|
1672
|
+
* @param depName the name of the dependency/package
|
|
1673
|
+
* @returns `true` if the project has a dependency a packaged with the provided name, `false` otherwise
|
|
1674
|
+
*/
|
|
1648
1675
|
const hasDependency = (buildCtx, depName) => {
|
|
1649
1676
|
return getDependencies(buildCtx).includes(depName);
|
|
1650
1677
|
};
|
|
@@ -4000,7 +4027,7 @@ const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
|
|
|
4000
4027
|
};
|
|
4001
4028
|
};
|
|
4002
4029
|
|
|
4003
|
-
const buildId = '
|
|
4030
|
+
const buildId = '20220603032000';
|
|
4004
4031
|
const minfyJsId = 'terser5.6.1_7';
|
|
4005
4032
|
const optimizeCssId = 'autoprefixer10.2.5_postcss8.2.13_7';
|
|
4006
4033
|
const parse5Version = '6.0.1';
|
|
@@ -4008,8 +4035,8 @@ const rollupVersion = '2.42.3';
|
|
|
4008
4035
|
const sizzleVersion = '2.42.3';
|
|
4009
4036
|
const terserVersion = '5.6.1';
|
|
4010
4037
|
const typescriptVersion = '4.5.4';
|
|
4011
|
-
const vermoji = '
|
|
4012
|
-
const version$3 = '2.16.0';
|
|
4038
|
+
const vermoji = '🌸';
|
|
4039
|
+
const version$3 = '2.16.1-0';
|
|
4013
4040
|
const versions = {
|
|
4014
4041
|
stencil: version$3,
|
|
4015
4042
|
parse5: parse5Version,
|
|
@@ -11670,7 +11697,7 @@ const createWorkerMessageHandler = (sys) => {
|
|
|
11670
11697
|
const fnArgs = msgToWorker.args.slice(1);
|
|
11671
11698
|
const fn = workerCtx[fnName];
|
|
11672
11699
|
if (typeof fn === 'function') {
|
|
11673
|
-
return fn
|
|
11700
|
+
return fn(...fnArgs);
|
|
11674
11701
|
}
|
|
11675
11702
|
};
|
|
11676
11703
|
};
|
|
@@ -13785,8 +13812,8 @@ function generateBuildStats(config, buildCtx) {
|
|
|
13785
13812
|
/**
|
|
13786
13813
|
* Writes the files from the stats config to the file system
|
|
13787
13814
|
* @param config the project build configuration
|
|
13788
|
-
* @param
|
|
13789
|
-
*
|
|
13815
|
+
* @param data the information to write out to disk (as specified by each stats output target specified in the provided
|
|
13816
|
+
* config)
|
|
13790
13817
|
*/
|
|
13791
13818
|
async function writeBuildStats(config, data) {
|
|
13792
13819
|
const statsTargets = config.outputTargets.filter(isOutputTargetStats);
|
|
@@ -55436,6 +55463,7 @@ const addDefineCustomElementFunction = (tagNames, newStatements, caseStatements)
|
|
|
55436
55463
|
* ```typescript
|
|
55437
55464
|
* defineCustomElement(MyPrincipalComponent);
|
|
55438
55465
|
* ```
|
|
55466
|
+
* @param componentName the component's class name to use as the first argument to `defineCustomElement`
|
|
55439
55467
|
* @returns the expression statement described above
|
|
55440
55468
|
*/
|
|
55441
55469
|
function createAutoDefinitionExpression(componentName) {
|
|
@@ -56811,9 +56839,15 @@ const addLazyElementGetter = (classMembers, moduleFile, cmp) => {
|
|
|
56811
56839
|
|
|
56812
56840
|
/**
|
|
56813
56841
|
* Adds static "style" getter within the class
|
|
56842
|
+
* ```typescript
|
|
56814
56843
|
* const MyComponent = class {
|
|
56815
56844
|
* static get style() { return "styles"; }
|
|
56816
56845
|
* }
|
|
56846
|
+
* ```
|
|
56847
|
+
* @param classMembers a class to existing members of a class. **this parameter will be mutated** rather than returning
|
|
56848
|
+
* a cloned version
|
|
56849
|
+
* @param cmp the metadata associated with the component being evaluated
|
|
56850
|
+
* @param commentOriginalSelector if `true`, add a comment with the original CSS selector to the style.
|
|
56817
56851
|
*/
|
|
56818
56852
|
const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelector) => {
|
|
56819
56853
|
const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
|
|
@@ -56823,11 +56857,15 @@ const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelec
|
|
|
56823
56857
|
};
|
|
56824
56858
|
/**
|
|
56825
56859
|
* Adds static "style" property to the class variable.
|
|
56860
|
+
* ```typescript
|
|
56826
56861
|
* const MyComponent = class {}
|
|
56827
56862
|
* MyComponent.style = "styles";
|
|
56863
|
+
* ```
|
|
56864
|
+
* @param styleStatements a list of statements containing style assignments to a class
|
|
56865
|
+
* @param cmp the metadata associated with the component being evaluated
|
|
56828
56866
|
*/
|
|
56829
|
-
const addStaticStylePropertyToClass = (styleStatements, cmp
|
|
56830
|
-
const styleLiteral = getStyleLiteral(cmp,
|
|
56867
|
+
const addStaticStylePropertyToClass = (styleStatements, cmp) => {
|
|
56868
|
+
const styleLiteral = getStyleLiteral(cmp, false);
|
|
56831
56869
|
if (styleLiteral) {
|
|
56832
56870
|
const statement = t.createStatement(t.createAssignment(t.createPropertyAccess(t.createIdentifier(cmp.componentClassName), 'style'), styleLiteral));
|
|
56833
56871
|
styleStatements.push(statement);
|
|
@@ -57429,7 +57467,7 @@ const updateLazyComponentMembers = (transformOpts, styleStatements, classNode, m
|
|
|
57429
57467
|
addWatchers(classMembers, cmp);
|
|
57430
57468
|
transformHostData(classMembers, moduleFile);
|
|
57431
57469
|
if (transformOpts.style === 'static') {
|
|
57432
|
-
addStaticStylePropertyToClass(styleStatements, cmp
|
|
57470
|
+
addStaticStylePropertyToClass(styleStatements, cmp);
|
|
57433
57471
|
}
|
|
57434
57472
|
return classMembers;
|
|
57435
57473
|
};
|
|
@@ -62280,7 +62318,7 @@ const getRelativeDts = (config, srcPath, emitDtsPath) => {
|
|
|
62280
62318
|
emitDtsPath = join(emitDtsPath, '..');
|
|
62281
62319
|
srcPath = normalizePath$1(join(srcPath, '..'));
|
|
62282
62320
|
}
|
|
62283
|
-
return join
|
|
62321
|
+
return join(...parts.reverse());
|
|
62284
62322
|
};
|
|
62285
62323
|
|
|
62286
62324
|
const outputServiceWorkers = async (config, buildCtx) => {
|
|
@@ -62758,9 +62796,16 @@ const createInMemoryFs = (sys) => {
|
|
|
62758
62796
|
return data.exists;
|
|
62759
62797
|
};
|
|
62760
62798
|
/**
|
|
62761
|
-
* Synchronous!!! Do not use
|
|
62799
|
+
* **Synchronous!!! Do not use!!!**
|
|
62762
62800
|
* (Only typescript transpiling is allowed to use)
|
|
62763
|
-
*
|
|
62801
|
+
*
|
|
62802
|
+
* Synchronously get information about a file from a provided path. This function will attempt to use an in-memory
|
|
62803
|
+
* cache before performing a blocking read.
|
|
62804
|
+
*
|
|
62805
|
+
* In the event of a cache hit, the content from the cache will be returned and skip the read.
|
|
62806
|
+
*
|
|
62807
|
+
* @param filePath the path to the file to read
|
|
62808
|
+
* @returns `true` if the file exists, `false` otherwise
|
|
62764
62809
|
*/
|
|
62765
62810
|
const accessSync = (filePath) => {
|
|
62766
62811
|
const item = getItem(filePath);
|
|
@@ -62932,9 +62977,19 @@ const createInMemoryFs = (sys) => {
|
|
|
62932
62977
|
return fileText;
|
|
62933
62978
|
};
|
|
62934
62979
|
/**
|
|
62935
|
-
* Synchronous!!! Do not use
|
|
62980
|
+
* **Synchronous!!! Do not use!!!**
|
|
62936
62981
|
* (Only typescript transpiling is allowed to use)
|
|
62937
|
-
*
|
|
62982
|
+
*
|
|
62983
|
+
* Synchronously read a file from a provided path. This function will attempt to use an in-memory cache before
|
|
62984
|
+
* performing a blocking read in the following circumstances:
|
|
62985
|
+
* - no `opts` are provided
|
|
62986
|
+
* - the `useCache` member on `opts` is set to `true`, or is not set
|
|
62987
|
+
*
|
|
62988
|
+
* In the event of a cache hit, the content from the cache will be returned and skip the read.
|
|
62989
|
+
*
|
|
62990
|
+
* @param filePath the path to the file to read
|
|
62991
|
+
* @param opts a configuration to use when reading a file
|
|
62992
|
+
* @returns the contents of the file (read from either disk or the cache).
|
|
62938
62993
|
*/
|
|
62939
62994
|
const readFileSync = (filePath, opts) => {
|
|
62940
62995
|
if (opts == null || opts.useCache === true || opts.useCache === undefined) {
|
|
@@ -63027,10 +63082,13 @@ const createInMemoryFs = (sys) => {
|
|
|
63027
63082
|
};
|
|
63028
63083
|
};
|
|
63029
63084
|
/**
|
|
63030
|
-
* Synchronous!!! Do not use
|
|
63031
|
-
* Always returns an object, does not throw errors.
|
|
63085
|
+
* **Synchronous!!! Do not use!!!**
|
|
63032
63086
|
* (Only typescript transpiling is allowed to use)
|
|
63033
|
-
*
|
|
63087
|
+
*
|
|
63088
|
+
* Searches an in-memory cache for an item at the provided path. Always returns an object, **does not throw errors**.
|
|
63089
|
+
*
|
|
63090
|
+
* @param itemPath the path to the file to read
|
|
63091
|
+
* @returns an object describing the item found at the provided `itemPath`
|
|
63034
63092
|
*/
|
|
63035
63093
|
const statSync = (itemPath) => {
|
|
63036
63094
|
const item = getItem(itemPath);
|
|
@@ -64541,7 +64599,7 @@ const getComponentPathContent = (componentGraph, outputTarget) => {
|
|
|
64541
64599
|
const dependencies = [
|
|
64542
64600
|
{
|
|
64543
64601
|
name: "@stencil/core",
|
|
64544
|
-
version: "2.16.0",
|
|
64602
|
+
version: "2.16.1-0",
|
|
64545
64603
|
main: "compiler/stencil.js",
|
|
64546
64604
|
resources: [
|
|
64547
64605
|
"package.json",
|
|
@@ -65919,7 +65977,7 @@ const validateConfig = (userConfig = {}) => {
|
|
|
65919
65977
|
setBooleanConfig(config, 'sourceMap', null, typeof config.sourceMap === 'undefined' ? false : config.sourceMap);
|
|
65920
65978
|
setBooleanConfig(config, 'watch', 'watch', false);
|
|
65921
65979
|
setBooleanConfig(config, 'buildDocs', 'docs', !config.devMode);
|
|
65922
|
-
setBooleanConfig(config, 'buildDist',
|
|
65980
|
+
setBooleanConfig(config, 'buildDist', 'esm', !config.devMode || config.buildEs5);
|
|
65923
65981
|
setBooleanConfig(config, 'profile', 'profile', config.devMode);
|
|
65924
65982
|
setBooleanConfig(config, 'writeLog', 'log', false);
|
|
65925
65983
|
setBooleanConfig(config, 'buildAppCore', null, true);
|
|
@@ -66454,6 +66512,10 @@ const convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collect
|
|
|
66454
66512
|
|
|
66455
66513
|
/**
|
|
66456
66514
|
* Stand-alone compiling of a single string
|
|
66515
|
+
* @param config the Stencil configuration to use in the compilation process
|
|
66516
|
+
* @param input the string to compile
|
|
66517
|
+
* @param transformOpts a configuration object for how the string is compiled
|
|
66518
|
+
* @returns the results of compiling the provided input string
|
|
66457
66519
|
*/
|
|
66458
66520
|
const transpileModule = (config, input, transformOpts) => {
|
|
66459
66521
|
if (!config.logger) {
|