Skip to content
commercekit-toolsPublic

About

Open-source API sandbox and simulation platform for CommerceKit developer tools.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CommerceKit Sandbox

CommerceKit Sandbox is an open-source API simulation platform for testing GitHub Actions, command-line tools, integrations, and developer applications without depending on live vendor systems.

The repository is part of the CommerceKit developer-tooling ecosystem. Each simulated service is an independently deployable Cloudflare Worker in a pnpm workspace. SAP Commerce Cloud CCv2 is the first service.

Architecture

apps/
└── ccv2/   # commercekit-sandbox-ccv2 Worker

New services can be added under apps/<service-name> with their own Wrangler configuration, bindings, tests, and deployment. Shared packages will be introduced only after reusable code exists.

The CCv2 Worker uses:

  • TypeScript and Hono for the HTTP API
  • Cloudflare Workers for execution
  • SQLite-backed Durable Objects for isolated run state
  • Vitest with Cloudflare's Workers runtime integration
  • ESLint and Prettier for code quality

The service catalog, CCv2 documentation, API reference, and interactive playground are hosted on commercekit.tools. This repository owns the API Worker at ccv2.sandbox.commercekit.tools.

Requirements

  • Node.js 26.13.1 LTS, pinned in both repository and CCv2 build roots
  • pnpm 12.11.2 through Corepack
npm install --global corepack@0.36.0
corepack enable
pnpm install --frozen-lockfile

Node 26 does not bundle Corepack. Install the pinned Corepack bootstrap above before enabling pnpm. CI uses the existing pnpm setup action. Cloudflare Workers Builds reads apps/ccv2/.node-version; keep it aligned with the repository pin and remove or update any dashboard NODE_VERSION override that still selects Node 24. This changes the build host; production continues to run on workerd with the existing compatibility date, bindings and runtime secrets.

Development

Start the CCv2 Worker on http://localhost:8787:

pnpm dev:ccv2

Generate local signing material, then smoke-test the implemented routes:

pnpm --filter @commercekit/sandbox-ccv2 secrets:generate
curl http://localhost:8787/
curl http://localhost:8787/sandbox/v1/health
curl http://localhost:8787/openapi.json

The health route performs a real SQLite query through the Durable Object binding.

Run the bounded end-to-end suite against a local Worker:

pnpm smoke:ccv2

Production verification is deliberate and opt-in. It creates only disposable synthetic runs, redacts credentials, and attempts cleanup in finally:

CCV2_CONFIRM_PRODUCTION=1 pnpm smoke:production

Validation

pnpm types:ccv2
pnpm security:audit
pnpm lint
pnpm format:check
pnpm typecheck
pnpm test
pnpm build:check
pnpm run ci

pnpm build:check builds the Worker through a Wrangler deployment dry-run. It does not deploy or require Cloudflare credentials.

pnpm security:audit includes development dependencies and fails on moderate or higher advisories. It runs in both pnpm run ci and GitHub CI. Development tooling is part of this check even when it is absent from the deployed Worker.

Worker tests retain per-file isolation and their existing timeouts while bounding concurrent workerd startup to two workers. This avoids resource-contention timeouts during local and CI builds without skipping scenarios.

GitHub Actions runs validation only. Production deployment uses Cloudflare Workers Builds, with apps/ccv2 as the root directory. Required runtime secrets and the pre-merge checklist are in apps/ccv2/docs/cloudflare-deployment.md.

Current status

The CCv2 Worker implements isolated 24-hour runs, synthetic OAuth/JWT authentication, deterministic scenarios and faults, build and deployment lifecycles, green decisions, cancellation, and the ten families in the independently authored Management API 2.0.12 inventory. Both OpenAPI documents, contract checks, and full Worker-runtime integration tests are included. SCIM remains outside the verified Management API scope, so no unverified SCIM routes are advertised. See the contract audit, production assessment, and website integration contract.

License

MIT

About

Open-source API sandbox and simulation platform for CommerceKit developer tools.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages