diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0190951 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,19 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: yarn install + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/README.md b/README.md index 2c4f8e9..de498ef 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ class ReactComment extends window.HTMLElement { window.customElements.define('react-comment', ReactComment) ``` -To include a comment in your JSX or React component, simply include the `` tag with the comment-text as content and import reactComment.js. +To include a comment in your JSX or React component, simply include the `` 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. ### Import ```javascript import 'reactComponent' diff --git a/reactComment.js b/index.js similarity index 100% rename from reactComment.js rename to index.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..3c565d7 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "react-jsx-html-comments", + "version": "1.0.0", + "description": "Enable HTML comments and conditional IE comments in React components and JSX using a Web Component (W3C Custom Element).", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/RodrigoTomeES/react-jsx-html-comments.git" + }, + "keywords": [ + "jsx", + "html", + "react", + "webcomponents", + "webcomponent", + "customelements", + "customelement" + ], + "author": "RodrigoTomeES", + "license": "MIT", + "bugs": { + "url": "https://github.com/RodrigoTomeES/react-jsx-html-comments/issues" + }, + "homepage": "https://github.com/RodrigoTomeES/react-jsx-html-comments#readme" +}