chadtmiller.com/pds.js
An atproto PDS in JavaScript, for Cloudflare Workers and Node
0
0
# @pdsjs/sites
## 2.1.9
### Patch Changes
- Updated dependencies
- @pdsjs/core@2.5.2
## 2.1.8
### Patch Changes
- Updated dependencies [542c4dc]
- @pdsjs/core@2.5.1
## 2.1.7
### Patch Changes
- a67a568: An account can publish a palette. `dev.pdsjs.app.theme` holds one per record
key: a display name, whether it runs light or dark, and colours by semantic
name rather than by the element they paint. A page that meets a name it does not know ignores it, and a name left
out keeps the page's own.
The record says nothing about how a page should read it. A page that has to
choose, such as one colouring a set of things apart, asks the colours: a
palette with no hue to spend answers for itself.
- abae790: `/.well-known/atproto-did` on a site hostname carries
`Access-Control-Allow-Origin: *` and answers a preflight. Handle resolution in
a browser app is a cross-origin fetch of the handle's own hostname, so a client
that resolves by well-known alone could not read the DID of an account whose
handle is a site this server hosts. It is the one path on a site origin with
CORS headers: the reference PDS serves the same document through its CORS
middleware. A hostname with no account answers a plain-text 404, not the site's
404 page.
- Updated dependencies [d66fcff]
- Updated dependencies [05a11b4]
- Updated dependencies [f79dd82]
- Updated dependencies [e0b38cd]
- Updated dependencies [cc4577b]
- Updated dependencies [7c06024]
- Updated dependencies [6935a55]
- Updated dependencies [15c69af]
- Updated dependencies [411b47b]
- Updated dependencies [861663f]
- Updated dependencies [154e7d7]
- Updated dependencies [10c91f6]
- Updated dependencies [77eb9db]
- Updated dependencies [76f5187]
- Updated dependencies [b51250e]
- Updated dependencies [799286b]
- Updated dependencies [4adc49e]
- Updated dependencies [9149663]
- Updated dependencies [fd401a4]
- Updated dependencies [93816a1]
- Updated dependencies [3d475f8]
- Updated dependencies [078c2df]
- Updated dependencies [d5f111c]
- @pdsjs/core@2.5.0
## 2.1.6
### Patch Changes
- Updated dependencies [d307f57]
- Updated dependencies [2d0d653]
- @pdsjs/core@2.4.3
## 2.1.5
### Patch Changes
- Updated dependencies [c235e96]
- @pdsjs/core@2.4.2
## 2.1.4
### Patch Changes
- Updated dependencies [fa1558c]
- @pdsjs/core@2.4.1
## 2.1.3
### Patch Changes
- 6b79149: Video-ready blob hosting. Blob uploads and downloads stream: `uploadBlob` hashes and stages bytes chunk by chunk instead of buffering the body, and `getBlob` answers byte ranges from a streamed read, so a 300 MB video fits through a Durable Object and seeks in a browser. The blob port gains optional `createWriter` and `getStream`; the fs, R2, S3 and Deno stores implement both, and each platform injects its native SHA-256. Drive stores a file as one blob of its own type when the store streams, takes large files across several requests through upload sessions, and offers a Link dialog with the blob ref any record can embed. The Worker serves public blobs through the edge cache, and a site's `/.blobs/` route serves ranges and now applies the same space-privacy filter as `getBlob`. A new `videos.mjs` example app is a gallery over the drive's videos. The node server accepts a `blobUploadLimit` option (`PDS_BLOB_UPLOAD_LIMIT` in the example), which Bluesky video posting needs.
- Updated dependencies [ee6d696]
- Updated dependencies [54bec84]
- Updated dependencies [f716d9d]
- Updated dependencies [4c334b3]
- Updated dependencies [6b79149]
- Updated dependencies [8616855]
- Updated dependencies [af8b1fd]
- @pdsjs/core@2.4.0
## 2.1.2
### Patch Changes
- 89b33a7: Site files and repo blobs serve with `Access-Control-Allow-Origin: *`. Site
content is public; the open origin lets another site's page use a font or
fetch a file from here, the same as any static file host.
- Updated dependencies [232a280]
- Updated dependencies [c541c98]
- Updated dependencies [f8e3dff]
- Updated dependencies [bdad8c4]
- Updated dependencies [51d6402]
- Updated dependencies [d8cae21]
- Updated dependencies [d8cae21]
- Updated dependencies [24c9e1e]
- Updated dependencies [035450d]
- Updated dependencies [3920c52]
- Updated dependencies [585139b]
- Updated dependencies [5125583]
- @pdsjs/core@2.3.0
## 2.1.1
### Patch Changes
- a4cae1f: An app-authoring guide, and the two reference apps that go with it.
`docs/apps.md` covers the three records an app is made of, how a page finds
the repo it serves, reading through queries and writing with an app password,
choosing a collection, publishing a manifest, installing, and the update loop
a developer follows. `examples/apps/` holds the two working apps it refers to,
each of which discovers its host from its own origin and so runs on any
account that installs it.
- 72965f8: Installable apps: a repo-hosted site, published once, installed anywhere.
A developer publishes a `dev.pdsjs.app.manifest` record naming their app
and pinning its site record by CID, with an icon, the query definitions the
app reads, declared settings ({key, label, type, default, options}, data
and never code), a suggested subdomain, and an `external` flag for apps
that talk beyond the user's own PDS. The pinned record key is an artifact
address with no naming meaning.
Installing copies the app into the user's own repo: every blob is fetched
from the developer's PDS and hashed locally against the CID the record
names, the site record copies verbatim so its CID stays the one the
manifest pinned, query defs and a `dev.pdsjs.app.install` record land with
it in one commit. The install record snapshots the name, icon, settings
schema, and chosen values, so the account page needs no cross-server read
and the app survives its developer's repo disappearing. A drifted pin
refuses to install; a manifest requesting scopes refuses until grants
exist.
Two ways in: `pdsjs-site install <at-uri>` over stock XRPC, or the account
page's install sheet, which previews the manifest before anything happens.
Installed apps list with their icon and name, carry a generated settings
form, move to a new subdomain without touching their content, and show an
update action when the developer publishes a new manifest version; updates
keep the user's settings and subdomain. Apps discover their host from
their own origin at load, so one published file serves every installer's
data.
- 098af68: Materialized queries: a `dev.pdsjs.query.def` record names a live view over
one collection of the repo, with equality filters and one sort field, and
`GET /xrpc/dev.pdsjs.query.run` returns the whole view as JSON in a single
request. Reading a thousand-record collection through `listRecords` costs a
serial cursor walk; through a query it is one round trip. The engine keeps a
decoded copy of each queried collection in memory, replayed from storage on
first use and maintained from every commit, so results reflect a write
immediately. Off unless `PDS_EXPERIMENTAL_QUERIES` (the `experimental.sites.queries` option on
Node and Deno) is set.
Behind it, `@pdsjs/core` gains the app platform's live-data seams, both
inert until a platform package fills them: an optional `onCommit` callback
called after each successful commit (an error there is logged and never
fails the write), and a `queryRoutes` table composed like `spaceRoutes`.
Site hostnames also now answer `/.blobs/<cid>` with that blob from the repo,
immutable and edge-cacheable, sandboxed by CSP, media mimes only. A
client-rendered site can query its data live and show repo media without a
manifest entry per file.
- e628859: Static sites served from the repo, in a new `@pdsjs/sites` package.
A site's files are ordinary blobs and a site is one `dev.pdsjs.site.deploy`
record holding the path→blob manifest, so a deploy is a stock atproto write:
it rides the firehose, survives migration, and lands in backups with
everything else. `pdsjs-site deploy ./dist --site home` uploads only the files
whose CID changed and writes the record.
Serving is by hostname. The record key is a DNS label, so `blog` serves at
`blog.<site domain>` and the site named by `PDS_EXPERIMENTAL_SITE_APEX_NAME` (default
`home`) serves at the apex. Responses carry an ETag derived from the file's
CID, so conditional requests answer 304, and a missing path falls back to
`index.html` for single-page apps.
Caching is per file: `pdsjs-site deploy --cache-control "[glob:]value"` sets
the Cache-Control each matched path serves with, and content addressing makes
`immutable` safe for fingerprinted assets. On Cloudflare, site responses are
also held in the edge cache for their `max-age`, so repeat requests are
answered at the visitor's edge location instead of crossing to the Durable
Object's region. The PDS's own hostname never enters that cache.
The feature is off until a site domain is configured: `PDS_EXPERIMENTAL_SITE_DOMAIN` on the
Worker, `experimental: { sites: { domain } }` on the Node and Deno `createServer`. Without it no
hostname is inspected and dispatch is untouched. `@pdsjs/core` gains two
optional ports, `SiteHandlerPort` and `SiteBrowserPort`, and never imports the
sites package itself; a platform package builds both and passes them in. On
Node and Deno `@pdsjs/sites` is an optional peer dependency, so a deployment
that does not want sites does not install it.
Site content is only ever served on the site domain, never on the PDS's own
hostname. That keeps repo-controlled HTML on a separate origin from the
account session cookie.
Every servable site hostname also answers `/.blobs/<cid>` with that blob from
the repo, immutable and sandboxed, so a client-rendered site can show repo
media without a manifest entry per file. `www` with no site named `www`
deployed redirects to the apex.
The account interface grows a Sites page listing what is deployed, with a
delete that unlinks the record's blobs and reaps the orphans. It appears only
when the server composes the feature in, and it warns when the PDS's own
hostname shadows the apex site.
- Updated dependencies [261d4f4]
- Updated dependencies [dfce920]
- Updated dependencies [dfcf1cc]
- Updated dependencies [99c414f]
- Updated dependencies [261d4f4]
- Updated dependencies [218f25c]
- Updated dependencies [1b8cd1e]
- Updated dependencies [f2df586]
- Updated dependencies [e761cdb]
- Updated dependencies [d679bf1]
- Updated dependencies [fd33b13]
- Updated dependencies [d88b21d]
- Updated dependencies [8ce9621]
- Updated dependencies [faceaf7]
- Updated dependencies [bc5314a]
- Updated dependencies [f800d5a]
- Updated dependencies [eeb7976]
- Updated dependencies [b368c19]
- Updated dependencies [44bd2b5]
- Updated dependencies [6e47bc6]
- Updated dependencies [5a39d42]
- Updated dependencies [72965f8]
- Updated dependencies [09e110d]
- Updated dependencies [098af68]
- Updated dependencies [7898894]
- Updated dependencies [378e2bb]
- Updated dependencies [4363389]
- Updated dependencies [011e28d]
- Updated dependencies [4169189]
- Updated dependencies [ee386d7]
- Updated dependencies [8cbae75]
- Updated dependencies [4363389]
- Updated dependencies [4a9943d]
- Updated dependencies [9abf6d6]
- Updated dependencies [9524139]
- Updated dependencies [62dc25a]
- Updated dependencies [8d62485]
- Updated dependencies [f1c6639]
- Updated dependencies [224cb48]
- Updated dependencies [5a39d42]
- Updated dependencies [fd54c7d]
- Updated dependencies [67387fe]
- Updated dependencies [1852faf]
- Updated dependencies [9ceb6ad]
- Updated dependencies [e628859]
- @pdsjs/core@2.2.0