Skip to content

Commit 7563eb5

Browse files
committed
Added npm configuration, added an action to deploy npm package and updated Readme with npm package
1 parent 8e67c82 commit 7563eb5

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
registry-url: https://registry.npmjs.org/
16+
- run: yarn install
17+
- run: npm publish --access public
18+
env:
19+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ReactComment extends window.HTMLElement {
3939
window.customElements.define('react-comment', ReactComment)
4040
```
4141

42-
To include a comment in your JSX or React component, simply include the `<react-comment>` tag with the comment-text as content and import reactComment.js.
42+
To include a comment in your JSX or React component, simply include the `<react-comment>` tag with the comment-text as content and import index.js (you can rename the file) or use the npm package react-jsx-html-comments.
4343
### Import
4444
```javascript
4545
import 'reactComponent'
File renamed without changes.

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "react-jsx-html-comments",
3+
"version": "1.0.0",
4+
"description": "Enable HTML comments and conditional IE comments in React components and JSX using a Web Component (W3C Custom Element).",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/RodrigoTomeES/react-jsx-html-comments.git"
12+
},
13+
"keywords": [
14+
"jsx",
15+
"html",
16+
"react",
17+
"webcomponents",
18+
"webcomponent",
19+
"customelements",
20+
"customelement"
21+
],
22+
"author": "RodrigoTomeES",
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/RodrigoTomeES/react-jsx-html-comments/issues"
26+
},
27+
"homepage": "https://github.com/RodrigoTomeES/react-jsx-html-comments#readme"
28+
}

0 commit comments

Comments
 (0)