From 1431172c23470033a78ff731c54328cabcef670f Mon Sep 17 00:00:00 2001 From: devrnt Date: Sat, 2 Jan 2021 18:17:41 +0100 Subject: [PATCH 1/4] chore: rename examples to playground --- .vscode/settings.json | 3 +++ {example => playground}/.npmignore | 0 {example => playground}/components/animatedStep.tsx | 0 {example => playground}/components/asyncStep.tsx | 2 +- {example => playground}/components/footer.tsx | 2 +- {example => playground}/components/index.ts | 0 {example => playground}/components/step.tsx | 2 +- {example => playground}/hooks/index.ts | 0 {example => playground}/hooks/useMockMutation.tsx | 0 {example => playground}/index.html | 0 {example => playground}/index.tsx | 2 +- {example => playground}/package.json | 2 +- {example => playground}/style.css | 0 {example => playground}/tsconfig.json | 0 {example => playground}/yarn.lock | 0 15 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .vscode/settings.json rename {example => playground}/.npmignore (100%) rename {example => playground}/components/animatedStep.tsx (100%) rename {example => playground}/components/asyncStep.tsx (95%) rename {example => playground}/components/footer.tsx (94%) rename {example => playground}/components/index.ts (100%) rename {example => playground}/components/step.tsx (93%) rename {example => playground}/hooks/index.ts (100%) rename {example => playground}/hooks/useMockMutation.tsx (100%) rename {example => playground}/index.html (100%) rename {example => playground}/index.tsx (97%) rename {example => playground}/package.json (96%) rename {example => playground}/style.css (100%) rename {example => playground}/tsconfig.json (100%) rename {example => playground}/yarn.lock (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d7207a4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules\\typescript\\lib" +} \ No newline at end of file diff --git a/example/.npmignore b/playground/.npmignore similarity index 100% rename from example/.npmignore rename to playground/.npmignore diff --git a/example/components/animatedStep.tsx b/playground/components/animatedStep.tsx similarity index 100% rename from example/components/animatedStep.tsx rename to playground/components/animatedStep.tsx diff --git a/example/components/asyncStep.tsx b/playground/components/asyncStep.tsx similarity index 95% rename from example/components/asyncStep.tsx rename to playground/components/asyncStep.tsx index 302eea5..b0e54ff 100644 --- a/example/components/asyncStep.tsx +++ b/playground/components/asyncStep.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { useWizard } from '../..'; +import { useWizard } from '../../dist'; import { useMockMutation } from '../hooks'; type Props = { diff --git a/example/components/footer.tsx b/playground/components/footer.tsx similarity index 94% rename from example/components/footer.tsx rename to playground/components/footer.tsx index 213211e..3bee9c5 100644 --- a/example/components/footer.tsx +++ b/playground/components/footer.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { useWizard } from '../..'; +import { useWizard } from '../../dist'; const Footer: React.FC = React.memo(() => { const { diff --git a/example/components/index.ts b/playground/components/index.ts similarity index 100% rename from example/components/index.ts rename to playground/components/index.ts diff --git a/example/components/step.tsx b/playground/components/step.tsx similarity index 93% rename from example/components/step.tsx rename to playground/components/step.tsx index 7caf1f6..5d124a9 100644 --- a/example/components/step.tsx +++ b/playground/components/step.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { useWizard } from '../..'; +import { useWizard } from '../../dist'; type Props = { number: number; diff --git a/example/hooks/index.ts b/playground/hooks/index.ts similarity index 100% rename from example/hooks/index.ts rename to playground/hooks/index.ts diff --git a/example/hooks/useMockMutation.tsx b/playground/hooks/useMockMutation.tsx similarity index 100% rename from example/hooks/useMockMutation.tsx rename to playground/hooks/useMockMutation.tsx diff --git a/example/index.html b/playground/index.html similarity index 100% rename from example/index.html rename to playground/index.html diff --git a/example/index.tsx b/playground/index.tsx similarity index 97% rename from example/index.tsx rename to playground/index.tsx index b15cda7..556f7cc 100644 --- a/example/index.tsx +++ b/playground/index.tsx @@ -4,7 +4,7 @@ import './style.css'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { Wizard } from '../.'; +import { Wizard } from '../dist'; import { AsyncStep, Footer, Step } from './components'; import AnimatedStep from './components/animatedStep'; diff --git a/example/package.json b/playground/package.json similarity index 96% rename from example/package.json rename to playground/package.json index 0721084..0ea14c8 100644 --- a/example/package.json +++ b/playground/package.json @@ -1,5 +1,5 @@ { - "name": "example", + "name": "playground", "version": "1.0.0", "main": "index.js", "license": "MIT", diff --git a/example/style.css b/playground/style.css similarity index 100% rename from example/style.css rename to playground/style.css diff --git a/example/tsconfig.json b/playground/tsconfig.json similarity index 100% rename from example/tsconfig.json rename to playground/tsconfig.json diff --git a/example/yarn.lock b/playground/yarn.lock similarity index 100% rename from example/yarn.lock rename to playground/yarn.lock From bdf86ae38aa25ca50d05f860d4d3d65f85c894a8 Mon Sep 17 00:00:00 2001 From: devrnt Date: Sat, 2 Jan 2021 21:25:01 +0100 Subject: [PATCH 2/4] chore: add github deploy action --- .github/workflows/deploy.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..c0afdb7 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy to Github Pages + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '14.x' + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - run: yarn install --frozen-lockfile + - run: yarn build + - run: yarn build:playground + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./playground/dist \ No newline at end of file From d5c48b541e3c2c58699df2dec7d84d3644b21ab3 Mon Sep 17 00:00:00 2001 From: devrnt Date: Sat, 2 Jan 2021 21:25:33 +0100 Subject: [PATCH 3/4] chore: add playground assets --- playground/assets/images/githubLogo.svg | 3 +++ playground/assets/images/logo.svg | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 playground/assets/images/githubLogo.svg create mode 100644 playground/assets/images/logo.svg diff --git a/playground/assets/images/githubLogo.svg b/playground/assets/images/githubLogo.svg new file mode 100644 index 0000000..c4e93b4 --- /dev/null +++ b/playground/assets/images/githubLogo.svg @@ -0,0 +1,3 @@ + + + diff --git a/playground/assets/images/logo.svg b/playground/assets/images/logo.svg new file mode 100644 index 0000000..e892603 --- /dev/null +++ b/playground/assets/images/logo.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From f2224df5a84c17b0f13cbbf0d25f774cda1ce56e Mon Sep 17 00:00:00 2001 From: devrnt Date: Sat, 2 Jan 2021 21:28:36 +0100 Subject: [PATCH 4/4] feat: add playground site --- package.json | 1 + playground/app.tsx | 20 +++ playground/components/asyncStep.tsx | 35 ++-- playground/components/footer.tsx | 54 ++++-- playground/components/index.ts | 2 + playground/components/step.tsx | 46 ++++-- playground/components/tooltip.tsx | 34 ++++ playground/global.d.ts | 9 + playground/index.html | 7 +- playground/index.tsx | 43 +---- playground/modules/common/button.tsx | 37 +++++ playground/modules/common/index.ts | 3 + playground/modules/common/page.tsx | 103 ++++++++++++ playground/modules/common/style.tsx | 58 +++++++ playground/modules/index.ts | 1 + playground/modules/wizard/wizard.tsx | 76 +++++++++ playground/package.json | 6 +- playground/yarn.lock | 239 +++++++++++++++++++++++---- 18 files changed, 657 insertions(+), 117 deletions(-) create mode 100644 playground/app.tsx create mode 100644 playground/components/tooltip.tsx create mode 100644 playground/global.d.ts create mode 100644 playground/modules/common/button.tsx create mode 100644 playground/modules/common/index.ts create mode 100644 playground/modules/common/page.tsx create mode 100644 playground/modules/common/style.tsx create mode 100644 playground/modules/index.ts create mode 100644 playground/modules/wizard/wizard.tsx diff --git a/package.json b/package.json index 53fccf3..dbe38cc 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "scripts": { "start": "tsdx watch", "build": "tsdx build", + "build:playground": "yarn --cwd ./playground install && yarn --cwd ./playground build", "test": "tsdx test --passWithNoTests", "test:watch": "tsdx test --watch", "test:coverage": "tsdx test --coverage", diff --git a/playground/app.tsx b/playground/app.tsx new file mode 100644 index 0000000..615ba98 --- /dev/null +++ b/playground/app.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; + +import { WizardModule } from './modules'; +import { Page, Style } from './modules/common'; + +const App = () => { + return ( + <> +