Skip to content

Commit b18463d

Browse files
committed
migrated to turborepo, tsup & next.js
1 parent 4a90bd5 commit b18463d

64 files changed

Lines changed: 7140 additions & 42883 deletions

Some content is hidden

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

.all-contributorsrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"projectOwner": "onderonur",
44
"repoType": "github",
55
"repoHost": "https://github.com",
6-
"files": [
7-
"README.md"
8-
],
6+
"files": ["README.md"],
97
"imageSize": 100,
108
"commit": true,
119
"commitConvention": "none",
@@ -15,9 +13,7 @@
1513
"name": "KimSeonghyeon",
1614
"avatar_url": "https://avatars.githubusercontent.com/u/13966404?v=4",
1715
"profile": "https://seonghyeonkimm.github.io/",
18-
"contributions": [
19-
"code"
20-
]
16+
"contributions": ["code"]
2117
}
2218
],
2319
"contributorsPerLine": 7

.eslintrc.js

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,10 @@
1+
// This configuration only applies to the package manager root.
2+
/** @type {import("eslint").Linter.Config} */
13
module.exports = {
2-
env: {
3-
browser: true,
4-
es6: true,
5-
},
6-
extends: ['react-app', 'plugin:react/recommended', 'airbnb', 'prettier'],
4+
ignorePatterns: ['apps/**', 'packages/**'],
5+
extends: ['@repo/eslint-config/library.js'],
76
parser: '@typescript-eslint/parser',
87
parserOptions: {
9-
ecmaFeatures: {
10-
jsx: true,
11-
},
12-
ecmaVersion: 12,
13-
sourceType: 'module',
14-
},
15-
plugins: ['react', '@typescript-eslint', 'prettier'],
16-
settings: {
17-
'import/resolver': {
18-
node: {
19-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
20-
},
21-
},
22-
},
23-
// https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
24-
overrides: [
25-
{
26-
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
27-
rules: {
28-
'no-undef': 'off',
29-
},
30-
},
31-
],
32-
rules: {
33-
'prettier/prettier': 'warn',
34-
'no-shadow': 'warn',
35-
'no-unused-vars': 'off',
36-
radix: 'off',
37-
'@typescript-eslint/no-unused-vars': 'warn',
38-
// For optional chaining to not create linting errors
39-
'no-unused-expressions': 'off',
40-
'arrow-body-style': 'off',
41-
'import/extensions': 'off',
42-
'import/no-extraneous-dependencies': 'off',
43-
'import/order': 'off',
44-
'import/newline-after-import': 'warn',
45-
'import/prefer-default-export': 'off',
46-
'no-use-before-define': 'off',
47-
'@typescript-eslint/no-use-before-define': 'warn',
48-
'react/jsx-curly-newline': 'off',
49-
'react/jsx-tag-spacing': 'warn',
50-
'react/button-has-type': 'warn',
51-
'react/jsx-filename-extension': [
52-
'warn',
53-
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
54-
],
55-
'react/jsx-one-expression-per-line': 'off',
8+
project: true,
569
},
5710
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Install
2+
description: Sets up Node.js and runs install
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version: 20
11+
cache: npm
12+
13+
- name: Install dependencies
14+
shell: bash
15+
run: npm ci

.github/workflows/main.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/quality.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Quality
2+
3+
on:
4+
push:
5+
branches:
6+
# TODO: This will be replaced with `main` later.
7+
- monorepo
8+
9+
# To cancel previous workflow when a new one is triggered.
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
format:
16+
name: Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out
20+
uses: actions/checkout@v4
21+
22+
- name: Install
23+
uses: ./.github/composite-actions/install
24+
25+
- name: Run format check
26+
run: npm run format
27+
28+
lint:
29+
name: Lint
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check out
33+
uses: actions/checkout@v4
34+
35+
- name: Install
36+
uses: ./.github/composite-actions/install
37+
38+
- name: Run lint check
39+
run: npm run lint
40+
41+
typecheck:
42+
name: Typecheck
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Check out
46+
uses: actions/checkout@v4
47+
48+
- name: Install
49+
uses: ./.github/composite-actions/install
50+
51+
- name: Run type check
52+
run: npm run typecheck
53+
54+
build:
55+
name: Build
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Check out
59+
uses: actions/checkout@v4
60+
61+
- name: Install
62+
uses: ./.github/composite-actions/install
63+
64+
- name: Run build
65+
run: npm run build

.gitignore

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
1-
*.log
2-
.DS_Store
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# Dependencies
34
node_modules
4-
.cache
5-
.rts2_cache_cjs
6-
.rts2_cache_esm
7-
.rts2_cache_umd
8-
.rts2_cache_system
5+
.pnp
6+
.pnp.js
7+
8+
# Local env files
9+
.env
10+
.env.local
11+
.env.development.local
12+
.env.test.local
13+
.env.production.local
14+
15+
# Testing
16+
coverage
17+
18+
# Turbo
19+
.turbo
20+
21+
# Vercel
22+
.vercel
23+
24+
# Build Outputs
25+
.next/
26+
out/
27+
build
928
dist
29+
30+
31+
# Debug
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*
35+
36+
# Misc
37+
.DS_Store
38+
*.pem

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx tsdx lint
1+
npx lint-staged
2+
npm run typecheck

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-intersection-observer-hook
22

3-
![Build status](https://img.shields.io/github/actions/workflow/status/onderonur/react-intersection-observer-hook/main.yml)
3+
![Build status](https://img.shields.io/github/actions/workflow/status/onderonur/react-intersection-observer-hook/quality.yml)
44
![License](https://img.shields.io/npm/l/react-intersection-observer-hook)
55
![Version](https://img.shields.io/npm/v/react-intersection-observer-hook)
66

@@ -92,10 +92,8 @@ function Example() {
9292
// `rootRef`: Same ref callback which is returned by `useIntersectionObserver`.
9393
// `isVisible`: Becomes true/false based on the response of `IntersectionObserver`.
9494
// `wasEverVisible`: When our observed node becomes visible once, this flag becomes `true` and stays like that.
95-
const [
96-
ref,
97-
{ entry, rootRef, isVisible, wasEverVisible },
98-
] = useTrackVisibility();
95+
const [ref, { entry, rootRef, isVisible, wasEverVisible }] =
96+
useTrackVisibility();
9997

10098
useEffect(() => {
10199
console.log(`The component is ${isVisible ? 'visible' : 'not visible'}.`);

0 commit comments

Comments
 (0)