@rindo/core 4.18.3-dev.1734304270.ca7046f → 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 +76 -60
- 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/internal/app-data/package.json +1 -1
- package/internal/client/index.js +531 -507
- package/internal/client/package.json +3 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +104 -49
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +29 -11
- package/internal/hydrate/runner.js +235 -258
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +29 -10
- package/internal/rindo-public-compiler.d.ts +14 -0
- package/internal/rindo-public-runtime.d.ts +0 -2
- package/internal/testing/index.js +435 -406
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +133 -129
- package/mock-doc/index.d.ts +18 -4
- package/mock-doc/index.js +133 -129
- package/mock-doc/package.json +1 -1
- package/package.json +33 -1
- 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 +68 -4
- 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/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
package/cli/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo CLI (CommonJS) v4.
|
|
2
|
+
Rindo CLI (CommonJS) v4.19.0-dev.1734909053.96af66b | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
@@ -3617,8 +3617,14 @@ var taskGenerate = async (config) => {
|
|
|
3617
3617
|
config.logger.error(tagError);
|
|
3618
3618
|
return config.sys.exit(1);
|
|
3619
3619
|
}
|
|
3620
|
-
|
|
3621
|
-
if (
|
|
3620
|
+
let cssExtension = "css";
|
|
3621
|
+
if (!!config.plugins.find((plugin) => plugin.name === "sass")) {
|
|
3622
|
+
cssExtension = await chooseSassExtension();
|
|
3623
|
+
} else if (!!config.plugins.find((plugin) => plugin.name === "less")) {
|
|
3624
|
+
cssExtension = "less";
|
|
3625
|
+
}
|
|
3626
|
+
const filesToGenerateExt = await chooseFilesToGenerate(cssExtension);
|
|
3627
|
+
if (!filesToGenerateExt) {
|
|
3622
3628
|
return;
|
|
3623
3629
|
}
|
|
3624
3630
|
const extensionsToGenerate = ["tsx", ...filesToGenerateExt];
|
|
@@ -3632,7 +3638,13 @@ var taskGenerate = async (config) => {
|
|
|
3632
3638
|
await checkForOverwrite(filesToGenerate, config);
|
|
3633
3639
|
const writtenFiles = await Promise.all(
|
|
3634
3640
|
filesToGenerate.map(
|
|
3635
|
-
(file) => getBoilerplateAndWriteFile(
|
|
3641
|
+
(file) => getBoilerplateAndWriteFile(
|
|
3642
|
+
config,
|
|
3643
|
+
componentName,
|
|
3644
|
+
extensionsToGenerate.includes("css") || extensionsToGenerate.includes("sass") || extensionsToGenerate.includes("scss") || extensionsToGenerate.includes("less"),
|
|
3645
|
+
file,
|
|
3646
|
+
cssExtension
|
|
3647
|
+
)
|
|
3636
3648
|
)
|
|
3637
3649
|
).catch((error) => config.logger.error(error));
|
|
3638
3650
|
if (!writtenFiles) {
|
|
@@ -3645,22 +3657,34 @@ var taskGenerate = async (config) => {
|
|
|
3645
3657
|
const absoluteRootDir = config.rootDir;
|
|
3646
3658
|
writtenFiles.map((file) => console.log(` - ${(0, import_path2.relative)(absoluteRootDir, file)}`));
|
|
3647
3659
|
};
|
|
3648
|
-
var chooseFilesToGenerate = async () => {
|
|
3660
|
+
var chooseFilesToGenerate = async (cssExtension) => {
|
|
3649
3661
|
const { prompt } = await Promise.resolve().then(() => __toESM(require_lib()));
|
|
3650
3662
|
return (await prompt({
|
|
3651
3663
|
name: "filesToGenerate",
|
|
3652
3664
|
type: "multiselect",
|
|
3653
3665
|
message: "Which additional files do you want to generate?",
|
|
3654
3666
|
choices: [
|
|
3655
|
-
{ value:
|
|
3667
|
+
{ value: cssExtension, title: `Stylesheet (.${cssExtension})`, selected: true },
|
|
3656
3668
|
{ value: "spec.tsx", title: "Spec Test (.spec.tsx)", selected: true },
|
|
3657
3669
|
{ value: "e2e.ts", title: "E2E Test (.e2e.ts)", selected: true }
|
|
3658
3670
|
]
|
|
3659
3671
|
})).filesToGenerate;
|
|
3660
3672
|
};
|
|
3673
|
+
var chooseSassExtension = async () => {
|
|
3674
|
+
const { prompt } = await Promise.resolve().then(() => __toESM(require_lib()));
|
|
3675
|
+
return (await prompt({
|
|
3676
|
+
name: "sassFormat",
|
|
3677
|
+
type: "select",
|
|
3678
|
+
message: "Which Sass format would you like to use? (More info: https://sass-lang.com/documentation/syntax/#the-indented-syntax)",
|
|
3679
|
+
choices: [
|
|
3680
|
+
{ value: "sass", title: `*.sass Format`, selected: true },
|
|
3681
|
+
{ value: "scss", title: "*.scss Format" }
|
|
3682
|
+
]
|
|
3683
|
+
})).sassFormat;
|
|
3684
|
+
};
|
|
3661
3685
|
var getFilepathForFile = (filePath, componentName, extension) => isTest2(extension) ? normalizePath((0, import_path2.join)(filePath, "test", `${componentName}.${extension}`)) : normalizePath((0, import_path2.join)(filePath, `${componentName}.${extension}`));
|
|
3662
|
-
var getBoilerplateAndWriteFile = async (config, componentName, withCss, file) => {
|
|
3663
|
-
const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss);
|
|
3686
|
+
var getBoilerplateAndWriteFile = async (config, componentName, withCss, file, styleExtension) => {
|
|
3687
|
+
const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss, styleExtension);
|
|
3664
3688
|
await config.sys.writeFile(normalizePath(file.path), boilerplate);
|
|
3665
3689
|
return file.path;
|
|
3666
3690
|
};
|
|
@@ -3684,12 +3708,15 @@ var checkForOverwrite = async (files, config) => {
|
|
|
3684
3708
|
var isTest2 = (extension) => {
|
|
3685
3709
|
return extension === "e2e.ts" || extension === "spec.tsx";
|
|
3686
3710
|
};
|
|
3687
|
-
var getBoilerplateByExtension = (tagName, extension, withCss) => {
|
|
3711
|
+
var getBoilerplateByExtension = (tagName, extension, withCss, styleExtension) => {
|
|
3688
3712
|
switch (extension) {
|
|
3689
3713
|
case "tsx":
|
|
3690
|
-
return getComponentBoilerplate(tagName, withCss);
|
|
3714
|
+
return getComponentBoilerplate(tagName, withCss, styleExtension);
|
|
3691
3715
|
case "css":
|
|
3692
|
-
|
|
3716
|
+
case "less":
|
|
3717
|
+
case "sass":
|
|
3718
|
+
case "scss":
|
|
3719
|
+
return getStyleUrlBoilerplate(styleExtension);
|
|
3693
3720
|
case "spec.tsx":
|
|
3694
3721
|
return getSpecTestBoilerplate(tagName);
|
|
3695
3722
|
case "e2e.ts":
|
|
@@ -3698,11 +3725,11 @@ var getBoilerplateByExtension = (tagName, extension, withCss) => {
|
|
|
3698
3725
|
throw new Error(`Unkown extension "${extension}".`);
|
|
3699
3726
|
}
|
|
3700
3727
|
};
|
|
3701
|
-
var getComponentBoilerplate = (tagName, hasStyle) => {
|
|
3728
|
+
var getComponentBoilerplate = (tagName, hasStyle, styleExtension) => {
|
|
3702
3729
|
const decorator = [`{`];
|
|
3703
3730
|
decorator.push(` tag: '${tagName}',`);
|
|
3704
3731
|
if (hasStyle) {
|
|
3705
|
-
decorator.push(` styleUrl: '${tagName}
|
|
3732
|
+
decorator.push(` styleUrl: '${tagName}.${styleExtension}',`);
|
|
3706
3733
|
}
|
|
3707
3734
|
decorator.push(` shadow: true,`);
|
|
3708
3735
|
decorator.push(`}`);
|
|
@@ -3710,7 +3737,6 @@ var getComponentBoilerplate = (tagName, hasStyle) => {
|
|
|
3710
3737
|
|
|
3711
3738
|
@Component(${decorator.join("\n")})
|
|
3712
3739
|
export class ${toPascalCase(tagName)} {
|
|
3713
|
-
|
|
3714
3740
|
render() {
|
|
3715
3741
|
return (
|
|
3716
3742
|
<Host>
|
|
@@ -3718,11 +3744,12 @@ export class ${toPascalCase(tagName)} {
|
|
|
3718
3744
|
</Host>
|
|
3719
3745
|
);
|
|
3720
3746
|
}
|
|
3721
|
-
|
|
3722
3747
|
}
|
|
3723
3748
|
`;
|
|
3724
3749
|
};
|
|
3725
|
-
var getStyleUrlBoilerplate = () => `:host
|
|
3750
|
+
var getStyleUrlBoilerplate = (ext) => ext === "sass" ? `:host
|
|
3751
|
+
display: block
|
|
3752
|
+
` : `:host {
|
|
3726
3753
|
display: block;
|
|
3727
3754
|
}
|
|
3728
3755
|
`;
|
package/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo CLI v4.
|
|
2
|
+
Rindo CLI v4.19.0-dev.1734909053.96af66b | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -3611,8 +3611,14 @@ var taskGenerate = async (config) => {
|
|
|
3611
3611
|
config.logger.error(tagError);
|
|
3612
3612
|
return config.sys.exit(1);
|
|
3613
3613
|
}
|
|
3614
|
-
|
|
3615
|
-
if (
|
|
3614
|
+
let cssExtension = "css";
|
|
3615
|
+
if (!!config.plugins.find((plugin) => plugin.name === "sass")) {
|
|
3616
|
+
cssExtension = await chooseSassExtension();
|
|
3617
|
+
} else if (!!config.plugins.find((plugin) => plugin.name === "less")) {
|
|
3618
|
+
cssExtension = "less";
|
|
3619
|
+
}
|
|
3620
|
+
const filesToGenerateExt = await chooseFilesToGenerate(cssExtension);
|
|
3621
|
+
if (!filesToGenerateExt) {
|
|
3616
3622
|
return;
|
|
3617
3623
|
}
|
|
3618
3624
|
const extensionsToGenerate = ["tsx", ...filesToGenerateExt];
|
|
@@ -3626,7 +3632,13 @@ var taskGenerate = async (config) => {
|
|
|
3626
3632
|
await checkForOverwrite(filesToGenerate, config);
|
|
3627
3633
|
const writtenFiles = await Promise.all(
|
|
3628
3634
|
filesToGenerate.map(
|
|
3629
|
-
(file) => getBoilerplateAndWriteFile(
|
|
3635
|
+
(file) => getBoilerplateAndWriteFile(
|
|
3636
|
+
config,
|
|
3637
|
+
componentName,
|
|
3638
|
+
extensionsToGenerate.includes("css") || extensionsToGenerate.includes("sass") || extensionsToGenerate.includes("scss") || extensionsToGenerate.includes("less"),
|
|
3639
|
+
file,
|
|
3640
|
+
cssExtension
|
|
3641
|
+
)
|
|
3630
3642
|
)
|
|
3631
3643
|
).catch((error) => config.logger.error(error));
|
|
3632
3644
|
if (!writtenFiles) {
|
|
@@ -3639,22 +3651,34 @@ var taskGenerate = async (config) => {
|
|
|
3639
3651
|
const absoluteRootDir = config.rootDir;
|
|
3640
3652
|
writtenFiles.map((file) => console.log(` - ${relative(absoluteRootDir, file)}`));
|
|
3641
3653
|
};
|
|
3642
|
-
var chooseFilesToGenerate = async () => {
|
|
3654
|
+
var chooseFilesToGenerate = async (cssExtension) => {
|
|
3643
3655
|
const { prompt } = await Promise.resolve().then(() => __toESM(require_lib()));
|
|
3644
3656
|
return (await prompt({
|
|
3645
3657
|
name: "filesToGenerate",
|
|
3646
3658
|
type: "multiselect",
|
|
3647
3659
|
message: "Which additional files do you want to generate?",
|
|
3648
3660
|
choices: [
|
|
3649
|
-
{ value:
|
|
3661
|
+
{ value: cssExtension, title: `Stylesheet (.${cssExtension})`, selected: true },
|
|
3650
3662
|
{ value: "spec.tsx", title: "Spec Test (.spec.tsx)", selected: true },
|
|
3651
3663
|
{ value: "e2e.ts", title: "E2E Test (.e2e.ts)", selected: true }
|
|
3652
3664
|
]
|
|
3653
3665
|
})).filesToGenerate;
|
|
3654
3666
|
};
|
|
3667
|
+
var chooseSassExtension = async () => {
|
|
3668
|
+
const { prompt } = await Promise.resolve().then(() => __toESM(require_lib()));
|
|
3669
|
+
return (await prompt({
|
|
3670
|
+
name: "sassFormat",
|
|
3671
|
+
type: "select",
|
|
3672
|
+
message: "Which Sass format would you like to use? (More info: https://sass-lang.com/documentation/syntax/#the-indented-syntax)",
|
|
3673
|
+
choices: [
|
|
3674
|
+
{ value: "sass", title: `*.sass Format`, selected: true },
|
|
3675
|
+
{ value: "scss", title: "*.scss Format" }
|
|
3676
|
+
]
|
|
3677
|
+
})).sassFormat;
|
|
3678
|
+
};
|
|
3655
3679
|
var getFilepathForFile = (filePath, componentName, extension) => isTest2(extension) ? normalizePath(join2(filePath, "test", `${componentName}.${extension}`)) : normalizePath(join2(filePath, `${componentName}.${extension}`));
|
|
3656
|
-
var getBoilerplateAndWriteFile = async (config, componentName, withCss, file) => {
|
|
3657
|
-
const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss);
|
|
3680
|
+
var getBoilerplateAndWriteFile = async (config, componentName, withCss, file, styleExtension) => {
|
|
3681
|
+
const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss, styleExtension);
|
|
3658
3682
|
await config.sys.writeFile(normalizePath(file.path), boilerplate);
|
|
3659
3683
|
return file.path;
|
|
3660
3684
|
};
|
|
@@ -3678,12 +3702,15 @@ var checkForOverwrite = async (files, config) => {
|
|
|
3678
3702
|
var isTest2 = (extension) => {
|
|
3679
3703
|
return extension === "e2e.ts" || extension === "spec.tsx";
|
|
3680
3704
|
};
|
|
3681
|
-
var getBoilerplateByExtension = (tagName, extension, withCss) => {
|
|
3705
|
+
var getBoilerplateByExtension = (tagName, extension, withCss, styleExtension) => {
|
|
3682
3706
|
switch (extension) {
|
|
3683
3707
|
case "tsx":
|
|
3684
|
-
return getComponentBoilerplate(tagName, withCss);
|
|
3708
|
+
return getComponentBoilerplate(tagName, withCss, styleExtension);
|
|
3685
3709
|
case "css":
|
|
3686
|
-
|
|
3710
|
+
case "less":
|
|
3711
|
+
case "sass":
|
|
3712
|
+
case "scss":
|
|
3713
|
+
return getStyleUrlBoilerplate(styleExtension);
|
|
3687
3714
|
case "spec.tsx":
|
|
3688
3715
|
return getSpecTestBoilerplate(tagName);
|
|
3689
3716
|
case "e2e.ts":
|
|
@@ -3692,11 +3719,11 @@ var getBoilerplateByExtension = (tagName, extension, withCss) => {
|
|
|
3692
3719
|
throw new Error(`Unkown extension "${extension}".`);
|
|
3693
3720
|
}
|
|
3694
3721
|
};
|
|
3695
|
-
var getComponentBoilerplate = (tagName, hasStyle) => {
|
|
3722
|
+
var getComponentBoilerplate = (tagName, hasStyle, styleExtension) => {
|
|
3696
3723
|
const decorator = [`{`];
|
|
3697
3724
|
decorator.push(` tag: '${tagName}',`);
|
|
3698
3725
|
if (hasStyle) {
|
|
3699
|
-
decorator.push(` styleUrl: '${tagName}
|
|
3726
|
+
decorator.push(` styleUrl: '${tagName}.${styleExtension}',`);
|
|
3700
3727
|
}
|
|
3701
3728
|
decorator.push(` shadow: true,`);
|
|
3702
3729
|
decorator.push(`}`);
|
|
@@ -3704,7 +3731,6 @@ var getComponentBoilerplate = (tagName, hasStyle) => {
|
|
|
3704
3731
|
|
|
3705
3732
|
@Component(${decorator.join("\n")})
|
|
3706
3733
|
export class ${toPascalCase(tagName)} {
|
|
3707
|
-
|
|
3708
3734
|
render() {
|
|
3709
3735
|
return (
|
|
3710
3736
|
<Host>
|
|
@@ -3712,11 +3738,12 @@ export class ${toPascalCase(tagName)} {
|
|
|
3712
3738
|
</Host>
|
|
3713
3739
|
);
|
|
3714
3740
|
}
|
|
3715
|
-
|
|
3716
3741
|
}
|
|
3717
3742
|
`;
|
|
3718
3743
|
};
|
|
3719
|
-
var getStyleUrlBoilerplate = () => `:host
|
|
3744
|
+
var getStyleUrlBoilerplate = (ext) => ext === "sass" ? `:host
|
|
3745
|
+
display: block
|
|
3746
|
+
` : `:host {
|
|
3720
3747
|
display: block;
|
|
3721
3748
|
}
|
|
3722
3749
|
`;
|
package/cli/package.json
CHANGED
package/compiler/package.json
CHANGED
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,7 +231091,7 @@ ${e.message}`;
|
|
|
231091
231091
|
var typescript_5_4_5_bundle_cache_min_default = ts;
|
|
231092
231092
|
|
|
231093
231093
|
// src/version.ts
|
|
231094
|
-
var buildId = "
|
|
231094
|
+
var buildId = "1734909053";
|
|
231095
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";
|
|
@@ -231099,8 +231099,8 @@ var rollupVersion = "2.56.3";
|
|
|
231099
231099
|
var jqueryVersion = "4.0.0-pre";
|
|
231100
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)) {
|
|
@@ -248054,10 +248053,17 @@ import { createWorker } from '${WORKER_HELPER_ID}';
|
|
|
248054
248053
|
export const workerName = '${workerName}';
|
|
248055
248054
|
export const workerMsgId = '${workerMsgId}';
|
|
248056
248055
|
export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
|
|
248057
|
-
|
|
248058
|
-
|
|
248059
|
-
|
|
248060
|
-
|
|
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
|
+
}
|
|
248061
248067
|
`;
|
|
248062
248068
|
};
|
|
248063
248069
|
var getMockedWorkerMain = () => {
|
|
@@ -248189,7 +248195,8 @@ var getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
|
|
|
248189
248195
|
treeshake: getTreeshakeOption(config, bundleOpts),
|
|
248190
248196
|
preserveEntrySignatures: (_c = bundleOpts.preserveEntrySignatures) != null ? _c : "strict",
|
|
248191
248197
|
onwarn: createOnWarnFn(buildCtx.diagnostics),
|
|
248192
|
-
cache: compilerCtx.rollupCache.get(bundleOpts.id)
|
|
248198
|
+
cache: compilerCtx.rollupCache.get(bundleOpts.id),
|
|
248199
|
+
external: config.rollupConfig.inputOptions.external
|
|
248193
248200
|
};
|
|
248194
248201
|
return rollupOptions;
|
|
248195
248202
|
};
|
|
@@ -249782,7 +249789,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
249782
249789
|
member: cmps.some((c) => c.hasMember),
|
|
249783
249790
|
method: cmps.some((c) => c.hasMethod),
|
|
249784
249791
|
mode: cmps.some((c) => c.hasMode),
|
|
249785
|
-
observeAttribute: cmps.some((c) => c.hasAttribute),
|
|
249792
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
249786
249793
|
prop: cmps.some((c) => c.hasProp),
|
|
249787
249794
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
249788
249795
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
@@ -250584,12 +250591,17 @@ var writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupO
|
|
|
250584
250591
|
var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
|
|
250585
250592
|
const hydratePackageName = await getHydratePackageName(config, compilerCtx);
|
|
250586
250593
|
const hydrateAppDirPath = outputTarget.dir;
|
|
250594
|
+
if (!hydrateAppDirPath) {
|
|
250595
|
+
throw new Error(`outputTarget config missing the "dir" property`);
|
|
250596
|
+
}
|
|
250587
250597
|
const hydrateCoreIndexPath = join(hydrateAppDirPath, "index.js");
|
|
250598
|
+
const hydrateCoreIndexPathESM = join(hydrateAppDirPath, "index.mjs");
|
|
250588
250599
|
const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, "index.d.ts");
|
|
250589
250600
|
const pkgJsonPath = join(hydrateAppDirPath, "package.json");
|
|
250590
250601
|
const pkgJsonCode = getHydratePackageJson(
|
|
250591
250602
|
config,
|
|
250592
250603
|
hydrateCoreIndexPath,
|
|
250604
|
+
hydrateCoreIndexPathESM,
|
|
250593
250605
|
hydrateCoreIndexDtsFilePath,
|
|
250594
250606
|
hydratePackageName
|
|
250595
250607
|
);
|
|
@@ -250608,24 +250620,32 @@ var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rol
|
|
|
250608
250620
|
})
|
|
250609
250621
|
);
|
|
250610
250622
|
};
|
|
250611
|
-
var getHydratePackageJson = (config,
|
|
250623
|
+
var getHydratePackageJson = (config, hydrateAppFilePathCJS, hydrateAppFilePathESM, hydrateDtsFilePath, hydratePackageName) => {
|
|
250612
250624
|
const pkg = {
|
|
250613
250625
|
name: hydratePackageName,
|
|
250614
250626
|
description: `${config.namespace} component hydration app.`,
|
|
250615
|
-
main: (0, import_path26.basename)(
|
|
250616
|
-
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
|
+
}
|
|
250617
250635
|
};
|
|
250618
250636
|
return JSON.stringify(pkg, null, 2);
|
|
250619
250637
|
};
|
|
250620
250638
|
var getHydratePackageName = async (config, compilerCtx) => {
|
|
250639
|
+
const directoryName = (0, import_path26.basename)(config.rootDir);
|
|
250621
250640
|
try {
|
|
250622
250641
|
const rootPkgFilePath = join(config.rootDir, "package.json");
|
|
250623
250642
|
const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
|
|
250624
250643
|
const pkgData = JSON.parse(pkgStr);
|
|
250625
|
-
|
|
250644
|
+
const scope = pkgData.name || directoryName;
|
|
250645
|
+
return `${scope}/hydrate`;
|
|
250626
250646
|
} catch (e) {
|
|
250627
250647
|
}
|
|
250628
|
-
return `${config.fsNamespace}/hydrate`;
|
|
250648
|
+
return `${config.fsNamespace || directoryName}/hydrate`;
|
|
250629
250649
|
};
|
|
250630
250650
|
var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
250631
250651
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250635,6 +250655,15 @@ var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
|
|
|
250635
250655
|
};
|
|
250636
250656
|
|
|
250637
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
|
+
};
|
|
250638
250667
|
var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
|
|
250639
250668
|
try {
|
|
250640
250669
|
const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
|
|
@@ -250642,6 +250671,7 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250642
250671
|
const mockDoc = join(packageDir, "mock-doc", "index.js");
|
|
250643
250672
|
const rollupOptions = {
|
|
250644
250673
|
...config.rollupConfig.inputOptions,
|
|
250674
|
+
external: ["stream"],
|
|
250645
250675
|
input,
|
|
250646
250676
|
inlineDynamicImports: true,
|
|
250647
250677
|
plugins: [
|
|
@@ -250668,12 +250698,10 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
|
|
|
250668
250698
|
onwarn: createOnWarnFn(buildCtx.diagnostics)
|
|
250669
250699
|
};
|
|
250670
250700
|
const rollupAppBuild = await rollup(rollupOptions);
|
|
250671
|
-
|
|
250672
|
-
|
|
250673
|
-
|
|
250674
|
-
|
|
250675
|
-
});
|
|
250676
|
-
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
|
+
]);
|
|
250677
250705
|
} catch (e) {
|
|
250678
250706
|
if (!buildCtx.hasError) {
|
|
250679
250707
|
loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
|
|
@@ -252653,7 +252681,7 @@ var validateRollupConfig = (config) => {
|
|
|
252653
252681
|
if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
|
|
252654
252682
|
cleanRollupConfig = {
|
|
252655
252683
|
...cleanRollupConfig,
|
|
252656
|
-
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
|
|
252684
|
+
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
|
|
252657
252685
|
};
|
|
252658
252686
|
}
|
|
252659
252687
|
if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
|
|
@@ -254203,6 +254231,9 @@ export interface CustomElementsDefineOptions {
|
|
|
254203
254231
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
254204
254232
|
}
|
|
254205
254233
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
|
|
254234
|
+
/**
|
|
254235
|
+
* @deprecated
|
|
254236
|
+
*/
|
|
254206
254237
|
export declare function applyPolyfills(): Promise<void>;
|
|
254207
254238
|
|
|
254208
254239
|
/**
|
|
@@ -254398,7 +254429,7 @@ var updateTypeName = (currentTypeName, typeAlias) => {
|
|
|
254398
254429
|
return currentTypeName;
|
|
254399
254430
|
}
|
|
254400
254431
|
const endingStrChar = "(?!(\"|'|`))";
|
|
254401
|
-
const typeNameRegex = new RegExp(
|
|
254432
|
+
const typeNameRegex = new RegExp(`\\b${typeAlias.localName}\\b${endingStrChar}`, "g");
|
|
254402
254433
|
return currentTypeName.replace(typeNameRegex, typeAlias.importName);
|
|
254403
254434
|
};
|
|
254404
254435
|
var copyRindoCoreDts = async (config, compilerCtx) => {
|
|
@@ -254693,6 +254724,9 @@ var updateImportReferenceFactory = (typeCounts, filePath, config) => {
|
|
|
254693
254724
|
}
|
|
254694
254725
|
const newTypeName = getIncrementTypeName(typeName);
|
|
254695
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(),
|
|
254696
254730
|
localName: typeName,
|
|
254697
254731
|
importName: newTypeName
|
|
254698
254732
|
});
|
|
@@ -254744,10 +254778,10 @@ var generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
|
|
|
254744
254778
|
importFilePath = normalizePath("./" + relative(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, "");
|
|
254745
254779
|
}
|
|
254746
254780
|
return `{ ${typeData.sort(sortImportNames).map((td2) => {
|
|
254747
|
-
if (td2.
|
|
254748
|
-
return `${td2.
|
|
254781
|
+
if (td2.originalName === td2.importName) {
|
|
254782
|
+
return `${td2.originalName}`;
|
|
254749
254783
|
} else {
|
|
254750
|
-
return `${td2.
|
|
254784
|
+
return `${td2.originalName} as ${td2.importName}`;
|
|
254751
254785
|
}
|
|
254752
254786
|
}).join(`, `)} } from "${importFilePath}";`;
|
|
254753
254787
|
});
|
|
@@ -261945,10 +261979,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261945
261979
|
}
|
|
261946
261980
|
if (typeof prerenderConfig.beforeHydrate === "function") {
|
|
261947
261981
|
try {
|
|
261948
|
-
|
|
261949
|
-
if (isPromise(rtn)) {
|
|
261950
|
-
await rtn;
|
|
261951
|
-
}
|
|
261982
|
+
await prerenderConfig.beforeHydrate(doc, url);
|
|
261952
261983
|
} catch (e) {
|
|
261953
261984
|
catchError(results.diagnostics, e);
|
|
261954
261985
|
}
|
|
@@ -261973,7 +262004,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
261973
262004
|
excludeStaticComponents(doc, hydrateOpts, hydrateResults);
|
|
261974
262005
|
}
|
|
261975
262006
|
if (hydrateOpts.addModulePreloads) {
|
|
261976
|
-
if (!prerenderRequest.isDebug) {
|
|
262007
|
+
if (!prerenderRequest.isDebug && componentGraph) {
|
|
261977
262008
|
addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
|
|
261978
262009
|
}
|
|
261979
262010
|
} else {
|
|
@@ -262010,10 +262041,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
262010
262041
|
}
|
|
262011
262042
|
if (typeof prerenderConfig.afterHydrate === "function") {
|
|
262012
262043
|
try {
|
|
262013
|
-
|
|
262014
|
-
if (isPromise(rtn)) {
|
|
262015
|
-
await rtn;
|
|
262016
|
-
}
|
|
262044
|
+
await prerenderConfig.afterHydrate(doc, url, results);
|
|
262017
262045
|
} catch (e) {
|
|
262018
262046
|
catchError(results.diagnostics, e);
|
|
262019
262047
|
}
|
|
@@ -262025,7 +262053,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
262025
262053
|
}
|
|
262026
262054
|
return results;
|
|
262027
262055
|
}
|
|
262028
|
-
const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
262056
|
+
const html = await hydrateApp.serializeDocumentToString(doc, hydrateOpts);
|
|
262029
262057
|
prerenderEnsureDir(sys, prerenderCtx2, results.filePath);
|
|
262030
262058
|
const writePromise = sys.writeFile(results.filePath, html);
|
|
262031
262059
|
if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
|
|
@@ -262725,17 +262753,13 @@ var prerenderUrl = async (results, manager, url) => {
|
|
|
262725
262753
|
var import_mock_doc3 = require("../mock-doc/index.cjs");
|
|
262726
262754
|
var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
|
|
262727
262755
|
try {
|
|
262728
|
-
if (!isString(srcIndexHtmlPath)) {
|
|
262756
|
+
if (!isString(srcIndexHtmlPath) && outputTarget.indexHtml) {
|
|
262729
262757
|
srcIndexHtmlPath = outputTarget.indexHtml;
|
|
262730
262758
|
}
|
|
262731
262759
|
let templateHtml;
|
|
262732
262760
|
if (isFunction(prerenderConfig.loadTemplate)) {
|
|
262733
262761
|
const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
|
|
262734
|
-
|
|
262735
|
-
templateHtml = await loadTemplateResult;
|
|
262736
|
-
} else {
|
|
262737
|
-
templateHtml = loadTemplateResult;
|
|
262738
|
-
}
|
|
262762
|
+
templateHtml = await loadTemplateResult;
|
|
262739
262763
|
} else {
|
|
262740
262764
|
templateHtml = await config.sys.readFile(srcIndexHtmlPath);
|
|
262741
262765
|
}
|
|
@@ -262748,7 +262772,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262748
262772
|
staticSite = !hasRindoScript(doc);
|
|
262749
262773
|
}
|
|
262750
262774
|
doc.documentElement.classList.add("hydrated");
|
|
262751
|
-
if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
|
|
262775
|
+
if (hydrateOpts.inlineExternalStyleSheets && !isDebug && outputTarget.appDir) {
|
|
262752
262776
|
try {
|
|
262753
262777
|
await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
|
|
262754
262778
|
} catch (e) {
|
|
@@ -262762,7 +262786,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262762
262786
|
catchError(diagnostics, e);
|
|
262763
262787
|
}
|
|
262764
262788
|
}
|
|
262765
|
-
if (hydrateOpts.minifyStyleElements && !isDebug) {
|
|
262789
|
+
if (hydrateOpts.minifyStyleElements && !isDebug && outputTarget.baseUrl) {
|
|
262766
262790
|
try {
|
|
262767
262791
|
const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
|
|
262768
262792
|
await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
|
|
@@ -262772,20 +262796,12 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
|
|
|
262772
262796
|
}
|
|
262773
262797
|
if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
|
|
262774
262798
|
const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
|
|
262775
|
-
|
|
262776
|
-
doc = await beforeSerializeResults;
|
|
262777
|
-
} else {
|
|
262778
|
-
doc = beforeSerializeResults;
|
|
262779
|
-
}
|
|
262799
|
+
doc = await beforeSerializeResults;
|
|
262780
262800
|
}
|
|
262781
262801
|
let html = (0, import_mock_doc3.serializeNodeToHtml)(doc);
|
|
262782
262802
|
if (isFunction(prerenderConfig.afterSerializeTemplate)) {
|
|
262783
262803
|
const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
|
|
262784
|
-
|
|
262785
|
-
html = await afterSerializeResults;
|
|
262786
|
-
} else {
|
|
262787
|
-
html = afterSerializeResults;
|
|
262788
|
-
}
|
|
262804
|
+
html = await afterSerializeResults;
|
|
262789
262805
|
}
|
|
262790
262806
|
return {
|
|
262791
262807
|
html,
|