Skip to content

Commit

Permalink
feat: support React 18, modernise package build and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Dec 23, 2023
1 parent 52f7017 commit ab60acb
Show file tree
Hide file tree
Showing 6 changed files with 1,205 additions and 741 deletions.
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

40 changes: 14 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"author": "Measured Co. <hello@measured.co>",
"license": "MIT",
"repository": "measuredco/react-from-json",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"engines": {
"node": ">=8",
"npm": ">=5"
Expand All @@ -16,8 +15,7 @@
"test": "cross-env CI=1 react-scripts-ts test --env=jsdom",
"test:watch": "react-scripts-ts test --env=jsdom",
"cz": "git-cz",
"build": "rollup -c",
"start": "rollup -c -w",
"build": "rm -rf dist && tsup src/index.tsx",
"prepare": "yarn run build",
"predeploy": "cd example && yarn install && yarn run build",
"deploy": "gh-pages -d example/build",
Expand All @@ -26,35 +24,25 @@
},
"dependencies": {},
"peerDependencies": {
"prop-types": "^15.5.4",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@types/jest": "^23.1.5",
"@types/react": "^16.3.13",
"@types/react-dom": "^16.0.5",
"@types/react-test-renderer": "^16.0.2",
"babel-core": "^6.26.3",
"babel-runtime": "^6.26.0",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/react-test-renderer": "^18.0.7",
"commitizen": "^2.10.1",
"conventional-changelog-cli": "^2.0.5",
"conventional-recommended-bump": "^4.0.1",
"cross-env": "^5.1.4",
"gh-pages": "^1.2.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts-ts": "^2.16.0",
"react-test-renderer": "^16.5.2",
"rollup": "^0.62.0",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-postcss-modules": "^1.0.8",
"rollup-plugin-typescript2": "^0.13.0",
"rollup-plugin-url": "^1.4.0",
"typescript": "^2.8.3"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts-ts": "^3.1.0",
"react-test-renderer": "^18.2.0",
"tsup": "^6.7.0",
"typescript": "^4.5.2"
},
"files": [
"dist"
Expand Down
39 changes: 0 additions & 39 deletions rollup.config.js

This file was deleted.

38 changes: 20 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Library",
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom", "es2016", "es2017"],
"sourceMap": true,
"allowJs": false,
"jsx": "react",
"composite": false,
"declaration": true,
"moduleResolution": "node",
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"],
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"jsx": "react-jsx",
"lib": ["ES2015", "DOM"],
"module": "ESNext",
"target": "es6",
"noImplicitAny": false,
"plugins": [{ "name": "typescript-plugin-css-modules" }]
}
}
6 changes: 6 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const config = {
dts: true,
format: "cjs",
};

export default config;
Loading

0 comments on commit ab60acb

Please sign in to comment.