Skip to content

chore: modernize config, tooling #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Install dependencies
run: yarn install

- name: Check build health
run: yarn build

- name: Check for regressions
run: yarn lint

- name: Run tests
run: yarn test
25 changes: 10 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
node_modules/
coverage/
dist/
types/
yarn-error.log
.size-snapshot.json
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
.DS_Store
.vscode
.docz/
package-lock.json
coverage/
node_modules
dist

# Editor directories and files
.idea
.rpt2_cache/
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
14 changes: 0 additions & 14 deletions .npmignore

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"tabWidth": 2,
"printWidth": 120
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Paul Henschel
Copyright (c) 2019-2025 Poimandres

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
60 changes: 0 additions & 60 deletions karma.conf.js

This file was deleted.

140 changes: 43 additions & 97 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
{
"name": "react-use-measure",
"version": "2.1.1",
"description": "measure view bounds",
"main": "./dist/web.cjs.js",
"module": "./dist/web.js",
"types": "./types/index.d.ts",
"sideEffects": false,
"website": "https://github.com/pmndrs/react-use-measure",
"repository": "https://github.com/pmndrs/react-use-measure",
"scripts": {
"prebuild": "rimraf dist && npm run typegen",
"build": "rollup -c",
"prepare": "npm run build",
"eslint": "eslint src/**/*.{js,ts,jsx,tsx}",
"test": "karma start --single-run",
"test:watch": "karma start",
"typecheck": "tsc --noEmit --strict --jsx react src/*",
"typegen": "tsc || true && prettier types/**/** --write"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick"
}
},
"prettier": {
"semi": false,
"trailingComma": "es5",
"singleQuote": true,
"bracketSameLine": true,
"tabWidth": 2,
"printWidth": 120
},
"description": "Utility to measure view bounds",
"keywords": [
"react",
"use",
Expand All @@ -39,77 +10,52 @@
"hooks"
],
"author": "Paul Henschel",
"contributors": [
{
"name": "Erik Verweij",
"url": "https://github.com/everweij",
"email": "[email protected]"
}
],
"homepage": "https://github.com/pmndrs/react-use-measure",
"repository": "https://github.com/pmndrs/react-use-measure",
"license": "MIT",
"peerDependencies": {
"react": ">=16.13",
"react-dom": ">=16.13"
"files": [
"dist/*",
"src/*"
],
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"exports": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"sideEffects": false,
"devDependencies": {
"@babel/core": "7.16.0",
"@babel/plugin-transform-modules-commonjs": "7.16.0",
"@babel/plugin-transform-parameters": "7.16.3",
"@babel/plugin-transform-runtime": "7.16.4",
"@babel/plugin-transform-template-literals": "7.16.0",
"@babel/preset-env": "7.16.4",
"@babel/preset-react": "7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@babel/register": "^7.16.0",
"@testing-library/react": "^12.1.2",
"@types/debounce": "^1.2.1",
"@types/expect": "^24.3.0",
"@types/lodash-es": "^4.17.5",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.10",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@types/styled-components": "^5.1.15",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.3",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"constants-browserify": "^1.0.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"expect": "^27.3.1",
"husky": "^4.3.8",
"karma": "^6.3.9",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^5.0.0",
"mocha": "^9.1.3",
"path-browserify": "^1.0.1",
"prettier": "^2.5.0",
"pretty-quick": "^3.1.2",
"puppeteer": "^11.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
"@types/node": "^22.12.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitest/browser": "^3.0.4",
"playwright": "^1.50.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.60.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-size-snapshot": "^0.12.0",
"stream-browserify": "^3.0.0",
"styled-components": "^5.3.3",
"typescript": "^4.5.2",
"webpack": "^5.64.4"
"typescript": "^5.7.3",
"vite": "^6.0.11",
"vitest": "^3.0.4"
},
"dependencies": {
"debounce": "^1.2.1"
"peerDependencies": {
"react": ">=16.13",
"react-dom": ">=16.13"
},
"scripts": {
"postinstall": "npx playwright install",
"dev": "vite",
"build": "vite build",
"lint": "tsc",
"test": "vitest run"
}
}
49 changes: 0 additions & 49 deletions rollup.config.js

This file was deleted.

Loading