From 2e0e37e3668d26601f7e33be172e9e37d68bbeb5 Mon Sep 17 00:00:00 2001 From: Dima Vyshniakov Date: Thu, 30 Nov 2023 18:08:01 +0100 Subject: [PATCH] add actions --- .github/dependabot.yml | 9 ++++ .github/workflows/pages.yml | 57 +++++++++++++++++++++++++ .github/workflows/pull-request-jobs.yml | 41 ++++++++++++++++++ .gitignore | 1 + package.json | 14 +++--- pnpm-lock.yaml | 46 +++++++++----------- 6 files changed, 135 insertions(+), 33 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pages.yml create mode 100644 .github/workflows/pull-request-jobs.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f21fb47 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + time: "03:00" + open-pull-requests-limit: 18 + versioning-strategy: increase diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..6bb82c1 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,57 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + - name: Use Node.js ${{ steps.nvm.outputs.NVMRC }} + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.nvm.outputs.NVMRC }} + cache: 'pnpm' + - name: Run deploy tasks + run: | + pnpm install + pnpm run build:docs --quiet + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: './storybook-static' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/pull-request-jobs.yml b/.github/workflows/pull-request-jobs.yml new file mode 100644 index 0000000..7013120 --- /dev/null +++ b/.github/workflows/pull-request-jobs.yml @@ -0,0 +1,41 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + # push: + # branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + lint-test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Cancel Workflow Action + uses: styfle/cancel-workflow-action@0.10.1 + with: + access_token: ${{ github.token }} + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + - name: Use Node.js ${{ steps.nvm.outputs.NVMRC }} + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.nvm.outputs.NVMRC }} + cache: 'pnpm' + - name: Run test tasks + run: | + pnpm install + pnpm run lint:code --quiet + pnpm run lint:style --quiet + pnpm run test --silent + pnpm run start:docs --smoke-test --quiet + pnpm run build diff --git a/.gitignore b/.gitignore index a547bf3..2dca16e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ dist-ssr *.njsproj *.sln *.sw? +storybook-static diff --git a/package.json b/package.json index afcd314..4e8798d 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "fix:style": "run-s 'lint:style --fix'", "test": "jest", "preview": "vite preview", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build", + "start:docs": "storybook dev -p 6006", + "build:docs": "storybook build", "prepare": "is-ci || husky install" }, "peerDependencies": { @@ -54,13 +54,10 @@ "react-dom": ">=18.2.0" }, "dependencies": { - "-": "^0.0.1", - "D": "^1.0.0", - "autoprefixer": "^10.4.16", - "lodash": "^4.17.21", - "postcss": "^8.4.31" + "lodash": "^4.17.21" }, "devDependencies": { + "autoprefixer": "10.4.16", "@storybook/addon-essentials": "7.6.1", "@storybook/addon-interactions": "7.6.1", "@storybook/addon-links": "7.6.1", @@ -84,7 +81,7 @@ "eslint-config-prettier": "8.10.0", "eslint-plugin-import": "2.29.0", "eslint-plugin-prettier": "5.0.1", - "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-refresh": "0.4.4", "eslint-plugin-ssr-friendly": "1.3.0", @@ -96,6 +93,7 @@ "jest-environment-jsdom": "29.7.0", "lint-staged": "15.1.0", "npm-run-all": "4.1.5", + "postcss": "8.4.31", "prettier": "3.1.0", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 923c536..880eb20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,21 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: - '-': - specifier: ^0.0.1 - version: 0.0.1 - D: - specifier: ^1.0.0 - version: 1.0.0 - autoprefixer: - specifier: ^10.4.16 - version: 10.4.16(postcss@8.4.31) lodash: specifier: ^4.17.21 version: 4.17.21 - postcss: - specifier: ^8.4.31 - version: 8.4.31 devDependencies: '@storybook/addon-essentials': @@ -79,6 +67,9 @@ devDependencies: alias-hq: specifier: 6.2.3 version: 6.2.3(@babel/preset-env@7.23.5) + autoprefixer: + specifier: 10.4.16 + version: 10.4.16(postcss@8.4.31) eslint: specifier: 8.53.0 version: 8.53.0 @@ -92,7 +83,7 @@ devDependencies: specifier: 5.0.1 version: 5.0.1(eslint-config-prettier@8.10.0)(eslint@8.53.0)(prettier@3.1.0) eslint-plugin-react: - specifier: ^7.33.2 + specifier: 7.33.2 version: 7.33.2(eslint@8.53.0) eslint-plugin-react-hooks: specifier: 4.6.0 @@ -127,6 +118,9 @@ devDependencies: npm-run-all: specifier: 4.1.5 version: 4.1.5 + postcss: + specifier: 8.4.31 + version: 8.4.31 prettier: specifier: 3.1.0 version: 3.1.0 @@ -172,10 +166,6 @@ devDependencies: packages: - /-@0.0.1: - resolution: {integrity: sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==} - dev: false - /@aashutoshrathi/word-wrap@1.2.6: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} @@ -4688,11 +4678,6 @@ packages: resolution: {integrity: sha512-3iYLKFECbISvItw3Sv2cDVSDI64QdthhKcHEmzWawp27KL/0qXWYPBnSkTnqybFoJ4mNjqjs9HuO52d5DZHjbw==} dev: true - /D@1.0.0: - resolution: {integrity: sha512-nQvrCBu7K2pSSEtIM0EEF03FVjcczCXInMt3moLNFbjlWx6bZrX72uT6/1uAXDbnzGUAx9gTyDiQ+vrFi663oA==} - deprecated: Package no longer supported. Contact support@npmjs.com for more info. - dev: false - /abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} deprecated: Use your platform's native atob() and btoa() methods instead @@ -5100,7 +5085,7 @@ packages: picocolors: 1.0.0 postcss: 8.4.31 postcss-value-parser: 4.2.0 - dev: false + dev: true /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} @@ -5357,6 +5342,7 @@ packages: electron-to-chromium: 1.4.597 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) + dev: true /bs-logger@0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -5453,6 +5439,7 @@ packages: /caniuse-lite@1.0.30001565: resolution: {integrity: sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==} + dev: true /chai@4.3.10: resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==} @@ -6244,6 +6231,7 @@ packages: /electron-to-chromium@1.4.597: resolution: {integrity: sha512-0XOQNqHhg2YgRVRUrS4M4vWjFCFIP2ETXcXe/0KIQBjXE9Cpy+tgzzYfuq6HGai3hWq0YywtG+5XK8fyG08EjA==} + dev: true /emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -6470,6 +6458,7 @@ packages: /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} + dev: true /escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -7183,7 +7172,7 @@ packages: /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} - dev: false + dev: true /fragment-cache@0.2.1: resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==} @@ -9468,6 +9457,7 @@ packages: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + dev: true /nanomatch@1.2.13: resolution: {integrity: sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==} @@ -9534,6 +9524,7 @@ packages: /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} + dev: true /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} @@ -9562,7 +9553,7 @@ packages: /normalize-range@0.1.2: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} - dev: false + dev: true /npm-run-all@4.1.5: resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==} @@ -9963,6 +9954,7 @@ packages: /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -10060,6 +10052,7 @@ packages: /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + dev: true /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} @@ -10068,6 +10061,7 @@ packages: nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -11032,6 +11026,7 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + dev: true /source-map-resolve@0.5.3: resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} @@ -12000,6 +11995,7 @@ packages: browserslist: 4.22.1 escalade: 3.1.1 picocolors: 1.0.0 + dev: true /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}