Skip to content

Commit

Permalink
chore: housekeeping
Browse files Browse the repository at this point in the history
- Use tsup instead of the currently unmaintained microbundle
- Fix version conflict in the React types
- Address vulnerabilities in dependencies reported by Dependabot
  • Loading branch information
Julian Schleemann committed Feb 20, 2024
1 parent 91c5376 commit 7006000
Show file tree
Hide file tree
Showing 6 changed files with 1,380 additions and 2,882 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# build
lib/
dist/

# dependencies
node_modules/

# editor
.idea/
.idea/
3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
testEnvironment: 'jsdom'
};
48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
"name": "@atmina/formbuilder",
"version": "2.0.0",
"description": "A strongly-typed alternative API for React Hook Form.",
"source": "src/index.ts",
"main": "lib/index.js",
"module": "lib/index.module.js",
"unpkg": "lib/index.umd.js",
"types": "lib/index.d.ts",
"files": [
"/lib"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": ["/dist"],
"scripts": {
"build": "rimraf lib && microbundle --jsx React.createElement src/index.ts",
"build": "rimraf dist && tsup src/index.ts --dts --format esm,cjs",
"prepublishOnly": "npm test && npm run build",
"lint": "yarn run lint:fix && yarn run prettier:fix",
"lint:check": "eslint . --report-unused-disable-directives --max-warnings 0",
Expand Down Expand Up @@ -39,25 +36,25 @@
"homepage": "https://github.com/atmina/formbuilder#readme",
"devDependencies": {
"@atmina/linting": "^2.1.2",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^14.1.1",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/eslint": "^8.56.2",
"@types/jest": "^27.5.0",
"@types/react": "^18.1.0",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"eslint": "^8.56.0",
"expect-type": "^0.13.0",
"jest": "^28.0.3",
"jest-environment-jsdom": "^28.0.2",
"microbundle": "^0.15.0",
"expect-type": "^0.17.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-hook-form": "^7.33.0",
"ts-jest": "^28.0.1",
"typescript": "^4.6.4"
"react-hook-form": "^7.50.1",
"ts-jest": "^29.1.2",
"tsup": "^8.0.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand All @@ -70,5 +67,10 @@
}
},
"packageManager": "[email protected]+sha256.dbed5b7e10c552ba0e1a545c948d5473bc6c5a28ce22a8fd27e493e3e5eb6370",
"prettier": "@atmina/linting/prettier"
"prettier": "@atmina/linting/prettier",
"resolutions": {
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"word-wrap": "^1.2.4"
}
}
1 change: 1 addition & 0 deletions src/formbuilder.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '@testing-library/jest-dom';
import {act, render, screen, waitFor} from '@testing-library/react';
import {userEvent} from '@testing-library/user-event';
import React, {type FC, type ReactNode} from 'react';
Expand Down
19 changes: 12 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"jsx": "react",
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"moduleDetection": "force",
"isolatedModules": true,
"strict": true,
"outDir": "dist"
},
"exclude": ["node_modules"]
"declaration": true,
"moduleResolution": "bundler",
"module": "esnext",
"noEmit": true,
"lib": ["es2022", "dom", "dom.iterable"],
"jsx": "react"
}
}
Loading

0 comments on commit 7006000

Please sign in to comment.