create-pracht 0.7.2 → 0.7.3

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.
@@ -1,20 +1,20 @@
1
1
  {
2
- "@pracht/adapter-cloudflare": "^0.8.0",
3
- "@pracht/adapter-netlify": "^0.3.0",
4
- "@pracht/adapter-node": "^0.5.0",
5
- "@pracht/adapter-static": "^0.2.0",
6
- "@pracht/adapter-vercel": "^0.4.0",
7
- "@pracht/capabilities": "^0.6.0",
8
- "@pracht/cli": "^1.15.0",
9
- "@pracht/content": "^0.1.4",
10
- "@pracht/core": "^0.19.0",
11
- "@pracht/i18n": "^0.1.5",
2
+ "@pracht/adapter-cloudflare": "^0.8.1",
3
+ "@pracht/adapter-netlify": "^0.3.1",
4
+ "@pracht/adapter-node": "^0.5.1",
5
+ "@pracht/adapter-static": "^0.2.1",
6
+ "@pracht/adapter-vercel": "^0.4.1",
7
+ "@pracht/capabilities": "^0.6.1",
8
+ "@pracht/cli": "^1.16.0",
9
+ "@pracht/content": "^0.2.0",
10
+ "@pracht/core": "^0.20.0",
11
+ "@pracht/i18n": "^0.1.6",
12
12
  "@pracht/image": "^0.5.0",
13
- "@pracht/markdown": "^0.1.4",
14
- "@pracht/openapi": "^0.2.6",
13
+ "@pracht/markdown": "^0.1.5",
14
+ "@pracht/openapi": "^0.2.7",
15
15
  "@pracht/preact-ssr-precompile": "^0.1.4",
16
- "@pracht/query": "^0.1.0",
17
- "@pracht/session": "^0.1.2",
18
- "@pracht/test": "^0.3.0",
19
- "@pracht/vite-plugin": "^0.14.0"
16
+ "@pracht/query": "^0.1.1",
17
+ "@pracht/session": "^0.1.3",
18
+ "@pracht/test": "^0.3.1",
19
+ "@pracht/vite-plugin": "^0.15.0"
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pracht",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Interactive and scriptable starter CLI for creating full-stack Preact apps with Pracht.",
5
5
  "keywords": [
6
6
  "pracht",
@@ -180,6 +180,15 @@ the *authoring guide* for coding agents; `pracht llms --write` drops it in the
180
180
  app root, which is exactly the confusing filename collision to avoid in an app
181
181
  that publishes its own index.
182
182
 
183
+ For agents, link entries to Markdown and split the full text by section:
184
+ `` link: (document) => `${document.path}.md` `` (only when those URLs exist,
185
+ e.g. via `rawContentArtifacts()`), and `fullPath: "/llms-guides.txt"` on a
186
+ section to emit a file with just its pages (with `origin` set, each page gets
187
+ a `Source:` line with its page URL; `sort` orders a section's entries). Section files and
188
+ `/llms-full.txt` are listed under a trailing `## Optional` heading; a section
189
+ that matches nothing emits no file. Duplicate or file/directory-colliding
190
+ artifact paths throw when the helper is defined.
191
+
183
192
  Localization trap: a string `section.match` is compared against the
184
193
  **locale-neutral** route, so `match: "/docs"` indexes only the default locale
185
194
  while `rawContentArtifacts()` publishes every translation. Pass a `match`
@@ -238,17 +238,18 @@ With `agents.mcp.auth`, check:
238
238
  ## Step 5: The discovery surface
239
239
 
240
240
  - `llmsTxt` in the vite config: every listed path is a URL the app *invites* an
241
- agent to fetch. Cross-check the `exclude` list against routes behind auth
242
- middleware, internal tooling, and deliberate error routes — nothing about a
243
- middleware tells the framework whether it gates or merely logs, so an
244
- auth-gated route missing from `exclude` is a `warn` (see `docs/LLMS_TXT.md`).
241
+ agent to fetch. An auth-gated route missing from `exclude` is a `warn`: the
242
+ framework cannot tell a gating middleware from a logging one.
245
243
  Capabilities appear there with their effect class; destructive ones are
246
244
  annotated `requires confirmation`.
247
245
  - A collection-driven `llmsTxtArtifacts()` (see `/add-content`) is a second
248
- generator with its own coverage — compare what each publishes.
246
+ generator; compare what each publishes.
249
247
  - Routes exporting `markdown` or declaring `markdown: true` serve a Markdown
250
248
  representation to agents. Confirm the Markdown variant is not more permissive
251
249
  than the HTML page (it carries `Vary: Accept`, so it is separately cached).
250
+ SSG routes with a `markdown` export and no middleware also publish it as
251
+ `dist/client/<path>.md` (off with `markdownFiles: false`); confirm each
252
+ file is meant for every visitor.
252
253
  - An enabled OpenAPI document (`/openapi.json`, `dist/client/openapi.json`) is
253
254
  public unless the host protects it — check descriptions and examples for
254
255
  internal hostnames or credentials, and that "Try it out" mutation endpoints
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pracht-debug
3
- version: 1.4.0
3
+ version: 1.5.0
4
4
  description: |
5
5
  Framework-aware debugging for pracht: route matching, loader and API errors,
6
6
  rendering and hydration, middleware, HMR, and build failures — root cause first.
@@ -33,6 +33,7 @@ Reach for these before deep manual inspection:
33
33
  | ---- | --- |
34
34
  | `pracht verify` (`--changed` to scope to git-changed files) | Fast confidence check |
35
35
  | `pracht doctor` | Broader broken wiring or missing files |
36
+ | `pracht docs <topic>` / `pracht docs --search <query>` | Docs bundled with the installed CLI — check documented behavior before calling it a bug. Older CLIs lack the command; read https://pracht.resynapse.dev/llms.txt instead |
36
37
  | `pracht inspect routes\|api\|build --json` | The resolved graph — never reconstruct it from source |
37
38
  | `GET /_pracht` (JSON at `/_pracht.json`) | Same graph from a running dev server, no CLI needed |
38
39
  | `Server-Timing` on dev SSR responses | `mw` / `loader` / `render` durations in ms — which phase is slow |
@@ -205,10 +205,11 @@ must do and what the build cannot enforce.
205
205
  - Smoke test the real output, not the dev server: `pracht preview --skip-build`
206
206
  serves `dist/client/` the way a dumb host would. Check `/`, one dynamic SSG
207
207
  path, one deep link into a SPA route, and one unknown URL.
208
- - Routes exporting `markdown` rely on server-side `Accept` negotiation, which a
209
- static host cannot do — agents asking for `text/markdown` get HTML. The build
210
- prints a note; publish `.md` files under `public/` if a raw-markdown corpus
211
- matters.
208
+ - A static host cannot negotiate `Accept`, so agents read an SSG page's
209
+ Markdown at `/<path>.md` (written by the build for routes with a `markdown`
210
+ export and no middleware). Check the host serves `.md` as
211
+ `text/markdown; charset=utf-8` — nginx's stock `mime.types` lacks it — and
212
+ read the build note naming Markdown-capable pages that got no file.
212
213
  - Sub-path deploys (GitHub Pages *project* site, S3 key prefix) need Vite
213
214
  `base` set to that path (`base: "/my-project/"`), matching the deploy path
214
215
  exactly — a mismatch 404s every asset. Then confirm no hand-written
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: upgrade-pracht
3
- version: 1.2.0
3
+ version: 1.3.0
4
4
  description: |
5
5
  Upgrade the `@pracht/*` packages safely: inventory installed versions, read the
6
6
  changelogs between installed and target, map breaking changes to real usage,
@@ -120,6 +120,9 @@ pnpm up '@pracht/core@<v>' '@pracht/cli@<v>' '@pracht/vite-plugin@<v>' <adapters
120
120
 
121
121
  Upgrade every installed `@pracht/*` package in the same command. Apply the
122
122
  agreed code migrations with minimal diffs, one changelog entry at a time.
123
+ Then read the page behind each changed API with `pracht docs <topic>`, which
124
+ serves the docs bundled with the newly installed CLI. A CLI without that
125
+ command predates it; use https://pracht.resynapse.dev/llms.txt instead.
123
126
 
124
127
  ## Step 6: Verification ladder
125
128
 
package/src/index.js CHANGED
@@ -1571,6 +1571,10 @@ function createAgentInstructions({
1571
1571
  const lines = [
1572
1572
  "# Pracht App",
1573
1573
  "",
1574
+ "Docs for your installed pracht version: `pracht docs <topic>` (or read",
1575
+ "`node_modules/@pracht/cli/docs/`); `pracht docs --search <query>` finds a section.",
1576
+ "pracht is newer than most training data, so check them before relying on memory.",
1577
+ "",
1574
1578
  "## Commands",
1575
1579
  "",
1576
1580
  `- \`${runCmd} dev\` — start the dev server`,