-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use npm instead of yarn to build Theia #14481
Conversation
70c2767
to
82b7da0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far it works very well.
I used npm ci
to install. I tested all applications and was able to build and start all of them. I also tested watching for the browser application. Tests also completed successfully.
Linting is currently broken but this is already mentioned in the current PR description.
@theia/request: > @theia/[email protected] lint
@theia/request: > theiaext lint
@theia/request: $ eslint --cache=true --no-error-on-unmatched-pattern=true "{src,test}/**/*.{ts,tsx}"
@theia/request: /bin/sh: 1: node: not found
@theia/request: Oops! Something went wrong! :(
@theia/request: ESLint: 8.57.1
@theia/request: SyntaxError: Failed to load plugin '@theia' declared in '.eslintrc.js » ../../configs/build.eslintrc.json » ./base.eslintrc.json': Unexpected end of JSON input
@theia/request: at JSON.parse (<anonymous>)
@theia/request: at PackageReExports.FromPackageSync (/home/user/git/theia/dev-packages/private-re-exports/lib/package-re-exports.js:127:47)
@theia/request: at Object.<anonymous> (/home/user/git/theia/dev-packages/private-eslint-plugin/rules/shared-dependencies.js:24:40)
@@ -1,7 +1,6 @@ | |||
root = true | |||
|
|||
[*] | |||
insert_final_newline = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this? Why remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we now have the preference "files.insertFinalNewline" which acomplishes the same thing.
dev-packages/application-manager/src/generator/webpack-generator.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works pretty well, but there are still a few calls to yarn
littered throughout the build scripts:
theia/scripts/run-reverse-topo.js
Line 34 in 37d8330
const YARN_WORKSPACES = JSON.parse(cp.execSync('yarn --silent workspaces info').toString()); theia/scripts/translation-update.js
Line 42 in 37d8330
const childProcess = cp.spawnSync('yarn', [
There might be more. See also below.
c75a1a9
to
937f18b
Compare
@JonasHelming in response to your question elsewhere, the documentation on https://theia-ide.org/ mostly uses the yeoman generator output and the theia-ide repository as examples. While the output of the generator and theia-ide still use yarn, it makes no sense to update the documentation. |
0e3f7af
to
b3af23a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me know. Everything seems to work as expected without relying on yarn.
Linting fails for me with
It errors in all packages with errors like this:
Linting works for me in the current yarn based mono repo. |
@sdirix I had the same issue, it's related to some cached info. You need to run |
Sadly I already tried that, the issue persists. Do you know how exactly the |
@sdirix what's your invocation sequence for lint? |
I tried npm ci
npm run lint I also tried npm ci
npm run compile
npm run lint npm install
npm run lint every time preceded by I also tried
I also tried changing |
Fixes eclipse-theia#13948 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
See eclipse-dash/dash-licenses#415 Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me now! Thanks for the fix.
Once we merge we should do a prerelease so we can do some real world testing in our downstream repositories (which are still yarn based) to verify that they continue working.
Signed-off-by: Thomas Mäder <[email protected]>
ff7c76f
to
9b81e92
Compare
eclipse-theia/theia#14481 Contributed on behalf of STMicroelectronics
What it does
This PR rewrites the Theia build process to use npm in stead of yarn. This required a couple of changes:
Contrary to yarn, npm does not invoke the prepare scripts of workspace packages in the order of their dependencies (npm/cli#3034). So instead of relying on
yarn install
to invoke the necessary build scripts, we have to invoke the build process explicitly after thenpm install
. The build process is built on this logic:This can be achieved by invoking
npm run build
in the repo root.Fixes #13948
Contributed on behalf of STMicroelectronics
There are a couple of issues in npm that currently require manual edits of package-lock.json
How to test
Make sure we can build Theia as described above and the apps work fine.
Follow-ups
Attribution
Contributed on behalf of STMicroelectronics
Review checklist
Reminder for reviewers