Migrate to monorepo to split Vue 2 and Vue 3 packages
See original GitHub issueRelated #343
Currently, the structure of this repository is as follows:
Branch | Version | Vue | Jest |
---|---|---|---|
master | 4.x | 2.x | <27 |
next | 5.x(alpha) | 3.x | <27 |
In Jest 27, breaking changes have came. (#344, #348, #351) To accommodate it, this package also requires breaking changes. (and need to increment semver)
But, vue-jest@4
cannot increment because of 5.x exists.
So we should split it to another package.
If you want to keep the package name different, I don’t think it is necessary to divide the version by branch. (ex. CI/CD)
@lmiller1990 Could you tell us your thoughts on the items in the “Consideration” section?
Details
Package naming & Support version
Package | Ver. | Vue ver. | Jest ver. | Description |
---|---|---|---|---|
vue-jest |
4.x | 2.x | <27 | alias for vue2-jest@26 |
vue-jest |
5.x(alpha) | 3.x | <27 | deprecate (use vue3-jest@26 instead) |
vue-jest |
27.x | latest (=2.x now) | 27.x | alias for vue2-jest@27 now |
vue2-jest |
26.x | 2.x | 26.x | equals to vue-jest@4 |
vue3-jest |
26.x | 3.x | 26.x | equals to vue-jest@5 |
vue2-jest |
27.x | 2.x | 27.x | |
vue3-jest |
27.x | 3.x | 27.x |
Versioning
Like ts-jest, We DOES NOT use Semantic Versioning.
vue2-jest@xx.yy.zz
vue3-jest@xx.yy.zz
xx
: Equals supported Jest major versionyy
: Compliant with semVer major & patch version (ie included BREAKING CHANGE)zz
: Compliant with semVer patch version
It is recommended for users to pin version as below:
"devDependencies": {
"vue2-jest": "^27.1.1", // Not recommended. It means 27.1.1 <= x < 28.0.0
"vue2-jest": "27.1.x", // 27.1.0 <= x < 27.2.0
"vue2-jest": "~27.1", // 27.1.0 <= x < 27.2.0
"vue2-jest": "~27.1.1" // 27.1.1 <= x < 27.2.0
}
Repository Structures
.github/
e2e/
packages/
vue2-jest/
src/
test/
package.json
README.md
vue3-jest/
src/
test/
package.json
README.md
core/
src/
test/
package.json
.editorconfig
.eslintrc
.prettierignore
LICENSE
package.json
README.md
yarn.lock
Tasks
- Add missing dependencies in
/e2e
projects-
master
branch (#356) -
next
branch (#357)
-
- Setup monorepo in
master
branch (#360)- move vue-jest@4 library to
/packages/vue2-jest
- rename package to
vue2-jest
- move end-to-end tests to
/e2e/2.x
- move vue-jest@4 library to
- Setup monorepo in
next
branch (#361)- move vue-jest@5 library to
/packages/vue3-jest
- rename package to
vue3-jest
- move end-to-end tests to
/e2e/3.x
- move vue-jest@5 library to
- Merge
next
branch intomaster
(#363) - (Optional) Split duplicated code in another package (like
/packages/vue-jest-core
) - Create
vue-jest
package that wrapsvue2-jest@latest
- Add or update README
vue-jest
vue2-jest
vue3-jest
- root
- Release
vue2-jest
,vue3-jest
, andvue-jest-core
Consideration (Resolved)
Package name
-
vue2-jest
,vue-jest
-
vue2-jest
,vue3-jest
-
vue2-jest
,vue3-jest
,vue-jest
(alias ofvue3-jest
) - Other
Use semver or not
- Yes, we will release new packages as version 1.x. Major version does not match Jest version.
- No, like ts-jest, we will release new packages as version 27.x. Major version matches Jest version.
Deprecates vue-jest or not
- **Yes.
- No. use
vue-jest
as alias of latest Vue + Jest package (currentlyvue3-jest@latest
)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to migrate your library from Vue2 to Vue3
In this article, I will show you how to migrate a Vue 2.x library to Vue 3.x plugin, so if you are the...
Read more >How to Migrate from Vue v.2 to Vue v.3 with a Simple Example ...
For this tutorial, I'll keep things simple and show you how to migrate a Vue.js project that currently uses the Vue 2 CDN....
Read more >Sharing reusable Vue.js components with Lerna, Storybook ...
Lerna will be used to keep all our components inside the same repository (monorepos) with independent versions, Storybook to create and visualize components...
Read more >vue.js - Building for vue2 and vue3 in monorepo
a) move vue-tsc to the root package.json. This is what I did as I try and keep all my project tooling out of...
Read more >From a Single Repo, to Multi-Repos, to Monorepo, to Multi ...
Stage 2: Multirepo. Fast forward a couple of years. I completely split the application into PHP packages, managed via Composer and dependency ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That would work too. I’m sure we can ask npm for the package name
vue2-jest
, but it’s probably easier to just publish under thevue
org.Ok, those are both merged. What’s next? Let’s update the plan:
next
(Vue 3) andmaster
(Vue 2) branches is now using a monorepo thanks to @nogic1008. This should help us support multiple Vue versions better.We will not use
next
anymore.master
will target the latest version of Jest (in this case 27). It will have support for both Vue 2 and 3.I think the next step is having
master
include support for both Vue 2 and 3.So
next
intomaster
. We need two packages:vue2-jest
andvue3-jest
. This will target Jest 27.master
.26.x
master
.vue-jest@27
(Vue 2, Jest 27)vue-jest@27
(Vue 2, Jest 27)vue2-jest@26
vue2-jest@27
,vue3-jest@26
vue3-jest@27
Does this sound correct?