Skip to content

Contributing

chris edited this page Mar 12, 2024 · 5 revisions

So contributors are welcome! Grab a ticket and go for it or create a ticket and open a PR. If more information is needed just leave a comment and we will get to you asap :)

Guidelines for contributing

It's still a bit wild-westy but there are few rules:

  1. Comment your code
  2. Prefix your branches with either feat/, bug/ or improv/, depending on the type of work. This helps triage PRs.
  3. When creating a PR, reference the ticket number in the description so that everyone knows what problem your PR is solving.

Development workflow

To make contributing easier, there's a script you can use. Of course you are more than welcome to do whatever.

  1. Create a redwood app and install the @redwoodjs-stripe packages. This will scaffold out the demo-store and give you a place to start from:
yarn create redwood-app my-store
cd my-store
yarn install
npx @redwoodjs-stripe/cli@latest setup
  1. Clone or fork the redwoodjs-stripe repo and run the sync script from inside /redwoodjs-stripe. The script needs the relative path to your testing app. This script syncs up your @redwoodjs-stripe packages in your app's node modules and watches for changes in the repo:
yarn sync ../my-store
  1. As of Redwoodjs v7, modifying the yarn rw dev command no longer works for rebuilding after changes in the node_modules for the various sides. As a result we've built a vite plugin for monitoring web side changes in the @redwoodjs-stripe/web node module. Import the vite plugin from @redwoodjs-stripe/web inside of the the vite config file on the web side. Add it to the list of plugins in the config.
diff --git a/web/vite.config.js b/web/vite.config.js
index 5d77c58..321ae9e 100644
--- a/web/vite.config.js
+++ b/web/vite.config.js
@@ -3,13 +3,14 @@ import dns from 'dns'
 import { defineConfig } from 'vite'
 
 import redwood from '@redwoodjs/vite'
+import redwoodStripe from '@redwoodjs-stripe/web/dev-vite-plugin'
 
 // So that Vite will load on localhost instead of `127.0.0.1`.
 // See: https://vitejs.dev/config/server-options.html#server-host.
 dns.setDefaultResultOrder('verbatim')
 
 const viteConfig = {
-  plugins: [redwood()],
+  plugins: [redwood(), redwoodStripe()],
 }
 
 export default defineConfig(viteConfig)

Warning

The vite plugin will break your project if you leave it in for prod. Please remember to remove it after working on the plugin code.

If you are using an earlier versions of Redwoodjs then you can still use the modified dev run command:

RWJS_WATCH_NODE_MODULES=1 yarn rw dev
  1. Run your Redwoodjs project and you should be able to see changes you make in the plugin code.
yarn rw dev

Happy hacking!!!

Clone this wiki locally