Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update npm dependencies #38

Merged
merged 4 commits into from Dec 26, 2021
Merged

Update npm dependencies #38

merged 4 commits into from Dec 26, 2021

Conversation

albertyw
Copy link
Contributor

@albertyw albertyw commented Dec 23, 2021

Depends on #37

There are still a few dependencies not updated:

$ npm outdated
Package                 Current  Wanted  Latest  Location                             Depended by
mocha-jenkins-reporter    0.1.9   0.1.9   0.4.7  node_modules/mocha-jenkins-reporter  mocaccino.js
supports-color            8.1.1   8.1.1   9.2.1  node_modules/supports-color          mocaccino.js
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/albertyw/mocaccino.js/node_modules/supports-color/index.js from /home/albertyw/mocaccino.js/lib/mocaccino.js not supported.
Instead change the require of index.js in /home/albertyw/mocaccino.js/lib/mocaccino.js to a dynamic import() which is available in all CommonJS modules.

@albertyw albertyw marked this pull request as draft December 23, 2021 01:29
package.json Outdated
@@ -41,16 +41,16 @@
"dependencies": {
"brout": "^1.3.0",
"listen": "^1.0.0",
"mocha": "^8.4.0",
"mocha": "^9.1.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to have this land in Mochify as well in the long run? Even if the only relevant breaking change seems to be dropping Node 10 I'm wonderig if this would mean we'd have to do major version bumps on both mocaccino and Mochify?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that we're stuck with mocha 8 because mocha 9 cannot be browserified (whole reason for the rewrite that I'm not getting over the finish line 🤭). Did that change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My memories might be off here, but from what I can recall that move from Browserify to Rollup in Mocha (which you might be referring to?) happened in some version before 8 already and was covered here #35 (comment) and here mantoni/mochify.js#213 (comment) so I think Mocha 9 should work. That doesn't necessarily make it true though...

Copy link
Contributor Author

@albertyw albertyw Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR seems to build fine when brought into mochify.js: mantoni/mochify.js#276

@mantoni Are you referring to being stuck on an old version of browserify instead of mocha (mantoni/mochify.js#224)?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to break, I've sent a PR to fix it, but nobody replied. mochajs/mocha#4121

This was the whole reason I went off to write a new mochify, that isn't depending on a bundler (plus some other improvements in the design). See https://github.com/mantoni/mochify.js/milestone/1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR says

I'm maintaining mochify and would like to move away from depending on the pre-bundled Mocha.

which also aligns with what I remember: it's just not possible to browserify browser-entry.js file anymore because of that missing transform. Mocaccino however currently loads the pre-bundled mocha/mocha.js here:

var mochaPath = opts.mochaPath
? resolve.sync('mocha.js', { paths: [opts.mochaPath] })
: resolve.sync('mocha/mocha');

so I think Mocha 9 should work fine as long as we consume the bundled version.


That being said, if I can help with finishing that rewrite in some way, I am happy to help, it will be worth it nonetheless :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should we update to mocha 9 and leave a bundled mocha.js or should we stay at mocha 8 for consistency until the rewrite finishes?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you with this decision. If you have time to do the work, I'll support the upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the mocha update from this PR. It can be added in a later PR.

@albertyw albertyw force-pushed the update-deps branch 2 times, most recently from d2544af to 38acd8e Compare December 24, 2021 23:03
@albertyw albertyw marked this pull request as ready for review December 24, 2021 23:07
@albertyw
Copy link
Contributor Author

Now that #37 is landed, I rebased this PR and it should be ready to land, pending the mocha question.

@mantoni
Copy link
Owner

mantoni commented Dec 25, 2021

Shall I merge and release a major?

package.json Outdated
},
"devDependencies": {
"@studio/changes": "^2.2.0",
"browserify": "^16.2.3",
"browserify": "^17.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should stick to 16 here so that it's in sync with the (blocked) Mochify: mantoni/mochify.js#224

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the browserify update

@m90 m90 merged commit 09f1a80 into mantoni:master Dec 26, 2021
@m90
Copy link
Collaborator

m90 commented Dec 26, 2021

Thank you 🙌 if you're ready for upgrading Mocha too, let's do this.

@albertyw albertyw deleted the update-deps branch December 27, 2021 05:01
@albertyw albertyw mentioned this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants