@stencil/core 5.0.0-beta.18 → 5.0.0-beta.19

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.
@@ -1844,7 +1844,7 @@ const validateComponentTag = (tag) => {
1844
1844
  };
1845
1845
  //#endregion
1846
1846
  //#region src/version.ts
1847
- const version = "5.0.0-beta.18";
1847
+ const version = "5.0.0-beta.19";
1848
1848
  //#endregion
1849
1849
  //#region src/compiler/events.ts
1850
1850
  const buildEvents = () => {
@@ -1,3 +1,3 @@
1
- import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-WnMTqnE1.mjs";
1
+ import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-CsCXc_9d.mjs";
2
2
  import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-DGo5Qu7U.mjs";
3
3
  export { CustomElementsExportBehaviorOptions, LOG_LEVELS, buildHydrateCss, buildId, cmpMetaToDocsComponent, createCompiler, createPrerenderer, createSystem, createWorkerContext, createWorkerMessageHandler, foldBuildFlags, generateComponentTypesFile, generateManifest, getScopeId, hasStencilCssComponentsImport, hasStencilGlobalsImport, hasStencilHydrateImport, loadConfig, nodeRequire, optimizeCss, optimizeJs, parseCssOnlyComponents, replaceStencilCssComponentsImport, replaceStencilGlobalsImport, replaceStencilHydrateImport, scopeCss, transpile, transpileSync, ts, validateConfig, validateHydrated, vermoji, version, versions };
@@ -461,9 +461,9 @@ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
461
461
  };
462
462
  //#endregion
463
463
  //#region src/version.ts
464
- const version = "5.0.0-beta.18";
465
- const buildId = "1791495713";
466
- const vermoji = "🏏";
464
+ const version = "5.0.0-beta.19";
465
+ const buildId = "1791586317";
466
+ const vermoji = "🏵";
467
467
  /**
468
468
  * Get the installed version of a tool/dependency.
469
469
  * Handles packages with exports maps that point to subdirectories.
@@ -19556,9 +19556,12 @@ const getPackageJsonRecommendations = (config, compilerCtx) => {
19556
19556
  const srcIndexPath = join$2(config.srcDir, "index.ts");
19557
19557
  const hasSrcIndex = compilerCtx.fs.accessSync(srcIndexPath);
19558
19558
  const moduleOptions = [];
19559
+ let emptyLoaderIndex = null;
19559
19560
  if (loaderBundle?.dir) {
19560
- const loaderEntry = hasSrcIndex ? join$2(loaderBundle.dir, "index.js") : join$2(loaderBundle.dir, "esm", "loader.js");
19561
+ const loaderIndex = join$2(loaderBundle.dir, "index.js");
19562
+ const loaderEntry = hasSrcIndex ? loaderIndex : join$2(loaderBundle.dir, "esm", "loader.js");
19561
19563
  moduleOptions.push(normalizePath(relative$1(config.rootDir, loaderEntry)));
19564
+ if (!hasSrcIndex) emptyLoaderIndex = loaderIndex;
19562
19565
  }
19563
19566
  if (standalone?.dir) moduleOptions.push(normalizePath(relative$1(config.rootDir, join$2(standalone.dir, "index.js"))));
19564
19567
  const typesOptions = [];
@@ -19572,9 +19575,13 @@ const getPackageJsonRecommendations = (config, compilerCtx) => {
19572
19575
  }
19573
19576
  let main = null;
19574
19577
  const hasCjsOutput = !!loaderBundle?.cjs;
19575
- if (loaderBundle?.dir && loaderBundle.cjs) main = normalizePath(relative$1(config.rootDir, join$2(loaderBundle.dir, "index.cjs")));
19578
+ if (loaderBundle?.dir && loaderBundle.cjs) {
19579
+ const cjsEntry = hasSrcIndex ? join$2(loaderBundle.dir, "index.cjs") : join$2(loaderBundle.dir, "cjs", "loader.cjs");
19580
+ main = normalizePath(relative$1(config.rootDir, cjsEntry));
19581
+ }
19576
19582
  return {
19577
19583
  moduleOptions,
19584
+ emptyLoaderIndex,
19578
19585
  typesOptions,
19579
19586
  main,
19580
19587
  hasCjsOutput
@@ -19637,7 +19644,7 @@ const validateBuildPackageJson = async (config, compilerCtx, buildCtx) => {
19637
19644
  const validatePackageJson = (config, compilerCtx, buildCtx) => {
19638
19645
  const recommendations = getPackageJsonRecommendations(config, compilerCtx);
19639
19646
  if (recommendations.moduleOptions.length === 0 && recommendations.typesOptions.length === 0) return;
19640
- if (recommendations.moduleOptions.length > 0) validateModuleField(config, compilerCtx, buildCtx, recommendations.moduleOptions);
19647
+ if (recommendations.moduleOptions.length > 0) validateModuleField(config, compilerCtx, buildCtx, recommendations.moduleOptions, recommendations.emptyLoaderIndex);
19641
19648
  if (recommendations.typesOptions.length > 0) validateTypesField(config, compilerCtx, buildCtx, recommendations.typesOptions);
19642
19649
  if (recommendations.main) validateMainField(config, compilerCtx, buildCtx, recommendations.main);
19643
19650
  else validateMainFieldExists(config, compilerCtx, buildCtx);
@@ -19661,8 +19668,9 @@ const formatModuleOptions = (options) => {
19661
19668
  * @param compilerCtx the current compiler context
19662
19669
  * @param buildCtx the context associated with the current build
19663
19670
  * @param moduleOptions the recommended module paths based on configured output targets
19671
+ * @param emptyLoaderIndex the loader-bundle's `index.js`, when it has no exports
19664
19672
  */
19665
- const validateModuleField = (config, compilerCtx, buildCtx, moduleOptions) => {
19673
+ const validateModuleField = (config, compilerCtx, buildCtx, moduleOptions, emptyLoaderIndex) => {
19666
19674
  const currentModulePath = buildCtx.packageJson.module;
19667
19675
  const suggestion = formatModuleOptions(moduleOptions);
19668
19676
  if (!isString$1(currentModulePath) || currentModulePath === "") {
@@ -19670,6 +19678,10 @@ const validateModuleField = (config, compilerCtx, buildCtx, moduleOptions) => {
19670
19678
  return;
19671
19679
  }
19672
19680
  const moduleFile = join$2(config.rootDir, currentModulePath);
19681
+ if (moduleFile === emptyLoaderIndex) {
19682
+ packageJsonWarn(config, compilerCtx, buildCtx, `package.json "module" property is set to "${currentModulePath}" which has no exports without a "src/index.ts". Consider setting it to: ${suggestion}`, "\"module\"");
19683
+ return;
19684
+ }
19673
19685
  if (!compilerCtx.fs.accessSync(moduleFile)) packageJsonWarn(config, compilerCtx, buildCtx, `package.json "module" property is set to "${currentModulePath}" which doesn't exist. Consider setting it to: ${suggestion}`, "\"module\"");
19674
19686
  };
19675
19687
  /**
@@ -19990,11 +20002,16 @@ const mergeConditions = (current, owned) => {
19990
20002
  * @returns The root entry to write
19991
20003
  */
19992
20004
  const getRootExport = (config, compilerCtx, current, loaderBundle, standalone, types) => {
19993
- const isUsable = (target) => isString$1(target) ? compilerCtx.fs.accessSync(join$2(config.rootDir, target)) : target != null;
20005
+ const hasSrcIndex = compilerCtx.fs.accessSync(join$2(config.srcDir, "index.ts"));
20006
+ const emptyLoaderIndex = loaderBundle && !hasSrcIndex ? join$2(loaderBundle.dir, "index.js") : null;
20007
+ const rootUsesEmptyLoaderIndex = emptyLoaderIndex != null;
20008
+ const isUsable = (target) => {
20009
+ if (!isString$1(target)) return target != null;
20010
+ const path = join$2(config.rootDir, target);
20011
+ return path !== emptyLoaderIndex && compilerCtx.fs.accessSync(path);
20012
+ };
19994
20013
  if (isString$1(current) && isUsable(current)) return current;
19995
20014
  const existing = isJsonObject(current) ? current : {};
19996
- const hasSrcIndex = compilerCtx.fs.accessSync(join$2(config.srcDir, "index.ts"));
19997
- const rootUsesEmptyLoaderIndex = !!loaderBundle && !hasSrcIndex;
19998
20015
  const conditions = {
19999
20016
  types: existing.types,
20000
20017
  import: existing.import,
@@ -1,4 +1,4 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-WnMTqnE1.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-CsCXc_9d.mjs";
2
2
  import { t as createNodeSys } from "../../node-DGo5Qu7U.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
@@ -33,7 +33,7 @@ import "@rollup/pluginutils";
33
33
  import { createHash } from "crypto";
34
34
  import { afterAll, vi } from "vitest";
35
35
  //#region src/version.ts
36
- const version = "5.0.0-beta.18";
36
+ const version = "5.0.0-beta.19";
37
37
  const MEMBER_FLAGS = {
38
38
  String: 1,
39
39
  Number: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-beta.18",
3
+ "version": "5.0.0-beta.19",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -126,9 +126,9 @@
126
126
  "terser": "^5.50.0",
127
127
  "tinyglobby": "^0.2.17",
128
128
  "typescript": ">5.0.0 <7.0.0",
129
- "@stencil/cli": "5.0.0-beta.18",
130
- "@stencil/mock-doc": "5.0.0-beta.18",
131
- "@stencil/dev-server": "5.0.0-beta.18"
129
+ "@stencil/dev-server": "5.0.0-beta.19",
130
+ "@stencil/mock-doc": "5.0.0-beta.19",
131
+ "@stencil/cli": "5.0.0-beta.19"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@ionic/prettier-config": "^4.0.0",