-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 install support #11216
Comments
We were sort of discussing this recently. Right now, our default commands executed for builds are meant to serve Python based projects. This comes from all of the tooling we directly supported historically being Python based tools -- Sphinx and Mkdocs. More direct support for Node/etc tooling is getting into some new area for us, so we don't yet have concrete plans here. Feedback here is definitely helpful for us! So, a few things that we've discussed at some points: We've talked about at very least offering overrides to default build jobs. These are discussed more here: The missing jobs right now are:
You can sort of accomplish this now with the build:
jobs:
install:
- npm install
build:
html:
- npm run build
- ... As far as native support for npm install in our configuration file, these additions are hard for us to maintain. So, we might instead prefer to keep npm/etc support at simply overriding You can also do this with Our eventual goal here is to support/offer reusable, community build packages, where users only need to specify the tooling package and it's arguments. This is a far ways out though. As far as caching goes, we do not cache anything between builds anyways. Each build requires a full, fresh checkout of your repository. We've tried caching layers and surprisingly saw little improvement with build time. |
This PR modifies the build to not run default commands when the user doesn't specify `sphinx` or `mkdocs` configs in the YAML file. This allows to use the following YAML file to build with Docusaurus, for example: ```yaml version: 2 build: os: ubuntu-24.04 tools: nodejs: "22" jobs: install: - cd docs/ && npm install build: html: - cd docs/ && npm run build post_build: - mkdir --parents $READTHEDOCS_OUTPUT/html/ - cp --recursive docs/build/* $READTHEDOCS_OUTPUT/html/ ``` This is the structure I've been wanting to have to allow any type of doctool to work in our platform following the `build.jobs` pattern. The code deployed in production doesn't allow this because it runs automatically `create_environment`, `install_core_dependencies` and `install_requirements` even if the project is not using Python --which is incorrect. It fails with the generic error: " Unknown problem. There was a problem with Read the Docs while building your documentation" - https://app.readthedocs.org/projects/test-builds/builds/26425680/ - https://read-the-docs.sentry.io/issues/4458662274/ This PR detects if the user is defining `sphinx` or `mkdocs` and if it's not, it doesn't run those jobs and leave the user to handle the build workflow completely. * Related #11216 * Related #11551
What's the problem this feature will solve?
Similar to the
python.install
feature, it would be nice to support anpm.install
as well. Maybe alsocargo
andgo
?Describe the solution you'd like
A small wrapper for
npm install
(andnpm build
?) to automatically build the packages inpackage.json
. Having first-party support would be helpful, because than the caching can be more efficiently shared.Alternative solutions
Manual control of
cache
artifactsThe text was updated successfully, but these errors were encountered: