@stencil/core 5.0.0-beta.21 → 5.0.0-beta.23

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.21";
1847
+ const version = "5.0.0-beta.23";
1848
1848
  //#endregion
1849
1849
  //#region src/compiler/events.ts
1850
1850
  const buildEvents = () => {
@@ -2643,14 +2643,14 @@ const getTranspileCssConfig = (compileOpts, importData, results) => {
2643
2643
  };
2644
2644
  const getTranspileConfigOpt = (value, validValues, defaultValue) => {
2645
2645
  if (value === null || value === "null") return null;
2646
- value = isString$1(value) ? value.toLowerCase().trim() : null;
2646
+ value = isString$1(value) ? value.toLowerCase().trim() : void 0;
2647
2647
  if (validValues.has(value)) return value;
2648
2648
  return defaultValue;
2649
2649
  };
2650
2650
  const VALID_EXPORT = /* @__PURE__ */ new Set(["customelement", "module"]);
2651
- const VALID_METADATA = /* @__PURE__ */ new Set(["compilerstatic", null]);
2651
+ const VALID_METADATA = /* @__PURE__ */ new Set(["compilerstatic"]);
2652
2652
  const VALID_MODULE = /* @__PURE__ */ new Set(["cjs", "esm"]);
2653
- const VALID_PROXY = /* @__PURE__ */ new Set(["defineproperty", null]);
2653
+ const VALID_PROXY = /* @__PURE__ */ new Set(["defineproperty"]);
2654
2654
  const VALID_STYLE = /* @__PURE__ */ new Set(["static"]);
2655
2655
  const VALID_STYLE_IMPORT_DATA = /* @__PURE__ */ new Set(["queryparams"]);
2656
2656
  const VALID_TARGET = /* @__PURE__ */ new Set([
@@ -2830,7 +2830,7 @@ const validateReadmeOutputTarget = (config, outputTarget) => {
2830
2830
  if (!isAbsolute(outputTarget.dir)) outputTarget.dir = join$1(config.rootDir, outputTarget.dir);
2831
2831
  if (outputTarget.footer == null) outputTarget.footer = NOTE;
2832
2832
  outputTarget.strict = !!outputTarget.strict;
2833
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2833
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2834
2834
  return outputTarget;
2835
2835
  };
2836
2836
  const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -2842,7 +2842,7 @@ const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
2842
2842
  if (isString$1(outputTarget.typesFile) && !isAbsolute(outputTarget.typesFile)) outputTarget.typesFile = join$1(config.rootDir, outputTarget.typesFile);
2843
2843
  else if (outputTarget.typesFile !== null && outputTarget.file.endsWith(".json")) outputTarget.typesFile = outputTarget.file.replace(/\.json$/, ".d.ts");
2844
2844
  outputTarget.strict = !!outputTarget.strict;
2845
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2845
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2846
2846
  return outputTarget;
2847
2847
  };
2848
2848
  const validateCustomDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -2851,7 +2851,7 @@ const validateCustomDocsOutputTarget = (config, diagnostics, outputTarget) => {
2851
2851
  err.messageText = `docs-custom outputTarget missing the "generator" function`;
2852
2852
  }
2853
2853
  outputTarget.strict = !!outputTarget.strict;
2854
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2854
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2855
2855
  return outputTarget;
2856
2856
  };
2857
2857
  const validateVScodeDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -2859,21 +2859,22 @@ const validateVScodeDocsOutputTarget = (config, diagnostics, outputTarget) => {
2859
2859
  const err = buildError(diagnostics);
2860
2860
  err.messageText = `docs-vscode outputTarget missing the "file" path`;
2861
2861
  }
2862
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2862
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2863
2863
  return outputTarget;
2864
2864
  };
2865
2865
  const DEFAULT_AGENT_SKILL_DIR = "dist/skill";
2866
2866
  const validateAgentSkillOutputTarget = (config, outputTarget) => {
2867
2867
  outputTarget.dir = getAbsolutePath(config, outputTarget.dir || DEFAULT_AGENT_SKILL_DIR);
2868
2868
  outputTarget.name = toSkillName(outputTarget.name || config.fsNamespace);
2869
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2869
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2870
2870
  return outputTarget;
2871
2871
  };
2872
+ const DEFAULT_CUSTOM_ELEMENTS_MANIFEST_FILE = "dist/custom-elements.json";
2872
2873
  const validateCustomElementsManifestOutputTarget = (config, outputTarget) => {
2873
- if (!isString$1(outputTarget.file)) outputTarget.file = "custom-elements.json";
2874
+ if (!isString$1(outputTarget.file)) outputTarget.file = DEFAULT_CUSTOM_ELEMENTS_MANIFEST_FILE;
2874
2875
  if (!isAbsolute(outputTarget.file)) outputTarget.file = join$1(config.rootDir, outputTarget.file);
2875
2876
  outputTarget.strict = !!outputTarget.strict;
2876
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
2877
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
2877
2878
  return outputTarget;
2878
2879
  };
2879
2880
  //#endregion
