neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.95k stars 214 forks source link

Implement Yarn 2 support #1630

Closed constgen closed 7 months ago

constgen commented 3 years ago

Resolves https://github.com/neutrinojs/neutrino/issues/1277

constgen commented 3 years ago

I can see in the build logs that the job published packages to NPM. But why? It even didn't pass the code formatting check. And this is only Pull Request.

edmorley commented 3 years ago

I can see in the build logs that the job published packages to NPM. But why?

It's not a real NPM server - see: https://github.com/neutrinojs/neutrino/blob/master/scripts/test-create-project-ci.sh

constgen commented 3 years ago

Here are my thoughts. I have my personal set of Neutrino middlewares and presets for React, ESLint and other. I reuse couple of Neutrino core middlewares, but most are custom. I faced really a lot of problems with Yarn 2. Especially with ESlint. I resolved them. Some solutions were really hacky. So I decided to integrate my experience to the Neutrino core.

Lets discuss your points

constgen commented 3 years ago

Please, look at the new section in the documentation https://github.com/constgen/neutrino-dev/tree/pnp/packages/eslint#utility-functions

constgen commented 3 years ago

I think everything related to Yarn 2 is resolved. The only left are tests. And I think there is a separate problem. I feel like tests can affect each other and they are not isolated. Seems like they may have a shared neutrino config and all Webpack plugins are applied across test. Is it possible? Because currently just commenting one test can make other tests red or green.

constgen commented 3 years ago

@edmorley in Webpack 5 only pnp-webpack-plugin will be not necessary. All other fixes to ESLint, Jest and etc. will be highly required. Their issues still remain. So with pnp-webpack-plugin or without it we need this PR any way. But without pnp-webpack-plugin it will be hard to automate testing in Yarn 2. In my opinion it affects only several presets and it will be really easy to remove it in Neutrino 10 without affecting anything.

constgen commented 3 years ago

@edmorley @eliperelman can you look at final version of this PR?

edmorley commented 3 years ago

@constgen Thank you for working on this :-) Before it can be merged (and so before spending time on review), we need to have CI passing, which is blocked on Travis CI credits running out, due to Travis CI's new policy (that is, there are no more free credits). The best way to resolve this would be to migrate to another provider -- I would recommend Circle CI. I don't have time to work on such a migration, but would be happy to review a PR that did so.

constgen commented 3 years ago

Is GitHub Actions is an option? I tried it recently for one of my projects as a replacement for Travis. Have to say that it also has free plan limits but it worked well for me

edmorley commented 3 years ago

Yeah that works too :-)

edmorley commented 7 months ago

Closing since unfortunately this project is no longer maintained. See: https://github.com/neutrinojs/neutrino/issues/1707 https://github.com/neutrinojs/webpack-chain/issues/358