@pathmx/cloudflare 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,60 +1,58 @@
1
- # @pathmx/cloudflare
1
+ # `@pathmx/cloudflare`
2
2
 
3
- Opt-in publication plugin for deploying PathMX static publications as a
4
- Cloudflare Worker with Static Assets.
3
+ Publish a static PathMX build as a Cloudflare Worker with Static Assets.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ bun run pmx plugins add cloudflare
9
+ ```
10
+
11
+ Configure the publication in a repository Plugin:
5
12
 
6
13
  ```ts
7
14
  // plugins/cloudflare.plugin.ts
8
15
  import { CloudflarePlugin } from "@pathmx/cloudflare"
9
16
 
10
17
  export default CloudflarePlugin({
11
- accountId: "0123456789abcdef0123456789abcdef",
12
18
  worker: "my-pathmx-site",
13
19
  origin: "https://docs.example.com",
14
- basePath: "/course-guide",
20
+ domain: "docs.example.com",
21
+ })
22
+ ```
23
+
24
+ Set `accountId` when local Cloudflare credentials can access more than one
25
+ account. Use `basePath` when PathMX should live below an origin prefix such as
26
+ `/course-guide`.
27
+
28
+ Custom Domains are the default. To attach an exact Worker route in an existing
29
+ zone instead:
30
+
31
+ ```ts
32
+ export default CloudflarePlugin({
33
+ worker: "my-pathmx-site",
34
+ origin: "https://docs.example.com",
15
35
  domain: "docs.example.com",
16
36
  routing: { type: "route", zone: "example.com" },
17
37
  })
18
38
  ```
19
39
 
20
- `basePath` mounts every canonical PathMX route—including exact Markdown,
21
- runtime assets, polling records, and discovery documents—under one prefix. It
22
- is useful when a PathMX publication lives beside another application on the
23
- same origin.
24
-
25
- Set `accountId` when local credentials can access more than one Cloudflare
26
- account. It is written to the generated Wrangler configuration so validation
27
- and deployment select the same account.
28
-
29
- Domains default to Cloudflare Custom Domains. Select zone-route routing when
30
- an existing Worker route must run before the domain; PathMX emits the exact
31
- `docs.example.com/*` route so it outranks broader wildcard routes in that zone.
32
-
33
- For a sibling source checkout, keep both packages local and override peer
34
- resolution until they are published:
35
-
36
- ```json
37
- {
38
- "dependencies": {
39
- "@pathmx/cloudflare": "file:../minipathmx/pathmx/cloudflare",
40
- "pathmx": "file:../minipathmx/pathmx/core"
41
- },
42
- "overrides": {
43
- "pathmx": "file:../minipathmx/pathmx/core"
44
- }
45
- }
40
+ ## Publish
41
+
42
+ Stage and validate without deploying:
43
+
44
+ ```sh
45
+ bun run pmx cloudflare publish
46
46
  ```
47
47
 
48
- Stage locally by default. Validation invokes pinned Wrangler without deploying;
49
- deployment is the only command that mutates Cloudflare state.
48
+ Preview the work without writing the managed stage:
50
49
 
51
50
  ```sh
52
- pmx cloudflare publish
53
- pmx cloudflare publish --dry-run
54
- pmx cloudflare publish --deploy
51
+ bun run pmx cloudflare publish --dry-run
55
52
  ```
56
53
 
57
- The managed stage is written to `.pathmx/publish/cloudflare/`. Its generated
58
- Worker applies the canonical publication route manifest, including Markdown
59
- content negotiation and exact `.md` routes, before fetching immutable bodies
60
- from the Static Assets binding.
54
+ Deploy after validation succeeds:
55
+
56
+ ```sh
57
+ bun run pmx cloudflare publish --deploy
58
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pathmx/cloudflare",
3
3
  "description": "Cloudflare publication support for PathMX.",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
7
7
  "type": "git",