Skip to content

Commit fce0992

Browse files
authored
Merge pull request #339 from SMAKSS/develop
[Release] Upgrade deps and structure
2 parents 6fa6615 + 4239e34 commit fce0992

39 files changed

Lines changed: 8415 additions & 2450 deletions

.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/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 & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,41 @@
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:
8+
release:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
id-token: write
1015
steps:
1116
- 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
1817
with:
19-
name: built-package
20-
path: |
21-
./path-to-your-build-folder
22-
package.json
23-
24-
publish-npm:
25-
needs: build
26-
runs-on: ubuntu-latest
27-
steps:
28-
- uses: actions/checkout@v4
29-
- uses: actions/download-artifact@v4
18+
fetch-depth: 0
19+
- uses: pnpm/action-setup@v4
3020
with:
31-
name: built-package
21+
version: 10
3222
- uses: actions/setup-node@v4
3323
with:
34-
node-version: 18
24+
node-version-file: .nvmrc
3525
registry-url: https://registry.npmjs.org/
3626
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
27+
cache: pnpm
28+
- name: Ensure npm CLI supports OIDC
29+
run: npm install -g npm@11.5.1
30+
- run: pnpm install --frozen-lockfile
31+
- run: pnpm build
32+
- name: Release (master)
33+
if: github.ref_name == 'master'
34+
run: pnpm release
4735
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
56-
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
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Release (develop)
38+
if: github.ref_name == 'develop'
39+
run: pnpm release
7340
env:
74-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_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`

CODE_OF_CONDUCT.md

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,85 @@
22

33
## 1. Purpose
44

5-
A primary goal of @smakss/react-scroll-direction is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
5+
A primary goal of @smakss/react-scroll-direction is to be inclusive to the
6+
largest number of contributors, with the most varied and diverse backgrounds
7+
possible. As such, we are committed to providing a friendly, safe, and welcoming
8+
environment for all, regardless of gender, sexual orientation, ability,
9+
ethnicity, socioeconomic status, and religion (or lack thereof).
610

7-
This Code of Conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
11+
This Code of Conduct outlines our expectations for all those who participate in
12+
our community, as well as the consequences for unacceptable behavior.
813

914
## 2. Open [Source/Culture/Tech] Citizenship
1015

11-
A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
16+
A supplemental goal of this Code of Conduct is to increase open
17+
[source/culture/tech] citizenship by encouraging participants to recognize and
18+
strengthen the relationships between our actions and their effects on our
19+
community.
1220

1321
## 3. Expected Behavior
1422

1523
The following behaviors are expected and requested of all community members:
1624

17-
- Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
25+
- Participate in an authentic and active way. In doing so, you contribute to the
26+
health and longevity of this community.
1827
- Exercise consideration and respect in your speech and actions.
1928
- Attempt collaboration before conflict.
2029
- Refrain from demeaning, discriminatory, or harassing behavior and speech.
2130
- Be mindful of your surroundings and of your fellow participants.
22-
- Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
31+
- Alert community leaders if you notice a dangerous situation, someone in
32+
distress, or violations of this Code of Conduct, even if they seem
33+
inconsequential.
2334

2435
## 4. Unacceptable Behavior
2536

26-
The following behaviors are considered harassment and are unacceptable within our community:
37+
The following behaviors are considered harassment and are unacceptable within
38+
our community:
2739

28-
- Violence, threats of violence, or violent language directed against another person.
29-
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
40+
- Violence, threats of violence, or violent language directed against another
41+
person.
42+
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory
43+
jokes and language.
3044
- Posting or displaying sexually explicit or violent material.
31-
- Posting or threatening to post other people's personally identifying information ("doxing").
32-
- Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
45+
- Posting or threatening to post other people's personally identifying
46+
information ("doxing").
47+
- Personal insults, particularly those related to gender, sexual orientation,
48+
race, religion, or disability.
3349
- Inappropriate photography or recording.
34-
- Unwelcome sexual attention. This includes, but is not limited to: inappropriate touching, groping, and unwarranted comments.
50+
- Unwelcome sexual attention. This includes, but is not limited to:
51+
inappropriate touching, groping, and unwarranted comments.
3552
- Advocating for, or encouraging, any of the above behavior.
3653
- Stalking or following.
3754

3855
## 5. Consequences of Unacceptable Behavior
3956

40-
Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated. Anyone asked to stop unacceptable behavior is expected to comply immediately.
57+
Unacceptable behavior from any community member, including sponsors and those
58+
with decision-making authority, will not be tolerated. Anyone asked to stop
59+
unacceptable behavior is expected to comply immediately.
4160

42-
If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning.
61+
If a community member engages in unacceptable behavior, the community organizers
62+
may take any action they deem appropriate, up to and including a temporary ban
63+
or permanent expulsion from the community without warning.
4364

4465
## 6. Reporting Guidelines
4566

46-
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. @SMAKSS.
67+
If you are subject to or witness unacceptable behavior, or have any other
68+
concerns, please notify a community organizer as soon as possible. @SMAKSS.
4769

48-
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe.
70+
Additionally, community organizers are available to help community members
71+
engage with local law enforcement or to otherwise help those experiencing
72+
unacceptable behavior feel safe.
4973

5074
## 7. Addressing Grievances
5175

52-
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify the project team with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
76+
If you feel you have been falsely or unfairly accused of violating this Code of
77+
Conduct, you should notify the project team with a concise description of your
78+
grievance. Your grievance will be handled in accordance with our existing
79+
governing policies.
5380

5481
## 8. Scope
5582

56-
We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues–online and in-person–as well as in all one-on-one communications pertaining to community business.
83+
We expect all community participants (contributors, paid or otherwise; sponsors;
84+
and other guests) to abide by this Code of Conduct in all community
85+
venues–online and in-person–as well as in all one-on-one communications
86+
pertaining to community business.

0 commit comments

Comments
 (0)