@stencil/cli 5.0.0-alpha.21 → 5.0.0-alpha.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.
Files changed (2) hide show
  1. package/dist/index.mjs +12 -2
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { pathToFileURL } from "node:url";
12
12
  import { existsSync } from "node:fs";
13
13
  import { homedir } from "node:os";
14
14
  import { dirname as dirname$1, isAbsolute, join as join$1, relative as relative$1 } from "path";
15
- import { generatePackageJsonFields, generateStencilConfig, getComponentBoilerplate, getStyleBoilerplate, getTemplatePath, toPascalCase } from "@stencil/templates";
15
+ import { generateIndexHtml, generatePackageJsonFields, generateStencilConfig, getComponentBoilerplate, getStyleBoilerplate, getTemplatePath, toPascalCase } from "@stencil/templates";
16
16
  import { start } from "@stencil/dev-server";
17
17
  //#region src/config-flags.ts
18
18
  /**
@@ -1193,7 +1193,7 @@ async function isExistingStencilProject(dir) {
1193
1193
  }
1194
1194
  //#endregion
1195
1195
  //#region src/wizard/splash.ts
1196
- const CLI_VERSION = "5.0.0-alpha.21";
1196
+ const CLI_VERSION = "5.0.0-alpha.23";
1197
1197
  const isTTY = process.stdout.isTTY;
1198
1198
  const noColor = !isTTY || "NO_COLOR" in process.env;
1199
1199
  const RESET = noColor ? "" : "\x1B[0m";
@@ -3883,6 +3883,11 @@ async function writeGlobalScript(rootDir) {
3883
3883
  await mkdir(dirname(path), { recursive: true });
3884
3884
  await writeIfAbsent(path, `export default function (): void {}\n`);
3885
3885
  }
3886
+ async function writeIndexHtml(rootDir, content) {
3887
+ const path = join(rootDir, "src", "index.html");
3888
+ await mkdir(dirname(path), { recursive: true });
3889
+ await writeIfAbsent(path, content);
3890
+ }
3886
3891
  function workspaceBuildScript(pm) {
3887
3892
  switch (pm) {
3888
3893
  case "pnpm": return "pnpm -r build";
@@ -4000,6 +4005,11 @@ async function taskInit(coreCompiler, strictConfig, loadProjectConfig) {
4000
4005
  if (configSource) await writeStencilConfig(coreDir, configSource);
4001
4006
  if (features.globalStyle) await writeGlobalStyle(coreDir);
4002
4007
  if (features.globalScript) await writeGlobalScript(coreDir);
4008
+ if (outputs.includes("www")) await writeIndexHtml(coreDir, generateIndexHtml({
4009
+ projectName,
4010
+ namespace,
4011
+ globalStyle: features.globalStyle
4012
+ }));
4003
4013
  s1.stop("Project files created");
4004
4014
  const s2 = p.spinner();
4005
4015
  s2.start("Installing dependencies");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/cli",
3
- "version": "5.0.0-alpha.21",
3
+ "version": "5.0.0-alpha.23",
4
4
  "description": "CLI for Stencil - Web component compiler",
5
5
  "keywords": [
6
6
  "components",
@@ -41,16 +41,16 @@
41
41
  "nypm": "^0.3.12",
42
42
  "std-env": "^3.8.0",
43
43
  "typescript": ">4.0.0 <7.0.0",
44
- "@stencil/templates": "5.0.0-alpha.21",
45
- "@stencil/dev-server": "5.0.0-alpha.21"
44
+ "@stencil/dev-server": "5.0.0-alpha.23",
45
+ "@stencil/templates": "5.0.0-alpha.23"
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.21"
50
+ "@stencil/core": "5.0.0-alpha.23"
51
51
  },
52
52
  "peerDependencies": {
53
- "@stencil/core": "^5.0.0 || 5.0.0-alpha.21"
53
+ "@stencil/core": "^5.0.0 || 5.0.0-alpha.23"
54
54
  },
55
55
  "volta": {
56
56
  "extends": "../../package.json"