create-astro 3.0.3 → 3.0.5

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.js +11 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -362,7 +362,7 @@ function printHelp({
362
362
  if (headline) {
363
363
  message.push(
364
364
  linebreak(),
365
- `${title(commandName)} ${color.green(`v${"3.0.3"}`)} ${headline}`
365
+ `${title(commandName)} ${color.green(`v${"3.0.5"}`)} ${headline}`
366
366
  );
367
367
  }
368
368
  if (usage) {
@@ -568,6 +568,7 @@ function help() {
568
568
  headline: "Scaffold Astro projects.",
569
569
  tables: {
570
570
  Flags: [
571
+ ["--help (-h)", "See all available flags."],
571
572
  ["--template <name>", "Specify your template."],
572
573
  ["--install / --no-install", "Install dependencies (or not)."],
573
574
  ["--git / --no-git", "Initialize git repo (or not)."],
@@ -575,6 +576,8 @@ function help() {
575
576
  ["--no (-n)", "Skip all prompt by declining defaults."],
576
577
  ["--dry-run", "Walk through steps without executing."],
577
578
  ["--skip-houston", "Skip Houston animation."],
579
+ ["--ref", "Choose astro branch (default: latest)."],
580
+ ["--fancy", "Enable full unicode support for Windows."],
578
581
  ["--typescript <option>", "TypeScript option: strict | strictest | relaxed."]
579
582
  ]
580
583
  }
@@ -750,17 +753,19 @@ async function template(ctx) {
750
753
  }
751
754
  var FILES_TO_REMOVE = ["sandbox.config.json", "CHANGELOG.md"];
752
755
  var FILES_TO_UPDATE = {
753
- "package.json": (file, overrides) => fs3.promises.readFile(file, "utf-8").then(
754
- (value) => fs3.promises.writeFile(
756
+ "package.json": (file, overrides) => fs3.promises.readFile(file, "utf-8").then((value) => {
757
+ var _a;
758
+ const indent = ((_a = /(^\s+)/m.exec(value)) == null ? void 0 : _a[1]) ?? " ";
759
+ fs3.promises.writeFile(
755
760
  file,
756
761
  JSON.stringify(
757
762
  Object.assign(JSON.parse(value), Object.assign(overrides, { private: void 0 })),
758
763
  null,
759
- " "
764
+ indent
760
765
  ),
761
766
  "utf-8"
762
- )
763
- )
767
+ );
768
+ })
764
769
  };
765
770
  async function copyTemplate(tmpl, ctx) {
766
771
  const ref = ctx.ref || "latest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@types/which-pm-runs": "^1.0.0",
36
36
  "arg": "^5.0.2",
37
- "astro-scripts": "0.0.11",
37
+ "astro-scripts": "0.0.12",
38
38
  "strip-ansi": "^7.0.1",
39
39
  "strip-json-comments": "^5.0.0",
40
40
  "which-pm-runs": "^1.1.0"