Skip to content

Commit 2978336

Browse files
committed
fix: switch to tshy for dual ESM/CJS builds
attw now passes all green: node10, node16 CJS, node16 ESM, bundler.
1 parent 88fe868 commit 2978336

4 files changed

Lines changed: 272 additions & 19 deletions

File tree

.changeset/fix-cjs-exports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"agentcrumbs": patch
33
---
44

5-
Add typesVersions for node10 resolution of subpath exports
5+
Switch to tshy for dual ESM/CJS builds, remove unused ./test subpath export

packages/agentcrumbs/package.json

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +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-
"types": "./dist/index.d.ts",
11-
"import": "./dist/index.js"
12-
}
5+
"tshy": {
6+
"exports": {
7+
".": "./src/index.ts"
8+
},
9+
"exclude": [
10+
"src/__tests__/**/*"
11+
]
1312
},
1413
"bin": {
15-
"agentcrumbs": "./dist/cli/index.js",
14+
"agentcrumbs": "./dist/esm/cli/index.js",
1615
"intent": "./bin/intent.js"
1716
},
1817
"files": [
@@ -36,14 +35,15 @@
3635
"docs": "https://agentcrumbs.dev/docs"
3736
},
3837
"scripts": {
39-
"build": "tsc",
40-
"dev": "tsc --watch",
38+
"build": "tshy",
39+
"dev": "tshy --watch",
4140
"test": "vitest",
4241
"typecheck": "tsc --noEmit",
4342
"prepublishOnly": "npx @tanstack/intent@latest validate"
4443
},
4544
"devDependencies": {
4645
"@types/node": "^25.3.3",
46+
"tshy": "^3.3.2",
4747
"typescript": "^5.7.0",
4848
"vitest": "^3.0.0"
4949
},
@@ -61,5 +61,21 @@
6161
"claude",
6262
"cursor",
6363
"copilot"
64-
]
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"
6581
}

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)