Skip to content

Commit 5c61b29

Browse files
vvanpokazupon
authored andcommitted
Update dependencies and compatibility tests (#1341)
* Update lockfile `yarn install` was failing with newer node versions (>=10) because the version of fsevents was too old (no precompiled binaries), and node-gyp would fail to build it. `yarn upgrade` mitigates this issue, but a change in `prettier` 1.18 (https://prettier.io/blog/2019/06/06/1.18.0.html) required `yarn format` to also be run. A missing dependency (`rollup-plugin-json`) was added to `@vue/test-utils`, as it is imported in its build script. * Update compatibility test versions Update minor versions of running `yarn test:compat` to the latest patch revisions. Add optional argument to `yarn test:compat`, to allow running tests against arbitrary `vue` versions. Run compatibility tests in reverse order, to ensure the most relevant test failures are displayed. Run `yarn add` non-interactively, to force errors if `yarn test:compat` is passed an invalid value. Run `yarn add` without clobbering the lockfile. * Update CircleCI config for compatibility tests Having each compatibility test version specified in both the CI config and the package script leads to inconsistencies over time. The CI config can just use the package script. * Hoist dev dependencies explicitly Common build dependencies across sub-packages can get out-of-sync over time. Currently, `rollup` and plugins is used across both `test-utils` and `server-test-utils`, but different versions are specified. This requires duplicate installations, and prevents hoisting. Since `devDependencies` are not present in published packages, and since the monorepo is used exclusively for building the subpackages, it makes sense to define all build dependencies in the root package. Move all `devDependencies` in the root package to `dependencies`, to avoid unmet peer dependency errors in `yarn`: yarnpkg/yarn#5810 Update each of these dependencies to their latest version, in particular `rollup`, which has since released stable versions. See https://github.com/lerna/lerna/blob/master/doc/hoist.md#lerna-hoisting * Remove build step from compatibility tests Each compatibility test installs a legacy version of `vue`, and builds each package against this version before running the test suites. This is assumedly in error, as the only build that gets published is the one built against the dependencies in the lockfile. To properly test compatibility for consumers using older versions of `vue` to satisfy each package's peer dependency, we need to test against the build that would actually get published. The fix is to run `yarn build:test` only once, before any compatibility tests are run. * Relax rollup dependency constraints The upgrade from `rollup` beta -> stable went without breakages, so clearly we don't need to overly constrain updated dependencies using the `^` semver specifier. * Revert locked dependencies The updates from 1d6950a have to be partially reverted to allow for the last compatiblity test suite to pass: `[email protected]`. There is some unclear combination of dependencies that causes 80 unit test failures for only the 2.0 version of vue.
1 parent a0f35d2 commit 5c61b29

File tree

9 files changed

+490
-468
lines changed

9 files changed

+490
-468
lines changed

.circleci/config.yml

+3-63
Original file line numberDiff line numberDiff line change
@@ -60,48 +60,13 @@ jobs:
6060
- run:
6161
name: yarn test
6262
command: yarn test
63-
test_version_2.0.8:
63+
test_compat:
6464
<<: *defaults
6565
steps:
6666
- attach_workspace:
6767
at: ~/repo
6868
- *restore_node_modules
69-
- run: yarn test:compat "2.0.8"
70-
test_version_2.1.10:
71-
<<: *defaults
72-
steps:
73-
- attach_workspace:
74-
at: ~/repo
75-
- *restore_node_modules
76-
- run: yarn test:compat "2.1.10"
77-
test_version_2.2.6:
78-
<<: *defaults
79-
steps:
80-
- attach_workspace:
81-
at: ~/repo
82-
- *restore_node_modules
83-
- run: yarn test:compat "2.2.6"
84-
test_version_2.3.4:
85-
<<: *defaults
86-
steps:
87-
- attach_workspace:
88-
at: ~/repo
89-
- *restore_node_modules
90-
- run: yarn test:compat "2.3.4"
91-
test_version_2.4.2:
92-
<<: *defaults
93-
steps:
94-
- attach_workspace:
95-
at: ~/repo
96-
- *restore_node_modules
97-
- run: yarn test:compat "2.4.2"
98-
test_version_2.5.13:
99-
<<: *defaults
100-
steps:
101-
- attach_workspace:
102-
at: ~/repo
103-
- *restore_node_modules
104-
- run: yarn test:compat "2.5.16"
69+
- run: yarn test:compat
10570
workflows:
10671
version: 2
10772
install-tests:
@@ -116,32 +81,7 @@ workflows:
11681
- test:
11782
requires:
11883
- install
119-
- test_version_2.0.8:
120-
requires:
121-
- install
122-
- build_test
123-
- test
124-
- test_version_2.1.10:
125-
requires:
126-
- install
127-
- build_test
128-
- test
129-
- test_version_2.2.6:
130-
requires:
131-
- install
132-
- build_test
133-
- test
134-
- test_version_2.3.4:
135-
requires:
136-
- install
137-
- build_test
138-
- test
139-
- test_version_2.4.2:
140-
requires:
141-
- install
142-
- build_test
143-
- test
144-
- test_version_2.5.13:
84+
- test_compat:
14585
requires:
14686
- install
14787
- build_test

package.json

+14-5
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
"format:check": "prettier --check \"**/*.{js,json,vue,md}\"",
2121
"release": "npm run build && npm run test:unit:only && lerna publish --conventional-commits -m \"chore(release): publish %s\" --cd-version prerelease",
2222
"test": "npm run format:check && npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma && npm run test:unit:node",
23-
"test:compat": "scripts/test-compat-all.sh",
23+
"test:compat": "scripts/test-compat.sh",
2424
"test:unit": "npm run build:test && npm run test:unit:only",
2525
"test:unit:only": "mocha-webpack --webpack-config test/setup/webpack.test.config.js test/specs --recursive --require test/setup/mocha.setup.js",
2626
"test:unit:debug": "npm run build:test && node --inspect-brk node_modules/.bin/mocha-webpack --webpack-config test/setup/webpack.test.config.js test/specs --recursive --require test/setup/mocha.setup.js",
27-
"test:unit:karma": "npm run build:test && TARGET=browser karma start test/setup/karma.conf.js --single-run",
27+
"test:unit:karma": "npm run build:test && npm run test:unit:karma:only",
28+
"test:unit:karma:only": "cross-env TARGET=browser karma start test/setup/karma.conf.js --single-run",
2829
"test:unit:node": "npm run build:test && npm run test:unit:node:only",
2930
"test:unit:node:only": "cross-env TEST_ENV=node mocha-webpack --webpack-config test/setup/webpack.test.config.js test/specs/render.spec.js test/specs/renderToString.spec.js --require test/setup/mocha.setup.js",
3031
"test:types": "tsc -p packages/test-utils/types && tsc -p packages/server-test-utils/types"
3132
},
32-
"devDependencies": {
33+
"dependencies": {
3334
"babel-core": "^6.26.0",
3435
"babel-eslint": "^8.2.2",
3536
"babel-loader": "^7.1.3",
@@ -41,7 +42,9 @@
4142
"babel-preset-flow-vue": "^1.0.0",
4243
"babel-preset-stage-2": "^6.24.1",
4344
"chai": "^4.0.0",
45+
"chalk": "^2.4.2",
4446
"conditional-specs": "^1.0.1",
47+
"conventional-changelog": "^3.1.12",
4548
"cross-env": "^5.0.0",
4649
"css-loader": "^0.28.4",
4750
"eslint": "^4.18.1",
@@ -63,10 +66,16 @@
6366
"mocha": "^5.2.0",
6467
"mocha-webpack": "^1.0.1",
6568
"prettier": "^1.16.0",
66-
"rollup": "^0.58.2",
69+
"rollup": "1",
70+
"rollup-plugin-buble": "^0.19",
71+
"rollup-plugin-commonjs": "10",
72+
"rollup-plugin-flow-no-whitespace": "1",
73+
"rollup-plugin-json": "4",
74+
"rollup-plugin-node-resolve": "5",
75+
"semver": "^6.3.0",
6776
"sinon": "^7.2.3",
6877
"sinon-chai": "^3.3.0",
69-
"typescript": "^3.0.1",
78+
"typescript": "3",
7079
"vee-validate": "^2.1.3",
7180
"vue": "^2.5.22",
7281
"vue-class-component": "^6.1.2",

packages/server-test-utils/package.json

-11
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@
2727
"cheerio": "^1.0.0-rc.2",
2828
"@types/cheerio": "^0.22.10"
2929
},
30-
"devDependencies": {
31-
"chalk": "^2.1.0",
32-
"conventional-changelog": "^1.1.3",
33-
"rollup": "^0.57.1",
34-
"rollup-plugin-buble": "^0.19.2",
35-
"rollup-plugin-commonjs": "^8.3.0",
36-
"rollup-plugin-flow-no-whitespace": "^1.0.0",
37-
"rollup-plugin-json": "^2.3.0",
38-
"rollup-plugin-node-resolve": "^3.0.3",
39-
"typescript": "^2.6.2"
40-
},
4130
"peerDependencies": {
4231
"@vue/test-utils": "*",
4332
"vue": "2.x",

packages/shared/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"name": "shared",
33
"version": "1.0.0-beta.29",
44
"private": true,
5-
"dependencies": {
6-
"semver": "^5.6.0"
7-
},
85
"peerDependencies": {
96
"vue": "2.x",
107
"vue-template-compiler": "^2.x"

packages/test-utils/package.json

-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@
2323
"url": "https://github.com/vuejs/vue-test-utils/issues"
2424
},
2525
"homepage": "https://github.com/vuejs/vue-test-utils#readme",
26-
"devDependencies": {
27-
"chalk": "^2.1.0",
28-
"conventional-changelog": "^1.1.3",
29-
"rollup": "^0.56.3",
30-
"rollup-plugin-buble": "^0.19.2",
31-
"rollup-plugin-commonjs": "^8.3.0",
32-
"rollup-plugin-flow-no-whitespace": "^1.0.0",
33-
"rollup-plugin-node-resolve": "^3.0.3",
34-
"typescript": "^2.6.2"
35-
},
3626
"peerDependencies": {
3727
"vue": "2.x",
3828
"vue-template-compiler": "^2.x"

0 commit comments

Comments
 (0)