@regardio/dev 2.0.2 → 2.1.1

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.
@@ -1,24 +1,25 @@
1
1
  ---
2
2
 
3
- title: Dependency Handling
4
- type: guide
5
- status: published
6
- summary: Safe dependency updates and supply-chain controls for Regardio workspaces
7
- related: [releases, typescript, vitest]
8
- locale: en-US
3
+ title: "Dependency Handling"
4
+ description: "How Regardio workspaces keep dependencies up to date without letting the supply chain surprise them."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # Dependency Handling
12
13
 
13
- Dependency update workflow and supply-chain controls for Regardio workspaces. Automated updates are combined with pnpm guardrails; the lockfile is authoritative.
14
+ Dependency updates in a Regardio workspace walk a narrow path: automated update tooling on one side, pnpm guardrails on the other, and the lockfile as the final word.
14
15
 
15
16
  ## Update workflow
16
17
 
17
- - Use `pnpm ncu` to prepare workspace dependency upgrades
18
- - Install through `pnpm` so workspace-level safety settings are applied
19
- - Run the normal verification flow after updates:
18
+ - `pnpm ncu` prepares the upgrade proposals
19
+ - Installs go through `pnpm` so workspace-level safety settings apply
20
+ - The normal verification flow runs after an update
20
21
 
21
- The root `ncu` script uses a 1-day cooldown so it does not propose versions that are newer than the workspace release-age policy.
22
+ The root `ncu` script uses a 1-day cooldown, so it won't propose versions newer than the workspace's release-age policy allows anyway.
22
23
 
23
24
  ```bash
24
25
  pnpm audit
@@ -28,7 +29,7 @@ pnpm test
28
29
  pnpm typecheck
29
30
  ```
30
31
 
31
- For larger automated upgrade passes, use the existing safety wrapper:
32
+ For larger upgrade passes, the safety wrapper pulls everything together:
32
33
 
33
34
  ```bash
34
35
  pnpm safe-upgrade
@@ -36,15 +37,13 @@ pnpm safe-upgrade
36
37
 
37
38
  ## Workspace safety settings
38
39
 
39
- The root `pnpm-workspace.yaml` defines the main supply-chain controls.
40
+ The root `pnpm-workspace.yaml` carries the main supply-chain controls.
40
41
 
41
42
  ### Allow-listed dependency builds
42
43
 
43
- Regardio keeps dependency build scripts restricted through `onlyBuiltDependencies`.
44
+ Build scripts stay restricted through `onlyBuiltDependencies`. A dependency cannot run `build` or `postinstall` unless it's already trusted and listed explicitly. If a package that never needed a build step adds one in a compromised release, pnpm doesn't run it — the workspace notices before the damage does.
44
45
 
45
- This means dependencies cannot start running build or postinstall steps unless they are already trusted and listed explicitly. If a package that previously needed no build step suddenly adds one in a compromised release, pnpm will not execute it automatically.
46
-
47
- When a legitimate dependency genuinely needs a build step, add it deliberately to the allow-list and review why it is required.
46
+ When a legitimate dependency genuinely needs a build step, add it deliberately to the allow-list and leave a note on why.
48
47
 
49
48
  ### Block exotic transitive dependencies
50
49
 
@@ -52,7 +51,7 @@ When a legitimate dependency genuinely needs a build step, add it deliberately t
52
51
  blockExoticSubdeps: true
53
52
  ```
54
53
 
55
- This prevents transitive dependencies from resolving through git URLs, tarballs, or other non-registry sources.
54
+ Transitive dependencies can't resolve through git URLs, tarballs, or other non-registry sources. The registry remains the only door in.
56
55
 
57
56
  ### Delay newly published versions
58
57
 
@@ -60,9 +59,9 @@ This prevents transitive dependencies from resolving through git URLs, tarballs,
60
59
  minimumReleaseAge: 1440
