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

Refactor rc file loading / local registry support + add tests #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

refi64
Copy link
Collaborator

@refi64 refi64 commented Dec 17, 2022

This:

  • Adds proper npm (bug-for-bug-compatible even though that's not really necessary) & yarn rc file parsers w/ tests. (As it turns out, I was wrong when I said .yarnrc is loaded up the directory tree, oops.)
  • Adds tests for local registries to ensure they stay working, using Verdaccio (a very simple registry that works well for this use case).

node/flatpak_node_generator/providers/yarn.py Show resolved Hide resolved
node/flatpak_node_generator/providers/yarn.py Outdated Show resolved Hide resolved
node/tests/data/packages/custom-registry/.npmrc Outdated Show resolved Hide resolved
.github/workflows/node.yaml Outdated Show resolved Hide resolved

class ConfigProvider:
@property
def _filename(self) -> str:
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason for the filename to be a property and not a class variable? I can't imagine npm/yarn config file name ever changing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's mostly because then we could use actual abstractproperty handling in the future, but atm it does mean that forgetting to override it gives a clearer error at the call site.

- Use more "proper" package-manager-specific parsing, including what
  should be a fully-compliant (albiet over-engineered) parser for npm's
  ini format used in .npmrc.
- Moves all config loading into its own set of classes. (As it turns
  out, this *does* walk recursively, contrary to what I said before,
  oops!)
- Terminology change: rename rcfile -> config, just to match more with
  how npm describes itself.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
@refi64
Copy link
Collaborator Author

refi64 commented Jan 13, 2023

Merge conflicts fixed.

This adds a test-time dependency on a running Verdaccio instance.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants