@rindo/core 4.18.3-dev.1734304270.ca7046f → 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.
Files changed (45) hide show
  1. package/cli/index.cjs +43 -16
  2. package/cli/index.js +43 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +64 -55
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +3 -3
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/client/index.js +531 -507
  14. package/internal/client/package.json +3 -1
  15. package/internal/client/patch-browser.js +1 -1
  16. package/internal/hydrate/index.js +104 -49
  17. package/internal/hydrate/package.json +1 -1
  18. package/internal/hydrate/runner.d.ts +29 -11
  19. package/internal/hydrate/runner.js +235 -258
  20. package/internal/package.json +1 -1
  21. package/internal/rindo-private.d.ts +29 -10
  22. package/internal/rindo-public-compiler.d.ts +14 -0
  23. package/internal/rindo-public-runtime.d.ts +0 -2
  24. package/internal/testing/index.js +435 -406
  25. package/internal/testing/package.json +1 -1
  26. package/mock-doc/index.cjs +133 -129
  27. package/mock-doc/index.d.ts +18 -4
  28. package/mock-doc/index.js +133 -129
  29. package/mock-doc/package.json +1 -1
  30. package/package.json +29 -1
  31. package/screenshot/index.js +1 -1
  32. package/screenshot/package.json +1 -1
  33. package/screenshot/pixel-match.js +1 -1
  34. package/sys/node/index.js +10 -10
  35. package/sys/node/package.json +1 -1
  36. package/sys/node/worker.js +1 -1
  37. package/testing/index.js +68 -4
  38. package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
  39. package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
  40. package/testing/jest/jest-28/matchers/events.d.ts +4 -0
  41. package/testing/jest/jest-28/matchers/index.d.ts +2 -1
  42. package/testing/jest/jest-29/matchers/events.d.ts +4 -0
  43. package/testing/jest/jest-29/matchers/index.d.ts +2 -1
  44. package/testing/package.json +1 -1
  45. 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.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI (CommonJS) v4.19.0 | 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
- const filesToGenerateExt = await chooseFilesToGenerate();
3621
- if (void 0 === filesToGenerateExt) {
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(config, componentName, extensionsToGenerate.includes("css"), file)
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: "css", title: "Stylesheet (.css)", selected: true },
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
- return getStyleUrlBoilerplate();
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}.css',`);
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.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI v4.19.0 | 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
- const filesToGenerateExt = await chooseFilesToGenerate();
3615
- if (void 0 === filesToGenerateExt) {
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(config, componentName, extensionsToGenerate.includes("css"), file)
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: "css", title: "Stylesheet (.css)", selected: true },
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
- return getStyleUrlBoilerplate();
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}.css',`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/cli",
3
- "version": "4.18.3-dev.1734304270.ca7046f",
3
+ "version": "4.19.0",
4
4
  "description": "Rindo CLI.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/compiler",
3
- "version": "4.18.3-dev.1734304270.ca7046f",
3
+ "version": "4.19.0",
4
4
  "description": "Rindo Compiler.",
5
5
  "main": "./rindo.js",
6
6
  "types": "./rindo.d.ts",
package/compiler/rindo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Compiler v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
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 isPromise2 = !!getAwaitedTypeOfPromise(type);
115666
- if (callSignatures.length === 0 && !isPromise2) {
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 && !isPromise2) {
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 (isPromise2) {
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 = "1734304270";
231094
+ var buildId = "1734571004";
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{1F3C6}";
231103
- var version = "4.18.3-dev.1734304270.ca7046f";
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) => {
@@ -248189,7 +248188,8 @@ var getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
248189
248188
  treeshake: getTreeshakeOption(config, bundleOpts),
248190
248189
  preserveEntrySignatures: (_c = bundleOpts.preserveEntrySignatures) != null ? _c : "strict",
248191
248190
  onwarn: createOnWarnFn(buildCtx.diagnostics),
248192
- cache: compilerCtx.rollupCache.get(bundleOpts.id)
248191
+ cache: compilerCtx.rollupCache.get(bundleOpts.id),
248192
+ external: config.rollupConfig.inputOptions.external
248193
248193
  };
248194
248194
  return rollupOptions;
248195
248195
  };
@@ -249782,7 +249782,7 @@ var getBuildFeatures = (cmps) => {
249782
249782
  member: cmps.some((c) => c.hasMember),
249783
249783
  method: cmps.some((c) => c.hasMethod),
249784
249784
  mode: cmps.some((c) => c.hasMode),
249785
- observeAttribute: cmps.some((c) => c.hasAttribute),
249785
+ observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
249786
249786
  prop: cmps.some((c) => c.hasProp),
249787
249787
  propBoolean: cmps.some((c) => c.hasPropBoolean),
249788
249788
  propNumber: cmps.some((c) => c.hasPropNumber),
@@ -250584,12 +250584,17 @@ var writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupO
250584
250584
  var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
250585
250585
  const hydratePackageName = await getHydratePackageName(config, compilerCtx);
250586
250586
  const hydrateAppDirPath = outputTarget.dir;
250587
+ if (!hydrateAppDirPath) {
250588
+ throw new Error(`outputTarget config missing the "dir" property`);
250589
+ }
250587
250590
  const hydrateCoreIndexPath = join(hydrateAppDirPath, "index.js");
250591
+ const hydrateCoreIndexPathESM = join(hydrateAppDirPath, "index.mjs");
250588
250592
  const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, "index.d.ts");
250589
250593
  const pkgJsonPath = join(hydrateAppDirPath, "package.json");
250590
250594
  const pkgJsonCode = getHydratePackageJson(
250591
250595
  config,
250592
250596
  hydrateCoreIndexPath,
250597
+ hydrateCoreIndexPathESM,
250593
250598
  hydrateCoreIndexDtsFilePath,
250594
250599
  hydratePackageName
250595
250600
  );
@@ -250608,24 +250613,32 @@ var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rol
250608
250613
  })
250609
250614
  );
250610
250615
  };
250611
- var getHydratePackageJson = (config, hydrateAppFilePath, hydrateDtsFilePath, hydratePackageName) => {
250616
+ var getHydratePackageJson = (config, hydrateAppFilePathCJS, hydrateAppFilePathESM, hydrateDtsFilePath, hydratePackageName) => {
250612
250617
  const pkg = {
250613
250618
  name: hydratePackageName,
250614
250619
  description: `${config.namespace} component hydration app.`,
250615
- main: (0, import_path26.basename)(hydrateAppFilePath),
250616
- 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
+ }
250617
250628
  };
250618
250629
  return JSON.stringify(pkg, null, 2);
250619
250630
  };
250620
250631
  var getHydratePackageName = async (config, compilerCtx) => {
250632
+ const directoryName = (0, import_path26.basename)(config.rootDir);
250621
250633
  try {
250622
250634
  const rootPkgFilePath = join(config.rootDir, "package.json");
250623
250635
  const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
250624
250636
  const pkgData = JSON.parse(pkgStr);
250625
- return `${pkgData.name}/hydrate`;
250637
+ const scope = pkgData.name || directoryName;
250638
+ return `${scope}/hydrate`;
250626
250639
  } catch (e) {
250627
250640
  }
250628
- return `${config.fsNamespace}/hydrate`;
250641
+ return `${config.fsNamespace || directoryName}/hydrate`;
250629
250642
  };
250630
250643
  var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
250631
250644
  const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
@@ -250635,6 +250648,15 @@ var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
250635
250648
  };
250636
250649
 
250637
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
+ };
250638
250660
  var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
