Skip to content

Commit 4f0cd2d

Browse files
committed
workflow: add dist-tag when publishing [ci skip]
1 parent 208a997 commit 4f0cd2d

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ test('base', async () => {
2525

2626
// should inject babel-jest
2727
expect(pkg.devDependencies).toHaveProperty('babel-jest')
28-
// babel-core 6 -> 7 shim
29-
expect(pkg.devDependencies).toHaveProperty('babel-core')
3028
// eslint
3129
expect(files['tests/unit/.eslintrc.js']).toMatch('jest: true')
3230

packages/@vue/cli-plugin-unit-jest/generator/index.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,14 @@ module.exports = (api, _, __, invoking) => {
5454
if (api.hasPlugin('babel')) {
5555
api.extendPackage({
5656
devDependencies: {
57-
'babel-jest': '^23.6.0',
58-
// this is for now necessary to force babel-jest and vue-jest to use babel 7
59-
'babel-core': '7.0.0-bridge.0'
57+
'babel-jest': '^24.7.1'
6058
}
6159
})
6260
} else {
63-
// Jest's shipped babel-jest still uses babel 6,
64-
// so we cannot use extendPackage which renders babel.config.js.
65-
api.render(files => {
66-
files['.babelrc'] = JSON.stringify(
67-
{
68-
plugins: ['transform-es2015-modules-commonjs']
69-
},
70-
null,
71-
2
72-
)
61+
api.extendPackage({
62+
babel: {
63+
plugins: ['transform-es2015-modules-commonjs']
64+
}
7365
})
7466
}
7567
} else {

packages/@vue/cli-plugin-unit-jest/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26+
"@babel/core": "^7.4.4",
27+
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
2628
"@vue/cli-shared-utils": "^3.6.0",
2729
"babel-jest": "^24.7.1",
28-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
2930
"jest": "^24.7.1",
3031
"jest-serializer-vue": "^2.0.2",
3132
"jest-transform-stub": "^2.0.0",

scripts/release.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,24 @@ const release = async () => {
9393
}
9494
}
9595

96+
const releaseType = semver.diff(curVersion, version)
97+
98+
let distTag = 'latest'
99+
if (releaseType.startsWith('pre')) {
100+
distTag = 'next'
101+
}
102+
96103
const lernaArgs = [
97104
'publish',
98-
version
105+
version,
106+
'--dist-tag',
107+
distTag
99108
]
100-
const releaseType = semver.diff(curVersion, version)
101-
102109
// keep packages' minor version in sync
103110
if (releaseType !== 'patch') {
104111
lernaArgs.push('--force-publish')
105112
}
113+
106114
await execa(require.resolve('lerna/cli'), lernaArgs, { stdio: 'inherit' })
107115
}
108116

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3507,7 +3507,7 @@ babel-plugin-syntax-object-rest-spread@^6.8.0:
35073507
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
35083508
integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=
35093509

3510-
babel-plugin-transform-es2015-modules-commonjs@^6.26.0, babel-plugin-transform-es2015-modules-commonjs@^6.26.2:
3510+
babel-plugin-transform-es2015-modules-commonjs@^6.26.0:
35113511
version "6.26.2"
35123512
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3"
35133513
integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==

0 commit comments

Comments
 (0)