Skip to content

Conversation

@nikrooz
Copy link
Contributor

@nikrooz nikrooz commented Nov 10, 2025

  • use pnpm workspaces
  • use turbo for caching tasks
  • use plop.js for generating new libs
  • use changeset for release

- Deleted all files except .git
- Copied typescript-monorepo-template structure
- Updated root package.json with SDK metadata:
  - Name: @restatedev/sdk-typescript
  - Version: 1.9.0
  - Repository URLs
  - Added typedoc and wasm-pack dependencies
  - Added build-docs script
- Updated .templates/package.json.hbs with SDK metadata

Step 2: Create restate-sdk-core package

- Created package using plop template (lib, publishable)
- Copied source code from main branch:
  - src/core.ts
  - src/duration.ts
  - src/entry_codec.ts
  - src/index.ts
  - src/serde_api.ts
- Copied README.md from main
- Updated tsconfig.json with path mappings
- Single entry point (main only)

Step 3: Create restate-sdk package with multiple entry points

- Created package using plop template (lib, publishable)
- Added 3 additional entry points using add-entry:
  - fetch (src/fetch.ts)
  - lambda (src/lambda.ts)
  - node (src/node.ts)
- Added dependency: @restatedev/restate-sdk-core (workspace)
- Added external to tsdown config to prevent bundling core
- Added devDependency: @types/aws-lambda
- Copied all source code from main branch
- Copied tests from main branch
- Copied README from main
- Updated tsconfig.json with path mappings

Step 4: Create restate-sdk-clients package

- Created package using plop template (lib, publishable)
- Added dependency: @restatedev/restate-sdk-core (workspace)
- Added external to tsdown config
- Copied source code from main branch
- Copied README from main
- Copied buf.yaml for protocol buffers
- Single entry point
- Updated tsconfig.json with path mappings

Step 5: Create restate-sdk-zod package

- Created package using plop template (lib, publishable)
- Added devDependencies:
  - @restatedev/restate-sdk-core (workspace)
  - zod (catalog from pnpm-workspace.yaml)
- Added peerDependency: zod ^3.25.0 || ^4.0.0
- Added external to tsdown config for both core and zod
- Copied source code from main branch
- Copied tests from main branch
- Copied README from main
- Single entry point
- Updated tsconfig.json with path mappings

Step 6: Create restate-sdk-testcontainers package

- Created package using plop template (lib, publishable)
- Added dependencies:
  - @restatedev/restate-sdk (workspace)
  - @restatedev/restate-sdk-clients (workspace)
  - apache-arrow: ^18.0.0
  - testcontainers: ^10.24.1
- Added external to tsdown config for SDK packages
- Copied source code from main branch
- Copied README from main
- Single entry point
- Updated tsconfig.json with path mappings

Step 7: Create restate-sdk-cloudflare-workers package (FINAL SDK PACKAGE!)

- Created package using plop template (lib, publishable)
- Added fetch entry point using add-entry
- Added dependencies:
  - @restatedev/restate-sdk-core (workspace)
- Added devDependencies:
  - @types/aws-lambda
  - @restatedev/restate-sdk (workspace)
- Added external to tsdown config
- Copied patches/ directory (Cloudflare-specific patches)
- Copied patch_sdk_cf_workers.sh script
- Copied source code from main branch
- Two entry points: main and fetch
- Updated tsconfig.json with path mappings

All 6 SDK library packages complete!

Step 8: Create restate-e2e-services test package

- Created using plop template (type: test)
- Added dependencies:
  - @restatedev/restate-sdk (workspace)
  - @restatedev/restate-sdk-clients (workspace)
  - heapdump, uuid
- Copied all source code from main
- Copied Docker files and config from main
- Test package (private, no build step)

Add 7 example packages with source code

- packages/examples/restate-sdk-examples - Main SDK examples
- packages/examples/node - Node.js example
- packages/examples/bun - Bun example
- packages/examples/deno - Deno example
- packages/examples/lambda - AWS Lambda example
- packages/examples/cloudflare - Cloudflare Workers example
- packages/examples/vercel - Vercel example

Add WASM bindings, build tools, and TypeDoc config

- sdk-shared-core-wasm-bindings/ - Rust WASM package for core bindings
- .tools/build_core.sh - Build script for WASM bindings
- typedoc.json - TypeScript documentation configuration

Fix tsconfig.base.json - add lib and other compiler options

Add missing compiler options from original SDK:
- lib: ["esnext"] - Required for proper fetch API types
- allowSyntheticDefaultImports
- noImplicitThis

Add SDK templates, VSCode settings, and API directory

- templates/ - Original SDK templates for different runtimes
- .vscode/settings.json - VSCode workspace configuration
- .api/.gitkeep - Placeholder for API directory

Replace template workflows with SDK workflows

- Remove template CI/release workflows
- Add SDK-specific workflows:
  - Template testing workflows (bun, cloudflare, deno, lambda, node, vercel)
  - compatibility.yaml - SDK compatibility testing
  - docker.yml - Docker image building
  - integration.yaml - Integration tests
  - test.yml - Unit tests
  - release-docs.yml - Documentation releases
