Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 42 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,47 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Print head and base refs
run: |
echo "Head ref: ${{ github.head_ref }}"
echo "Base ref: ${{ github.base_ref }}"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm typecheck

- name: Check code quality
run: |
pnpm lint
pnpm format:check
pnpm run --if-present generate

- name: Security Audit
run: pnpm audit --audit-level moderate || true
continue-on-error: true

- name: Security Audit Summary
if: success() || failure()
run: pnpm audit --audit-level moderate || true

- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ./dist/

- name: Error handling
if: failure()
run: echo "CI failed. Please check the logs."
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1

- name: Print head and base refs
run: |
echo "Head ref: ${{ github.head_ref }}"
echo "Base ref: ${{ github.base_ref }}"

- name: Setup pnpm, Node.js, and dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
runtime: node
node-version-file: .nvmrc
cache: true
require-lockfile: true

- name: Run tests
run: pnpm run test

- name: Type check
run: pnpm run typecheck

- name: Check code quality
run: |
pnpm run lint
pnpm run format:check
pnpm run --if-present generate

- name: Security audit
run: pnpm audit
Comment thread
SMAKSS marked this conversation as resolved.
Resolved

- name: Archive production artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: build-artifacts
path: ./dist/

- name: Error handling
if: failure()
run: echo "CI failed. Please check the logs."
22 changes: 10 additions & 12 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,27 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4

- name: Setup pnpm, Node.js, and dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
runtime: node
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
scope: "@smakss"
cache: pnpm
- name: Ensure npm CLI supports OIDC
run: npm install -g npm@11.5.1
- run: pnpm install --frozen-lockfile
cache: true
require-lockfile: true

- run: pnpm build

- name: Release (master)
if: github.ref_name == 'master'
run: pnpm release
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.14.0
26
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"@semantic-release/github": "^12.0.3",
"@semantic-release/npm": "^13.1.3",
"@semantic-release/release-notes-generator": "^14.1.0",
"@testing-library/react": "^16.3.0",
"@testing-library/react": "^16.3.2",
"@types/react": "^19.2.10",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"@vitest/coverage-v8": "^2.1.9",
"@vitest/coverage-v8": "^4.1.12",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
Expand All @@ -31,9 +31,9 @@
"react-dom": "^19.2.4",
"semantic-release": "^25.0.3",
"typescript": "^5.9.3",
"vite": "^7.3.1",
"vite": "^7.3.7",
"vite-plugin-dts": "^4.5.4",
"vitest": "^2.1.9"
"vitest": "^4.1.12"
},
"engines": {
"node": ">=22.14.0"
Expand Down Expand Up @@ -77,6 +77,7 @@
"license": "MIT",
"main": "dist/index.js",
"name": "@smakss/react-scroll-direction",
"packageManager": "pnpm@12.17.0",
Comment thread
SMAKSS marked this conversation as resolved.
Resolved
"peerDependencies": {
"react": ">=16.8.0"
},
Expand Down
Loading