@webjsdev/cli 0.10.55 → 0.10.56
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/lib/create.js +35 -0
- package/lib/doctor/codes.js +66 -0
- package/lib/doctor/manifest.js +161 -0
- package/lib/doctor/policy.js +124 -0
- package/lib/doctor/probes/elision.js +111 -0
- package/lib/doctor/probes/env.js +53 -0
- package/lib/doctor/probes/framework-resolves.js +84 -0
- package/lib/doctor/probes/git-hook.js +58 -0
- package/lib/doctor/probes/importmap-coherence.js +158 -0
- package/lib/doctor/probes/node.js +37 -0
- package/lib/doctor/probes/static-asset-freshness.js +58 -0
- package/lib/doctor/probes/tsconfig.js +55 -0
- package/lib/doctor/probes/unmarked-asset-links.js +199 -0
- package/lib/doctor/probes/vendor-gitignore.js +84 -0
- package/lib/doctor/probes/vendor-pin.js +77 -0
- package/lib/doctor/probes/webjs-versions.js +85 -0
- package/lib/doctor/route-modules.js +100 -0
- package/lib/doctor/runner.js +71 -0
- package/lib/doctor/util.js +160 -0
- package/lib/doctor.js +5 -1634
- package/package.json +1 -1
- package/templates/.agents/skills/webjs/SKILL.md +41 -2
- package/templates/.agents/skills/webjs/references/client-router-and-streaming.md +20 -2
- package/templates/.agents/skills/webjs/references/components.md +41 -1
- package/templates/.agents/skills/webjs/references/module-structure.md +229 -0
- package/templates/.agents/skills/webjs/references/muscle-memory-gotchas.md +1 -1
- package/templates/.agents/skills/webjs/references/routing-and-pages.md +36 -2
- package/templates/.agents/skills/webjs/references/runtime.md +5 -0
- package/templates/gallery/app/features/boundaries/page.ts +11 -0
- package/templates/gallery/app/features/client-router/page.ts +8 -1
- package/templates/gallery/modules/client-router/components/router-controls.ts +16 -2
- package/templates/gallery/modules/gallery/nav.ts +35 -26
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* left sidebar (so they can never drift). A browser-safe data module (no server
|
|
4
4
|
* imports, no client globals): the home flattens the groups into its card grid,
|
|
5
5
|
* and <gallery-nav> renders them grouped. gallery:clear removes this module.
|
|
6
|
+
*
|
|
7
|
+
* Blurbs are INTENT-shaped, not noun-shaped: each one opens on the job you would
|
|
8
|
+
* be doing when you want this demo, because the index is the first thing an
|
|
9
|
+
* agent reads and a card that only names the feature cannot be found by someone
|
|
10
|
+
* who does not know the feature exists. The skill's cheat sheet
|
|
11
|
+
* (.agents/skills/webjs/SKILL.md, "Reach For The Right Primitive") carries the
|
|
12
|
+
* same set keyed the same way, and the repo's
|
|
13
|
+
* test/repo-health/skill-gallery-intent-parity.test.mjs fails if the two fall
|
|
14
|
+
* out of step.
|
|
6
15
|
*/
|
|
7
16
|
export interface NavItem { href: string; title: string; blurb: string; }
|
|
8
17
|
export interface NavGroup { label: string; items: NavItem[]; }
|
|
@@ -11,68 +20,68 @@ export const FEATURE_GROUPS: NavGroup[] = [
|
|
|
11
20
|
{
|
|
12
21
|
label: 'Routing',
|
|
13
22
|
items: [
|
|
14
|
-
{ href: '/features/routing', title: 'Routing', blurb: '
|
|
15
|
-
{ href: '/features/boundaries', title: 'Boundaries', blurb: '
|
|
16
|
-
{ href: '/features/metadata', title: 'Metadata', blurb: '
|
|
23
|
+
{ href: '/features/routing', title: 'Routing', blurb: 'Add a URL to the app, static or with a dynamic [id] segment. The file is the route, so there is no table to register it in.' },
|
|
24
|
+
{ href: '/features/boundaries', title: 'Boundaries', blurb: 'Abandon a render because something is missing or not allowed. Throw notFound / forbidden / unauthorized and the nearest boundary file catches it.' },
|
|
25
|
+
{ href: '/features/metadata', title: 'Metadata', blurb: 'Give a page its own title, description, and social preview without writing head markup yourself.' },
|
|
17
26
|
],
|
|
18
27
|
},
|
|
19
28
|
{
|
|
20
29
|
label: 'Components',
|
|
21
30
|
items: [
|
|
22
|
-
{ href: '/features/components', title: 'Components', blurb: '
|
|
23
|
-
{ href: '/features/directives', title: 'Directives', blurb: '
|
|
24
|
-
{ href: '/features/async-render', title: 'Async render', blurb: '
|
|
31
|
+
{ href: '/features/components', title: 'Components', blurb: 'Make one part of the page respond to a click or hold state. A page never hydrates, so interactivity lives in a component.' },
|
|
32
|
+
{ href: '/features/directives', title: 'Directives', blurb: 'Render a keyed list, or swap a single node when state changes, without re-rendering the component around it.' },
|
|
33
|
+
{ href: '/features/async-render', title: 'Async render', blurb: 'Get server data into the first paint. Await it in async render() rather than fetching after mount, which SSR never runs.' },
|
|
25
34
|
],
|
|
26
35
|
},
|
|
27
36
|
{
|
|
28
37
|
label: 'Data & actions',
|
|
29
38
|
items: [
|
|
30
|
-
{ href: '/features/server-actions', title: 'Server actions', blurb: '
|
|
31
|
-
{ href: '/features/route-handler', title: 'Route handlers', blurb: 'A server-only route.ts
|
|
32
|
-
{ href: '/features/forms', title: 'Forms', blurb: '
|
|
33
|
-
{ href: '/features/optimistic-ui', title: 'Optimistic UI', blurb: '
|
|
39
|
+
{ href: '/features/server-actions', title: 'Server actions', blurb: 'Call server code from the browser by importing the function. No fetch, no endpoint to name, and the types survive the trip.' },
|
|
40
|
+
{ href: '/features/route-handler', title: 'Route handlers', blurb: 'Expose JSON to a caller outside the app. A server-only route.ts, the WebJs equivalent of a Next route handler.' },
|
|
41
|
+
{ href: '/features/forms', title: 'Forms', blurb: 'Write data from a form that still works with JS off. Binding the action to the form is the whole wiring.' },
|
|
42
|
+
{ href: '/features/optimistic-ui', title: 'Optimistic UI', blurb: 'Make a mutation feel instant. optimistic() applies the change immediately and rolls it back if the server refuses.' },
|
|
34
43
|
],
|
|
35
44
|
},
|
|
36
45
|
{
|
|
37
46
|
label: 'Client & streaming',
|
|
38
47
|
items: [
|
|
39
|
-
{ href: '/features/client-router', title: 'Client router', blurb: 'Automatic
|
|
40
|
-
{ href: '/features/view-transitions', title: 'View transitions', blurb: '
|
|
41
|
-
{ href: '/features/streaming', title: 'Streaming actions', blurb: '
|
|
42
|
-
{ href: '/features/stream', title: 'Stream updates', blurb: '
|
|
43
|
-
{ href: '/features/suspense', title: 'Suspense boundary', blurb: '
|
|
44
|
-
{ href: '/features/frames', title: 'Frames', blurb: '
|
|
48
|
+
{ href: '/features/client-router', title: 'Client router', blurb: 'Navigate without a full page reload. Automatic the moment a page ships a component, with nothing to import or configure.' },
|
|
49
|
+
{ href: '/features/view-transitions', title: 'View transitions', blurb: 'Cross-fade a navigation instead of snapping. One opt-in meta, plus a marker for elements that must survive the swap.' },
|
|
50
|
+
{ href: '/features/streaming', title: 'Streaming actions', blurb: 'Show tokens or progress as the server produces them. An action returning an async generator, consumed with for await.' },
|
|
51
|
+
{ href: '/features/stream', title: 'Stream updates', blurb: 'Change one element after a write, like appending a row or bumping a count, without redrawing the region around it.' },
|
|
52
|
+
{ href: '/features/suspense', title: 'Suspense boundary', blurb: 'Paint the page before a slow region is ready. The fallback flushes on the first byte and the content streams in behind it.' },
|
|
53
|
+
{ href: '/features/frames', title: 'Frames', blurb: 'Refresh one region on its own with no navigation, like a filtered list or a tab panel. Zero component JS, full-nav fallback with JS off.' },
|
|
45
54
|
],
|
|
46
55
|
},
|
|
47
56
|
{
|
|
48
57
|
label: 'Real-time',
|
|
49
58
|
items: [
|
|
50
|
-
{ href: '/features/websockets', title: 'WebSockets', blurb: 'A WS(ws, req) route
|
|
51
|
-
{ href: '/features/broadcast', title: 'Broadcast', blurb: '
|
|
59
|
+
{ href: '/features/websockets', title: 'WebSockets', blurb: 'Hold a live two-way connection instead of polling. A WS(ws, req) route export on the server, connectWS() on the client.' },
|
|
60
|
+
{ href: '/features/broadcast', title: 'Broadcast', blurb: 'Push one update to every client connected on a WebSocket path, so a change made in one of them shows up in the rest. Optionally excluding the sender.' },
|
|
52
61
|
],
|
|
53
62
|
},
|
|
54
63
|
{
|
|
55
64
|
label: 'Auth & sessions',
|
|
56
65
|
items: [
|
|
57
|
-
{ href: '/features/auth', title: 'Auth', blurb: '
|
|
58
|
-
{ href: '/features/sessions', title: 'Sessions', blurb: 'A signed
|
|
66
|
+
{ href: '/features/auth', title: 'Auth', blurb: 'Add login and a route only signed-in visitors can open, without rolling password hashing and session cookies yourself.' },
|
|
67
|
+
{ href: '/features/sessions', title: 'Sessions', blurb: 'Remember something per visitor across requests. A signed cookie applied by middleware, read and written with getSession().' },
|
|
59
68
|
],
|
|
60
69
|
},
|
|
61
70
|
{
|
|
62
71
|
label: 'Built-ins',
|
|
63
72
|
items: [
|
|
64
|
-
{ href: '/features/caching', title: 'Caching', blurb: '
|
|
65
|
-
{ href: '/features/env', title: 'Env vars', blurb: '
|
|
66
|
-
{ href: '/features/rate-limit', title: 'Rate limiting', blurb: 'The rateLimit() middleware
|
|
67
|
-
{ href: '/features/file-storage', title: 'File storage', blurb: '
|
|
68
|
-
{ href: '/features/service-worker', title: 'Service worker', blurb: 'The opt-in
|
|
73
|
+
{ href: '/features/caching', title: 'Caching', blurb: 'Stop re-rendering a page that is identical for every visitor. export const revalidate, with the rule for when that is safe.' },
|
|
74
|
+
{ href: '/features/env', title: 'Env vars', blurb: 'Read config and secrets at runtime while keeping the secrets server-side. WEBJS_PUBLIC_ is the only prefix the browser sees.' },
|
|
75
|
+
{ href: '/features/rate-limit', title: 'Rate limiting', blurb: 'Stop one caller hammering an endpoint. The rateLimit() middleware returns a 429 with Retry-After until the interval resets.' },
|
|
76
|
+
{ href: '/features/file-storage', title: 'File storage', blurb: 'Accept an upload and serve it back, streamed both ways, with nothing buffered in memory and nothing written into public/.' },
|
|
77
|
+
{ href: '/features/service-worker', title: 'Service worker', blurb: 'Keep the app usable offline. The opt-in service worker, registered from a browser-only lifecycle hook (never a page or layout).' },
|
|
69
78
|
],
|
|
70
79
|
},
|
|
71
80
|
];
|
|
72
81
|
|
|
73
82
|
/** The whole example apps (composed features), shown after the single-feature demos. */
|
|
74
83
|
export const EXAMPLES: NavItem[] = [
|
|
75
|
-
{ href: '/examples/todo', title: 'Optimistic todo', blurb: '
|
|
84
|
+
{ href: '/examples/todo', title: 'Optimistic todo', blurb: 'See the pieces composed in one real feature: the declarative optimistic() list API, progressive-enhancement forms, accessible labels, the modules split, and SQLite.' },
|
|
76
85
|
];
|
|
77
86
|
|
|
78
87
|
/**
|