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

webpack: add aliases support #123

Merged
merged 1 commit into from
May 25, 2020
Merged

Conversation

slint
Copy link
Member

@slint slint commented May 19, 2020

No description provided.

// Semantic-UI LESS config resolving alias
// TODO: This would be better injected via config from Flask...
"../../theme.config$": path.resolve(config.build.context, "less/invenio_theme/theme.config"),
...aliases,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the @templates now, and move it to a Invenio RDM config

Copy link
Member Author

Choose a reason for hiding this comment

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

@slint
Copy link
Member Author

slint commented May 19, 2020

Note: adding this method to inject Webpack aliases doesn't cancel out inveniosoftware/pywebpack#27, which can still be useful for generally adding aliases.

@slint
Copy link
Member Author

slint commented May 19, 2020

Tests seem to be failing because Flask-WebpackExt docs are not properly built?

@ppanero
Copy link
Member

ppanero commented May 19, 2020

@slint we. had that issue several times during the sprint. read the docs are built in py27 in many cases. If you change it to python 3 they built again properly.

@slint slint changed the title webpack: add aliases via application config webpack: add aliases support May 20, 2020
@lnielsen lnielsen self-assigned this May 25, 2020
@lnielsen lnielsen merged commit 51e696c into inveniosoftware:master May 25, 2020
Sprint Week 19-20 - Semantic UI transition automation moved this from For next week to Done May 25, 2020
def dependencies(self):
"""Proxy to the active theme's bundle dependencies."""
return self._active_theme_bundle.dependencies
def __getattr__(self, attr):
Copy link
Member

Choose a reason for hiding this comment

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

This one is causing troubles with tests in Invenio-Theme:

__________________ ERROR collecting invenio_theme/webpack.py ___________________
450/opt/python/3.7.1/lib/python3.7/doctest.py:932: in find
451    self._find(tests, obj, name, module, source_lines, globs, {})
452../../../virtualenv/python3.7.1/lib/python3.7/site-packages/_pytest/doctest.py:476: in _find
453    self, tests, obj, name, module, source_lines, globs, seen
454/opt/python/3.7.1/lib/python3.7/doctest.py:991: in _find
455    if ((inspect.isroutine(inspect.unwrap(val))
456../../../virtualenv/python3.7.1/lib/python3.7/site-packages/_pytest/doctest.py:427: in _mock_aware_unwrap
457    return real_unwrap(obj, stop=_is_mocked)
458/opt/python/3.7.1/lib/python3.7/inspect.py:511: in unwrap
459    while _is_wrapper(func):
460/opt/python/3.7.1/lib/python3.7/inspect.py:505: in _is_wrapper
461    return hasattr(f, '__wrapped__') and not stop(f)
462../../../virtualenv/python3.7.1/lib/python3.7/site-packages/invenio_assets/webpack.py:65: in __getattr__
463    return getattr(self._active_theme_bundle, attr)
464../../../virtualenv/python3.7.1/lib/python3.7/site-packages/invenio_assets/webpack.py:56: in _active_theme_bundle
465    themes = current_app.config.get('APP_THEME', [])
466../../../virtualenv/python3.7.1/lib/python3.7/site-packages/werkzeug/local.py:347: in __getattr__
467    return getattr(self._get_current_object(), name)
468../../../virtualenv/python3.7.1/lib/python3.7/site-packages/werkzeug/local.py:306: in _get_current_object
469    return self.__local()
470../../../virtualenv/python3.7.1/lib/python3.7/site-packages/flask/globals.py:52: in _find_app
471    raise RuntimeError(_app_ctx_err_msg)
472E   RuntimeError: Working outside of application context.
473E   
474E   This typically means that you attempted to use functionality that needed
475E   to interface with the current application object in some way. To solve
476E   this, set up an application context with app.app_context().  See the
477E   documentation for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants