@stencil/core 5.0.0-alpha.26 → 5.0.0-alpha.28

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.
@@ -1,4 +1,4 @@
1
1
  import { f as scopeCss } from "../client-CvcvHKz4.mjs";
2
- import { C as version, S as vermoji, _ as cmpMetaToDocsComponent, a as createPrerenderer, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, i as createSystem, l as createWorkerMessageHandler, m as validateConfig, n as transpile, o as loadConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, w as versions, x as buildId, y as getScopeId } from "../compiler-qcxWTHA-.mjs";
2
+ import { C as version, S as vermoji, _ as cmpMetaToDocsComponent, a as createPrerenderer, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, i as createSystem, l as createWorkerMessageHandler, m as validateConfig, n as transpile, o as loadConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, w as versions, x as buildId, y as getScopeId } from "../compiler-BEGofLCO.mjs";
3
3
  import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-BlgRcMMi.mjs";
4
4
  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 };
@@ -28,9 +28,9 @@ import { createJiti } from "jiti";
28
28
  import * as process$1 from "process";
29
29
  import { dataToEsm } from "@rollup/pluginutils";
30
30
  //#region src/version.ts
31
- const version = "5.0.0-alpha.26";
32
- const buildId = "1783975744";
33
- const vermoji = "🌜";
31
+ const version = "5.0.0-alpha.28";
32
+ const buildId = "1784191171";
33
+ const vermoji = "🎳";
34
34
  /**
35
35
  * Get the installed version of a tool/dependency.
36
36
  * Handles packages with exports maps that point to subdirectories.
@@ -256,7 +256,7 @@ const resetModuleLegacy = (moduleFile) => {
256
256
  */
257
257
  const getTsOptionsToExtend = (config) => {
258
258
  const cacheDir = config.cacheDir || config.sys.tmpDirSync();
259
- return {
259
+ const tsOptions = {
260
260
  experimentalDecorators: true,
261
261
  declaration: config.outputTargets.some(isOutputTargetTypes),
262
262
  module: config.tsCompilerOptions?.module || ts.ModuleKind.ESNext,
@@ -269,6 +269,8 @@ const getTsOptionsToExtend = (config) => {
269
269
  incremental: config.enableCache !== false,
270
270
  tsBuildInfoFile: config.enableCache !== false ? join$2(cacheDir, ".tsbuildinfo") : void 0
271
271
  };
272
+ if (config.tsCompilerOptions?.skipLibCheck === void 0) tsOptions.skipLibCheck = true;
273
+ return tsOptions;
272
274
  };
273
275
  //#endregion
274
276
  //#region src/compiler/transpile/create-build-program.ts
@@ -16019,6 +16021,18 @@ const validateUniqueTagNames = (config, buildCtx, cmp) => {
16019
16021
  //#endregion
16020
16022
  //#region src/compiler/transpile/run-program.ts
16021
16023
  /**
16024
+ * In dev mode, downgrade unused-variable diagnostics to warnings so they don't fail the build
16025
+ * while a component is mid-edit.
16026
+ *
16027
+ * @param config - the validated Stencil configuration
16028
+ * @param diags - the diagnostics to relax in place
16029
+ */
16030
+ const applyDevModeRelaxation = (config, diags) => {
16031
+ if (config.devMode) diags.forEach((diag) => {
16032
+ if (diag.code === "6133" || diag.code === "6192") diag.level = "warn";
16033
+ });
16034
+ };
16035
+ /**
16022
16036
  * Run the TypeScript program to transpile source files.
16023
16037
  *
16024
16038
  * @param config - the validated Stencil configuration
@@ -16039,6 +16053,21 @@ const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
16039
16053
  const tsTypeChecker = tsProgram.getTypeChecker();
16040
16054
  const typesOutputTarget = config.outputTargets.filter(isOutputTargetTypes);
16041
16055
  const emittedDts = [];
16056
+ if (buildCtx.isRebuild && buildCtx.hasScriptChanges && config.validateTypes) {
16057
+ const emitBuilder = tsBuilder;
16058
+ let affected = emitBuilder.getSemanticDiagnosticsOfNextAffectedFile?.();
16059
+ while (affected) {
16060
+ if ("fileName" in affected.affected) {
16061
+ const fileName = normalizePath(affected.affected.fileName);
16062
+ if (!fileName.includes("node_modules") && !fileName.endsWith(".d.ts") && fileName.startsWith(normalizePath(config.srcDir))) {
16063
+ const tsSemantic = loadTypeScriptDiagnostics(affected.result);
16064
+ applyDevModeRelaxation(config, tsSemantic);
16065
+ buildCtx.diagnostics.push(...tsSemantic);
16066
+ }
16067
+ }
16068
+ affected = emitBuilder.getSemanticDiagnosticsOfNextAffectedFile?.();
16069
+ }
16070
+ }
16042
16071
  const emitCallback = (emitFilePath, data, _w, _e, tsSourceFiles) => {
16043
16072
  if (emitFilePath.includes("e2e.") || emitFilePath.includes("spec.") || emitFilePath.endsWith("e2e.d.ts") || emitFilePath.endsWith("spec.d.ts")) return;
16044
16073
  if (emitFilePath.endsWith(".js") || emitFilePath.endsWith("js.map")) updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data, emitFilePath, tsTypeChecker, null);
@@ -16126,36 +16155,15 @@ const validateTypesAfterGeneration = async (config, compilerCtx, buildCtx, tsBui
16126
16155
  needsRebuild: true
16127
16156
  };
16128
16157
  }
16129
- if (config.validateTypes) {
16130
- const applyDevModeRelaxation = (diags) => {
16131
- if (config.devMode) diags.forEach((d) => {
16132
- if (d.code === "6133" || d.code === "6192") d.level = "warn";
16133
- });
16134
- };
16135
- if (buildCtx.isRebuild) {
16136
- const emitBuilder = tsBuilder;
16137
- let affected = emitBuilder.getSemanticDiagnosticsOfNextAffectedFile?.();
16138
- while (affected) {
16139
- if ("fileName" in affected.affected) {
16140
- const fileName = normalizePath(affected.affected.fileName);
16141
- if (!fileName.includes("node_modules") && !fileName.endsWith(".d.ts") && fileName.startsWith(normalizePath(config.srcDir))) {
16142
- const tsSemantic = loadTypeScriptDiagnostics(affected.result);
16143
- applyDevModeRelaxation(tsSemantic);
16144
- buildCtx.diagnostics.push(...tsSemantic);
16145
- }
16146
- }
16147
- affected = emitBuilder.getSemanticDiagnosticsOfNextAffectedFile?.();
16148
- }
16149
- } else {
16150
- const sourceFiles = tsProgram.getSourceFiles().filter((sf) => {
16151
- const fileName = normalizePath(sf.fileName);
16152
- return !fileName.includes("node_modules") && !fileName.endsWith(".d.ts") && fileName.startsWith(normalizePath(config.srcDir));
16153
- });
16154
- for (const sourceFile of sourceFiles) {
16155
- const tsSemantic = loadTypeScriptDiagnostics(tsProgram.getSemanticDiagnostics(sourceFile));
16156
- applyDevModeRelaxation(tsSemantic);
16157
- buildCtx.diagnostics.push(...tsSemantic);
16158
- }
16158
+ if (config.validateTypes && !buildCtx.isRebuild) {
16159
+ const sourceFiles = tsProgram.getSourceFiles().filter((sf) => {
16160
+ const fileName = normalizePath(sf.fileName);
16161
+ return !fileName.includes("node_modules") && !fileName.endsWith(".d.ts") && fileName.startsWith(normalizePath(config.srcDir));
16162
+ });
16163
+ for (const sourceFile of sourceFiles) {
16164
+ const tsSemantic = loadTypeScriptDiagnostics(tsProgram.getSemanticDiagnostics(sourceFile));
16165
+ applyDevModeRelaxation(config, tsSemantic);
16166
+ buildCtx.diagnostics.push(...tsSemantic);
16159
16167
  }
16160
16168
  }
16161
16169
  const hasTypesChanged = await generateAppTypes(config, compilerCtx, buildCtx, "src");
@@ -1,4 +1,4 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-qcxWTHA-.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-BEGofLCO.mjs";
2
2
  import { t as createNodeSys } from "../../node-BlgRcMMi.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { A as HYDRATE_ID, C as setAssetPath, D as DEFAULT_DOC_DATA, F as reWireGetterSetter, M as STENCIL_DOC_DATA, P as getHostRef$1, S as getAssetPath, X as Env, Y as BUILD, _ as insertBefore, b as getElement, c as Fragment, g as getRenderingRef, h as forceUpdate, j as NODE_TYPE, k as HYDRATE_CHILD_ID, l as bootstrapLazy, m as h, p as Host, s as Mixin, u as getMode, v as renderVdom, y as createEvent } from "../client-CvcvHKz4.mjs";
2
2
  import { L as EVENT_FLAGS, h as noop, w as CMP_FLAGS } from "../regular-expression-CFVJOTUh.mjs";
3
- import { b as getBuildFeatures, c as createWorkerContext, h as Cache, i as createSystem, o as loadConfig, p as createInMemoryFs, s as createCompiler, v as BuildContext } from "../compiler-qcxWTHA-.mjs";
3
+ import { b as getBuildFeatures, c as createWorkerContext, h as Cache, i as createSystem, o as loadConfig, p as createInMemoryFs, s as createCompiler, v as BuildContext } from "../compiler-BEGofLCO.mjs";
4
4
  import { wt as formatLazyBundleRuntimeMeta } from "../validation-CtaOJgnM.mjs";
5
5
  import { o as buildEvents } from "../node-BlgRcMMi.mjs";
6
6
  import fs from "node:fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-alpha.26",
3
+ "version": "5.0.0-alpha.28",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -121,9 +121,9 @@
121
121
  "terser": "^5.0.0",
122
122
  "tinyglobby": "^0.2.0",
123
123
  "typescript": ">4.0.0 <7.0.0",
124
- "@stencil/cli": "5.0.0-alpha.26",
125
- "@stencil/mock-doc": "5.0.0-alpha.26",
126
- "@stencil/dev-server": "5.0.0-alpha.26"
124
+ "@stencil/cli": "5.0.0-alpha.28",
125
+ "@stencil/mock-doc": "5.0.0-alpha.28",
126
+ "@stencil/dev-server": "5.0.0-alpha.28"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@ionic/prettier-config": "^4.0.0",