create-astro 4.8.4 → 4.9.1

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 +20 -23
  2. package/package.json +1 -2
package/dist/index.js CHANGED
@@ -278,27 +278,10 @@ function rarity(frequency, emoji) {
278
278
 
279
279
  // src/messages.ts
280
280
  import { exec } from "node:child_process";
281
+ import { stripVTControlCharacters } from "node:util";
281
282
  import { color, say as houston, label, spinner as load } from "@astrojs/cli-kit";
282
283
  import { align, sleep } from "@astrojs/cli-kit/utils";
283
284
 
284
- // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
285
- function ansiRegex({ onlyFirst = false } = {}) {
286
- const pattern = [
287
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
288
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
289
- ].join("|");
290
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
291
- }
292
-
293
- // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
294
- var regex = ansiRegex();
295
- function stripAnsi(string) {
296
- if (typeof string !== "string") {
297
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
298
- }
299
- return string.replace(regex, "");
300
- }
301
-
302
285
  // src/shell.ts
303
286
  import { spawn } from "node:child_process";
304
287
  import { text as textFromStream } from "node:stream/consumers";
@@ -420,7 +403,7 @@ var nextSteps = async ({ projectDir, devCmd }) => {
420
403
  ${prefix}Enter your project directory using`,
421
404
  color.cyan(`cd ${projectDir}`, "")
422
405
  ];
423
- const len = enter[0].length + stripAnsi(enter[1]).length;
406
+ const len = enter[0].length + stripVTControlCharacters(enter[1]).length;
424
407
  log(enter.join(len > max ? "\n" + prefix : " "));
425
408
  }
426
409
  log(
@@ -463,7 +446,7 @@ function printHelp({
463
446
  if (headline) {
464
447
  message.push(
465
448
  linebreak(),
466
- `${title(commandName)} ${color.green(`v${"4.8.4"}`)} ${headline}`
449
+ `${title(commandName)} ${color.green(`v${"4.9.1"}`)} ${headline}`
467
450
  );
468
451
  }
469
452
  if (usage) {
@@ -540,7 +523,7 @@ async function getContext(argv) {
540
523
  prompt,
541
524
  packageManager,
542
525
  username: getName(),
543
- version: getVersion(packageManager, "astro", "4.14.3"),
526
+ version: getVersion(packageManager, "astro", "4.15.12"),
544
527
  skipHouston,
545
528
  fancy,
546
529
  dryRun,
@@ -1140,8 +1123,8 @@ var FILES_TO_UPDATE2 = {
1140
1123
  parsedPackageJson.scripts.build = `astro check && ${buildScript}`;
1141
1124
  }
1142
1125
  const [astroCheckVersion, typescriptVersion] = await Promise.all([
1143
- getVersion(options.ctx.packageManager, "@astrojs/check", "0.9.3"),
1144
- getVersion(options.ctx.packageManager, "typescript", "5.5.4")
1126
+ getVersion(options.ctx.packageManager, "@astrojs/check", "0.9.4"),
1127
+ getVersion(options.ctx.packageManager, "typescript", "5.6.2")
1145
1128
  ]);
1146
1129
  parsedPackageJson.dependencies ??= {};
1147
1130
  parsedPackageJson.dependencies["@astrojs/check"] = `^${astroCheckVersion}`;
@@ -1174,6 +1157,20 @@ var FILES_TO_UPDATE2 = {
1174
1157
  );
1175
1158
  }
1176
1159
  }
1160
+ },
1161
+ "astro.config.mjs": async (file, options) => {
1162
+ if (!(options.value === "strict" || options.value === "strictest")) {
1163
+ return;
1164
+ }
1165
+ try {
1166
+ let data = await readFile(file, { encoding: "utf-8" });
1167
+ data = `// @ts-check
1168
+ ${data}`;
1169
+ await writeFile(file, data, { encoding: "utf-8" });
1170
+ } catch (err) {
1171
+ if (err && err.code === "ENOENT") return;
1172
+ if (err instanceof Error) throw new Error(err.message);
1173
+ }
1177
1174
  }
1178
1175
  };
1179
1176
  async function setupTypeScript(value, ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "4.8.4",
3
+ "version": "4.9.1",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -30,7 +30,6 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "arg": "^5.0.2",
33
- "strip-ansi": "^7.1.0",
34
33
  "strip-json-comments": "^5.0.1",
35
34
  "astro-scripts": "0.0.14"
36
35
  },