Skip to content

Commit 9d28200

Browse files
committed
Update library to use modern technology
1 parent b26e319 commit 9d28200

16 files changed

Lines changed: 18603 additions & 14903 deletions

.babelrc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
{
2-
"presets": [
3-
"env",
4-
"react",
5-
"es2015"
6-
],
7-
"plugins": [
8-
"transform-class-properties",
9-
"transform-object-rest-spread"
10-
]
2+
"presets": ["@babel/preset-env", "@babel/preset-react"]
113
}

.eslintrc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
2-
"extends": "airbnb",
3-
"parser": "babel-eslint",
2+
"extends": ["airbnb", "airbnb/hooks"],
3+
"parser": "@babel/eslint-parser",
44
"env": {
55
"browser": true,
6-
"es6": true
6+
"es2020": true,
7+
"jest": true
78
},
8-
"plugins": ["jsx-a11y", "react"],
9+
"plugins": ["jsx-a11y", "react", "react-hooks"],
910
"parserOptions": {
10-
"ecmaVersion": 6,
11+
"ecmaVersion": 2020,
1112
"sourceType": "module",
1213
"ecmaFeatures": {
1314
"jsx": true
14-
}
15+
},
16+
"requireConfigFile": false
1517
},
1618
"rules": {
1719
"arrow-parens": ["error", "always"],
@@ -47,6 +49,9 @@
4749
"react/prop-types": 0,
4850
"react/require-extension": 0,
4951
"react/self-closing-comp": 0,
50-
"react/sort-comp": 0
52+
"react/jsx-props-no-spreading": 0,
53+
"react/sort-comp": 0,
54+
"react-hooks/rules-of-hooks": "error",
55+
"react-hooks/exhaustive-deps": "warn"
5156
}
5257
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
build/
4+
coverage/

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": false,
3+
"trailingComma": "es5",
4+
"printWidth": 80,
5+
"tabWidth": 2,
6+
"semi": true
7+
}

CHANGELOG.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
1-
#0.1.3
1+
# CHANGELOG
2+
3+
## 0.2.0 (2025-08-26)
4+
5+
### Demo and Build Pipeline Modernization
6+
7+
- Demo and library now use a single React instance (no duplicate Reacts)
8+
- Demo imports library from npm tarball, not local dist
9+
- Added stable, modular Gulp build pipeline (separate build and watch tasks)
10+
- Added LESS variable for @primary-color
11+
- Added /gh-pages/bin/update-demo.sh for one-command demo updates
12+
- Added npm script 'update-demo' for easy demo refresh
13+
- Improved error handling and build stability
14+
- Updated documentation and workflow for best practices
15+
16+
## 0.1.3
17+
218
Adds in currency (thanks! @jgautheron)
319

4-
#0.1.2
20+
## 0.1.2
21+
522
Adds in decimal values (thanks! @che-wf)
623

7-
#0.0.5
24+
## 0.0.5
25+
826
Updates to React 16 (thanks! @kunukn)
927

10-
#0.0.4
28+
## 0.0.4
29+
1130
Fix incorrect numbers being drawn when the screen was inactive. (thanks! @migreva)
1231

13-
#0.0.3
32+
## 0.0.3
33+
1434
Added `delayValue` prop to delay the start of the animation.
1535

16-
#0.0.2
36+
## 0.0.2
37+
1738
Added `userLocaleString` prop. Thanks @adjohu.
1839

19-
#0.0.1
40+
## 0.0.1
41+
2042
Initial release

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contributing
2+
3+
Thank you for considering contributing to react-number-easing!
4+
5+
## How to Contribute
6+
7+
- Fork the repository and create your branch from `main`.
8+
- Install dependencies: `npm install`
9+
- Run tests: `npm test`
10+
- Run linter: `npm run lint`
11+
- Build the project: `npm run build`
12+
- Submit a pull request with a clear description of your changes.
13+
14+
## Code Style
15+
16+
- Use Prettier for formatting: `npm run format`
17+
- Follow ESLint rules.
18+
19+
## Issues
20+
21+
If you find a bug or have a feature request, please open an issue on GitHub.

