You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: rescope @webjs → @webjskit (org name 'webjs' unavailable on npm)
The @webjs organization is not available on npm (likely reserved because
the unscoped `webjs` package is held by an unrelated project). Switching
to the @webjskit scope, which we own.
No behaviour changes — just a scope rename across:
* Package names: @webjs/core, @webjs/server, @webjs/cli, @webjs/docs,
@webjs/website, @webjs-examples/blog → @webjskit/* / @webjskit-examples/*
* All import specifiers ('@webjs/core' → '@webjskit/core', etc.)
* Import map, BUILTIN set, core resolver in dev server
* Test symlinks (node_modules/@webjs/core → node_modules/@webjskit/core)
* Scaffolded template deps
* Docs, READMEs, AGENTS.md
* Lockfile regenerated
All 571 unit tests still pass.
|`richFetch<T>(url, init?)`| Client-side fetch that adds `Accept: application/vnd.webjs+json`, encodes plain-object bodies via superjson, and decodes responses with rich types. |
321
321
322
-
### Directives — `import { … } from '@webjs/core/directives'`
322
+
### Directives — `import { … } from '@webjskit/core/directives'`
323
323
324
324
webjs follows a **"less is more"** philosophy: only directives that solve
325
325
problems with NO native alternative are included. AI agents don't need
@@ -349,7 +349,7 @@ syntax sugar — they write code that works, not code that looks pretty.
349
349
| Async data in page |`async` page function (just `await`) |
350
350
| Lists without reorder |`${items.map(item => html\`…\`)}` |
351
351
352
-
### Context Protocol — `import { … } from '@webjs/core/context'`
352
+
### Context Protocol — `import { … } from '@webjskit/core/context'`
353
353
354
354
Share data across deeply nested components without prop drilling.
355
355
@@ -362,7 +362,7 @@ Share data across deeply nested components without prop drilling.
362
362
363
363
**When to use Context (AI hint):** Use when data (theme, auth state, locale, config) must reach components many levels deep without threading it through every intermediate component's attributes. Do NOT use for data that changes on every render (use state for that) or for data that only one component needs (use a server action or prop).
- On the server these modules are imported normally; you can freely use Prisma, `fs`, environment variables, etc.
862
862
- **Expose as REST**: wrap any action with `expose('METHOD /path', fn)` to ALSO make it reachable at a stable REST URL. The same function body powers both callers:
When called over HTTP, the adapter merges `{ ...query, ...urlParams, ...jsonBody }` into a single object argument. This is the recommended way to surface a server action to external consumers — no `route.js` wrapper needed.
@@ -988,7 +988,7 @@ no client-side runtime, no diff from writing the classes by hand.
// Now rate limiter and sessions share state across instances
1465
1465
```
@@ -1474,7 +1474,7 @@ and what stays in-memory.
1474
1474
### Streaming SSR / Suspense
1475
1475
1476
1476
```js
1477
-
import { html, Suspense } from'@webjs/core';
1477
+
import { html, Suspense } from'@webjskit/core';
1478
1478
1479
1479
exportdefaultfunctionPage() {
1480
1480
returnhtml`
@@ -1548,15 +1548,15 @@ Fixed-window limiter shaped as middleware. Place it in `middleware.ts` at whatev
1548
1548
1549
1549
```js
1550
1550
// app/api/auth/middleware.ts — protect login/signup from brute force
1551
-
import { rateLimit } from'@webjs/server';
1551
+
import { rateLimit } from'@webjskit/server';
1552
1552
exportdefaultrateLimit({ window:'10s', max:5 });
1553
1553
1554
1554
// app/api/middleware.ts — general API rate limit
1555
-
import { rateLimit } from'@webjs/server';
1555
+
import { rateLimit } from'@webjskit/server';
1556
1556
exportdefaultrateLimit({ window:'1m', max:60 });
1557
1557
1558
1558
// Custom key: rate limit per authenticated user instead of IP
1559
-
import { rateLimit } from'@webjs/server';
1559
+
import { rateLimit } from'@webjskit/server';
1560
1560
exportdefaultrateLimit({
1561
1561
window:'1m', max:30,
1562
1562
key:async (req) => {
@@ -1580,7 +1580,7 @@ then segment-scoped files.
1580
1580
1581
1581
### Client router — Turbo Drive-style navigation
1582
1582
1583
-
`import'@webjs/core/client-router'` enables SPA-style navigation without full page reloads. Intercepts same-origin `<a>` clicks (including inside shadow DOM via `composedPath()`), fetches the target HTML, and swaps DOM content.
1583
+
`import'@webjskit/core/client-router'` enables SPA-style navigation without full page reloads. Intercepts same-origin `<a>` clicks (including inside shadow DOM via `composedPath()`), fetches the target HTML, and swaps DOM content.
Copy file name to clipboardExpand all lines: docs/app/docs/ai-first/page.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
import{html}from'@webjs/core';
1
+
import{html}from'@webjskit/core';
2
2
3
3
exportconstmetadata={title: 'AI-First Development — webjs'};
4
4
@@ -24,7 +24,7 @@ export default function AIFirst() {
24
24
<p>Every webjs app has an <code>AGENTS.md</code> at the root. This is a structured document that AI agents read before touching any code. It contains:</p>
25
25
<ul>
26
26
<li><strong>File conventions table</strong> — which filename means what (page.ts, route.ts, middleware.ts, .server.ts, etc.).</li>
27
-
<li><strong>Public API surface</strong> — every exported function from <code>webjs</code> and <code>@webjs/server</code> with a one-line description.</li>
27
+
<li><strong>Public API surface</strong> — every exported function from <code>webjs</code> and <code>@webjskit/server</code> with a one-line description.</li>
28
28
<li><strong>Invariants</strong> — rules that must never be broken ("never import @prisma/client from a component", "event holes must be unquoted").</li>
29
29
<li><strong>Recipes</strong> — step-by-step instructions for "add a page", "add a server action", "add a component", "add a DB model".</li>
30
30
<li><strong>What's deliberately deferred</strong> — so agents don't try to implement features that aren't supported yet.</li>
0 commit comments