Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 0d8672d

Browse files
committed
chore: fix remaining build issues
1 parent 280d54b commit 0d8672d

File tree

23 files changed

+508
-386
lines changed

23 files changed

+508
-386
lines changed

examples/rivet/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
dist
2+
node_modules

examples/rivet/Dockerfile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,36 @@ RUN npm i -g corepack && corepack enable
44

55
WORKDIR /app
66

7-
COPY package.json pnpm-lock.yaml ./
7+
COPY package.json ./
88

99
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
10-
pnpm install --frozen-lockfile
10+
pnpm install
1111

1212
COPY . .
13-
# HACK: Remove worker.ts bc file is invalid in Node
14-
RUN rm src/worker.ts && pnpm build
1513

16-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
17-
pnpm install --prod --frozen-lockfile
14+
RUN pnpm build
15+
16+
COPY . .
17+
18+
# ===
1819

1920
FROM node:22-alpine AS runtime
2021

22+
RUN npm i -g corepack && corepack enable
23+
2124
RUN addgroup -g 1001 -S rivet && \
2225
adduser -S rivet -u 1001 -G rivet
2326

2427
WORKDIR /app
2528

26-
COPY --from=builder --chown=rivet:rivet /app/dist ./dist
27-
COPY --from=builder --chown=rivet:rivet /app/node_modules ./node_modules
2829
COPY --from=builder --chown=rivet:rivet /app/package.json ./
2930

31+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
32+
pnpm install --prod
33+
34+
COPY --from=builder --chown=rivet:rivet /app/dist ./dist
35+
3036
USER rivet
3137

32-
CMD ["node", "dist/server.js"]
38+
CMD ["node", "dist/server.js"]
39+

examples/rivet/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ export RIVET_ENVIRONMENT=your_environment
3939
npm run dev
4040
```
4141

42+
This will start the RivetKit server locally at http://localhost:6420.
43+
44+
### Testing the Client
45+
46+
In a separate terminal, run the client script to interact with your workers:
47+
48+
```sh
49+
npm run client
50+
```
51+
4252
### Deployment
4353

4454
Deploy to Rivet Cloud:

examples/rivet/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@
22
"name": "example-rivet",
33
"version": "0.9.0-rc.1",
44
"private": true,
5-
"type": "module",
65
"scripts": {
76
"dev": "tsx --watch src/server.ts",
87
"check-types": "tsc --noEmit",
9-
"build": "tsc"
8+
"build": "tsc",
9+
"client": "tsx scripts/client.ts"
1010
},
1111
"devDependencies": {
1212
"@types/node": "^22.13.9",
13-
"rivetkit": "workspace:*",
1413
"tsx": "^3.12.7",
1514
"typescript": "^5.5.2"
1615
},
1716
"dependencies": {
18-
"@rivetkit/rivet": "workspace:*"
17+
"rivetkit": "https://pkg.pr.new/rivet-gg/rivetkit@65c3659",
18+
"@rivetkit/rivet": "https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/rivet@65c3659"
1919
},
2020
"example": {
21-
"platforms": ["*"]
21+
"platforms": [
22+
"*"
23+
]
2224
},
2325
"stableVersion": "0.8.0"
2426
}

examples/rivet/scripts/client.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { createClient } from "rivetkit/client";
2+
import { execSync } from "node:child_process";
3+
import type { Registry } from "../src/registry.js";
4+
5+
// Get endpoint from rivet kit
6+
const endpoint = execSync("rivet kit endpoint", { encoding: "utf8" }).trim();
7+
console.log("🔗 Using endpoint:", endpoint);
8+
9+
// Create RivetKit client
10+
const client = createClient<Registry>(endpoint);
11+
12+
async function main() {
13+
console.log("🚀 Rivet Client Demo");
14+
15+
try {
16+
// Create counter instance
17+
const counter = client.counter.getOrCreate("demo");
18+
19+
// Increment counter
20+
console.log("Incrementing counter 'demo'...");
21+
const result1 = await counter.increment(1);
22+
console.log("New count:", result1);
23+
24+
// Increment again with larger value
25+
console.log("Incrementing counter 'demo' by 5...");
26+
const result2 = await counter.increment(5);
27+
console.log("New count:", result2);
28+
29+
// Create another counter
30+
const counter2 = client.counter.getOrCreate("another");
31+
console.log("Incrementing counter 'another' by 10...");
32+
const result3 = await counter2.increment(10);
33+
console.log("New count:", result3);
34+
35+
console.log("✅ Demo completed!");
36+
} catch (error) {
37+
console.error("❌ Error:", error);
38+
process.exit(1);
39+
}
40+
}
41+
42+
main().catch(console.error);

examples/rivet/src/worker.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/rivet/tsconfig.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"jsx": "react-jsx",
1111

1212
/* Specify what module code is generated. */
13-
"module": "esnext",
13+
"module": "nodenext",
1414
/* Specify how TypeScript looks up a file from a given module specifier. */
15-
"moduleResolution": "bundler",
15+
"moduleResolution": "nodenext",
1616
/* Specify type package names to be included without being referenced in a source file. */
1717
"types": ["node"],
1818
/* Enable importing .json files */
@@ -23,9 +23,6 @@
2323
/* Enable error reporting in type-checked JavaScript files. */
2424
"checkJs": false,
2525

26-
/* Disable emitting files from a compilation. */
27-
"noEmit": true,
28-
2926
/* Ensure that each file can be safely transpiled without relying on other imports. */
3027
"isolatedModules": true,
3128
/* Allow 'import x from y' when a module doesn't have a default export. */
@@ -37,7 +34,8 @@
3734
"strict": true,
3835

3936
/* Skip type checking all .d.ts files. */
40-
"skipLibCheck": true
37+
"skipLibCheck": true,
38+
"outDir": "dist"
4139
},
4240
"include": ["src/**/*"]
4341
}

packages/drivers/file-system/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/platforms/bun/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/platforms/bun/package.json

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)