@@ -1,4 +1,4 @@
1
- import { $ as CompilerFsStats, $n as WorkerMainController, $t as OutputTargetBuild, A as BuildOverrides, An as ResolveModuleIdResults, At as HotModuleReplacement, B as CompilerEventBuildLog, Bn as SsrFactoryOptions, Bt as Logger, C as BuildEmitEvents, Cn as PluginTransformResults, Cr as JsonDocsStyle, Ct as DevServerEditor, D as BuildOnEventRemove, Dn as PrerenderResults, Dr as JsonDocsValue, Dt as HistoryApiFallback, E as BuildNoChangeResults, En as PrerenderOptions, Er as JsonDocsUsage, Et as FsWatchResults, F as Compiler, Fn as SerializeDocumentOptions, Ft as LazyRequire, G as CompilerEventFileAdd, Gn as TransformOptions, Gt as OptimizeCssInput, H as CompilerEventBuildStart, Hn as StencilDevServerConfig, Ht as LoggerTimeSpan, I as CompilerBuildResults, In as ServiceWorkerConfig, It as LightDomPatches, J as CompilerEventFsChange, Jn as TranspileResults, Jt as OptimizeJsOutput, K as CompilerEventFileDelete, Kn as TranspileOnlyResults, Kt as OptimizeCssOutput, L as CompilerBuildStart, Ln as SitemapXmpOpts, Lt as LoadConfigInit, M as CliInitOptions, Mn as RobotsTxtOpts, Mt as HydrateFactoryOptions, N as CompileScriptMinifyOptions, Nn as RobotsTxtResults, Nt as HydratedFlag, O as BuildOnEvents, On as PrerenderStartOptions, Or as StyleDoc, Ot as HmrGlobalStyleUpdate, P as CompileTarget, Pn as RolldownConfig, Pt as LOG_LEVELS, Q as CompilerFileWatcherEvent, Qn as WatcherCloseResults, Qt as OutputTargetBaseNext, R as CompilerDependency, Rn as SitemapXmpResults, Rt as LoadConfigResults, S as AutoprefixerOptions, Sn as PluginCtx, Sr as JsonDocsSlot, St as DevServerConfig, T as BuildLog, Tn as PrerenderHydrateOptions, Tr as JsonDocsTypeLibrary, Tt as DocsReadmeCustomColumn, U as CompilerEventDirAdd, Un as StencilDocsConfig, Ut as ModeConfig, V as CompilerEventBuildNoChange, Vn as StencilConfig, Vt as LoggerLineUpdater, W as CompilerEventDirDelete, Wn as SystemDetails, Wt as NodeResolveConfig, X as CompilerFileWatcher, Xn as ValidatedConfig, Xt as OutputTargetAssets, Y as CompilerEventName, Yn as UnvalidatedConfig, Yt as OutputTarget, Z as CompilerFileWatcherCallback, Zn as ValidatedOutputTargetWww, Zt as OutputTargetBase, _ as PrintLine, _n as OutputTargetWww, _r as JsonDocsListener, _t as CopyTask, a as ComponentCompilerEvent, an as OutputTargetDocsCustom, at as CompilerSystemRealpathResults, b as SsrResults, bn as PlatformPath, br as JsonDocsPart, bt as CustomElementsExportBehaviorOptions, c as ComponentCompilerMethod, cn as OutputTargetDocsReadme, ct as CompilerSystemRemoveFileResults, d as ComponentCompilerTypeReferences, dn as OutputTargetLoaderBundle, dr as JsonDocMethodParameter, dt as CompilerSystemWriteFileResults, en as OutputTargetCollection, er as WorkerOptions, et as CompilerRequest, f as ComponentGlobalStyle, fn as OutputTargetSsr, fr as JsonDocs, ft as CompilerWatcher, g as PrerenderUrlResults, gn as OutputTargetTypes, gr as JsonDocsEvent, gt as CopyResults, h as PackageJsonData, hn as OutputTargetStats, hr as JsonDocsDependencyGraph, ht as ConfigCompat, i as CompilerWorkerContext, in as OutputTargetDocsAgentSkill, it as CompilerSystemCreateDirectoryResults, j as BuildResultsComponentGraph, jn as ResolveModuleOptions, jt as HydrateDocumentOptions, k as BuildOutput, kn as ResolveModuleIdOptions, kr as FsWriteResults, kt as HmrStyleUpdate, l as ComponentCompilerProperty, ln as OutputTargetDocsVscode, lr as UserBuildConditionals, lt as CompilerSystemRenameResults, m as LazyBundlesRuntimeData, mn as OutputTargetStandalone, mr as JsonDocsCustomState, mt as ConfigBundle, nn as OutputTargetCustom, nt as CompilerSystem, o as ComponentCompilerListener, on as OutputTargetDocsCustomElementsManifest, ot as CompilerSystemRemoveDirectoryOptions, pn as OutputTargetSsrWasm, pr as JsonDocsComponent, pt as Config, q as CompilerEventFileUpdate, qn as TranspileOptions, qt as OptimizeJsInput, r as CompilerCtx, rn as OutputTargetDistLazy, rt as CompilerSystemCreateDirectoryOptions, s as ComponentCompilerMeta, sn as OutputTargetDocsJson, st as CompilerSystemRemoveDirectoryResults, t as BuildCtx, tn as OutputTargetCopy, tt as CompilerRequestResponse, u as ComponentCompilerState, un as OutputTargetGlobalStyle, ut as CompilerSystemRenamedPath, vn as PageReloadStrategy, vr as JsonDocsMethod, vt as Credentials, w as BuildEvents, wn as PrerenderConfig, wr as JsonDocsTag, wt as Diagnostic, x as WorkerMsgHandler, xn as Plugin, xr as JsonDocsProp, xt as DevServer, yn as ParsedPath, yr as JsonDocsMethodReturn, yt as CustomElementsExportBehavior, z as CompilerEventBuildFinish, zn as SsrDocumentOptions, zt as LogLevel } from "../index-B9-Byy8z.mjs";
1
+ import { $ as CompilerFsStats, $n as WorkerMainController, $t as OutputTargetBuild, A as BuildOverrides, An as ResolveModuleIdResults, At as HotModuleReplacement, B as CompilerEventBuildLog, Bn as SsrFactoryOptions, Bt as Logger, C as BuildEmitEvents, Cn as PluginTransformResults, Cr as JsonDocsStyle, Ct as DevServerEditor, D as BuildOnEventRemove, Dn as PrerenderResults, Dr as JsonDocsValue, Dt as HistoryApiFallback, E as BuildNoChangeResults, En as PrerenderOptions, Er as JsonDocsUsage, Et as FsWatchResults, F as Compiler, Fn as SerializeDocumentOptions, Ft as LazyRequire, G as CompilerEventFileAdd, Gn as TransformOptions, Gt as OptimizeCssInput, H as CompilerEventBuildStart, Hn as StencilDevServerConfig, Ht as LoggerTimeSpan, I as CompilerBuildResults, In as ServiceWorkerConfig, It as LightDomPatches, J as CompilerEventFsChange, Jn as TranspileResults, Jt as OptimizeJsOutput, K as CompilerEventFileDelete, Kn as TranspileOnlyResults, Kt as OptimizeCssOutput, L as CompilerBuildStart, Ln as SitemapXmpOpts, Lt as LoadConfigInit, M as CliInitOptions, Mn as RobotsTxtOpts, Mt as HydrateFactoryOptions, N as CompileScriptMinifyOptions, Nn as RobotsTxtResults, Nt as HydratedFlag, O as BuildOnEvents, On as PrerenderStartOptions, Or as StyleDoc, Ot as HmrGlobalStyleUpdate, P as CompileTarget, Pn as RolldownConfig, Pt as LOG_LEVELS, Q as CompilerFileWatcherEvent, Qn as WatcherCloseResults, Qt as OutputTargetBaseNext, R as CompilerDependency, Rn as SitemapXmpResults, Rt as LoadConfigResults, S as AutoprefixerOptions, Sn as PluginCtx, Sr as JsonDocsSlot, St as DevServerConfig, T as BuildLog, Tn as PrerenderHydrateOptions, Tr as JsonDocsTypeLibrary, Tt as DocsReadmeCustomColumn, U as CompilerEventDirAdd, Un as StencilDocsConfig, Ut as ModeConfig, V as CompilerEventBuildNoChange, Vn as StencilConfig, Vt as LoggerLineUpdater, W as CompilerEventDirDelete, Wn as SystemDetails, Wt as NodeResolveConfig, X as CompilerFileWatcher, Xn as ValidatedConfig, Xt as OutputTargetAssets, Y as CompilerEventName, Yn as UnvalidatedConfig, Yt as OutputTarget, Z as CompilerFileWatcherCallback, Zn as ValidatedOutputTargetWww, Zt as OutputTargetBase, _ as PrintLine, _n as OutputTargetWww, _r as JsonDocsListener, _t as CopyTask, a as ComponentCompilerEvent, an as OutputTargetDocsCustom, at as CompilerSystemRealpathResults, b as SsrResults, bn as PlatformPath, br as JsonDocsPart, bt as CustomElementsExportBehaviorOptions, c as ComponentCompilerMethod, cn as OutputTargetDocsReadme, ct as CompilerSystemRemoveFileResults, d as ComponentCompilerTypeReferences, dn as OutputTargetLoaderBundle, dr as JsonDocMethodParameter, dt as CompilerSystemWriteFileResults, en as OutputTargetCollection, er as WorkerOptions, et as CompilerRequest, f as ComponentGlobalStyle, fn as OutputTargetSsr, fr as JsonDocs, ft as CompilerWatcher, g as PrerenderUrlResults, gn as OutputTargetTypes, gr as JsonDocsEvent, gt as CopyResults, h as PackageJsonData, hn as OutputTargetStats, hr as JsonDocsDependencyGraph, ht as ConfigCompat, i as CompilerWorkerContext, in as OutputTargetDocsAgentSkill, it as CompilerSystemCreateDirectoryResults, j as BuildResultsComponentGraph, jn as ResolveModuleOptions, jt as HydrateDocumentOptions, k as BuildOutput, kn as ResolveModuleIdOptions, kr as FsWriteResults, kt as HmrStyleUpdate, l as ComponentCompilerProperty, ln as OutputTargetDocsVscode, lr as UserBuildConditionals, lt as CompilerSystemRenameResults, m as LazyBundlesRuntimeData, mn as OutputTargetStandalone, mr as JsonDocsCustomState, mt as ConfigBundle, nn as OutputTargetCustom, nt as CompilerSystem, o as ComponentCompilerListener, on as OutputTargetDocsCustomElementsManifest, ot as CompilerSystemRemoveDirectoryOptions, pn as OutputTargetSsrWasm, pr as JsonDocsComponent, pt as Config, q as CompilerEventFileUpdate, qn as TranspileOptions, qt as OptimizeJsInput, r as CompilerCtx, rn as OutputTargetDistLazy, rt as CompilerSystemCreateDirectoryOptions, s as ComponentCompilerMeta, sn as OutputTargetDocsJson, st as CompilerSystemRemoveDirectoryResults, t as BuildCtx, tn as OutputTargetCopy, tt as CompilerRequestResponse, u as ComponentCompilerState, un as OutputTargetGlobalStyle, ut as CompilerSystemRenamedPath, vn as PageReloadStrategy, vr as JsonDocsMethod, vt as Credentials, w as BuildEvents, wn as PrerenderConfig, wr as JsonDocsTag, wt as Diagnostic, x as WorkerMsgHandler, xn as Plugin, xr as JsonDocsProp, xt as DevServer, yn as ParsedPath, yr as JsonDocsMethodReturn, yt as CustomElementsExportBehavior, z as CompilerEventBuildFinish, zn as SsrDocumentOptions, zt as LogLevel } from "../index-C41EOWaQ.mjs";
2
2
  import ts from "typescript";
3
3
  import { Plugin as Plugin$1 } from "rolldown";
4
4
  //#region src/version.d.ts
@@ -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-ApS_Tn_4.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-B7K47DPN.mjs";
2
2
  import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-Bz2SOK7_.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 };
@@ -1,4 +1,4 @@
1
- import { $i as CUSTOM, $r as filterActiveTargets, Ai as buildWarn, Ar as ModeValidationError, Bi as loadTypeScriptDiagnostics, Br as isJsFile, Ca as TYPES, Ci as isOutputTargetWww, Da as XLINK_NS, Di as TASK_CANCELED_MSG, Ea as WWW, Ei as shouldExcludeComponent, Fi as escapeHtml, Fr as createJsVarName, Gi as formatLazyBundleRuntimeMeta, Gr as readOnlyArrayHasStringMember, Hi as isRolldownError, Hr as isTsFile, Ii as normalizeDiagnostics, Ir as generatePreamble, Ji as CMP_FLAGS, Jr as getSourceMappingUrlForEndOfFile, Ki as stringifyRuntimeData, Kr as readPackageJson, Li as splitLineBreaks, Lr as getTextDocs, Mi as hasError, Mr as validateComponentTag, Ni as hasWarning, Nr as ParsePackageJsonResult, Oi as buildError, Pi as shouldIgnoreError, Pr as addDocBlock, Qi as COPY, Qr as FilterComponentsResult, Ri as augmentDiagnosticWithNode, Rr as hasDependency, Sa as SVG_NS, Si as isOutputTargetTypes, Ta as WATCH_FLAGS, Ti as relativeImport, Ui as loadRolldownDiagnostics, Ur as isTsxFile, Vi as createOnWarnFn, Vr as isJsxFile, Wi as formatComponentRuntimeMeta, Wr as parsePackageJson, Xi as COLLECTION_APP_DATA_FILE_NAME, Xr as rolldownToStencilSourceMap, Yi as COLLECTION, Yr as getSourceMappingUrlLinker, Zi as COLLECTION_MANIFEST_FILE_NAME, Zr as result_d_exports, _a as SSR, _i as isOutputTargetLoaderBundle, aa as DOCS_JSON, ai as isOutputTargetCollection, ba as STATS, bi as isOutputTargetStandalone, ca as EVENT_FLAGS, ci as isOutputTargetDistLazy, da as HOST_FLAGS, di as isOutputTargetDocsCustom, ea as DEFAULT_STYLE_MODE, ei as filterExcludedComponents, fa as HTML_NS, fi as isOutputTargetDocsCustomElementsManifest, ga as NODE_TYPES, gi as isOutputTargetGlobalStyle, ha as MEMBER_FLAGS, hi as isOutputTargetDocsVscode, ia as DOCS_CUSTOM_ELEMENTS_MANIFEST, ii as isOutputTargetAssets, ji as catchError, jr as validateComponentModes, ki as buildJsonFileError, la as GENERATED_DTS, li as isOutputTargetDocs, ma as LOADER_BUNDLE, mi as isOutputTargetDocsReadme, na as DOCS_AGENT_SKILL, ni as getComponentsDtsTypesFilePath, oa as DOCS_README, oi as isOutputTargetCopy, pa as LISTENER_FLAGS, pi as isOutputTargetDocsJson, qi as ASSETS, qr as getInlineSourceMappingUrlLinker, ra as DOCS_CUSTOM, ri as getComponentsFromModules, sa as DOCS_VSCODE, si as isOutputTargetCustom, ta as DIST_LAZY, ti as getComponentsDtsSrcFilePath, ua as GLOBAL_STYLE, ui as isOutputTargetDocsAgentSkill, va as SSR_WASM, vi as isOutputTargetSsr, wa as VALID_CONFIG_OUTPUT_TARGETS, wi as isValidConfigOutputTarget, xa as STYLE_EXT, xi as isOutputTargetStats, ya as STANDALONE, yi as isOutputTargetSsrWasm, zi as loadTypeScriptDiagnostic, zr as isDtsFile } from "../../index-B9-Byy8z.mjs";
1
+ import { $i as CUSTOM, $r as filterActiveTargets, Ai as buildWarn, Ar as ModeValidationError, Bi as loadTypeScriptDiagnostics, Br as isJsFile, Ca as TYPES, Ci as isOutputTargetWww, Da as XLINK_NS, Di as TASK_CANCELED_MSG, Ea as WWW, Ei as shouldExcludeComponent, Fi as escapeHtml, Fr as createJsVarName, Gi as formatLazyBundleRuntimeMeta, Gr as readOnlyArrayHasStringMember, Hi as isRolldownError, Hr as isTsFile, Ii as normalizeDiagnostics, Ir as generatePreamble, Ji as CMP_FLAGS, Jr as getSourceMappingUrlForEndOfFile, Ki as stringifyRuntimeData, Kr as readPackageJson, Li as splitLineBreaks, Lr as getTextDocs, Mi as hasError, Mr as validateComponentTag, Ni as hasWarning, Nr as ParsePackageJsonResult, Oi as buildError, Pi as shouldIgnoreError, Pr as addDocBlock, Qi as COPY, Qr as FilterComponentsResult, Ri as augmentDiagnosticWithNode, Rr as hasDependency, Sa as SVG_NS, Si as isOutputTargetTypes, Ta as WATCH_FLAGS, Ti as relativeImport, Ui as loadRolldownDiagnostics, Ur as isTsxFile, Vi as createOnWarnFn, Vr as isJsxFile, Wi as formatComponentRuntimeMeta, Wr as parsePackageJson, Xi as COLLECTION_APP_DATA_FILE_NAME, Xr as rolldownToStencilSourceMap, Yi as COLLECTION, Yr as getSourceMappingUrlLinker, Zi as COLLECTION_MANIFEST_FILE_NAME, Zr as result_d_exports, _a as SSR, _i as isOutputTargetLoaderBundle, aa as DOCS_JSON, ai as isOutputTargetCollection, ba as STATS, bi as isOutputTargetStandalone, ca as EVENT_FLAGS, ci as isOutputTargetDistLazy, da as HOST_FLAGS, di as isOutputTargetDocsCustom, ea as DEFAULT_STYLE_MODE, ei as filterExcludedComponents, fa as HTML_NS, fi as isOutputTargetDocsCustomElementsManifest, ga as NODE_TYPES, gi as isOutputTargetGlobalStyle, ha as MEMBER_FLAGS, hi as isOutputTargetDocsVscode, ia as DOCS_CUSTOM_ELEMENTS_MANIFEST, ii as isOutputTargetAssets, ji as catchError, jr as validateComponentModes, ki as buildJsonFileError, la as GENERATED_DTS, li as isOutputTargetDocs, ma as LOADER_BUNDLE, mi as isOutputTargetDocsReadme, na as DOCS_AGENT_SKILL, ni as getComponentsDtsTypesFilePath, oa as DOCS_README, oi as isOutputTargetCopy, pa as LISTENER_FLAGS, pi as isOutputTargetDocsJson, qi as ASSETS, qr as getInlineSourceMappingUrlLinker, ra as DOCS_CUSTOM, ri as getComponentsFromModules, sa as DOCS_VSCODE, si as isOutputTargetCustom, ta as DIST_LAZY, ti as getComponentsDtsSrcFilePath, ua as GLOBAL_STYLE, ui as isOutputTargetDocsAgentSkill, va as SSR_WASM, vi as isOutputTargetSsr, wa as VALID_CONFIG_OUTPUT_TARGETS, wi as isValidConfigOutputTarget, xa as STYLE_EXT, xi as isOutputTargetStats, ya as STANDALONE, yi as isOutputTargetSsrWasm, zi as loadTypeScriptDiagnostic, zr as isDtsFile } from "../../index-C41EOWaQ.mjs";
2
2
  //#region src/utils/byte-size.d.ts
3
3
  /**
4
4
  * Used to learn the size of a string in bytes.
@@ -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.21";
465
- const buildId = "1791840744";
466
- const vermoji = "🍎";
464
+ const version = "5.0.0-beta.23";
465
+ const buildId = "1791932475";
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.
@@ -5179,6 +5179,86 @@ const getScopeId = (tagName, mode) => {
5179
5179
  return "sc-" + tagName + (mode && mode !== "$" ? "-" + mode : "");
5180
5180
  };
5181
5181
  //#endregion
5182
+ //#region src/compiler/style/transform-stylesheet.ts
5183
+ /**
5184
+ * Run a stylesheet through the plugin (e.g. Sass) and CSS-to-ESM transforms, memoized in
5185
+ * `compilerCtx.cssTransformCache` so every consumer of the same stylesheet shares one computation.
5186
+ *
5187
+ * @param config a user-supplied configuration
5188
+ * @param compilerCtx the current compiler context
5189
+ * @param buildCtx the current build context
5190
+ * @param id the stylesheet's path, annotated with its import data as query params - the cache key
5191
+ * @param data the import data serialized into `id`
5192
+ * @returns the cache entry, or `null` if the stylesheet could not be read
5193
+ */
5194
+ const transformStylesheet = async (config, compilerCtx, buildCtx, id, data) => {
5195
+ if (compilerCtx.cssTransformCache.has(id)) return compilerCtx.cssTransformCache.get(id) ?? null;
5196
+ if (!compilerCtx.worker) return null;
5197
+ const filePath = normalizeFsPath(id);
5198
+ const code = await compilerCtx.fs.readFile(filePath);
5199
+ if (typeof code !== "string") {
5200
+ compilerCtx.cssTransformCache.set(id, null);
5201
+ return null;
5202
+ }
5203
+ const pluginTransforms = await runPluginTransformsEsmImports(config, compilerCtx, buildCtx, code, filePath);
5204
+ const cssInput = data.tag ? pluginTransforms.code : inlineRelativeCssUrlAssets(pluginTransforms.code, filePath);
5205
+ const cssTransformOutput = await compilerCtx.worker.transformCssToEsm({
5206
+ file: pluginTransforms.id,
5207
+ input: cssInput,
5208
+ tag: data.tag,
5209
+ tags: buildCtx.components.map((c) => c.tagName),
5210
+ addTagTransformers: !!buildCtx.config.compat.additionalTagTransformers,
5211
+ encapsulation: data.encapsulation,
5212
+ mode: data.mode,
5213
+ sourceMap: config.sourceMap,
5214
+ minify: config.minifyCss,
5215
+ autoprefixer: config.autoprefixCss,
5216
+ docs: config.outputTargets.some(isOutputTargetDocs)
5217
+ });
5218
+ const entry = {
5219
+ pluginTransformId: pluginTransforms.id,
5220
+ pluginTransformCode: pluginTransforms.code,
5221
+ pluginTransformDependencies: pluginTransforms.dependencies,
5222
+ pluginTransformDiagnostics: pluginTransforms.diagnostics,
5223
+ cssTransformOutput
5224
+ };
5225
+ compilerCtx.cssTransformCache.set(id, entry);
5226
+ return entry;
5227
+ };
5228
+ /**
5229
+ * 3rd-party stylesheets with relative `url(./font.ttf)` (font-face `src`, a background-image, ...)
5230
+ * have nowhere to resolve that path once this CSS is self-injected as a CSSStyleSheet:
5231
+ * there's no bundler output location for it to be relative *to*.
5232
+ * Inlining the referenced file as a `data:` URI sidesteps needing one - no separate asset
5233
+ * to serve, works the same regardless of how/where the final bundle is deployed.
5234
+ */
5235
+ const CSS_URL_RE = /url\(\s*(['"]?)([^'"()]+)\1\s*\)/g;
5236
+ const CSS_URL_ASSET_MIME_TYPES = {
5237
+ ttf: "font/ttf",
5238
+ otf: "font/otf",
5239
+ woff: "font/woff",
5240
+ woff2: "font/woff2",
5241
+ eot: "application/vnd.ms-fontobject",
5242
+ png: "image/png",
5243
+ jpg: "image/jpeg",
5244
+ jpeg: "image/jpeg",
5245
+ gif: "image/gif",
5246
+ svg: "image/svg+xml"
5247
+ };
5248
+ const inlineRelativeCssUrlAssets = (cssText, cssFilePath) => cssText.replace(CSS_URL_RE, (original, _quote, url) => {
5249
+ if (/^(data:|[a-z][a-z0-9+.-]*:|\/\/|\/)/i.test(url)) return original;
5250
+ const cleanUrl = url.split(/[?#]/)[0];
5251
+ const ext = cleanUrl.split(".").pop()?.toLowerCase();
5252
+ const mimeType = ext && CSS_URL_ASSET_MIME_TYPES[ext];
5253
+ if (!mimeType) return original;
5254
+ try {
5255
+ const assetPath = resolve(dirname(cssFilePath), cleanUrl);
5256
+ return `url("data:${mimeType};base64,${readFileSync(assetPath).toString("base64")}")`;
5257
+ } catch {
5258
+ return original;
5259
+ }
5260
+ });
5261
+ //#endregion
5182
5262
  //#region src/compiler/transformers/stencil-import-path.ts
5183
5263
  /**
5184
5264
  * Serialize data about a style import to an annotated path, where
@@ -5298,35 +5378,7 @@ const extTransformsPlugin = (config, compilerCtx, buildCtx) => {
5298
5378
  if (data != null) {
5299
5379
  const filePath = normalizeFsPath(id);
5300
5380
  const wasCached = compilerCtx.cssTransformCache.has(id);
5301
- if (!wasCached) {
5302
- const code = await compilerCtx.fs.readFile(filePath);
5303
- if (typeof code !== "string") compilerCtx.cssTransformCache.set(id, null);
5304
- else {
5305
- const pluginTransforms = await runPluginTransformsEsmImports(config, compilerCtx, buildCtx, code, filePath);
5306
- const cssInput = data.tag ? pluginTransforms.code : inlineRelativeCssUrlAssets(pluginTransforms.code, filePath);
5307
- const cssTransformResults = await compilerCtx.worker.transformCssToEsm({
5308
- file: pluginTransforms.id,
5309
- input: cssInput,
5310
- tag: data.tag,
5311
- tags: buildCtx.components.map((c) => c.tagName),
5312
- addTagTransformers: !!buildCtx.config.compat.additionalTagTransformers,
5313
- encapsulation: data.encapsulation,
5314
- mode: data.mode,
5315
- sourceMap: config.sourceMap,
5316
- minify: config.minifyCss,
5317
- autoprefixer: config.autoprefixCss,
5318
- docs: config.outputTargets.some(isOutputTargetDocs)
5319
- });
5320
- compilerCtx.cssTransformCache.set(id, {
5321
- pluginTransformId: pluginTransforms.id,
5322
- pluginTransformCode: pluginTransforms.code,
5323
- pluginTransformDependencies: pluginTransforms.dependencies,
5324
- pluginTransformDiagnostics: pluginTransforms.diagnostics,
5325
- cssTransformOutput: cssTransformResults
5326
- });
5327
- }
5328
- }
5329
- const cacheEntry = compilerCtx.cssTransformCache.get(id);
5381
+ const cacheEntry = await transformStylesheet(config, compilerCtx, buildCtx, id, data);
5330
5382
  if (wasCached) cacheHits++;
5331
5383
  if (cacheEntry == null) return null;
5332
5384
  /**
@@ -5401,39 +5453,6 @@ const extTransformsPlugin = (config, compilerCtx, buildCtx) => {
5401
5453
  }
5402
5454
  };
5403
5455
  };
5404
- /**
5405
- * 3rd-party stylesheets with relative `url(./font.ttf)` (font-face `src`, a background-image, ...)
5406
- * have nowhere to resolve that path once this CSS is self-injected as a CSSStyleSheet:
5407
- * there's no bundler output location for it to be relative *to*.
5408
- * Inlining the referenced file as a `data:` URI sidesteps needing one - no separate asset
5409
- * to serve, works the same regardless of how/where the final bundle is deployed.
5410
- */
5411
- const CSS_URL_RE = /url\(\s*(['"]?)([^'"()]+)\1\s*\)/g;
5412
- const CSS_URL_ASSET_MIME_TYPES = {
5413
- ttf: "font/ttf",
5414
- otf: "font/otf",
5415
- woff: "font/woff",
5416
- woff2: "font/woff2",
5417
- eot: "application/vnd.ms-fontobject",
5418
- png: "image/png",
5419
- jpg: "image/jpeg",
5420
- jpeg: "image/jpeg",
5421
- gif: "image/gif",
5422
- svg: "image/svg+xml"
5423
- };
5424
- const inlineRelativeCssUrlAssets = (cssText, cssFilePath) => cssText.replace(CSS_URL_RE, (original, _quote, url) => {
5425
- if (/^(data:|[a-z][a-z0-9+.-]*:|\/\/|\/)/i.test(url)) return original;
5426
- const cleanUrl = url.split(/[?#]/)[0];
5427
- const ext = cleanUrl.split(".").pop()?.toLowerCase();
5428
- const mimeType = ext && CSS_URL_ASSET_MIME_TYPES[ext];
5429
- if (!mimeType) return original;
5430
- try {
5431
- const assetPath = resolve(dirname(cssFilePath), cleanUrl);
5432
- return `url("data:${mimeType};base64,${readFileSync(assetPath).toString("base64")}")`;
5433
- } catch {
5434
- return original;
5435
- }
5436
- });
5437
5456
  //#endregion
5438
5457
  //#region src/compiler/bundle/file-load-plugin.ts
5439
5458
  const RESOLVE_EXTENSIONS = [
@@ -9766,22 +9785,63 @@ const generateAgentSkillDocs = async (compilerCtx, docsData, outputTargets) => {
9766
9785
  }));
9767
9786
  };
9768
9787
  //#endregion
9788
+ //#region src/compiler/build/update-package-json.ts
9789
+ const isJsonObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
9790
+ /**
9791
+ * Apply an update to the project's `package.json`, keeping its indentation, line endings
9792
+ * and key order. Nothing is written if there's no `package.json` or the update changes nothing.
9793
+ *
9794
+ * @param config The validated Stencil config
9795
+ * @param compilerCtx The compiler context
9796
+ * @param update Mutates the parsed `package.json`
9797
+ * @param immediateWrite Write straight to disk instead of queuing the write for the next commit
9798
+ */
9799
+ const updatePackageJson = async (config, compilerCtx, update, immediateWrite = false) => {
9800
+ const source = await readPackageJsonSource(config, compilerCtx);
9801
+ const pkg = source ? parsePackageJson(source, config.packageJsonFilePath).data : null;
9802
+ if (!source || !isJsonObject(pkg)) return;
9803
+ const before = JSON.stringify(pkg);
9804
+ update(pkg);
9805
+ if (JSON.stringify(pkg) === before) return;
9806
+ const eol = source.includes("\r\n") ? "\r\n" : "\n";
9807
+ const indent = /^([ \t]+)"/m.exec(source)?.[1] ?? 2;
9808
+ let output = JSON.stringify(pkg, null, indent);
9809
+ if (/\n\s*$/.test(source)) output += "\n";
9810
+ output = output.replace(/\n/g, eol);
9811
+ await compilerCtx.fs.writeFile(config.packageJsonFilePath, output, { immediateWrite });
9812
+ };
9813
+ const readPackageJsonSource = async (config, compilerCtx) => {
9814
+ try {
9815
+ return await compilerCtx.fs.readFile(config.packageJsonFilePath);
9816
+ } catch {
9817
+ return;
9818
+ }
9819
+ };
9820
+ //#endregion
9769
9821
  //#region src/compiler/docs/cem/index.ts
9770
9822
  /**
9771
9823
  * Generate Custom Elements Manifest (custom-elements.json) output
9772
9824
  * conforming to the Custom Elements Manifest specification.
9773
9825
  * @see https://github.com/webcomponents/custom-elements-manifest
9774
9826
  *
9827
+ * The `customElements` field of the project's `package.json` is pointed at the manifest
9828
+ * (the first one, if several are configured), which is how tooling locates it.
9829
+ *
9830
+ * @param config the Stencil configuration associated with the project
9775
9831
  * @param compilerCtx the current compiler context
9776
9832
  * @param docsData the generated docs data from Stencil components
9777
9833
  * @param outputTargets the output targets configured for the build
9778
9834
  */
9779
- const generateCustomElementsManifestDocs = async (compilerCtx, docsData, outputTargets) => {
9835
+ const generateCustomElementsManifestDocs = async (config, compilerCtx, docsData, outputTargets) => {
9780
9836
  const cemOutputTargets = outputTargets.filter(isOutputTargetDocsCustomElementsManifest);
9781
9837
  if (cemOutputTargets.length === 0) return;
9782
9838
  const manifest = generateManifest(docsData);
9783
9839
  const jsonContent = JSON.stringify(manifest, null, 2) + "\n";
9784
9840
  await Promise.all(cemOutputTargets.map((outputTarget) => compilerCtx.fs.writeFile(outputTarget.file, jsonContent)));
9841
+ const manifestPath = normalizePath(relative$1(config.rootDir, cemOutputTargets[0].file), false);
9842
+ if (!manifestPath.startsWith("../")) await updatePackageJson(config, compilerCtx, (pkg) => {
9843
+ pkg.customElements = manifestPath;
9844
+ });
9785
9845
  };
9786
9846
  /**
9787
9847
  * Generate the Custom Elements Manifest from Stencil docs data
@@ -9955,6 +10015,46 @@ const componentToDeclaration = (component) => {
9955
10015
  };
9956
10016
  };
9957
10017
  //#endregion
10018
+ //#region src/compiler/docs/collect-style-docs.ts
10019
+ /**
10020
+ * Populate `styleDocs` for every component from its external stylesheets. Stylesheets a bundler
10021
+ * has already transformed are read from `compilerCtx.cssTransformCache`; the rest are transformed
10022
+ * here, so style docs don't depend on a bundling output target having run.
10023
+ *
10024
+ * @param config the configuration associated with the current Stencil task run
10025
+ * @param compilerCtx the current compiler context
10026
+ * @param buildCtx the build context for the current Stencil task run
10027
+ */
10028
+ const collectStyleDocs = async (config, compilerCtx, buildCtx) => {
10029
+ const cached = /* @__PURE__ */ new Map();
10030
+ for (const [id, entry] of compilerCtx.cssTransformCache) {
10031
+ const { data } = parseImportPath(id);
10032
+ if (entry && data?.tag) cached.set(cacheKey(id, data.tag, data.mode), entry);
10033
+ }
10034
+ const collect = async (cmp, mode, externalStyle) => {
10035
+ let entry = cached.get(cacheKey(externalStyle.absolutePath, cmp.tagName, mode)) ?? cached.get(cacheKey(externalStyle.originalComponentPath, cmp.tagName, mode));
10036
+ if (!entry) {
10037
+ const data = {
10038
+ tag: cmp.tagName,
10039
+ mode,
10040
+ encapsulation: cmp.encapsulation
10041
+ };
10042
+ const id = `${externalStyle.absolutePath}?${new URLSearchParams(data)}`;
10043
+ const transformed = await transformStylesheet(config, compilerCtx, buildCtx, id, data);
10044
+ if (!transformed) return;
10045
+ entry = transformed;
10046
+ const diagnostics = [...entry.pluginTransformDiagnostics, ...entry.cssTransformOutput.diagnostics];
10047
+ buildCtx.diagnostics.push(...diagnostics);
10048
+ if (hasError(diagnostics)) compilerCtx.cssTransformCache.delete(id);
10049
+ for (const dep of entry.pluginTransformDependencies) compilerCtx.addWatchFile(dep);
10050
+ }
10051
+ cmp.styleDocs ||= [];
10052
+ mergeIntoWith(cmp.styleDocs, entry.cssTransformOutput.styleDocs, (docs) => `${docs.name},${docs.mode}`);
10053
+ };
10054
+ await Promise.all(buildCtx.components.filter((cmp) => !cmp.internal && !cmp.isCollectionDependency).flatMap((cmp) => (cmp.styles ?? []).flatMap((style) => (style.externalStyles ?? []).map((externalStyle) => collect(cmp, style.modeName, externalStyle)))));
10055
+ };
10056
+ const cacheKey = (path, tag, mode) => `${normalizeFsPath(path)}\n${tag}\n${mode}`;
10057
+ //#endregion
9958
10058
  //#region src/compiler/docs/custom/index.ts
9959
10059
  const generateCustomDocs = async (config, docsData, outputTargets) => {
9960
10060
  const customOutputTargets = outputTargets.filter(isOutputTargetDocsCustom);
@@ -10247,48 +10347,6 @@ const getDefaultReadme = (docsData) => {
10247
10347
  ""
10248
10348
  ].join("\n");
10249
10349
  };
10250
- /**
10251
- * Extract the existing CSS Custom Properties section from a README file.
10252
- * This is used to preserve CSS props documentation when running `stencil docs`
10253
- * without building styles.
10254
- *
10255
- * @param compilerCtx the current compiler context
10256
- * @param readmePath the path to the README file to read
10257
- * @returns array of CSS custom properties styles, or undefined if none found
10258
- */
10259
- const extractExistingCssProps = async (compilerCtx, readmePath) => {
10260
- try {
10261
- const cssPropsSectionMatch = (await compilerCtx.fs.readFile(readmePath)).match(/## CSS Custom Properties\s*\n\s*\n([\s\S]*?)(?=\n##|\n-{4,}|$)/);
10262
- if (!cssPropsSectionMatch) return;
10263
- const cssPropsSection = cssPropsSectionMatch[1];
10264
- const styles = [];
10265
- const lines = cssPropsSection.split("\n");
10266
- let inTable = false;
10267
- for (const line of lines) {
10268
- const trimmedLine = line.trim();
10269
- if (trimmedLine.startsWith("| Name") || trimmedLine.startsWith("| ---")) {
10270
- inTable = true;
10271
- continue;
10272
- }
10273
- if (inTable && trimmedLine.startsWith("|")) {
10274
- const parts = trimmedLine.split("|").map((p) => p.trim()).filter((p) => p);
10275
- if (parts.length >= 2) {
10276
- const name = parts[0].replace(/`/g, "").trim();
10277
- const docs = parts[1].trim();
10278
- if (name.startsWith("--")) styles.push({
10279
- name,
10280
- docs,
10281
- annotation: "prop",
10282
- mode: void 0
10283
- });
10284
- }
10285
- }
10286
- }
10287
- return styles.length > 0 ? styles : void 0;
10288
- } catch {
10289
- return;
10290
- }
10291
- };
10292
10350
  //#endregion
10293
10351
  //#region src/compiler/docs/readme/index.ts
10294
10352
  const generateReadmeDocs = async (config, compilerCtx, docsData, outputTargets) => {
@@ -10405,21 +10463,14 @@ const outputDocs = async (config, compilerCtx, buildCtx) => {
10405
10463
  const docsOutputTargets = filterActiveTargets(config.outputTargets.filter((o) => isOutputTargetDocsReadme(o) || isOutputTargetDocsJson(o) || isOutputTargetDocsCustom(o) || isOutputTargetDocsVscode(o) || isOutputTargetDocsCustomElementsManifest(o) || isOutputTargetDocsAgentSkill(o)), config.devMode);
10406
10464
  if (docsOutputTargets.length === 0) return;
10407
10465
  await buildCtx.stylesPromise;
10466
+ await collectStyleDocs(config, compilerCtx, buildCtx);
10408
10467
  const docsData = await generateDocData(config, compilerCtx, buildCtx);
10409
- if (config.outputTargets.every((target) => target.type === "docs-readme" || target.type === "docs-json" || target.type === "docs-custom" || target.type === "docs-vscode" || target.type === "docs-custom-elements-manifest" || target.type === "docs-agent-skill")) await Promise.all(docsData.components.map(async (component) => {
10410
- if (component.styles.length === 0) {
10411
- const readmeDir = docsOutputTargets.find(isOutputTargetDocsReadme)?.dir || config.srcDir;
10412
- const readmePath = normalizePath(readmeDir) === normalizePath(config.srcDir) ? component.readmePath : join$2(readmeDir, component.readmePath.replace(config.srcDir, ""));
10413
- const existingCssProps = await extractExistingCssProps(compilerCtx, readmePath);
10414
- if (existingCssProps) component.styles = existingCssProps;
10415
- }
10416
- }));
10417
10468
  await Promise.all([
10418
10469
  generateReadmeDocs(config, compilerCtx, docsData, docsOutputTargets),
10419
10470
  generateJsonDocs(config, compilerCtx, docsData, docsOutputTargets),
10420
10471
  generateVscodeDocs(compilerCtx, docsData, docsOutputTargets),
10421
10472
  generateCustomDocs(config, docsData, docsOutputTargets),
10422
- generateCustomElementsManifestDocs(compilerCtx, docsData, docsOutputTargets),
10473
+ generateCustomElementsManifestDocs(config, compilerCtx, docsData, docsOutputTargets),
10423
10474
  generateAgentSkillDocs(compilerCtx, docsData, docsOutputTargets)
10424
10475
  ]);
10425
10476
  };
@@ -19745,13 +19796,13 @@ const validateTypeField = (config, compilerCtx, buildCtx, recommendations) => {
19745
19796
  if (recommendations.moduleOptions.length > 0 && currentType !== "module") packageJsonWarn(config, compilerCtx, buildCtx, `package.json "type" property should be set to "module".`, "\"type\"");
19746
19797
  };
19747
19798
  /**
19748
- * Check if a rootDir-relative directory is covered by a package.json `files` array,
19799
+ * Check if a rootDir-relative directory or file is covered by a package.json `files` array,
19749
19800
  * either directly or via a parent directory entry (e.g. "dist/" covers "dist/types/").
19750
19801
  * @param files the package.json "files" array
19751
- * @param dir the rootDir-relative directory to check for
19802
+ * @param dir the rootDir-relative path to check for
19752
19803
  * @returns true if `dir` is covered by one of the `files` entries
19753
19804
  */
19754
- const isDirCoveredByFiles = (files, dir) => {
19805
+ const isCoveredByFiles = (files, dir) => {
19755
19806
  const normalizedDir = dir.replace(/\/$/, "").replace(/^\.\//, "");
19756
19807
  return files.some((userPath) => {
19757
19808
  const normalizedUserPath = normalizePath(userPath).replace(/\/$/, "").replace(/^\.\//, "");
@@ -19781,7 +19832,15 @@ const validateFilesField = async (config, compilerCtx, buildCtx) => {
19781
19832
  return;
19782
19833
  }
19783
19834
  const files = buildCtx.packageJson.files;
19784
- const uncoveredDirs = distDirs.filter((dir) => !isDirCoveredByFiles(files, dir));
19835
+ const manifest = config.outputTargets.find(isOutputTargetDocsCustomElementsManifest);
19836
+ if (manifest?.file) {
19837
+ const manifestPath = normalizePath(relative$1(config.rootDir, manifest.file), false);
19838
+ if (!manifestPath.startsWith("../") && !isCoveredByFiles(files, manifestPath)) {
19839
+ const msg = `package.json "files" array doesn't cover the Custom Elements Manifest "${manifestPath}", so it won't be published.`;
19840
+ packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
19841
+ }
19842
+ }
19843
+ const uncoveredDirs = distDirs.filter((dir) => !isCoveredByFiles(files, dir));
19785
19844
  if (uncoveredDirs.length > 0) {
19786
19845
  const msg = `package.json "files" array must contain the distribution ${uncoveredDirs.length > 1 ? "directories" : "directory"} ${formatDirs(uncoveredDirs)} when generating a distribution.`;
19787
19846
  packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
@@ -19906,7 +19965,6 @@ const OWNED_CONDITIONS = [
19906
19965
  "import",
19907
19966
  "require"
19908
19967
  ];
19909
- const isJsonObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
19910
19968
  /**
19911
19969
  * Write the `exports` map entry points into the project's `package.json`.
19912
19970
  *
@@ -19914,6 +19972,7 @@ const isJsonObject = (v) => typeof v === "object" && v !== null && !Array.isArra
19914
19972
  * (respects user customization), otherwise a default is set (loader-bundle > standalone)
19915
19973
  * - every other generated entry is owned by Stencil and rewritten on each build
19916
19974
  * - per-component entries whose component no longer exists are removed
19975
+ * - `./custom-elements.json` points at the Custom Elements Manifest, if one is generated
19917
19976
  * - entries Stencil doesn't generate are left untouched
19918
19977
  *
19919
19978
  * @param config The validated Stencil config
@@ -19926,37 +19985,23 @@ const writeExportMaps = async (config, compilerCtx, buildCtx) => {
19926
19985
  const ssr = config.outputTargets.find(isOutputTargetSsr);
19927
19986
  const types = config.outputTargets.find(isOutputTargetTypes);
19928
19987
  if (!loaderBundle && !standalone && !ssr) return;
19929
- const source = await readPackageJsonSource(config, compilerCtx);
19930
- const pkg = source ? parsePackageJson(source, config.packageJsonFilePath).data : null;
19931
- if (!source || !isJsonObject(pkg)) return;
19932
- let exportMap = toExportMap(pkg.exports);
19933
- if (loaderBundle || standalone) {
19934
- const root = getRootExport(config, compilerCtx, exportMap["."], loaderBundle, standalone, types);
19935
- exportMap = "." in exportMap ? {
19936
- ...exportMap,
19937
- ".": root
19938
- } : {
19939
- ".": root,
19940
- ...exportMap
19941
- };
19942
- }
19943
19988
  const generated = getGeneratedExports(config, buildCtx, loaderBundle, standalone, ssr, types);
19944
- if (standalone?.dir) removeStaleComponentExports(exportMap, generated, toRelativePath(config, standalone.dir));
19945
- for (const [key, entry] of Object.entries(generated)) exportMap[key] = isString$1(entry) ? entry : mergeConditions(exportMap[key], entry);
19946
- pkg.exports = exportMap;
19947
- const eol = source.includes("\r\n") ? "\r\n" : "\n";
19948
- const indent = /^([ \t]+)"/m.exec(source)?.[1] ?? 2;
19949
- let output = JSON.stringify(pkg, null, indent);
19950
- if (/\n\s*$/.test(source)) output += "\n";
19951
- output = output.replace(/\n/g, eol);
19952
- if (output !== source) await compilerCtx.fs.writeFile(config.packageJsonFilePath, output, { immediateWrite: true });
19953
- };
19954
- const readPackageJsonSource = async (config, compilerCtx) => {
19955
- try {
19956
- return await compilerCtx.fs.readFile(config.packageJsonFilePath);
19957
- } catch {
19958
- return;
19959
- }
19989
+ await updatePackageJson(config, compilerCtx, (pkg) => {
19990
+ let exportMap = toExportMap(pkg.exports);
19991
+ if (loaderBundle || standalone) {
19992
+ const root = getRootExport(config, compilerCtx, exportMap["."], loaderBundle, standalone, types);
19993
+ exportMap = "." in exportMap ? {
19994
+ ...exportMap,
19995
+ ".": root
19996
+ } : {
19997
+ ".": root,
19998
+ ...exportMap
19999
+ };
20000
+ }
20001
+ if (standalone?.dir) removeStaleComponentExports(exportMap, generated, toRelativePath(config, standalone.dir));
20002
+ for (const [key, entry] of Object.entries(generated)) exportMap[key] = isString$1(entry) ? entry : mergeConditions(exportMap[key], entry);
20003
+ pkg.exports = exportMap;
20004
+ }, true);
19960
20005
  };
19961
20006
  /**
19962
20007
  * Normalize a `package.json` `exports` value into its subpath-keyed form.
@@ -20073,6 +20118,9 @@ const getGeneratedExports = (config, buildCtx, loaderBundle, standalone, ssr, ty
20073
20118
  if (assetsDir) generated["./assets/*"] = `${toRelativePath(config, assetsDir)}/*`;
20074
20119
  for (const globalStyle of globalStyles) if (globalStyle.dir && globalStyle.fileName && globalStyle.dir !== assetsDir) generated[`./assets/${globalStyle.fileName}`] = toRelativePath(config, join$2(globalStyle.dir, globalStyle.fileName));
20075
20120
  }
20121
+ const manifest = config.outputTargets.find(isOutputTargetDocsCustomElementsManifest);
20122
+ if (manifest?.file) generated["./custom-elements.json"] = toRelativePath(config, manifest.file);
20123
+ generated["./package.json"] = "./package.json";
20076
20124
  return generated;
20077
20125
  };
20078
20126
  /**
@@ -21261,7 +21309,7 @@ const validateReadmeOutputTarget = (config, outputTarget) => {
21261
21309
  if (!isAbsolute$1(outputTarget.dir)) outputTarget.dir = join$2(config.rootDir, outputTarget.dir);
21262
21310
  if (outputTarget.footer == null) outputTarget.footer = NOTE;
21263
21311
  outputTarget.strict = !!outputTarget.strict;
21264
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21312
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21265
21313
  return outputTarget;
21266
21314
  };
21267
21315
  const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -21273,7 +21321,7 @@ const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
21273
21321
  if (isString$1(outputTarget.typesFile) && !isAbsolute$1(outputTarget.typesFile)) outputTarget.typesFile = join$2(config.rootDir, outputTarget.typesFile);
21274
21322
  else if (outputTarget.typesFile !== null && outputTarget.file.endsWith(".json")) outputTarget.typesFile = outputTarget.file.replace(/\.json$/, ".d.ts");
21275
21323
  outputTarget.strict = !!outputTarget.strict;
21276
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21324
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21277
21325
  return outputTarget;
21278
21326
  };
21279
21327
  const validateCustomDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -21282,7 +21330,7 @@ const validateCustomDocsOutputTarget = (config, diagnostics, outputTarget) => {
21282
21330
  err.messageText = `docs-custom outputTarget missing the "generator" function`;
21283
21331
  }
21284
21332
  outputTarget.strict = !!outputTarget.strict;
21285
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21333
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21286
21334
  return outputTarget;
21287
21335
  };
21288
21336
  const validateVScodeDocsOutputTarget = (config, diagnostics, outputTarget) => {
@@ -21290,21 +21338,22 @@ const validateVScodeDocsOutputTarget = (config, diagnostics, outputTarget) => {
21290
21338
  const err = buildError(diagnostics);
21291
21339
  err.messageText = `docs-vscode outputTarget missing the "file" path`;
21292
21340
  }
21293
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21341
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21294
21342
  return outputTarget;
21295
21343
  };
21296
21344
  const DEFAULT_AGENT_SKILL_DIR = "dist/skill";
21297
21345
  const validateAgentSkillOutputTarget = (config, outputTarget) => {
21298
21346
  outputTarget.dir = getAbsolutePath(config, outputTarget.dir || DEFAULT_AGENT_SKILL_DIR);
21299
21347
  outputTarget.name = toSkillName(outputTarget.name || config.fsNamespace);
21300
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21348
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21301
21349
  return outputTarget;
21302
21350
  };
21351
+ const DEFAULT_CUSTOM_ELEMENTS_MANIFEST_FILE = "dist/custom-elements.json";
21303
21352
  const validateCustomElementsManifestOutputTarget = (config, outputTarget) => {
21304
- if (!isString$1(outputTarget.file)) outputTarget.file = "custom-elements.json";
21353
+ if (!isString$1(outputTarget.file)) outputTarget.file = DEFAULT_CUSTOM_ELEMENTS_MANIFEST_FILE;
21305
21354
  if (!isAbsolute$1(outputTarget.file)) outputTarget.file = join$2(config.rootDir, outputTarget.file);
21306
21355
  outputTarget.strict = !!outputTarget.strict;
21307
- if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = !config._docsFlag;
21356
+ if (!isBoolean$1(outputTarget.skipInDev)) outputTarget.skipInDev = true;
21308
21357
  return outputTarget;
21309
21358
  };
21310
21359
  //#endregion
@@ -26325,14 +26374,14 @@ const getTranspileCssConfig = (compileOpts, importData, results) => {
26325
26374
  };
26326
26375
  const getTranspileConfigOpt = (value, validValues, defaultValue) => {
26327
26376
  if (value === null || value === "null") return null;
26328
- value = isString$1(value) ? value.toLowerCase().trim() : null;
26377
+ value = isString$1(value) ? value.toLowerCase().trim() : void 0;
26329
26378
  if (validValues.has(value)) return value;
26330
26379
  return defaultValue;
26331
26380
  };
26332
26381
  const VALID_EXPORT = /* @__PURE__ */ new Set(["customelement", "module"]);
26333
- const VALID_METADATA = /* @__PURE__ */ new Set(["compilerstatic", null]);
26382
+ const VALID_METADATA = /* @__PURE__ */ new Set(["compilerstatic"]);
26334
26383
  const VALID_MODULE = /* @__PURE__ */ new Set(["cjs", "esm"]);
26335
- const VALID_PROXY = /* @__PURE__ */ new Set(["defineproperty", null]);
26384
+ const VALID_PROXY = /* @__PURE__ */ new Set(["defineproperty"]);
26336
26385
  const VALID_STYLE = /* @__PURE__ */ new Set(["static"]);
26337
26386
  const VALID_STYLE_IMPORT_DATA = /* @__PURE__ */ new Set(["queryparams"]);
26338
26387
  const VALID_TARGET = /* @__PURE__ */ new Set([
@@ -2101,11 +2101,6 @@ interface Config extends StencilConfig {
2101
2101
  tsWatchOptions?: any;
2102
2102
  _isValidated?: boolean;
2103
2103
  _isTesting?: boolean;
2104
- /**
2105
- * Internal flag set when --docs CLI flag is used.
2106
- * Forces docs output targets to build even in dev mode.
2107
- */
2108
- _docsFlag?: boolean;
2109
2104
  /**
2110
2105
  * Whether running in a CI environment (disables interactive features, adjusts worker count)
2111
2106
  */
@@ -3837,9 +3832,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
3837
3832
  type: 'docs-custom-elements-manifest';
3838
3833
  /**
3839
3834
  * The file path where the custom-elements.json manifest will be written.
3840
- * Defaults to 'custom-elements.json' in the root directory.
3835
+ * Defaults to 'dist/custom-elements.json'.
3836
+ *
3837
+ * The `customElements` field of the project's `package.json` is set to this path.
3841
3838
  */
3842
- file: string;
3839
+ file?: string;
3843
3840
  strict?: boolean;
3844
3841
  }
3845
3842
  interface OutputTargetDocsCustom extends OutputTargetBase {
@@ -2141,11 +2141,6 @@ interface Config extends StencilConfig {
2141
2141
  tsWatchOptions?: any;
2142
2142
  _isValidated?: boolean;
2143
2143
  _isTesting?: boolean;
2144
- /**
2145
- * Internal flag set when --docs CLI flag is used.
2146
- * Forces docs output targets to build even in dev mode.
2147
- */
2148
- _docsFlag?: boolean;
2149
2144
  /**
2150
2145
  * Whether running in a CI environment (disables interactive features, adjusts worker count)
2151
2146
  */
@@ -3877,9 +3872,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
3877
3872
  type: 'docs-custom-elements-manifest';
3878
3873
  /**
3879
3874
  * The file path where the custom-elements.json manifest will be written.
3880
- * Defaults to 'custom-elements.json' in the root directory.
3875
+ * Defaults to 'dist/custom-elements.json'.
3876
+ *
3877
+ * The `customElements` field of the project's `package.json` is set to this path.
3881
3878
  */
3882
- file: string;
3879
+ file?: string;
3883
3880
  strict?: boolean;
3884
3881
  }
3885
3882
  interface OutputTargetDocsCustom extends OutputTargetBase {
@@ -1,4 +1,4 @@
1
- import { ar as RafCallback, cr as TagTransformer, lr as UserBuildConditionals, n as ChildType, nr as ErrorHandler, p as HostElement, rr as FunctionalComponent, sr as ResolutionHandler, ur as VNode, v as PropsType, y as RuntimeRef } from "./index-B9-Byy8z.mjs";
1
+ import { ar as RafCallback, cr as TagTransformer, lr as UserBuildConditionals, n as ChildType, nr as ErrorHandler, p as HostElement, rr as FunctionalComponent, sr as ResolutionHandler, ur as VNode, v as PropsType, y as RuntimeRef } from "./index-C41EOWaQ.mjs";
2
2
  //#region src/client/client-build.d.ts
3
3
  declare const Build: UserBuildConditionals;
4
4
  //#endregion
@@ -103,35 +103,6 @@ const BUILD = {
103
103
  asyncQueue: false
104
104
  };
105
105
  BUILD.isDev, BUILD.isTesting;
106
- const MEMBER_FLAGS = {
107
- String: 1,
108
- Number: 2,
109
- Boolean: 4,
110
- Any: 8,
111
- Unknown: 16,
112
- State: 32,
113
- Method: 64,
114
- Event: 128,
115
- Element: 256,
116
- ReflectAttr: 512,
117
- Mutable: 1024,
118
- Getter: 2048,
119
- Setter: 4096,
120
- Prop: 31,
121
- HasAttribute: 31,
122
- PropLike: 63
123
- };
124
- //#endregion
125
- //#region src/client/client-host-ref.ts
126
- /**
127
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
128
- *
129
- * @param ref the runtime ref of interest
130
- * @returns the Host reference (if found) or undefined
131
- */
132
- const getHostRef = (ref) => {
133
- if (ref.__s_ghr) return ref.__s_ghr();
134
- };
135
106
  //#endregion
136
107
  //#region src/client/client-log.ts
137
108
  const STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : ["%cstencil", "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"];
@@ -173,13 +144,12 @@ BUILD.lazyLoad || globalThis.HTMLElement;
173
144
  * @returns the `ReadonlySignal` for the prop, or `null` if not found / not signal-backed
174
145
  */
175
146
  const getSignal = (elm, prop) => {
176
- const hostRef = getHostRef(elm);
177
- if (!hostRef?.$signalValues$) {
147
+ const signals = elm[STENCIL_SIGNALS_SYMBOL];
148
+ if (!signals) {
178
149
  if (BUILD.isDev) consoleDevWarn(`getSignal('${prop}'): element <${elm.tagName.toLowerCase()}> is not signal-backed. Ensure signalBacking is true in stencil.config.ts.`);
179
150
  return null;
180
151
  }
181
- if (!((hostRef.$cmpMeta$?.$members$?.[prop]?.[0] ?? 0) & MEMBER_FLAGS.Prop)) return null;
182
- return hostRef.$signalValues$.get(prop) ?? null;
152
+ return signals.get(prop) ?? null;
183
153
  };
184
154
  /**
185
155
  * Marks a class method as a reactive effect. Wraps the method in `effect()` after
@@ -1,4 +1,4 @@
1
- import { Bt as Logger, nt as CompilerSystem } from "../../index-B9-Byy8z.mjs";
1
+ import { Bt as Logger, nt as CompilerSystem } from "../../index-C41EOWaQ.mjs";
2
2
  //#region src/sys/node/logger/index.d.ts
3
3
  /**
4
4
  * Create a logger to run in a Node environment
@@ -1,4 +1,4 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-ApS_Tn_4.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-B7K47DPN.mjs";
2
2
  import { t as createNodeSys } from "../../node-Bz2SOK7_.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
@@ -1276,11 +1276,6 @@ interface Config extends StencilConfig {
1276
1276
  tsWatchOptions?: any;
1277
1277
  _isValidated?: boolean;
1278
1278
  _isTesting?: boolean;
1279
- /**
1280
- * Internal flag set when --docs CLI flag is used.
1281
- * Forces docs output targets to build even in dev mode.
1282
- */
1283
- _docsFlag?: boolean;
1284
1279
  /**
1285
1280
  * Whether running in a CI environment (disables interactive features, adjusts worker count)
1286
1281
  */
@@ -2633,9 +2628,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
2633
2628
  type: 'docs-custom-elements-manifest';
2634
2629
  /**
2635
2630
  * The file path where the custom-elements.json manifest will be written.
2636
- * Defaults to 'custom-elements.json' in the root directory.
2631
+ * Defaults to 'dist/custom-elements.json'.
2632
+ *
2633
+ * The `customElements` field of the project's `package.json` is set to this path.
2637
2634
  */
2638
- file: string;
2635
+ file?: string;
2639
2636
  strict?: boolean;
2640
2637
  }
2641
2638
  interface OutputTargetDocsCustom extends OutputTargetBase {
@@ -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.21";
36
+ const version = "5.0.0-beta.23";
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.21",
3
+ "version": "5.0.0-beta.23",
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.21",
130
- "@stencil/mock-doc": "5.0.0-beta.21",
131
- "@stencil/dev-server": "5.0.0-beta.21"
129
+ "@stencil/cli": "5.0.0-beta.23",
130
+ "@stencil/mock-doc": "5.0.0-beta.23",
131
+ "@stencil/dev-server": "5.0.0-beta.23"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@ionic/prettier-config": "^4.0.0",