Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chfoidl committed Mar 27, 2024
0 parents commit 5ade5d1
Show file tree
Hide file tree
Showing 16 changed files with 5,172 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "wunderwerkio/use-scrollbar"
}
],
"commit": false,
"fixed": [[]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}


5 changes: 5 additions & 0 deletions .changeset/eighty-scissors-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wunderwerk/use-scrollbar": patch
---

Fix visible percent conditions for canScroll and scroll end
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"@wunderwerk/use-scrollbar": "0.1.0-beta.2"
},
"changesets": []
}
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"@wunderwerk/eslint-config/typescript",
"@wunderwerk/eslint-config/react"
],
"rules": {
"no-console": "off"
}
}
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop --command bash {0}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: 'release: version packages'
version: nix develop --command pnpm version-packages
publish: nix develop --command pnpm publish-packages
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop --command bash {0}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install nix
uses: nixbuild/nix-quick-install-action@v26

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: 'release: version packages'
version: nix develop --command pnpm version-packages
publish: nix develop --command pnpm publish-packages
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.turbo/*
!.turbo/config.json

# Build
dist

coverage

.npmrc

25 changes: 25 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/** @type {import("prettier").Config} */
module.exports = {
arrowParens: "always",
printWidth: 80,
singleQuote: false,
jsxSingleQuote: false,
semi: true,
trailingComma: "all",
tabWidth: 2,
plugins: [
"@ianvs/prettier-plugin-sort-imports",
],
importOrder: [
"^(jest-fetch-mock)$",
"<THIRD_PARTY_MODULES>",
"^@drupal-kit/(.*)$",
"",
"^~/utils/(.*)$",
"^~/(.*)$",
"^[./]",
],
importOrderParserPlugins: ["decorators-legacy", "importAssertions", "typescript"],
};


3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# use-scrollbar

This package provides a React Hook to implement a custom scrollbar.
97 changes: 97 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
ww-node-overlays.url = "github:wunderwerkio/nix-node-packages-overlays";
ww-utils.url = "github:wunderwerkio/nix-ww-utils";
};

outputs = {
self,
nixpkgs,
ww-node-overlays,
ww-utils,
}: {
devShells = ww-utils.lib.forEachWunderwerkSystem (
system: let
overlays = with ww-node-overlays.overlays; [
pnpm
];
pkgs = import nixpkgs {
inherit system overlays;
};
in rec {
default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs-18_x

nodePackages.pnpm-latest
];

shellHook = ''
if [ ! -d "node_modules" ]; then
echo ""
echo "It seems this is the first time running the project."
echo "You can start the install process by running the following command:"
echo ""
echo "nix develop '.#setup'"
echo ""
fi
'';
};
setup = pkgs.mkShell {
buildInputs = default.buildInputs;

shellHook = ''
if [ ! -d "node_modules" ]; then
pnpm install
echo ""
echo "Run next: pnpm dev"
echo "Run storybook: pnpm storybook"
echo ""
exit 0
fi
'';
};
}
);

formatter = ww-utils.lib.forEachWunderwerkSystem (
system:
nixpkgs.legacyPackages.${system}.alejandra
);
};
}
Loading

0 comments on commit 5ade5d1

Please sign in to comment.