-
Notifications
You must be signed in to change notification settings - Fork 208
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
chore: streamline package publishing #453
base: master
Are you sure you want to change the base?
Conversation
"docs": "npm run build && npm run docs:ci", | ||
"docs:ci": "npm run docs:extract -- --local && npm run docs:generate", | ||
"docs:generate": "api-documenter markdown --input-folder ./tmp --output-folder ./api/docs", | ||
"docs:extract": "api-extractor run --verbose", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree with this specific renaming. There are actually two distinct processes happening here:
- Public API metadata is extracted from the code
- Documentation is generated from the code
If we're going to rename, we should probably use names that reflect these different processes so we don't conflate them as I originally did.
Also, we shouldn't use pass --local
in the docs:ci
script. That flag disables the validation which checks if the public API has changed. The API report that api-extractor
produces should be thought of as similar to package-lock.json
only it's a lockfile for public API changes, not dependencies. Following that comparison, consider the workflow for package-lock.json
:
- Changes are deliberately made to the lockfile by a developer (or dependabot) locally and then the change is committed
- When running
npm ci
in an automated environment, if the lockfile doesn't matchpackage.json
then it will error
We should follow a similar process for the API report. That is how the previous scripts operated with api:dev
being the deliberate, local change and api:extract
being the automated one which should fail if there is a difference detected.
Following today's v5 release, we saw a few points of improvement on our release process:
version
script.a. The version file is also something we've considered removing, but in the meantime I've added a test to make sure that the file just exports a valid semver string.
The new release process is:
npm version <type>
, using major/minor/etc. as appropriategit push && git push tags/<version>
Important: Publishing will require creating/storing an
NPM_TOKEN
secret. So gotta do that before this will actually work.This PR also contains a few prettier fixes because that happens sometimes.