@stencil/core 5.0.0-beta.3 → 5.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler/browser.js +2 -2
- package/dist/compiler/index.d.mts +1 -1
- package/dist/compiler/index.mjs +1 -1
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/{compiler-BPgV6bA4.mjs → compiler-CO6yPHdk.mjs} +55 -30
- package/dist/declarations/stencil-public-compiler.d.ts +2 -1
- package/dist/{index-DmHmu3y0.d.mts → index-BAP9T4CB.d.mts} +1 -1
- package/dist/{index-BopBfjPu.d.mts → index-BvF31nqP.d.mts} +2 -1
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/worker.mjs +1 -1
- package/dist/testing/index.d.mts +2 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -4
package/dist/compiler/browser.js
CHANGED
|
@@ -1832,7 +1832,7 @@ const validateComponentTag = (tag) => {
|
|
|
1832
1832
|
};
|
|
1833
1833
|
//#endregion
|
|
1834
1834
|
//#region src/version.ts
|
|
1835
|
-
const version = "5.0.0-beta.
|
|
1835
|
+
const version = "5.0.0-beta.5";
|
|
1836
1836
|
//#endregion
|
|
1837
1837
|
//#region src/compiler/events.ts
|
|
1838
1838
|
const buildEvents = () => {
|
|
@@ -3812,7 +3812,7 @@ const validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
3812
3812
|
...config,
|
|
3813
3813
|
devMode,
|
|
3814
3814
|
compat: config.compat || {},
|
|
3815
|
-
generateExportMaps: isBoolean$1(config.generateExportMaps) ? config.generateExportMaps :
|
|
3815
|
+
generateExportMaps: isBoolean$1(config.generateExportMaps) ? config.generateExportMaps : !isString$1(config.configPath),
|
|
3816
3816
|
hydratedFlag: validateHydrated(config),
|
|
3817
3817
|
logLevel,
|
|
3818
3818
|
logger,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CompilerSystemRemoveDirectoryResults, $n as JsonDocMethodParameter, $t as OutputTargetDocsReadme, A as CompilerDependency, An as StencilDevServerConfig, At as LogLevel, B as CompilerEventFsChange, Bn as WatcherCloseResults, Bt as OutputTarget, C as CacheStorage, Cn as SerializeDocumentOptions, Ct as HydrateFactoryOptions, D as Compiler, Dn as SsrDocumentOptions, Dt as LightDomPatches, E as CompileTarget, En as SitemapXmpResults, Et as LazyRequire, F as CompilerEventDirAdd, Fn as TranspileOptions, Ft as NodeResolveConfig, G as CompilerFsStats, Gt as OutputTargetCollection, H as CompilerFileWatcher, Hn as WorkerOptions, Ht as OutputTargetBase, I as CompilerEventDirDelete, In as TranspileResults, It as OptimizeCssInput, J as CompilerSystem, Jt as OutputTargetDistLazy, K as CompilerRequest, Kt as OutputTargetCopy, L as CompilerEventFileAdd, Ln as UnvalidatedConfig, Lt as OptimizeCssOutput, M as CompilerEventBuildLog, Mn as SystemDetails, Mt as LoggerLineUpdater, N as CompilerEventBuildNoChange, Nn as TransformOptions, Nt as LoggerTimeSpan, O as CompilerBuildResults, On as SsrFactoryOptions, Ot as LoadConfigInit, P as CompilerEventBuildStart, Pn as TranspileOnlyResults, Pt as ModeConfig, Q as CompilerSystemRemoveDirectoryOptions, Qt as OutputTargetDocsJson, R as CompilerEventFileDelete, Rn as ValidatedConfig, Rt as OptimizeJsInput, S as BuildResultsComponentGraph, Sn as RolldownConfig, St as HydrateDocumentOptions, T as CompileScriptMinifyOptions, Tn as SitemapXmpOpts, Tt as LOG_LEVELS, U as CompilerFileWatcherCallback, Ut as OutputTargetBaseNext, V as CompilerEventName, Vn as WorkerMainController, Vt as OutputTargetAssets, W as CompilerFileWatcherEvent, Wt as OutputTargetBuild, X as CompilerSystemCreateDirectoryResults, Xt as OutputTargetDocsCustom, Y as CompilerSystemCreateDirectoryOptions, Yt as OutputTargetDocsAgentSkill, Z as CompilerSystemRealpathResults, Zt as OutputTargetDocsCustomElementsManifest, _ as BuildNoChangeResults, _n as ResolveModuleIdOptions, _r as FsWriteResults, _t as DocsReadmeCustomColumn, an as OutputTargetStandalone, ar as JsonDocsListener, at as Config, b as BuildOutput, bn as RobotsTxtOpts, bt as HmrStyleUpdate, c as PrintLine, cn as OutputTargetWww, cr as JsonDocsPart, ct as CopyResults, d as SsrResults, dn as PlatformPath, dr as JsonDocsStyle, dt as CustomElementsExportBehavior, en as OutputTargetDocsVscode, er as JsonDocs, et as CompilerSystemRemoveFileResults, f as WorkerMsgHandler, fn as PrerenderConfig, fr as JsonDocsTag, ft as CustomElementsExportBehaviorOptions, g as BuildLog, gn as PrerenderStartOptions, gr as StyleDoc, gt as Diagnostic, h as BuildEvents, hn as PrerenderResults, hr as JsonDocsValue, ht as DevServerEditor, i as ComponentCompilerTypeReferences, in as OutputTargetSsrWasm, ir as JsonDocsEvent, it as CompilerWatcher, j as CompilerEventBuildFinish, jn as StencilDocsConfig, jt as Logger, k as CompilerBuildStart, kn as StencilConfig, kt as LoadConfigResults, ln as PageReloadStrategy, lr as JsonDocsProp, lt as CopyTask, m as BuildEmitEvents, mn as PrerenderOptions, mr as JsonDocsUsage, mt as DevServerConfig, n as CompilerWorkerContext, nn as OutputTargetLoaderBundle, nr as JsonDocsCustomState, nt as CompilerSystemRenamedPath, o as LazyBundlesRuntimeData, on as OutputTargetStats, or as JsonDocsMethod, ot as ConfigBundle, p as AutoprefixerOptions, pn as PrerenderHydrateOptions, pr as JsonDocsTypeLibrary, pt as DevServer, q as CompilerRequestResponse, qt as OutputTargetCustom, r as ComponentCompilerMeta, rn as OutputTargetSsr, rr as JsonDocsDependencyGraph, rt as CompilerSystemWriteFileResults, s as PackageJsonData, sn as OutputTargetTypes, sr as JsonDocsMethodReturn, st as ConfigCompat, tn as OutputTargetGlobalStyle, tr as JsonDocsComponent, tt as CompilerSystemRenameResults, un as ParsedPath, ur as JsonDocsSlot, ut as Credentials, v as BuildOnEventRemove, vn as ResolveModuleIdResults, vt as FsWatchResults, w as CliInitOptions, wn as ServiceWorkerConfig, wt as HydratedFlag, x as BuildOverrides, xn as RobotsTxtResults, xt as HotModuleReplacement, y as BuildOnEvents, yn as ResolveModuleOptions, yt as HistoryApiFallback, z as CompilerEventFileUpdate, zn as ValidatedOutputTargetWww, zt as OptimizeJsOutput } from "../index-
|
|
1
|
+
import { $ as CompilerSystemRemoveDirectoryResults, $n as JsonDocMethodParameter, $t as OutputTargetDocsReadme, A as CompilerDependency, An as StencilDevServerConfig, At as LogLevel, B as CompilerEventFsChange, Bn as WatcherCloseResults, Bt as OutputTarget, C as CacheStorage, Cn as SerializeDocumentOptions, Ct as HydrateFactoryOptions, D as Compiler, Dn as SsrDocumentOptions, Dt as LightDomPatches, E as CompileTarget, En as SitemapXmpResults, Et as LazyRequire, F as CompilerEventDirAdd, Fn as TranspileOptions, Ft as NodeResolveConfig, G as CompilerFsStats, Gt as OutputTargetCollection, H as CompilerFileWatcher, Hn as WorkerOptions, Ht as OutputTargetBase, I as CompilerEventDirDelete, In as TranspileResults, It as OptimizeCssInput, J as CompilerSystem, Jt as OutputTargetDistLazy, K as CompilerRequest, Kt as OutputTargetCopy, L as CompilerEventFileAdd, Ln as UnvalidatedConfig, Lt as OptimizeCssOutput, M as CompilerEventBuildLog, Mn as SystemDetails, Mt as LoggerLineUpdater, N as CompilerEventBuildNoChange, Nn as TransformOptions, Nt as LoggerTimeSpan, O as CompilerBuildResults, On as SsrFactoryOptions, Ot as LoadConfigInit, P as CompilerEventBuildStart, Pn as TranspileOnlyResults, Pt as ModeConfig, Q as CompilerSystemRemoveDirectoryOptions, Qt as OutputTargetDocsJson, R as CompilerEventFileDelete, Rn as ValidatedConfig, Rt as OptimizeJsInput, S as BuildResultsComponentGraph, Sn as RolldownConfig, St as HydrateDocumentOptions, T as CompileScriptMinifyOptions, Tn as SitemapXmpOpts, Tt as LOG_LEVELS, U as CompilerFileWatcherCallback, Ut as OutputTargetBaseNext, V as CompilerEventName, Vn as WorkerMainController, Vt as OutputTargetAssets, W as CompilerFileWatcherEvent, Wt as OutputTargetBuild, X as CompilerSystemCreateDirectoryResults, Xt as OutputTargetDocsCustom, Y as CompilerSystemCreateDirectoryOptions, Yt as OutputTargetDocsAgentSkill, Z as CompilerSystemRealpathResults, Zt as OutputTargetDocsCustomElementsManifest, _ as BuildNoChangeResults, _n as ResolveModuleIdOptions, _r as FsWriteResults, _t as DocsReadmeCustomColumn, an as OutputTargetStandalone, ar as JsonDocsListener, at as Config, b as BuildOutput, bn as RobotsTxtOpts, bt as HmrStyleUpdate, c as PrintLine, cn as OutputTargetWww, cr as JsonDocsPart, ct as CopyResults, d as SsrResults, dn as PlatformPath, dr as JsonDocsStyle, dt as CustomElementsExportBehavior, en as OutputTargetDocsVscode, er as JsonDocs, et as CompilerSystemRemoveFileResults, f as WorkerMsgHandler, fn as PrerenderConfig, fr as JsonDocsTag, ft as CustomElementsExportBehaviorOptions, g as BuildLog, gn as PrerenderStartOptions, gr as StyleDoc, gt as Diagnostic, h as BuildEvents, hn as PrerenderResults, hr as JsonDocsValue, ht as DevServerEditor, i as ComponentCompilerTypeReferences, in as OutputTargetSsrWasm, ir as JsonDocsEvent, it as CompilerWatcher, j as CompilerEventBuildFinish, jn as StencilDocsConfig, jt as Logger, k as CompilerBuildStart, kn as StencilConfig, kt as LoadConfigResults, ln as PageReloadStrategy, lr as JsonDocsProp, lt as CopyTask, m as BuildEmitEvents, mn as PrerenderOptions, mr as JsonDocsUsage, mt as DevServerConfig, n as CompilerWorkerContext, nn as OutputTargetLoaderBundle, nr as JsonDocsCustomState, nt as CompilerSystemRenamedPath, o as LazyBundlesRuntimeData, on as OutputTargetStats, or as JsonDocsMethod, ot as ConfigBundle, p as AutoprefixerOptions, pn as PrerenderHydrateOptions, pr as JsonDocsTypeLibrary, pt as DevServer, q as CompilerRequestResponse, qt as OutputTargetCustom, r as ComponentCompilerMeta, rn as OutputTargetSsr, rr as JsonDocsDependencyGraph, rt as CompilerSystemWriteFileResults, s as PackageJsonData, sn as OutputTargetTypes, sr as JsonDocsMethodReturn, st as ConfigCompat, tn as OutputTargetGlobalStyle, tr as JsonDocsComponent, tt as CompilerSystemRenameResults, un as ParsedPath, ur as JsonDocsSlot, ut as Credentials, v as BuildOnEventRemove, vn as ResolveModuleIdResults, vt as FsWatchResults, w as CliInitOptions, wn as ServiceWorkerConfig, wt as HydratedFlag, x as BuildOverrides, xn as RobotsTxtResults, xt as HotModuleReplacement, y as BuildOnEvents, yn as ResolveModuleOptions, yt as HistoryApiFallback, z as CompilerEventFileUpdate, zn as ValidatedOutputTargetWww, zt as OptimizeJsOutput } from "../index-BvF31nqP.mjs";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
//#region src/version.d.ts
|
|
4
4
|
declare const version: string;
|
package/dist/compiler/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as buildId, a as createPrerenderer, b as versions, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as getScopeId, h as cmpMetaToDocsComponent, i as createSystem, l as createWorkerMessageHandler, m as generateManifest, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as vermoji, x as scopeCss, y as version } from "../compiler-
|
|
1
|
+
import { _ as buildId, a as createPrerenderer, b as versions, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as getScopeId, h as cmpMetaToDocsComponent, i as createSystem, l as createWorkerMessageHandler, m as generateManifest, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as vermoji, x as scopeCss, y as version } from "../compiler-CO6yPHdk.mjs";
|
|
2
2
|
import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-75gQKkFz.mjs";
|
|
3
3
|
export { CustomElementsExportBehaviorOptions, LOG_LEVELS, buildId, cmpMetaToDocsComponent, createCompiler, createPrerenderer, createSystem, createWorkerContext, createWorkerMessageHandler, generateManifest, getScopeId, loadConfig, nodeRequire, optimizeCss, optimizeJs, scopeCss, transpile, transpileSync, ts, validateConfig, vermoji, version, versions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $i as HOST_FLAGS, $r as isOutputTargetDocsCustom, Ai as isRolldownError, Ar as isTsFile, Bi as COPY, Br as FilterComponentsResult, Ci as escapeHtml, Cr as createJsVarName, Di as loadTypeScriptDiagnostic, Dr as isDtsFile, Ei as augmentDiagnosticWithNode, Er as hasDependency, Fi as ASSETS, Fr as getInlineSourceMappingUrlLinker, Gi as DOCS_CUSTOM, Gr as getComponentsFromModules, Hi as DEFAULT_STYLE_MODE, Hr as filterExcludedComponents, Ii as CMP_FLAGS, Ir as getSourceMappingUrlForEndOfFile, Ji as DOCS_README, Jr as isOutputTargetCopy, Ki as DOCS_CUSTOM_ELEMENTS_MANIFEST, Kr as isOutputTargetAssets, Li as COLLECTION, Lr as getSourceMappingUrlLinker, Mi as formatComponentRuntimeMeta, Mr as parsePackageJson, Ni as formatLazyBundleRuntimeMeta, Nr as readOnlyArrayHasStringMember, Oi as loadTypeScriptDiagnostics, Or as isJsFile, Pi as stringifyRuntimeData, Pr as readPackageJson, Qi as GLOBAL_STYLE, Qr as isOutputTargetDocsAgentSkill, Ri as COLLECTION_APP_DATA_FILE_NAME, Rr as rolldownToStencilSourceMap, Si as shouldIgnoreError, Sr as addDocBlock, Ti as splitLineBreaks, Tr as getTextDocs, Ui as DIST_LAZY, Ur as getComponentsDtsSrcFilePath, Vi as CUSTOM, Vr as filterActiveTargets, Wi as DOCS_AGENT_SKILL, Wr as getComponentsDtsTypesFilePath, Xi as EVENT_FLAGS, Xr as isOutputTargetDistLazy, Yi as DOCS_VSCODE, Yr as isOutputTargetCustom, Zi as GENERATED_DTS, Zr as isOutputTargetDocs, _i as buildJsonFileError, aa as SSR, ai as isOutputTargetLoaderBundle, bi as hasError, br as validateComponentTag, ca as STATS, ci as isOutputTargetStandalone, da as TYPES, di as isOutputTargetWww, ea as HTML_NS, ei as isOutputTargetDocsCustomElementsManifest, fa as VALID_CONFIG_OUTPUT_TARGETS, fi as isValidConfigOutputTarget, gi as buildError, ha as XLINK_NS, hi as TASK_CANCELED_MSG, ia as NODE_TYPES, ii as isOutputTargetGlobalStyle, ji as loadRolldownDiagnostics, jr as isTsxFile, ki as createOnWarnFn, kr as isJsxFile, la as STYLE_EXT, li as isOutputTargetStats, ma as WWW, mi as shouldExcludeComponent, na as LOADER_BUNDLE, ni as isOutputTargetDocsReadme, oa as SSR_WASM, oi as isOutputTargetSsr, pa as WATCH_FLAGS, pi as relativeImport, qi as DOCS_JSON, qr as isOutputTargetCollection, ra as MEMBER_FLAGS, ri as isOutputTargetDocsVscode, sa as STANDALONE, si as isOutputTargetSsrWasm, ta as LISTENER_FLAGS, ti as isOutputTargetDocsJson, ua as SVG_NS, ui as isOutputTargetTypes, vi as buildWarn, vr as ModeValidationError, wi as normalizeDiagnostics, wr as generatePreamble, xi as hasWarning, xr as ParsePackageJsonResult, yi as catchError, yr as validateComponentModes, zi as COLLECTION_MANIFEST_FILE_NAME, zr as result_d_exports } from "../../index-
|
|
1
|
+
import { $i as HOST_FLAGS, $r as isOutputTargetDocsCustom, Ai as isRolldownError, Ar as isTsFile, Bi as COPY, Br as FilterComponentsResult, Ci as escapeHtml, Cr as createJsVarName, Di as loadTypeScriptDiagnostic, Dr as isDtsFile, Ei as augmentDiagnosticWithNode, Er as hasDependency, Fi as ASSETS, Fr as getInlineSourceMappingUrlLinker, Gi as DOCS_CUSTOM, Gr as getComponentsFromModules, Hi as DEFAULT_STYLE_MODE, Hr as filterExcludedComponents, Ii as CMP_FLAGS, Ir as getSourceMappingUrlForEndOfFile, Ji as DOCS_README, Jr as isOutputTargetCopy, Ki as DOCS_CUSTOM_ELEMENTS_MANIFEST, Kr as isOutputTargetAssets, Li as COLLECTION, Lr as getSourceMappingUrlLinker, Mi as formatComponentRuntimeMeta, Mr as parsePackageJson, Ni as formatLazyBundleRuntimeMeta, Nr as readOnlyArrayHasStringMember, Oi as loadTypeScriptDiagnostics, Or as isJsFile, Pi as stringifyRuntimeData, Pr as readPackageJson, Qi as GLOBAL_STYLE, Qr as isOutputTargetDocsAgentSkill, Ri as COLLECTION_APP_DATA_FILE_NAME, Rr as rolldownToStencilSourceMap, Si as shouldIgnoreError, Sr as addDocBlock, Ti as splitLineBreaks, Tr as getTextDocs, Ui as DIST_LAZY, Ur as getComponentsDtsSrcFilePath, Vi as CUSTOM, Vr as filterActiveTargets, Wi as DOCS_AGENT_SKILL, Wr as getComponentsDtsTypesFilePath, Xi as EVENT_FLAGS, Xr as isOutputTargetDistLazy, Yi as DOCS_VSCODE, Yr as isOutputTargetCustom, Zi as GENERATED_DTS, Zr as isOutputTargetDocs, _i as buildJsonFileError, aa as SSR, ai as isOutputTargetLoaderBundle, bi as hasError, br as validateComponentTag, ca as STATS, ci as isOutputTargetStandalone, da as TYPES, di as isOutputTargetWww, ea as HTML_NS, ei as isOutputTargetDocsCustomElementsManifest, fa as VALID_CONFIG_OUTPUT_TARGETS, fi as isValidConfigOutputTarget, gi as buildError, ha as XLINK_NS, hi as TASK_CANCELED_MSG, ia as NODE_TYPES, ii as isOutputTargetGlobalStyle, ji as loadRolldownDiagnostics, jr as isTsxFile, ki as createOnWarnFn, kr as isJsxFile, la as STYLE_EXT, li as isOutputTargetStats, ma as WWW, mi as shouldExcludeComponent, na as LOADER_BUNDLE, ni as isOutputTargetDocsReadme, oa as SSR_WASM, oi as isOutputTargetSsr, pa as WATCH_FLAGS, pi as relativeImport, qi as DOCS_JSON, qr as isOutputTargetCollection, ra as MEMBER_FLAGS, ri as isOutputTargetDocsVscode, sa as STANDALONE, si as isOutputTargetSsrWasm, ta as LISTENER_FLAGS, ti as isOutputTargetDocsJson, ua as SVG_NS, ui as isOutputTargetTypes, vi as buildWarn, vr as ModeValidationError, wi as normalizeDiagnostics, wr as generatePreamble, xi as hasWarning, xr as ParsePackageJsonResult, yi as catchError, yr as validateComponentModes, zi as COLLECTION_MANIFEST_FILE_NAME, zr as result_d_exports } from "../../index-BvF31nqP.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,8 +461,8 @@ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
|
461
461
|
};
|
|
462
462
|
//#endregion
|
|
463
463
|
//#region src/version.ts
|
|
464
|
-
const version = "5.0.0-beta.
|
|
465
|
-
const buildId = "
|
|
464
|
+
const version = "5.0.0-beta.5";
|
|
465
|
+
const buildId = "1788905980";
|
|
466
466
|
const vermoji = "💛";
|
|
467
467
|
/**
|
|
468
468
|
* Get the installed version of a tool/dependency.
|
|
@@ -18120,13 +18120,17 @@ const getPackageJsonRecommendations = (config, compilerCtx) => {
|
|
|
18120
18120
|
const loaderBundle = config.outputTargets.find(isOutputTargetLoaderBundle);
|
|
18121
18121
|
const standalone = config.outputTargets.find(isOutputTargetStandalone);
|
|
18122
18122
|
const types = config.outputTargets.find(isOutputTargetTypes);
|
|
18123
|
+
const srcIndexPath = join$2(config.srcDir, "index.ts");
|
|
18124
|
+
const hasSrcIndex = compilerCtx.fs.accessSync(srcIndexPath);
|
|
18123
18125
|
const moduleOptions = [];
|
|
18124
|
-
if (loaderBundle?.dir)
|
|
18126
|
+
if (loaderBundle?.dir) {
|
|
18127
|
+
const loaderEntry = hasSrcIndex ? join$2(loaderBundle.dir, "index.js") : join$2(loaderBundle.dir, "esm", "loader.js");
|
|
18128
|
+
moduleOptions.push(normalizePath(relative$1(config.rootDir, loaderEntry)));
|
|
18129
|
+
}
|
|
18125
18130
|
if (standalone?.dir) moduleOptions.push(normalizePath(relative$1(config.rootDir, join$2(standalone.dir, "index.js"))));
|
|
18126
18131
|
const typesOptions = [];
|
|
18127
18132
|
if (types?.dir) {
|
|
18128
|
-
|
|
18129
|
-
if (compilerCtx.fs.accessSync(srcIndexPath)) typesOptions.push(normalizePath(relative$1(config.rootDir, join$2(types.dir, "index.d.ts"))));
|
|
18133
|
+
if (hasSrcIndex) typesOptions.push(normalizePath(relative$1(config.rootDir, join$2(types.dir, "index.d.ts"))));
|
|
18130
18134
|
else {
|
|
18131
18135
|
if (loaderBundle) typesOptions.push(normalizePath(relative$1(config.rootDir, join$2(types.dir, "loader.d.ts"))));
|
|
18132
18136
|
if (standalone) typesOptions.push(normalizePath(relative$1(config.rootDir, join$2(types.dir, "standalone.d.ts"))));
|
|
@@ -18424,6 +18428,24 @@ const validateBuildFiles = (config, compilerCtx, buildCtx) => {
|
|
|
18424
18428
|
//#endregion
|
|
18425
18429
|
//#region src/compiler/build/write-export-maps.ts
|
|
18426
18430
|
/**
|
|
18431
|
+
* Create the shared {@link NpmPkgSet} used across a single `writeExportMaps` run.
|
|
18432
|
+
* @param buildCtx The build context to report a warning diagnostic on if `npm` can't be run
|
|
18433
|
+
* @returns A function that shells out to `npm pkg set`, swallowing failure after warning once
|
|
18434
|
+
*/
|
|
18435
|
+
const createNpmPkgSet = (buildCtx) => {
|
|
18436
|
+
let npmAvailable = true;
|
|
18437
|
+
return (cmd) => {
|
|
18438
|
+
if (!npmAvailable) return;
|
|
18439
|
+
try {
|
|
18440
|
+
execSync(`npm pkg set ${cmd}`);
|
|
18441
|
+
} catch (e) {
|
|
18442
|
+
npmAvailable = false;
|
|
18443
|
+
const warn = buildWarn(buildCtx.diagnostics);
|
|
18444
|
+
warn.messageText = `Unable to generate "exports" map in package.json: the "npm" CLI could not be run (${e.message ?? e}). Set "generateExportMaps: false" in your Stencil config to silence this warning.`;
|
|
18445
|
+
}
|
|
18446
|
+
};
|
|
18447
|
+
};
|
|
18448
|
+
/**
|
|
18427
18449
|
* Create export map entry point definitions for the `package.json` file using the npm CLI.
|
|
18428
18450
|
*
|
|
18429
18451
|
* In v5, this uses a "smart default" approach:
|
|
@@ -18434,15 +18456,17 @@ const validateBuildFiles = (config, compilerCtx, buildCtx) => {
|
|
|
18434
18456
|
* - Generate per-component exports for standalone output
|
|
18435
18457
|
*
|
|
18436
18458
|
* @param config The validated Stencil config
|
|
18459
|
+
* @param compilerCtx The compiler context (used to detect a user-authored src/index.ts)
|
|
18437
18460
|
* @param buildCtx The build context containing the components to generate export maps for
|
|
18438
18461
|
*/
|
|
18439
|
-
const writeExportMaps = (config, buildCtx) => {
|
|
18462
|
+
const writeExportMaps = (config, compilerCtx, buildCtx) => {
|
|
18440
18463
|
const loaderBundle = config.outputTargets.find(isOutputTargetLoaderBundle);
|
|
18441
18464
|
const standalone = config.outputTargets.find(isOutputTargetStandalone);
|
|
18442
18465
|
const types = config.outputTargets.find(isOutputTargetTypes);
|
|
18443
|
-
|
|
18444
|
-
|
|
18445
|
-
if (
|
|
18466
|
+
const npmPkgSet = createNpmPkgSet(buildCtx);
|
|
18467
|
+
generateRootExport(config, compilerCtx, buildCtx, loaderBundle, standalone, types, npmPkgSet);
|
|
18468
|
+
if (loaderBundle) generateLoaderExport(config, loaderBundle, types, npmPkgSet);
|
|
18469
|
+
if (standalone) generateComponentExports(config, buildCtx, standalone, npmPkgSet);
|
|
18446
18470
|
};
|
|
18447
18471
|
/**
|
|
18448
18472
|
* Generate the root export `exports["."]`.
|
|
@@ -18452,28 +18476,32 @@ const writeExportMaps = (config, buildCtx) => {
|
|
|
18452
18476
|
* - If valid, leave it alone
|
|
18453
18477
|
* - If missing or invalid, set default (loader-bundle > standalone priority)
|
|
18454
18478
|
* @param config The validated Stencil config
|
|
18479
|
+
* @param compilerCtx The compiler context (used to detect a user-authored src/index.ts)
|
|
18455
18480
|
* @param buildCtx The build context containing the components to generate export maps for
|
|
18456
18481
|
* @param loaderBundle The loader-bundle output target, if it exists
|
|
18457
18482
|
* @param standalone The standalone output target, if it exists
|
|
18458
18483
|
* @param types The types output target, if it exists
|
|
18484
|
+
* @param npmPkgSet Function used to run `npm pkg set`, tolerating an unavailable npm CLI
|
|
18459
18485
|
*/
|
|
18460
|
-
const generateRootExport = (config, buildCtx, loaderBundle, standalone, types) => {
|
|
18486
|
+
const generateRootExport = (config, compilerCtx, buildCtx, loaderBundle, standalone, types, npmPkgSet) => {
|
|
18461
18487
|
if (!loaderBundle && !standalone) return;
|
|
18488
|
+
const hasSrcIndex = compilerCtx.fs.accessSync(join$2(config.srcDir, "index.ts"));
|
|
18489
|
+
const rootUsesEmptyLoaderIndex = !!loaderBundle && !hasSrcIndex;
|
|
18462
18490
|
const currentImport = ((buildCtx.packageJson?.exports)?.["."])?.import;
|
|
18463
18491
|
if (!(currentImport && isValidRootExport(config, currentImport, loaderBundle, standalone))) {
|
|
18464
18492
|
const primaryDir = loaderBundle?.dir ?? standalone?.dir;
|
|
18465
18493
|
if (primaryDir) {
|
|
18466
|
-
const
|
|
18467
|
-
|
|
18494
|
+
const entryFile = rootUsesEmptyLoaderIndex ? join$2("esm", "loader.js") : "index.js";
|
|
18495
|
+
npmPkgSet(`"exports[.][import]"="${normalizePath(relative$1(config.rootDir, join$2(primaryDir, entryFile)))}"`);
|
|
18468
18496
|
if (loaderBundle?.cjs) {
|
|
18469
|
-
const
|
|
18470
|
-
|
|
18497
|
+
const cjsEntryFile = rootUsesEmptyLoaderIndex ? join$2("cjs", "loader.cjs") : "index.cjs";
|
|
18498
|
+
npmPkgSet(`"exports[.][require]"="${normalizePath(relative$1(config.rootDir, join$2(loaderBundle.dir, cjsEntryFile)))}"`);
|
|
18471
18499
|
}
|
|
18472
18500
|
}
|
|
18473
18501
|
}
|
|
18474
18502
|
if (types?.dir) {
|
|
18475
|
-
const
|
|
18476
|
-
|
|
18503
|
+
const typesFile = rootUsesEmptyLoaderIndex ? "loader.d.ts" : "index.d.ts";
|
|
18504
|
+
npmPkgSet(`"exports[.][types]"="${normalizePath(relative$1(config.rootDir, join$2(types.dir, typesFile)))}"`);
|
|
18477
18505
|
}
|
|
18478
18506
|
};
|
|
18479
18507
|
/**
|
|
@@ -18516,20 +18544,16 @@ const ensureRelativePrefix = (path) => {
|
|
|
18516
18544
|
* @param config The validated Stencil config
|
|
18517
18545
|
* @param loaderBundle The loader-bundle output target
|
|
18518
18546
|
* @param types The types output target, if it exists
|
|
18547
|
+
* @param npmPkgSet Function used to run `npm pkg set`, tolerating an unavailable npm CLI
|
|
18519
18548
|
*/
|
|
18520
|
-
const generateLoaderExport = (config, loaderBundle, types) => {
|
|
18549
|
+
const generateLoaderExport = (config, loaderBundle, types, npmPkgSet) => {
|
|
18521
18550
|
const esmDir = join$2(loaderBundle.dir, "esm");
|
|
18522
|
-
|
|
18523
|
-
execSync(`npm pkg set "exports[./loader][import]"="${esmLoaderPath}"`);
|
|
18551
|
+
npmPkgSet(`"exports[./loader][import]"="${ensureRelativePrefix(normalizePath(relative$1(config.rootDir, join$2(esmDir, "loader.js"))))}"`);
|
|
18524
18552
|
if (loaderBundle.cjs) {
|
|
18525
18553
|
const cjsDir = join$2(loaderBundle.dir, "cjs");
|
|
18526
|
-
|
|
18527
|
-
execSync(`npm pkg set "exports[./loader][require]"="${cjsLoaderPath}"`);
|
|
18528
|
-
}
|
|
18529
|
-
if (types?.dir) {
|
|
18530
|
-
const typesPath = ensureRelativePrefix(normalizePath(relative$1(config.rootDir, join$2(types.dir, "loader.d.ts"))));
|
|
18531
|
-
execSync(`npm pkg set "exports[./loader][types]"="${typesPath}"`);
|
|
18554
|
+
npmPkgSet(`"exports[./loader][require]"="${ensureRelativePrefix(normalizePath(relative$1(config.rootDir, join$2(cjsDir, "loader.cjs"))))}"`);
|
|
18532
18555
|
}
|
|
18556
|
+
if (types?.dir) npmPkgSet(`"exports[./loader][types]"="${ensureRelativePrefix(normalizePath(relative$1(config.rootDir, join$2(types.dir, "loader.d.ts"))))}"`);
|
|
18533
18557
|
};
|
|
18534
18558
|
/**
|
|
18535
18559
|
* Generate per-component exports for standalone output.
|
|
@@ -18537,13 +18561,14 @@ const generateLoaderExport = (config, loaderBundle, types) => {
|
|
|
18537
18561
|
* @param config The validated Stencil config
|
|
18538
18562
|
* @param buildCtx The build context containing the components to generate export maps for
|
|
18539
18563
|
* @param standalone The standalone output target
|
|
18564
|
+
* @param npmPkgSet Function used to run `npm pkg set`, tolerating an unavailable npm CLI
|
|
18540
18565
|
*/
|
|
18541
|
-
const generateComponentExports = (config, buildCtx, standalone) => {
|
|
18566
|
+
const generateComponentExports = (config, buildCtx, standalone, npmPkgSet) => {
|
|
18542
18567
|
let outDir = relative$1(config.rootDir, standalone.dir);
|
|
18543
18568
|
if (!outDir.startsWith(".")) outDir = "./" + outDir;
|
|
18544
18569
|
buildCtx.components.forEach((cmp) => {
|
|
18545
|
-
|
|
18546
|
-
|
|
18570
|
+
npmPkgSet(`"exports[./${cmp.tagName}][import]"="${outDir}/${cmp.tagName}.js"`);
|
|
18571
|
+
npmPkgSet(`"exports[./${cmp.tagName}][types]"="${outDir}/${cmp.tagName}.d.ts"`);
|
|
18547
18572
|
});
|
|
18548
18573
|
};
|
|
18549
18574
|
//#endregion
|
|
@@ -18567,7 +18592,7 @@ const writeBuild = async (config, compilerCtx, buildCtx) => {
|
|
|
18567
18592
|
await compilerCtx.cache.commit();
|
|
18568
18593
|
buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
|
|
18569
18594
|
buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
|
|
18570
|
-
if (config.generateExportMaps) writeExportMaps(config, buildCtx);
|
|
18595
|
+
if (config.generateExportMaps && !config.devMode) writeExportMaps(config, compilerCtx, buildCtx);
|
|
18571
18596
|
await outputServiceWorkers(config, buildCtx);
|
|
18572
18597
|
await validateBuildFiles(config, compilerCtx, buildCtx);
|
|
18573
18598
|
} catch (e) {
|
|
@@ -20625,7 +20650,7 @@ const validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
20625
20650
|
...config,
|
|
20626
20651
|
devMode,
|
|
20627
20652
|
compat: config.compat || {},
|
|
20628
|
-
generateExportMaps: isBoolean$1(config.generateExportMaps) ? config.generateExportMaps :
|
|
20653
|
+
generateExportMaps: isBoolean$1(config.generateExportMaps) ? config.generateExportMaps : !isString$1(config.configPath),
|
|
20629
20654
|
hydratedFlag: validateHydrated(config),
|
|
20630
20655
|
logLevel,
|
|
20631
20656
|
logger,
|
|
@@ -1797,7 +1797,8 @@ interface StencilConfig {
|
|
|
1797
1797
|
* Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
|
|
1798
1798
|
* for each component in the build when `true`.
|
|
1799
1799
|
*
|
|
1800
|
-
*
|
|
1800
|
+
* Defaults to `true` for "no-config" projects (no `stencil.config.ts`/`.js` file), and `false`
|
|
1801
|
+
* whenever a config file is present - set this explicitly to opt an existing project in or out.
|
|
1801
1802
|
*/
|
|
1802
1803
|
generateExportMaps?: boolean;
|
|
1803
1804
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gn as FunctionalComponent, Qn as VNode, Wn as ErrorHandler, Xn as TagTransformer, Yn as ResolutionHandler, Zn as UserBuildConditionals, a as HostElement, l as PropsType, qn as RafCallback, t as ChildType, u as RuntimeRef } from "./index-
|
|
1
|
+
import { Gn as FunctionalComponent, Qn as VNode, Wn as ErrorHandler, Xn as TagTransformer, Yn as ResolutionHandler, Zn as UserBuildConditionals, a as HostElement, l as PropsType, qn as RafCallback, t as ChildType, u as RuntimeRef } from "./index-BvF31nqP.mjs";
|
|
2
2
|
//#region src/client/client-build.d.ts
|
|
3
3
|
declare const Build: UserBuildConditionals;
|
|
4
4
|
//#endregion
|
|
@@ -1784,7 +1784,8 @@ interface StencilConfig {
|
|
|
1784
1784
|
* Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
|
|
1785
1785
|
* for each component in the build when `true`.
|
|
1786
1786
|
*
|
|
1787
|
-
*
|
|
1787
|
+
* Defaults to `true` for "no-config" projects (no `stencil.config.ts`/`.js` file), and `false`
|
|
1788
|
+
* whenever a config file is present - set this explicitly to opt an existing project in or out.
|
|
1788
1789
|
*/
|
|
1789
1790
|
generateExportMaps?: boolean;
|
|
1790
1791
|
/**
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-CO6yPHdk.mjs";
|
|
2
2
|
import { t as createNodeSys } from "../../node-75gQKkFz.mjs";
|
|
3
3
|
//#region src/sys/node/node-worker-thread.ts
|
|
4
4
|
/**
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -919,7 +919,8 @@ interface StencilConfig {
|
|
|
919
919
|
* Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
|
|
920
920
|
* for each component in the build when `true`.
|
|
921
921
|
*
|
|
922
|
-
*
|
|
922
|
+
* Defaults to `true` for "no-config" projects (no `stencil.config.ts`/`.js` file), and `false`
|
|
923
|
+
* whenever a config file is present - set this explicitly to opt an existing project in or out.
|
|
923
924
|
*/
|
|
924
925
|
generateExportMaps?: boolean;
|
|
925
926
|
/**
|
package/dist/testing/index.mjs
CHANGED
|
@@ -32,7 +32,7 @@ import "@rollup/pluginutils";
|
|
|
32
32
|
import { createHash } from "crypto";
|
|
33
33
|
import { afterAll, vi } from "vitest";
|
|
34
34
|
//#region src/version.ts
|
|
35
|
-
const version = "5.0.0-beta.
|
|
35
|
+
const version = "5.0.0-beta.5";
|
|
36
36
|
const MEMBER_FLAGS = {
|
|
37
37
|
String: 1,
|
|
38
38
|
Number: 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.5",
|
|
4
4
|
"description": "A Compiler for Web Components and Progressive Web Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -125,9 +125,9 @@
|
|
|
125
125
|
"terser": "^5.50.0",
|
|
126
126
|
"tinyglobby": "^0.2.17",
|
|
127
127
|
"typescript": ">5.0.0 <7.0.0",
|
|
128
|
-
"@stencil/
|
|
129
|
-
"@stencil/
|
|
130
|
-
"@stencil/
|
|
128
|
+
"@stencil/mock-doc": "5.0.0-beta.5",
|
|
129
|
+
"@stencil/dev-server": "5.0.0-beta.5",
|
|
130
|
+
"@stencil/cli": "5.0.0-beta.5"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
133
|
"@ionic/prettier-config": "^4.0.0",
|