diff --git a/.changeset/two-dolphins-give.md b/.changeset/two-dolphins-give.md new file mode 100644 index 0000000..149dc4e --- /dev/null +++ b/.changeset/two-dolphins-give.md @@ -0,0 +1,5 @@ +--- +'css-preflight': patch +--- + +Internal updates to stylelint, github actions, and Readme. diff --git a/.github/composite-actions/code-checks/action.yml b/.github/composite-actions/code-checks/action.yml new file mode 100644 index 0000000..9f080fc --- /dev/null +++ b/.github/composite-actions/code-checks/action.yml @@ -0,0 +1,9 @@ +name: Code Checks +description: Checks code for compliance using linting, tests, etc. + +runs: + using: 'composite' + steps: + - name: Lint Styles + run: pnpm run lint + shell: bash diff --git a/.github/composite-actions/node-setup-ubuntu/action.yml b/.github/composite-actions/node-setup-ubuntu/action.yml new file mode 100644 index 0000000..0b5b223 --- /dev/null +++ b/.github/composite-actions/node-setup-ubuntu/action.yml @@ -0,0 +1,21 @@ +name: Node Setup Ubuntu +description: Sets up Node, PNPM, and installs packages. + +runs: + using: 'composite' + steps: + - name: Install PNPM + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + cache: pnpm + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + shell: bash diff --git a/.github/workflows/pr-main.yml b/.github/workflows/pr-main.yml index 4b13c20..7a04b9b 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/pr-main.yml @@ -1,4 +1,4 @@ -name: PR To Main Branch +name: On PR To Main Branch on: pull_request: @@ -9,26 +9,15 @@ on: - main jobs: - lint: + checks: + name: Code Checks runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Install PNPM - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false + - name: Prep Project + uses: ./.github/composite-actions/node-setup-ubuntu - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20.x - cache: pnpm - - - name: Install Dependencies - run: pnpm install --frozen-lockfile - - - name: Lint Styles - run: pnpm run lint + - name: Code Checks + uses: ./.github/composite-actions/code-checks diff --git a/.github/workflows/push-main.yml b/.github/workflows/push-main.yml index 1f0e42b..73bb70f 100644 --- a/.github/workflows/push-main.yml +++ b/.github/workflows/push-main.yml @@ -1,37 +1,26 @@ -name: Push To Main Branch +name: On Push To Main Branch on: push: branches: - main -# So no other instances of workflow running at same time +# So no other instances of release workflow run at same time concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: release: + name: Changesets Release Flow runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Install PNPM - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20.x - cache: pnpm + - name: Prep Project + uses: ./.github/composite-actions/node-setup-ubuntu - - name: Install Dependencies - run: pnpm install --frozen-lockfile - - - name: Lint Styles - run: pnpm run lint + - name: Code Checks + uses: ./.github/composite-actions/code-checks - name: 1Password Load Tokens id: op-tokens @@ -49,3 +38,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # NPM_TOKEN: set in steps.op-tokens (export-env: true) + + - name: Regen Readme NPM Badge + run: curl -X GET "https://img.shields.io/npm/v/css-preflight?color=red" + shell: bash diff --git a/.stylelintrc.json b/.stylelintrc.json index fbd4a2c..5390f6f 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,4 +1,10 @@ { "$schema": "https://json.schemastore.org/stylelintrc.json", - "extends": "stylelint-config-standard" + "extends": "stylelint-config-standard", + "plugins": [ + "stylelint-prettier" + ], + "rules": { + "prettier/prettier": true + } } \ No newline at end of file diff --git a/package.json b/package.json index 86bd938..d7955ff 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "devDependencies": { "@changesets/cli": "2.27.1", "stylelint": "15.11.0", - "stylelint-config-standard": "34.0.0" + "stylelint-config-standard": "34.0.0", + "stylelint-prettier": "4.1.0" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b45f094..b83a218 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ devDependencies: stylelint-config-standard: specifier: 34.0.0 version: 34.0.0(stylelint@15.11.0) + stylelint-prettier: + specifier: 4.1.0 + version: 4.1.0(prettier@3.1.0)(stylelint@15.11.0) packages: @@ -817,6 +820,10 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true + /fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + dev: true + /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -1722,12 +1729,25 @@ packages: which-pm: 2.0.0 dev: true + /prettier-linter-helpers@1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} + engines: {node: '>=6.0.0'} + dependencies: + fast-diff: 1.3.0 + dev: true + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true dev: true + /prettier@3.1.0: + resolution: {integrity: sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true @@ -2120,6 +2140,18 @@ packages: stylelint-config-recommended: 13.0.0(stylelint@15.11.0) dev: true + /stylelint-prettier@4.1.0(prettier@3.1.0)(stylelint@15.11.0): + resolution: {integrity: sha512-dd653q/d1IfvsSQshz1uAMe+XDm6hfM/7XiFH0htYY8Lse/s5ERTg7SURQehZPwVvm/rs7AsFhda9EQ2E9TS0g==} + engines: {node: ^14.17.0 || >=16.0.0} + peerDependencies: + prettier: '>=3.0.0' + stylelint: '>=15.8.0' + dependencies: + prettier: 3.1.0 + prettier-linter-helpers: 1.0.0 + stylelint: 15.11.0 + dev: true + /stylelint@15.11.0: resolution: {integrity: sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw==} engines: {node: ^14.13.1 || >=16.0.0}