redweb 0.16.1 → 0.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.2
4
+
5
+ - Make `redweb init` generate a neutral, runnable TypeScript/TSX foundation by default so tutorials and original applications share one low-boilerplate starting structure.
6
+ - Add composable `--with auth,multiplayer` dependency profiles without copying dashboard, chat, counter, or game-domain source. Keep named templates as explicit finished examples.
7
+ - Add `--bare` as the same application foundation without its test directory, test scripts, or test-only coverage dependency. Report the selected foundation, capabilities, and test inclusion in machine-readable and human CLI output.
8
+ - Cover the generated default with unit tests and actual CLI, TypeScript, HTTP, CSS, rerun, and lifecycle integration checks; no mocks or fixed-duration soak tests.
9
+
3
10
  ## 0.16.1
4
11
 
5
12
  - Refresh API and guide examples around concise `defineApp`, plain decorated pages, reusable TSX components, CSS, and connected clients. Keep lower-level HTTP, socket, template, and protocol APIs explicitly documented as alternatives.
package/README.md CHANGED
@@ -8,21 +8,23 @@ Redweb 0.14.0 adds [`defineApp({ pages, sockets, services, port })`](docs/APPLIC
8
8
 
9
9
  ## Install
10
10
 
11
- Start with a complete, tested counter application:
11
+ Start with a neutral, tested application foundation:
12
12
 
13
13
  <!-- redweb:setup:start -->
14
- > Documentation for Redweb 0.16.1. Install that exact version when following these examples.
14
+ > Documentation for Redweb 0.16.2. Install that exact version when following these examples.
15
15
 
16
16
  ```sh
17
- npx --yes redweb@0.16.1 init my-realtime --template realtime
18
- cd my-realtime
19
- npm install --save-exact redweb@0.16.1
17
+ npx --yes redweb@0.16.2 init my-app
18
+ cd my-app
19
+ npm install --save-exact redweb@0.16.2
20
20
  npm test
21
21
  npm run dev
22
22
  ```
23
23
  <!-- redweb:setup:end -->
24
24
 
25
- Open two tabs at `http://localhost:8181`. Clicking either button changes the counter on the server and updates both tabs.
25
+ Append `--with auth,multiplayer` when you need those dependency sets without copying example-domain code. Use `--bare` only to omit generated tests. The application, CSS, TypeScript configuration, build scripts, and development watcher remain.
26
+
27
+ The optional realtime example below is available with `redweb init my-realtime --template realtime`. Open two tabs at `http://localhost:8181`; clicking either button changes the counter on the server and updates both tabs.
26
28
 
27
29
  This is the starter's exact `src/app.tsx`. The initializer also supplies its stylesheet, compiler configuration, and real-network tests; startup and shutdown belong to Redweb itself. The file is not a standalone copy-and-run program.
28
30
 
@@ -58,7 +60,7 @@ if (require.main === module) void app.run().catch(error => { console.error(error
58
60
 
59
61
  ## Choose what to build
60
62
 
61
- The links below describe each starter and its boundaries. Reuse the version-correct setup above, changing both the directory name and `--template realtime` to your chosen template. Every initialized project includes all application files and real tests; complete generated recipe pages and file contents are also available in the [documentation catalogue](docs/generated.json).
63
+ The links below describe each optional example and its boundaries. Reuse the version-correct counter setup above, changing both the directory name and `--template realtime` to your chosen template. Every non-bare initialized project includes all application files and real tests; complete generated recipe pages and file contents are also available in the [documentation catalogue](docs/generated.json).
62
64
 
63
65
  | Build | Starter | Recipe notes |
64
66
  | --- | --- | --- |
package/docs/CLI.md CHANGED
@@ -4,7 +4,7 @@ Use the version installed in your project (`npx --no-install redweb`) when troub
4
4
 
5
5
  ## Add pages, components, and socket routes
6
6
 
7
- These commands are available in `redweb@0.16.1`.
7
+ These commands are available in `redweb@0.16.2`.
8
8
 
9
9
  ```sh
10
10
  npx --no-install redweb add page dashboard
@@ -35,7 +35,13 @@ Follow a [complete recipe's version-specific setup](GETTING_STARTED.md#start-wit
35
35
 
36
36
  The initializer creates missing files only. It does not install dependencies, run package scripts, or validate existing source code. A message saying initialization completed means the file operation completed, not that a preserved existing project is valid.
37
37
 
38
- `--template realtime|chat|site|socket|dashboard|http-ws` selects a complete runnable recipe. The default is `realtime`, a shared server-owned counter. `chat` includes the canonical reusable chat component, validated actions and its stylesheet; `site` has two non-live pages with a shared layout; `socket` exposes `/match` with separate `join`, `move`, and `resume` handlers, a shared Zod contract, and bounded in-memory sessions. The [dashboard](../recipes/dashboard/README.md) combines private live cards, SQLite persistence, explicit account provisioning, expiring sessions and account-wide sign-out. It requires Node 22.13+. The [http-ws starter](../recipes/http-ws/README.md) combines an HTTP health endpoint and a raw socket route on one explicitly owned listener. Each starter includes network tests, build/production instructions, and a development watcher. `--existing` and `--template` cannot be combined. The chat, socket and dashboard starters add Zod; Redweb itself does not require Zod or SQLite at runtime.
38
+ Without a template, `redweb init my-app` creates a neutral, runnable TypeScript/TSX foundation. It contains one placeholder page, CSS, build/development scripts, and real HTTP/lifecycle tests, but no counter, chatroom, dashboard, or game-domain code. This is the common starting point for tutorials and new applications.
39
+
40
+ `--with auth,multiplayer` composes optional dependency sets into that same foundation without generating another example. `auth` adds Express, Zod, their TypeScript declarations, and the Node 22.13+ requirement used by Redweb's native-SQLite authentication path. `multiplayer` adds Redweb Client and Zod. Either capability can be selected alone, the comma-separated list must not contain duplicates, and capabilities may also supplement an explicit example template.
41
+
42
+ `--template realtime|chat|site|socket|dashboard|http-ws` explicitly selects a complete runnable example. `realtime` is a shared server-owned counter. `chat` includes the canonical reusable chat component, validated actions and its stylesheet; `site` has two non-live pages with a shared layout; `socket` exposes `/match` with separate `join`, `move`, and `resume` handlers, a shared Zod contract, and bounded in-memory sessions. The [dashboard](../recipes/dashboard/README.md) combines private live cards, SQLite persistence, explicit account provisioning, expiring sessions and account-wide sign-out. It requires Node 22.13+. The [http-ws starter](../recipes/http-ws/README.md) combines an HTTP health endpoint and a raw socket route on one explicitly owned listener. Templates are learning/reference applications, not prerequisites for starting a project.
43
+
44
+ Every non-bare initialization includes network tests and a development watcher. `--bare` retains the same runnable source, CSS, manifest, compiler configuration, build scripts, and watcher, but omits the `test/` directory, test scripts, and the test-only coverage dependency. `--existing` cannot be combined with `--template`, `--with`, or `--bare`. The optional capability and template dependencies remain application-local; Redweb itself does not require Zod or SQLite at runtime.
39
45
 
40
46
  Doctor also checks the application's declared `engines.node` minimum (for example `>=22.13.0`). An incompatible runtime produces `PROJECT_NODE_UNSUPPORTED`. More complex ranges produce `PROJECT_NODE_UNCHECKED`, not a guessed success; npm remains responsible for its full engine-range interpretation. CI runs the dashboard acceptance tests on Node 22; older core compatibility jobs explicitly skip that recipe's runtime execution.
41
47
 
@@ -53,7 +59,7 @@ npx --no-install redweb doctor --json
53
59
 
54
60
  `--existing` creates only a missing `tsconfig.json`; it does not generate a new app, CSS, or package manifest. Adjust the generated source/output directories for your application. An existing `tsconfig.json` is never overwritten, even if it is incompatible.
55
61
 
56
- `--dry-run` does not create files or directories. `--json` reports a versioned result with `operation`, `root`, `created`, `skipped`, and `planned`. The shared file-plan writer preflights all destinations, including planned directory/file conflicts, case aliases and nonportable segments such as Windows device names, alternate streams and trailing dots/spaces. It rejects symbolic links/junctions in the destination's ancestor chain, including above the chosen project root. Exclusive creation prevents overwriting a file created concurrently.
62
+ `--dry-run` does not create files or directories. `--json` reports a versioned result with `operation`, `foundation`, `capabilities`, `tests`, `root`, `created`, `skipped`, and `planned`. The shared file-plan writer preflights all destinations, including planned directory/file conflicts, case aliases and nonportable segments such as Windows device names, alternate streams and trailing dots/spaces. It rejects symbolic links/junctions in the destination's ancestor chain, including above the chosen project root. Exclusive creation prevents overwriting a file created concurrently.
57
63
 
58
64
  This is not a transactional installer or a lock on the filesystem tree. An operating-system error during writing can leave completed files, a partial attempted file, or new directories; the error reports completed writes and the attempted destination. Inspect those paths before retrying. Rerunning preserves existing files rather than repairing their contents. Another process must not rename or replace destination directories while generation runs.
59
65
 
@@ -1,6 +1,6 @@
1
1
  # Development refresh and inspection
2
2
 
3
- This API is available in `redweb@0.16.1`. Use documentation matching the installed package before enabling it.
3
+ This API is available in `redweb@0.16.2`. Use documentation matching the installed package before enabling it.
4
4
 
5
5
  ## Browser refresh
6
6
 
@@ -4,7 +4,27 @@ Redweb renders TypeScript/TSX on Node.js and connects server-owned state and act
4
4
 
5
5
  It is not React, a browser component framework, a database, an identity provider, or a managed multiplayer platform. Do not use React hooks or import `react/jsx-runtime`. An edge-only host without Node listeners cannot run a live Redweb server; exported static pages need no Node runtime.
6
6
 
7
- ## Start with a complete recipe
7
+ ## Start a project
8
+
9
+ Create the same neutral foundation whether you are following a tutorial or starting your own application:
10
+
11
+ ```sh
12
+ npx --yes redweb@0.16.2 init my-app
13
+ cd my-app
14
+ npm install --save-exact redweb@0.16.2
15
+ npm test
16
+ npm run dev
17
+ ```
18
+
19
+ Add capability dependencies without importing example-domain code:
20
+
21
+ ```sh
22
+ npx --yes redweb@0.16.2 init my-game --with auth,multiplayer
23
+ ```
24
+
25
+ The default includes its real tests. `--bare` omits only the test directory, test scripts, and test-only coverage dependency; it retains the runnable application, CSS, compiler configuration, build scripts, and development watcher.
26
+
27
+ ## Explore complete recipes
8
28
 
9
29
  Choose one of these complete applications:
10
30
 
@@ -15,7 +35,7 @@ Choose one of these complete applications:
15
35
  - [HTTP and WebSockets](../recipes/http-ws/README.md): one listener, an HTTP health endpoint and a raw `/chat` route with an explicit cleanup owner.
16
36
  - [Private dashboard](../recipes/dashboard/README.md): persistent SQLite cards, account sessions and private live updates (Node 22.13+).
17
37
 
18
- Each generated recipe page contains its exact files, commands, limitations, and real HTTP/WebSocket acceptance tests. Follow that recipe's version-specific setup instructions rather than mixing an unreleased example with a published npm version.
38
+ Named templates are finished examples rather than the default project structure. Each generated recipe page contains its exact files, commands, limitations, and real HTTP/WebSocket acceptance tests. Follow that recipe's version-specific setup instructions rather than mixing an unreleased example with a published npm version.
19
39
 
20
40
  Requirements: Node.js satisfying the package's `engines` field and npm. Use a supported Node.js release in production. TypeScript and the development watcher are installed by the starter. No React, frontend bundler or broker is required. Only the dashboard starter uses a database; its native SQLite requirement is recipe-local.
21
41
 
@@ -47,7 +67,7 @@ For private raw socket subscriptions, see [room authorization and shared request
47
67
 
48
68
  Build first. Deploy `dist/`, the package manifest, and the lockfile, then install runtime dependencies with `npm ci --omit=dev`. The starters are tested with `src/` unavailable after compilation. Configure HTTPS/WSS and a proxy that supports WebSocket upgrades when using a reverse proxy.
49
69
 
50
- These deployment commands require a verified release pair. `redweb@0.16.1` installs published `redweb-client@0.3.0` automatically through its dependency. Future unreleased Redweb changes require their matching tested tarball until a release containing them is published. The `npm link` workflow is local development only: a clean production install does not preserve that link.
70
+ These deployment commands require a verified release pair. `redweb@0.16.2` installs published `redweb-client@0.3.0` automatically through its dependency. Future unreleased Redweb changes require their matching tested tarball until a release containing them is published. The `npm link` workflow is local development only: a clean production install does not preserve that link.
51
71
 
52
72
  Before public access, add authentication, authorization, trusted-origin policy, input/rate limits, application persistence where needed, and bounded shutdown. Treat reconnect/session tokens as credentials. Do not promise exactly-once delivery or durable sessions from an in-memory starter. See [operations](MULTIPLAYER_OPERATIONS.md) and [guarantees and limits](PRODUCTION_READINESS.md).
53
73
 
package/docs/MIGRATION.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Upgrade an existing Redweb application
2
2
 
3
- Match the installed package to its versioned documentation. Redweb 0.16.1 contains the capabilities described by the 0.16.1 guides; a later development checkout may not match that release. See [release verification](RELEASE_TRUST.md) and the changelog shipped with your selected package. Keep your lockfile and rollback artifact, and run your own real HTTP/WebSocket/browser tests after upgrading.
3
+ Match the installed package to its versioned documentation. Redweb 0.16.2 contains the capabilities described by the 0.16.2 guides; a later development checkout may not match that release. See [release verification](RELEASE_TRUST.md) and the changelog shipped with your selected package. Keep your lockfile and rollback artifact, and run your own real HTTP/WebSocket/browser tests after upgrading.
4
4
 
5
5
  ## 0.8 migration notes
6
6
 
@@ -41,18 +41,18 @@ An ordinary installation without this root policy can still select affected
41
41
  dependencies. No Express 5 migration, bundled fork or published shrinkwrap is
42
42
  introduced. Audit results remain time-sensitive and application-specific.
43
43
 
44
- For a published application, select an exact release, commit its lockfile, and use `npm ci` in CI/deployment. This guide is versioned for 0.16.1. Before registry publication, verify the packed candidate; after publication, repeat these registry checks from a clean application:
44
+ For a published application, select an exact release, commit its lockfile, and use `npm ci` in CI/deployment. This guide is versioned for 0.16.2. Before registry publication, verify the packed candidate; after publication, repeat these registry checks from a clean application:
45
45
 
46
46
  ```sh
47
- npm view redweb@0.16.1 version engines dist.integrity dist.signatures dist.attestations gitHead --json
48
- npm install --save-exact redweb@0.16.1
47
+ npm view redweb@0.16.2 version engines dist.integrity dist.signatures dist.attestations gitHead --json
48
+ npm install --save-exact redweb@0.16.2
49
49
  npm audit signatures
50
50
  npm audit --omit=dev
51
51
  ```
52
52
 
53
53
  The signature command must run in the installed application directory. Keep TLS verification enabled and use a current npm CLI; a certificate/trust-store failure is not a reason to disable verification. A lockfile's integrity value detects changed package bytes; registry signatures authenticate registry metadata; provenance, when present and verified, links an artifact to a build/source identity. Vulnerability audit is a separate check against known advisories, not an application penetration test.
54
54
 
55
- Redweb 0.16.1 contains socket-bound TSX controls and connection-owned page state, unified application startup, server-rendered TSX, reactive state/actions, complete starters, shared socket contracts, authorization, diagnostics, lifecycle work, and bounded heartbeat grace described by these versioned guides. Keep the package and documentation version aligned; do not mix a development guide or a future checkout with 0.16.1 and assume newer APIs exist.
55
+ Redweb 0.16.2 contains neutral composable initialization, socket-bound TSX controls and connection-owned page state, unified application startup, server-rendered TSX, reactive state/actions, complete starters, shared socket contracts, authorization, diagnostics, lifecycle work, and bounded heartbeat grace described by these versioned guides. Keep the package and documentation version aligned; do not mix a development guide or a future checkout with 0.16.2 and assume newer APIs exist.
56
56
 
57
57
  Redweb is pre-1.0. Consult the changelog and versioned guide before upgrading, run your own real HTTP/WebSocket/browser tests, and keep a rollback artifact. Patch/minor numbers and a compatible TypeScript build alone do not prove wire compatibility, preserved sessions, database compatibility or application authorization. HTTP-created live-page sessions are process-owned; a restart or rolling replacement does not migrate them automatically. Raw socket protocol versions are negotiated only when the route opts in, and application payload compatibility remains your contract.
58
58
 
@@ -1,6 +1,6 @@
1
1
  # Understand failures before retrying
2
2
 
3
- Status: included in `redweb@0.16.1`.
3
+ Status: included in `redweb@0.16.2`.
4
4
 
5
5
  Authentication identifies a visitor. Authorization decides what that visitor may do. Validation checks an input's shape. An application failure means server code or a dependency failed; it is not evidence that the visitor supplied bad credentials.
6
6
 
@@ -1,10 +1,10 @@
1
1
  # Shared socket contracts
2
2
 
3
- Status: included in `redweb@0.16.1`.
3
+ Status: included in `redweb@0.16.2`.
4
4
 
5
5
  A contract declares message payloads once. The same schema supplies runtime validation and inferred TypeScript types for senders and handlers. The URL still selects the route (`/match`), and the envelope's `type` selects an individual handler (`join`, `move`, `resume`). No socket decorators or second action dispatcher are required.
6
6
 
7
- Start with `npx --yes redweb@0.16.1 init my-match --template socket`. The complete maintained example lives in [the socket recipe](../recipes/socket/README.md): [contract](../recipes/socket/contract.ts), [handlers](../recipes/socket/handlers.ts), [server](../recipes/socket/app.tsx), and [real-network tests](../recipes/socket/app.test.cjs).
7
+ Start with `npx --yes redweb@0.16.2 init my-match --template socket`. The complete maintained example lives in [the socket recipe](../recipes/socket/README.md): [contract](../recipes/socket/contract.ts), [handlers](../recipes/socket/handlers.ts), [server](../recipes/socket/app.tsx), and [real-network tests](../recipes/socket/app.test.cjs).
8
8
 
9
9
  Session ownership is separate from room fan-out. For authenticated group delivery,
10
10
  see [room authorization](ROOM_AUTHORIZATION.md) and the complete