Skip to content

Commit 06dda5a

Browse files
authored
chore: use @vitejs/release-scripts (#244)
1 parent a4b0476 commit 06dda5a

File tree

7 files changed

+105
-409
lines changed

7 files changed

+105
-409
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
# prevents this action from running on forks
1313
if: github.repository == 'vitejs/vite-plugin-vue'
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
1518
environment: Release
1619
steps:
1720
- name: Checkout

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "@vitejs/vite-plugin-vue-monorepo",
33
"private": true,
4+
"type": "module",
45
"engines": {
56
"node": "^14.18.0 || >=16.0.0"
67
},
78
"homepage": "https://github.com/vitejs/vite-plugin-vue/",
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/vitejs/vite-plugin-vue.git"
12+
},
813
"keywords": [
914
"frontend",
1015
"hmr",
@@ -36,13 +41,11 @@
3641
"@types/convert-source-map": "^2.0.0",
3742
"@types/debug": "^4.1.8",
3843
"@types/fs-extra": "^11.0.1",
39-
"@types/minimist": "^1.2.2",
4044
"@types/node": "^18.17.6",
41-
"@types/prompts": "^2.4.4",
4245
"@types/resolve": "^1.20.2",
43-
"@types/semver": "^7.5.0",
4446
"@typescript-eslint/eslint-plugin": "^6.4.0",
4547
"@typescript-eslint/parser": "^6.4.0",
48+
"@vitejs/release-scripts": "^1.2.1",
4649
"conventional-changelog-cli": "^4.0.0",
4750
"eslint": "^8.47.0",
4851
"eslint-define-config": "^1.23.0",
@@ -53,17 +56,14 @@
5356
"fast-glob": "^3.3.1",
5457
"fs-extra": "^11.1.1",
5558
"lint-staged": "^14.0.1",
56-
"minimist": "^1.2.8",
5759
"npm-run-all": "^4.1.5",
5860
"picocolors": "^1.0.0",
5961
"playwright-chromium": "^1.37.1",
6062
"pnpm": "^7.33.6",
6163
"prettier": "3.0.2",
62-
"prompts": "^2.4.2",
6364
"resolve": "^1.22.4",
6465
"rollup": "^3.28.0",
6566
"rollup-plugin-license": "^2.9.1",
66-
"semver": "^7.5.4",
6767
"simple-git-hooks": "^2.9.0",
6868
"tsx": "^3.12.7",
6969
"typescript": "^4.9.5",

pnpm-lock.yaml

Lines changed: 61 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/publishCI.ts

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
1-
import semver from 'semver'
2-
import {
3-
args,
4-
getActiveVersion,
5-
getPackageInfo,
6-
publishPackage,
7-
step,
8-
} from './releaseUtils'
1+
import { publish } from '@vitejs/release-scripts'
92

10-
async function main() {
11-
const tag = args._[0]
12-
13-
if (!tag) {
14-
throw new Error('No tag specified')
15-
}
16-
17-
let pkgName = 'plugin-vue'
18-
let version
19-
20-
if (tag.includes('@')) [pkgName, version] = tag.split('@')
21-
else version = tag
22-
23-
if (version.startsWith('v')) version = version.slice(1)
24-
25-
const { currentVersion, pkgDir } = getPackageInfo(pkgName)
26-
if (currentVersion !== version)
27-
throw new Error(
28-
`Package version from tag "${version}" mismatches with current version "${currentVersion}"`,
29-
)
30-
31-
const activeVersion = await getActiveVersion(pkgName)
32-
33-
step('Publishing package...')
34-
const releaseTag = version.includes('beta')
35-
? 'beta'
36-
: version.includes('alpha')
37-
? 'alpha'
38-
: semver.lt(currentVersion, activeVersion)
39-
? 'previous'
40-
: undefined
41-
await publishPackage(pkgDir, releaseTag)
42-
}
43-
44-
main().catch((err) => {
45-
console.error(err)
46-
process.exit(1)
3+
publish({
4+
defaultPackage: 'plugin-vue',
5+
provenance: true,
476
})

0 commit comments

Comments
 (0)