Skip to content

Instantly share code, notes, and snippets.

@patitonar
Last active April 22, 2020 13:22
Show Gist options
  • Save patitonar/fbecc2153ceb8c925f7b23b821f383bb to your computer and use it in GitHub Desktop.
Save patitonar/fbecc2153ceb8c925f7b23b821f383bb to your computer and use it in GitHub Desktop.
Instructions to publish tokenbridge-plugin to npm

Information

The package to be published gets its configuration from tokenbridge/burner-wallet-plugin/tokenbridge-plugin/package.json

{
  "name": "tokenbridge-plugin",
  "version": "1.0.0",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "files": [
    "/dist"
  ],
}
  • name is the name of how package will be available in npm.
  • main is entry point for the package
  • types is the entry point for typescript types
  • files is the list of files included when publishing the package. So we have to run yarn build first to generate the dist folder.

Steps to publish to npm

  1. Create account in https://www.npmjs.com/

  2. Go to tokenbridge/burner-wallet-plugin/tokenbridge-plugin/

  3. Run yarn build. Make sure it generates the dist folder

  4. Update version in tokenbridge/burner-wallet-plugin/tokenbridge-plugin/package.json

  5. Run yarn publish and fill login information if required. The prompt will ask for the new version, complete it with the version from package.json

Done! Now the package is published in npm registry.

More information in https://classic.yarnpkg.com/en/docs/publishing-a-package/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment