diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9d3b32..57a61e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,14 +32,6 @@ jobs: with: cmd: 'jq .total.statements.pct packages/maska/coverage/coverage-summary.json' - - name: Build demo - run: npm run build --workspace=docs - - - name: Upload demo artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./packages/docs/docs - badge: runs-on: ubuntu-latest needs: build @@ -70,6 +62,11 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index b8d4e63..6113df6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ## Support ☕️ -Do you like **Maska**? Please support me via [Boosty](https://boosty.to/beholdr). +> ❤️ [Please support](https://boosty.to/beholdr) Maska future development! ## Features ✨ diff --git a/Taskfile.yml b/Taskfile.yml index 41653c4..4abea57 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -10,6 +10,9 @@ tasks: dev:maska-build-watch: npm run build:watch --workspace=packages/maska dev:svelte: npm run dev --workspace=packages/svelte dev:vue: npm run dev --workspace=packages/vue + dev:docs: + dir: docs + cmd: http-server code:test: npm run test --workspaces code:coverage: npm run test:coverage --workspaces diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..3b5459b --- /dev/null +++ b/docs/index.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/docs/docs/maska.svg b/docs/maska.svg similarity index 100% rename from packages/docs/docs/maska.svg rename to docs/maska.svg diff --git a/packages/docs/docs/README.md b/docs/v2/README.md similarity index 98% rename from packages/docs/docs/README.md rename to docs/v2/README.md index 4def345..912ba83 100644 --- a/packages/docs/docs/README.md +++ b/docs/v2/README.md @@ -1,8 +1,8 @@ - + --- -# Maska {{versionLabel}} +# Maska Do you like **Maska**? Please support me via [Boosty](https://boosty.to/beholdr). @@ -11,9 +11,6 @@ Do you like **Maska**? Please support me via [Boosty](https://boosty.to/beholdr) Here are several examples of basic masks that you could create with **Maska**. This demo is interactive: feel free to edit the examples. -
- - # Install diff --git a/packages/docs/docs/index.html b/docs/v2/index.html similarity index 87% rename from packages/docs/docs/index.html rename to docs/v2/index.html index 4983fff..50187ca 100644 --- a/packages/docs/docs/index.html +++ b/docs/v2/index.html @@ -4,17 +4,15 @@ - maska v3 docs + maska v2 docs - + - - diff --git a/packages/docs/src/index.ts b/packages/docs/src/index.ts deleted file mode 100644 index f04cbe2..0000000 --- a/packages/docs/src/index.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { createApp } from 'vue' - -import { vMaska } from '../../vue/src' -import App from './App.vue' - -const examples = [ - { - label: 'Simple mask', - code: `` - }, - { - label: 'Phone mask', - code: `` - }, - { - label: 'HEX-color', - code: `` - }, - { - label: 'IP address with optional digits', - code: `` - }, - { - label: 'Dynamic mask: CPF/CNPJ', - code: `` - }, - { - label: 'Cardholder name: via hook', - code: `const options = {\n preProcess: val => val.toUpperCase()\n}\n\n` - }, - { - label: 'Cardholder name: via token transform', - code: `const options = {\n tokens: {\n A: {\n pattern: /[A-Z]/,\n multiple: true,\n transform: chr => chr.toUpperCase()\n }\n }\n}\n\n` - }, - { - label: 'Year: with current year as a limit', - code: `const options = {\n postProcess: val => {\n const max = "" + new Date().getFullYear()\n return val > max ? max : val\n }\n}\n\n` - }, - { - label: 'Money format: simple', - code: `` - }, - { - label: 'Money format: full via hooks', - code: `const options = {\n preProcess: val => val.replace(/[$,]/g, ''),\n postProcess: val => {\n if (!val) return ''\n\n const sub = 3 - (val.includes('.') ? val.length - val.indexOf('.') : 0)\n\n return Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD'\n }).format(val)\n .slice(0, sub ? -sub : undefined)\n }\n}\n\n` - }, - { - label: 'Reversed number format with thousand separators', - code: `` - } -] - -createApp(App, { examples }) - .directive('maska', vMaska) - .mount('#demo-app') diff --git a/packages/docs/src/v2/index.ts b/packages/docs/src/v2/index.ts deleted file mode 100644 index 6e84e1b..0000000 --- a/packages/docs/src/v2/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { createApp } from 'vue' - -import App from '../App.vue' - -const examples = [ - { - label: 'Simple mask', - code: `` - }, - { - label: 'Phone mask', - code: `` - }, - { - label: 'HEX-color', - code: `` - }, - { - label: 'IP address with optional digits', - code: `` - }, - { - label: 'Dynamic mask: CPF/CNPJ', - code: `` - }, - { - label: 'Cardholder name: via hook', - code: `const options = {\n preProcess: val => val.toUpperCase()\n}\n\n` - }, - { - label: 'Cardholder name: via token transform', - code: `const options = {\n tokens: {\n A: {\n pattern: /[A-Z]/,\n multiple: true,\n transform: chr => chr.toUpperCase()\n }\n }\n}\n\n` - }, - { - label: 'Year: with current year as a limit', - code: `const options = {\n postProcess: val => {\n const max = "" + new Date().getFullYear()\n return val > max ? max : val\n }\n}\n\n` - }, - { - label: 'Money format: simple', - code: `` - }, - { - label: 'Money format: full via hooks', - code: `const options = {\n preProcess: val => val.replace(/[$,]/g, ''),\n postProcess: val => {\n if (!val) return ''\n\n const sub = 3 - (val.includes('.') ? val.length - val.indexOf('.') : 0)\n\n return Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD'\n }).format(val)\n .slice(0, sub ? -sub : undefined)\n }\n}\n\n` - }, - { - label: 'Reversed number format with thousand separators', - code: `` - } -] - -createApp(App, { examples }) - .directive('maska', Maska.vMaska) - .mount('#demo-app') diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json deleted file mode 100644 index 5e10d92..0000000 --- a/packages/docs/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] -} diff --git a/packages/docs/vite.config.mts b/packages/docs/vite.config.mts deleted file mode 100644 index 58c26bd..0000000 --- a/packages/docs/vite.config.mts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' - -export default defineConfig({ - base: '', - build: { - outDir: 'docs/dist', - cssCodeSplit: false, - rollupOptions: { - input: { - demo: 'src/index.ts', - demo_v2: 'src/v2/index.ts' - }, - output: { - entryFileNames: '[name].js', - assetFileNames: '[name][extname]' - } - } - }, - plugins: [vue()] -})