create-astro 3.0.4 → 3.1.0

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 +21 -19
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -189,13 +189,13 @@ var require_which_pm_runs = __commonJS({
189
189
  var import_arg = __toESM(require_arg(), 1);
190
190
  var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
191
191
  import { prompt } from "@astrojs/cli-kit";
192
- import os from "os";
192
+ import os from "node:os";
193
193
 
194
194
  // src/messages.ts
195
195
  import { color, label, say as houston, spinner as load } from "@astrojs/cli-kit";
196
196
  import { align, sleep } from "@astrojs/cli-kit/utils";
197
- import { exec } from "child_process";
198
- import { get } from "https";
197
+ import { exec } from "node:child_process";
198
+ import { get } from "node:https";
199
199
 
200
200
  // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
201
201
  function ansiRegex({ onlyFirst = false } = {}) {
@@ -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.4"}`)} ${headline}`
365
+ `${title(commandName)} ${color.green(`v${"3.1.0"}`)} ${headline}`
366
366
  );
367
367
  }
368
368
  if (usage) {
@@ -504,8 +504,8 @@ async function install({ pkgManager, cwd }) {
504
504
  }
505
505
 
506
506
  // src/actions/git.ts
507
- import fs from "fs";
508
- import path from "path";
507
+ import fs from "node:fs";
508
+ import path from "node:path";
509
509
  import { color as color2 } from "@astrojs/cli-kit";
510
510
  import { execa as execa2 } from "execa";
511
511
  async function git(ctx) {
@@ -606,7 +606,7 @@ async function intro(ctx) {
606
606
  }
607
607
 
608
608
  // src/actions/next-steps.ts
609
- import path2 from "path";
609
+ import path2 from "node:path";
610
610
  async function next(ctx) {
611
611
  let projectDir = path2.relative(process.cwd(), ctx.cwd);
612
612
  const devCmd = ctx.pkgManager === "npm" ? "npm run dev" : `${ctx.pkgManager} dev`;
@@ -619,10 +619,10 @@ async function next(ctx) {
619
619
 
620
620
  // src/actions/project-name.ts
621
621
  import { color as color4, generateProjectName } from "@astrojs/cli-kit";
622
- import path3 from "path";
622
+ import path3 from "node:path";
623
623
 
624
624
  // src/actions/shared.ts
625
- import fs2 from "fs";
625
+ import fs2 from "node:fs";
626
626
  var VALID_PROJECT_DIRECTORY_SAFE_LIST = [
627
627
  ".DS_Store",
628
628
  ".git",
@@ -716,8 +716,8 @@ async function checkCwd(cwd) {
716
716
  // src/actions/template.ts
717
717
  import { color as color5 } from "@astrojs/cli-kit";
718
718
  import { downloadTemplate } from "giget";
719
- import fs3 from "fs";
720
- import path4 from "path";
719
+ import fs3 from "node:fs";
720
+ import path4 from "node:path";
721
721
  async function template(ctx) {
722
722
  if (!ctx.template) {
723
723
  const { template: tmpl } = await ctx.prompt({
@@ -753,17 +753,19 @@ async function template(ctx) {
753
753
  }
754
754
  var FILES_TO_REMOVE = ["sandbox.config.json", "CHANGELOG.md"];
755
755
  var FILES_TO_UPDATE = {
756
- "package.json": (file, overrides) => fs3.promises.readFile(file, "utf-8").then(
757
- (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(
758
760
  file,
759
761
  JSON.stringify(
760
762
  Object.assign(JSON.parse(value), Object.assign(overrides, { private: void 0 })),
761
763
  null,
762
- " "
764
+ indent
763
765
  ),
764
766
  "utf-8"
765
- )
766
- )
767
+ );
768
+ })
767
769
  };
768
770
  async function copyTemplate(tmpl, ctx) {
769
771
  const ref = ctx.ref || "latest";
@@ -804,9 +806,9 @@ async function copyTemplate(tmpl, ctx) {
804
806
 
805
807
  // src/actions/typescript.ts
806
808
  import { color as color6 } from "@astrojs/cli-kit";
807
- import fs4 from "fs";
808
- import { readFile } from "fs/promises";
809
- import path5 from "path";
809
+ import fs4 from "node:fs";
810
+ import { readFile } from "node:fs/promises";
811
+ import path5 from "node:path";
810
812
 
811
813
  // ../../node_modules/.pnpm/strip-json-comments@5.0.0/node_modules/strip-json-comments/index.js
812
814
  var singleComment = Symbol("singleComment");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
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.12",
37
+ "astro-scripts": "0.0.14",
38
38
  "strip-ansi": "^7.0.1",
39
39
  "strip-json-comments": "^5.0.0",
40
40
  "which-pm-runs": "^1.1.0"