Skip to content

Commit

Permalink
publish commonjs and esm
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston committed May 27, 2022
1 parent 6bf903c commit ce6874c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
19 changes: 3 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"name": "react-use-error-boundary-development",
"version": "1.0.2",
"description": "A React error boundary hook for function components",
"license": "MIT",
"author": "Tate <tatethurston@gmail.com>",
"homepage": "https://github.com/tatethurston/react-use-error-boundary#readme",
Expand All @@ -13,27 +11,23 @@
"url": "https://github.com/tatethurston/react-use-error-boundary/issues"
},
"scripts": {
"build": "yarn clean && yarn tsc && yarn webpack",
"build:commonjs": "yarn tsc",
"build:module": "yarn tsc --module esnext --outDir dist/module",
"build:watch": "yarn build --watch",
"clean": "rm -rf dist/*",
"lint": "yarn typecheck && prettier --check . && prettier-package-json --list-different package.json && eslint .",
"lint:fix": "prettier --write . && prettier-package-json --write package.json && eslint --fix .",
"lint:fix:md": "prettier --write '*.md'",
"lint:fix:package": "prettier-package-json --write package.json",
"lint:fix:ts": "eslint --fix './src/**/*.ts{,x}'",
"package:build": "yarn install && yarn clean && yarn build && yarn package:prune && yarn package:copy:files",
"package:build": "yarn install && yarn clean && yarn build:commonjs && yarn build:module && webpack && yarn package:prune && yarn package:copy:files",
"package:copy:files": "cp ./LICENSE ./README.md dist/ && cp ./public.package.json dist/package.json",
"package:prune": "find dist -name test.* -delete",
"test": "jest src/*",
"test:ci": "yarn test --coverage",
"typecheck": "yarn tsc --noEmit && (cd example && yarn && yarn tsc --noEmit)",
"typecheck:watch": "yarn typecheck --watch"
},
"sideEffects": false,
"types": "dist/index.d.ts",
"peerDependencies": {
"react": ">= 16.8"
},
"devDependencies": {
"@babel/preset-env": "^7.17.12",
"@babel/preset-react": "^7.17.12",
Expand Down Expand Up @@ -61,13 +55,6 @@
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
},
"keywords": [
"componentDidCatch",
"error boundary hook",
"react error boundary",
"react hook",
"useErrorBoundary"
],
"husky": {
"hooks": {
"pre-commit": "yarn lint:fix"
Expand Down
14 changes: 11 additions & 3 deletions public.package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-use-error-boundary",
"version": "2.0.0",
"version": "2.0.1",
"description": "A React error boundary hook for function components",
"license": "MIT",
"author": "Tate <tatethurston@gmail.com>",
Expand All @@ -12,13 +12,21 @@
"bugs": {
"url": "https://github.com/tatethurston/react-use-error-boundary/issues"
},
"main": "dist/index.js",
"module": "dist/index.js",
"sideEffects": false,
"types": "index.d.ts",
"peerDependencies": {
"react": ">= 16.8"
},
"main": "index.js",
"module": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./module/index.js",
"module": "./module/index.js",
"default": "./index.js"
}
},
"keywords": [
"componentDidCatch",
"error boundary hook",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react",
"module": "ESNext",
"module": "CommonJS",
"moduleResolution": "Node",
"noEmitOnError": false,
"outDir": "dist",
Expand Down

0 comments on commit ce6874c

Please sign in to comment.