Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.24 KB

CONTRIBUTING.md

File metadata and controls

62 lines (45 loc) · 2.24 KB

Contributing

You need the Node version in .node-version and pnpm 12. For install and deploy, see the README, and for the development loop docs/development.md; each example's README lists its commands.

Build and check

pnpm install
pnpm run build
pnpm run check

pnpm run check typechecks the examples against the built component, so build first.

Component codegen

src/component/_generated comes from the Convex code generator, which needs a deployment. After a change to the component's functions or schema, from packages/convex-hosting:

CONVEX_AGENT_MODE=anonymous npx convex dev --once
pnpm run build:codegen

The first command creates an anonymous local deployment and writes .env.local, .convex/, and an empty app in convex/; git ignores all of them. The second runs npx convex codegen --component-dir ./src/component against that deployment and builds the package. Do not edit the generated files.

Cloudflare's asset worker

src/workers-sdk is a copy of Cloudflare's asset worker and of its test cases from cloudflare/workers-sdk, each file at its upstream path, at the commit in src/workers-sdk/UPSTREAM. Do not edit it by hand: CI runs the sync and fails when the folder differs. To update it, from packages/convex-hosting:

node scripts/sync-workers-sdk.ts [<commit>]

Cloudflare's integration fixtures under src/workers-sdk/fixtures run against anonymous local Convex deployments, which the Convex CLI starts (the first run downloads the local backend):

pnpm run test:fixtures

A test that fails by a stated difference from Cloudflare is listed in packages/convex-hosting/scripts/fixtures-expected-failures.json with its reason; the run fails when a listed test passes or an unlisted test fails.

Releasing

  1. In a PR, bump version in the package's package.json and add a CHANGELOG.md entry for @samebase/convex-hosting.
  2. Merge it. The Release workflow runs CI for that commit, publishes every package version that is not on npm yet with provenance, and tags it as <package name>@<version>. No approval step: the merge is the release.

Before a release, test a PR build from its pkg.pr.new preview link, which CI posts on the PR.