If you want to contribute or run a local version of the Formo Node SDK, follow these steps:
Run the following command to build both CommonJS and ESM versions of the SDK:
pnpm install
pnpm build
pnpm testTo test your SDK changes in a test app, you can link the package locally using npm link or pnpm link.
For example, if your projects are in the same directory:
~/
├── your-app/
└── sdk-node/
Run the following commands:
# In ~/your-app
pnpm link ../sdk-nodeOr with npm:
# In ~/your-app
npm link ../sdk-nodeAny changes you make to your local package require rebuilding to be reflected:
# In ~/sdk-node
pnpm buildThe changes will automatically be available in the linked project.
To remove the link:
# In ~/your-app
pnpm unlink ../sdk-nodeOr with npm:
# In ~/your-app
npm unlink ../sdk-nodeRun the test suite:
pnpm testThese tests make real network requests to the Formo API. You need a valid Write Key:
FORMO_WRITE_KEY=your-key pnpm run test:integrationCheck code style and types:
pnpm lint-
Update the version using npm:
npm version patch # For bug fixes npm version minor # For new features npm version major # For breaking changes
This automatically:
- Updates
package.jsonwith the new version - Creates a git commit with the change
- Creates a version tag (e.g.,
v1.0.1)
- Updates
-
Push the commit and tag:
git push --follow-tags
-
Automatic workflow execution:
- GitHub Actions workflow triggers on the
v*tag - Builds and tests the package
- Publishes to npm
- GitHub Actions workflow triggers on the