Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Add ESM as additional build target to support tree shaking (#49)
Browse files Browse the repository at this point in the history
In preparation of releasing
Concordium/concordium-node-sdk-js#266, we need
to also update the libraries included in this repo to be tree-shakable.

## Changes

- Added exports field to package.json
- Add ESM build target, and resolve to ES module by default

## Checklist

- [x] My code follows the style of this project.
- [x] The code compiles without warnings.
- [x] I have performed a self-review of the changes.
- [x] I have documented my code, in particular the intent of the
      hard-to-understand areas.
- [x] (If necessary) I have updated the CHANGELOG.
  • Loading branch information
soerenbf authored Sep 20, 2023
1 parent b5e48e8 commit ddf82b9
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"eslint": "latest",
"husky": "^8.0.0",
"lint-staged": "^13.1.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Build as ES module to facilitate tree-shaking.

## [0.3.0] - 2023-06-04

### Added
Expand Down
8 changes: 7 additions & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"license": "Apache-2.0",
"browser": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"./dist"
],
Expand All @@ -27,7 +33,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18",
"prettier": "2.8.1",
"typescript": "^4.9.4"
"typescript": "^5.2.2"
},
"peerDependencies": {
"react": "^18"
Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"module": "ES2020",
"moduleResolution": "bundler",
"sourceMap": true,
"outDir": "./dist"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/wallet-connectors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Build as ES module to facilitate tree-shaking.

## [0.3.2] - 2023-08-17

### Changed
Expand Down
8 changes: 7 additions & 1 deletion packages/wallet-connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"license": "Apache-2.0",
"browser": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"./dist"
],
Expand All @@ -28,6 +34,6 @@
"@tsconfig/recommended": "^1.0.1",
"@walletconnect/types": "^2.1.4",
"prettier": "2.8.1",
"typescript": "^4.9.4"
"typescript": "^5.2.2"
}
}
2 changes: 2 additions & 0 deletions packages/wallet-connectors/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"module": "ES2020",
"moduleResolution": "bundler",
"sourceMap": true,
"outDir": "./dist"
},
Expand Down
2 changes: 1 addition & 1 deletion samples/contractupdate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/react-dom": "^18.0.0",
"prettier": "2.8.1",
"react-scripts": "5.0.1",
"typescript": "^4.4.2"
"typescript": "^5.2.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion samples/sign-message/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"react-bootstrap": "^2.7.2",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.9.5"
"typescript": "^5.2.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
Loading

0 comments on commit ddf82b9

Please sign in to comment.