Intro | Architecture | Setup | Tasks | Local development | Roles | Publish
- Ensure you have Node.js and npm installed.
- An npm account. Sign up here if you don't have one.
Before publishing, make sure your package.json
is properly set up:
name
: The package name (must be unique on npm).version
: The current version of the package.description
: A brief description of your package.main
: The entry point of your package (usuallyindex.js
).scripts
: Any scripts you want to include, like build or test scripts.author
: The author's name and contact information.repository
: The repository URL where your code is located.keywords
: An array of keywords to help users discover your package.files
: An array of file patterns that describes which files should be included when your package is installed.dependencies
anddevDependencies
: Any required packages.
- Log in to your npm account from the command line:
npm login
- Enter your npm username, password, and email address when prompted.
- Create a .github/workflows/publish.yaml file in your project.
- Define the npm publishing process using GitHub Actions:
- Add your npm token
NPM_TOKEN
to the GitHub repository secrets (Settings > Secrets).
- Generate a release in the
main
branch of thessv_network
GitHub repository. - The GitHub Actions workflow will automatically publish the package to npm.