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

Restructuration package.json #5303

Merged
merged 6 commits into from
Jan 31, 2025
Merged

Conversation

neo-garaix
Copy link
Contributor

Changes how package.json are structured in LWC

  • Now we have a main package.json with workspaces
  • Others package.json are linked to the main one
  • Only one npm install is required to install all dependencies at the same location
  • Scripts like npm run js:test in LWC/tests/js-units can be executed in LWC/ with npm run js:test --workspace=tests/js:test
  • Updated the import path for js unit tests
  • Adapted CI

Funded by 3Liz

@github-actions github-actions bot added this to the 3.10.0 milestone Jan 30, 2025
@neo-garaix neo-garaix mentioned this pull request Jan 30, 2025
@Gustry Gustry added the run end2end If the PR must run end2end tests or not label Jan 30, 2025
Copy link
Member

@Gustry Gustry left a comment

Choose a reason for hiding this comment

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

Nice cleanup !

  • Can you edit the INSTALL.md about building JS ?
  • We need to look the make build command, to add the option npm install --production to not install dev dependancies in production packages

assets/package.json Outdated Show resolved Hide resolved
@Gustry Gustry added the javascript Pull requests that update Javascript code label Jan 30, 2025
@neo-garaix neo-garaix force-pushed the restruct-package-json branch from a5c28f1 to 920052f Compare January 30, 2025 16:37
@neo-garaix neo-garaix force-pushed the restruct-package-json branch from 7ac7324 to 1c642df Compare January 31, 2025 13:49
@Gustry Gustry force-pushed the restruct-package-json branch from db6fb8e to ce696b9 Compare January 31, 2025 16:34
@Gustry Gustry merged commit bb9733e into 3liz:master Jan 31, 2025
17 checks passed
@3liz-bot
Copy link
Contributor

The backport to release_3_8 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 1c642dff7... UPDATE: Changed structure of package.json with workspaces
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging .github/workflows/tests.yml
Auto-merging Makefile
Auto-merging assets/package.json
CONFLICT (content): Merge conflict in assets/package.json
Auto-merging package-lock.json
CONFLICT (content): Merge conflict in package-lock.json
CONFLICT (modify/delete): tests/end2end/package-lock.json deleted in 1c642dff7 (UPDATE: Changed structure of package.json with workspaces) and modified in HEAD.  Version HEAD of tests/end2end/package-lock.json left in tree.
Auto-merging tests/end2end/package.json
CONFLICT (content): Merge conflict in tests/end2end/package.json
Auto-merging tests/js-units/node/config.test.js
CONFLICT (content): Merge conflict in tests/js-units/node/config.test.js

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_8 release_3_8
# Navigate to the new working tree
cd .worktrees/backport-release_3_8
# Create a new branch
git switch --create backport-5303-to-release_3_8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 1c642dff7fce827949335a27309e140eca2d288a,88f12c088fcd1da8aba6cddd2f0df1586a392b55,58954f1919146c732e8536b378be8df61618c164,d8126b4b1d5916451caf8cd55584a34c9b42128a,874e6feaf98870492777852fa38eb4925290d124,ce696b9e48ebb34ac19dad5bc716339463689b98
# Push it to GitHub
git push --set-upstream origin backport-5303-to-release_3_8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_8

Then, create a pull request where the base branch is release_3_8 and the compare/head branch is backport-5303-to-release_3_8.

@3liz-bot
Copy link
Contributor

The backport to release_3_9 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 1c642dff7... UPDATE: Changed structure of package.json with workspaces
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging Makefile
CONFLICT (modify/delete): tests/js-units/package-lock.json deleted in 1c642dff7 (UPDATE: Changed structure of package.json with workspaces) and modified in HEAD.  Version HEAD of tests/js-units/package-lock.json left in tree.
Auto-merging tests/js-units/package.json
CONFLICT (content): Merge conflict in tests/js-units/package.json

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release_3_9 release_3_9
# Navigate to the new working tree
cd .worktrees/backport-release_3_9
# Create a new branch
git switch --create backport-5303-to-release_3_9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 1c642dff7fce827949335a27309e140eca2d288a,88f12c088fcd1da8aba6cddd2f0df1586a392b55,58954f1919146c732e8536b378be8df61618c164,d8126b4b1d5916451caf8cd55584a34c9b42128a,874e6feaf98870492777852fa38eb4925290d124,ce696b9e48ebb34ac19dad5bc716339463689b98
# Push it to GitHub
git push --set-upstream origin backport-5303-to-release_3_9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release_3_9

Then, create a pull request where the base branch is release_3_9 and the compare/head branch is backport-5303-to-release_3_9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_8 backport release_3_9 failed backport javascript Pull requests that update Javascript code run end2end If the PR must run end2end tests or not
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants