Skip to content

Commit 945cfb2

Browse files
Merge pull request #131 from remarkablemark/build/package
chore: upgrade dependencies, update docs, move TypeScript tests
2 parents 2998742 + 7321d6c commit 945cfb2

File tree

7 files changed

+138
-81
lines changed

7 files changed

+138
-81
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ script:
77
# Lint last commit message from history
88
- npx commitlint --from=HEAD~1
99
- npm run lint
10-
- npm run dtslint
10+
- npm run lint:dts
1111
- npm run test:coverage
1212
- npm run build
1313
- npm run benchmark

CONTRIBUTING.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Contributing
2+
3+
All pull requests are welcome! By participating in this project, you
4+
agree to abide by our **[code of conduct]**.
5+
6+
[code of conduct]: https://github.com/remarkablemark/html-react-parser/blob/master/CODE_OF_CONDUCT.md
7+
8+
[Fork], then clone the repository:
9+
10+
[fork]: https://github.com/remarkablemark/html-react-parser/fork
11+
12+
```sh
13+
# replace `<user>` with your username
14+
$ git clone git@github.com:<user>/html-react-parser.git
15+
$ cd html-react-parser
16+
```
17+
18+
Install package dependencies:
19+
20+
```sh
21+
$ npm install
22+
```
23+
24+
Make your change. Add tests and/or documentation. Ensure all tests and lint pass:
25+
26+
```sh
27+
$ npm test
28+
$ npm run lint
29+
```
30+
31+
Push to your fork and [submit a pull request][pr].
32+
33+
[pr]: https://github.com/remarkablemark/html-react-parser/compare/
34+
35+
At this point you're waiting on us. We like to comment on pull requests
36+
within three business days (and, typically, one business day). We may suggest
37+
changes, improvements, or alternatives.
38+
39+
Things that will improve the chance that your pull request will be accepted:
40+
41+
- [ ] Write tests that pass [CI].
42+
- [ ] Write good documentation.
43+
- [ ] Write a [good commit message][commit].
44+
45+
[ci]: https://travis-ci.org/remarkablemark/html-react-parser
46+
[commit]: https://www.conventionalcommits.org/
47+
48+
## Test
49+
50+
Run tests:
51+
52+
```sh
53+
$ npm test
54+
```
55+
56+
Run tests with coverage:
57+
58+
```sh
59+
$ npm run test:coverage
60+
```
61+
62+
View coverage report in your browser:
63+
64+
```sh
65+
$ npm run test:coverage:report
66+
$ open coverage/index.html
67+
```
68+
69+
## Lint
70+
71+
Lint codebase:
72+
73+
```sh
74+
$ npm run lint
75+
```
76+
77+
Fix lint errors:
78+
79+
```sh
80+
$ npm run lint:fix
81+
```
82+
83+
Test TypeScript declaration file for style and correctness:
84+
85+
```sh
86+
$ npm run lint:dts
87+
```
88+
89+
## Release
90+
91+
Only collaborators with credentials can release and publish:
92+
93+
```sh
94+
$ npm run release
95+
$ npm publish && git push --follow-tags
96+
```

README.md

Lines changed: 14 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -242,40 +242,6 @@ Although `<script>` tags and their contents are rendered on the server-side, the
242242

243243
This is because [inline event handlers](https://developer.mozilla.org/docs/Web/Guide/Events/Event_handlers) (e.g., `onclick`) are parsed as a _string_ instead of a _function_. See [#73](https://github.com/remarkablemark/html-react-parser/issues/73).
244244

245-
## Testing
246-
247-
Run tests:
248-
249-
```sh
250-
$ npm test
251-
```
252-
253-
Run tests with coverage:
254-
255-
```sh
256-
$ npm run test:coverage
257-
```
258-
259-
View coverage in browser:
260-
261-
```sh
262-
$ npm run test:coverage:report
263-
$ open coverage/index.html
264-
```
265-
266-
Lint files:
267-
268-
```sh
269-
$ npm run lint
270-
$ npm run dtslint
271-
```
272-
273-
Fix lint errors:
274-
275-
```sh
276-
$ npm run lint:fix
277-
```
278-
279245
## Benchmarks
280246

281247
```sh
@@ -290,44 +256,36 @@ html-to-react - Multiple x 139,780 ops/sec ±2.32% (87 runs sampled)
290256
html-to-react - Complex x 8,118 ops/sec ±2.99% (82 runs sampled)
291257
```
292258

293-
## Release
294-
295-
Only collaborators with credentials can release and publish:
296-
297-
```sh
298-
$ npm run release
299-
$ git push --follow-tags && npm publish
300-
```
301-
302259
## Contributors
303260

304261
### Code Contributors
305262

306-
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
307-
<a href="https://github.com/remarkablemark/html-react-parser/graphs/contributors"><img src="https://opencollective.com/html-react-parser/contributors.svg?width=890&button=false" /></a>
263+
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/remarkablemark/html-react-parser/blob/master/CONTRIBUTING.md)].
264+
265+
[![Code Contributors](https://opencollective.com/html-react-parser/contributors.svg?width=890&button=false)](https://github.com/remarkablemark/html-react-parser/graphs/contributors)
308266

309267
### Financial Contributors
310268

311269
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/html-react-parser/contribute)]
312270

