cf-service-sdk
v0.1.51
Published
TypeScript SDK for the Cloud Forge Service
Readme
cf-service-sdk
TypeScript SDK for the CloudForge Service, built with Apollo Client and GraphQL.
Installation
npm install cf-service-sdkDevelopment
Prerequisites
- Node.js
- The
cf-serviceDjango backend checked out as a sibling directory (../cf-service) - Django virtual environment at
../cf-service/venv
Local Development Workflow
Use update-local.sh to pull the latest schema from the Django backend, regenerate all SDK files, build, and install the package directly into cf-web — all in one step.
./update-local.shThis script will:
- Clean the
distdirectory and remove old generated schema/documents - Pull the latest GraphQL schema from the Django backend (
npm run update-schema) - Run GraphQL codegen to regenerate TypeScript types (
npm run generate) - Run SDK codegen (
npm run generate-sdk) - Install dependencies
- Build the package
- Pack and install it directly into
../cf-web
Note: Both
cf-serviceandcf-webmust be checked out as sibling directories alongside this repo.
Publishing to npm
Use publish.sh to build and publish a new version to npm.
./publish.shThis script will:
- Verify you are logged in to npm (run
npm loginfirst if not) - Clean and regenerate all schema, documents, and SDK files
- Check whether the current version in
package.jsonalready exists on npm - If it does, prompt you to bump the version (patch / minor / major)
- Confirm before publishing
- Publish the package with
npm publish --access public
npm Scripts
| Script | Description |
|---|---|
| npm run update-schema | Pull GraphQL schema from Django and generate .graphql files |
| npm run generate | Run GraphQL codegen to produce TypeScript types |
| npm run generate-sdk | Generate the TypeScript SDK from GraphQL operations |
| npm run build | Compile TypeScript to dist/ |
