@rindo/core 2.16.0-beta.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/rindo.js +209 -147
- package/compiler/rindo.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +5 -5
- 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/dev-server/templates/initial-load.html +2 -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/rindo-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 +5 -3
- 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 +18 -14
- package/testing/package.json +1 -1
package/compiler/rindo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Compiler
|
|
2
|
+
Rindo Compiler v2.16.1-0 | MIT Licensed | https://rindojs.web.app
|
|
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 "@rindo/core" by each component using JSX. For example: import { Component, h } from '@rindo/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('@rindo/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 "@rindo/core" by each component using JSX. For example: import { Component, h } from '@rindo/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('@rindo/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
|
};
|
|
@@ -4523,7 +4550,7 @@ const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
|
|
|
4523
4550
|
};
|
|
4524
4551
|
};
|
|
4525
4552
|
|
|
4526
|
-
const buildId = '
|
|
4553
|
+
const buildId = '20220812071405';
|
|
4527
4554
|
const minfyJsId = 'terser5.6.1_7';
|
|
4528
4555
|
const optimizeCssId = 'autoprefixer10.2.5_postcss8.4.16_7';
|
|
4529
4556
|
const parse5Version = '6.0.1';
|
|
@@ -4531,8 +4558,8 @@ const rollupVersion = '2.42.3';
|
|
|
4531
4558
|
const sizzleVersion = '2.42.3';
|
|
4532
4559
|
const terserVersion = '5.6.1';
|
|
4533
4560
|
const typescriptVersion = '4.5.4';
|
|
4534
|
-
const vermoji = '
|
|
4535
|
-
const version$3 = '
|
|
4561
|
+
const vermoji = '🛠';
|
|
4562
|
+
const version$3 = '2.16.1-0';
|
|
4536
4563
|
const versions = {
|
|
4537
4564
|
rindo: version$3,
|
|
4538
4565
|
parse5: parse5Version,
|
|
@@ -12188,7 +12215,7 @@ const createWorkerMessageHandler = (sys) => {
|
|
|
12188
12215
|
const fnArgs = msgToWorker.args.slice(1);
|
|
12189
12216
|
const fn = workerCtx[fnName];
|
|
12190
12217
|
if (typeof fn === 'function') {
|
|
12191
|
-
return fn
|
|
12218
|
+
return fn(...fnArgs);
|
|
12192
12219
|
}
|
|
12193
12220
|
};
|
|
12194
12221
|
};
|
|
@@ -14306,8 +14333,8 @@ function generateBuildStats(config, buildCtx) {
|
|
|
14306
14333
|
/**
|
|
14307
14334
|
* Writes the files from the stats config to the file system
|
|
14308
14335
|
* @param config the project build configuration
|
|
14309
|
-
* @param
|
|
14310
|
-
*
|
|
14336
|
+
* @param data the information to write out to disk (as specified by each stats output target specified in the provided
|
|
14337
|
+
* config)
|
|
14311
14338
|
*/
|
|
14312
14339
|
async function writeBuildStats(config, data) {
|
|
14313
14340
|
const statsTargets = config.outputTargets.filter(isOutputTargetStats);
|
|
@@ -55956,6 +55983,7 @@ const addDefineCustomElementFunction = (tagNames, newStatements, caseStatements)
|
|
|
55956
55983
|
* ```typescript
|
|
55957
55984
|
* defineCustomElement(MyPrincipalComponent);
|
|
55958
55985
|
* ```
|
|
55986
|
+
* @param componentName the component's class name to use as the first argument to `defineCustomElement`
|
|
55959
55987
|
* @returns the expression statement described above
|
|
55960
55988
|
*/
|
|
55961
55989
|
function createAutoDefinitionExpression(componentName) {
|
|
@@ -57331,9 +57359,15 @@ const addLazyElementGetter = (classMembers, moduleFile, cmp) => {
|
|
|
57331
57359
|
|
|
57332
57360
|
/**
|
|
57333
57361
|
* Adds static "style" getter within the class
|
|
57362
|
+
* ```typescript
|
|
57334
57363
|
* const MyComponent = class {
|
|
57335
57364
|
* static get style() { return "styles"; }
|
|
57336
57365
|
* }
|
|
57366
|
+
* ```
|
|
57367
|
+
* @param classMembers a class to existing members of a class. **this parameter will be mutated** rather than returning
|
|
57368
|
+
* a cloned version
|
|
57369
|
+
* @param cmp the metadata associated with the component being evaluated
|
|
57370
|
+
* @param commentOriginalSelector if `true`, add a comment with the original CSS selector to the style.
|
|
57337
57371
|
*/
|
|
57338
57372
|
const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelector) => {
|
|
57339
57373
|
const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
|
|
@@ -57343,11 +57377,15 @@ const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelec
|
|
|
57343
57377
|
};
|
|
57344
57378
|
/**
|
|
57345
57379
|
* Adds static "style" property to the class variable.
|
|
57380
|
+
* ```typescript
|
|
57346
57381
|
* const MyComponent = class {}
|
|
57347
57382
|
* MyComponent.style = "styles";
|
|
57383
|
+
* ```
|
|
57384
|
+
* @param styleStatements a list of statements containing style assignments to a class
|
|
57385
|
+
* @param cmp the metadata associated with the component being evaluated
|
|
57348
57386
|
*/
|
|
57349
|
-
const addStaticStylePropertyToClass = (styleStatements, cmp
|
|
57350
|
-
const styleLiteral = getStyleLiteral(cmp,
|
|
57387
|
+
const addStaticStylePropertyToClass = (styleStatements, cmp) => {
|
|
57388
|
+
const styleLiteral = getStyleLiteral(cmp, false);
|
|
57351
57389
|
if (styleLiteral) {
|
|
57352
57390
|
const statement = t.createStatement(t.createAssignment(t.createPropertyAccess(t.createIdentifier(cmp.componentClassName), 'style'), styleLiteral));
|
|
57353
57391
|
styleStatements.push(statement);
|
|
@@ -57949,7 +57987,7 @@ const updateLazyComponentMembers = (transformOpts, styleStatements, classNode, m
|
|
|
57949
57987
|
addWatchers(classMembers, cmp);
|
|
57950
57988
|
transformHostData(classMembers, moduleFile);
|
|
57951
57989
|
if (transformOpts.style === 'static') {
|
|
57952
|
-
addStaticStylePropertyToClass(styleStatements, cmp
|
|
57990
|
+
addStaticStylePropertyToClass(styleStatements, cmp);
|
|
57953
57991
|
}
|
|
57954
57992
|
return classMembers;
|
|
57955
57993
|
};
|
|
@@ -62800,7 +62838,7 @@ const getRelativeDts = (config, srcPath, emitDtsPath) => {
|
|
|
62800
62838
|
emitDtsPath = join(emitDtsPath, '..');
|
|
62801
62839
|
srcPath = normalizePath$1(join(srcPath, '..'));
|
|
62802
62840
|
}
|
|
62803
|
-
return join
|
|
62841
|
+
return join(...parts.reverse());
|
|
62804
62842
|
};
|
|
62805
62843
|
|
|
62806
62844
|
const outputServiceWorkers = async (config, buildCtx) => {
|
|
@@ -63278,9 +63316,16 @@ const createInMemoryFs = (sys) => {
|
|
|
63278
63316
|
return data.exists;
|
|
63279
63317
|
};
|
|
63280
63318
|
/**
|
|
63281
|
-
* Synchronous!!! Do not use
|
|
63319
|
+
* **Synchronous!!! Do not use!!!**
|
|
63282
63320
|
* (Only typescript transpiling is allowed to use)
|
|
63283
|
-
*
|
|
63321
|
+
*
|
|
63322
|
+
* Synchronously get information about a file from a provided path. This function will attempt to use an in-memory
|
|
63323
|
+
* cache before performing a blocking read.
|
|
63324
|
+
*
|
|
63325
|
+
* In the event of a cache hit, the content from the cache will be returned and skip the read.
|
|
63326
|
+
*
|
|
63327
|
+
* @param filePath the path to the file to read
|
|
63328
|
+
* @returns `true` if the file exists, `false` otherwise
|
|
63284
63329
|
*/
|
|
63285
63330
|
const accessSync = (filePath) => {
|
|
63286
63331
|
const item = getItem(filePath);
|
|
@@ -63452,9 +63497,19 @@ const createInMemoryFs = (sys) => {
|
|
|
63452
63497
|
return fileText;
|
|
63453
63498
|
};
|
|
63454
63499
|
/**
|
|
63455
|
-
* Synchronous!!! Do not use
|
|
63500
|
+
* **Synchronous!!! Do not use!!!**
|
|
63456
63501
|
* (Only typescript transpiling is allowed to use)
|
|
63457
|
-
*
|
|
63502
|
+
*
|
|
63503
|
+
* Synchronously read a file from a provided path. This function will attempt to use an in-memory cache before
|
|
63504
|
+
* performing a blocking read in the following circumstances:
|
|
63505
|
+
* - no `opts` are provided
|
|
63506
|
+
* - the `useCache` member on `opts` is set to `true`, or is not set
|
|
63507
|
+
*
|
|
63508
|
+
* In the event of a cache hit, the content from the cache will be returned and skip the read.
|
|
63509
|
+
*
|
|
63510
|
+
* @param filePath the path to the file to read
|
|
63511
|
+
* @param opts a configuration to use when reading a file
|
|
63512
|
+
* @returns the contents of the file (read from either disk or the cache).
|
|
63458
63513
|
*/
|
|
63459
63514
|
const readFileSync = (filePath, opts) => {
|
|
63460
63515
|
if (opts == null || opts.useCache === true || opts.useCache === undefined) {
|
|
@@ -63547,10 +63602,13 @@ const createInMemoryFs = (sys) => {
|
|
|
63547
63602
|
};
|
|
63548
63603
|
};
|
|
63549
63604
|
/**
|
|
63550
|
-
* Synchronous!!! Do not use
|
|
63551
|
-
* Always returns an object, does not throw errors.
|
|
63605
|
+
* **Synchronous!!! Do not use!!!**
|
|
63552
63606
|
* (Only typescript transpiling is allowed to use)
|
|
63553
|
-
*
|
|
63607
|
+
*
|
|
63608
|
+
* Searches an in-memory cache for an item at the provided path. Always returns an object, **does not throw errors**.
|
|
63609
|
+
*
|
|
63610
|
+
* @param itemPath the path to the file to read
|
|
63611
|
+
* @returns an object describing the item found at the provided `itemPath`
|
|
63554
63612
|
*/
|
|
63555
63613
|
const statSync = (itemPath) => {
|
|
63556
63614
|
const item = getItem(itemPath);
|
|
@@ -65061,7 +65119,7 @@ const getComponentPathContent = (componentGraph, outputTarget) => {
|
|
|
65061
65119
|
const dependencies = [
|
|
65062
65120
|
{
|
|
65063
65121
|
name: "@rindo/core",
|
|
65064
|
-
version: "
|
|
65122
|
+
version: "2.16.1-0",
|
|
65065
65123
|
main: "compiler/rindo.js",
|
|
65066
65124
|
resources: [
|
|
65067
65125
|
"package.json",
|
|
@@ -66439,7 +66497,7 @@ const validateConfig = (userConfig = {}) => {
|
|
|
66439
66497
|
setBooleanConfig(config, 'sourceMap', null, typeof config.sourceMap === 'undefined' ? false : config.sourceMap);
|
|
66440
66498
|
setBooleanConfig(config, 'watch', 'watch', false);
|
|
66441
66499
|
setBooleanConfig(config, 'buildDocs', 'docs', !config.devMode);
|
|
66442
|
-
setBooleanConfig(config, 'buildDist',
|
|
66500
|
+
setBooleanConfig(config, 'buildDist', 'esm', !config.devMode || config.buildEs5);
|
|
66443
66501
|
setBooleanConfig(config, 'profile', 'profile', config.devMode);
|
|
66444
66502
|
setBooleanConfig(config, 'writeLog', 'log', false);
|
|
66445
66503
|
setBooleanConfig(config, 'buildAppCore', null, true);
|
|
@@ -66974,6 +67032,10 @@ const convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collect
|
|
|
66974
67032
|
|
|
66975
67033
|
/**
|
|
66976
67034
|
* Stand-alone compiling of a single string
|
|
67035
|
+
* @param config the Rindo configuration to use in the compilation process
|
|
67036
|
+
* @param input the string to compile
|
|
67037
|
+
* @param transformOpts a configuration object for how the string is compiled
|
|
67038
|
+
* @returns the results of compiling the provided input string
|
|
66977
67039
|
*/
|
|
66978
67040
|
const transpileModule = (config, input, transformOpts) => {
|
|
66979
67041
|
if (!config.logger) {
|