Skip to content

Commit 380065e

Browse files
committed
composition
1 parent f054bc4 commit 380065e

23 files changed

+3498
-650
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ node_modules
55
.env
66
.env.*
77
dist
8+
debug-*.ts
9+
test-*.ts

AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
- Install packages via pnpm rather than editing package.json directly
44
- Bias towards making new test files that are roughly logically grouped rather than letting test files gets too large. Try to stay below 300 lines. Prefer making a new file when you want to add a `describe()`
55
- Prefer asserting the full STDOUT/STDERR output rather than using to.contain or to.not.contain
6-
- Always also add `comparison-tests` for major command functionality, but edge cases should always be covered in unit tests which are mush faster
6+
- Always also add `comparison-tests` for major command functionality, but edge cases should always be covered in unit tests which are mush faster (`pnpm test:comparison`)
77
- When you are unsure about bash/command behavior, create a `comparison-tests` test file to ensure compat.
88
- `--help` does not need to pass comparison tests and should reflect actual capability
99
- Commands must handle unknown arguments correctly
1010
- Always ensure all tests pass in the end and there are no compile and lint errors
1111
- Use `pnpm lint:fix`
12+
- Strongly prefer running a temporary comparison test or unit test over an ad-hoc script to figure out the behavior of some bash script or API.
13+
- The implementation should align with the real behavior of bash, not what is convenient for TS or TE tests.
14+
- Don't use `cat > test-direct.ts << 'SCRIPT'` style test scripts because they constantly require 1-off approval. Instead make comparison-tests and see what they output. event console.log is there is you remove later.
15+
- using `npx tsx -e '…` is another good option for adhoc testing.
16+
- Always make sure to build before using dist

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Always start by reading AGENTS.md

PROJECT.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,19 @@ xargs — build argument lists
198198
- Command should be eagerly registered
199199
- But their implementations should only be loaded when they are actually called
200200
- Make sure that files support Buffers and encoding
201+
202+
## All before this is done
203+
204+
Woohoo
205+
206+
## Implementation phase 13
207+
208+
- Block `return await` with biome
209+
- Do we handle stop of execution in multi-line script for non-zero return values?
210+
211+
## Implementation phase 14
212+
213+
- Should the parser be rewritten to use an official AST? Could we parse with an official bash grammar?
214+
- Search the web for official grammars and use an existing npm package for parsing the grammer and the input
215+
- Further extend composition tests
216+
- Start by writing `real-parser.md` and then confirm further work.

0 commit comments

Comments
 (0)