- Add CLA configuration

Clean up duplicate package directories from git checkout operations

Update generated TypeScript configs and format code

- Regenerate path mappings in tsconfig.json
- Update tsconfig.build.json references in all packages
- Format code with prettier

Reorder exports in restate-sdk-cloudflare-workers package.json

Move package.json export to end for consistency

Restore SDK-specific ignore patterns

Add back SDK-specific patterns that were in main:
- .gitignore: Add generated sources, buf.lock, test reports, .restate, docs-out, build artifacts
- .prettierignore: Add generated sources, buf.lock, IDE files, test reports, build artifacts

Restore original README.md and LICENSE from SDK

Keep the SDK's original README and LICENSE instead of template versions

Restore original eslint.config.js from SDK

Keep SDK-specific ESLint configuration:
- Additional ignore patterns (Next.js, Wrangler, WASM files, etc.)
- SDK-specific rules (no-console, template-expressions)
- Special rules for examples and test packages

Remove placeholder index.ts files from example packages

Remove template-generated placeholder files:
- packages/examples/restate-sdk-examples/src/index.ts
- packages/examples/vercel/src/index.ts

These packages have their actual source code in other files.

Restore original tsdown.config.ts settings from SDK

Key changes to match original SDK configs:
- Add 'unbundle: true' to core, sdk, and clients packages
- Restore Node.js built-in externals for restate-sdk
- Restore 'http2' external for testcontainers
- Remove cloudflare-workers and zod externals (bundled by default)
- Remove 'clean' flag (not in originals)
- Reorder entry points to match original

Reorder exports in restate-sdk package.json

Move package.json export to end for consistency with other packages

Fix version and description in all library packages

Update all library package.json files:
- Set version to 1.9.0 (from 0.0.0 placeholder)
- Set description to 'Typescript SDK for Restate' (from TODO placeholder)

Restore original .prettierrc from SDK

Keep SDK's minimal prettier config with only trailingComma setting

pnpm i

Signed-off-by: Nik Nasr <nik@restate.dev>

Remove templates/ directory and update workflows to use packages/examples/

- Update all template test workflows to use packages/examples/ instead of templates/
- Remove templates/ directory (now redundant with packages/examples/)
- Remove 'templates' from .prettierignore
- This completes the migration: examples are now part of the monorepo structure

Remove placeholder README from restate-sdk-cloudflare-workers

Restore original formatting for cloudflare-workers patches

Keep original single-line import formatting instead of prettier-formatted multi-line imports

Clean up temporary patch files from wrong location

Restore original WASM-generated files for clean rename detection

Remove placeholder source files from cloudflare-workers and e2e-services

Fix cloudflare-workers package to use patch script instead of tsdown

Restore original formatting for WASM TypeScript declarations

add src

Signed-off-by: Nik Nasr <nik@restate.dev>

fix examples

Signed-off-by: Nik Nasr <nik@restate.dev>

fix examples

Signed-off-by: Nik Nasr <nik@restate.dev>

some fixes

Signed-off-by: Nik Nasr <nik@restate.dev>

fix lint

Signed-off-by: Nik Nasr <nik@restate.dev>

fix import

Signed-off-by: Nik Nasr <nik@restate.dev>

fix build

Signed-off-by: Nik Nasr <nik@restate.dev>

fix vercel

Signed-off-by: Nik Nasr <nik@restate.dev>

fix

Signed-off-by: Nik Nasr <nik@restate.dev>

update workflows

Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Test Results

  7 files  ±0    7 suites  ±0   4m 9s ⏱️ +16s
 49 tests ±0   49 ✅ ±0  0 💤 ±0  0 ❌ ±0 
210 runs  ±0  210 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 597e96b. ± Comparison against base commit 88c15ae.

♻️ This comment has been updated with latest results.

Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz nikrooz marked this pull request as ready for review November 10, 2025 19:14
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@slinkydeveloper
Copy link
Collaborator

slinkydeveloper commented Dec 11, 2025

Hey @nikrooz , i tried to use this but still nothing...

!10221 ➜ pnpm install --loglevel debug                                                                                        ~/projects/work/sdk-typescript (NN_reorg2) ✗
Scope: all 15 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +796
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 796, reused 796, downloaded 0, added 796, done
node_modules/.pnpm/cpu-features@0.0.10/node_modules/cpu-features: Running install script...
node_modules/.pnpm/heapdump@0.3.15/node_modules/heapdump: Running install script...
 ELIFECYCLE  Command failed.

Why do we even use these modules? in the test-services image? can we make those optional and install them only in the test-services image?

Copy link
Collaborator

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments. Once those are solved, you can go ahead and merge

Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
Signed-off-by: Nik Nasr <nik@restate.dev>
@nikrooz
Copy link
Contributor Author

nikrooz commented Jan 4, 2026

Left a bunch of comments. Once those are solved, you can go ahead and merge

Thank you for the review. I've addressed all the comments.

@nikrooz nikrooz merged commit 83583c1 into main Jan 4, 2026
9 checks passed
@nikrooz nikrooz deleted the NN_reorg2 branch January 4, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants