diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9e90dc0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{html}] +charset = utf-8 +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 69cb318..94462af 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,4 @@ -name: E2E Test +name: Test on: push: @@ -9,18 +9,18 @@ on: - 'pnpm-lock.yaml' - 'src/**/*.ts' - 'src/**/*.vue' - - 'tests/e2e/**/*.spec.ts' + - 'tests/**/*.ts' pull_request: paths: - '.github/workflows/e2e.yml' - 'pnpm-lock.yaml' - 'src/**/*.ts' - 'src/**/*.vue' - - 'tests/e2e/**/*.spec.ts' + - 'tests/**/*.ts' workflow_dispatch: concurrency: - group: e2e-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: @@ -28,33 +28,47 @@ jobs: runs-on: ubuntu-latest env: + CI: 1 DEBUG: 0 PLAYWRIGHT_BROWSERS_PATH: 0 steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/checkout@v4.2.2 + - uses: actions/cache@v4.1.2 with: path: /home/runner/.local/share/pnpm/store key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}- - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v2.4.1 with: - version: 8 + version: 9 run_install: true - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4.1.0 with: - node-version: 18 + node-version: 22 cache: 'pnpm' + - name: Build front + run: pnpm build + + - name: Test front + run: pnpm coverage + + - name: Component Coverage + uses: davelosert/vitest-coverage-report-action@v2.7.0 + if: ${{ always() }} + with: + working-directory: ./ + vite-config-path: ./vite.config.ts + - name: Install Playwright browsers run: npx playwright install --with-deps - name: Run e2e tests run: pnpm test:ci-e2e - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4.4.3 if: always() with: name: playwright-report diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b329d3b..b2a8208 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,20 +7,20 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4.2.2 + - uses: pnpm/action-setup@v2.4.1 with: - version: 8 + version: 9 run_install: false - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4.1.0 with: - node-version: '18' + node-version: 22 - run: | pnpm i --frozen-lockfile pnpm build - - uses: JS-DevTools/npm-publish@v2 + - uses: JS-DevTools/npm-publish@v3.1.1 id: publish with: token: ${{ secrets.NPM_TOKEN }} @@ -45,7 +45,7 @@ jobs: run: echo "${{ steps.changelog.outputs.changelog }}" - name: Create Release - uses: ncipollo/release-action@v1 + uses: ncipollo/release-action@v1.14.0 if: steps.create_tag.outputs.successful with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 457df3f..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Build + Test - -on: - push: - branches: - - main - paths: - - '.github/workflows/test.yml' - - 'pnpm-lock.yaml' - - 'src/**/*.ts' - - 'src/**/*.vue' - pull_request: - paths: - - '.github/workflows/test.yml' - - 'pnpm-lock.yaml' - - 'src/**/*.ts' - - 'src/**/*.vue' - workflow_dispatch: - -concurrency: - group: test-${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - test: - runs-on: ubuntu-latest - env: - DEBUG: 0 - - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install dependencies - run: pnpm i --frozen-lockfile - - # - name: Install playwright browsers - # run: pnpm i - # working-directory: front - - - name: Build front - run: pnpm build - - - name: Test front - run: pnpm coverage - - - name: Component Coverage - uses: davelosert/vitest-coverage-report-action@v1.4.0 - if: ${{ always() }} - with: - working-directory: ./ - vite-config-path: ./vite.config.ts diff --git a/.gitignore b/.gitignore index d0308e4..0e29950 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules dist +*.tsbuildinfo /tests/e2e/videos/ /tests/e2e/screenshots/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..f37f2ab --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 120, + "arrowParens": "avoid", + "trailingComma": "es5" +} diff --git a/CHANGES.md b/CHANGES.md index 2824c94..56ff9fd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # @slipmatio/ui +### 0.2.0 - (2024-11-14) + +- Fix: make sure button text doesn't wrap. +- Chore: upgraded Vite and Renovate configs. +- Chore: bumped deps. + ### 0.1.2 - (2023-07-17) - CI: tag and release automatically on publish. diff --git a/build/rollup.config.js b/build/rollup.config.js deleted file mode 100644 index 7f94ff2..0000000 --- a/build/rollup.config.js +++ /dev/null @@ -1,168 +0,0 @@ -// rollup.config.js -import fs from 'fs' -import path from 'path' -import vue from 'rollup-plugin-vue' -import alias from '@rollup/plugin-alias' -import commonjs from '@rollup/plugin-commonjs' -import resolve from '@rollup/plugin-node-resolve' -import replace from '@rollup/plugin-replace' -import babel from '@rollup/plugin-babel' -import PostCSS from 'rollup-plugin-postcss' -import { terser } from 'rollup-plugin-terser' -import minimist from 'minimist' - -// Get browserslist config and remove ie from es build targets -const esbrowserslist = fs - .readFileSync('./.browserslistrc') - .toString() - .split('\n') - .filter((entry) => entry && entry.substring(0, 2) !== 'ie') - -const argv = minimist(process.argv.slice(2)) - -const projectRoot = path.resolve(__dirname, '..') - -const baseConfig = { - input: 'src/entry.ts', - plugins: { - preVue: [ - alias({ - entries: [ - { - find: '@', - replacement: `${path.resolve(projectRoot, 'src')}`, - }, - ], - customResolver: resolve({ - extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'], - }), - }), - ], - replace: { - 'process.env.NODE_ENV': JSON.stringify('production'), - }, - vue: {}, - postVue: [ - // Process only `