Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .changeset/pink-ducks-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-pds": patch
"@ascorbic/pds": patch
---

Improvements to CLI prompts and logic
26 changes: 0 additions & 26 deletions demos/pds/.env.example

This file was deleted.

13 changes: 7 additions & 6 deletions packages/create-pds/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ async function getLatestPdsVersion(): Promise<string> {
throw new Error(`Failed to fetch: ${response.status}`);
}
const data = (await response.json()) as { version: string };
return `^${data.version}`;
} catch {
// Fallback to a known version if fetch fails
return "^0.2.0";
}
if (data.version) {
return data.version;
}
} catch {}
// Fallback to a known version if fetch fails
return "^0.2.0";
}

const main = defineCommand({
Expand Down Expand Up @@ -253,7 +254,7 @@ const main = defineCommand({
// Replace placeholders in package.json
await replaceInFile(join(targetDir, "package.json"), {
name: projectName,
pdsVersion,
pdsVersion: `^${pdsVersion}`,
});

spinner.stop("Template copied");
Expand Down
31 changes: 9 additions & 22 deletions packages/create-pds/templates/pds-worker/env.example
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
# Example environment variables for local development
# Copy this to .dev.vars and fill in your values
# Or run `pnpm pds init --local` to generate automatically
# Environment variables for local development
# Run `pnpm pds init` to generate this file automatically

# Public hostname of your PDS
PDS_HOSTNAME=demo-pds.example.com

# Your account's DID (usually did:web:{PDS_HOSTNAME})
DID=did:web:demo-pds.example.com

# Your account's handle
HANDLE=alice.demo-pds.example.com

# Bearer token for write operations (generate a random string)
AUTH_TOKEN=your-secret-token-here
# Bearer token for write operations
AUTH_TOKEN=

# Private key for signing commits (secp256k1 JWK)
SIGNING_KEY={"kty":"EC","crv":"secp256k1","x":"...","d":"..."}

# Public key for DID document (multibase encoded)
SIGNING_KEY_PUBLIC=zQ3sh...
SIGNING_KEY=

# Secret for signing session JWTs (generate a random string)
JWT_SECRET=your-jwt-secret-here
# Secret for signing session JWTs
JWT_SECRET=

# Optional: Bcrypt hash of account password (for app login)
# PASSWORD_HASH=$2a$10$...
# Bcrypt hash of account password (for app login)
PASSWORD_HASH=
4 changes: 2 additions & 2 deletions packages/create-pds/templates/pds-worker/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// AT Protocol PDS on Cloudflare Workers
// Run `pnpm pds init` to configure, or `pnpm pds init --production` to deploy secrets
"name": "atproto-pds",
"name": "my-pds",
"main": "src/index.ts",
"compatibility_date": "2025-12-02",
"compatibility_flags": [
Expand Down Expand Up @@ -47,4 +47,4 @@
// - SIGNING_KEY: Private signing key (secp256k1 JWK)
// - JWT_SECRET: Secret for signing session JWTs
// - PASSWORD_HASH: Bcrypt hash of account password (for Bluesky app login)
}
}
Loading
Loading