Skip to content

Commit f10c86e

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 48e9a92 commit f10c86e

9 files changed

Lines changed: 3392 additions & 2761 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,32 @@ jobs:
2222
uses: actions/setup-node@v4
2323
with:
2424
node-version: 20
25+
cache: pnpm
2526

26-
- name: Cache dependencies
27-
uses: actions/cache@v4
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
2829
with:
29-
path: |
30-
**/node_modules
31-
key: ${{ runner.os }}-node-18-yarn-${{ hashFiles('**/yarn.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-18-yarn-
30+
version: 10
3431

3532
- name: Install dependencies
36-
run: yarn install
33+
run: pnpm install --frozen-lockfile
3734

3835
- name: Type check
39-
run: yarn typecheck
36+
run: pnpm typecheck
4037

4138
- name: Check code quality
4239
run: |
43-
yarn lint
44-
yarn format:check
45-
yarn run --if-present generate
40+
pnpm lint
41+
pnpm format:check
42+
pnpm run --if-present generate
4643
4744
- name: Security Audit
48-
run: yarn audit --level moderate || true
45+
run: pnpm audit --audit-level moderate || true
4946
continue-on-error: true
5047

5148
- name: Security Audit Summary
5249
if: success() || failure()
53-
run: yarn audit --summary
50+
run: pnpm audit --audit-level moderate || true
5451

5552
- name: Archive production artifacts
5653
uses: actions/upload-artifact@v4

.github/workflows/npm-publish.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
13+
with:
14+
version: 10
1215
- uses: actions/setup-node@v4
1316
with:
1417
node-version: 20
15-
- run: yarn
16-
- run: yarn generate
18+
cache: pnpm
19+
- run: pnpm install --frozen-lockfile
20+
- run: pnpm generate
1721
- uses: actions/upload-artifact@v4
1822
with:
1923
name: built-package
2024
path: |
21-
./path-to-your-build-folder
25+
./dist
2226
package.json
2327
2428
publish-npm:
@@ -29,13 +33,17 @@ jobs:
2933
- uses: actions/download-artifact@v4
3034
with:
3135
name: built-package
36+
- uses: pnpm/action-setup@v4
37+
with:
38+
version: 10
3239
- uses: actions/setup-node@v4
3340
with:
3441
node-version: 18
3542
registry-url: https://registry.npmjs.org/
3643
scope: "@smakss"
37-
- run: yarn install
38-
- run: yarn generate
44+
cache: pnpm
45+
- run: pnpm install --frozen-lockfile
46+
- run: pnpm generate
3947
- run: |
4048
if grep -q "beta" package.json; then
4149
echo "Publishing Beta to npm"
@@ -55,13 +63,17 @@ jobs:
5563
- uses: actions/download-artifact@v4
5664
with:
5765
name: built-package
66+
- uses: pnpm/action-setup@v4
67+
with:
68+
version: 10
5869
- uses: actions/setup-node@v4
5970
with:
6071
node-version: 18
6172
registry-url: https://npm.pkg.github.com/
6273
scope: "@smakss"
63-
- run: yarn install
64-
- run: yarn generate
74+
cache: pnpm
75+
- run: pnpm install --frozen-lockfile
76+
- run: pnpm generate
6577
- run: |
6678
if grep -q "beta" package.json; then
6779
echo "Publishing Beta to GitHub Package Registry"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ First and foremost, thank you for considering contributing to @smakss/react-scro
1212
Before you start working on your contribution, you need to set up your development environment. After cloning the repository, run the following commands:
1313

1414
```bash
15-
yarn setup
15+
pnpm setup
1616
```
1717

1818
This will install all the necessary development dependencies and set up Git hooks using Husky.

Readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ Experience the extended capabilities of `@smakss/react-scroll-direction` on Code
1414

1515
## Installation
1616

17-
Install `@smakss/react-scroll-direction` via npm or yarn:
17+
Install `@smakss/react-scroll-direction` via npm, yarn, or pnpm:
1818

1919
```bash
2020
npm install @smakss/react-scroll-direction
2121
# or
2222
yarn add @smakss/react-scroll-direction
23+
# or
24+
pnpm add @smakss/react-scroll-direction
2325
```
2426

2527
Then, import it into your project:

lint-staged.config.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
"*.+(js|jsx|ts|tsx)": ["yarn lint", () => "yarn typecheck"],
3-
"*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|graphql|mdx)": ["yarn format"],
2+
"*.+(js|jsx|ts|tsx)": ["pnpm lint", () => "pnpm typecheck"],
3+
"*.+(js|jsx|json|yml|yaml|css|ts|tsx|md|graphql|mdx)": ["pnpm format"],
44
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"lint-staged": "^16.2.7",
1919
"prettier": "^3.8.1",
2020
"typescript": "^5.9.3",
21-
"vite": "^6.3.6",
21+
"vite": "^6.4.1",
2222
"vite-plugin-dts": "^4.5.4"
2323
},
2424
"engines": {
@@ -42,7 +42,7 @@
4242
"direction-and-position-detection",
4343
"scroll-hook",
4444
"npm",
45-
"yarn",
45+
"pnpm",
4646
"react",
4747
"remix",
4848
"nextjs",
@@ -74,9 +74,9 @@
7474
"generate": "vite build",
7575
"lint": "npx eslint --cache --cache-location ./node_modules/.cache/.eslintcache --max-warnings=0 .",
7676
"lint:fix": "npx eslint --fix .",
77-
"setup": "yarn && husky install",
77+
"setup": "pnpm install && husky",
7878
"typecheck": "tsc -b .",
79-
"update:deps": "rm -rf node_modules yarn.lock && npx npm-check-updates -u && yarn"
79+
"update:deps": "rm -rf node_modules pnpm-lock.yaml && npx npm-check-updates -u && pnpm install"
8080
},
8181
"type": "module",
8282
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)