61
60
  ```
62
61
 
63
- We wait 24 hours before pnpm may install a newly published version. This gives time for compromised packages to be detected and removed before they reach the workspace.
62
+ pnpm waits 24 hours before installing a newly published version. That window is long enough for most compromised packages to be detected and pulled before they land in a workspace.
64
63
 
65
- The root `ncu` script mirrors this with `--cooldown 1`, which helps align version selection with the install policy. pnpm still remains the authoritative enforcement point during installation.
64
+ The root `ncu` script mirrors this with `--cooldown 1`, which lines version selection up with the install policy. pnpm is still the authoritative enforcement point at install time.
66
65
 
67
66
  ### Prevent trust downgrades
68
67
 
@@ -70,47 +69,45 @@ The root `ncu` script mirrors this with `--cooldown 1`, which helps align versio
70
69
  trustPolicy: no-downgrade
71
70
  ```
72
71
 
73
- If a package release becomes less trustworthy than earlier releases, pnpm rejects the installation instead of silently accepting the downgrade.
72
+ If a package release becomes less trustworthy than earlier releases, pnpm refuses to install it rather than silently accepting the downgrade.
74
73
 
75
- `npm-check-updates` does not enforce trust policy, build-script allow-lists, or exotic transitive source restrictions. Those safeguards only take effect when `pnpm install` resolves and installs dependencies.
74
+ `npm-check-updates` does not enforce trust policy, build-script allow-lists, or exotic-source restrictions. Those safeguards take effect when `pnpm install` resolves and installs — not before.
76
75
 
77
76
  ## Lockfile discipline
78
77
 
79
- - Commit `pnpm-lock.yaml`
80
- - Review lockfile changes together with manifest changes
81
- - Prefer normal installs over ad hoc per-package package manager commands so the workspace lock remains authoritative
78
+ - `pnpm-lock.yaml` is committed
79
+ - Lockfile changes are reviewed alongside manifest changes
80
+ - Prefer regular installs over ad-hoc per-package commands so the workspace lock stays authoritative
82
81
 
83
82
  ## Reviewing dependency updates
84
83
 
85
- When an automated update lands, review:
84
+ When an automated update lands, a few questions are worth asking:
86
85
 
87
- - whether the package is direct or transitive
88
- - whether the update adds or changes a build requirement
89
- - whether the package affects runtime, build tooling, or release tooling
90
- - whether overrides should be added for newly disclosed vulnerabilities
86
+ - Is the package direct or transitive?
87
+ - Does the update add or change a build requirement?
88
+ - Does the package affect runtime, build tooling, or release tooling?
89
+ - Do any newly disclosed vulnerabilities want a workspace override?
91
90
 
92
91
  ## Shipping dependency changes
93
92
 
94
- Dependency updates follow the same release gates as any other change.
95
-
96
- - verify locally before shipping
97
- - keep changelog subjects clear when a release is primarily dependency maintenance
98
- - use provenance when publishing public packages
93
+ Dependency updates go through the same release gates as any other change.
99
94
 
100
- ## When to make an exception
95
+ - Verify locally before shipping
96
+ - Keep changelog subjects clear when the release is primarily dependency maintenance
97
+ - Use provenance when publishing public packages
101
98
 
102
- Exceptions should stay explicit and rare.
99
+ ## When an exception is warranted
103
100
 
104
- Examples:
101
+ Exceptions stay explicit and rare. A few examples of what qualifies:
105
102
 
106
- - adding a package to `onlyBuiltDependencies`
107
- - introducing a workspace override for a vulnerable transitive dependency
108
- - reducing the release-age delay for a security-critical emergency update
103
+ - Adding a package to `onlyBuiltDependencies`
104
+ - Introducing a workspace override for a vulnerable transitive dependency
105
+ - Reducing the release-age delay for a security-critical emergency update
109
106
 
110
- When an exception is necessary, document the reason in the change itself so later readers can understand why the safer default was not enough.
107
+ When an exception is needed, record the reason in the change itself later readers will thank whoever left the note.
111
108
 
112
- Related documents:
109
+ ## Related
113
110
 
