-
Notifications
You must be signed in to change notification settings - Fork 47
Enable PNPM (rspack is part of Invenio-Assets) #385
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
Merged
max-moser
merged 3 commits into
inveniosoftware:master
from
max-moser:mm/pnpm-and-rspack
Mar 28, 2025
+252
−71
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,16 +84,17 @@ def update_statics_and_assets(self, force, debug=False, log_file=None): | |
| Needed here (parent) because is used by Assets and Install commands. | ||
| """ | ||
| # Commands | ||
| pkg_man = self.cli_config.python_package_manager | ||
| ops = [pkg_man.run_command("invenio", "collect", "--verbose")] | ||
| py_pkg_man = self.cli_config.python_package_manager | ||
| js_pkg_man = self.cli_config.javascript_package_manager | ||
| ops = [py_pkg_man.run_command("invenio", "collect", "--verbose")] | ||
|
|
||
| if force: | ||
| ops.append(pkg_man.run_command("invenio", "webpack", "clean", "create")) | ||
| ops.append(pkg_man.run_command("invenio", "webpack", "install")) | ||
| ops.append(py_pkg_man.run_command("invenio", "webpack", "clean", "create")) | ||
| ops.append(py_pkg_man.run_command("invenio", "webpack", "install")) | ||
| else: | ||
| ops.append(pkg_man.run_command("invenio", "webpack", "create")) | ||
| ops.append(py_pkg_man.run_command("invenio", "webpack", "create")) | ||
| ops.append(self._statics) | ||
| ops.append(pkg_man.run_command("invenio", "webpack", "build")) | ||
| ops.append(py_pkg_man.run_command("invenio", "webpack", "build")) | ||
| # Keep the same messages for some of the operations for backward compatibility | ||
| messages = { | ||
| "build": "Building assets...", | ||
|
|
@@ -108,7 +109,9 @@ def update_statics_and_assets(self, force, debug=False, log_file=None): | |
| if op[-1] in messages: | ||
| click.secho(messages[op[-1]], fg="green") | ||
| response = run_interactive( | ||
| op, env={"PIPENV_VERBOSITY": "-1"}, log_file=log_file | ||
| op, | ||
| env={"PIPENV_VERBOSITY": "-1", **js_pkg_man.env_overrides()}, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here we tell |
||
| log_file=log_file, | ||
| ) | ||
| if response.status_code != 0: | ||
| break | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there is still a good amount of optimization potential by calling the
inveniocommand only once and thus saving all the redundant application initializations which eat up a lot of time.one way to move forward is to implement a single larger command (e.g. in
invenio-app-rdm) that performs all the steps currently implemented here, based on the provided CLI args.@ntarocco has pointed out to me that something very much like that has already been done in Invenio-App-ILS
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.
an option would be to use a
rpc-serverimplementation. a WIP would be here forinvenio-clicombined with PR frominvenio-app