Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- This package can now be used in ESM environments as well as CommonJS ([#469](https://github.com/MetaMask/smart-transactions-controller/pull/469))

### Changed

- **BREAKING:** Disallow subpath exports ([#469](https://github.com/MetaMask/smart-transactions-controller/pull/469))

## [18.1.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
coverageReporters: ['text', 'html'],
coverageThreshold: {
global: {
branches: 75.52,
branches: 74.65,
functions: 92.5,
lines: 92.52,
statements: 92.51,
Expand Down
29 changes: 22 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,35 @@
"url": "https://github.com/MetaMask/smart-transactions-controller.git"
},
"license": "SEE LICENSE IN LICENSE",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"files": [
"dist/"
"dist"
],
"scripts": {
"build": "tsc --project tsconfig.build.json",
"build:clean": "rm -rf dist && yarn build",
"build:link": "yarn build && cd dist && yarn link && rm -rf node_modules && cd ..",
"build": "ts-bridge --project tsconfig.build.json --clean",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog",
"lint:changelog": "auto-changelog validate --prettier",
"lint:eslint": "eslint . --cache --ext js,ts",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog",
"lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
"prepack": "./scripts/prepack.sh",
"test": "jest",
"test": "jest && attw --pack",
"test:watch": "jest --watchAll"
},
"dependencies": {
Expand All @@ -42,6 +55,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.1.0",
Expand All @@ -53,6 +67,7 @@
"@metamask/json-rpc-engine": "^10.0.1",
"@metamask/network-controller": "^24.0.0",
"@metamask/transaction-controller": "^42.0.0",
"@ts-bridge/cli": "^0.6.3",
"@types/jest": "^26.0.24",
"@types/lodash": "^4.14.194",
"@types/node": "^18.19.17",
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if [[ -n $SKIP_PREPACK ]]; then
exit 0
fi

yarn build:clean
yarn build
2 changes: 2 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"inlineSources": true,
"noEmit": false,
"outDir": "dist",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "CommonJS",
"moduleResolution": "node",
"noEmit": true,
"noErrorTruncation": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
Expand Down
Loading
Loading