create-astro 5.0.0 → 5.0.2

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/create-astro.mjs CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  const currentVersion = process.versions.node;
6
6
  const requiredMajorVersion = Number.parseInt(currentVersion.split('.')[0], 10);
7
- // TODO: remove once Stackblitz supports Node 22
8
- const IS_STACKBLITZ = !!process.versions.webcontainer;
9
- const minimumMajorVersion = IS_STACKBLITZ ? 20 : 22;
7
+ const minimumMajorVersion = 22;
10
8
 
11
9
  if (requiredMajorVersion < minimumMajorVersion) {
12
10
  console.error(`Node.js v${currentVersion} is out-of-date and unsupported!`);
package/dist/index.js CHANGED
@@ -289,21 +289,28 @@ import { align, sleep } from "@astrojs/cli-kit/utils";
289
289
  // src/shell.ts
290
290
  import { spawn } from "node:child_process";
291
291
  import { text as textFromStream } from "node:stream/consumers";
292
+ var WINDOWS_CMD_SHIMS = /* @__PURE__ */ new Set(["npm", "npx", "pnpm", "pnpx", "yarn", "yarnpkg", "bun", "bunx"]);
292
293
  var text = (stream) => stream ? textFromStream(stream).then((t) => t.trimEnd()) : "";
294
+ function resolveCommand(command) {
295
+ if (process.platform !== "win32") return command;
296
+ if (command.includes("/") || command.includes("\\") || command.includes(".")) return command;
297
+ return WINDOWS_CMD_SHIMS.has(command.toLowerCase()) ? `${command}.cmd` : command;
298
+ }
293
299
  async function shell(command, flags, opts = {}) {
294
300
  let child;
295
301
  let stdout2 = "";
296
302
  let stderr = "";
297
303
  try {
298
- child = spawn(command, flags, {
304
+ child = spawn(resolveCommand(command), flags, {
299
305
  cwd: opts.cwd,
300
- shell: true,
301
306
  stdio: opts.stdio,
302
307
  timeout: opts.timeout
303
308
  });
304
- const done = new Promise((resolve) => child.on("close", resolve));
305
- [stdout2, stderr] = await Promise.all([text(child.stdout), text(child.stderr)]);
306
- await done;
309
+ const done = new Promise((resolve, reject) => {
310
+ child.once("error", reject);
311
+ child.once("close", () => resolve());
312
+ });
313
+ [stdout2, stderr] = await Promise.all([text(child.stdout), text(child.stderr), done]);
307
314
  } catch {
308
315
  throw { stdout: stdout2, stderr, exitCode: 1 };
309
316
  }
@@ -413,7 +420,7 @@ ${prefix}Enter your project directory using`,
413
420
  log(enter.join(len > max ? "\n" + prefix : " "));
414
421
  }
415
422
  log(
416
- `${prefix}Run ${color.cyan(devCmd)} to start the dev server. ${color.cyan("CTRL+C")} to stop.`
423
+ `${prefix}Run ${color.cyan(devCmd)} to start the dev server. ${color.cyan("q")} + ${color.cyan("ENTER")} to stop.`
417
424
  );
418
425
  await sleep(100);
419
426
  log(
@@ -452,7 +459,7 @@ function printHelp({
452
459
  if (headline) {
453
460
  message.push(
454
461
  linebreak(),
455
- `${title(commandName)} ${color.green(`v${"5.0.0"}`)} ${headline}`
462
+ `${title(commandName)} ${color.green(`v${"5.0.2"}`)} ${headline}`
456
463
  );
457
464
  }
458
465
  if (usage) {
@@ -551,7 +558,7 @@ async function getContext(argv) {
551
558
  packageManager,
552
559
  "astro",
553
560
  getPackageTag(packageSpecifier),
554
- "6.0.0"
561
+ "6.0.6"
555
562
  ),
556
563
  skipHouston,
557
564
  fancy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "astro-scripts": "0.0.14"
35
35
  },
36
36
  "engines": {
37
- "node": "^20.19.1 || >=22.12.0"
37
+ "node": ">=22.12.0"
38
38
  },
39
39
  "publishConfig": {
40
40
  "provenance": true