create-astro 5.0.4 → 5.0.6
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/dist/index.js +13 -13
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -289,15 +289,20 @@ 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"
|
|
292
|
+
var WINDOWS_CMD_SHIMS = /* @__PURE__ */ new Set(["npm", "npx", "pnpm", "pnpx", "yarn", "yarnpkg"]);
|
|
293
|
+
var WINDOWS_EXE_SHIMS = /* @__PURE__ */ new Set(["bun", "bunx"]);
|
|
293
294
|
var text = (stream) => stream ? textFromStream(stream).then((t) => t.trimEnd()) : "";
|
|
294
295
|
function resolveCommand(command, flags) {
|
|
295
296
|
if (process.platform !== "win32") return [command, flags];
|
|
296
297
|
if (command.includes("/") || command.includes("\\") || command.includes("."))
|
|
297
298
|
return [command, flags];
|
|
298
|
-
|
|
299
|
+
const cmd = command.toLowerCase();
|
|
300
|
+
if (WINDOWS_CMD_SHIMS.has(cmd)) {
|
|
299
301
|
return ["cmd.exe", ["/d", "/s", "/c", `${command}.cmd`, ...flags]];
|
|
300
302
|
}
|
|
303
|
+
if (WINDOWS_EXE_SHIMS.has(cmd)) {
|
|
304
|
+
return [`${command}.exe`, flags];
|
|
305
|
+
}
|
|
301
306
|
return [command, flags];
|
|
302
307
|
}
|
|
303
308
|
async function shell(command, flags, opts = {}) {
|
|
@@ -465,7 +470,7 @@ function printHelp({
|
|
|
465
470
|
if (headline) {
|
|
466
471
|
message.push(
|
|
467
472
|
linebreak(),
|
|
468
|
-
`${title(commandName)} ${color.green(`v${"5.0.
|
|
473
|
+
`${title(commandName)} ${color.green(`v${"5.0.6"}`)} ${headline}`
|
|
469
474
|
);
|
|
470
475
|
}
|
|
471
476
|
if (usage) {
|
|
@@ -564,7 +569,7 @@ async function getContext(argv) {
|
|
|
564
569
|
packageManager,
|
|
565
570
|
"astro",
|
|
566
571
|
getPackageTag(packageSpecifier),
|
|
567
|
-
"6.1.
|
|
572
|
+
"6.1.9"
|
|
568
573
|
),
|
|
569
574
|
skipHouston,
|
|
570
575
|
fancy,
|
|
@@ -677,15 +682,10 @@ var FILES_TO_REMOVE = ["CHANGELOG.md", ".codesandbox"];
|
|
|
677
682
|
var FILES_TO_UPDATE = {
|
|
678
683
|
"package.json": (file, overrides) => fs.promises.readFile(file, "utf-8").then((value) => {
|
|
679
684
|
const indent = /(^\s+)/m.exec(value)?.[1] ?? " ";
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
null,
|
|
685
|
-
indent
|
|
686
|
-
),
|
|
687
|
-
"utf-8"
|
|
688
|
-
);
|
|
685
|
+
const packageJson = JSON.parse(value);
|
|
686
|
+
packageJson.name = overrides.name;
|
|
687
|
+
delete packageJson.private;
|
|
688
|
+
return fs.promises.writeFile(file, JSON.stringify(packageJson, null, indent), "utf-8");
|
|
689
689
|
})
|
|
690
690
|
};
|
|
691
691
|
function getTemplateTarget(tmpl, ref = "latest") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astro",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"arg": "^5.0.2",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"@astrojs/internal-helpers": "0.9.0",
|
|
34
|
+
"astro-scripts": "0.0.14"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22.12.0"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"build": "astro-scripts build \"src/index.ts\" --bundle && tsc",
|
|
44
44
|
"build:ci": "astro-scripts build \"src/index.ts\" --bundle",
|
|
45
45
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
46
|
-
"test": "astro-scripts test \"test/**/*.test.
|
|
46
|
+
"test": "astro-scripts test \"test/**/*.test.ts\"",
|
|
47
|
+
"typecheck:tests": "tsc --build tsconfig.test.json"
|
|
47
48
|
}
|
|
48
49
|
}
|