Skip to content

Conversation

@utnapischtim
Copy link
Contributor

No description provided.

@max-moser
Copy link
Contributor

just for the record; a brief summary of private communications:
i added an application context to the reported problematic spot:

    def update_statics_and_assets(self, force, flask_env="production", log_file=None):
        """High-level command to update less/js/images/... files.

        Needed here (parent) because is used by Assets and Install commands.
        """
        app = create_cli()
        with app.app_context():
            project.app = app
            collect = Collect(app)
            collect.collect(verbose=True)
            project.clean()
            project.create()
            project.install()
            copied_files = self._copy_statics_and_assets()
            self._symlink_assets_templates(copied_files)
            project.build()

this made the build process go through, but with no assets actually collected:

(invenio-cli) mmoser@mx ~/rdm/tu-data [master*] $ invenio-cli assets build                                                                                                                                [13:11:18]
Collect static from blueprints
0 of 0 files already present
Done collecting.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'morris.js@0.5.0',
npm WARN EBADENGINE   required: { node: '>=0.8 <0.11' },
npm WARN EBADENGINE   current: { node: 'v20.12.2', npm: '10.5.0' }
npm WARN EBADENGINE }
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm WARN deprecated redux-devtools-extension@2.13.9: Package moved to @redux-devtools/extension.
npm WARN deprecated npmlog@5.0.1: This package is no longer supported.
npm WARN deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm WARN deprecated gauge@3.0.2: This package is no longer supported.
npm WARN deprecated bootstrap-colorpicker@2.5.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated jvectormap@1.2.2: jvectormap is not maintened since Aug 2015. You can use jvectormap-next or jqvmap instead.
npm WARN deprecated ckeditor@4.12.1: We have renamed the @ckeditor package. New versions are available under the @ckeditor4 name.

> invenio-assets@2.0.0 postinstall
> patch-package

patch-package 6.5.1
Applying patches...
semantic-ui-less@2.5.0 ✔

added 1325 packages, and audited 1326 packages in 58s

280 packages are looking for funding
  run `npm fund` for details

9 vulnerabilities (7 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Copying project statics and assets...
Symlinking assets...

> invenio-assets@2.0.0 build
> NODE_PRESERVE_SYMLINKS=1 NODE_ENV=production rspack --config ./build/webpack.config.js

asset js/skins/ui/oxide/skin.min.css 72.2 KiB [emitted]
asset js/skins/ui/oxide/content.min.css 22.5 KiB [emitted]
asset js/skins/content/default/content.css 1.1 KiB [emitted]
Rspack 1.0.6 compiled successfully in 55 ms

i haven't dug much deeper into this, but very likely it's because of invenio-cli running outside of the virtual environment for me rather than inside.
thus, there are (barely any) invenio packages installed for the python interpreter used for invenio-cli, and thus there are no entrypoints available.
the initialized app is thus basically an empty invenio instance and doesn't know about any of the assets.


one possibility would be to implement the grouped-together functionality as a CLI command for an invenio package (e.g. in flask-webpackext), and simply call that one unified CLI command from invenio-cli.
another option would be to have invenio-cli provide a custom python script and pass that as argument to invenio shell, similar to how the upgrade scripts in invenio-app-rdm work.

it seems that the first option is the preferred one right now.

@utnapischtim
Copy link
Contributor Author

superseded by #383

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.

2 participants