Skip to content

Publishing to npm

Huy Tran edited this page Apr 22, 2022 · 5 revisions
  1. This process requires code changes. Create a new branch off of main.
  2. In command prompt, type npm login. This will login your profile that connects to the AI2 Repo
  3. Build the library:
    • In the ui/library directory, run yarn build.
    • This should rebuild two files in the ui/library/dist directory: pdf-components.js and index.d.ts.
  4. Increment the version number:
    • In ui/library/dist/package.json, increment the version property.
  5. Commit your changes, push your branch, and submit a pull request.
  6. Tag the new version:
    • Run git tag v0.0.x (substitute 0.0.x with the appropriate version number)
    • Run git push --tags
  7. Publish to npm:
    • In ui/library/dist directory, run npm publish. If this is successful, npm will print out package details as a success message.
    • Within a couple minutes of successfully publishing, you will be able to pull the newest version of our library into your project! 🥳

Resource: how to format a version number

Clone this wiki locally