create-astro 3.1.9 → 4.0.0-beta.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 +11 -14
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -28,12 +28,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var require_arg = __commonJS({
29
29
  "../../node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.js"(exports, module) {
30
30
  var flagSymbol = Symbol("arg flag");
31
- var ArgError = class extends Error {
31
+ var ArgError = class _ArgError extends Error {
32
32
  constructor(msg, code) {
33
33
  super(msg);
34
34
  this.name = "ArgError";
35
35
  this.code = code;
36
- Object.setPrototypeOf(this, ArgError.prototype);
36
+ Object.setPrototypeOf(this, _ArgError.prototype);
37
37
  }
38
38
  };
39
39
  function arg2(opts, {
@@ -175,7 +175,7 @@ import os from "node:os";
175
175
  import detectPackageManager2 from "which-pm-runs";
176
176
 
177
177
  // src/messages.ts
178
- import { color, label, say as houston, spinner as load } from "@astrojs/cli-kit";
178
+ import { color, say as houston, label, spinner as load } from "@astrojs/cli-kit";
179
179
  import { align, sleep } from "@astrojs/cli-kit/utils";
180
180
  import { execa } from "execa";
181
181
  import fetch from "node-fetch-native";
@@ -202,11 +202,10 @@ function stripAnsi(string) {
202
202
  // src/messages.ts
203
203
  import detectPackageManager from "which-pm-runs";
204
204
  async function getRegistry() {
205
- var _a, _b;
206
- const packageManager = ((_a = detectPackageManager()) == null ? void 0 : _a.name) || "npm";
205
+ const packageManager = detectPackageManager()?.name || "npm";
207
206
  try {
208
207
  const { stdout: stdout2 } = await execa(packageManager, ["config", "get", "registry"]);
209
- return ((_b = stdout2 == null ? void 0 : stdout2.trim()) == null ? void 0 : _b.replace(/\/$/, "")) || "https://registry.npmjs.org";
208
+ return stdout2?.trim()?.replace(/\/$/, "") || "https://registry.npmjs.org";
210
209
  } catch (e) {
211
210
  return "https://registry.npmjs.org";
212
211
  }
@@ -243,11 +242,11 @@ var welcome = [
243
242
  `Awaiting further instructions.`
244
243
  ];
245
244
  var getName = () => new Promise((resolve) => {
246
- exec("git config user.name", { encoding: "utf-8" }, (_1, gitName, _2) => {
245
+ exec("git config user.name", { encoding: "utf-8" }, (_1, gitName) => {
247
246
  if (gitName.trim()) {
248
247
  return resolve(gitName.split(" ")[0].trim());
249
248
  }
250
- exec("whoami", { encoding: "utf-8" }, (_3, whoami, _4) => {
249
+ exec("whoami", { encoding: "utf-8" }, (_3, whoami) => {
251
250
  if (whoami.trim()) {
252
251
  return resolve(whoami.split(" ")[0].trim());
253
252
  }
@@ -356,7 +355,7 @@ function printHelp({
356
355
  if (headline) {
357
356
  message.push(
358
357
  linebreak(),
359
- `${title(commandName)} ${color.green(`v${"3.1.9"}`)} ${headline}`
358
+ `${title(commandName)} ${color.green(`v${"4.0.0-beta.0"}`)} ${headline}`
360
359
  );
361
360
  }
362
361
  if (usage) {
@@ -381,7 +380,6 @@ function printHelp({
381
380
 
382
381
  // src/actions/context.ts
383
382
  async function getContext(argv) {
384
- var _a;
385
383
  const flags = (0, import_arg.default)(
386
384
  {
387
385
  "--template": String,
@@ -403,7 +401,7 @@ async function getContext(argv) {
403
401
  },
404
402
  { argv, permissive: true }
405
403
  );
406
- const pkgManager = ((_a = detectPackageManager2()) == null ? void 0 : _a.name) ?? "npm";
404
+ const pkgManager = detectPackageManager2()?.name ?? "npm";
407
405
  const [username, version] = await Promise.all([getName(), getVersion()]);
408
406
  let cwd = flags["_"][0];
409
407
  let {
@@ -475,7 +473,7 @@ async function dependencies(ctx) {
475
473
  await info("--dry-run", `Skipping dependency installation`);
476
474
  } else if (deps) {
477
475
  await spinner({
478
- start: `Dependencies installing with ${ctx.pkgManager}...`,
476
+ start: `Installing dependencies with ${ctx.pkgManager}...`,
479
477
  end: "Dependencies installed",
480
478
  while: () => {
481
479
  return install({ pkgManager: ctx.pkgManager, cwd: ctx.cwd }).catch((e) => {
@@ -763,8 +761,7 @@ async function template(ctx) {
763
761
  var FILES_TO_REMOVE = ["sandbox.config.json", "CHANGELOG.md"];
764
762
  var FILES_TO_UPDATE = {
765
763
  "package.json": (file, overrides) => fs3.promises.readFile(file, "utf-8").then((value) => {
766
- var _a;
767
- const indent = ((_a = /(^\s+)/m.exec(value)) == null ? void 0 : _a[1]) ?? " ";
764
+ const indent = /(^\s+)/m.exec(value)?.[1] ?? " ";
768
765
  fs3.promises.writeFile(
769
766
  file,
770
767
  JSON.stringify(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.1.9",
3
+ "version": "4.0.0-beta.0",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "astro-scripts": "0.0.14"
42
42
  },
43
43
  "engines": {
44
- "node": ">=16.12.0"
44
+ "node": ">=18.14.1"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "astro-scripts build \"src/index.ts\" --bundle && tsc",