Skip to content

Commit

Permalink
Merge pull request #1 from South-Paw/use-npm
Browse files Browse the repository at this point in the history
1.0.2: Fix hook dependencies, use NPM and update dev dependencies
  • Loading branch information
South-Paw authored Jan 13, 2021
2 parents 053ceb9 + 15a8a49 commit 6c88e1c
Show file tree
Hide file tree
Showing 12 changed files with 22,206 additions and 12,776 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"extends": [
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/react",
"prettier/@typescript-eslint",
"plugin:jest/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/jsx-props-no-spreading": "off"
},
"overrides": [
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
uses: actions/checkout@v1

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Build Storybook
run: yarn build:storybook
run: npm run build:storybook

- name: Deploy draft to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'
build-dir: "./storybook-static"
draft: true
comment-on-pull-request: true
18 changes: 9 additions & 9 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Lint
run: yarn lint
run: npm run lint

test:
name: Test
Expand All @@ -26,12 +26,12 @@ jobs:
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Test
env:
CI: true
run: yarn test
run: npm run test

build:
name: Build
Expand All @@ -42,10 +42,10 @@ jobs:
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Build Package
run: yarn build
run: npm run build

deployDraftOnMasterCommit:
name: Deploy draft to Netlify
Expand All @@ -56,17 +56,17 @@ jobs:
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Build Storybook
run: yarn build:storybook
run: npm run build:storybook

- name: Deploy draft build to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'
build-dir: "./storybook-static"
draft: true
comment-on-commit: true
25 changes: 22 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,34 @@ jobs:
uses: actions/checkout@v1

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Build Storybook
run: yarn build:storybook
run: npm run build:storybook

- name: Deploy production to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'
build-dir: "./storybook-static"

publishPackage:
name: Publish package to npm
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish package
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
stories: ['../src/**/*.stories.@(tsx|mdx)'],
addons: ['@storybook/addon-docs', '@storybook/addon-knobs', '@storybook/addon-actions'],
addons: ['@storybook/addon-essentials'],
};
2 changes: 1 addition & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { create } from '@storybook/theming/create';

addons.setConfig({
theme: create({
brandTitle: 'react-obfuscate-ts',
brandTitle: '🕵️ react-obfuscate-ts',
brandUrl: 'https://github.com/South-Paw/react-obfuscate-ts',
}),
});
4 changes: 4 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const parameters = {
controls: { expanded: true },
layout: 'fullscreen',
};
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
🕵️ A React component to obfuscate contact links and text

[![npm](https://img.shields.io/npm/v/@south-paw/react-obfuscate-ts.svg)](https://www.npmjs.com/package/@south-paw/react-obfuscate-ts)
[![Dependencies](https://david-dm.org/south-paw/react-obfuscate-ts/status.svg)](https://david-dm.org/south-paw/react-obfuscate-ts)
[![Dev Dependencies](https://david-dm.org/south-paw/react-obfuscate-ts/dev-status.svg)](https://david-dm.org/south-paw/react-obfuscate-ts?type=dev)

## Features

- Easy to implement component for hiding your contact links or text in the DOM.
- Supports obfuscation of `email`, `tel`, `sms`, `href` and any other string of text as a child.
- Out of the box `aria-label` for screen readers to identify the obfuscated element.
- Supports the styled-components `as` prop for use with other Link components (such as your own UI libraries link).
- Supports the styled-components `as` prop for use with other Link components (such as your own UI libraries link component).

## How it works

Expand Down
Loading

1 comment on commit 6c88e1c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Netlify deployed react-obfuscate-ts as draft

https://5ffeae3fd9428cb907fb87d6--react-obfuscate-ts.netlify.app

Please sign in to comment.