Skip to content

Commit

Permalink
Support for both CJS and ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
komiya-atsushi committed Oct 17, 2024
1 parent 8c5f1e2 commit 99c9806
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
dist/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
dist/
node_modules/
coverage/
.idea/
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
"test": "npm run test:jest && npm run test:attw",
"lint": "gts lint",
"clean": "gts clean",
"compile": "tsc",
"fix": "gts fix",
"pretest": "npm run compile",
"pretest:attw": "npm --workspaces --if-present run compile",
"pretest:jest": "npm --workspaces --if-present run compile",
"pretest:attw": "npm --workspaces --if-present run build",
"posttest": "npm run lint"
},
"keywords": [],
Expand Down
24 changes: 19 additions & 5 deletions packages/bolt-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,31 @@
"slack",
"dynamodb"
],
"main": "build/src/index.js",
"engines": {
"node": ">=18"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"files": [
"build/src/**/*.{js,d.ts}"
"dist/*.*"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
"compile": "tsc",
"test:attw": "attw --pack ."
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.621.0",
"@slack/logger": "^4.0.0",
Expand Down
24 changes: 19 additions & 5 deletions packages/bolt-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,34 @@
"slack",
"s3"
],
"main": "build/src/index.js",
"engines": {
"node": ">=18"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}
},
"files": [
"build/src/**/*.{js,d.ts}"
"dist/*.*"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
"compile": "tsc",
"test:attw": "attw --pack ."
},
"dependencies": {
"@aws-sdk/client-s3": "^3.621.0",
"@slack/logger": "^4.0.0",
"@slack/oauth": "^2.6.1"
},
"engines": {
"node": ">=18"
}
}

0 comments on commit 99c9806

Please sign in to comment.