@vyriy/timeout 0.3.2 → 0.3.4
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/AGENTS.md +59 -22
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -1,41 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Project Agent Guide
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This repository follows a calm engineering style: changes should be explicit, reusable, typed, documented, tested, and easy to reason about.
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Core Principles
|
|
6
8
|
|
|
7
9
|
- Prefer simple modules over clever frameworks or hidden conventions.
|
|
8
|
-
- Keep package
|
|
10
|
+
- Keep package and project boundaries explicit.
|
|
11
|
+
- Avoid project-specific coupling in reusable code.
|
|
9
12
|
- Extract only proven reusable behavior.
|
|
10
13
|
- Keep public APIs small, typed, documented, and stable.
|
|
11
|
-
- Prefer SSR-friendly and SSG-friendly code paths.
|
|
12
|
-
- Keep integrations replaceable and avoid hard coupling to a CMS or runtime host.
|
|
13
|
-
- Prefer
|
|
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.
|
|
17
|
+
- Prefer the option that is simpler to explain, easier to evolve, and calmer to maintain.
|
|
14
18
|
|
|
15
19
|
## File Shape
|
|
16
20
|
|
|
17
|
-
- Prefer one exported runtime method, component, or
|
|
21
|
+
- Prefer one exported runtime method, component, helper, or class per production file when it stays readable.
|
|
18
22
|
- Prefer one matching test file per production file, for example `feature.ts` and `feature.test.ts`.
|
|
19
23
|
- Use focused folders when behavior naturally splits into several related files.
|
|
20
24
|
- Keep `index.ts` as a public re-export surface only. Do not place implementation logic in it.
|
|
21
|
-
- Use
|
|
25
|
+
- Use relative import and export specifiers that match the package module style.
|
|
26
|
+
- Use `.js` relative specifiers in TypeScript source for ESM/NodeNext packages.
|
|
22
27
|
- Add `types.ts` when public shared types are part of the package contract.
|
|
23
28
|
- Keep constants near the code that owns them unless they are shared or clarify repeated behavior.
|
|
24
29
|
|
|
25
30
|
## Public Surface
|
|
26
31
|
|
|
27
|
-
- Every new public export
|
|
28
|
-
- Add or update
|
|
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.
|
|
29
34
|
- Add JSDoc for public exports when behavior, parameters, return values, or usage expectations need explanation.
|
|
30
|
-
-
|
|
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.
|
|
31
37
|
|
|
32
38
|
## Tests
|
|
33
39
|
|
|
34
|
-
- Tests use Jest and `@jest/globals`.
|
|
35
40
|
- Cover public behavior and meaningful edge cases.
|
|
36
41
|
- 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.
|
|
37
44
|
- When mocking modules, install mocks before loading the module under test.
|
|
38
|
-
- Use focused validation when changing
|
|
45
|
+
- Use focused validation when changing behavior.
|
|
46
|
+
|
|
47
|
+
Example validation commands:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
yarn test
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For workspaces, prefer the project convention, for example:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
yarn workspace <package-name> test
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For Jest-based packages, focused validation may look like:
|
|
39
60
|
|
|
40
61
|
```bash
|
|
41
62
|
yarn jest packages/<package> --runInBand --coverage=false
|
|
@@ -44,22 +65,38 @@ yarn jest packages/<package> --runInBand --coverage=false
|
|
|
44
65
|
## Documentation
|
|
45
66
|
|
|
46
67
|
- Keep `README.md` concise and usage-oriented.
|
|
47
|
-
- Start package READMEs with `#
|
|
68
|
+
- Start package READMEs with `# <package>`.
|
|
48
69
|
- Document real public exports, supported options, and examples that actually work.
|
|
49
|
-
-
|
|
50
|
-
-
|
|
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.
|
|
51
73
|
|
|
52
74
|
## Components
|
|
53
75
|
|
|
54
|
-
- Prefer lightweight React
|
|
76
|
+
- Prefer lightweight React components with TypeScript when working in React packages.
|
|
55
77
|
- Keep components SSR-friendly and avoid browser globals during render.
|
|
56
|
-
- Prefer composable props and
|
|
78
|
+
- Prefer composable props and predictable ergonomics.
|
|
57
79
|
- Put each public component in its own file with a matching test.
|
|
58
|
-
- Add
|
|
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.
|
|
59
82
|
|
|
60
83
|
## Change Discipline
|
|
61
84
|
|
|
62
85
|
- Keep changes scoped to the requested behavior.
|
|
63
86
|
- Avoid unrelated refactors and metadata churn.
|
|
64
|
-
- Sync implementation, tests,
|
|
65
|
-
-
|
|
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.
|
|
89
|
+
- 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.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/timeout",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Timeout utility for Vyriy projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@vyriy/pause": "0.3.
|
|
8
|
+
"@vyriy/pause": "0.3.4"
|
|
9
9
|
},
|
|
10
10
|
"agents": "./AGENTS.md",
|
|
11
11
|
"license": "MIT",
|