114
- - [Release Workflow](./releases.md) — Automated release process for Regardio packages
115
- - [Testing Approach](../standards/testing.md) — Testing philosophy and patterns for Regardio projects
116
- - [TypeScript Configuration](./typescript.md) — TypeScript setup and configuration for Regardio projects
111
+ - [Releases](./releases.md) — the release process dependency changes pass through
112
+ - [Testing](../standards/testing.md) — the layer that catches what slips past the update review
113
+ - [TypeScript](./typescript.md) — TypeScript configuration for Regardio projects
@@ -1,20 +1,21 @@
1
1
  ---
2
2
 
3
- title: Husky
4
- type: guide
5
- status: published
6
- summary: Git hooks for quality gates
7
- related: [commitlint, biome]
8
- locale: en-US
3
+ title: "Husky"
4
+ description: "Git hooks for quality gates — the last chance to catch something before it lands in history."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # Husky
12
13
 
13
- Runs quality checks at commit time via Git hooks. Configured through `@regardio/dev`; bypass only in genuine emergencies.
14
+ Husky runs quality checks at commit time through git hooks. The configuration comes from `@regardio/dev`; bypass is available, but saved for real emergencies.
14
15
 
15
16
  ## Setup
16
17
 
17
- Husky is configured automatically via the `prepare` script:
18
+ Husky configures itself through the `prepare` script:
18
19
 
19
20
  ```json
20
21
  {
@@ -28,63 +29,60 @@ This runs after `pnpm install` and sets up the `.husky` directory.
28
29
 
29
30
  ## Hooks
30
31
 
31
- ### commit-msg
32
+ ### `commit-msg`
32
33
 
33
- Validates commit messages against conventional commit format:
34
+ Validates commit messages against the conventional-commit format:
34
35
 
35
36
  ```bash
36
37
  #!/bin/sh
37
38
  pnpm lint-commit --edit $1
38
39
  ```
39
40
 
40
- ### pre-commit (optional)
41
+ ### `pre-commit` (optional)
41
42
 
42
- Run linting before commit:
43
+ Runs linting before a commit lands:
43
44
 
44
45
  ```bash
45
46
  #!/bin/sh
46
47
  pnpm lint
47
48
  ```
48
49
 
49
- ## CLI Wrapper
50
+ ## CLI wrapper
50
51
 
51
- Use `exec-husky` instead of `husky` directly. This wrapper handles monorepo scenarios correctly.
52
+ `exec-husky` takes the place of `husky` directly the wrapper handles monorepo scenarios that bare Husky doesn't.
52
53
 
53
- ## Bypassing Hooks
54
+ ## Bypassing hooks
54
55
 
55
- In rare cases where you need to skip hooks:
56
+ In the rare case where a hook truly has to be skipped:
56
57
 
57
58
  ```bash
58
59
  git commit --no-verify -m "emergency fix"
59
60
  ```
60
61
 
61
- Use sparingly and only when absolutely necessary.
62
+ Use sparingly. A bypass that becomes habit stops being a bypass.
62
63
 
63
64
  ## Troubleshooting
64
65
 
65
66
  ### Hooks not running
66
67
 
67
- Ensure Husky is installed:
68
+ Make sure Husky is installed:
68
69
 
69
70
  ```bash
70
71
  pnpm install
71
72
  ```
72
73
 
73
- Check that `.husky` directory exists and contains hook files.
74
+ Check that `.husky/` exists and carries the hook files.
74
75
 
75
76
  ### Permission denied
76
77
 
77
- Make hooks executable:
78
+ Make the hooks executable:
78
79
 
79
80
  ```bash
