Skip to content

Commit

Permalink
fix: added double build
Browse files Browse the repository at this point in the history
  • Loading branch information
seekayel committed Jun 22, 2023
1 parent 8e9e69a commit 7a5ed5e
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.*
src
commitlint.config.cjs
examples
scripts
src
test
commitlint.config.js
tsconfig.json
tsconfig*.json
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default { transform: {} }
export default { transform: {} };
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"type": "module",
"name": "@cyclic.sh/dynamodb",
"version": "0.0.27",
"description": "SDK for interacting with Cyclic.sh (https://cyclic.sh) app AWS DynamoDB databases",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"types": "./dist/esm/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"scripts": {
"clean": "rm dist/*",
"build": "tsc && cp src/*.js dist/",
"build": "rm -fr dist/* && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && ./scripts/generatePackageJson.sh",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"prepare": "husky install"
},
Expand Down
11 changes: 11 additions & 0 deletions scripts/generatePackageJson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cat >dist/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >dist/esm/package.json <<!EOF
{
"type": "module"
}
!EOF
25 changes: 25 additions & 0 deletions tsconfig-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "src",
"declaration": true,
"esModuleInterop": true,
"inlineSourceMap": false,
"lib": ["esnext"],
"listEmittedFiles": false,
"listFiles": false,
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"pretty": true,
"resolveJsonModule": true,
"rootDir": "src",
"skipLibCheck": true,
"strict": true,
"traceResolution": false,
"types": ["node", "jest"]
},
"compileOnSave": false,
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
8 changes: 8 additions & 0 deletions tsconfig-cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist/cjs",
"target": "es2015"
}
}
8 changes: 8 additions & 0 deletions tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"module": "esnext",
"outDir": "dist/esm",
"target": "esnext"
}
}

0 comments on commit 7a5ed5e

Please sign in to comment.