Repository navigation
Commit 6aa3aa3
authored
build: publish the attw CLI as a self-contained binary (#10)
* build: bundle the attw CLI into a self-contained bin-only package
The published CLI declared five runtime dependencies and externalized them, so
installing it pulled the analyzer, effect, and a compiler into the consumer's
tree, and the analyzer ran whatever TypeScript the host hoisted.
Inline every dependency into the single dist/main.mjs entry, drop the library
entry for AttwHandler that nothing outside the package imports, and move the
former runtime dependencies to devDependencies. deps.onlyImport fails the build
if a bare import survives, so the manifest cannot drift from the bundle; the
inlined TypeScript is the analyzer's own pinned 6.0.3.
The published manifest now exposes only bin. Verified by packing, installing the
tarball in an empty project (npm adds exactly one package, then the bin link
resolves), and running attw --pack on an ESM-only fixture from the installed
binary
* build: stop building the CLI bundle during install
`prepare` ran tsdown on every `pnpm install`, before any package was built. The
bundle inlines the analyzer, so on a fresh clone the analyzer's dist/ did not
exist yet, rolldown left it external, and the onlyImport gate failed the install
with "@systemfsoftware/arethetypeswrong is imported in main.mjs but is not
included in deps.onlyImport option" — the Commitlint workflow's
`pnpm install --frozen-lockfile` broke on it.
turbo already orders this: every task that needs dist depends on `^build`, so
`pnpm build` builds the analyzer before the CLI. Install no longer builds, and
the bundle is produced by the task graph that knows the order
* docs: remove the install note added to the CLI README
The note was added alongside the bundling change without being part of it. The
package page describes what the CLI does; what changed about its packaging
belongs to the release note1 parent 05349db commit 6aa3aa3
4 files changed
Lines changed: 27 additions & 31 deletions
File tree
- .changeset
- packages/arethetypeswrong-cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 37 | | |
44 | 38 | | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
52 | 48 | | |
| 49 | + | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
8 | 5 | | |
9 | 6 | | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
21 | 16 | | |
22 | 17 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments