Skip to main content

Contribution and Coding Guidelines

Use Volta

The deployment lambda uses specific versions of node and npm. The root package.json specifies:

"volta": {
"node": "22.22.0",
"npm": "10.9.4"
}

After installing Volta (and restarting your session), your terminal will automatically use the correct versions.

Use npm Workspaces

The Helium repo uses npm workspaces to link dependencies. Most npm commands run from the root directory.

npm install example-dependency -w ./packages/example-component

Adding a new component workspace:

npm init -w ./packages/new-example-component
  • UI packages should be developed under /packages/
  • Package name should be prefixed with @thoughtindustries/, license: MIT

GraphQL Codegen

Use GraphQL Codegen to generate hooks for queries and mutations. The repo points to the remote GraphQL endpoint for schema introspection.

npm run generate -w ./<path_to_workspace>

Storybook and Testing

Each package should include a Readme.md and a Storybook story. Run from root:

npm run storybook

Storybook runs at localhost:6006 and is published at thoughtindustries.github.io/helium.

Tests run with:

jest --watch

Coding Standards

  • PascalCase for components, type names, enum values
  • camelCase for properties and local variables
  • lowercase-hyphenated for filenames
  • .generated.* files are auto-generated — do not hand-edit
  • Use arrow functions, 2-space indentation, double quotes
  • Use .map(), .filter() instead of loops
  • Review Node.js compatibility for Cloudflare Workers constraints