Skip to content

Commit 384a29b

Browse files
Goosterhofclaude
andcommitted
style: format documentation files with oxfmt
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1e6687a commit 384a29b

15 files changed

Lines changed: 292 additions & 275 deletions

docs/.vitepress/config.mts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from "vitepress";
22

33
export default defineConfig({
4-
title: 'FS Packages',
5-
description: 'Shared frontend service packages by Script Development',
4+
title: "FS Packages",
5+
description: "Shared frontend service packages by Script Development",
66

77
themeConfig: {
88
nav: [
9-
{ text: 'Home', link: '/' },
10-
{ text: 'Getting Started', link: '/getting-started' },
11-
{ text: 'Architecture', link: '/architecture' },
12-
{ text: 'Packages', link: '/packages/http' },
13-
{ text: 'Contributing', link: '/contributing' },
9+
{ text: "Home", link: "/" },
10+
{ text: "Getting Started", link: "/getting-started" },
11+
{ text: "Architecture", link: "/architecture" },
12+
{ text: "Packages", link: "/packages/http" },
13+
{ text: "Contributing", link: "/contributing" },
1414
],
1515

1616
sidebar: {
17-
'/': [
17+
"/": [
1818
{
19-
text: 'Guide',
19+
text: "Guide",
2020
items: [
21-
{ text: 'Getting Started', link: '/getting-started' },
22-
{ text: 'Architecture', link: '/architecture' },
23-
{ text: 'Contributing', link: '/contributing' },
21+
{ text: "Getting Started", link: "/getting-started" },
22+
{ text: "Architecture", link: "/architecture" },
23+
{ text: "Contributing", link: "/contributing" },
2424
],
2525
},
2626
{
27-
text: 'Foundation',
27+
text: "Foundation",
2828
collapsed: false,
2929
items: [
30-
{ text: 'fs-http', link: '/packages/http' },
31-
{ text: 'fs-storage', link: '/packages/storage' },
32-
{ text: 'fs-helpers', link: '/packages/helpers' },
30+
{ text: "fs-http", link: "/packages/http" },
31+
{ text: "fs-storage", link: "/packages/storage" },
32+
{ text: "fs-helpers", link: "/packages/helpers" },
3333
],
3434
},
3535
{
36-
text: 'Services',
36+
text: "Services",
3737
collapsed: false,
3838
items: [
39-
{ text: 'fs-theme', link: '/packages/theme' },
40-
{ text: 'fs-loading', link: '/packages/loading' },
41-
{ text: 'fs-toast', link: '/packages/toast' },
42-
{ text: 'fs-dialog', link: '/packages/dialog' },
43-
{ text: 'fs-translation', link: '/packages/translation' },
39+
{ text: "fs-theme", link: "/packages/theme" },
40+
{ text: "fs-loading", link: "/packages/loading" },
41+
{ text: "fs-toast", link: "/packages/toast" },
42+
{ text: "fs-dialog", link: "/packages/dialog" },
43+
{ text: "fs-translation", link: "/packages/translation" },
4444
],
4545
},
4646
{
47-
text: 'Domain',
47+
text: "Domain",
4848
collapsed: false,
4949
items: [
50-
{ text: 'fs-adapter-store', link: '/packages/adapter-store' },
51-
{ text: 'fs-router', link: '/packages/router' },
50+
{ text: "fs-adapter-store", link: "/packages/adapter-store" },
51+
{ text: "fs-router", link: "/packages/router" },
5252
],
5353
},
5454
],
5555
},
5656

5757
socialLinks: [
58-
{ icon: 'github', link: 'https://github.com/script-development/fs-packages' },
59-
{ icon: 'npm', link: 'https://www.npmjs.com/org/script-development' },
58+
{ icon: "github", link: "https://github.com/script-development/fs-packages" },
59+
{ icon: "npm", link: "https://www.npmjs.com/org/script-development" },
6060
],
6161

6262
search: {
63-
provider: 'local',
63+
provider: "local",
6464
},
6565

6666
outline: {
6767
level: [2, 3],
6868
},
6969

7070
footer: {
71-
message: 'Built by Script Development & Back to Code',
71+
message: "Built by Script Development & Back to Code",
7272
},
7373
},
74-
})
74+
});

docs/architecture.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ Vue-dependent packages use Vue's reactivity primitives (`Ref`, `ComputedRef`, `r
199199
```typescript
200200
const loading = createLoadingService();
201201

202-
loading.isLoading; // ComputedRef<boolean> — use in templates, watch, computed
203-
loading.activeCount; // DeepReadonly<Ref<number>> — readable but not writable
202+
loading.isLoading; // ComputedRef<boolean> — use in templates, watch, computed
203+
loading.activeCount; // DeepReadonly<Ref<number>> — readable but not writable
204204
```
205205

206206
This means services integrate naturally with Vue's ecosystem:
@@ -245,7 +245,7 @@ const routes = [
245245

246246
const router = createRouterService(routes);
247247

248-
router.goToEditPage("users", 42); // compiles — "users" exists and has an edit page
248+
router.goToEditPage("users", 42); // compiles — "users" exists and has an edit page
249249
router.goToEditPage("projects", 42); // compile error — "projects" is not a valid route
250250
```
251251

@@ -254,15 +254,18 @@ router.goToEditPage("projects", 42); // compile error — "projects" is not a va
254254
`fs-translation` validates keys against your translation schema:
255255

256256
```typescript
257-
const translation = createTranslationService({
258-
en: {
259-
common: { save: "Save", cancel: "Cancel" },
260-
users: { title: "Users", empty: "No users found" },
257+
const translation = createTranslationService(
258+
{
259+
en: {
260+
common: { save: "Save", cancel: "Cancel" },
261+
users: { title: "Users", empty: "No users found" },
262+
},
261263
},
262-
}, "en");
264+
"en",
265+
);
263266

264-
translation.t("common.save"); // compiles — "common.save" exists
265-
translation.t("common.delete"); // compile error — "common.delete" doesn't exist
267+
translation.t("common.save"); // compiles — "common.save" exists
268+
translation.t("common.delete"); // compile error — "common.delete" doesn't exist
266269
```
267270

268271
## The Dependency Graph

docs/contributing.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ npm run lint:pkg
7373

7474
Every pull request must pass all 8 gates in order:
7575

76-
| Gate | Command | What it checks |
77-
|------|---------|----------------|
78-
| 1. Audit | `npm audit` | No known vulnerabilities in dependencies |
79-
| 2. Format | `npm run format:check` | Code follows oxfmt formatting rules |
80-
| 3. Lint | `npm run lint` | No oxlint violations |
81-
| 4. Build | `npm run build` | All packages compile successfully |
82-
| 5. Typecheck | `npm run typecheck` | No TypeScript errors in strict mode |
83-
| 6. Package lint | `npm run lint:pkg` | Package exports are correct (publint + attw) |
84-
| 7. Coverage | `npm run test:coverage` | 100% code coverage per package |
85-
| 8. Mutation | `npm run test:mutation` | 90% mutation score per package |
76+
| Gate | Command | What it checks |
77+
| --------------- | ----------------------- | -------------------------------------------- |
78+
| 1. Audit | `npm audit` | No known vulnerabilities in dependencies |
79+
| 2. Format | `npm run format:check` | Code follows oxfmt formatting rules |
80+
| 3. Lint | `npm run lint` | No oxlint violations |
81+
| 4. Build | `npm run build` | All packages compile successfully |
82+
| 5. Typecheck | `npm run typecheck` | No TypeScript errors in strict mode |
83+
| 6. Package lint | `npm run lint:pkg` | Package exports are correct (publint + attw) |
84+
| 7. Coverage | `npm run test:coverage` | 100% code coverage per package |
85+
| 8. Mutation | `npm run test:mutation` | 90% mutation score per package |
8686

8787
::: tip Why mutation testing?
8888
100% code coverage means every line of code was executed during tests. It does not mean every line was actually **verified**. Mutation testing changes your code (introduces "mutants") and checks whether your tests catch the change. A 90% mutation score means your tests detect 90% of possible bugs — not just that they run the code.
@@ -180,7 +180,9 @@ export function createExampleService(config: ExampleConfig): ExampleService {
180180
// return public API as plain object
181181
return {
182182
value: computed(() => state.value),
183-
doSomething() { /* ... */ },
183+
doSomething() {
184+
/* ... */
185+
},
184186
};
185187
}
186188
```

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const dialog = createDialogService();
128128
// Translation
129129
export const translation = createTranslationService(
130130
{ en: { common: { save: "Save", cancel: "Cancel" } } },
131-
"en"
131+
"en",
132132
);
133133
```
134134

docs/index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,32 @@ All packages are published under the `@script-development` scope on npm.
3838

3939
These packages have zero Vue dependency — they work in any TypeScript project.
4040

41-
| Package | Description |
42-
|---------|-------------|
43-
| [fs-http](/packages/http) | HTTP service factory with middleware architecture |
44-
| [fs-storage](/packages/storage) | localStorage service factory with prefix namespacing |
41+
| Package | Description |
42+
| ------------------------------- | ----------------------------------------------------------------- |
43+
| [fs-http](/packages/http) | HTTP service factory with middleware architecture |
44+
| [fs-storage](/packages/storage) | localStorage service factory with prefix namespacing |
4545
| [fs-helpers](/packages/helpers) | Tree-shakeable utilities: deep copy, type guards, case conversion |
4646

4747
### Services
4848

4949
Vue-powered reactive services for common application concerns.
5050

51-
| Package | Description |
52-
|---------|-------------|
53-
| [fs-theme](/packages/theme) | Reactive dark/light mode with system preference detection |
54-
| [fs-loading](/packages/loading) | Loading state service with HTTP middleware integration |
55-
| [fs-toast](/packages/toast) | Component-agnostic toast notification queue |
56-
| [fs-dialog](/packages/dialog) | Component-agnostic dialog stack with error middleware |
57-
| [fs-translation](/packages/translation) | Type-safe reactive i18n with multi-locale support |
51+
| Package | Description |
52+
| --------------------------------------- | --------------------------------------------------------- |
53+
| [fs-theme](/packages/theme) | Reactive dark/light mode with system preference detection |
54+
| [fs-loading](/packages/loading) | Loading state service with HTTP middleware integration |
55+
| [fs-toast](/packages/toast) | Component-agnostic toast notification queue |
56+
| [fs-dialog](/packages/dialog) | Component-agnostic dialog stack with error middleware |
57+
| [fs-translation](/packages/translation) | Type-safe reactive i18n with multi-locale support |
5858

5959
### Domain
6060

6161
Higher-level packages for domain-driven application architecture.
6262

63-
| Package | Description |
64-
|---------|-------------|
65-
| [fs-adapter-store](/packages/adapter-store) | Reactive state management with CRUD resource adapters |
66-
| [fs-router](/packages/router) | Type-safe router with CRUD navigation and middleware pipeline |
63+
| Package | Description |
64+
| ------------------------------------------- | ------------------------------------------------------------- |
65+
| [fs-adapter-store](/packages/adapter-store) | Reactive state management with CRUD resource adapters |
66+
| [fs-router](/packages/router) | Type-safe router with CRUD navigation and middleware pipeline |
6767

6868
## Quality Guarantees
6969

docs/packages/adapter-store.md

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ npm install @script-development/fs-adapter-store
1515
## The Big Picture
1616

1717
A typical application has domain resources — users, projects, invoices — that need to be:
18+
1819
1. **Fetched** from an API
1920
2. **Stored** in reactive state
2021
3. **Displayed** in components
@@ -43,11 +44,11 @@ import { createAdapterStoreModule, resourceAdapter } from "@script-development/f
4344
import { http, storage, loading } from "@/services";
4445

4546
const usersStore = createAdapterStoreModule<User>({
46-
domainName: "users", // API endpoint: /users
47-
adapter: resourceAdapter, // CRUD adapter factory
48-
httpService: http, // for API calls
49-
storageService: storage, // for offline persistence
50-
loadingService: loading, // for waiting on data
47+
domainName: "users", // API endpoint: /users
48+
adapter: resourceAdapter, // CRUD adapter factory
49+
httpService: http, // for API calls
50+
storageService: storage, // for offline persistence
51+
loadingService: loading, // for waiting on data
5152
});
5253
```
5354

@@ -117,15 +118,15 @@ When a resource comes from the API (has an `id`), it's wrapped in an `Adapted` o
117118
const user = usersStore.getById(1).value;
118119

119120
// Read original values (readonly, frozen)
120-
user.id; // 1
121-
user.name; // "Alice"
121+
user.id; // 1
122+
user.name; // "Alice"
122123
user.email; // "alice@example.com"
123124

124125
// Edit via mutable ref
125126
user.mutable.value.name = "Bob";
126127

127128
// Save changes
128-
await user.update(); // PUT /users/1 — sends full object
129+
await user.update(); // PUT /users/1 — sends full object
129130
await user.patch({ name: "Bob" }); // PATCH /users/1 — sends partial update
130131

131132
// Discard edits
@@ -143,7 +144,7 @@ When you create a new resource via `generateNew()`, it's wrapped in a `NewAdapte
143144
const newUser = usersStore.generateNew();
144145

145146
// Default values (readonly, frozen)
146-
newUser.name; // "" (empty defaults)
147+
newUser.name; // "" (empty defaults)
147148
newUser.email; // ""
148149

149150
// Edit via mutable ref
@@ -218,40 +219,40 @@ import { EntryNotFoundError, MissingResponseDataError } from "@script-developmen
218219

219220
### `createAdapterStoreModule(config)`
220221

221-
| Parameter | Type | Description |
222-
|-----------|------|-------------|
223-
| `config.domainName` | `string` | Resource endpoint name (e.g., `"users"`) |
224-
| `config.adapter` | `Adapter` | CRUD adapter factory (use `resourceAdapter`) |
225-
| `config.httpService` | `Pick<HttpService, "getRequest">` | HTTP service for fetching |
226-
| `config.storageService` | `Pick<StorageService, "get" \| "put">` | Storage for persistence |
227-
| `config.loadingService` | `Pick<LoadingService, "ensureLoadingFinished">` | Loading service for sync |
222+
| Parameter | Type | Description |
223+
| ----------------------- | ----------------------------------------------- | -------------------------------------------- |
224+
| `config.domainName` | `string` | Resource endpoint name (e.g., `"users"`) |
225+
| `config.adapter` | `Adapter` | CRUD adapter factory (use `resourceAdapter`) |
226+
| `config.httpService` | `Pick<HttpService, "getRequest">` | HTTP service for fetching |
227+
| `config.storageService` | `Pick<StorageService, "get" \| "put">` | Storage for persistence |
228+
| `config.loadingService` | `Pick<LoadingService, "ensureLoadingFinished">` | Loading service for sync |
228229

229230
### Store Module Methods
230231

231-
| Method | Returns | Description |
232-
|--------|---------|-------------|
233-
| `getAll` | `ComputedRef<Adapted[]>` | Reactive list of all adapted resources |
234-
| `getById(id)` | `ComputedRef<Adapted \| undefined>` | Reactive lookup by ID |
235-
| `getOrFailById(id)` | `Promise<Adapted>` | Wait for loading, throw if not found |
236-
| `generateNew()` | `NewAdapted` | Create a new unsaved resource |
237-
| `retrieveAll()` | `Promise<void>` | Fetch all from API and update state |
232+
| Method | Returns | Description |
233+
| ------------------- | ----------------------------------- | -------------------------------------- |
234+
| `getAll` | `ComputedRef<Adapted[]>` | Reactive list of all adapted resources |
235+
| `getById(id)` | `ComputedRef<Adapted \| undefined>` | Reactive lookup by ID |
236+
| `getOrFailById(id)` | `Promise<Adapted>` | Wait for loading, throw if not found |
237+
| `generateNew()` | `NewAdapted` | Create a new unsaved resource |
238+
| `retrieveAll()` | `Promise<void>` | Fetch all from API and update state |
238239

239240
### Adapted Properties
240241

241-
| Property | Type | Description |
242-
|----------|------|-------------|
243-
| *(all resource fields)* | `readonly` | Original values from API |
244-
| `mutable` | `Ref<Writable<T>>` | Editable copy |
245-
| `reset()` | `() => void` | Revert mutable to original |
246-
| `update()` | `() => Promise<T>` | PUT full resource |
247-
| `patch(partial)` | `(partial) => Promise<T>` | PATCH partial update |
248-
| `delete()` | `() => Promise<void>` | DELETE resource |
242+
| Property | Type | Description |
243+
| ----------------------- | ------------------------- | -------------------------- |
244+
| _(all resource fields)_ | `readonly` | Original values from API |
245+
| `mutable` | `Ref<Writable<T>>` | Editable copy |
246+
| `reset()` | `() => void` | Revert mutable to original |
247+
| `update()` | `() => Promise<T>` | PUT full resource |
248+
| `patch(partial)` | `(partial) => Promise<T>` | PATCH partial update |
249+
| `delete()` | `() => Promise<void>` | DELETE resource |
249250

250251
### NewAdapted Properties
251252

252-
| Property | Type | Description |
253-
|----------|------|-------------|
254-
| *(all new fields)* | `readonly` | Default values |
255-
| `mutable` | `Ref<Writable<N>>` | Editable copy |
256-
| `reset()` | `() => void` | Revert mutable to defaults |
257-
| `create()` | `() => Promise<T>` | POST to create resource |
253+
| Property | Type | Description |
254+
| ------------------ | ------------------ | -------------------------- |
255+
| _(all new fields)_ | `readonly` | Default values |
256+
| `mutable` | `Ref<Writable<N>>` | Editable copy |
257+
| `reset()` | `() => void` | Revert mutable to defaults |
258+
| `create()` | `() => Promise<T>` | POST to create resource |

0 commit comments

Comments
 (0)