create-astro 4.11.0 → 4.11.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/dist/index.js +12 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -442,7 +442,7 @@ function printHelp({
|
|
|
442
442
|
if (headline) {
|
|
443
443
|
message.push(
|
|
444
444
|
linebreak(),
|
|
445
|
-
`${title(commandName)} ${color.green(`v${"4.11.
|
|
445
|
+
`${title(commandName)} ${color.green(`v${"4.11.2"}`)} ${headline}`
|
|
446
446
|
);
|
|
447
447
|
}
|
|
448
448
|
if (usage) {
|
|
@@ -518,7 +518,7 @@ async function getContext(argv) {
|
|
|
518
518
|
prompt,
|
|
519
519
|
packageManager,
|
|
520
520
|
username: getName(),
|
|
521
|
-
version: getVersion(packageManager, "astro", "5.
|
|
521
|
+
version: getVersion(packageManager, "astro", "5.7.2"),
|
|
522
522
|
skipHouston,
|
|
523
523
|
fancy,
|
|
524
524
|
add,
|
|
@@ -628,7 +628,7 @@ async function astroAdd({
|
|
|
628
628
|
}
|
|
629
629
|
async function install({ packageManager, cwd }) {
|
|
630
630
|
if (packageManager === "yarn") await ensureYarnLock({ cwd });
|
|
631
|
-
return shell(packageManager, ["
|
|
631
|
+
return shell(packageManager, ["add"], { cwd, timeout: 9e4, stdio: "ignore" });
|
|
632
632
|
}
|
|
633
633
|
async function ensureYarnLock({ cwd }) {
|
|
634
634
|
const yarnLock = path.join(cwd, "yarn.lock");
|
|
@@ -883,9 +883,10 @@ async function template(ctx) {
|
|
|
883
883
|
message: "How would you like to start your new project?",
|
|
884
884
|
initial: "basics",
|
|
885
885
|
choices: [
|
|
886
|
-
{ value: "basics", label: "A basic,
|
|
886
|
+
{ value: "basics", label: "A basic, helpful starter project", hint: "(recommended)" },
|
|
887
887
|
{ value: "blog", label: "Use blog template" },
|
|
888
|
-
{ value: "starlight", label: "Use docs (Starlight) template" }
|
|
888
|
+
{ value: "starlight", label: "Use docs (Starlight) template" },
|
|
889
|
+
{ value: "minimal", label: "Use minimal (empty) template" }
|
|
889
890
|
]
|
|
890
891
|
});
|
|
891
892
|
ctx.template = tmpl;
|
|
@@ -948,6 +949,12 @@ async function copyTemplate(tmpl, ctx) {
|
|
|
948
949
|
cwd: ctx.cwd,
|
|
949
950
|
dir: "."
|
|
950
951
|
});
|
|
952
|
+
if (ctx.packageManager !== "npm") {
|
|
953
|
+
const readmePath = path5.resolve(ctx.cwd, "README.md");
|
|
954
|
+
const readme = fs4.readFileSync(readmePath, "utf8");
|
|
955
|
+
const updatedReadme = readme.replace(/\bnpm run\b/g, ctx.packageManager).replace(/\bnpm\b/g, ctx.packageManager);
|
|
956
|
+
fs4.writeFileSync(readmePath, updatedReadme);
|
|
957
|
+
}
|
|
951
958
|
} catch (err) {
|
|
952
959
|
if (ctx.cwd !== "." && ctx.cwd !== "./" && !ctx.cwd.startsWith("../")) {
|
|
953
960
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astro",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@astrojs/cli-kit": "^0.4.1",
|
|
29
|
-
"@bluwy/giget-core": "^0.1.
|
|
29
|
+
"@bluwy/giget-core": "^0.1.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"arg": "^5.0.2",
|