250639
250661
  try {
250640
250662
  const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
@@ -250642,6 +250664,7 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
250642
250664
  const mockDoc = join(packageDir, "mock-doc", "index.js");
250643
250665
  const rollupOptions = {
250644
250666
  ...config.rollupConfig.inputOptions,
250667
+ external: ["stream"],
250645
250668
  input,
250646
250669
  inlineDynamicImports: true,
250647
250670
  plugins: [
@@ -250668,12 +250691,10 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
250668
250691
  onwarn: createOnWarnFn(buildCtx.diagnostics)
250669
250692
  };
250670
250693
  const rollupAppBuild = await rollup(rollupOptions);
250671
- const rollupOutput = await rollupAppBuild.generate({
250672
- banner: generatePreamble(config),
250673
- format: "cjs",
250674
- file: "index.js"
250675
- });
250676
- 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
+ ]);
250677
250698
  } catch (e) {
250678
250699
  if (!buildCtx.hasError) {
250679
250700
  loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
@@ -252653,7 +252674,7 @@ var validateRollupConfig = (config) => {
252653
252674
  if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
252654
252675
  cleanRollupConfig = {
252655
252676
  ...cleanRollupConfig,
252656
- inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
252677
+ inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
252657
252678
  };
252658
252679
  }
252659
252680
  if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
@@ -254203,6 +254224,9 @@ export interface CustomElementsDefineOptions {
254203
254224
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
254204
254225
  }
254205
254226
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
254227
+ /**
254228
+ * @deprecated
254229
+ */
254206
254230
  export declare function applyPolyfills(): Promise<void>;
254207
254231
 
254208
254232
  /**
@@ -254398,7 +254422,7 @@ var updateTypeName = (currentTypeName, typeAlias) => {
254398
254422
  return currentTypeName;
254399
254423
  }
254400
254424
  const endingStrChar = "(?!(\"|'|`))";
254401
- const typeNameRegex = new RegExp(`${typeAlias.localName}\\b${endingStrChar}`, "g");
254425
+ const typeNameRegex = new RegExp(`\\b${typeAlias.localName}\\b${endingStrChar}`, "g");
254402
254426
  return currentTypeName.replace(typeNameRegex, typeAlias.importName);
254403
254427
  };
254404
254428
  var copyRindoCoreDts = async (config, compilerCtx) => {
@@ -254693,6 +254717,9 @@ var updateImportReferenceFactory = (typeCounts, filePath, config) => {
254693
254717
  }
254694
254718
  const newTypeName = getIncrementTypeName(typeName);
254695
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(),
254696
254723
  localName: typeName,
254697
254724
  importName: newTypeName
254698
254725
  });
@@ -254744,10 +254771,10 @@ var generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
254744
254771
  importFilePath = normalizePath("./" + relative(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, "");
254745
254772
  }
254746
254773
  return `{ ${typeData.sort(sortImportNames).map((td2) => {
254747
- if (td2.localName === td2.importName) {
254748
- return `${td2.importName}`;
254774
+ if (td2.originalName === td2.importName) {
254775
+ return `${td2.originalName}`;
254749
254776
  } else {
254750
- return `${td2.localName} as ${td2.importName}`;
254777
+ return `${td2.originalName} as ${td2.importName}`;
254751
254778
  }
254752
254779
  }).join(`, `)} } from "${importFilePath}";`;
254753
254780
  });
@@ -261945,10 +261972,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261945
261972
  }
261946
261973
  if (typeof prerenderConfig.beforeHydrate === "function") {
261947
261974
  try {
261948
- const rtn = prerenderConfig.beforeHydrate(doc, url);
261949
- if (isPromise(rtn)) {
261950
- await rtn;
261951
- }
261975
+ await prerenderConfig.beforeHydrate(doc, url);
261952
261976
  } catch (e) {
261953
261977
  catchError(results.diagnostics, e);
261954
261978
  }
@@ -261973,7 +261997,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261973
261997
  excludeStaticComponents(doc, hydrateOpts, hydrateResults);
261974
261998
  }
261975
261999
  if (hydrateOpts.addModulePreloads) {
261976
- if (!prerenderRequest.isDebug) {
262000
+ if (!prerenderRequest.isDebug && componentGraph) {
261977
262001
  addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
261978
262002
  }
261979
262003
  } else {
@@ -262010,10 +262034,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
262010
262034
  }
262011
262035
  if (typeof prerenderConfig.afterHydrate === "function") {
262012
262036
  try {
262013
- const rtn = prerenderConfig.afterHydrate(doc, url, results);
262014
- if (isPromise(rtn)) {
262015
- await rtn;
262016
- }
262037
+ await prerenderConfig.afterHydrate(doc, url, results);
262017
262038
  } catch (e) {
262018
262039
  catchError(results.diagnostics, e);
262019
262040
  }
@@ -262025,7 +262046,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
262025
262046
  }
262026
262047
  return results;
262027
262048
  }
262028
- const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
262049
+ const html = await hydrateApp.serializeDocumentToString(doc, hydrateOpts);
262029
262050
  prerenderEnsureDir(sys, prerenderCtx2, results.filePath);
262030
262051
  const writePromise = sys.writeFile(results.filePath, html);
262031
262052
  if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
@@ -262725,17 +262746,13 @@ var prerenderUrl = async (results, manager, url) => {
262725
262746
  var import_mock_doc3 = require("../mock-doc/index.cjs");
262726
262747
  var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
262727
262748
  try {
262728
- if (!isString(srcIndexHtmlPath)) {
262749
+ if (!isString(srcIndexHtmlPath) && outputTarget.indexHtml) {
262729
262750
  srcIndexHtmlPath = outputTarget.indexHtml;
262730
262751
  }
262731
262752
  let templateHtml;
262732
262753
  if (isFunction(prerenderConfig.loadTemplate)) {
262733
262754
  const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
262734
- if (isPromise(loadTemplateResult)) {
262735
- templateHtml = await loadTemplateResult;
262736
- } else {
262737
- templateHtml = loadTemplateResult;
262738
- }
262755
+ templateHtml = await loadTemplateResult;
262739
262756
  } else {
262740
262757
  templateHtml = await config.sys.readFile(srcIndexHtmlPath);
262741
262758
  }
@@ -262748,7 +262765,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262748
262765
  staticSite = !hasRindoScript(doc);
262749
262766
  }
262750
262767
  doc.documentElement.classList.add("hydrated");
262751
- if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
262768
+ if (hydrateOpts.inlineExternalStyleSheets && !isDebug && outputTarget.appDir) {
262752
262769
  try {
262753
262770
  await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
262754
262771
  } catch (e) {
@@ -262762,7 +262779,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262762
262779
  catchError(diagnostics, e);
262763
262780
  }
262764
262781
  }
262765
- if (hydrateOpts.minifyStyleElements && !isDebug) {
262782
+ if (hydrateOpts.minifyStyleElements && !isDebug && outputTarget.baseUrl) {
262766
262783
  try {
262767
262784
  const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
262768
262785
  await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
@@ -262772,20 +262789,12 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262772
262789
  }
262773
262790
  if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
262774
262791
  const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
262775
- if (isPromise(beforeSerializeResults)) {
262776
- doc = await beforeSerializeResults;
262777
- } else {
262778
- doc = beforeSerializeResults;
262779
- }
262792
+ doc = await beforeSerializeResults;
262780
262793
  }
262781
262794
  let html = (0, import_mock_doc3.serializeNodeToHtml)(doc);
262782
262795
  if (isFunction(prerenderConfig.afterSerializeTemplate)) {
262783
262796
  const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
262784
- if (isPromise(afterSerializeResults)) {
262785
- html = await afterSerializeResults;
262786
- } else {
262787
- html = afterSerializeResults;
262788
- }
262797
+ html = await afterSerializeResults;
262789
262798
  }
262790
262799
  return {
262791
262800
  html,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Dev Server Client v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
2
+ Rindo Dev Server Client v4.19.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
 
5
5
  // src/dev-server/client/app-error.css
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/dev-server/client",
3
- "version": "4.18.3-dev.1734304270.ca7046f",
3
+ "version": "4.19.0",
4
4
  "description": "Rindo Dev Server Client.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",