create-pracht 0.6.0 → 0.6.2
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.
- package/package.json +1 -1
- package/skills/add-auth/SKILL.md +63 -143
- package/skills/add-capabilities/SKILL.md +409 -0
- package/skills/add-content/SKILL.md +242 -0
- package/skills/add-db/SKILL.md +93 -202
- package/skills/add-i18n/SKILL.md +178 -217
- package/skills/add-images/SKILL.md +203 -0
- package/skills/add-observability/SKILL.md +118 -15
- package/skills/add-openapi/SKILL.md +209 -0
- package/skills/audit-a11y/SKILL.md +8 -9
- package/skills/audit-agent-surface/SKILL.md +335 -0
- package/skills/audit-auth/SKILL.md +16 -11
- package/skills/audit-bundles/SKILL.md +56 -12
- package/skills/audit-csrf/SKILL.md +9 -10
- package/skills/audit-deps/SKILL.md +8 -8
- package/skills/audit-headers/SKILL.md +9 -10
- package/skills/audit-islands/SKILL.md +9 -10
- package/skills/audit-loaders/SKILL.md +23 -8
- package/skills/audit-redirects/SKILL.md +9 -10
- package/skills/audit-secrets/SKILL.md +6 -6
- package/skills/audit-seo/SKILL.md +8 -8
- package/skills/audit-shells/SKILL.md +8 -9
- package/skills/configure-isg/SKILL.md +9 -10
- package/skills/migrate-nextjs/SKILL.md +200 -415
- package/skills/pracht-debug/SKILL.md +165 -120
- package/skills/pracht-deploy/SKILL.md +248 -329
- package/skills/pracht-scaffold/SKILL.md +123 -146
- package/skills/pracht-test-api/SKILL.md +10 -10
- package/skills/pre-deploy/SKILL.md +166 -195
- package/skills/scaffold-e2e/SKILL.md +11 -12
- package/skills/scaffold-tests/SKILL.md +10 -12
- package/skills/tune-render-mode/SKILL.md +7 -8
- package/skills/typed-routes/SKILL.md +15 -11
- package/skills/upgrade-pracht/SKILL.md +12 -10
- package/src/index.js +43 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: upgrade-pracht
|
|
3
|
-
version: 1.0.
|
|
3
|
+
version: 1.0.2
|
|
4
4
|
description: |
|
|
5
|
-
Upgrade the
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Use
|
|
10
|
-
|
|
11
|
-
upgrade safe".
|
|
5
|
+
Upgrade the `@pracht/*` packages safely: inventory installed versions, read the
|
|
6
|
+
changelogs between installed and target, map breaking changes to real usage,
|
|
7
|
+
apply, then walk the verification ladder (doctor, typegen, verify, build,
|
|
8
|
+
tests).
|
|
9
|
+
Use for "upgrade pracht", "update @pracht packages", "bump the framework", "what
|
|
10
|
+
changed in the new pracht version", "is this upgrade safe".
|
|
12
11
|
allowed-tools:
|
|
13
12
|
- Bash
|
|
14
13
|
- Read
|
|
@@ -33,8 +32,9 @@ pnpm list --depth 1 --json | grep -A2 '@pracht/' # or read package.json + lock
|
|
|
33
32
|
|
|
34
33
|
The family: `@pracht/core`, `@pracht/cli`, `@pracht/vite-plugin`,
|
|
35
34
|
`@pracht/adapter-node`, `@pracht/adapter-cloudflare`, `@pracht/adapter-vercel`,
|
|
36
|
-
`@pracht/preact-ssr-precompile`, `@pracht/
|
|
37
|
-
|
|
35
|
+
`@pracht/preact-ssr-precompile`, `@pracht/content`, `@pracht/markdown`,
|
|
36
|
+
`@pracht/image`. Get the latest published versions with
|
|
37
|
+
`npm view <pkg> version`.
|
|
38
38
|
|
|
39
39
|
## Step 2: Understand the versioning model
|
|
40
40
|
|
|
@@ -75,6 +75,8 @@ https://raw.githubusercontent.com/JoviDeCroock/pracht/main/packages/<dir>/CHANGE
|
|
|
75
75
|
| `@pracht/vite-plugin` | `packages/vite-plugin` |
|
|
76
76
|
| `@pracht/adapter-node` / `-cloudflare` / `-vercel` | `packages/adapter-*` |
|
|
77
77
|
| `@pracht/preact-ssr-precompile` | `packages/preact-ssr-precompile` |
|
|
78
|
+
| `@pracht/content` | `packages/content` |
|
|
79
|
+
| `@pracht/markdown` | `packages/markdown` |
|
|
78
80
|
| `@pracht/image` | `packages/image` |
|
|
79
81
|
|
|
80
82
|
Changelogs are changesets-generated: `## X.Y.Z` sections containing
|
package/src/index.js
CHANGED
|
@@ -1298,6 +1298,11 @@ function createWranglerConfig(projectName) {
|
|
|
1298
1298
|
// validates every named export of the deployed entry module and rejects the
|
|
1299
1299
|
// build metadata (buildTarget, manifests, ...) server.js also exports.
|
|
1300
1300
|
' "main": "dist/server/worker.js",',
|
|
1301
|
+
// Pracht's Vite build is the authoritative bundle and may contain lazy
|
|
1302
|
+
// server chunks. A second Wrangler bundle would inline them again; the
|
|
1303
|
+
// module rule makes Wrangler upload those chunks next to the entry.
|
|
1304
|
+
' "no_bundle": true,',
|
|
1305
|
+
' "rules": [{ "type": "ESModule", "globs": ["**/*.js", "**/*.mjs"] }],',
|
|
1301
1306
|
` "compatibility_date": ${JSON.stringify(compatibilityDate)},`,
|
|
1302
1307
|
' "assets": {',
|
|
1303
1308
|
' "binding": "ASSETS",',
|
|
@@ -1431,6 +1436,12 @@ function createAgentInstructions({ adapter, agentTools, packageManager, router,
|
|
|
1431
1436
|
// needs the explicit `run` form the same way npm does.
|
|
1432
1437
|
const runCmd =
|
|
1433
1438
|
packageManager === "npm" || packageManager === "bun" ? `${packageManager} run` : packageManager;
|
|
1439
|
+
// The pages router derives route ids from filenames, so the home page of a
|
|
1440
|
+
// pages app is `index` (`src/pages/index.tsx`); the manifest scaffold names
|
|
1441
|
+
// it `home` explicitly. Every id in the instructions below has to be one the
|
|
1442
|
+
// scaffold actually generated, or the first link an agent writes is the very
|
|
1443
|
+
// compile error these conventions exist to prevent.
|
|
1444
|
+
const homeRouteId = router === "pages" ? "index" : "home";
|
|
1434
1445
|
|
|
1435
1446
|
const lines = [
|
|
1436
1447
|
"# Pracht App",
|
|
@@ -1535,6 +1546,21 @@ function createAgentInstructions({ adapter, agentTools, packageManager, router,
|
|
|
1535
1546
|
lines.push("- `netlify.toml` — Netlify build, publish, and functions configuration");
|
|
1536
1547
|
}
|
|
1537
1548
|
|
|
1549
|
+
lines.push("");
|
|
1550
|
+
lines.push("## Conventions");
|
|
1551
|
+
lines.push("");
|
|
1552
|
+
lines.push(
|
|
1553
|
+
`- Navigate by route id, not by path: \`<Link route="${homeRouteId}">\`, ` +
|
|
1554
|
+
`\`href("${homeRouteId}")\`, \`navigate({ route: "${homeRouteId}" })\`. Dynamic routes take ` +
|
|
1555
|
+
"their segments through `params`. `<Link href>` is a type error — the id survives a path " +
|
|
1556
|
+
"change and `pracht typegen` types both the id and its params. Use a plain `<a href>` for " +
|
|
1557
|
+
"external and user-provided URLs.",
|
|
1558
|
+
);
|
|
1559
|
+
lines.push(
|
|
1560
|
+
"- Run `pracht typegen` once to type route ids, params, and `apiFetch()`; `pracht dev` keeps " +
|
|
1561
|
+
"them in sync.",
|
|
1562
|
+
);
|
|
1563
|
+
|
|
1538
1564
|
if (agentTools) {
|
|
1539
1565
|
lines.push("");
|
|
1540
1566
|
lines.push("## Agent tooling");
|
|
@@ -1575,6 +1601,9 @@ function createReadme({
|
|
|
1575
1601
|
const deployCommand = packageManager === "npm" ? "npm run deploy" : `${packageManager} deploy`;
|
|
1576
1602
|
const typecheckCommand =
|
|
1577
1603
|
packageManager === "npm" ? "npm run typecheck" : `${packageManager} typecheck`;
|
|
1604
|
+
// The pages router derives route ids from filenames, so its home page is
|
|
1605
|
+
// "index" where the manifest starter names it "home".
|
|
1606
|
+
const homeRouteId = router === "pages" ? "index" : "home";
|
|
1578
1607
|
|
|
1579
1608
|
const lines = [
|
|
1580
1609
|
`# ${projectName}`,
|
|
@@ -1658,6 +1687,20 @@ function createReadme({
|
|
|
1658
1687
|
lines.push("- `src/api/health.ts` is a sample API route.");
|
|
1659
1688
|
}
|
|
1660
1689
|
|
|
1690
|
+
// The one convention a new app trips over before it writes anything else,
|
|
1691
|
+
// and AGENTS.md — where the same note lives for coding agents — is only
|
|
1692
|
+
// seeded when agent tooling is enabled.
|
|
1693
|
+
lines.push("");
|
|
1694
|
+
lines.push("## Navigating");
|
|
1695
|
+
lines.push("");
|
|
1696
|
+
lines.push(
|
|
1697
|
+
`Pracht navigates by route id, not by path: \`<Link route="${homeRouteId}">\`, ` +
|
|
1698
|
+
`\`href("${homeRouteId}")\`, \`navigate({ route: "${homeRouteId}" })\`. Dynamic routes ` +
|
|
1699
|
+
"take their segments through `params`. The id survives a path change, and `pracht " +
|
|
1700
|
+
"typegen` types both the id and its params — so `<Link href>` is a compile error. Use a " +
|
|
1701
|
+
"plain `<a href>` for external and user-provided URLs.",
|
|
1702
|
+
);
|
|
1703
|
+
|
|
1661
1704
|
if (packageManager === "pnpm") {
|
|
1662
1705
|
lines.push(
|
|
1663
1706
|
pnpmWorkspaceNotice
|