@stencil/cli 5.0.0-alpha.11 → 5.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +37 -14
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -1029,7 +1029,7 @@ async function isExistingStencilProject(dir) {
1029
1029
  }
1030
1030
  //#endregion
1031
1031
  //#region src/wizard/splash.ts
1032
- const CLI_VERSION = "5.0.0-alpha.11";
1032
+ const CLI_VERSION = "5.0.0-alpha.13";
1033
1033
  const isTTY = process.stdout.isTTY;
1034
1034
  const noColor = !isTTY || "NO_COLOR" in process.env;
1035
1035
  const RESET = noColor ? "" : "\x1B[0m";
@@ -3604,6 +3604,37 @@ async function copyTemplate(rootDir, projectName, namespace, stencilVersion) {
3604
3604
  else await writeIfAbsent(destPath, content);
3605
3605
  }
3606
3606
  }
3607
+ const PARCEL_WATCHER_BUILD_ALLOWANCES = [
3608
+ `onlyBuiltDependencies:`,
3609
+ ` - '@parcel/watcher'`,
3610
+ ``,
3611
+ `allowBuilds:`,
3612
+ ` '@parcel/watcher': true`
3613
+ ].join("\n");
3614
+ async function mergePnpmWorkspaceYaml(yamlPath) {
3615
+ let existing = null;
3616
+ try {
3617
+ existing = await readFile(yamlPath, "utf8");
3618
+ } catch {}
3619
+ if (existing === null) {
3620
+ await writeFile(yamlPath, [
3621
+ `packages:`,
3622
+ ` - 'packages/*'`,
3623
+ ``,
3624
+ PARCEL_WATCHER_BUILD_ALLOWANCES,
3625
+ ``
3626
+ ].join("\n"), "utf8");
3627
+ return;
3628
+ }
3629
+ let toAppend = "";
3630
+ if (!existing.includes("packages/*")) toAppend += `\npackages:\n - 'packages/*'\n`;
3631
+ if (!existing.includes("onlyBuiltDependencies:")) toAppend += `\nonlyBuiltDependencies:\n - '@parcel/watcher'\n`;
3632
+ if (!existing.includes("allowBuilds:")) toAppend += `\nallowBuilds:\n '@parcel/watcher': true\n`;
3633
+ if (toAppend) {
3634
+ const separator = existing.endsWith("\n") ? "" : "\n";
3635
+ await writeFile(yamlPath, existing + separator + toAppend, "utf8");
3636
+ }
3637
+ }
3607
3638
  async function writeIfAbsent(destPath, content) {
3608
3639
  try {
3609
3640
  await writeFile(destPath, content, {
@@ -3720,17 +3751,7 @@ async function scaffoldWorkspaceRoot(cwd, projectName) {
3720
3751
  delete pkg.dependencies;
3721
3752
  delete pkg.devDependencies;
3722
3753
  await writeFile(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf8");
3723
- if (usePnpmYaml) {
3724
- const yamlPath = join(cwd, "pnpm-workspace.yaml");
3725
- try {
3726
- await writeFile(yamlPath, `packages:\n - 'packages/*'\n`, {
3727
- encoding: "utf8",
3728
- flag: "wx"
3729
- });
3730
- } catch (e) {
3731
- if (e.code !== "EEXIST") throw e;
3732
- }
3733
- }
3754
+ if (usePnpmYaml) await mergePnpmWorkspaceYaml(join(cwd, "pnpm-workspace.yaml"));
3734
3755
  }
3735
3756
  /**
3736
3757
  * Write output-driven distributable fields (type, module, types) into package.json.
@@ -3985,13 +4006,15 @@ const run = async (init) => {
3985
4006
  if (task === "add") await taskAdd(flags.unknownArgs, strictConfig);
3986
4007
  else {
3987
4008
  const loadProjectConfig = async (configPath) => {
4009
+ const derivedRootDir = configPath ? dirname(configPath) : rootDir;
3988
4010
  const loaded = await coreCompiler.loadConfig({
3989
- config: { rootDir: configPath ? dirname(configPath) : rootDir },
4011
+ config: { rootDir: derivedRootDir },
3990
4012
  configPath,
3991
4013
  logger,
3992
4014
  sys
3993
4015
  });
3994
- return coreCompiler.validateConfig(loaded.config, {}).config;
4016
+ if (loaded.diagnostics.length > 0) logger.printDiagnostics(loaded.diagnostics);
4017
+ return coreCompiler.validateConfig(loaded.config ?? { rootDir: derivedRootDir }, {}).config;
3995
4018
  };
3996
4019
  await taskInit(coreCompiler, strictConfig, loadProjectConfig);
3997
4020
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/cli",
3
- "version": "5.0.0-alpha.11",
3
+ "version": "5.0.0-alpha.13",
4
4
  "description": "CLI for Stencil - Web component compiler",
5
5
  "keywords": [
6
6
  "components",
@@ -41,13 +41,13 @@
41
41
  "nypm": "^0.3.12",
42
42
  "std-env": "^3.8.0",
43
43
  "typescript": ">4.0.0 <7.0.0",
44
- "@stencil/dev-server": "5.0.0-alpha.11",
45
- "@stencil/templates": "5.0.0-alpha.11"
44
+ "@stencil/dev-server": "5.0.0-alpha.13",
45
+ "@stencil/templates": "5.0.0-alpha.13"
46
46
  },
47
47
  "devDependencies": {
48
48
  "tsdown": ">=0.21.0 <1.0.0",
49
49
  "vitest": "^4.1.7",
50
- "@stencil/core": "5.0.0-alpha.11"
50
+ "@stencil/core": "5.0.0-alpha.13"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@stencil/core": "^5.0.0-0"