313271
#### Individuals
314272

315-
<a href="https://opencollective.com/html-react-parser"><img src="https://opencollective.com/html-react-parser/individuals.svg?width=890"></a>
273+
[![Financial Contributors - Individuals](https://opencollective.com/html-react-parser/individuals.svg?width=890)](https://opencollective.com/html-react-parser)
316274

317275
#### Organizations
318276

319277
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/html-react-parser/contribute)]
320278

321-
<a href="https://opencollective.com/html-react-parser/organization/0/website"><img src="https://opencollective.com/html-react-parser/organization/0/avatar.svg"></a>
322-
<a href="https://opencollective.com/html-react-parser/organization/1/website"><img src="https://opencollective.com/html-react-parser/organization/1/avatar.svg"></a>
323-
<a href="https://opencollective.com/html-react-parser/organization/2/website"><img src="https://opencollective.com/html-react-parser/organization/2/avatar.svg"></a>
324-
<a href="https://opencollective.com/html-react-parser/organization/3/website"><img src="https://opencollective.com/html-react-parser/organization/3/avatar.svg"></a>
325-
<a href="https://opencollective.com/html-react-parser/organization/4/website"><img src="https://opencollective.com/html-react-parser/organization/4/avatar.svg"></a>
326-
<a href="https://opencollective.com/html-react-parser/organization/5/website"><img src="https://opencollective.com/html-react-parser/organization/5/avatar.svg"></a>
327-
<a href="https://opencollective.com/html-react-parser/organization/6/website"><img src="https://opencollective.com/html-react-parser/organization/6/avatar.svg"></a>
328-
<a href="https://opencollective.com/html-react-parser/organization/7/website"><img src="https://opencollective.com/html-react-parser/organization/7/avatar.svg"></a>
329-
<a href="https://opencollective.com/html-react-parser/organization/8/website"><img src="https://opencollective.com/html-react-parser/organization/8/avatar.svg"></a>
330-
<a href="https://opencollective.com/html-react-parser/organization/9/website"><img src="https://opencollective.com/html-react-parser/organization/9/avatar.svg"></a>
279+
[![Financial Contributors - Organization 0](https://opencollective.com/html-react-parser/organization/0/avatar.svg)](https://opencollective.com/html-react-parser/organization/0/website)
280+
[![Financial Contributors - Organization 1](https://opencollective.com/html-react-parser/organization/1/avatar.svg)](https://opencollective.com/html-react-parser/organization/1/website)
281+
[![Financial Contributors - Organization 2](https://opencollective.com/html-react-parser/organization/2/avatar.svg)](https://opencollective.com/html-react-parser/organization/2/website)
282+
[![Financial Contributors - Organization 3](https://opencollective.com/html-react-parser/organization/3/avatar.svg)](https://opencollective.com/html-react-parser/organization/3/website)
283+
[![Financial Contributors - Organization 4](https://opencollective.com/html-react-parser/organization/4/avatar.svg)](https://opencollective.com/html-react-parser/organization/4/website)
284+
[![Financial Contributors - Organization 5](https://opencollective.com/html-react-parser/organization/5/avatar.svg)](https://opencollective.com/html-react-parser/organization/5/website)
285+
[![Financial Contributors - Organization 6](https://opencollective.com/html-react-parser/organization/6/avatar.svg)](https://opencollective.com/html-react-parser/organization/6/website)
286+
[![Financial Contributors - Organization 7](https://opencollective.com/html-react-parser/organization/7/avatar.svg)](https://opencollective.com/html-react-parser/organization/7/website)
287+
[![Financial Contributors - Organization 8](https://opencollective.com/html-react-parser/organization/8/avatar.svg)](https://opencollective.com/html-react-parser/organization/8/website)
288+
[![Financial Contributors - Organization 9](https://opencollective.com/html-react-parser/organization/9/avatar.svg)](https://opencollective.com/html-react-parser/organization/9/website)
331289

332290
## Support
333291

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"clean": "rimraf dist",
1313
"coveralls": "nyc report --reporter=text-lcov | coveralls",
1414
"lint": "eslint --ignore-path .gitignore --ignore-pattern /examples/ .",
15+
"lint:dts": "dtslint .",
1516
"lint:fix": "npm run lint -- --fix",
16-
"dtslint": "dtslint .",
1717
"prepublishOnly": "npm run lint && npm run dtslint && npm test && npm run build",
1818
"release": "standard-version --no-verify",
1919
"test": "mocha",
@@ -38,32 +38,32 @@
3838
"@types/domhandler": "2.4.1",
3939
"html-dom-parser": "0.2.3",
4040
"react-property": "1.0.1",
41-
"style-to-object": "0.2.3"
41+
"style-to-object": "0.3.0"
4242
},
4343
"devDependencies": {
44-
"@commitlint/cli": "^8.0.0",
45-
"@commitlint/config-conventional": "^8.0.0",
46-
"@types/react": "^16.8.22",
44+
"@commitlint/cli": "^8.2.0",
45+
"@commitlint/config-conventional": "^8.2.0",
46+
"@types/react": "^16.9.11",
4747
"benchmark": "^2.1.4",
48-
"coveralls": "^3.0.4",
49-
"cross-env": "^5.2.0",
50-
"dtslint": "^0.8.0",
51-
"eslint": "^6.0.0",
52-
"eslint-plugin-prettier": "^3.1.0",
53-
"husky": "^2.4.1",
54-
"lint-staged": "^8.2.1",
55-
"mocha": "^6.1.4",
48+
"coveralls": "^3.0.7",
49+
"cross-env": "^6.0.3",
50+
"dtslint": "^2.0.0",
51+
"eslint": "^6.6.0",
52+
"eslint-plugin-prettier": "^3.1.1",
53+
"husky": "^3.0.9",
54+
"lint-staged": "^9.4.2",
55+
"mocha": "^6.2.2",
5656
"nyc": "^14.1.1",
57-
"preact": "10.0.4",
58-
"prettier": "^1.18.2",
57+
"preact": "^10.0.4",
58+
"prettier": "^1.19.1",
5959
"react": "^16",
6060
"react-dom": "^16",
61-
"rimraf": "^2.6.3",
62-
"rollup": "^1.16.2",
63-
"rollup-plugin-commonjs": "^10.0.0",
64-
"rollup-plugin-node-resolve": "^5.0.4",
65-
"rollup-plugin-uglify": "^6.0.2",
66-
"standard-version": "^6.0.1"
61+
"rimraf": "^3.0.0",
62+
"rollup": "^1.26.3",
63+
"rollup-plugin-commonjs": "^10.1.0",
64+
"rollup-plugin-node-resolve": "^5.2.0",
65+
"rollup-plugin-uglify": "^6.0.3",
66+
"standard-version": "^6"
6767
},
6868
"peerDependencies": {
6969
"react": "^0.14 || ^15 || ^16"
File renamed without changes.

tsconfig.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
"types": [],
1111
"noEmit": true,
1212
"forceConsistentCasingInFileNames": true,
13-
"paths": { "html-react-parser": ["."], "html-react-parser/lib/*": ["./lib/*"] },
13+
"paths": {
14+
"html-react-parser": ["."],
15+
"html-react-parser/lib/*": ["./lib/*"]
16+
},
1417
"jsx": "react"
1518
},
1619
"files": [
1720
"index.d.ts",
1821
"lib/dom-to-react.d.ts",
19-
"lint/types/index.test.tsx",
20-
"lint/types/lib/dom-to-react.test.tsx"
22+
"test/types/index.test.tsx",
23+
"test/types/lib/dom-to-react.test.tsx"
2124
]
2225
}

0 commit comments

Comments
 (0)