mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-07 15:00:47 -06:00
update version sync script
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-overlay",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "error overlay & dev server middleware for vue-cli",
|
||||
"main": "dist/client.js",
|
||||
"files": [
|
||||
@@ -29,4 +29,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-babel",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "babel plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-e2e-cypress",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "e2e-cypress plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-e2e-nightwatch",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "e2e-nightwatch plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-eslint",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "eslint plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-pwa",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "pwa plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-typescript",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "typescript plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-unit-jest",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "unit-jest plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-unit-mocha-webpack",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "mocha-webpack unit testing plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -30,4 +30,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-service",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "local service for vue-cli projects",
|
||||
"main": "lib/Service.js",
|
||||
"bin": {
|
||||
@@ -21,8 +21,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/packages/@vue/cli-service#readme",
|
||||
"dependencies": {
|
||||
"@vue/cli-overlay": "^1.0.0",
|
||||
"@vue/cli-shared-utils": "^1.0.0",
|
||||
"@vue/cli-overlay": "^0.1.0",
|
||||
"@vue/cli-shared-utils": "^0.1.0",
|
||||
"address": "^1.0.3",
|
||||
"chalk": "^2.3.0",
|
||||
"cross-spawn": "^5.1.0",
|
||||
@@ -53,4 +53,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-shared-utils",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "shared utilities for vue-cli packages",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -25,4 +25,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli-test-utils",
|
||||
"version": "1.0.0",
|
||||
"version": "0.1.0",
|
||||
"description": "test utilities for vue-cli packages",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -21,4 +21,4 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = api => {
|
||||
if (!options.features.includes('ts') && !options.features.includes('-babel')) {
|
||||
api.extendPackage({
|
||||
devDependencies: {
|
||||
'@vue/cli-plugin-babel': '^1.0.0',
|
||||
'@vue/cli-plugin-babel': '^0.1.0',
|
||||
'babel-preset-vue-app': '^2.0.0'
|
||||
},
|
||||
babel: {
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = api => {
|
||||
'vue': '^2.5.13'
|
||||
},
|
||||
devDependencies: {
|
||||
'@vue/cli-service': '^1.0.0',
|
||||
'@vue/cli-service': '^0.1.0',
|
||||
'vue-template-compiler': '^2.5.13'
|
||||
},
|
||||
'postcss': {
|
||||
|
||||
@@ -5,9 +5,9 @@ module.exports = (api, options) => {
|
||||
test: 'jest'
|
||||
},
|
||||
devDependencies: {
|
||||
'@vue/cli-plugin-unit-jest': '^1.0.0',
|
||||
'@vue/cli-plugin-unit-jest': '^0.1.0',
|
||||
'jest': '^22.0.4',
|
||||
'vue-test-utils': '^1.0.0'
|
||||
'vue-test-utils': '^1.0.0-beta.9'
|
||||
},
|
||||
'jest': {
|
||||
'moduleFileExtensions': [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = (api, options) => {
|
||||
const devDependencies = {
|
||||
'@vue/cli-plugin-unit-mocha-webpack': '^1.0.0',
|
||||
'vue-test-utils': '^1.0.0'
|
||||
'@vue/cli-plugin-unit-mocha-webpack': '^0.1.0',
|
||||
'vue-test-utils': '^1.0.0-beta.9'
|
||||
}
|
||||
if (options.assertionLibrary === 'chai') {
|
||||
devDependencies.chai = '^4.1.2'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/cli",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.0-alpha.1",
|
||||
"description": "Command line interface for rapid Vue.js development",
|
||||
"bin": {
|
||||
"vue": "bin/vue",
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli#readme",
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^1.0.0",
|
||||
"@vue/cli-shared-utils": "^0.1.0",
|
||||
"chalk": "^2.3.0",
|
||||
"commander": "^2.12.2",
|
||||
"ejs": "^2.5.7",
|
||||
|
||||
@@ -1,20 +1,44 @@
|
||||
// make sure generators are using the latest version of plugins
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const globby = require('globby')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
const localPackageRE = /'(@vue\/cli-[\w-]+)': '\^(\d+\.\d+\.\d+)'/g
|
||||
const npmPackageRE = /'(vue|vue-template-compiler|vuex|vue-router|vue-test-utils)': '\^(\d+\.\d+\.\d+)'/g
|
||||
|
||||
;(async () => {
|
||||
const paths = await globby(['packages/@vue/cli/lib/generators/**/*.js'])
|
||||
paths
|
||||
.filter(p => !/\/files\//.test(p))
|
||||
.forEach(processFile)
|
||||
})()
|
||||
.forEach(filePath => {
|
||||
const makeReplacer = versionGetter => (_, pkg, curVersion) => {
|
||||
const version = versionGetter(pkg)
|
||||
if (version !== curVersion) {
|
||||
console.log(
|
||||
`${chalk.cyan(pkg)}: ${curVersion} => ${version} ` +
|
||||
chalk.gray(`(${path.relative(process.cwd(), filePath)})`)
|
||||
)
|
||||
}
|
||||
return `'${pkg}': '^${version}'`
|
||||
}
|
||||
|
||||
function processFile (filePath) {
|
||||
const file = fs.readFileSync(filePath, 'utf-8')
|
||||
const updated = file.replace(/'(@vue\/cli-[\w-]+)': '\^\d+\.\d+\.\d+'/g, (_, pkg) => {
|
||||
const version = require(`../packages/${pkg}/package.json`).version
|
||||
return `'${pkg}': '^${version}'`
|
||||
})
|
||||
fs.writeFileSync(filePath, updated)
|
||||
}
|
||||
const localReplacer = makeReplacer(
|
||||
pkg => require(`../packages/${pkg}/package.json`).version
|
||||
)
|
||||
|
||||
const npmReplacer = makeReplacer(
|
||||
pkg => execSync(`npm view ${pkg} version`).toString().trim()
|
||||
)
|
||||
|
||||
const updated = fs.readFileSync(filePath, 'utf-8')
|
||||
// update @vue packages in this repo
|
||||
.replace(localPackageRE, localReplacer)
|
||||
// also update vue, vue-template-compiler, vuex, vue-router
|
||||
.replace(npmPackageRE, npmReplacer)
|
||||
|
||||
fs.writeFileSync(filePath, updated)
|
||||
})
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user