Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
48e9a92
Refactor code structure for improved readability and maintainability
SMAKSS Feb 1, 2026
f10c86e
Refactor code structure for improved readability and maintainability
SMAKSS Feb 1, 2026
4a1f6db
Refactor code structure for improved readability and maintainability
SMAKSS Feb 1, 2026
1026ea3
feat(core): Update project to use pnpm, add playground for testing, a…
SMAKSS Feb 1, 2026
8030426
refactor(types): replace enum declarations with const objects for Axi…
SMAKSS Feb 1, 2026
38e5f9c
chore(format): apply prettier's new rules
SMAKSS Feb 1, 2026
3cf6dbd
feat(release): update release process to include develop branch and e…
SMAKSS Feb 1, 2026
cf48142
fix(exports): update exports field to include types and default entry…
SMAKSS Feb 1, 2026
62b8f8c
feat(build): enhance build scripts to clean dist directory before bui…
SMAKSS Feb 1, 2026
ef2896f
feat(docs): add Copilot and AGENTS instructions for automation and pr…
SMAKSS Feb 1, 2026
86e38be
feat(ci): update Node.js setup to use .nvmrc for version management a…
SMAKSS Feb 1, 2026
a8ab339
refactor(ci): streamline pnpm setup in CI workflows
SMAKSS Feb 1, 2026
dc500df
feat(ci): allow PR checks on develop branch in CI workflow
SMAKSS Feb 1, 2026
e171e67
fix(scripts): update typecheck:playground script to build before type…
SMAKSS Feb 1, 2026
4a3eccd
fix(ci): update artifact path from ./build/ to ./dist in CI workflow
SMAKSS Feb 1, 2026
7d732c6
Merge pull request #333 from SMAKSS/feat/upgrade-core-deps-and-structure
SMAKSS Feb 1, 2026
fa534a0
fix(workflow): move pnpm action setup step for clarity
SMAKSS Feb 1, 2026
fc3638a
fix(workflow): update release step for develop branch to remove dry run
SMAKSS Feb 1, 2026
7d1e362
fix(workflow): update npm publish workflow to support OIDC and npm CL…
SMAKSS Feb 1, 2026
c755a97
chore(docs): update installation size badge and improve import statem…
SMAKSS Feb 1, 2026
4239e34
fix(config): remove 'test' type from commitlint configuration
SMAKSS Feb 1, 2026
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
16 changes: 16 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copilot Instructions

Follow the repo’s existing patterns and tooling:

- Use pnpm for scripts and installs.
- Keep ESM imports/exports (`type: "module"`).
- Prefer Vite library build for package output.
- Use existing ESLint configs (root + `playground/`).
- Keep build output under `dist/`.
- Avoid changes to public APIs unless requested.

Helpful commands:
- `pnpm lint`
- `pnpm typecheck`
- `pnpm build`

35 changes: 16 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Checks

on:
pull_request:
branches: [master]
branches: [master, develop]

jobs:
build:
Expand All @@ -18,45 +18,42 @@ jobs:
echo "Head ref: ${{ github.head_ref }}"
echo "Base ref: ${{ github.base_ref }}"

- name: Setup Node.js
uses: actions/setup-node@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
node-version: 20
version: 10

- name: Cache dependencies
uses: actions/cache@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-18-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-18-yarn-
node-version-file: .nvmrc
cache: pnpm

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

- name: Type check
run: yarn typecheck
run: pnpm typecheck

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

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

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

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

- name: Error handling
if: failure()
Expand Down
85 changes: 26 additions & 59 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,41 @@
name: "@smakss/react-scroll-direction"
name: Release

on:
release:
types: [created]
push:
branches: [master, develop]

jobs:
build:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn
- run: yarn generate
- uses: actions/upload-artifact@v4
with:
name: built-package
path: |
./path-to-your-build-folder
package.json

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
name: built-package
version: 10
- uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
scope: "@smakss"
- run: yarn install
- run: yarn generate
- run: |
if grep -q "beta" package.json; then
echo "Publishing Beta to npm"
npm publish --tag beta
else
echo "Publishing Release to npm"
npm publish
fi
cache: pnpm
- name: Ensure npm CLI supports OIDC
run: npm install -g npm@11.5.1
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Release (master)
if: github.ref_name == 'master'
run: pnpm release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: built-package
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
scope: "@smakss"
- run: yarn install
- run: yarn generate
- run: |
if grep -q "beta" package.json; then
echo "Publishing Beta to GitHub Package Registry"
npm publish --tag beta
else
echo "Publishing Release to GitHub Package Registry"
npm publish
fi
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release (develop)
if: github.ref_name == 'develop'
run: pnpm release
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit ${1}
pnpm commitlint --edit ${1}
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
17 changes: 17 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @type {import('semantic-release').GlobalConfig}
*/
export default {
branches: ['master', {name: 'develop', prerelease: true, channel: 'dev'}],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/npm',
[
'@semantic-release/github',
{
assets: ['dist/**'],
},
],
],
}
33 changes: 33 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# AGENTS

Use these instructions for automation and assistant behavior in this repo.

## Project overview

- Package: `@smakss/react-scroll-direction`
- Build: Vite library build
- Package manager: pnpm
- Linting: ESLint (main + playground configs)

## Working rules

- Prefer pnpm scripts (`pnpm run <script>`).
- Keep changes ESM-friendly (`type: "module"`).
- Preserve existing file structure and naming conventions.
- Avoid large refactors unless requested.
- Keep output in `dist/` only.

## Commands

- Build: `pnpm build`
- Lint (all): `pnpm lint`
- Lint (main): `pnpm lint:main`
- Lint (playground): `pnpm lint:playground`
- Typecheck (all): `pnpm typecheck`
- Typecheck (main): `pnpm typecheck:main`
- Typecheck (playground): `pnpm typecheck:playground`

## Playground

- Location: `playground/`
- Run dev server: `pnpm -C playground dev`
64 changes: 47 additions & 17 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,85 @@

## 1. Purpose

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).
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).

This Code of Conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
This Code of Conduct outlines our expectations for all those who participate in
our community, as well as the consequences for unacceptable behavior.

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

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.
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.

## 3. Expected Behavior

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

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

## 4. Unacceptable Behavior

The following behaviors are considered harassment and are unacceptable within our community:
The following behaviors are considered harassment and are unacceptable within
our community:

- Violence, threats of violence, or violent language directed against another person.
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
- Violence, threats of violence, or violent language directed against another
person.
- Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory
jokes and language.
- Posting or displaying sexually explicit or violent material.
- Posting or threatening to post other people's personally identifying information ("doxing").
- Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
- Posting or threatening to post other people's personally identifying
information ("doxing").
- Personal insults, particularly those related to gender, sexual orientation,
race, religion, or disability.
- Inappropriate photography or recording.
- Unwelcome sexual attention. This includes, but is not limited to: inappropriate touching, groping, and unwarranted comments.
- Unwelcome sexual attention. This includes, but is not limited to:
inappropriate touching, groping, and unwarranted comments.
- Advocating for, or encouraging, any of the above behavior.
- Stalking or following.

## 5. Consequences of Unacceptable Behavior

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.
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.

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.
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.

## 6. Reporting Guidelines

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

Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe.
Additionally, community organizers are available to help community members
engage with local law enforcement or to otherwise help those experiencing
unacceptable behavior feel safe.

## 7. Addressing Grievances

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.
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.

## 8. Scope

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.
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.
Loading