You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+16-27Lines changed: 16 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,32 +16,25 @@ The generator does not auto-discover templates. Every output file must have an e
16
16
17
17
| Parent | Children affected |
18
18
|--------|------------------|
19
-
|`Node`|`CLI`, `ReactNative`|
19
+
|`Node`|`ReactNative`|
20
20
|`Dart`|`Flutter`|
21
21
|`Swift`|`Apple`|
22
22
|`Kotlin`|`Android`|
23
-
|`Go`|`GoCLI`|
23
+
|`Go`|`CLI`|
24
24
25
25
Modifying a parent's template or `getFiles()` affects all children. Regenerate and verify child SDKs too.
26
26
27
-
**Two couplings are not visible in the hierarchy.**
27
+
**One coupling is not visible in the hierarchy.**
28
28
29
-
`Concern/CliCommandSurface.php` is a trait used by **both**`CLI`and `GoCLI`. It holds
30
-
the nine helpers that decide what a generated command looks like — flag syntax, query
31
-
flags, promoted root commands, service scopes. It is shared precisely so the two CLIs
32
-
cannot drift, which means a change there alters the TypeScript CLI and the Go CLI at once.
29
+
`templates/cli/install.sh.twig`and `templates/cli/install.ps1.twig` build every download
30
+
URL from `language.params.npmPackage`. The same parameter names release assets produced
31
+
by `.goreleaser.yaml` and consumed by the Scoop manifest and npm platform packages.
32
+
Change the asset naming in one place and all four must move together.
33
33
34
-
`templates/cli/install.sh.twig` and `templates/cli/install.ps1.twig` live under
35
-
`templates/cli/` but are registered in **both**`CLI::getFiles()` and `GoCLI::getFiles()`.
36
-
They build every download URL from `language.params.npmPackage`, which also names every
37
-
release asset produced by `.goreleaser.yaml` and consumed by the scoop manifest and the
38
-
npm platform packages. Change the asset naming in one place and all four must move
39
-
together, for both CLIs.
40
-
41
-
Either way, regenerate both:
34
+
Regenerate the CLI after changing any of them:
42
35
43
36
```bash
44
-
php example.php cli&& php example.php go-cli
37
+
php example.php cli
45
38
```
46
39
47
40
### Rule 4: `copy` scope = no Twig processing
@@ -57,14 +50,13 @@ The `destination` string in each `getFiles()` entry supports Twig expressions an
57
50
58
51
### Rule 6: Never modify lock file templates directly
59
52
60
-
Lock file templates (`package-lock.json.twig`, `bun.lock.twig`) contain Twig expressions that get corrupted if you copy a raw lock file over them. Always use the update script:
53
+
Lock file templates (`package-lock.json.twig`) contain Twig expressions that get corrupted if you copy a raw lock file over them. Always use the update script:
61
54
62
55
```bash
63
-
./scripts/update-lockfiles.sh cli # update CLI lock files only
64
-
./scripts/update-lockfiles.sh all # update all TS-based SDK lock files
56
+
./scripts/update-lockfiles.sh all
65
57
```
66
58
67
-
The script strips Twig expressions before running `npm install`/`bun install`, then restores them automatically. Never run `cp package-lock.json package-lock.json.twig`or edit these files by hand.
59
+
The script strips Twig expressions before running `npm install`, then restores them automatically. Never copy a raw lock file over a lock template or edit one by hand.
0 commit comments