Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions changelog/cli/0.12.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
package: "@webjsdev/cli"
version: 0.12.2
date: 2026-11-12T18:56:17.900Z
commit_count: 1
---
## Features

- **`webjs verify`** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* Whether the app works, in one call: `webjs check` and `webjs typecheck` in parallel, then `webjs test`, then the app's `webjs.dev.before` steps and an in-process boot that requests every page and GET route needing no parameter. No dev server to start or stop. A passing step prints one line and a failing one the tail of its output; every step runs even after a failure.
- **A minimal scaffold** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* `webjs create` no longer pre-installs UI kit code (the first `webjs ui add` writes `lib/utils/cn.ts`), ships no theme toggle (dark mode follows the OS) and no `instrumentation.ts`.
* The full-stack app has no example module: `modules/` ships empty, and `AGENTS.md` lays out a module (`actions/`, `queries/`, `components/`, `utils/`, `types.ts`, its tests) and names the `modules`, `testing` and `progressive-enhancement` guides. The api template keeps its users endpoints, named as an example to replace.

## Fixes

- **On Node, `webjs test` gives each test file its own copy of the test database** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* On Node every test file runs in a process of its own, and two writing to one SQLite file at once failed with `database is locked`.
12 changes: 12 additions & 0 deletions changelog/mcp/0.1.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
package: "@webjsdev/mcp"
version: 0.1.21
date: 2026-11-12T18:56:17.800Z
commit_count: 1
---
## Features

- **The brief points at `webjs verify`, and the catalogue answers the lookups agents made** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* The brief tells an agent to verify the app with `npx webjs verify` instead of running `webjs status` after every edit.
* `npx webjs source` with no name now says which database `webjs test` uses, how `webjs db seed` runs the seed file, that a page renders per request unless it exports `revalidate`, and what a `route.ts` handler receives.
* The `modules` guide covers a feature's `utils/` folder and no longer points at an example module.
15 changes: 15 additions & 0 deletions changelog/server/0.10.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
package: "@webjsdev/server"
version: 0.10.2
date: 2026-11-12T18:56:17.700Z
commit_count: 1
---
## Fixes

- **`notFound()`, `forbidden()` and `unauthorized()` in an action called over RPC answer 404, 403 and 401** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* They answered a logged 500 while the no-JS form path rendered the right status. The generated client stub and `invokeActionForTest` now reject with the same sentinel, so `isForbidden(err)` holds in the caller; with `throwOnError: false` the test gets the body instead.
* As on the form path, a throw evicts none of the action's declared `invalidates` tags, so a guard at the top of an action cannot be used to flush caches. A `revalidatePath()` the action called before the throw is still reported to the browser.
- **`submitForm` refuses to post a layout's lone logout form** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* When the only bound form on the page has no fields and the test submits some, the form the test means is not rendered for that request; `submitForm` now says so instead of signing the user out. A form with fields of its own is still posted.
- **In development, a page POST with no `__webjs_action` field answers a 405 that names the field and `submitForm()`** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* Production keeps the bare `Method Not Allowed`.
11 changes: 11 additions & 0 deletions changelog/ui/0.5.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
package: "@webjsdev/ui"
version: 0.5.2
date: 2026-11-12T18:56:17.750Z
commit_count: 1
---
## Features

