@rindo/core 4.18.3 → 4.19.0-dev.1734909053.96af66b
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 +43 -16
- package/cli/index.js +43 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +187 -77
- 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 +2 -2
- package/dev-server/ws.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +535 -508
- package/internal/client/package.json +3 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +108 -50
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +29 -11
- package/internal/hydrate/runner.js +239 -260
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +39 -14
- package/internal/rindo-public-compiler.d.ts +21 -0
- package/internal/rindo-public-runtime.d.ts +0 -2
- package/internal/testing/index.js +439 -407
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +137 -131
- package/mock-doc/index.d.ts +18 -4
- package/mock-doc/index.js +137 -131
- package/mock-doc/package.json +1 -1
- package/package.json +38 -6
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +10 -10
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +95 -16
- package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
- package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
- package/testing/jest/jest-28/matchers/events.d.ts +4 -0
- package/testing/jest/jest-28/matchers/index.d.ts +2 -1
- package/testing/jest/jest-29/matchers/events.d.ts +4 -0
- package/testing/jest/jest-29/matchers/index.d.ts +2 -1
- package/testing/mocks.d.ts +9 -9
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
package/compiler/rindo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Compiler v4.
|
|
2
|
+
Rindo Compiler v4.19.0-dev.1734909053.96af66b | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
@@ -115662,18 +115662,18 @@ ${lanes.join("\n")}
|
|
|
115662
115662
|
0
|
|
115663
115663
|
/* Call */
|
|
115664
115664
|
);
|
|
115665
|
-
const
|
|
115666
|
-
if (callSignatures.length === 0 && !
|
|
115665
|
+
const isPromise = !!getAwaitedTypeOfPromise(type);
|
|
115666
|
+
if (callSignatures.length === 0 && !isPromise) {
|
|
115667
115667
|
return;
|
|
115668
115668
|
}
|
|
115669
115669
|
const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0;
|
|
115670
115670
|
const testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
115671
|
-
if (!testedSymbol && !
|
|
115671
|
+
if (!testedSymbol && !isPromise) {
|
|
115672
115672
|
return;
|
|
115673
115673
|
}
|
|
115674
115674
|
const isUsed = testedSymbol && isBinaryExpression(condExpr2.parent) && isSymbolUsedInBinaryExpressionChain(condExpr2.parent, testedSymbol) || testedSymbol && body2 && isSymbolUsedInConditionBody(condExpr2, body2, testedNode, testedSymbol);
|
|
115675
115675
|
if (!isUsed) {
|
|
115676
|
-
if (
|
|
115676
|
+
if (isPromise) {
|
|
115677
115677
|
errorAndMaybeSuggestAwait(
|
|
115678
115678
|
location,
|
|
115679
115679
|
/*maybeMissingAwait*/
|
|
@@ -231091,16 +231091,16 @@ ${e.message}`;
|
|
|
231091
231091
|
var typescript_5_4_5_bundle_cache_min_default = ts;
|
|
231092
231092
|
|
|
231093
231093
|
// src/version.ts
|
|
231094
|
-
var buildId = "
|
|
231095
|
-
var minfyJsId = "terser5.31.
|
|
231094
|
+
var buildId = "1734909053";
|
|
231095
|
+
var minfyJsId = "terser5.31.1_7";
|
|
231096
231096
|
var optimizeCssId = "autoprefixer10.4.19_postcss8.4.38_7";
|
|
231097
231097
|
var parse5Version = "7.1.2";
|
|
231098
231098
|
var rollupVersion = "2.56.3";
|
|
231099
231099
|
var jqueryVersion = "4.0.0-pre";
|
|
231100
|
-
var terserVersion = "5.31.
|
|
231100
|
+
var terserVersion = "5.31.1";
|
|
231101
231101
|
var typescriptVersion = "5.4.5";
|
|
231102
|
-
var vermoji = "\u{
|
|
231103
|
-
var version = "4.
|
|
231102
|
+
var vermoji = "\u{1F3CF}";
|
|
231103
|
+
var version = "4.19.0-dev.1734909053.96af66b";
|
|
231104
231104
|
var versions = {
|
|
231105
231105
|
rindo: version,
|
|
231106
231106
|
parse5: parse5Version,
|
|
@@ -231392,7 +231392,6 @@ var isNumber = (v) => typeof v === "number";
|
|
|
231392
231392
|
var isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
231393
231393
|
var isString = (v) => typeof v === "string";
|
|
231394
231394
|
var isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
|
|
231395
|
-
var isPromise = (v) => !!v && (typeof v === "object" || typeof v === "function") && typeof v.then === "function";
|
|
231396
231395
|
|
|
231397
231396
|
// src/utils/is-glob.ts
|
|
231398
231397
|
var isGlob = (str) => {
|
|
@@ -234128,7 +234127,7 @@ var TYPE_LIBRARY = {};
|
|
|
234128
234127
|
function addToLibrary(type, typeName, checker, pathToTypeModule) {
|
|
234129
234128
|
pathToTypeModule = relative(process.cwd(), pathToTypeModule);
|
|
234130
234129
|
if (pathToTypeModule.startsWith("node_modules")) {
|
|
234131
|
-
return "";
|
|
234130
|
+
return "node_modules::" + typeName;
|
|
234132
234131
|
}
|
|
234133
234132
|
const id = getTypeId(pathToTypeModule, typeName);
|
|
234134
234133
|
if (!type.isTypeParameter() && !(id in TYPE_LIBRARY)) {
|
|
@@ -237067,9 +237066,10 @@ function replace(options) {
|
|
|
237067
237066
|
}
|
|
237068
237067
|
var functionValues = mapToFunctions(replacements);
|
|
237069
237068
|
var keys2 = Object.keys(functionValues).sort(longest).map(escape3);
|
|
237070
|
-
var
|
|
237069
|
+
var lookbehind = preventAssignment ? "(?<!\\b(?:const|let|var)\\s*)" : "";
|
|
237070
|
+
var lookahead2 = preventAssignment ? "(?!\\s*=[^=])" : "";
|
|
237071
237071
|
var pattern = new RegExp(
|
|
237072
|
-
delimiters[0] + "(" + keys2.join("|") + ")" + delimiters[1] + lookahead2,
|
|
237072
|
+
"" + lookbehind + delimiters[0] + "(" + keys2.join("|") + ")" + delimiters[1] + lookahead2,
|
|
237073
237073
|
"g"
|
|
237074
237074
|
);
|
|
237075
237075
|
return {
|
|
@@ -239883,7 +239883,7 @@ var SourceMapGenerator = class _SourceMapGenerator {
|
|
|
239883
239883
|
}
|
|
239884
239884
|
};
|
|
239885
239885
|
|
|
239886
|
-
// scripts/build/terser-
|
|
239886
|
+
// scripts/build/terser-5_31_1-bundle-cache.min.js
|
|
239887
239887
|
function characters(e) {
|
|
239888
239888
|
return e.split("");
|
|
239889
239889
|
}
|
|
@@ -242577,7 +242577,7 @@ def_transform(AST_Node, noop2), def_transform(AST_LabeledStatement, function(e,
|
|
|
242577
242577
|
}
|
|
242578
242578
|
function u(e2, t2) {
|
|
242579
242579
|
e2.DEFMETHOD("to_mozilla_ast", function(e3) {
|
|
242580
|
-
return
|
|
242580
|
+
return n4 = t2(this, e3), i2 = this.start, o2 = this.end, i2 && o2 ? (null != i2.pos && null != o2.endpos && (n4.range = [i2.pos, o2.endpos]), i2.line && (n4.loc = { start: { line: i2.line, column: i2.col }, end: o2.endline ? { line: o2.endline, column: o2.endcol } : null }, i2.file && (n4.loc.source = i2.file)), n4) : n4;
|
|
242581
242581
|
var n4, i2, o2;
|
|
242582
242582
|
});
|
|
242583
242583
|
}
|
|
@@ -243985,7 +243985,10 @@ function has_break_or_continue(e, t) {
|
|
|
243985
243985
|
return t instanceof AST_LabeledStatement && i.push(t), i.push(e), e.body.walk(i), n3;
|
|
243986
243986
|
}
|
|
243987
243987
|
function maintain_this_binding(e, t, n3) {
|
|
243988
|
-
return e
|
|
243988
|
+
return requires_sequence_to_maintain_binding(e, t, n3) ? make_sequence(t, [make_node(AST_Number, t, { value: 0 }), n3]) : n3;
|
|
243989
|
+
}
|
|
243990
|
+
function requires_sequence_to_maintain_binding(e, t, n3) {
|
|
243991
|
+
return e instanceof AST_UnaryPrefix && "delete" == e.operator || e instanceof AST_Call && e.expression === t && (n3 instanceof AST_Chain || n3 instanceof AST_PropAccess || n3 instanceof AST_SymbolRef && "eval" == n3.name);
|
|
243989
243992
|
}
|
|
243990
243993
|
function is_func_expr(e) {
|
|
243991
243994
|
return e instanceof AST_Arrow || e instanceof AST_Function;
|
|
@@ -244837,6 +244840,23 @@ def_eval(AST_PropAccess, function(e, t) {
|
|
|
244837
244840
|
return t && make_sequence(this, t);
|
|
244838
244841
|
});
|
|
244839
244842
|
var r_keep_assign = /keep_assign/;
|
|
244843
|
+
function is_used_in_expression(e) {
|
|
244844
|
+
for (let t, n3, i = -1; t = e.parent(i), n3 = e.parent(i + 1); i++) {
|
|
244845
|
+
if (!(n3 instanceof AST_Sequence)) {
|
|
244846
|
+
if (n3 instanceof AST_Unary) {
|
|
244847
|
+
const e2 = n3.operator;
|
|
244848
|
+
if ("void" === e2) return false;
|
|
244849
|
+
if ("typeof" === e2 || "+" === e2 || "-" === e2 || "!" === e2 || "~" === e2) continue;
|
|
244850
|
+
}
|
|
244851
|
+
return true;
|
|
244852
|
+
}
|
|
244853
|
+
if (n3.expressions.indexOf(t) !== n3.expressions.length - 1) {
|
|
244854
|
+
const t2 = e.parent(i + 2);
|
|
244855
|
+
return !(n3.expressions.length > 2 || 1 === n3.expressions.length || !requires_sequence_to_maintain_binding(t2, n3, n3.expressions[1]));
|
|
244856
|
+
}
|
|
244857
|
+
}
|
|
244858
|
+
return true;
|
|
244859
|
+
}
|
|
244840
244860
|
function def_reduce_vars(e, t) {
|
|
244841
244861
|
e.DEFMETHOD("reduce_vars", t);
|
|
244842
244862
|
}
|
|
@@ -244952,11 +244972,14 @@ AST_Scope.DEFMETHOD("drop_unused", function(e) {
|
|
|
244952
244972
|
var f = new TreeTransformer(function(u2, c2, _2) {
|
|
244953
244973
|
var p2 = f.parent();
|
|
244954
244974
|
if (i) {
|
|
244955
|
-
const
|
|
244956
|
-
if (
|
|
244957
|
-
var d =
|
|
244975
|
+
const t2 = o(u2);
|
|
244976
|
+
if (t2 instanceof AST_SymbolRef) {
|
|
244977
|
+
var d = t2.definition(), m = r.has(d.id);
|
|
244958
244978
|
if (u2 instanceof AST_Assign) {
|
|
244959
|
-
if (!m || a.has(d.id) && a.get(d.id) !== u2)
|
|
244979
|
+
if (!m || a.has(d.id) && a.get(d.id) !== u2) {
|
|
244980
|
+
const t3 = u2.right.transform(f);
|
|
244981
|
+
return m || t3.has_side_effects(e) || is_used_in_expression(f) ? maintain_this_binding(p2, u2, t3) : _2 ? MAP.skip : make_node(AST_Number, u2, { value: 0 });
|
|
244982
|
+
}
|
|
244960
244983
|
} else if (!m) return _2 ? MAP.skip : make_node(AST_Number, u2, { value: 0 });
|
|
244961
244984
|
}
|
|
244962
244985
|
}
|
|
@@ -245025,6 +245048,13 @@ AST_Scope.DEFMETHOD("drop_unused", function(e) {
|
|
|
245025
245048
|
return l = u2, c2(u2, this), l = e2, u2;
|
|
245026
245049
|
}
|
|
245027
245050
|
}
|
|
245051
|
+
}, function(e2, t2) {
|
|
245052
|
+
if (e2 instanceof AST_Sequence) switch (e2.expressions.length) {
|
|
245053
|
+
case 0:
|
|
245054
|
+
return t2 ? MAP.skip : make_node(AST_Number, e2, { value: 0 });
|
|
245055
|
+
case 1:
|
|
245056
|
+
return e2.expressions[0];
|
|
245057
|
+
}
|
|
245028
245058
|
});
|
|
245029
245059
|
function p(e2, n4) {
|
|
245030
245060
|
var i2;
|
|
@@ -248023,10 +248053,17 @@ import { createWorker } from '${WORKER_HELPER_ID}';
|
|
|
248023
248053
|
export const workerName = '${workerName}';
|
|
248024
248054
|
export const workerMsgId = '${workerMsgId}';
|
|
248025
248055
|
export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
|
|
248026
|
-
|
|
248027
|
-
|
|
248028
|
-
|
|
248029
|
-
|
|
248056
|
+
export let worker;
|
|
248057
|
+
try {
|
|
248058
|
+
// first try directly starting the worker with the URL
|
|
248059
|
+
worker = /*@__PURE__*/createWorker(workerPath, workerName, workerMsgId);
|
|
248060
|
+
} catch(e) {
|
|
248061
|
+
// probably a cross-origin issue, try using a Blob instead
|
|
248062
|
+
const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
|
|
248063
|
+
const url = URL.createObjectURL(blob);
|
|
248064
|
+
worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
|
|
248065
|
+
URL.revokeObjectURL(url);
|
|
248066
|
+
}
|
|
248030
248067
|
`;
|
|
248031
248068
|
};
|
|
248032
248069
|
var getMockedWorkerMain = () => {
|
|
@@ -248158,7 +248195,8 @@ var getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
|
|
|
248158
248195
|
treeshake: getTreeshakeOption(config, bundleOpts),
|
|
248159
248196
|
preserveEntrySignatures: (_c = bundleOpts.preserveEntrySignatures) != null ? _c : "strict",
|
|
248160
248197
|
onwarn: createOnWarnFn(buildCtx.diagnostics),
|
|
248161
|
-
cache: compilerCtx.rollupCache.get(bundleOpts.id)
|
|
248198
|
+
cache: compilerCtx.rollupCache.get(bundleOpts.id),
|
|
248199
|
+
external: config.rollupConfig.inputOptions.external
|
|
248162
248200
|
};
|
|
248163
248201
|
return rollupOptions;
|
|
248164
248202
|
};
|
|
@@ -249751,7 +249789,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
249751
249789
|
member: cmps.some((c) => c.hasMember),
|
|
249752
249790
|
method: cmps.some((c) => c.hasMethod),
|
|
249753
249791
|
mode: cmps.some((c) => c.hasMode),
|
|
249754
|
-
observeAttribute: cmps.some((c) => c.hasAttribute),
|
|
249792
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
249755
249793
|
prop: cmps.some((c) => c.hasProp),
|
|
249756
249794
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
249757
249795
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
@@ -250553,12 +250591,17 @@ var writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupO
|
|
|
250553
250591
|
var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
|
|
250554
250592
|
const hydratePackageName = await getHydratePackageName(config, compilerCtx);
|
|
250555
250593
|
const hydrateAppDirPath = outputTarget.dir;
|
|
250594
|
+
if (!hydrateAppDirPath) {
|
|
250595
|
+
throw new Error(`outputTarget config missing the "dir" property`);
|
|
250596
|
+
}
|
|
250556
250597
|
const hydrateCoreIndexPath = join(hydrateAppDirPath, "index.js");
|
|
250598
|
+
const hydrateCoreIndexPathESM = join(hydrateAppDirPath, "index.mjs");
|
|
250557
250599
|
const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, "index.d.ts");
|
|
250558
250600
|
const pkgJsonPath = join(hydrateAppDirPath, "package.json");
|
|
250559
250601
|
const pkgJsonCode = getHydratePackageJson(
|
|
250560
250602
|
config,
|
|
250561
250603
|
hydrateCoreIndexPath,
|
|
250604
|
+
hydrateCoreIndexPathESM,
|
|
250562
250605
|
hydrateCoreIndexDtsFilePath,
|
|
250563
250606
|
hydratePackageName
|
|
250564
250607
|
);
|
|
@@ -250577,24 +250620,32 @@ var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rol
|
|
|
250577
250620
|
})
|
|
250578
250621
|
);
|
|
250579
250622
|
};
|
|
250580
|
-
var getHydratePackageJson = (config,
|
|
250623
|
+
var getHydratePackageJson = (config, hydrateAppFilePathCJS, hydrateAppFilePathESM, hydrateDtsFilePath, hydratePackageName) => {
|
|
250581
250624
|
const pkg = {
|
|
250582
250625
|
name: hydratePackageName,
|
|
250583
250626
|
description: `${config.namespace} component hydration app.`,
|
|
250584
|
-
main: (0, import_path26.basename)(
|
|
250585
|
-
types: (0, import_path26.basename)(hydrateDtsFilePath)
|
|
250627
|
+
main: (0, import_path26.basename)(hydrateAppFilePathCJS),
|
|
250628
|
+
types: (0, import_path26.basename)(hydrateDtsFilePath),
|
|
250629
|
+
exports: {
|
|
250630
|
+
".": {
|
|
250631
|
+
require: `./${(0, import_path26.basename)(hydrateAppFilePathCJS)}`,
|
|
250632
|
+
import: `./${(0, import_path26.basename)(hydrateAppFilePathESM)}`
|
|
250633
|
+
}
|
|
250634
|
+
}
|
|
250586
250635
|
};
|
|
250587
250636
|
return JSON.stringify(pkg, null, 2);
|
|
250588
250637
|
};
|
|
250589
250638
|
var getHydratePackageName = async (config, compilerCtx) => {
|
|
250639
|
+
const directoryName = (0, import_path26.basename)(config.rootDir);
|
|
250590
250640
|
try {
|
|
250591
250641
|
const rootPkgFilePath = join(config.rootDir, "package.json");
|
|
250592
250642
|
const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
|
|
250593
250643
|
const pkgData = JSON.parse(pkgStr);
|
|
250594
|
-
|
|
250644
|
+
const scope = pkgData.name || directoryName;
|
|
250645
|
+
return `${scope}/hydrate`;
|
|
250595
250646
|
} catch (e) {
|
|
250596
250647
|
}
|
|
250597
|
-
return `${config.fsNamespace}/hydrate`;
|
|
250648
|
+
return `${config.fsNamespace || directoryName}/hydrate`;
|
|
250598
250649
|
};
|
|
250599
250650
|
var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
250600
250651
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250604,6 +250655,15 @@ var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
|
250604
250655
|
};
|
|
250605
250656
|
|
|
250606
250657
|
// src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts
|
|
250658
|
+
var buildHydrateAppFor = async (format, rollupBuild, config, compilerCtx, buildCtx, outputTargets) => {
|
|
250659
|
+
const file = format === "esm" ? "index.mjs" : "index.js";
|
|
250660
|
+
const rollupOutput = await rollupBuild.generate({
|
|
250661
|
+
banner: generatePreamble(config),
|
|
250662
|
+
format,
|
|
250663
|
+
file
|
|
250664
|
+
});
|
|
250665
|
+
await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
|
|
250666
|
+
};
|
|
250607
250667
|
var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
|
|
250608
250668
|
try {
|
|
250609
250669
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250611,6 +250671,7 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250611
250671
|
const mockDoc = join(packageDir, "mock-doc", "index.js");
|
|
250612
250672
|
const rollupOptions = {
|
|
250613
250673
|
...config.rollupConfig.inputOptions,
|
|
250674
|
+
external: ["stream"],
|
|
250614
250675
|
input,
|
|
250615
250676
|
inlineDynamicImports: true,
|
|
250616
250677
|
plugins: [
|
|
@@ -250637,12 +250698,10 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250637
250698
|
onwarn: createOnWarnFn(buildCtx.diagnostics)
|
|
250638
250699
|
};
|
|
250639
250700
|
const rollupAppBuild = await rollup(rollupOptions);
|
|
250640
|
-
|
|
250641
|
-
|
|
250642
|
-
|
|
250643
|
-
|
|
250644
|
-
});
|
|
250645
|
-
await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
|
|
250701
|
+
await Promise.all([
|
|
250702
|
+
buildHydrateAppFor("cjs", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets),
|
|
250703
|
+
buildHydrateAppFor("esm", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets)
|
|
250704
|
+
]);
|
|
250646
250705
|
} catch (e) {
|
|
250647
250706
|
if (!buildCtx.hasError) {
|
|
250648
250707
|
loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
|
|
@@ -252622,7 +252681,7 @@ var validateRollupConfig = (config) => {
|
|
|
252622
252681
|
if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
|
|
252623
252682
|
cleanRollupConfig = {
|
|
252624
252683
|
...cleanRollupConfig,
|
|
252625
|
-
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
|
|
252684
|
+
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
|
|
252626
252685
|
};
|
|
252627
252686
|
}
|
|
252628
252687
|
if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
|
|
@@ -252849,6 +252908,7 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
252849
252908
|
devMode,
|
|
252850
252909
|
extras: config.extras || {},
|
|
252851
252910
|
flags,
|
|
252911
|
+
generateExportMaps: isBoolean(config.generateExportMaps) ? config.generateExportMaps : false,
|
|
252852
252912
|
hashFileNames,
|
|
252853
252913
|
hashedFileNameLength: (_c = config.hashedFileNameLength) != null ? _c : DEFAULT_HASHED_FILENAME_LENGTH,
|
|
252854
252914
|
hydratedFlag: validateHydrated(config),
|
|
@@ -254171,6 +254231,9 @@ export interface CustomElementsDefineOptions {
|
|
|
254171
254231
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
254172
254232
|
}
|
|
254173
254233
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
|
|
254234
|
+
/**
|
|
254235
|
+
* @deprecated
|
|
254236
|
+
*/
|
|
254174
254237
|
export declare function applyPolyfills(): Promise<void>;
|
|
254175
254238
|
|
|
254176
254239
|
/**
|
|
@@ -254366,7 +254429,7 @@ var updateTypeName = (currentTypeName, typeAlias) => {
|
|
|
254366
254429
|
return currentTypeName;
|
|
254367
254430
|
}
|
|
254368
254431
|
const endingStrChar = "(?!(\"|'|`))";
|
|
254369
|
-
const typeNameRegex = new RegExp(
|
|
254432
|
+
const typeNameRegex = new RegExp(`\\b${typeAlias.localName}\\b${endingStrChar}`, "g");
|
|
254370
254433
|
return currentTypeName.replace(typeNameRegex, typeAlias.importName);
|
|
254371
254434
|
};
|
|
254372
254435
|
var copyRindoCoreDts = async (config, compilerCtx) => {
|
|
@@ -254661,6 +254724,9 @@ var updateImportReferenceFactory = (typeCounts, filePath, config) => {
|
|
|
254661
254724
|
}
|
|
254662
254725
|
const newTypeName = getIncrementTypeName(typeName);
|
|
254663
254726
|
existingTypeImportData[importResolvedFile].push({
|
|
254727
|
+
// Since we create a unique ID for each type for documentation generation purposes, we can parse
|
|
254728
|
+
// that ID to get the original name for the export
|
|
254729
|
+
originalName: typeReference.id.split("::").pop(),
|
|
254664
254730
|
localName: typeName,
|
|
254665
254731
|
importName: newTypeName
|
|
254666
254732
|
});
|
|
@@ -254712,10 +254778,10 @@ var generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
|
|
|
254712
254778
|
importFilePath = normalizePath("./" + relative(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, "");
|
|
254713
254779
|
}
|
|
254714
254780
|
return `{ ${typeData.sort(sortImportNames).map((td2) => {
|
|
254715
|
-
if (td2.
|
|
254716
|
-
return `${td2.
|
|
254781
|
+
if (td2.originalName === td2.importName) {
|
|
254782
|
+
return `${td2.originalName}`;
|
|
254717
254783
|
} else {
|
|
254718
|
-
return `${td2.
|
|
254784
|
+
return `${td2.originalName} as ${td2.importName}`;
|
|
254719
254785
|
}
|
|
254720
254786
|
}).join(`, `)} } from "${importFilePath}";`;
|
|
254721
254787
|
});
|
|
@@ -258116,10 +258182,11 @@ var runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
|
|
|
258116
258182
|
const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
|
|
258117
258183
|
const emittedDts = [];
|
|
258118
258184
|
const emitCallback = (emitFilePath, data2, _w, _e, tsSourceFiles) => {
|
|
258185
|
+
if (emitFilePath.includes("e2e.") || emitFilePath.includes("spec.") || emitFilePath.endsWith("e2e.d.ts") || emitFilePath.endsWith("spec.d.ts")) {
|
|
258186
|
+
return;
|
|
258187
|
+
}
|
|
258119
258188
|
if (emitFilePath.endsWith(".js") || emitFilePath.endsWith("js.map")) {
|
|
258120
258189
|
updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data2, emitFilePath, tsTypeChecker, null);
|
|
258121
|
-
} else if (emitFilePath.endsWith(".e2e.d.ts") || emitFilePath.endsWith(".spec.d.ts") || emitFilePath === "e2e.d.ts" || emitFilePath === "spec.d.ts") {
|
|
258122
|
-
return;
|
|
258123
258190
|
} else if (emitFilePath.endsWith(".d.ts")) {
|
|
258124
258191
|
const srcDtsPath = normalizePath(tsSourceFiles[0].fileName);
|
|
258125
258192
|
const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
|
|
@@ -258757,19 +258824,25 @@ var packageJsonWarn = (config, compilerCtx, buildCtx, msg, jsonField) => {
|
|
|
258757
258824
|
var PRIMARY_PACKAGE_TARGET_CONFIGS = {
|
|
258758
258825
|
dist: {
|
|
258759
258826
|
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258760
|
-
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts")))
|
|
258827
|
+
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
|
|
258828
|
+
getMainPath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.cjs.js")))
|
|
258761
258829
|
},
|
|
258762
258830
|
"dist-collection": {
|
|
258763
|
-
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js")))
|
|
258831
|
+
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258832
|
+
getTypesPath: () => null,
|
|
258833
|
+
getMainPath: () => null
|
|
258764
258834
|
},
|
|
258765
258835
|
"dist-custom-elements": {
|
|
258766
258836
|
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258767
258837
|
getTypesPath: (rootDir, outputTargetConfig) => {
|
|
258768
258838
|
return outputTargetConfig.generateTypeDeclarations ? normalizePath(relative(rootDir, join(outputTargetConfig.dir, "index.d.ts"))) : null;
|
|
258769
|
-
}
|
|
258839
|
+
},
|
|
258840
|
+
getMainPath: () => null
|
|
258770
258841
|
},
|
|
258771
258842
|
"dist-types": {
|
|
258772
|
-
|
|
258843
|
+
getModulePath: () => null,
|
|
258844
|
+
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
|
|
258845
|
+
getMainPath: () => null
|
|
258773
258846
|
}
|
|
258774
258847
|
};
|
|
258775
258848
|
var validatePrimaryPackageOutputTarget = (config, compilerCtx, buildCtx) => {
|
|
@@ -258959,6 +259032,58 @@ var validateBuildFiles = (config, compilerCtx, buildCtx) => {
|
|
|
258959
259032
|
]);
|
|
258960
259033
|
};
|
|
258961
259034
|
|
|
259035
|
+
// src/compiler/build/write-export-maps.ts
|
|
259036
|
+
var import_child_process = require("child_process");
|
|
259037
|
+
var writeExportMaps = (config, buildCtx) => {
|
|
259038
|
+
var _a;
|
|
259039
|
+
const eligiblePrimaryTargets = config.outputTargets.filter(isEligiblePrimaryPackageOutputTarget);
|
|
259040
|
+
if (eligiblePrimaryTargets.length > 0) {
|
|
259041
|
+
const primaryTarget = (_a = eligiblePrimaryTargets.find((o) => o.isPrimaryPackageOutputTarget)) != null ? _a : eligiblePrimaryTargets[0];
|
|
259042
|
+
const outputTargetConfig = PRIMARY_PACKAGE_TARGET_CONFIGS[primaryTarget.type];
|
|
259043
|
+
if (outputTargetConfig.getModulePath) {
|
|
259044
|
+
const importPath = outputTargetConfig.getModulePath(config.rootDir, primaryTarget.dir);
|
|
259045
|
+
if (importPath) {
|
|
259046
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][import]"="${importPath}"`);
|
|
259047
|
+
}
|
|
259048
|
+
}
|
|
259049
|
+
if (outputTargetConfig.getMainPath) {
|
|
259050
|
+
const requirePath = outputTargetConfig.getMainPath(config.rootDir, primaryTarget.dir);
|
|
259051
|
+
if (requirePath) {
|
|
259052
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][require]"="${requirePath}"`);
|
|
259053
|
+
}
|
|
259054
|
+
}
|
|
259055
|
+
if (outputTargetConfig.getTypesPath) {
|
|
259056
|
+
const typesPath = outputTargetConfig.getTypesPath(config.rootDir, primaryTarget);
|
|
259057
|
+
if (typesPath) {
|
|
259058
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][types]"="${typesPath}"`);
|
|
259059
|
+
}
|
|
259060
|
+
}
|
|
259061
|
+
}
|
|
259062
|
+
const distLazyLoader = config.outputTargets.find(isOutputTargetDistLazyLoader);
|
|
259063
|
+
if (distLazyLoader != null) {
|
|
259064
|
+
let outDir = relative(config.rootDir, distLazyLoader.dir);
|
|
259065
|
+
if (!outDir.startsWith(".")) {
|
|
259066
|
+
outDir = "./" + outDir;
|
|
259067
|
+
}
|
|
259068
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][import]"="${outDir}/index.js"`);
|
|
259069
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][require]"="${outDir}/index.cjs"`);
|
|
259070
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][types]"="${outDir}/index.d.ts"`);
|
|
259071
|
+
}
|
|
259072
|
+
const distCustomElements = config.outputTargets.find(isOutputTargetDistCustomElements);
|
|
259073
|
+
if (distCustomElements != null) {
|
|
259074
|
+
let outDir = relative(config.rootDir, distCustomElements.dir);
|
|
259075
|
+
if (!outDir.startsWith(".")) {
|
|
259076
|
+
outDir = "./" + outDir;
|
|
259077
|
+
}
|
|
259078
|
+
buildCtx.components.forEach((cmp) => {
|
|
259079
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][import]"="${outDir}/${cmp.tagName}.js"`);
|
|
259080
|
+
if (distCustomElements.generateTypeDeclarations) {
|
|
259081
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][types]"="${outDir}/${cmp.tagName}.d.ts"`);
|
|
259082
|
+
}
|
|
259083
|
+
});
|
|
259084
|
+
}
|
|
259085
|
+
};
|
|
259086
|
+
|
|
258962
259087
|
// src/compiler/build/write-build.ts
|
|
258963
259088
|
var writeBuild = async (config, compilerCtx, buildCtx) => {
|
|
258964
259089
|
const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
|
|
@@ -258973,6 +259098,9 @@ var writeBuild = async (config, compilerCtx, buildCtx) => {
|
|
|
258973
259098
|
await compilerCtx.cache.commit();
|
|
258974
259099
|
buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
|
|
258975
259100
|
buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
|
|
259101
|
+
if (config.generateExportMaps) {
|
|
259102
|
+
writeExportMaps(config, buildCtx);
|
|
259103
|
+
}
|
|
258976
259104
|
await outputServiceWorkers(config, buildCtx);
|
|
258977
259105
|
await validateBuildFiles(config, compilerCtx, buildCtx);
|
|
258978
259106
|
} catch (e) {
|
|
@@ -261851,10 +261979,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261851
261979
|
}
|
|
261852
261980
|
if (typeof prerenderConfig.beforeHydrate === "function") {
|
|
261853
261981
|
try {
|
|
261854
|
-
|
|
261855
|
-
if (isPromise(rtn)) {
|
|
261856
|
-
await rtn;
|
|
261857
|
-
}
|
|
261982
|
+
await prerenderConfig.beforeHydrate(doc, url);
|
|
261858
261983
|
} catch (e) {
|
|
261859
261984
|
catchError(results.diagnostics, e);
|
|
261860
261985
|
}
|
|
@@ -261879,7 +262004,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261879
262004
|
excludeStaticComponents(doc, hydrateOpts, hydrateResults);
|
|
261880
262005
|
}
|
|
261881
262006
|
if (hydrateOpts.addModulePreloads) {
|
|
261882
|
-
if (!prerenderRequest.isDebug) {
|
|
262007
|
+
if (!prerenderRequest.isDebug && componentGraph) {
|
|
261883
262008
|
addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
|
|
261884
262009
|
}
|
|
261885
262010
|
} else {
|
|
@@ -261916,10 +262041,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261916
262041
|
}
|
|
261917
262042
|
if (typeof prerenderConfig.afterHydrate === "function") {
|
|
261918
262043
|
try {
|
|
261919
|
-
|
|
261920
|
-
if (isPromise(rtn)) {
|
|
261921
|
-
await rtn;
|
|
261922
|
-
}
|
|
262044
|
+
await prerenderConfig.afterHydrate(doc, url, results);
|
|
261923
262045
|
} catch (e) {
|
|
261924
262046
|
catchError(results.diagnostics, e);
|
|
261925
262047
|
}
|
|
@@ -261931,7 +262053,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261931
262053
|
}
|
|
261932
262054
|
return results;
|
|
261933
262055
|
}
|
|
261934
|
-
const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
262056
|
+
const html = await hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
261935
262057
|
prerenderEnsureDir(sys, prerenderCtx2, results.filePath);
|
|
261936
262058
|
const writePromise = sys.writeFile(results.filePath, html);
|
|
261937
262059
|
if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
|
|
@@ -262631,17 +262753,13 @@ var prerenderUrl = async (results, manager, url) => {
|
|
|
262631
262753
|
var import_mock_doc3 = require("../mock-doc/index.cjs");
|
|
262632
262754
|
var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
|
|
262633
262755
|
try {
|
|
262634
|
-
if (!isString(srcIndexHtmlPath)) {
|
|
262756
|
+
if (!isString(srcIndexHtmlPath) && outputTarget.indexHtml) {
|
|
262635
262757
|
srcIndexHtmlPath = outputTarget.indexHtml;
|
|
262636
262758
|
}
|
|
262637
262759
|
let templateHtml;
|
|
262638
262760
|
if (isFunction(prerenderConfig.loadTemplate)) {
|
|
262639
262761
|
const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
|
|
262640
|
-
|
|
262641
|
-
templateHtml = await loadTemplateResult;
|
|
262642
|
-
} else {
|
|
262643
|
-
templateHtml = loadTemplateResult;
|
|
262644
|
-
}
|
|
262762
|
+
templateHtml = await loadTemplateResult;
|
|
262645
262763
|
} else {
|
|
262646
262764
|
templateHtml = await config.sys.readFile(srcIndexHtmlPath);
|
|
262647
262765
|
}
|
|
@@ -262654,7 +262772,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262654
262772
|
staticSite = !hasRindoScript(doc);
|
|
262655
262773
|
}
|
|
262656
262774
|
doc.documentElement.classList.add("hydrated");
|
|
262657
|
-
if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
|
|
262775
|
+
if (hydrateOpts.inlineExternalStyleSheets && !isDebug && outputTarget.appDir) {
|
|
262658
262776
|
try {
|
|
262659
262777
|
await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
|
|
262660
262778
|
} catch (e) {
|
|
@@ -262668,7 +262786,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262668
262786
|
catchError(diagnostics, e);
|
|
262669
262787
|
}
|
|
262670
262788
|
}
|
|
262671
|
-
if (hydrateOpts.minifyStyleElements && !isDebug) {
|
|
262789
|
+
if (hydrateOpts.minifyStyleElements && !isDebug && outputTarget.baseUrl) {
|
|
262672
262790
|
try {
|
|
262673
262791
|
const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
|
|
262674
262792
|
await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
|
|
@@ -262678,20 +262796,12 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262678
262796
|
}
|
|
262679
262797
|
if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
|
|
262680
262798
|
const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
|
|
262681
|
-
|
|
262682
|
-
doc = await beforeSerializeResults;
|
|
262683
|
-
} else {
|
|
262684
|
-
doc = beforeSerializeResults;
|
|
262685
|
-
}
|
|
262799
|
+
doc = await beforeSerializeResults;
|
|
262686
262800
|
}
|
|
262687
262801
|
let html = (0, import_mock_doc3.serializeNodeToHtml)(doc);
|
|
262688
262802
|
if (isFunction(prerenderConfig.afterSerializeTemplate)) {
|
|
262689
262803
|
const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
|
|
262690
|
-
|
|
262691
|
-
html = await afterSerializeResults;
|
|
262692
|
-
} else {
|
|
262693
|
-
html = afterSerializeResults;
|
|
262694
|
-
}
|
|
262804
|
+
html = await afterSerializeResults;
|
|
262695
262805
|
}
|
|
262696
262806
|
return {
|
|
262697
262807
|
html,
|