diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6f2c750..c0bece7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: dryRun: - description: 'Dry run only' + description: Dry run only required: true default: true type: boolean @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - registry-url: 'https://registry.npmjs.org' + registry-url: https://registry.npmjs.org - run: npm ci - name: Publish package diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5be7396..6095665 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,8 +12,43 @@ jobs: node-version: [18, 20] steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm test + + use-in-a-client-project: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - name: Pack our shareable config + run: | + mkdir ${{ runner.temp }}/packed + npm pack --pack-destination ${{ runner.temp }}/packed + + - name: Create a client project + working-directory: ${{ runner.temp }} + run: | + mkdir some-project + cd some-project + npm init -y + touch index.js + + - name: Install our config in the client project + working-directory: ${{ runner.temp }}/some-project + run: | + npm install --save-dev ../packed/*.tgz + + - name: Use shareable config (also checks peer dependencies) + working-directory: ${{ runner.temp }}/some-project + run: | + echo '{ "extends": "pa11y" }' > .eslintrc.json + npx --no eslint . diff --git a/package-lock.json b/package-lock.json index ab2c36c..adc9428 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "pa11y-lint-config", + "name": "eslint-config-pa11y", "version": "3.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "pa11y-lint-config", + "name": "eslint-config-pa11y", "version": "3.0.0", "license": "LGPL-3.0", "devDependencies": { diff --git a/package.json b/package.json index 9ff7297..41e2a28 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pa11y-lint-config", + "name": "eslint-config-pa11y", "version": "3.0.0", "description": "Linter configurations for Pa11y projects", "author": "Team Pa11y",