- **The class helpers with a shadcn name take `className`** ([#1698](https://github.com/webjsdev/webjs/pull/1698)) [`1824e0eaa`](https://github.com/webjsdev/webjs/commit/1824e0eaa)
* `buttonClass({ variant: 'link', className: 'mt-2' })` merges the class through `cn()`, as shadcn's `buttonVariants` does, and so do the 16 other helpers that have a shadcn alias (`badgeClass`, `toggleClass`, `tabsListClass`, `itemClass` and the rest). Without a `className` every helper returns exactly what it did.
* `lib/utils.ts` (copied to an app as `lib/utils/cn.ts`) is about half the size: its commentary on the class merger moved to the package docs, and its code is unchanged.
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
}
},
"dependencies": {
"@webjsdev/cli": "^0.12.1",
"@webjsdev/cli": "^0.12.2",
"@webjsdev/core": "^0.9.1",
"@webjsdev/server": "^0.10.1",
"@webjsdev/server": "^0.10.2",
"dayjs": "^1.11.21",
"drizzle-orm": "1.0.0-rc.5"
},
Expand Down
6 changes: 3 additions & 3 deletions gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
}
},
"dependencies": {
"@webjsdev/cli": "^0.12.1",
"@webjsdev/cli": "^0.12.2",
"@webjsdev/core": "^0.9.1",
"@webjsdev/server": "^0.10.1",
"@webjsdev/ui": "^0.5.1",
"@webjsdev/server": "^0.10.2",
"@webjsdev/ui": "^0.5.2",
"drizzle-orm": "1.0.0-rc.5"
},
"devDependencies": {
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webjsdev/cli",
"version": "0.12.1",
"version": "0.12.2",
"type": "module",
"description": "The CLI for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Runs the dev and production servers, scaffolds apps, validates conventions, and drives the database. Node 24+ or Bun.",
"bin": {
Expand All @@ -13,9 +13,9 @@
"README.md"
],
"dependencies": {
"@webjsdev/mcp": "^0.1.20",
"@webjsdev/server": "^0.10.1",
"@webjsdev/ui": "^0.5.1"
"@webjsdev/mcp": "^0.1.21",
"@webjsdev/server": "^0.10.2",
"@webjsdev/ui": "^0.5.2"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webjsdev/mcp",
"version": "0.1.20",
"version": "0.1.21",
"type": "module",
"description": "The Model Context Protocol server for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Gives AI coding agents the WebJs brief, live app introspection over routes, actions, components, and convention checks, and the framework source.",
"bin": {
Expand All @@ -24,8 +24,8 @@
"README.md"
],
"dependencies": {
"@webjsdev/server": "^0.10.1",
"@webjsdev/ui": "^0.5.1"
"@webjsdev/server": "^0.10.2",
"@webjsdev/ui": "^0.5.2"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webjsdev/server",
"version": "0.10.1",
"version": "0.10.2",
"type": "module",
"description": "The server for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Provides the file-based router, SSR, server actions, route handlers, middleware, and live reload on Node 24+ or Bun.",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webjsdev/ui",
"version": "0.5.1",
"version": "0.5.2",
"type": "module",
"description": "The AI-first component library for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Class-helper functions for visuals, custom elements only where state matters, source-copied into your repo so you own it.",
"bin": {
Expand Down
18 changes: 11 additions & 7 deletions test/cli/test-db.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,17 @@ test('a row round-trips through the app db', async () => {
// A second run starts empty again: the row count assertion would fail on a reused database.
assert.equal(run({}).status, 0, 'each run gets its own database');

// #1697: test files run in parallel processes, and on one shared file they
// hit `database is locked`. Each file gets its own copy, so a second file
// inserting the same unique email still sees exactly one row.
writeFileSync(join(app, 'test', 'users', 'again.test.ts'),
readFileSync(join(app, 'test', 'users', 'users.test.ts'), 'utf8'));
const pair = run({});
assert.equal(pair.status, 0, 'two files writing the same unique row each have their own database\n' + pair.stdout + pair.stderr);
// #1697: on Node, test files run in parallel processes, and on one shared
// file they hit `database is locked`. Each file gets its own copy, so a
// second file inserting the same unique email still sees exactly one row.
// `bun test` runs every file in one process, one after another, so there is
// no lock to hit and the files share the run's database by design.
if (!process.versions.bun) {
writeFileSync(join(app, 'test', 'users', 'again.test.ts'),
readFileSync(join(app, 'test', 'users', 'users.test.ts'), 'utf8'));
const pair = run({});
assert.equal(pair.status, 0, 'two files writing the same unique row each have their own database\n' + pair.stdout + pair.stderr);
}

// Counterfactual: opted out, the test runs against the unmigrated dev database and fails.
assert.notEqual(run({ WEBJS_TEST_DB: '0' }).status, 0, 'without the test database the table does not exist');
Expand Down
2 changes: 1 addition & 1 deletion website/app/(site)/docs/testing/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('listPosts returns an array', async () => {
const posts = await listPosts();
assert.ok(Array.isArray(posts));
});</code-block>
<p><strong>Server tests get their own database.</strong> For a SQLite app, <code>webjs test</code> creates a temporary database, applies the app's migrations to it with <code>webjs db migrate</code> (or, before the first migration exists, pushes the schema with <code>webjs db push</code>, as Rails loads its schema file), and runs the server tests with <code>DATABASE_URL</code> pointing there, the way Rails prepares a test database. So a test can import the app's <code>db</code> and write to it without touching <code>db/dev.db</code>, and every run starts empty (insert what a test needs; the seed file is not applied). On Node each test file runs in a process of its own with its own copy of that database, as Rails gives each parallel worker one, so two files writing at once never see each other's rows or a <code>database is locked</code> error. A <code>DATABASE_URL</code> set in the shell is used as is (CI, or a Postgres test database), and <code>WEBJS_TEST_DB=0</code> turns it off.</p>
<p><strong>Server tests get their own database.</strong> For a SQLite app, <code>webjs test</code> creates a temporary database, applies the app's migrations to it with <code>webjs db migrate</code> (or, before the first migration exists, pushes the schema with <code>webjs db push</code>, as Rails loads its schema file), and runs the server tests with <code>DATABASE_URL</code> pointing there, the way Rails prepares a test database. So a test can import the app's <code>db</code> and write to it without touching <code>db/dev.db</code>, and every run starts empty (insert what a test needs; the seed file is not applied). On Node each test file runs in a process of its own with its own copy of that database, as Rails gives each parallel worker one, so two files writing at once never see each other's rows or a <code>database is locked</code> error. On Bun, <code>bun test</code> runs every file in one process, one after another, so the files share the run's database: a test inserts the rows it needs and does not rely on another file's. A <code>DATABASE_URL</code> set in the shell is used as is (CI, or a Postgres test database), and <code>WEBJS_TEST_DB=0</code> turns it off.</p>

<h2>Renderer Tests</h2>
<p>Test <code>renderToString</code> for SSR output. Import it from <code>@webjsdev/core/server</code>, not the root, so your test stays explicit about which side it runs on:</p>
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
}
},
"dependencies": {
"@webjsdev/cli": "^0.12.1",
"@webjsdev/cli": "^0.12.2",
"@webjsdev/core": "^0.9.1",
"@webjsdev/server": "^0.10.1"
"@webjsdev/server": "^0.10.2"
},
"devDependencies": {
"@types/node": "^24.0.0",
Expand Down
Loading