README.md

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# [React Number Easing](http://javierbyte.github.io/react-number-easing/)
2-
[![Rate on Openbase](https://badges.openbase.com/js/rating/che-react-number-easing.svg)](https://openbase.com/js/che-react-number-easing?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)
32

43
React component for fancy number transitions.
54

65
[Live demo](https://che-wf.github.io/react-number-easing/)
76

87
[![react-number-easing screenshot](assets/number-easing-infinite.gif)](https://che-wf.github.io/react-number-easing/)
98

10-
119
## Installation
1210

1311
```js
1412
npm i -S che-react-number-easing
1513
```
1614

17-
## Usage.
15+
## Usage
1816

1917
```jsx
20-
const NumberEasing = require('che-react-number-easing');
18+
import { NumberEasing } from "che-react-number-easing";
2119

2220
<NumberEasing
2321
ease="quintInOut"
@@ -26,41 +24,55 @@ const NumberEasing = require('che-react-number-easing');
2624
trail={true}
2725
useLocaleString={true}
2826
value={15}
29-
/>
27+
/>;
3028
```
3129

3230
### Props
3331

34-
* `[ease]`: The easing equation for the animation.
35-
* Default: `quintInOut` (You can choose from [mattdesl/eases](https://github.com/mattdesl/eases/blob/master/index.js).)
36-
* Type: `string`
37-
* `[precision]`: How many decimal places you want to show?
38-
* Default: `2`
39-
* Type: `number`
40-
* `[speed]`: How fast do you want to finish the animation?
41-
* Default:`500` (ms)
42-
* Type: `number`
43-
* `[trail]`: Do you want trailing zeroes?
44-
* Default: `false`
45-
* Type: `boolean`
46-
* `[useLocaleString]`: Use number formatting based on locale?
47-
* Default: `false`
48-
* Type: `boolean`
49-
* `[value]`: The value that you want to display at the end of the animation.
50-
* `Required`
51-
* Type: `number`
52-
53-
# Build
54-
55-
If you want to build this from source, you will need babel and less.
56-
57-
```js
32+
- `[ease]`: The easing equation for the animation.
33+
- Default: `quintInOut` (You can choose from [mattdesl/eases](https://github.com/mattdesl/eases/blob/master/index.js).)
34+
- Type: `string`
35+
- `[precision]`: How many decimal places you want to show?
36+
- Default: `2`
37+
- Type: `number`
38+
- `[speed]`: How fast do you want to finish the animation?
39+
- Default:`500` (ms)
40+
- Type: `number`
41+
- `[trail]`: Do you want trailing zeroes?
42+
- Default: `false`
43+
- Type: `boolean`
44+
- `[useLocaleString]`: Use number formatting based on locale?
45+
- Default: `false`
46+
- Type: `boolean`
47+
- `[value]`: The value that you want to display at the end of the animation.
48+
- `Required`
49+
- Type: `number`
50+
51+
## Requirements
52+
53+
- React 18 or newer
54+
55+
## Build
56+
57+
To build from source:
58+
59+
```sh
5860
npm install
61+
npm run build
5962
```
6063

61-
And run the pre publish script
64+
## Test
6265

63-
```js
64-
npm run prepare
66+
To run tests:
67+
68+
```sh
69+
npm test
6570
```
71+
6672
[![HitCount](http://hits.dwyl.com/{username}/che-wf/react-number-easing.svg)](http://hits.dwyl.com/{username}/che-wf/react-number-easing)
73+
74+
## Project Structure
75+
76+
- Main component: `src/components/NumberEasing.jsx`
77+
- All components are exported from `src/index.jsx`
78+
[![HitCount](http://hits.dwyl.com/{username}/che-wf/react-number-easing.svg)](http://hits.dwyl.com/{username}/che-wf/react-number-easing)

che-react-number-easing-0.2.0.tgz

503 KB
Binary file not shown.

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
testEnvironment: 'jsdom',
3+
testMatch: ['<rootDir>/src/**/__tests__/**/*.[jt]s?(x)'],
4+
testPathIgnorePatterns: ['<rootDir>/dist/'],
5+
};

0 commit comments

Comments
 (0)