Skip to content

Commit 2f2d4af

Browse files
authored
fix: clean up package exports (#15)
## Summary - Remove unused `./test` subpath export (`MemorySink` is already exported from the main entry) - Move `types` condition before `import` in exports (required for proper resolution) - attw passes: all green except expected CJS warning for ESM-only package ## Test plan - [ ] `npx @arethetypeswrong/cli --pack` shows no `💀` errors - [ ] `import { trail, MemorySink } from "agentcrumbs"` works
2 parents dd32947 + 2978336 commit 2f2d4af

File tree

4 files changed

+275
-21
lines changed

4 files changed

+275
-21
lines changed

.changeset/fix-cjs-exports.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"agentcrumbs": patch
3+
---
4+
5+
Switch to tshy for dual ESM/CJS builds, remove unused ./test subpath export

packages/agentcrumbs/package.json

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22
"name": "agentcrumbs",
33
"version": "0.3.1",
44
"description": "Debug mode for any agent.",
5-
"type": "module",
6-
"main": "./dist/index.js",
7-
"types": "./dist/index.d.ts",
8-
"exports": {
9-
".": {
10-
"import": "./dist/index.js",
11-
"types": "./dist/index.d.ts"
5+
"tshy": {
6+
"exports": {
7+
".": "./src/index.ts"
128
},
13-
"./test": {
14-
"import": "./dist/sinks/memory.js",
15-
"types": "./dist/sinks/memory.d.ts"
16-
}
9+
"exclude": [
10+
"src/__tests__/**/*"
11+
]
1712
},
1813
"bin": {
19-
"agentcrumbs": "./dist/cli/index.js",
14+
"agentcrumbs": "./dist/esm/cli/index.js",
2015
"intent": "./bin/intent.js"
2116
},
2217
"files": [
@@ -40,14 +35,15 @@
4035
"docs": "https://agentcrumbs.dev/docs"
4136
},
4237
"scripts": {
43-
"build": "tsc",
44-
"dev": "tsc --watch",
38+
"build": "tshy",
39+
"dev": "tshy --watch",
4540
"test": "vitest",
4641
"typecheck": "tsc --noEmit",
4742
"prepublishOnly": "npx @tanstack/intent@latest validate"
4843
},
4944
"devDependencies": {
5045
"@types/node": "^25.3.3",
46+
"tshy": "^3.3.2",
5147
"typescript": "^5.7.0",
5248
"vitest": "^3.0.0"
5349
},
@@ -65,5 +61,21 @@
6561
"claude",
6662
"cursor",
6763
"copilot"
68-
]
64+
],
65+
"type": "module",
66+
"exports": {
67+
".": {
68+
"import": {
69+
"types": "./dist/esm/index.d.ts",
70+
"default": "./dist/esm/index.js"
71+
},
72+
"require": {
73+
"types": "./dist/commonjs/index.d.ts",
74+
"default": "./dist/commonjs/index.js"
75+
}
76+
}
77+
},
78+
"main": "./dist/commonjs/index.js",
79+
"types": "./dist/commonjs/index.d.ts",
80+
"module": "./dist/esm/index.js"
6981
}

packages/agentcrumbs/tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
22
"compilerOptions": {
33
"target": "ES2022",
4-
"module": "Node16",
5-
"moduleResolution": "Node16",
64
"strict": true,
7-
"outDir": "./dist",
8-
"rootDir": "./src",
95
"declaration": true,
106
"declarationMap": true,
117
"sourceMap": true,
128
"esModuleInterop": true,
139
"skipLibCheck": true,
1410
"forceConsistentCasingInFileNames": true
1511
},
16-
"include": ["src/**/*"],
17-
"exclude": ["src/__tests__/**/*", "node_modules", "dist"]
12+
"exclude": ["src/__tests__/**/*"]
1813
}

0 commit comments

Comments
 (0)