@astrojs/upgrade 0.1.0-beta.0 → 0.1.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 +4 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -201,7 +201,6 @@ async function getContext(argv) {
201
201
  // src/messages.ts
202
202
  import { color, label, spinner as load } from "@astrojs/cli-kit";
203
203
  import { align } from "@astrojs/cli-kit/utils";
204
- import semverParse from "semver/functions/parse.js";
205
204
  import terminalLink from "terminal-link";
206
205
  import detectPackageManager2 from "which-pm-runs";
207
206
 
@@ -327,8 +326,8 @@ var upgrade = async (packageInfo, text2) => {
327
326
  const bg = isMajor ? (v) => color.bgYellow(color.black(` ${v} `)) : color.green;
328
327
  const style = isMajor ? color.yellow : color.green;
329
328
  const symbol = isMajor ? "\u25B2" : "\u25CF";
330
- const toVersion = semverParse(targetVersion);
331
- const version = `v${toVersion.version}`;
329
+ const toVersion = targetVersion.replace(/^\D+/, "");
330
+ const version = `v${toVersion}`;
332
331
  const length = 12 + name.length + text2.length + version.length;
333
332
  if (length > stdout.columns) {
334
333
  log(`${" ".repeat(5)} ${style(symbol)} ${name}`);
@@ -574,7 +573,7 @@ import { existsSync } from "node:fs";
574
573
  import { readFile } from "node:fs/promises";
575
574
  import semverCoerce from "semver/functions/coerce.js";
576
575
  import semverDiff from "semver/functions/diff.js";
577
- import semverParse2 from "semver/functions/parse.js";
576
+ import semverParse from "semver/functions/parse.js";
578
577
  async function verify(ctx) {
579
578
  const registry = await getRegistry();
580
579
  if (!ctx.dryRun) {
@@ -686,7 +685,7 @@ async function resolveTargetVersion(packageInfo, registry) {
686
685
  const prefix = packageInfo.targetVersion === "latest" ? "^" : "";
687
686
  packageInfo.targetVersion = `${prefix}${version}`;
688
687
  const fromVersion = semverCoerce(packageInfo.currentVersion);
689
- const toVersion = semverParse2(version);
688
+ const toVersion = semverParse(version);
690
689
  const bump = semverDiff(fromVersion, toVersion);
691
690
  if (bump === "major" && toVersion.prerelease.length === 0 || bump === "premajor") {
692
691
  packageInfo.isMajor = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/upgrade",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",