80
81
  chmod +x .husky/*
81
82
  ```
82
83
 
83
- Related documents:
84
-
85
- - [Commitlint](./commitlint.md) — Commit message validation
86
- - [Biome](./biome.md) — Linting and formatting
87
-
88
- ### Resources
84
+ ## Related
89
85
 
86
+ - [Commitlint](./commitlint.md) — commit-message validation
87
+ - [Biome](./biome.md) — linting and formatting
90
88
  - [Husky Documentation](https://typicode.github.io/husky/)
@@ -1,20 +1,21 @@
1
1
  ---
2
2
 
3
- title: Markdownlint
4
- type: guide
5
- status: published
6
- summary: Linting and formatting for Markdown files
7
- related: [biome]
8
- locale: en-US
3
+ title: "Markdownlint"
4
+ description: "Linting and light formatting for Markdown, so prose stays as consistent as the code alongside it."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # Markdownlint
12
13
 
13
- Lints Markdown structure and formatting. Rules are centralized in `@regardio/dev`; use the `lint-md` wrapper instead of calling the tool directly.
14
+ Markdownlint checks Markdown structure and formatting. The rules live in `@regardio/dev`; projects reach for the `lint-md` wrapper rather than calling the tool directly.
14
15
 
15
16
  ## Configuration
16
17
 
17
- Create `.markdownlint.json` in your package root:
18
+ A `.markdownlint.json` at the package root:
18
19
 
19
20
  ```json
20
21
  {
@@ -33,16 +34,16 @@ Create `.markdownlint.json` in your package root:
33
34
  }
34
35
  ```
35
36
 
36
- ## CLI Wrapper
37
+ ## CLI wrapper
37
38
 
38
- Use `lint-md` instead of `markdownlint-cli2` directly:
39
+ Use `lint-md` rather than `markdownlint-cli2` directly:
39
40
 
40
41
  ```bash
41
42
  lint-md "**/*.md" # Check all Markdown files
42
- lint-md --fix "**/*.md" # Auto-fix issues
43
+ lint-md --fix "**/*.md" # Auto-fix what can be auto-fixed
43
44
  ```
44
45
 
45
- ## Key Rules
46
+ ## Key rules
46
47
 
47
48
  | Rule | Description |
48
49
  |------|-------------|
@@ -52,11 +53,11 @@ lint-md --fix "**/*.md" # Auto-fix issues
52
53
  | MD012 | No multiple consecutive blank lines |
53
54
  | MD022 | Headings surrounded by blank lines |
54
55
  | MD032 | Lists surrounded by blank lines |
55
- | MD041 | First line should be a top-level heading |
56
+ | MD041 | First line is a top-level heading |
56
57
 
57
- ## Ignoring Rules
58
+ ## Ignoring rules
58
59
 
59
- For specific files or sections:
60
+ For a specific file or section, inline comments do the job:
60
61
 
61
62
  ```markdown
62
63
  <!-- markdownlint-disable MD013 -->
@@ -64,7 +65,7 @@ This line can be very long without triggering a warning.
64
65
  <!-- markdownlint-enable MD013 -->
65
66
  ```
66
67
 
67
- Or in config for specific files:
68
+ Or, per-file, through the config:
68
69
 
69
70
  ```json
70
71
  {
@@ -73,12 +74,8 @@ Or in config for specific files:
73
74
  }
74
75
  ```
75
76
 
76
- Related documents:
77
-
78
- - [Documentation](../standards/documentation.md) — Structure and conventions
79
- - [Biome](./biome.md) — Fast, unified linting and formatting
80
-
81
- ### Resources
77
+ ## Related
82
78
 
79
+ - [Biome](./biome.md) — linting and formatting on the code side
83
80
  - [Markdownlint Rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md)
84
81
  - [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2)
@@ -1,16 +1,17 @@
1
1
  ---
2
2
 
3
- title: Playwright
4
- type: guide
5
- status: published
6
- summary: End-to-end testing for web applications
7
- related: [vitest]
8
- locale: en-US
3
+ title: "Playwright"
4
+ description: "End-to-end testing for web applications — for the flows users actually feel."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # Playwright
12
13
 
13
- End-to-end testing for web applications. Prefer role-based, accessible selectors. Use E2E tests for critical user workflows, not as a substitute for unit or integration tests.
14
+ End-to-end testing for web applications. Playwright covers the flows a user actually moves through; it isn't a stand-in for unit or integration tests, and tests read best when they reach for accessible, role-based selectors.
14
15
 
15
16
  ## Configuration
16
17
 
@@ -39,16 +40,16 @@ export default defineConfig(
39
40
  }
40
41
  ```
41
42
 
42
- ## Running Tests
43
+ ## Running tests
43
44
 
44
45
  ```bash
45
46
  pnpm test:e2e # Run all E2E tests
46
47
  pnpm playwright test --ui # Interactive UI mode
47
- pnpm playwright test --debug # Debug mode with inspector
48
- pnpm playwright show-report # View HTML report
48
+ pnpm playwright test --debug # Debug mode with the inspector
49
+ pnpm playwright show-report # View the HTML report
49
50
  ```
50
51
 
51
- ## Writing Tests
52
+ ## Writing tests
52
53
 
53
54
  ```typescript
54
55
  import { test, expect } from '@playwright/test';
@@ -64,23 +65,25 @@ test('user can submit contact form', async ({ page }) => {
64
65
  });
65
66
  ```
66
67
 
67
- ## Best Practices
68
+ ## Patterns that hold up
68
69
 
69
- ### Use Role-Based Selectors
70
+ ### Role-based selectors
71
+
72
+ Selectors that match roles and labels survive UI tidying — selectors that pin to CSS classes don't.
70
73
 
71
74
  ```typescript
72
- // Preferred - accessible and resilient
75
+ // reads well accessible and resilient
73
76
  await page.getByRole('button', { name: 'Submit' });
74
77
  await page.getByLabel('Email');
75
78
 
76
- // Avoid - brittle
79
+ // brittle breaks on any class rename
77
80
  await page.locator('.submit-btn');
78
81
  await page.locator('#email-input');
79
82
  ```
80
83
 
81
- ### Add data-test Attributes
84
+ ### `data-test` attributes
82
85
 
83
- For elements without accessible names:
86
+ For elements without a natural accessible name:
84
87
 
85
88
  ```tsx
86
89
  <div data-test="user-avatar">{avatar}</div>
@@ -90,9 +93,9 @@ For elements without accessible names:
90
93
  await page.getByTestId('user-avatar');
91
94
  ```
92
95
 
93
- ### Page Object Pattern
96
+ ### Page objects for larger flows
94
97
 
95
- For complex pages, use page objects:
98
+ When a page has a handful of interactions worth naming, a small page object keeps tests readable:
96
99
 
97
100
  ```typescript
98
101
  class LoginPage {
@@ -106,12 +109,9 @@ class LoginPage {
106
109
  }
107
110
  ```
108
111
 
109
- Related documents:
110
-
111
- - [Testing Approach](../standards/testing.md) — Testing philosophy and patterns for Regardio projects
112
- - [Vitest](./vitest.md) — Unit and integration testing for TypeScript projects
113
-
114
- ### Resources
112
+ ## Related
115
113
 
114
+ - [Testing](../standards/testing.md) — testing philosophy and layers
115
+ - [Vitest](./vitest.md) — unit and integration testing
116
116
  - [Playwright Documentation](https://playwright.dev/)
117
117
  - [Best Practices](https://playwright.dev/docs/best-practices)
@@ -1,16 +1,17 @@
1
1
  ---
2
2
 
3
- title: Release Workflow
4
- type: guide
5
- status: published
6
- summary: GitLab-flow release process with Changesets for Regardio packages
7
- related: [commitlint]
8
- locale: en-US
3
+ title: "Release Workflow"
4
+ description: "Branch-based release workflow for Regardio packages — main → staging → production, driven by Changesets."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # Release Workflow
12
13
 
13
- Branch-based release workflow for Regardio packages. `main` → `staging` → `production`. Versioning is driven by [Changesets](https://github.com/changesets/changesets); quality gates run locally before any branch promotion.
14
+ Branch-based release workflow for Regardio packages. `main` → `staging` → `production`. Changesets carry the version bumps; quality gates run locally before any branch promotion. Nothing broken reaches a shared branch.
14
15
 
15
16
  ## Overview
16
17
 
@@ -209,13 +210,20 @@ Install `@regardio/dev` and:
209
210
  git checkout main
210
211
  ```
211
212
 
212
- 4. **Copy the release workflow** for your forge:
213
+ 4. **Copy the release workflow** for your forge. A GitHub Actions template ships with `@regardio/dev`; Forgejo Actions accepts the same workflow syntax with minimal changes.
213
214
 
214
215
  ```bash
216
+ # GitHub
215
217
  mkdir -p .github/workflows
216
218
  cp node_modules/@regardio/dev/templates/github/release.yml .github/workflows/release.yml
219
+
220
+ # Forgejo / Codeberg
221
+ mkdir -p .forgejo/workflows
222
+ cp node_modules/@regardio/dev/templates/github/release.yml .forgejo/workflows/release.yml
217
223
  ```
218
224
 
225
+ For other CI systems, treat the template as a reference: the workflow installs dependencies, builds, runs `pnpm changeset publish`, and pushes tags on every push to `production`.
226
+
219
227
  5. **First publish of any new package must be done locally**:
220
228
 
221
229
  ```bash
@@ -236,7 +244,57 @@ pnpm test # Must succeed
236
244
 
237
245
  Packages that should never be published to npm must set `"private": true` in `package.json`. `changeset publish` skips them automatically. The git flow (`ship-staging`, `ship-production`, `ship-hotfix`) works identically for private packages — changesets, version bumps, and branch promotion all continue as normal; only the npm publish step is skipped.
238
246
 
239
- Related documents:
247
+ ## Workspace-Level Automation
248
+
249
+ The meta-workspace (`workspace/`) provides scripts that operate across all repos at once. Run these from the `workspace/` directory.
250
+
251
+ ### Daily maintenance: safe-upgrade-and-ship
252
+
253
+ After a dependency upgrade cycle, ship everything to staging in one command:
254
+
255
+ ```bash
256
+ cd workspace
257
+ pnpm safe-upgrade-and-ship
258
+ ```
259
+
260
+ What it does:
261
+
262
+ 1. Runs `pnpm safe-upgrade` — upgrades all dependencies, runs build + lint + test + typecheck across the full workspace. Aborts if anything fails.
263
+ 2. For every repo (workspace itself, commons, ensemble, system, channels/*): checks `git status`.
264
+ 3. If only `package.json` and/or `pnpm-lock.yaml` changed: commits with `chore: upgrade dependencies`, pushes `main` to origin, fast-forward merges `main → staging`, pushes `staging`, returns to `main`.
265
+ 4. If unexpected files are uncommitted: skips that repo and reports it.
266
+
267
+ No further interaction needed — husky pre-commit hooks run on the commit step, and the full quality suite already passed in step 1.
268
+
269
+ ### Selective staging ship
270
+
271
+ If changes are already committed and ready:
272
+
273
+ ```bash
274
+ cd workspace
275
+ pnpm ship:staging
276
+ ```
277
+
278
+ Delegates to each repo's `ship:staging` (which re-runs quality checks per repo). Workspace itself is handled directly to avoid recursion.
279
+
280
+ ### Production ship
281
+
282
+ ```bash
283
+ cd workspace
284
+ pnpm ship:production
285
+ ```
286
+
287
+ Calls each sub-repo's `ship:production` in sequence, then promotes workspace itself (`main → production → staging`). For repos with Changesets (commons), this triggers the full version-bump flow. For app repos without Changesets (ensemble, system, channels), it promotes the branch without versioning.
288
+
289
+ ### When to use each command
290
+
291
+ | Command | When |
292
+ |---------|------|
293
+ | `pnpm safe-upgrade-and-ship` | Daily/weekly dependency maintenance — upgrade all, verify all, ship all to staging |
294
+ | `pnpm ship:staging` | Changes are already committed; just push everything to staging |
295
+ | `pnpm ship:production` | Ready to go to production across all repos |
296
+
297
+ ## Related
240
298
 
241
- - [Commit Conventions](../standards/commits.md) — Conventional commits for consistent history
242
- - [Commitlint](./commitlint.md) — Commit message validation
299
+ - [Commits](../standards/commits.md) — conventional commits and changelog generation
300
+ - [Commitlint](./commitlint.md) — commit-message validation
@@ -1,20 +1,21 @@
1
1
  ---
2
2
 
3
- title: TypeScript Configuration
4
- type: guide
5
- status: published
6
- summary: TypeScript setup and configuration for Regardio projects
7
- related: [biome, vitest]
8
- locale: en-US
3
+ title: "TypeScript Configuration"
4
+ description: "Shared, strict TypeScript presets for Regardio projects, with enough knobs for each shape of project."
5
+ publishedAt: 2026-04-17
6
+ language: "en"
7
+ status: "published"
8
+ kind: "guide"
9
+ area: "dev"
9
10
  ---
10
11
 
11
12
  # TypeScript Configuration
12
13
 
13
- Strict shared TypeScript presets for Regardio projects. Extend from `@regardio/dev` instead of rebuilding config from scratch. Keep strict settings enabled.
14
+ Strict, shared TypeScript presets for Regardio projects. Extending from `@regardio/dev` is the well-worn path; rebuilding a config from scratch is usually a path to drift.
14
15
 
15
16
  ## Presets
16
17
 
17
- | Preset | Use Case |
18
+ | Preset | Use case |
18
19
  |--------|----------|
19
20
  | `@regardio/dev/typescript/base` | Node.js packages, libraries |
20
21
  | `@regardio/dev/typescript/react` | React applications and components |
@@ -22,7 +23,7 @@ Strict shared TypeScript presets for Regardio projects. Extend from `@regardio/d
22
23
 
23
24
  ## Configuration
24
25
 
25
- ### tsconfig.json
26
+ ### `tsconfig.json`
26
27
 
27
28
  ```json
28
29
  {
@@ -40,9 +41,9 @@ For React projects:
40
41
  }
41
42
  ```
42
43
 
43
- ### tsconfig.build.json
44
+ ### `tsconfig.build.json`
44
45
 
45
- Separate build config for production output:
46
+ A separate build config for production output:
46
47
 
47
48
  ```json
48
49
  {
@@ -55,15 +56,15 @@ Separate build config for production output:
55
56
  }
56
57
  ```
57
58
 
58
- ## Strict Settings
59
+ ## Strict settings
59
60
 
60
- The base config enables strict TypeScript checking:
61
+ The base config turns on strict type-checking across the board:
61
62
 
62
- - `strict: true` - All strict type-checking options
63
- - `noUncheckedIndexedAccess: true` - Adds `undefined` to index signatures
64
- - `exactOptionalPropertyTypes: true` - Distinguishes between `undefined` and missing
65
- - `noImplicitReturns: true` - All code paths must return a value
66
- - `noFallthroughCasesInSwitch: true` - Prevents switch fallthrough bugs
63
+ - `strict: true` every strict type-checking option
64
+ - `noUncheckedIndexedAccess: true` adds `undefined` to index signatures
65
+ - `exactOptionalPropertyTypes: true` distinguishes `undefined` from missing
66
+ - `noImplicitReturns: true` every code path returns a value
67
+ - `noFallthroughCasesInSwitch: true` prevents switch-fallthrough surprises
67
68
 
68
69
  ## Scripts
69
70
 
@@ -76,14 +77,11 @@ The base config enables strict TypeScript checking:
76
77
  }
77
78
  ```
78
79
 
79
- Run `typecheck` regularly during development to catch type errors early.
80
+ Running `typecheck` during development catches type errors at the moment they appear, rather than at the moment they break something.
80
81
 
81
- Related documents:
82
-
83
- - [Biome](./biome.md) — Linting and formatting
84
- - [Vitest](./vitest.md) — Unit and integration testing for TypeScript projects
85
-
86
- ### Resources
82
+ ## Related
87
83
 
84
+ - [Biome](./biome.md) — linting and formatting
85
+ - [Vitest](./vitest.md) — unit and integration testing
88
86
  - [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/)
89
87
  - [tsconfig Reference](https://www.typescriptlang.org/tsconfig)