@vitejs/release-scripts 1.3.1 → 1.3.2

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 +9 -18
  2. package/package.json +17 -12
package/dist/index.js CHANGED
@@ -118,8 +118,7 @@ async function getActiveVersion(npmName) {
118
118
  try {
119
119
  return (await run("npm", ["info", npmName, "version"], { stdio: "pipe" })).stdout;
120
120
  } catch (e) {
121
- if (e.stderr.startsWith("npm ERR! code E404"))
122
- return;
121
+ if (e.stderr.startsWith("npm ERR! code E404")) return;
123
122
  throw e;
124
123
  }
125
124
  }
@@ -132,16 +131,12 @@ var publish = async ({
132
131
  packageManager
133
132
  }) => {
134
133
  const tag = args._[0];
135
- if (!tag)
136
- throw new Error("No tag specified");
134
+ if (!tag) throw new Error("No tag specified");
137
135
  let pkgName = defaultPackage;
138
136
  let version;
139
- if (tag.includes("@"))
140
- [pkgName, version] = tag.split("@");
141
- else
142
- version = tag;
143
- if (version.startsWith("v"))
144
- version = version.slice(1);
137
+ if (tag.includes("@")) [pkgName, version] = tag.split("@");
138
+ else version = tag;
139
+ if (version.startsWith("v")) version = version.slice(1);
145
140
  const { pkg, pkgDir } = getPackageInfo(pkgName, getPkgDir);
146
141
  if (pkg.version !== version)
147
142
  throw new Error(
@@ -174,21 +169,18 @@ var release = async ({
174
169
  message: "Select package",
175
170
  choices: packages.map((i) => ({ value: i, title: i }))
176
171
  })).pkg;
177
- if (!selectedPkg)
178
- return;
172
+ if (!selectedPkg) return;
179
173
  await logChangelog(selectedPkg);
180
174
  const { pkg, pkgPath, pkgDir } = getPackageInfo(selectedPkg, getPkgDir);
181
175
  const { messages } = await publint({ pkgDir });
182
176
  if (messages.length) {
183
- for (const message of messages)
184
- console.log(formatMessage(message, pkg));
177
+ for (const message of messages) console.log(formatMessage(message, pkg));
185
178
  const { yes: yes2 } = await prompts({
186
179
  type: "confirm",
187
180
  name: "yes",
188
181
  message: `${messages.length} messages from publint. Continue anyway?`
189
182
  });
190
- if (!yes2)
191
- process.exit(1);
183
+ if (!yes2) process.exit(1);
192
184
  }
193
185
  if (!targetVersion) {
194
186
  const { release: release2 } = await prompts({
@@ -224,8 +216,7 @@ var release = async ({
224
216
  name: "yes",
225
217
  message: `Releasing ${colors2.yellow(tag)} Confirm?`
226
218
  });
227
- if (!yes)
228
- return;
219
+ if (!yes) return;
229
220
  step("\nUpdating package version...");
230
221
  updateVersion(pkgPath, targetVersion);
231
222
  await generateChangelog(selectedPkg, targetVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/release-scripts",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "@vitejs release scripts",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,10 @@
14
14
  "import": "./dist/index.js"
15
15
  }
16
16
  },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/vitejs/release-scripts.git"
20
+ },
17
21
  "scripts": {
18
22
  "build": "tnode scripts/build.ts",
19
23
  "prettier": "pnpm prettier-ci --write",
@@ -24,18 +28,19 @@
24
28
  "dependencies": {
25
29
  "execa": "^8.0.1",
26
30
  "mri": "^1.2.0",
27
- "picocolors": "^1.0.0",
31
+ "picocolors": "^1.0.1",
28
32
  "prompts": "^2.4.2",
29
- "publint": "^0.2.2",
30
- "semver": "^7.5.4"
33
+ "publint": "^0.2.9",
34
+ "semver": "^7.6.3"
31
35
  },
32
36
  "devDependencies": {
33
- "@arnaud-barre/tnode": "^0.19.1",
34
- "@types/node": "^18.17.17",
35
- "@types/prompts": "^2.4.4",
36
- "@types/semver": "^7.5.2",
37
- "esbuild": "^0.19.3",
38
- "prettier": "^3.0.3",
39
- "typescript": "^5.2.2"
40
- }
37
+ "@arnaud-barre/tnode": "^0.19.2",
38
+ "@types/node": "^20.14.13",
39
+ "@types/prompts": "^2.4.9",
40
+ "@types/semver": "^7.5.8",
41
+ "esbuild": "^0.23.0",
42
+ "prettier": "^3.3.3",
43
+ "typescript": "^5.5.4"
44
+ },
45
+ "packageManager": "pnpm@9.6.0"
41
46
  }