Skip to content

Commit

Permalink
chore: use @vitejs/release-scripts (#12682)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre authored Apr 5, 2023
1 parent abe9274 commit 9c37cc1
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 377 deletions.
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@vitejs/vite-monorepo",
"private": true,
"type": "module",
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
Expand Down Expand Up @@ -50,17 +51,15 @@
"@types/json-stable-stringify": "^1.0.34",
"@types/less": "^3.0.3",
"@types/micromatch": "^4.0.2",
"@types/minimist": "^1.2.2",
"@types/node": "^18.15.5",
"@types/picomatch": "^2.3.0",
"@types/prompts": "2.4.2",
"@types/resolve": "^1.20.2",
"@types/sass": "~1.43.1",
"@types/semver": "^7.3.13",
"@types/stylus": "^0.48.38",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@vitejs/release-scripts": "^1.1.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.36.0",
"eslint-define-config": "^1.17.0",
Expand All @@ -71,16 +70,13 @@
"fast-glob": "^3.2.12",
"fs-extra": "^11.1.1",
"lint-staged": "^13.2.0",
"minimist": "^1.2.8",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.31.2",
"prettier": "2.8.5",
"prompts": "^2.4.2",
"resolve": "^1.22.1",
"rimraf": "^4.4.0",
"rollup": "^3.20.2",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"tslib": "^2.5.0",
"tsx": "^3.12.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/create-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"template-*",
"dist"
],
"main": "index.js",
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild",
Expand All @@ -33,6 +32,8 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/create-vite#readme",
"devDependencies": {
"@types/minimist": "^1.2.2",
"@types/prompts": "^2.4.4",
"cross-spawn": "^7.0.3",
"kolorist": "^1.7.0",
"minimist": "^1.2.8",
Expand Down
3 changes: 2 additions & 1 deletion playground/css/__tests__/no-css-minify/vite.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = require('../../vite.config-no-css-minify')
import config from '../../vite.config-no-css-minify'
export default config
100 changes: 86 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 2 additions & 46 deletions scripts/publishCI.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
import semver from 'semver'
import {
args,
getActiveVersion,
getPackageInfo,
publishPackage,
step,
} from './releaseUtils'
import { publish } from '@vitejs/release-scripts'

async function main() {
const tag = args._[0]

if (!tag) {
throw new Error('No tag specified')
}

let pkgName = 'vite'
let version

if (tag.includes('@')) [pkgName, version] = tag.split('@')
else version = tag

if (version.startsWith('v')) version = version.slice(1)

const { currentVersion, pkgDir } = getPackageInfo(pkgName)
if (currentVersion !== version)
throw new Error(
`Package version from tag "${version}" mismatches with current version "${currentVersion}"`,
)

const activeVersion = await getActiveVersion(pkgName)

step('Publishing package...')
const releaseTag = version.includes('beta')
? 'beta'
: version.includes('alpha')
? 'alpha'
: semver.lt(currentVersion, activeVersion)
? 'previous'
: undefined
await publishPackage(pkgDir, releaseTag)
}

main().catch((err) => {
console.error(err)
process.exit(1)
})
publish({ defaultPackage: 'vite' })
Loading

0 comments on commit 9c37cc1

Please sign in to comment.