create-astro 3.1.7 → 3.1.8

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 +8 -29
  2. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -168,33 +168,11 @@ var require_arg = __commonJS({
168
168
  }
169
169
  });
170
170
 
171
- // ../../node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js
172
- var require_which_pm_runs = __commonJS({
173
- "../../node_modules/.pnpm/which-pm-runs@1.1.0/node_modules/which-pm-runs/index.js"(exports, module) {
174
- "use strict";
175
- module.exports = function() {
176
- if (!process.env.npm_config_user_agent) {
177
- return void 0;
178
- }
179
- return pmFromUserAgent(process.env.npm_config_user_agent);
180
- };
181
- function pmFromUserAgent(userAgent) {
182
- const pmSpec = userAgent.split(" ")[0];
183
- const separatorPos = pmSpec.lastIndexOf("/");
184
- const name = pmSpec.substring(0, separatorPos);
185
- return {
186
- name: name === "npminstall" ? "cnpm" : name,
187
- version: pmSpec.substring(separatorPos + 1)
188
- };
189
- }
190
- }
191
- });
192
-
193
171
  // src/actions/context.ts
194
172
  var import_arg = __toESM(require_arg(), 1);
195
- var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
196
173
  import { prompt } from "@astrojs/cli-kit";
197
174
  import os from "node:os";
175
+ import detectPackageManager2 from "which-pm-runs";
198
176
 
199
177
  // src/messages.ts
200
178
  import { color, label, say as houston, spinner as load } from "@astrojs/cli-kit";
@@ -202,7 +180,6 @@ import { align, sleep } from "@astrojs/cli-kit/utils";
202
180
  import { execa } from "execa";
203
181
  import { exec } from "node:child_process";
204
182
  import { get } from "node:https";
205
- import preferredPM from "preferred-pm";
206
183
 
207
184
  // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
208
185
  function ansiRegex({ onlyFirst = false } = {}) {
@@ -213,18 +190,20 @@ function ansiRegex({ onlyFirst = false } = {}) {
213
190
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
214
191
  }
215
192
 
216
- // ../../node_modules/.pnpm/strip-ansi@7.0.1/node_modules/strip-ansi/index.js
193
+ // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
194
+ var regex = ansiRegex();
217
195
  function stripAnsi(string) {
218
196
  if (typeof string !== "string") {
219
197
  throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
220
198
  }
221
- return string.replace(ansiRegex(), "");
199
+ return string.replace(regex, "");
222
200
  }
223
201
 
224
202
  // src/messages.ts
203
+ import detectPackageManager from "which-pm-runs";
225
204
  async function getRegistry() {
226
205
  var _a;
227
- const packageManager = ((_a = await preferredPM(process.cwd())) == null ? void 0 : _a.name) || "npm";
206
+ const packageManager = ((_a = detectPackageManager()) == null ? void 0 : _a.name) || "npm";
228
207
  const { stdout: stdout2 } = await execa(packageManager, ["config", "get", "registry"]);
229
208
  return stdout2 || "https://registry.npmjs.org";
230
209
  }
@@ -377,7 +356,7 @@ function printHelp({
377
356
  if (headline) {
378
357
  message.push(
379
358
  linebreak(),
380
- `${title(commandName)} ${color.green(`v${"3.1.7"}`)} ${headline}`
359
+ `${title(commandName)} ${color.green(`v${"3.1.8"}`)} ${headline}`
381
360
  );
382
361
  }
383
362
  if (usage) {
@@ -424,7 +403,7 @@ async function getContext(argv) {
424
403
  },
425
404
  { argv, permissive: true }
426
405
  );
427
- const pkgManager = ((_a = (0, import_which_pm_runs.default)()) == null ? void 0 : _a.name) ?? "npm";
406
+ const pkgManager = ((_a = detectPackageManager2()) == null ? void 0 : _a.name) ?? "npm";
428
407
  const [username, version] = await Promise.all([getName(), getVersion()]);
429
408
  let cwd = flags["_"][0];
430
409
  let {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -25,19 +25,18 @@
25
25
  "//a": "MOST PACKAGES SHOULD GO IN DEV_DEPENDENCIES! THEY WILL BE BUNDLED.",
26
26
  "//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
27
27
  "dependencies": {
28
- "@astrojs/cli-kit": "^0.2.2",
29
- "chai": "^4.3.6",
28
+ "@astrojs/cli-kit": "^0.2.3",
29
+ "chai": "^4.3.7",
30
30
  "execa": "^6.1.0",
31
31
  "giget": "1.0.0",
32
32
  "mocha": "^9.2.2",
33
- "preferred-pm": "^3.0.3"
33
+ "which-pm-runs": "^1.1.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/which-pm-runs": "^1.0.0",
37
37
  "arg": "^5.0.2",
38
- "strip-ansi": "^7.0.1",
38
+ "strip-ansi": "^7.1.0",
39
39
  "strip-json-comments": "^5.0.0",
40
- "which-pm-runs": "^1.1.0",
41
40
  "astro-scripts": "0.0.14"
42
41
  },
43
42
  "engines": {