Skip to content

Commit 0082e0d

Browse files
committed
chore: refactor package configuration to support dual ESM and CJS builds and update TypeScript compiler options
1 parent c933e07 commit 0082e0d

2 files changed

Lines changed: 72 additions & 53 deletions

File tree

package.json

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
{
2-
"name": "@arcaelas/agent",
3-
"version": "1.19.0",
4-
"description": "A small box of tools, which are implemented in different factions of the library.",
5-
"license": "ISC",
6-
"main": "build/index.js",
72
"author": {
8-
"email": "comunity@arcaelas.com",
3+
"email": "community@arcaelas.com",
94
"name": "Arcaelas Insiders",
105
"url": "https://github.com/arcaelas"
116
},
12-
"repository": {
13-
"type": "git",
14-
"url": "https://github.com/arcaelas/agent.git"
15-
},
167
"bugs": {
178
"email": "community@arcaelas.com",
189
"url": "https://github.com/arcaelas/agent/issues"
1910
},
11+
"dependencies": {
12+
"@anthropic-ai/claude-agent-sdk": "^0.2.71",
13+
"@arcaelas/utils": "^2.0.5",
14+
"zod": "^4.3.6"
15+
},
16+
"description": "A small box of tools, which are implemented in different factions of the library.",
17+
"devDependencies": {
18+
"@eslint/js": "^9.0.0",
19+
"@types/node": "^25.3.5",
20+
"eslint": "^9.0.0",
21+
"prettier": "^3.0.0",
22+
"tsc-alias": "^1.8.16",
23+
"typescript": "^5.0.4",
24+
"typescript-eslint": "^8.0.0"
25+
},
26+
"exports": {
27+
".": {
28+
"import": "./build/esm/index.js",
29+
"require": "./build/cjs/index.js",
30+
"types": "./build/esm/index.d.ts"
31+
}
32+
},
33+
"files": [
34+
"build"
35+
],
2036
"homepage": "https://github.com/arcaelas/agent",
2137
"keywords": [
2238
"agent",
@@ -26,34 +42,27 @@
2642
"arcaelas-insiders",
2743
"javascript"
2844
],
29-
"files": [
30-
"build/"
31-
],
45+
"license": "ISC",
46+
"main": "./build/cjs/index.js",
47+
"module": "./build/esm/index.js",
48+
"name": "@arcaelas/agent",
3249
"publishConfig": {
3350
"access": "public",
3451
"registry": "https://registry.npmjs.org/"
3552
},
53+
"repository": {
54+
"type": "git",
55+
"url": "https://github.com/arcaelas/agent.git"
56+
},
3657
"scripts": {
37-
"build": "tsc && tsc-alias",
58+
"build": "yarn build:esm && yarn build:cjs",
59+
"build:cjs": "tsc --module commonjs --moduleResolution node --outDir build/cjs && tsc-alias --outDir build/cjs && echo '{\"type\":\"commonjs\"}' > build/cjs/package.json",
60+
"build:esm": "tsc --module ESNext --moduleResolution bundler --outDir build/esm && tsc-alias --resolve-full-paths --outDir build/esm && echo '{\"type\":\"module\"}' > build/esm/package.json",
3861
"docs": "mkdocs gh-deploy --force",
39-
"lint:fix": "eslint src/ --fix",
40-
"prepublishOnly": "yarn build && npm version minor",
41-
"postpublish": "rm -rf build/",
4262
"lint": "eslint src/ --fix",
43-
"release": "npm version minor && yarn build && npm publish --access public"
63+
"prepublishOnly": "rm -rf build && npm version minor && yarn build",
64+
"release": "npm publish --access public"
4465
},
45-
"dependencies": {
46-
"@anthropic-ai/claude-agent-sdk": "^0.2.71",
47-
"@arcaelas/utils": "^2.0.5",
48-
"zod": "^4.3.6"
49-
},
50-
"devDependencies": {
51-
"@eslint/js": "^9.0.0",
52-
"@types/node": "^25.3.5",
53-
"eslint": "^9.0.0",
54-
"prettier": "^3.0.0",
55-
"tsc-alias": "^1.8.16",
56-
"typescript": "^5.0.4",
57-
"typescript-eslint": "^8.0.0"
58-
}
59-
}
66+
"types": "./build/esm/index.d.ts",
67+
"version": "1.19.0"
68+
}

tsconfig.json

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
{
2-
"include": ["src"],
32
"compilerOptions": {
4-
"target": "ESNext",
5-
"module": "commonjs",
6-
"moduleResolution": "node",
3+
"allowSyntheticDefaultImports": true,
74
"baseUrl": "./",
8-
"paths": {
9-
"~/*": ["src/*"]
10-
},
11-
"outDir": "./build",
125
"declaration": true,
13-
"sourceMap": true,
6+
"downlevelIteration": true,
7+
"emitDecoratorMetadata": true,
148
"esModuleInterop": true,
15-
"allowSyntheticDefaultImports": true,
9+
"experimentalDecorators": true,
1610
"forceConsistentCasingInFileNames": true,
17-
"strict": true,
11+
"lib": [
12+
"ESNext",
13+
"DOM"
14+
],
15+
"module": "commonjs",
16+
"moduleResolution": "node",
1817
"noImplicitAny": false,
19-
"skipLibCheck": true,
18+
"outDir": "./build",
19+
"paths": {
20+
"~/*": [
21+
"src/*"
22+
]
23+
},
2024
"resolveJsonModule": true,
21-
"experimentalDecorators": true,
22-
"emitDecoratorMetadata": true,
23-
"downlevelIteration": true,
24-
"lib": ["ESNext", "DOM"],
25-
"useDefineForClassFields": false,
26-
"strictPropertyInitialization": false
25+
"skipLibCheck": true,
26+
"sourceMap": true,
27+
"strict": true,
28+
"strictPropertyInitialization": false,
29+
"target": "ESNext",
30+
"useDefineForClassFields": false
2731
},
28-
"exclude": ["node_modules", "build", "src/custom.ts", "src/_index.ts"]
29-
}
32+
"exclude": [
33+
"node_modules",
34+
"build"
35+
],
36+
"include": [
37+
"src"
38+
]
39+
}

0 commit comments

Comments
 (0)