question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate to monorepo to split Vue 2 and Vue 3 packages

See original GitHub issue

Related #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 version
  • yy: 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

Tasks

  1. Add missing dependencies in /e2e projects
    • master branch (#356)
    • next branch (#357)
  2. 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
  3. 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
  4. Merge next branch into master (#363)
  5. (Optional) Split duplicated code in another package (like /packages/vue-jest-core)
  6. Create vue-jest package that wraps vue2-jest@latest
  7. Add or update README
    • vue-jest
    • vue2-jest
    • vue3-jest
    • root
  8. Release vue2-jest, vue3-jest, and vue-jest-core

Consideration (Resolved)

Package name

  • vue2-jest, vue-jest
  • vue2-jest, vue3-jest
  • vue2-jest, vue3-jest, vue-jest(alias of vue3-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 (currently vue3-jest@latest)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lmiller1990commented, Jul 19, 2021

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 the vue org.

2reactions
lmiller1990commented, Jun 21, 2021

Ok, those are both merged. What’s next? Let’s update the plan:

next (Vue 3) and master (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

  1. Merge next into master. We need two packages: vue2-jest and vue3-jest. This will target Jest 27.
  2. Make a new PR with the changes to support Jest 27. This will target master.
  3. Fork master -> call the new branch 26.x
  4. Merge Jest 27 support to master.
  5. Release 6? new versions:
  • 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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found