Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Test Package

on: push

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-22.04
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@

# Project
/node_modules

# Build
/dist
*.tsbuildinfo

# Cache
.eslintcache
5,913 changes: 3,521 additions & 2,392 deletions package-lock.json

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@
"name": "@aboutbits/react-toolbox",
"version": "0.2.3",
"description": "Tools for React",
"author": "About Bits",
"license": "MIT",
"homepage": "https://github.com/aboutbits/react-toolbox",
"repository": {
"type": "git",
"url": "git+https://github.com/aboutbits/react-toolbox"
},
"bugs": {
"url": "https://github.com/aboutbits/react-toolbox/issues"
},
"keywords": [
"react",
"toolbox",
"tooling",
"tools"
],
"private": false,
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"files": [
"readme.md",
"dist/**/*"
],
"engines": {
"npm": ">=8",
"node": ">=16"
Expand All @@ -22,52 +46,28 @@
"version": "npm run test && npm run lint && git add -A src",
"postversion": "git push && git push --tags"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aboutbits/react-toolbox"
},
"private": false,
"keywords": [
"react",
"toolbox",
"tooling",
"tools"
],
"author": "About Bits",
"license": "MIT",
"bugs": {
"url": "https://github.com/aboutbits/react-toolbox/issues"
},
"homepage": "https://github.com/aboutbits/react-toolbox#readme",
"files": [
"readme.md",
"dist/**/*"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.4.0",
"@types/css-mediaquery": "^0.1.1",
"@types/jest": "^28.1.3",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@types/css-mediaquery": "^0.1.4",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.69",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"css-mediaquery": "^0.1.2",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.1.0",
"jest": "^28.1.1",
"jest-environment-jsdom": "^28.1.1",
"prettier": "^2.7.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"ts-jest": "^28.0.5",
"typescript": "^4.7.4"
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-jest": "^29.1.2",
"typescript": "^5.4.3"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/async-data/AsyncView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Props<Data, Error> = {
}

const AsyncView = <Data, Error>(
props: Props<Data, Error>
props: Props<Data, Error>,
// The `ReactElement<any, any> | null` type is for React 17 compatibility (see type FunctionComponent). With React 18 it can be a ReactNode and we can remove the Fragment wrappers.
): ReactElement<any, any> | null => {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/async-data/__test__/AsyncView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function renderAsyncView(data?: Data, error?: Error): RenderResult {
renderLoading={<Loading />}
renderSuccess={(data) => <Success data={data} />}
renderError={(error) => <Error error={error} />}
/>
/>,
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/location-provider/getCurrentLocation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getCurrentLocation = (
highAccuracy = false
highAccuracy = false,
): Promise<GeolocationPosition> => {
return new Promise<GeolocationPosition>((resolve, reject) => {
const successCallback = (position: GeolocationPosition): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('useReactSimpleMatchMedia', () => {

it('should be visible if between matches', () => {
const { getByText } = renderTestComponent(
'(min-width : 500px) and (max-width: 600px)'
'(min-width : 500px) and (max-width: 600px)',
)
expect(getByText(/visible/i)).toBeInTheDocument()
})
Expand Down