You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change deno quickstart to use package.json instead of deno.json (#4374)
# Description of Changes
Deno quickstart template now uses `package.json` instead of `deno.json`
so `spacetime dev` can run it. Added `templates/deno-ts/package.json`,
removed `deno.json`, and updated the Deno quickstart doc.
# API and ABI breaking changes
None.
# Expected complexity level and risk
**1** — Template and docs only.
# Testing
- [ ] `spacetime dev --template deno-ts` and confirm client runs.
- [ ] Spot-check updated Deno quickstart doc.
**Built-in TypeScript:** Deno runs TypeScript directly without transpilation, making startup faster and eliminating the need for build tools.
239
239
240
-
**Import maps:** The `deno.json` file defines import maps, allowing you to import `spacetimedb` directly without `npm:` prefix in your code.
240
+
**Dependencies:** The `package.json` file declares the `spacetimedb` dependency; Deno resolves it from there (and from `node_modules` after `pnpm install` when developing in the SpacetimeDB repo).
241
241
242
-
**No node_modules:** Deno caches dependencies globally, so there's no `node_modules` folder to manage.
242
+
**node_modules:** When using the template from the repo workspace, run `pnpm install` so `spacetimedb` is linked. For a project created with `spacetime init`, Deno resolves the versioned dependency from package.json.
243
243
</StepText>
244
244
<StepCode>
245
245
```bash
246
246
# Configure via environment variables
247
247
SPACETIMEDB_HOST=ws://localhost:3000 \
248
248
SPACETIMEDB_DB_NAME=my-app \
249
-
deno task start
249
+
pnpm run start
250
250
251
251
# Or run with explicit permissions
252
252
deno run --allow-net --allow-read --allow-write --allow-env --unstable-sloppy-imports src/main.ts
253
253
254
-
# The deno.json configures tasks and imports
255
-
cat deno.json
254
+
# package.json defines scripts and the spacetimedb dependency
255
+
cat package.json
256
256
{
257
-
"tasks": {
257
+
"scripts": {
258
258
"dev": "deno run --watch --allow-net --allow-read --allow-write --allow-env --unstable-sloppy-imports src/main.ts",
259
-
"start": "deno run --allow-net --allow-read --allow-write --allow-env --unstable-sloppy-imports src/main.ts"
259
+
"start": "deno run --allow-net --allow-read --allow-write --allow-env --unstable-sloppy-imports src/main.ts",
0 commit comments