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

NPM workspaces for JS repositories #165

Open
adamstankiewicz opened this issue May 3, 2023 · 1 comment
Open

NPM workspaces for JS repositories #165

adamstankiewicz opened this issue May 3, 2023 · 1 comment

Comments

@adamstankiewicz
Copy link
Member

adamstankiewicz commented May 3, 2023

Description

Many of our JavaScript libraries have several sub-packages included in their repositories.

This is most evidently seen in the Paragon repository where there is a component-generator, dependent-usage-analyzer, example, icons, src, and www all treated as packages within the repository, each containing their own package.json file to define their specific dependencies.

While other repositories (e.g., frontend-build, frontend-platform, frontend-component-header) don't have as many packages, our convention is typically to include an example MFE app in order to run the JS library against for QA during local development.

For example, frontend-build has an example package that defines its dependencies via its own package.json file. To run the example app after a git clone of the repo, you have to cd example && npm install && npm start rather than simply running npm install && npm start from the root of the repository, which is not intuitive.

To get around this issue and others in Paragon, we have adopted NPM workspaces. As such, this GitHub issue is intended to track the consideration of whether NPM workspaces are relevant for any of our other JS libraries as a quality of life improvement for contributors and newcomers.

@davidjoy
Copy link
Contributor

davidjoy commented May 3, 2023

FYI - openedx/frontend-platform#235 which I plan to merge ASAP adds two sub-projects to frontend-platform (example and example-plugin-app)

Also, I discovered you can do npm --prefix example start and add that to your top-level package.json and it works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants