@vyriy/ssg 0.8.7 → 0.8.9

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.
Files changed (2) hide show
  1. package/AGENTS.md +125 -68
  2. package/package.json +2 -2
package/AGENTS.md CHANGED
@@ -1,102 +1,159 @@
1
- # Project Agent Guide
1
+ # Vyriy Package Agent Guide
2
2
 
3
- This repository follows a calm engineering style: changes should be explicit, reusable, typed, documented, tested, and easy to reason about.
3
+ This guide applies to everything under `packages/*`.
4
4
 
5
- Use this guide as the default behavior for AI agents and contributors working in this repository. Prefer local package conventions when they are more specific than this document.
5
+ Always read the root `AGENTS.md` first for current project direction, then use this package guide as the stricter local contract for package work. If the root guide gains new package-relevant knowledge, sync it here in the same change or in the next package-touching change so this file does not drift behind.
6
6
 
7
- ## Core Principles
7
+ ## Package Principles
8
8
 
9
- - Prefer simple modules over clever frameworks or hidden conventions.
10
- - Keep package and project boundaries explicit.
11
- - Avoid project-specific coupling in reusable code.
12
- - Extract only proven reusable behavior.
13
- - Keep public APIs small, typed, documented, and stable.
14
- - Prefer SSR-friendly and SSG-friendly code paths when working with frontend or shared code.
15
- - Keep integrations replaceable and avoid hard coupling to a CMS, framework, vendor, or runtime host.
16
- - Prefer infrastructure assumptions that are easy to deploy, observe, and replace.
9
+ - Keep packages small, explicit, typed, documented, tested, and easy to reason about.
10
+ - Prefer calm reusable contracts over project-specific shortcuts.
11
+ - Keep every package responsible for one clear capability or closely related capability group.
12
+ - Keep public APIs small and intentional.
13
+ - Prefer SSR-friendly, SSG-friendly, and runtime-agnostic code paths.
14
+ - Avoid hidden framework, CMS, browser, filesystem, network, or cloud assumptions unless they are the package contract.
15
+ - Add packages only when they reduce real complexity, clarify boundaries, or improve reuse.
17
16
  - Prefer the option that is simpler to explain, easier to evolve, and calmer to maintain.
18
17
 
19
- ## File Shape
18
+ ## Standard Package Shape
20
19
 
21
- - Prefer one exported runtime method, component, helper, or class per production file when it stays readable.
20
+ Use `packages/pause` as the default structural template for ordinary runtime packages.
21
+
22
+ Expected files for a typical package:
23
+
24
+ - `README.md`
25
+ - `doc.mdx`
26
+ - `index.ts`
27
+ - `index.test.ts` when public re-exports need coverage
28
+ - `package.json`
29
+ - `<package>.ts`
30
+ - `<package>.test.ts`
31
+ - `types.ts` when public shared types are part of the package contract
32
+
33
+ Package-local build configs are not the default. Add them only when a package has a real special-purpose build shape.
34
+
35
+ ## File Responsibility
36
+
37
+ - Prefer one exported runtime method, component, helper, class, or factory per production file when it stays readable.
38
+ - Keep types in `types.ts` or focused type files when they are public, reused, or make runtime code noisy.
39
+ - Keep implementation code separate from type-only contracts when that improves readability or reuse.
22
40
  - Prefer one matching test file per production file, for example `feature.ts` and `feature.test.ts`.
23
41
  - Use focused folders when behavior naturally splits into several related files.
42
+ - Inside focused folders, prefer short file names because the folder path already carries part of the meaning.
24
43
  - Keep `index.ts` as a public re-export surface only. Do not place implementation logic in it.
44
+ - Keep constants near the code that owns them unless they are shared, clarify intent, or reduce repeated noise.
45
+ - Avoid exporting internal helpers only to make tests easier.
46
+
47
+ ## Imports And Exports
48
+
25
49
  - Use relative import and export specifiers that match the package module style.
26
50
  - Use `.js` relative specifiers in TypeScript source for ESM/NodeNext packages.
27
- - Add `types.ts` when public shared types are part of the package contract.
28
- - Keep constants near the code that owns them unless they are shared or clarify repeated behavior.
51
+ - Re-export every public runtime export from the package public entry point.
52
+ - Re-export public types with `export type`.
53
+ - Add or update `index.test.ts` when public exports change.
54
+ - Do not hand-maintain package `exports` maps in source manifests unless the package has a real custom publishing need.
29
55
 
30
- ## Public Surface
56
+ Example:
31
57
 
32
- - Every new public export must be re-exported from the package or module public entry point.
33
- - Add or update public-surface tests when exports change.
34
- - Add JSDoc for public exports when behavior, parameters, return values, or usage expectations need explanation.
35
- - Avoid exporting internal helpers only to make tests easier.
36
- - Do not hand-maintain package `exports` maps unless the project has a real custom publishing need.
58
+ ```ts
59
+ export * from './feature.js';
60
+ export type * from './types.js';
61
+ ```
62
+
63
+ ## Package Manifest
64
+
65
+ Keep source `package.json` files minimal and let `build:dist` generate publishing metadata where possible.
66
+
67
+ Typical runtime package fields:
68
+
69
+ - `"private": true`
70
+ - `"type": "module"`
71
+ - `"engines": { "node": ">=24.0.0" }`
72
+ - `"main": "index.js"` when the package has a runtime entry
73
+ - runtime dependencies only when package source imports them at runtime
74
+
75
+ ## Documentation Is Required
37
76
 
38
- ## Tests
77
+ Documentation must move with code. Do not finish a package change while docs describe a different API than the implementation.
39
78
 
40
- - Cover public behavior and meaningful edge cases.
79
+ - Every package must have a concise, usage-oriented `README.md`.
80
+ - Every ordinary package should have `doc.mdx`, normally wrapping the package README in the Storybook/docs style used by `packages/pause/doc.mdx`.
81
+ - Start package READMEs with `# @vyriy/<package>`.
82
+ - Document real public exports, supported options, behavior expectations, and examples that actually work.
83
+ - Update README examples whenever imports, parameters, return values, configuration, or behavior changes.
84
+ - Keep `doc.mdx` aligned with the README and package title when packages are added, renamed, or reorganized.
85
+ - Add or update JSDoc for public exports when behavior, parameters, return values, errors, side effects, or usage expectations need explanation.
86
+ - For component packages, include visual documentation, stories, or examples for supported states, variants, and interaction states.
87
+ - Avoid broad architecture essays in package READMEs; keep architectural direction in root-level docs unless it is necessary to use the package.
88
+
89
+ ## Tests Are Required
90
+
91
+ Tests should protect public behavior and meaningful regression risk.
92
+
93
+ - Add or update Jest tests for changed public behavior, public exports, and meaningful edge cases.
94
+ - Add a real test immediately for new packages. If behavior is not finalized, add a valid placeholder test with a clear public API expectation.
41
95
  - Prefer behavior-focused tests over private implementation lock-in.
42
- - Keep tests deterministic.
43
- - Avoid real network, filesystem, timers, browser, or cloud dependencies unless the behavior specifically requires them.
96
+ - Keep tests deterministic and avoid real network, timers, browser, filesystem, or cloud dependencies unless that dependency is the behavior under test.
44
97
  - When mocking modules, install mocks before loading the module under test.
45
- - Use focused validation when changing behavior.
98
+ - Use `@jest/globals` in Jest tests.
99
+ - Use `--coverage=false` for focused behavioral regression runs when global coverage thresholds would obscure the result.
46
100
 
47
- Example validation commands:
101
+ Typical package test naming:
48
102
 
49
- ```bash
50
- yarn test
51
- ```
103
+ - `<package>.test.ts` for single-file packages
104
+ - `<feature>.test.ts` for multi-entry packages
105
+ - `index.test.ts` for public re-export coverage
52
106
 
53
- For workspaces, prefer the project convention, for example:
107
+ ## Quality Gate
54
108
 
55
- ```bash
56
- yarn workspace <package-name> test
57
- ```
109
+ Before finishing package work, keep the package surface synchronized and run focused validation.
110
+
111
+ Required sync checks:
58
112
 
59
- For Jest-based packages, focused validation may look like:
113
+ - implementation matches public types
114
+ - public exports are updated
115
+ - public-surface tests are updated when exports change
116
+ - unit tests cover new or changed behavior
117
+ - `README.md` matches the actual API and examples
118
+ - `doc.mdx` exists and points at the correct README/title for ordinary packages
119
+ - JSDoc is updated for public API changes that need explanation
120
+ - source manifests stay minimal and accurate
121
+ - `.js` relative specifiers are used where required
122
+ - no unrelated refactors, formatting churn, or generated artifacts are included
123
+
124
+ Preferred validation commands:
60
125
 
61
126
  ```bash
62
- yarn jest packages/<package> --runInBand --coverage=false
127
+ yarn tsc --pretty false
128
+ yarn eslint <changed files or package>
129
+ yarn prettier --check <changed files or package>
130
+ yarn jest <changed tests or package> --runInBand --coverage=false
63
131
  ```
64
132
 
65
- ## Documentation
133
+ Also run `yarn build:dist` for package export, manifest, build-shape, or generated-dist behavior changes. After larger package or library changes, prefer building the affected library/package as an additional confidence check.
134
+
135
+ If a required validation command cannot be run, state why and report the remaining risk.
66
136
 
67
- - Keep `README.md` concise and usage-oriented.
68
- - Start package READMEs with `# <package>`.
69
- - Document real public exports, supported options, and examples that actually work.
70
- - Update docs when public behavior changes.
71
- - Keep generated docs wrappers, such as `doc.mdx`, aligned with the README when the project uses them.
72
- - For component packages, include visual documentation or stories for supported states and common usage.
137
+ ## New Package Checklist
73
138
 
74
- ## Components
139
+ When creating a new workspace package `@vyriy/<package>`:
75
140
 
76
- - Prefer lightweight React components with TypeScript when working in React packages.
77
- - Keep components SSR-friendly and avoid browser globals during render.
78
- - Prefer composable props and predictable ergonomics.
79
- - Put each public component in its own file with a matching test.
80
- - Add stories or examples when a component has visual states, variants, or interaction states.
81
- - Keep styling explicit and reusable. Avoid hidden theme assumptions unless they are part of the package contract.
141
+ 1. Create `packages/<package>`.
142
+ 2. Mirror `packages/pause` unless the package purpose clearly requires a different shape.
143
+ 3. Replace `pause` references with the new package name, exported symbols, types, metadata, paths, README, and docs title.
144
+ 4. Keep implementation, public types, tests, README, `doc.mdx`, public exports, and manifest in sync from the first change.
145
+ 5. Keep `.js` relative import/export specifiers.
146
+ 6. Add a real test immediately, or a valid placeholder test with a clear public API expectation when behavior is not finalized.
147
+ 7. Keep source `package.json` minimal and let `build:dist` generate publish metadata.
148
+ 8. Run relevant type, lint, format, test, and build checks.
82
149
 
83
150
  ## Change Discipline
84
151
 
85
- - Keep changes scoped to the requested behavior.
86
- - Avoid unrelated refactors and metadata churn.
87
- - Sync implementation, tests, docs, examples, and public re-exports together.
88
- - Do not introduce new dependencies unless they clearly reduce complexity or are already part of the project direction.
152
+ - Keep changes scoped to the requested package behavior.
89
153
  - Prefer small, reviewable changes over broad rewrites.
90
- - Preserve existing conventions unless there is a clear reason to change them.
91
-
92
- ## Before Finishing
93
-
94
- Check that the change is complete:
95
-
96
- - Public exports are updated.
97
- - Public-surface tests are updated when exports change.
98
- - Matching unit tests exist for new behavior.
99
- - README examples still match the real API.
100
- - Visual docs, stories, or examples are updated for visible component behavior.
101
- - TypeScript imports follow the package module style.
102
- - No unrelated files, formatting churn, or generated artifacts were changed.
154
+ - Split multi-responsibility files into cohesive modules when it makes behavior easier to understand, test, or reuse.
155
+ - Avoid abstraction for its own sake.
156
+ - Do not introduce new dependencies unless they clearly reduce complexity or are already part of the project direction.
157
+ - Preserve existing package conventions unless there is a clear reason to change them.
158
+ - Never leave package docs, tests, exports, or public types behind the implementation.
159
+ - When you learn something package-relevant while working, update the nearest durable guide or docs so future package work starts from that knowledge.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/ssg",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "description": "Static Markdown site generator for Vyriy projects.",
5
5
  "homepage": "https://vyriy.dev/docs/ssg/",
6
6
  "type": "module",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@types/react": "^19.2.17",
13
- "@vyriy/render": "0.8.7",
13
+ "@vyriy/render": "0.8.9",
14
14
  "minisearch": "^7.2.0",
15
15
  "react": "^19.2.7",
16
16
  "react-markdown": "^10.1.0",