@rindo/core 4.18.3 → 4.19.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 +43 -16
- package/cli/index.js +43 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +175 -72
- 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 +34 -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 | 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 = "1734571004";
|
|
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{1F427}";
|
|
231103
|
+
var version = "4.19.0";
|
|
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) => {
|
|
@@ -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;
|
|
@@ -248158,7 +248188,8 @@ var getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
|
|
|
248158
248188
|
treeshake: getTreeshakeOption(config, bundleOpts),
|
|
248159
248189
|
preserveEntrySignatures: (_c = bundleOpts.preserveEntrySignatures) != null ? _c : "strict",
|
|
248160
248190
|
onwarn: createOnWarnFn(buildCtx.diagnostics),
|
|
248161
|
-
cache: compilerCtx.rollupCache.get(bundleOpts.id)
|
|
248191
|
+
cache: compilerCtx.rollupCache.get(bundleOpts.id),
|
|
248192
|
+
external: config.rollupConfig.inputOptions.external
|
|
248162
248193
|
};
|
|
248163
248194
|
return rollupOptions;
|
|
248164
248195
|
};
|
|
@@ -249751,7 +249782,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
249751
249782
|
member: cmps.some((c) => c.hasMember),
|
|
249752
249783
|
method: cmps.some((c) => c.hasMethod),
|
|
249753
249784
|
mode: cmps.some((c) => c.hasMode),
|
|
249754
|
-
observeAttribute: cmps.some((c) => c.hasAttribute),
|
|
249785
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
249755
249786
|
prop: cmps.some((c) => c.hasProp),
|
|
249756
249787
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
249757
249788
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
@@ -250553,12 +250584,17 @@ var writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupO
|
|
|
250553
250584
|
var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
|
|
250554
250585
|
const hydratePackageName = await getHydratePackageName(config, compilerCtx);
|
|
250555
250586
|
const hydrateAppDirPath = outputTarget.dir;
|
|
250587
|
+
if (!hydrateAppDirPath) {
|
|
250588
|
+
throw new Error(`outputTarget config missing the "dir" property`);
|
|
250589
|
+
}
|
|
250556
250590
|
const hydrateCoreIndexPath = join(hydrateAppDirPath, "index.js");
|
|
250591
|
+
const hydrateCoreIndexPathESM = join(hydrateAppDirPath, "index.mjs");
|
|
250557
250592
|
const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, "index.d.ts");
|
|
250558
250593
|
const pkgJsonPath = join(hydrateAppDirPath, "package.json");
|
|
250559
250594
|
const pkgJsonCode = getHydratePackageJson(
|
|
250560
250595
|
config,
|
|
250561
250596
|
hydrateCoreIndexPath,
|
|
250597
|
+
hydrateCoreIndexPathESM,
|
|
250562
250598
|
hydrateCoreIndexDtsFilePath,
|
|
250563
250599
|
hydratePackageName
|
|
250564
250600
|
);
|
|
@@ -250577,24 +250613,32 @@ var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rol
|
|
|
250577
250613
|
})
|
|
250578
250614
|
);
|
|
250579
250615
|
};
|
|
250580
|
-
var getHydratePackageJson = (config,
|
|
250616
|
+
var getHydratePackageJson = (config, hydrateAppFilePathCJS, hydrateAppFilePathESM, hydrateDtsFilePath, hydratePackageName) => {
|
|
250581
250617
|
const pkg = {
|
|
250582
250618
|
name: hydratePackageName,
|
|
250583
250619
|
description: `${config.namespace} component hydration app.`,
|
|
250584
|
-
main: (0, import_path26.basename)(
|
|
250585
|
-
types: (0, import_path26.basename)(hydrateDtsFilePath)
|
|
250620
|
+
main: (0, import_path26.basename)(hydrateAppFilePathCJS),
|
|
250621
|
+
types: (0, import_path26.basename)(hydrateDtsFilePath),
|
|
250622
|
+
exports: {
|
|
250623
|
+
".": {
|
|
250624
|
+
require: `./${(0, import_path26.basename)(hydrateAppFilePathCJS)}`,
|
|
250625
|
+
import: `./${(0, import_path26.basename)(hydrateAppFilePathESM)}`
|
|
250626
|
+
}
|
|
250627
|
+
}
|
|
250586
250628
|
};
|
|
250587
250629
|
return JSON.stringify(pkg, null, 2);
|
|
250588
250630
|
};
|
|
250589
250631
|
var getHydratePackageName = async (config, compilerCtx) => {
|
|
250632
|
+
const directoryName = (0, import_path26.basename)(config.rootDir);
|
|
250590
250633
|
try {
|
|
250591
250634
|
const rootPkgFilePath = join(config.rootDir, "package.json");
|
|
250592
250635
|
const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
|
|
250593
250636
|
const pkgData = JSON.parse(pkgStr);
|
|
250594
|
-
|
|
250637
|
+
const scope = pkgData.name || directoryName;
|
|
250638
|
+
return `${scope}/hydrate`;
|
|
250595
250639
|
} catch (e) {
|
|
250596
250640
|
}
|
|
250597
|
-
return `${config.fsNamespace}/hydrate`;
|
|
250641
|
+
return `${config.fsNamespace || directoryName}/hydrate`;
|
|
250598
250642
|
};
|
|
250599
250643
|
var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
250600
250644
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250604,6 +250648,15 @@ var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
|
250604
250648
|
};
|
|
250605
250649
|
|
|
250606
250650
|
// src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts
|
|
250651
|
+
var buildHydrateAppFor = async (format, rollupBuild, config, compilerCtx, buildCtx, outputTargets) => {
|
|
250652
|
+
const file = format === "esm" ? "index.mjs" : "index.js";
|
|
250653
|
+
const rollupOutput = await rollupBuild.generate({
|
|
250654
|
+
banner: generatePreamble(config),
|
|
250655
|
+
format,
|
|
250656
|
+
file
|
|
250657
|
+
});
|
|
250658
|
+
await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
|
|
250659
|
+
};
|
|
250607
250660
|
var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
|
|
250608
250661
|
try {
|
|
250609
250662
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250611,6 +250664,7 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250611
250664
|
const mockDoc = join(packageDir, "mock-doc", "index.js");
|
|
250612
250665
|
const rollupOptions = {
|
|
250613
250666
|
...config.rollupConfig.inputOptions,
|
|
250667
|
+
external: ["stream"],
|
|
250614
250668
|
input,
|
|
250615
250669
|
inlineDynamicImports: true,
|
|
250616
250670
|
plugins: [
|
|
@@ -250637,12 +250691,10 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250637
250691
|
onwarn: createOnWarnFn(buildCtx.diagnostics)
|
|
250638
250692
|
};
|
|
250639
250693
|
const rollupAppBuild = await rollup(rollupOptions);
|
|
250640
|
-
|
|
250641
|
-
|
|
250642
|
-
|
|
250643
|
-
|
|
250644
|
-
});
|
|
250645
|
-
await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
|
|
250694
|
+
await Promise.all([
|
|
250695
|
+
buildHydrateAppFor("cjs", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets),
|
|
250696
|
+
buildHydrateAppFor("esm", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets)
|
|
250697
|
+
]);
|
|
250646
250698
|
} catch (e) {
|
|
250647
250699
|
if (!buildCtx.hasError) {
|
|
250648
250700
|
loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
|
|
@@ -252622,7 +252674,7 @@ var validateRollupConfig = (config) => {
|
|
|
252622
252674
|
if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
|
|
252623
252675
|
cleanRollupConfig = {
|
|
252624
252676
|
...cleanRollupConfig,
|
|
252625
|
-
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
|
|
252677
|
+
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
|
|
252626
252678
|
};
|
|
252627
252679
|
}
|
|
252628
252680
|
if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
|
|
@@ -252849,6 +252901,7 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
252849
252901
|
devMode,
|
|
252850
252902
|
extras: config.extras || {},
|
|
252851
252903
|
flags,
|
|
252904
|
+
generateExportMaps: isBoolean(config.generateExportMaps) ? config.generateExportMaps : false,
|
|
252852
252905
|
hashFileNames,
|
|
252853
252906
|
hashedFileNameLength: (_c = config.hashedFileNameLength) != null ? _c : DEFAULT_HASHED_FILENAME_LENGTH,
|
|
252854
252907
|
hydratedFlag: validateHydrated(config),
|
|
@@ -254171,6 +254224,9 @@ export interface CustomElementsDefineOptions {
|
|
|
254171
254224
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
254172
254225
|
}
|
|
254173
254226
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
|
|
254227
|
+
/**
|
|
254228
|
+
* @deprecated
|
|
254229
|
+
*/
|
|
254174
254230
|
export declare function applyPolyfills(): Promise<void>;
|
|
254175
254231
|
|
|
254176
254232
|
/**
|
|
@@ -254366,7 +254422,7 @@ var updateTypeName = (currentTypeName, typeAlias) => {
|
|
|
254366
254422
|
return currentTypeName;
|
|
254367
254423
|
}
|
|
254368
254424
|
const endingStrChar = "(?!(\"|'|`))";
|
|
254369
|
-
const typeNameRegex = new RegExp(
|
|
254425
|
+
const typeNameRegex = new RegExp(`\\b${typeAlias.localName}\\b${endingStrChar}`, "g");
|
|
254370
254426
|
return currentTypeName.replace(typeNameRegex, typeAlias.importName);
|
|
254371
254427
|
};
|
|
254372
254428
|
var copyRindoCoreDts = async (config, compilerCtx) => {
|
|
@@ -254661,6 +254717,9 @@ var updateImportReferenceFactory = (typeCounts, filePath, config) => {
|
|
|
254661
254717
|
}
|
|
254662
254718
|
const newTypeName = getIncrementTypeName(typeName);
|
|
254663
254719
|
existingTypeImportData[importResolvedFile].push({
|
|
254720
|
+
// Since we create a unique ID for each type for documentation generation purposes, we can parse
|
|
254721
|
+
// that ID to get the original name for the export
|
|
254722
|
+
originalName: typeReference.id.split("::").pop(),
|
|
254664
254723
|
localName: typeName,
|
|
254665
254724
|
importName: newTypeName
|
|
254666
254725
|
});
|
|
@@ -254712,10 +254771,10 @@ var generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
|
|
|
254712
254771
|
importFilePath = normalizePath("./" + relative(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, "");
|
|
254713
254772
|
}
|
|
254714
254773
|
return `{ ${typeData.sort(sortImportNames).map((td2) => {
|
|
254715
|
-
if (td2.
|
|
254716
|
-
return `${td2.
|
|
254774
|
+
if (td2.originalName === td2.importName) {
|
|
254775
|
+
return `${td2.originalName}`;
|
|
254717
254776
|
} else {
|
|
254718
|
-
return `${td2.
|
|
254777
|
+
return `${td2.originalName} as ${td2.importName}`;
|
|
254719
254778
|
}
|
|
254720
254779
|
}).join(`, `)} } from "${importFilePath}";`;
|
|
254721
254780
|
});
|
|
@@ -258116,10 +258175,11 @@ var runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
|
|
|
258116
258175
|
const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
|
|
258117
258176
|
const emittedDts = [];
|
|
258118
258177
|
const emitCallback = (emitFilePath, data2, _w, _e, tsSourceFiles) => {
|
|
258178
|
+
if (emitFilePath.includes("e2e.") || emitFilePath.includes("spec.") || emitFilePath.endsWith("e2e.d.ts") || emitFilePath.endsWith("spec.d.ts")) {
|
|
258179
|
+
return;
|
|
258180
|
+
}
|
|
258119
258181
|
if (emitFilePath.endsWith(".js") || emitFilePath.endsWith("js.map")) {
|
|
258120
258182
|
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
258183
|
} else if (emitFilePath.endsWith(".d.ts")) {
|
|
258124
258184
|
const srcDtsPath = normalizePath(tsSourceFiles[0].fileName);
|
|
258125
258185
|
const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
|
|
@@ -258757,19 +258817,25 @@ var packageJsonWarn = (config, compilerCtx, buildCtx, msg, jsonField) => {
|
|
|
258757
258817
|
var PRIMARY_PACKAGE_TARGET_CONFIGS = {
|
|
258758
258818
|
dist: {
|
|
258759
258819
|
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258760
|
-
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts")))
|
|
258820
|
+
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
|
|
258821
|
+
getMainPath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.cjs.js")))
|
|
258761
258822
|
},
|
|
258762
258823
|
"dist-collection": {
|
|
258763
|
-
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js")))
|
|
258824
|
+
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258825
|
+
getTypesPath: () => null,
|
|
258826
|
+
getMainPath: () => null
|
|
258764
258827
|
},
|
|
258765
258828
|
"dist-custom-elements": {
|
|
258766
258829
|
getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
|
|
258767
258830
|
getTypesPath: (rootDir, outputTargetConfig) => {
|
|
258768
258831
|
return outputTargetConfig.generateTypeDeclarations ? normalizePath(relative(rootDir, join(outputTargetConfig.dir, "index.d.ts"))) : null;
|
|
258769
|
-
}
|
|
258832
|
+
},
|
|
258833
|
+
getMainPath: () => null
|
|
258770
258834
|
},
|
|
258771
258835
|
"dist-types": {
|
|
258772
|
-
|
|
258836
|
+
getModulePath: () => null,
|
|
258837
|
+
getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
|
|
258838
|
+
getMainPath: () => null
|
|
258773
258839
|
}
|
|
258774
258840
|
};
|
|
258775
258841
|
var validatePrimaryPackageOutputTarget = (config, compilerCtx, buildCtx) => {
|
|
@@ -258959,6 +259025,58 @@ var validateBuildFiles = (config, compilerCtx, buildCtx) => {
|
|
|
258959
259025
|
]);
|
|
258960
259026
|
};
|
|
258961
259027
|
|
|
259028
|
+
// src/compiler/build/write-export-maps.ts
|
|
259029
|
+
var import_child_process = require("child_process");
|
|
259030
|
+
var writeExportMaps = (config, buildCtx) => {
|
|
259031
|
+
var _a;
|
|
259032
|
+
const eligiblePrimaryTargets = config.outputTargets.filter(isEligiblePrimaryPackageOutputTarget);
|
|
259033
|
+
if (eligiblePrimaryTargets.length > 0) {
|
|
259034
|
+
const primaryTarget = (_a = eligiblePrimaryTargets.find((o) => o.isPrimaryPackageOutputTarget)) != null ? _a : eligiblePrimaryTargets[0];
|
|
259035
|
+
const outputTargetConfig = PRIMARY_PACKAGE_TARGET_CONFIGS[primaryTarget.type];
|
|
259036
|
+
if (outputTargetConfig.getModulePath) {
|
|
259037
|
+
const importPath = outputTargetConfig.getModulePath(config.rootDir, primaryTarget.dir);
|
|
259038
|
+
if (importPath) {
|
|
259039
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][import]"="${importPath}"`);
|
|
259040
|
+
}
|
|
259041
|
+
}
|
|
259042
|
+
if (outputTargetConfig.getMainPath) {
|
|
259043
|
+
const requirePath = outputTargetConfig.getMainPath(config.rootDir, primaryTarget.dir);
|
|
259044
|
+
if (requirePath) {
|
|
259045
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][require]"="${requirePath}"`);
|
|
259046
|
+
}
|
|
259047
|
+
}
|
|
259048
|
+
if (outputTargetConfig.getTypesPath) {
|
|
259049
|
+
const typesPath = outputTargetConfig.getTypesPath(config.rootDir, primaryTarget);
|
|
259050
|
+
if (typesPath) {
|
|
259051
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[.][types]"="${typesPath}"`);
|
|
259052
|
+
}
|
|
259053
|
+
}
|
|
259054
|
+
}
|
|
259055
|
+
const distLazyLoader = config.outputTargets.find(isOutputTargetDistLazyLoader);
|
|
259056
|
+
if (distLazyLoader != null) {
|
|
259057
|
+
let outDir = relative(config.rootDir, distLazyLoader.dir);
|
|
259058
|
+
if (!outDir.startsWith(".")) {
|
|
259059
|
+
outDir = "./" + outDir;
|
|
259060
|
+
}
|
|
259061
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][import]"="${outDir}/index.js"`);
|
|
259062
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][require]"="${outDir}/index.cjs"`);
|
|
259063
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./loader][types]"="${outDir}/index.d.ts"`);
|
|
259064
|
+
}
|
|
259065
|
+
const distCustomElements = config.outputTargets.find(isOutputTargetDistCustomElements);
|
|
259066
|
+
if (distCustomElements != null) {
|
|
259067
|
+
let outDir = relative(config.rootDir, distCustomElements.dir);
|
|
259068
|
+
if (!outDir.startsWith(".")) {
|
|
259069
|
+
outDir = "./" + outDir;
|
|
259070
|
+
}
|
|
259071
|
+
buildCtx.components.forEach((cmp) => {
|
|
259072
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][import]"="${outDir}/${cmp.tagName}.js"`);
|
|
259073
|
+
if (distCustomElements.generateTypeDeclarations) {
|
|
259074
|
+
(0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][types]"="${outDir}/${cmp.tagName}.d.ts"`);
|
|
259075
|
+
}
|
|
259076
|
+
});
|
|
259077
|
+
}
|
|
259078
|
+
};
|
|
259079
|
+
|
|
258962
259080
|
// src/compiler/build/write-build.ts
|
|
258963
259081
|
var writeBuild = async (config, compilerCtx, buildCtx) => {
|
|
258964
259082
|
const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
|
|
@@ -258973,6 +259091,9 @@ var writeBuild = async (config, compilerCtx, buildCtx) => {
|
|
|
258973
259091
|
await compilerCtx.cache.commit();
|
|
258974
259092
|
buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
|
|
258975
259093
|
buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
|
|
259094
|
+
if (config.generateExportMaps) {
|
|
259095
|
+
writeExportMaps(config, buildCtx);
|
|
259096
|
+
}
|
|
258976
259097
|
await outputServiceWorkers(config, buildCtx);
|
|
258977
259098
|
await validateBuildFiles(config, compilerCtx, buildCtx);
|
|
258978
259099
|
} catch (e) {
|
|
@@ -261851,10 +261972,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261851
261972
|
}
|
|
261852
261973
|
if (typeof prerenderConfig.beforeHydrate === "function") {
|
|
261853
261974
|
try {
|
|
261854
|
-
|
|
261855
|
-
if (isPromise(rtn)) {
|
|
261856
|
-
await rtn;
|
|
261857
|
-
}
|
|
261975
|
+
await prerenderConfig.beforeHydrate(doc, url);
|
|
261858
261976
|
} catch (e) {
|
|
261859
261977
|
catchError(results.diagnostics, e);
|
|
261860
261978
|
}
|
|
@@ -261879,7 +261997,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261879
261997
|
excludeStaticComponents(doc, hydrateOpts, hydrateResults);
|
|
261880
261998
|
}
|
|
261881
261999
|
if (hydrateOpts.addModulePreloads) {
|
|
261882
|
-
if (!prerenderRequest.isDebug) {
|
|
262000
|
+
if (!prerenderRequest.isDebug && componentGraph) {
|
|
261883
262001
|
addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
|
|
261884
262002
|
}
|
|
261885
262003
|
} else {
|
|
@@ -261916,10 +262034,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261916
262034
|
}
|
|
261917
262035
|
if (typeof prerenderConfig.afterHydrate === "function") {
|
|
261918
262036
|
try {
|
|
261919
|
-
|
|
261920
|
-
if (isPromise(rtn)) {
|
|
261921
|
-
await rtn;
|
|
261922
|
-
}
|
|
262037
|
+
await prerenderConfig.afterHydrate(doc, url, results);
|
|
261923
262038
|
} catch (e) {
|
|
261924
262039
|
catchError(results.diagnostics, e);
|
|
261925
262040
|
}
|
|
@@ -261931,7 +262046,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261931
262046
|
}
|
|
261932
262047
|
return results;
|
|
261933
262048
|
}
|
|
261934
|
-
const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
262049
|
+
const html = await hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
261935
262050
|
prerenderEnsureDir(sys, prerenderCtx2, results.filePath);
|
|
261936
262051
|
const writePromise = sys.writeFile(results.filePath, html);
|
|
261937
262052
|
if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
|
|
@@ -262631,17 +262746,13 @@ var prerenderUrl = async (results, manager, url) => {
|
|
|
262631
262746
|
var import_mock_doc3 = require("../mock-doc/index.cjs");
|
|
262632
262747
|
var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
|
|
262633
262748
|
try {
|
|
262634
|
-
if (!isString(srcIndexHtmlPath)) {
|
|
262749
|
+
if (!isString(srcIndexHtmlPath) && outputTarget.indexHtml) {
|
|
262635
262750
|
srcIndexHtmlPath = outputTarget.indexHtml;
|
|
262636
262751
|
}
|
|
262637
262752
|
let templateHtml;
|
|
262638
262753
|
if (isFunction(prerenderConfig.loadTemplate)) {
|
|
262639
262754
|
const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
|
|
262640
|
-
|
|
262641
|
-
templateHtml = await loadTemplateResult;
|
|
262642
|
-
} else {
|
|
262643
|
-
templateHtml = loadTemplateResult;
|
|
262644
|
-
}
|
|
262755
|
+
templateHtml = await loadTemplateResult;
|
|
262645
262756
|
} else {
|
|
262646
262757
|
templateHtml = await config.sys.readFile(srcIndexHtmlPath);
|
|
262647
262758
|
}
|
|
@@ -262654,7 +262765,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262654
262765
|
staticSite = !hasRindoScript(doc);
|
|
262655
262766
|
}
|
|
262656
262767
|
doc.documentElement.classList.add("hydrated");
|
|
262657
|
-
if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
|
|
262768
|
+
if (hydrateOpts.inlineExternalStyleSheets && !isDebug && outputTarget.appDir) {
|
|
262658
262769
|
try {
|
|
262659
262770
|
await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
|
|
262660
262771
|
} catch (e) {
|
|
@@ -262668,7 +262779,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262668
262779
|
catchError(diagnostics, e);
|
|
262669
262780
|
}
|
|
262670
262781
|
}
|
|
262671
|
-
if (hydrateOpts.minifyStyleElements && !isDebug) {
|
|
262782
|
+
if (hydrateOpts.minifyStyleElements && !isDebug && outputTarget.baseUrl) {
|
|
262672
262783
|
try {
|
|
262673
262784
|
const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
|
|
262674
262785
|
await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
|
|
@@ -262678,20 +262789,12 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262678
262789
|
}
|
|
262679
262790
|
if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
|
|
262680
262791
|
const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
|
|
262681
|
-
|
|
262682
|
-
doc = await beforeSerializeResults;
|
|
262683
|
-
} else {
|
|
262684
|
-
doc = beforeSerializeResults;
|
|
262685
|
-
}
|
|
262792
|
+
doc = await beforeSerializeResults;
|
|
262686
262793
|
}
|
|
262687
262794
|
let html = (0, import_mock_doc3.serializeNodeToHtml)(doc);
|
|
262688
262795
|
if (isFunction(prerenderConfig.afterSerializeTemplate)) {
|
|
262689
262796
|
const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
|
|
262690
|
-
|
|
262691
|
-
html = await afterSerializeResults;
|
|
262692
|
-
} else {
|
|
262693
|
-
html = afterSerializeResults;
|
|
262694
|
-
}
|
|
262797
|
+
html = await afterSerializeResults;
|
|
262695
262798
|
}
|
|
262696
262799
|
return {
|
|
262697
262800
|
html,
|