Skip to content

Latest commit

 

History

History
147 lines (103 loc) · 3.18 KB

CONTRIBUTING.md

File metadata and controls

147 lines (103 loc) · 3.18 KB

Contributing

Getting Started

We'd love to accept your contributions to this project! If you are a first time contributor, please review our Contributing Guidelines before proceeding.

Prerequisites

Setup

  • Fork this repository

  • Clone this repository to your workstation:

# Clone the project
git clone git@github.com:go-vela/vela-npm.git $HOME/go-vela/vela-npm
  • Navigate to the repository code:
# Change into the project directory
cd $HOME/go-vela/vela-npm
  • Point the original code at your fork:
# Add a remote branch pointing to your fork
git remote add fork https://github.com/your_fork/vela-npm

Running Locally

  • Navigate to the repository code:
# Change into the project directory
cd $HOME/go-vela/vela-npm
  • Build the repository code:
# Build the code with `make`
make build
  • Run the repository code:
# Run the code with `make`
make run

Development

  • Navigate to the repository code:
# Change into the project directory
cd $HOME/go-vela/vela-npm
  • Make a test user for your local Verdaccio instance, this will create a .env file with the access token in it
# username: testuser
# password: testpass
# email: test@test.com
make user
  • Write your code and tests to implement the changes you desire.

  • Test your code against the provided example:

# Build code and test plugin against local registry
make test-e2e
  • Ensure your code meets the project standards:
# Clean the code with `make`
make clean
  • Push to your fork:
# Push your code up to your fork
git push fork main
  • Make sure to follow our PR process when opening a pull request

Thank you for your contribution!

Testing A Different Project

Sometimes it's helpful to test out publishing npm packages locally before trying in a CI environment. This repo is also helpful in facilitating that.

  • Start Verdaccio
make registry
  • Create a user
make user
  • Build local plugin image
make build
  • Clone your npm project repository
git clone my-project
  • Get your project ready for publishing
cd my-project
npm install --production
# run build scripts if needed
npm run build
  • From plugin repo, run local plugin against your project, where $PROJECT_PATH is the directory path to your npm project
PROJECT_PATH=/User/helpful-contributor/my-project make docker-run