Skip to content

Commit 7d732c6

Browse files
authored
Merge pull request #333 from SMAKSS/feat/upgrade-core-deps-and-structure
Feat/upgrade core deps and structure
2 parents 459176f + 4a3eccd commit 7d732c6

41 files changed

Lines changed: 8419 additions & 2455 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
3+
github: [SMAKSS]
4+
ko_fi: smakss

.github/copilot-instructions.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copilot Instructions
2+
3+
Follow the repo’s existing patterns and tooling:
4+
5+
- Use pnpm for scripts and installs.
6+
- Keep ESM imports/exports (`type: "module"`).
7+
- Prefer Vite library build for package output.
8+
- Use existing ESLint configs (root + `playground/`).
9+
- Keep build output under `dist/`.
10+
- Avoid changes to public APIs unless requested.
11+
12+
Helpful commands:
13+
- `pnpm lint`
14+
- `pnpm typecheck`
15+
- `pnpm build`
16+

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ updates:
44
directory: "/"
55
schedule:
66
interval: daily
7-
reviewers:
8-
- "SMAKSS"
9-
assignees:
10-
- "SMAKSS"
117
labels:
128
- "dependencies"
139
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR Checks
22

33
on:
44
pull_request:
5-
branches: [master]
5+
branches: [master, develop]
66

77
jobs:
88
build:
@@ -18,45 +18,42 @@ jobs:
1818
echo "Head ref: ${{ github.head_ref }}"
1919
echo "Base ref: ${{ github.base_ref }}"
2020
21-
- name: Setup Node.js
22-
uses: actions/setup-node@v4
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
2323
with:
24-
node-version: 20
24+
version: 10
2525

26-
- name: Cache dependencies
27-
uses: actions/cache@v4
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
2828
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-
29+
node-version-file: .nvmrc
30+
cache: pnpm
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
5754
with:
5855
name: build-artifacts
59-
path: ./build/
56+
path: ./dist/
6057

6158
- name: Error handling
6259
if: failure()

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,40 @@
1-
name: "@smakss/react-scroll-direction"
1+
name: Release
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
branches: [master, develop]
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version: 20
15-
- run: yarn
16-
- run: yarn generate
17-
- uses: actions/upload-artifact@v4
18-
with:
19-
name: built-package
20-
path: |
21-
./path-to-your-build-folder
22-
package.json
23-
24-
publish-npm:
25-
needs: build
8+
release:
269
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
2714
steps:
2815
- uses: actions/checkout@v4
29-
- uses: actions/download-artifact@v4
3016
with:
31-
name: built-package
17+
fetch-depth: 0
3218
- uses: actions/setup-node@v4
3319
with:
34-
node-version: 18
20+
node-version-file: .nvmrc
3521
registry-url: https://registry.npmjs.org/
3622
scope: "@smakss"
37-
- run: yarn install
38-
- run: yarn generate
39-
- run: |
40-
if grep -q "beta" package.json; then
41-
echo "Publishing Beta to npm"
42-
npm publish --tag beta
43-
else
44-
echo "Publishing Release to npm"
45-
npm publish
46-
fi
47-
env:
48-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
49-
50-
publish-gpr:
51-
needs: build
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: actions/download-artifact@v4
23+
cache: pnpm
24+
- uses: pnpm/action-setup@v4
5625
with:
57-
name: built-package
58-
- uses: actions/setup-node@v4
59-
with:
60-
node-version: 18
61-
registry-url: https://npm.pkg.github.com/
62-
scope: "@smakss"
63-
- run: yarn install
64-
- run: yarn generate
65-
- run: |
66-
if grep -q "beta" package.json; then
67-
echo "Publishing Beta to GitHub Package Registry"
68-
npm publish --tag beta
69-
else
70-
echo "Publishing Release to GitHub Package Registry"
71-
npm publish
72-
fi
26+
version: 10
27+
- run: pnpm install --frozen-lockfile
28+
- run: pnpm build
29+
- name: Release (master)
30+
if: github.ref_name == 'master'
31+
run: pnpm release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
- name: Release dry run (develop)
36+
if: github.ref_name == 'develop'
37+
run: pnpm release --dry-run
7338
env:
74-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.husky/commit-msg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
yarn commitlint --edit ${1}
1+
pnpm commitlint --edit ${1}

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
yarn lint-staged
1+
pnpm lint-staged

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0

.releaserc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @type {import('semantic-release').GlobalConfig}
3+
*/
4+
export default {
5+
branches: ['master', {name: 'develop', prerelease: true, channel: 'dev'}],
6+
plugins: [
7+
'@semantic-release/commit-analyzer',
8+
'@semantic-release/release-notes-generator',
9+
'@semantic-release/npm',
10+
[
11+
'@semantic-release/github',
12+
{
13+
assets: ['dist/**'],
14+
},
15+
],
16+
],
17+
}

AGENTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# AGENTS
2+
3+
Use these instructions for automation and assistant behavior in this repo.
4+
5+
## Project overview
6+
7+
- Package: `@smakss/react-scroll-direction`
8+
- Build: Vite library build
9+
- Package manager: pnpm
10+
- Linting: ESLint (main + playground configs)
11+
12+
## Working rules
13+
14+
- Prefer pnpm scripts (`pnpm run <script>`).
15+
- Keep changes ESM-friendly (`type: "module"`).
16+
- Preserve existing file structure and naming conventions.
17+
- Avoid large refactors unless requested.
18+
- Keep output in `dist/` only.
19+
20+
## Commands
21+
22+
- Build: `pnpm build`
23+
- Lint (all): `pnpm lint`
24+
- Lint (main): `pnpm lint:main`
25+
- Lint (playground): `pnpm lint:playground`
26+
- Typecheck (all): `pnpm typecheck`
27+
- Typecheck (main): `pnpm typecheck:main`
28+
- Typecheck (playground): `pnpm typecheck:playground`
29+
30+
## Playground
31+
32+
- Location: `playground/`
33+
- Run dev server: `pnpm -C playground dev`

0 commit comments

Comments
 (0)