Skip to content

Commit 1aa5b2d

Browse files
authoredDec 10, 2021
feat: added types (#650)
1 parent f8aad69 commit 1aa5b2d

13 files changed

+1174
-501
lines changed
 

‎lint-staged.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
"*": ["prettier --write --ignore-unknown"],
3-
"*.{js,ts}": ["eslint --cache --fix"],
3+
"*.{js}": ["eslint --cache --fix"],
44
};

‎package-lock.json

+47-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@
1212
"url": "https://opencollective.com/webpack"
1313
},
1414
"main": "dist/cjs.js",
15+
"types": "types/cjs.d.ts",
1516
"engines": {
1617
"node": ">= 12.20.0"
1718
},
1819
"scripts": {
1920
"start": "npm run build -- -w",
2021
"clean": "del-cli dist",
2122
"prebuild": "npm run clean",
22-
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
23+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write && prettier types --write",
24+
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
25+
"build": "npm-run-all -p \"build:**\"",
2326
"commitlint": "commitlint --from=master",
2427
"security": "npm audit --production",
2528
"lint:prettier": "prettier --list-different .",
2629
"lint:js": "eslint --cache .",
30+
"lint:types": "tsc --pretty --noEmit",
2731
"lint": "npm-run-all -l -p \"lint:**\"",
2832
"test:only": "cross-env NODE_ENV=test jest",
2933
"test:watch": "npm run test:only -- --watch",
@@ -54,6 +58,9 @@
5458
"@babel/preset-env": "^7.15.0",
5559
"@commitlint/cli": "^15.0.0",
5660
"@commitlint/config-conventional": "^15.0.0",
61+
"@types/glob-parent": "^5.1.1",
62+
"@types/normalize-path": "^3.0.0",
63+
"@types/serialize-javascript": "^5.0.1",
5764
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
5865
"babel-jest": "^27.0.6",
5966
"cross-env": "^7.0.3",
@@ -72,6 +79,7 @@
7279
"npm-run-all": "^4.1.5",
7380
"prettier": "^2.3.2",
7481
"standard-version": "^9.3.1",
82+
"typescript": "^4.5.2",
7583
"webpack": "^5.64.1"
7684
},
7785
"keywords": [

0 commit comments

Comments
 (0)
Please sign in to comment.