Skip to content

Commit

Permalink
add esnext and esm build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbach committed Apr 5, 2022
1 parent 50438e0 commit ba8485a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
yarn
npx lerna bootstrap
yarn build
yarn build:all-targets
yarn build:storybook
yarn build:docs
mv ./packages/stories/storybook-static/index.html ./packages/stories/storybook-static/index.htm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
npx lerna bootstrap
- name: Build
run: |
yarn build
yarn build:all-targets
yarn build:storybook
yarn build:docs
- name: Lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/packages/*/out
/packages/*/lib
.idea
node_modules
storybook-static
Expand Down
3 changes: 2 additions & 1 deletion config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"jsx": "react",
"declaration": true,
"module": "CommonJS",
"skipLibCheck": true
"skipLibCheck": true,
"moduleResolution": "Node"
},
"exclude": ["node_modules", "../**/*.spec.ts", "../**/*.spec.tsx"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"storybook": "lerna run storybook --parallel --npm-client=yarn",
"build:storybook": "lerna run build:storybook --parallel --npm-client=yarn",
"build": "lerna run build --npm-client=yarn",
"build:all-targets": "lerna run build:all --npm-client=yarn",
"test": "lerna run test --npm-client=yarn --stream",
"prettier:check": "prettier --check .",
"prettier:write": "prettier --write .",
Expand Down
20 changes: 14 additions & 6 deletions packages/synergies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@
"author": "Lukas Bach",
"license": "MIT",
"private": false,
"main": "out/index.js",
"typings": "out/index.d.ts",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"esnext": "lib/esnext/index.js",
"typings": "lib/esm/index.d.ts",
"scripts": {
"start": "tsc -w",
"build": "tsc",
"test": "jest --passWithNoTests",
"prepublish": "tsc && jest && cpy \"../../README.md\" ."
"build:all": "run-p \"build:cjs\" \"build:esm\" \"build:esnext\" \"build:types\"",
"build:cjs": "tsc -m commonjs --outDir lib/cjs",
"build:types": "tsc --declaration true --emitDeclarationOnly --outDir lib/types",
"build:esm": "tsc -m es2015 --outDir lib/esm",
"build:esnext": "tsc -m esnext --outDir lib/esnext",
"start": "tsc -w",
"test": "jest",
"prepublish": "yarn build:all && yarn test && cpy \"../../README.md\" ."
},
"devDependencies": {
"@babel/preset-env": "^7.12.11",
Expand All @@ -34,7 +41,8 @@
"jest": "^26.6.3",
"react-test-renderer": "^17.0.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.2"
"typescript": "^4.1.2",
"npm-run-all": "^4.1.5"
},
"peerDependencies": {
"immer": "*",
Expand Down
5 changes: 3 additions & 2 deletions packages/synergies/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../config/tsconfig.json",
"include": ["src"],
"compilerOptions": {
"outDir": "out",
"esModuleInterop": true
"outDir": "lib/cjs",
"esModuleInterop": true,
"declaration": false
}
}
29 changes: 27 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8056,7 +8056,7 @@ cross-fetch@^3.1.5:
dependencies:
node-fetch "2.6.7"

cross-spawn@^6.0.0:
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
Expand Down Expand Up @@ -13080,6 +13080,11 @@ memory-fs@^0.5.0:
errno "^0.1.3"
readable-stream "^2.0.1"

memorystream@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI=

meow@^10.1.1:
version "10.1.2"
resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.2.tgz#62951cb69afa69594142c8250806bc30a3912e4d"
Expand Down Expand Up @@ -13865,6 +13870,21 @@ npm-pick-manifest@^3.0.0:
npm-package-arg "^6.0.0"
semver "^5.4.1"

npm-run-all@^4.1.5:
version "4.1.5"
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba"
integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==
dependencies:
ansi-styles "^3.2.1"
chalk "^2.4.1"
cross-spawn "^6.0.5"
memorystream "^0.3.1"
minimatch "^3.0.4"
pidtree "^0.3.0"
read-pkg "^3.0.0"
shell-quote "^1.6.1"
string.prototype.padend "^3.0.0"

npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
Expand Down Expand Up @@ -14614,6 +14634,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.0, picomatc
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pidtree@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a"
integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==

pify@^2.0.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
Expand Down Expand Up @@ -16817,7 +16842,7 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shell-quote@^1.7.3:
shell-quote@^1.6.1, shell-quote@^1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123"
integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==
Expand Down

0 comments on commit ba8485a

Please sign in to comment.