create-vanilla-vite 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -13,6 +13,8 @@ Create a Vite app with the official interactive setup. Choose React or any other
13
13
  - Node.js 20 or newer
14
14
  - npm or pnpm
15
15
 
16
+ The commands below work in Windows PowerShell or Command Prompt as well as macOS and Linux terminals. pnpm commands require pnpm to be installed; npm is sufficient.
17
+
16
18
  ## Create a project
17
19
 
18
20
  With pnpm:
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
4
- import { spawn } from "node:child_process";
4
+ import spawn from "cross-spawn";
5
5
  import { emitKeypressEvents } from "node:readline";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  import { stdin, stdout } from "node:process";
@@ -43,11 +43,12 @@ const clientFolder = `${projectName}-client`;
43
43
  const serverFolder = `${projectName}-server`;
44
44
  const packageRoot = fileURLToPath(new URL("../", import.meta.url));
45
45
  const scriptRoot = fileURLToPath(new URL("../scripts/", import.meta.url));
46
+ const cliPackage = JSON.parse(
47
+ await readFile(join(packageRoot, "package.json"), "utf8"),
48
+ );
46
49
 
47
50
  async function updateIfOutdated() {
48
- const { version: installedVersion } = JSON.parse(
49
- await readFile(join(packageRoot, "package.json"), "utf8"),
50
- );
51
+ const { version: installedVersion } = cliPackage;
51
52
  const registry = (process.env.npm_config_registry || "https://registry.npmjs.org")
52
53
  .replace(/\/$/, "");
53
54
 
@@ -400,6 +401,9 @@ try {
400
401
  ...(includeServer ? { server: "node scripts/run-app.mjs server" } : {}),
401
402
  },
402
403
  type: "module",
404
+ dependencies: {
405
+ "cross-spawn": cliPackage.dependencies["cross-spawn"],
406
+ },
403
407
  };
404
408
  await writeFile(join(root, "package.json"), `${JSON.stringify(rootPackage, null, 2)}\n`);
405
409
  await writeFile(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vanilla-vite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Scaffold a React or Vite app with an optional Node.js or Express backend",
5
5
  "type": "module",
6
6
  "repository": {
@@ -42,5 +42,8 @@
42
42
  "javascript",
43
43
  "cli"
44
44
  ],
45
- "license": "ISC"
45
+ "license": "ISC",
46
+ "dependencies": {
47
+ "cross-spawn": "^7.0.6"
48
+ }
46
49
  }
package/scripts/dev.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { spawn } from "node:child_process";
1
+ import spawn from "cross-spawn";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -1,4 +1,4 @@
1
- import { spawn } from "node:child_process";
1
+ import spawn from "cross-spawn";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";