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

build: Build accepts version argument #4340

Closed

Conversation

duncanbeevers
Copy link
Contributor

🗣️ Conversation

The current npm run build script is not capable of one-off documentation builds.
The build script contains essential information and compilation steps necessary for previewing builds.

npm run build continues to build all versions
npm run build 3.0.0 builds a specific version
npm run build latest builds from the latest spec

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

@duncanbeevers duncanbeevers requested review from a team as code owners February 6, 2025 22:53
@duncanbeevers duncanbeevers force-pushed the build-specific-versions branch from dee5f13 to 6a21745 Compare February 6, 2025 22:57
`npm run build` continues to build all versions
`npm run build 3.0.0` builds a specific version
`npm run build latest` builds from the latest spec
@duncanbeevers duncanbeevers force-pushed the build-specific-versions branch from 6a21745 to b878202 Compare February 6, 2025 22:59
Copy link
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

@duncanbeevers Could you please explain your use case for this?

Background: we don't change the already published specs, and if we change the build scripts, we'll need to rebuild all published versions anyway to check whether they all are affected only in the expected ways.

The work-in-progress version src/oas-md in a *dev branch can already be built separately.

@ralfhandl ralfhandl requested a review from a team February 7, 2025 10:08
@ralfhandl ralfhandl added the script Pull requests that update Bash or JavaScript code label Feb 7, 2025
@duncanbeevers
Copy link
Contributor Author

I have been experimenting with generating variants for the examples included in the schema, rather than having the variants explicitly inlined. eg; schema authors write YAML, and the JSON example gets auto-generated.

In order to accomplish this, I've needed to make some changes to the build script, so I have to run it a lot, and I simply wanted an easier way to run it in a more-focused fashion.

I'd be happy to adjust my workflow if there's a better-isolated way to run one-off builds, though I don't quite understand your comment.

The work-in-progress version src/oas-md in a *dev branch can already be built separately

I'll experiment in the dev branch then, and see whether that suffices.

@duncanbeevers
Copy link
Contributor Author

duncanbeevers commented Feb 7, 2025

@ralfhandl Can you explain a little how the development process works? I'm happy to work in dev, but it appears that branch is missing some changes present in main (eg; dark mode support).

Update

It appears there's a good bit of duplication between build.sh and bulid-src.sh`.

It's also a bit tricky because build-src doesn't cd into the scripts/md2html folder, which changes shape of the arguments passed to md2html.js.

I suppose one advantage of this PR is that it relies on a single build script for all its operations, whether building artifacts for one spec version, or many.

@duncanbeevers
Copy link
Contributor Author

Closing in favor of #4341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
script Pull requests that update Bash or JavaScript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants