SAService Architect Open designer
SAService ArchitectDocumentation
Code generation pnpm workspace -> npm packages

Generate TypeScript Microservices: pnpm Workspace

TypeScript generation creates independent npm packages joined by a root pnpm workspace.

When to use

Use this reference when generating, reviewing or operating a Service Architect project.

Behavior

  • src/main.generated.ts starts a generated service package.
  • src/internal/app and config contain runtime graph assembly and typed configuration.
  • src/internal/functions holds preserved business code.
  • test mirrors business functions and supplies ServiceLib test support.
  • User-named Modules expose generated ESM entrypoints for the public types, functions and connector schemas assigned to them.
  • Standalone package metadata and Compose/Docker files can be emitted for repository extraction.

Run a complete TypeScript microservice example

pnpm packages, strict TypeScript, grpc-js and asynchronous Node.js execution.

The runnable TypeScript example contains business implementations as well as generated infrastructure. A new Designer archive provides extension points for your own business code.

Install Git, GNU Make, Docker with Compose v2, and the host toolchain required by the repository README. Run these commands from the example workspace root; make help lists the targets available in that version.

git clone https://github.com/gorundebug/tsexample.git
cd tsexample
make help
make init
make docker-up
  • Use the service README and generated configuration for endpoint addresses and example requests.
  • When finished, make docker-down stops the stack while preserving its volumes.
  • Continue with the visual design guide or safe regeneration.

TypeScript service directories

Important paths in each generated TypeScript service.

PathOwnershipDescription
package.jsonManaged

Package scripts, dependencies and ESM metadata.

src/main.generated.tsGenerated

Service process entrypoint.

src/internal/app/Generated

Runtime graph and connector construction.

src/internal/functions/Preserved

Business operators and endpoint handlers.

test/functions/Preserved

Business behavior tests.

tsconfig.json + tsconfig.test.jsonManaged

Production and test build graphs.

package.standalone.generated.jsonGenerated

Metadata for extracting an independent repository.

Dockerfile.standalone.generatedGenerated

Standalone multi-stage service image.

scripts/node-diagnostics.generated.mjsGenerated

Diagnostic reports and heap snapshots.

TypeScript service tree

<service-name>/
  package.json + tsconfig.json
  src/main.generated.ts
  src/internal/app/ + functions/
  test/functions/ + support/
  scripts/
  config/ + graph/ + docs/
  grafana/ + helm/