|
11 | 11 | "url": "https://github.com/MetaMask/utils.git" |
12 | 12 | }, |
13 | 13 | "license": "ISC", |
14 | | - "main": "./dist/index.js", |
15 | | - "types": "./dist/index.d.ts", |
| 14 | + "main": "./dist/cjs/index.js", |
| 15 | + "module": "./dist/esm/index.js", |
| 16 | + "types": "./dist/types/index.d.ts", |
16 | 17 | "files": [ |
17 | | - "dist/" |
| 18 | + "dist/cjs/**", |
| 19 | + "dist/esm/**", |
| 20 | + "dist/types/**" |
18 | 21 | ], |
19 | 22 | "scripts": { |
20 | | - "build": "tsc --project tsconfig.build.json", |
| 23 | + "build": "yarn build:source && yarn build:types", |
| 24 | + "build:cjs": "swc src --out-dir dist/cjs --config-file .swcrc.build.json --config module.type=commonjs", |
21 | 25 | "build:clean": "rimraf dist && yarn build", |
22 | 26 | "build:docs": "typedoc", |
23 | | - "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog && yarn lint:constraints", |
| 27 | + "build:esm": "swc src --out-dir dist/esm --config-file .swcrc.build.json --config module.type=es6", |
| 28 | + "build:source": "yarn build:esm && yarn build:cjs", |
| 29 | + "build:types": "tsc --project tsconfig.build.json", |
| 30 | + "lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog", |
24 | 31 | "lint:changelog": "auto-changelog validate", |
25 | 32 | "lint:constraints": "yarn constraints", |
26 | 33 | "lint:dependencies": "depcheck && yarn dedupe", |
27 | 34 | "lint:eslint": "eslint . --cache --ext js,ts", |
28 | | - "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog && yarn lint:constraints --fix", |
| 35 | + "lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog", |
29 | 36 | "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", |
30 | 37 | "prepack": "./scripts/prepack.sh", |
31 | 38 | "test": "yarn test:source && yarn test:types", |
|
45 | 52 | "superstruct": "^1.0.3" |
46 | 53 | }, |
47 | 54 | "devDependencies": { |
48 | | - "@lavamoat/allow-scripts": "^2.0.3", |
| 55 | + "@lavamoat/allow-scripts": "^2.3.1", |
49 | 56 | "@lavamoat/preinstall-always-fail": "^1.0.0", |
50 | 57 | "@metamask/auto-changelog": "^3.1.0", |
51 | 58 | "@metamask/eslint-config": "^11.0.1", |
52 | 59 | "@metamask/eslint-config-jest": "^11.0.0", |
53 | 60 | "@metamask/eslint-config-nodejs": "^11.0.1", |
54 | 61 | "@metamask/eslint-config-typescript": "^11.0.0", |
| 62 | + "@swc/cli": "^0.1.62", |
| 63 | + "@swc/core": "^1.3.66", |
55 | 64 | "@types/jest": "^28.1.7", |
56 | 65 | "@types/node": "^17.0.23", |
57 | 66 | "@typescript-eslint/eslint-plugin": "^5.43.0", |
|
86 | 95 | }, |
87 | 96 | "lavamoat": { |
88 | 97 | "allowScripts": { |
89 | | - "@lavamoat/preinstall-always-fail": false |
| 98 | + "@lavamoat/preinstall-always-fail": false, |
| 99 | + "@swc/core": true |
90 | 100 | } |
91 | 101 | }, |
92 | 102 | "tsd": { |
|
0 commit comments