diff --git a/README.md b/README.md index 40d090e..88f0c36 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ [![TypeScript](https://img.shields.io/badge/TypeScript-7.0-blue?logo=typescript)](https://www.typescriptlang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[**Documentation**](https://btravstack.github.io/entity/) · [**Getting started**](https://btravstack.github.io/entity/tutorial/getting-started) · [**Reference**](https://btravstack.github.io/entity/reference/declaration) · [**Why entity?**](https://btravstack.github.io/entity/explanation/why-entity) +[**Documentation**](https://btravstack.github.io/btravstack/entity/) · [**Getting started**](https://btravstack.github.io/btravstack/entity/tutorial/getting-started) · [**Reference**](https://btravstack.github.io/btravstack/entity/reference/declaration) · [**Why entity?**](https://btravstack.github.io/btravstack/entity/explanation/why-entity) @@ -68,7 +68,7 @@ pnpm add @btravstack/entity zod unthrown @unthrown/standard-schema `zod`, `unthrown` and `@unthrown/standard-schema` are **peer dependencies** — install all four. -([Why](https://btravstack.github.io/entity/explanation/peer-dependencies).) +([Why](https://btravstack.github.io/btravstack/entity/explanation/peer-dependencies).) ## A worked example @@ -182,7 +182,7 @@ only need the shared behaviour". There is no class form. Putting the union at a base-class position is `TS2507` at the declaration, because a class's instance type cannot be a union at all (`TS2509`). -([Why](https://btravstack.github.io/entity/explanation/unions-and-roots).) +([Why](https://btravstack.github.io/btravstack/entity/explanation/unions-and-roots).) ## Aggregates @@ -228,19 +228,19 @@ events that were folded and checked against every invariant. Load with state or as events without touching its declaration. Use `Entity` for everything inside the boundary, and for simple models where a public `update()` costs nothing. See [Model an event-driven -aggregate](https://btravstack.github.io/entity/how-to/model-an-event-driven-aggregate). +aggregate](https://btravstack.github.io/btravstack/entity/how-to/model-an-event-driven-aggregate). ## Documentation -**[btravstack.github.io/entity](https://btravstack.github.io/entity/)** — built +**[btravstack.github.io/entity](https://btravstack.github.io/btravstack/entity/)** — built with VitePress from [`docs/`](./docs), and organised by the four [Diátaxis](https://diataxis.fr/) modes: -- **[Tutorial](https://btravstack.github.io/entity/tutorial/getting-started)** — from nothing to a working entity, one step at a time. -- **How-to guides** — [expose an HTTP contract](https://btravstack.github.io/entity/how-to/http-contract) · [persist and rehydrate](https://btravstack.github.io/entity/how-to/persist-and-rehydrate) · [model an aggregate](https://btravstack.github.io/entity/how-to/model-an-aggregate) · [model an event-driven aggregate](https://btravstack.github.io/entity/how-to/model-an-event-driven-aggregate) · [test domain logic](https://btravstack.github.io/entity/how-to/test-domain-logic) -- **[Reference](https://btravstack.github.io/entity/reference/declaration)** — every member, option and type, with signatures. Plus the [generated API reference](https://btravstack.github.io/entity/api/). -- **[Guarantees and compatibility](https://btravstack.github.io/entity/reference/guarantees)** — before you adopt: what is enforced at compile time and at runtime, what is deliberately left to you, and the supported Node, TypeScript and zod versions. Then the same model [compared with plain zod and Effect `Schema.Class`](https://btravstack.github.io/entity/explanation/compared). -- **[Explanation](https://btravstack.github.io/entity/explanation/why-entity)** — why it is built this way: sealed construction, what immutability covers, no I/O, why an entity is final and a union has no class form. +- **[Tutorial](https://btravstack.github.io/btravstack/entity/tutorial/getting-started)** — from nothing to a working entity, one step at a time. +- **How-to guides** — [expose an HTTP contract](https://btravstack.github.io/btravstack/entity/how-to/http-contract) · [persist and rehydrate](https://btravstack.github.io/btravstack/entity/how-to/persist-and-rehydrate) · [model an aggregate](https://btravstack.github.io/btravstack/entity/how-to/model-an-aggregate) · [model an event-driven aggregate](https://btravstack.github.io/btravstack/entity/how-to/model-an-event-driven-aggregate) · [test domain logic](https://btravstack.github.io/btravstack/entity/how-to/test-domain-logic) +- **[Reference](https://btravstack.github.io/btravstack/entity/reference/declaration)** — every member, option and type, with signatures. Plus the [generated API reference](https://btravstack.github.io/btravstack/api/entity/). +- **[Guarantees and compatibility](https://btravstack.github.io/btravstack/entity/reference/guarantees)** — before you adopt: what is enforced at compile time and at runtime, what is deliberately left to you, and the supported Node, TypeScript and zod versions. Then the same model [compared with plain zod and Effect `Schema.Class`](https://btravstack.github.io/btravstack/entity/explanation/compared). +- **[Explanation](https://btravstack.github.io/btravstack/entity/explanation/why-entity)** — why it is built this way: sealed construction, what immutability covers, no I/O, why an entity is final and a union has no class form. ## Development diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index d0e5de9..a7ad38a 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -109,7 +109,10 @@ export default defineConfig({ const normalizedPath = pageData.relativePath.replace(/^\/+/, ""); // cleanUrls is true, so the public URL has no `.html` extension: strip // `index.md` to the directory and any other `.md` to the bare route. - const canonicalUrl = `${SITE_URL}${normalizedPath}` + const newBase = pageData.relativePath.startsWith("api/") + ? "https://btravstack.github.io/btravstack/" + : "https://btravstack.github.io/btravstack/entity/"; + const canonicalUrl = `${newBase}${normalizedPath}` .replace(/index\.md$/, "") .replace(/\.md$/, ""); @@ -123,6 +126,10 @@ export default defineConfig({ pageData.frontmatter.editLink = false; } + pageData.frontmatter.head.push([ + "meta", + { "http-equiv": "refresh", content: `0;url=${canonicalUrl}` }, + ]); pageData.frontmatter.head.push(["link", { rel: "canonical", href: canonicalUrl }]); const pageTitle = pageData.title || pageData.frontmatter.title || "entity"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 183bdaa..17247ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -272,6 +272,7 @@ catalogs: version: 6.0.3 overrides: + shell-quote@>=1.8.4 <1.11.0: 1.11.0 vite@<6.4.3: 6.4.3 js-yaml@<4.3.2: 4.3.2 nanoid@<3.3.18: 3.3.18 @@ -2234,133 +2235,157 @@ packages: resolution: {integrity: sha512-viote6xAyL5cKLquV2X2wRfopSckH+msDYbaI8Hh8JAaogYs8MJZVRUbSrbsY29TaPrIFZwNRwQ8+YSxs0dkGw==} cpu: [arm64] os: [android] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-arm64@0.9.3': resolution: {integrity: sha512-y2PGOLyxc724EJ+Et/5PxGfutQuV1Z2J9cxHo6W1I5CR3nk0i03J4yPrnw6rNJOfrtlISzcc7q0RrSyfPndpIg==} cpu: [arm64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-x64@0.9.3': resolution: {integrity: sha512-xZ9UpXUOLmsrKVUp7MRXxWU3drNiilRC42OLpjWEhnOehIGVF1bZgzHcqRYJxVyU53RMrkRMsaxplkGd6Qo/ow==} cpu: [x64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-freebsd-x64@0.9.3': resolution: {integrity: sha512-RGCYSZw3VonreVTpur9iOfnbMngR2/f7UOE7gwcDx5WoHjIhtmTK9EIq9qs78ARdMFAPzKp5OzHljl5QMaGJ7g==} cpu: [x64] os: [freebsd] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-gnu@0.9.3': resolution: {integrity: sha512-kjIJIw39GSPTF0hnq+jnM0tR+J5WlariAAWetxMtawNskITDT1ZigaK3YF5hMhDz2mAofaM1t+63qtx+7aXjeg==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-musl@0.9.3': resolution: {integrity: sha512-TVHeVdzaS4ub86URrQufiy4t01ZtdyKDZ5sTPqWFKAUbQJ7rQ0o5vIT+/jCeHQbP+Yf9p5peRdmPbcZewoDNiA==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-gnu@0.9.3': resolution: {integrity: sha512-9aQeeLh1qaCa2GcyzHnwLKGfFrsI+KOyhnh4+fICSq5kyhzCWQfXVCCK4RTEZPLcyuVwfN5Id0JEYavRN4oNTQ==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-musl@0.9.3': resolution: {integrity: sha512-TLXA5Hd1nr8VSP2MtxcFddsBIHj+DPpyG5eberEGMATndgG7STlKQmle51MV0MZ8UgsdYM6CybIVpzlCPQwP9w==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-gnu@0.9.3': resolution: {integrity: sha512-tk0BFbF3Clb9k9biPH3qmr+Qwk24rRM26+HY91hYXmZlzlepZG0scQ6OffZFWtzwKE5JjlZpMdcWj1lTiHbEjA==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-musl@0.9.3': resolution: {integrity: sha512-xo+pXshsCXruEEkDMbwHqkeTyC4XHb6A6oXr6x2YK3jOMcS5kZz0e26BmTCr40J0nY/K3ysmwG9R1xHygtiuwQ==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-arm64@0.9.3': resolution: {integrity: sha512-70gAQo6HZzMgIJTjeMZOEO2XaRj4GcNGP/n81R9tXQv0x8d4ZHnZDv+ygeWfHo+xchAUPwpnrVZA4p6RhJa3GQ==} cpu: [arm64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-x64@0.9.3': resolution: {integrity: sha512-7Hz3NGlq6qBBR8zMEk6GMZivofNjnYZpMXSoUwUgz9Ur2LaivuP23HQh0ern+T6HVkTJEvilw4VJrg1rX1Ugcg==} cpu: [x64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-parser/binding-android-arm64@0.9.3': resolution: {integrity: sha512-z3tDGTaUXD5Q4IuebFOY/QHxhR/SqujMhkMv9C5bh25upyFEXdafp0MsXQIIheWhVZzn5VMOniyxFni/7s9LgQ==} cpu: [arm64] os: [android] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-arm64@0.9.3': resolution: {integrity: sha512-hzKvKSKS7z3ufnu1VkQYEoxmS6A5uNnkwukKnc2atxpWdq648nLVOqut4h1jUXjbM2WcoTfuZLF6AHAGFf8cmg==} cpu: [arm64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-x64@0.9.3': resolution: {integrity: sha512-OM2PiVlPATvzlj/KGHNlu+t8FC3YzM5joVNjhsz/EaigQ8x2UUQ1Q0agQLiv5GZ2L8TSzrLUwBCZ7YOvP8q+tw==} cpu: [x64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-freebsd-x64@0.9.3': resolution: {integrity: sha512-WMn9M4LHNVysGNwsAJ9gpRPqQIW2lcPrDNGcyk0agx3IYqCJq1MQugh6Be8Otc5U08eGdE39o8Kx9YWJmXz7GA==} cpu: [x64] os: [freebsd] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-gnu@0.9.3': resolution: {integrity: sha512-vqKjwiyW1FWvbykYMEQIcAJwA17WxK3rxxqDuyCvQwcNVaLEUxI4BXiUdlF3kHucc7MnoFQhoRPkySgOzlLM+Q==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-musl@0.9.3': resolution: {integrity: sha512-qohilhYOT+zkt2gYzym4F1T6BzRdvPqS9/sFB03pmnVV8LrvjOXVsGwEBAa3CEvzJKhAZjdTmVz7zsVdjyHWLg==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-gnu@0.9.3': resolution: {integrity: sha512-tvTIyUvTGkeee68i4JIo9o27As+Ug6LXOZvElGgFbTs6+KBdb5LGhvugaIQljdfIsm2XnIbOLG6OnQSXHMLB9w==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-musl@0.9.3': resolution: {integrity: sha512-OWZBHW1wuChBpFlrF+On1yiBcFPMRrj2g0VKsM/PCBGffu1OM0ORkS+vLS3Snu6wYwndM5Dd9Ctvux6eUlrQjA==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-gnu@0.9.3': resolution: {integrity: sha512-/tbk1h0dlADOCngbiQO9V3SHwBIJkoGBq8BDEraSw2CC3nGxPEPTCCYUDp5738Ij2FxVwy1FWVuhFkHvpMrPbQ==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-musl@0.9.3': resolution: {integrity: sha512-u3+0sCso/mcjDvtc3866D2giV7l34PDyDVBkMesAWa3DWbIWPlybehi2SSnmScgArV22ctqSSgUzdBBVJ6zYAg==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-arm64@0.9.3': resolution: {integrity: sha512-xnGEvdhyjRkXozHtpXVpEEkyGZWAxJ3RoILv7XRV5SvTEztaTCk5GQyfcOzI9An/EJtcL4ERCI8QmS0TpDPJiA==} cpu: [arm64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-x64@0.9.3': resolution: {integrity: sha512-N5eShGcuwnrXEprePFmEjtng6acZmtnC4zgazK9xxkavcx1q1uX8Nz8lU5RS973EMlNr902cIc6Cd2D4tqZDBg==} cpu: [x64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-toolchain/types@0.9.3': resolution: {integrity: sha512-rFE+5P4g2wxko5C85MugJOlVjBHEQq87dIkhLkniLXLp63PEtgaFjD954i5HXlfnyzLxPcZHsSOVDVgmo1HToA==} @@ -2972,8 +2997,8 @@ packages: engines: {node: '>=10'} hasBin: true - shell-quote@1.10.0: - resolution: {integrity: sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==} + shell-quote@1.11.0: + resolution: {integrity: sha512-JdxDPD0DBTyu08pq0kPC0xSNet/qsU07qT6IsX1AS8oO2ICNRY4ldNa8OAI6PuwAH8tG3lxEhbqmyp4Dw4036g==} engines: {node: '>= 0.4'} shiki@2.5.0: @@ -5091,7 +5116,7 @@ snapshots: launch-editor@2.14.1: dependencies: picocolors: 1.1.1 - shell-quote: 1.10.0 + shell-quote: 1.11.0 lefthook-darwin-arm64@2.1.17: optional: true @@ -5436,7 +5461,7 @@ snapshots: semver@7.8.5: {} - shell-quote@1.10.0: {} + shell-quote@1.11.0: {} shiki@2.5.0: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ebe7f93..ec4f526 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -97,6 +97,10 @@ catalogs: # runtime deps, which are the three peers). Each selector is version-scoped so # only the affected line moves and unrelated lines are untouched. overrides: + # GHSA-pqg4-j6r4-53mv (Critical): shell-quote command injection through a + # line terminator after a comment token. Reaches us via the Changesets CLI's + # editor launcher, never the published entity package. + "shell-quote@>=1.8.4 <1.11.0": "1.11.0" # GHSA-fx2h-pf6j-xcff (High, `server.fs.deny` bypass on Windows alternate data # streams) plus three moderates on the same line: GHSA path traversal in # optimized deps, launch-editor NTLMv2 disclosure, and the esbuild dev-server