Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/basic-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "esbuild src/main.ts --bundle --platform=node --outfile=dist/main.js --format=esm && node dist/main.js",
"start": "node dist/main.js",
"build": "esbuild src/main.ts --bundle --platform=node --outfile=dist/main.js --format=esm",
"generate": "cargo run -p gen-bindings -- --out-dir src/module_bindings --module-path spacetimedb && prettier --write src/module_bindings",
"spacetime:generate": "spacetime generate --lang typescript --out-dir src/module_bindings --module-path spacetimedb",
"spacetime:publish:local": "spacetime publish --module-path spacetimedb --server local",
"spacetime:publish": "spacetime publish --module-path spacetimedb --server maincloud"
Expand Down
51 changes: 0 additions & 51 deletions templates/basic-ts/spacetimedb/pnpm-lock.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions templates/basic-ts/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import {
tables,
} from './module_bindings/index.js';

// `spacetime init` and `spacetime dev` write the connection settings to
// `.env.local`. Variables already set in the environment take precedence.
try {
process.loadEnvFile?.('.env.local');
} catch {
// No `.env.local`: fall back to the defaults below.
}

const HOST = process.env.SPACETIMEDB_HOST ?? 'ws://localhost:3000';
const DB_NAME = process.env.SPACETIMEDB_DB_NAME ?? 'basic-ts';

Expand Down
7 changes: 5 additions & 2 deletions templates/basic-ts/src/module_bindings/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading