Skip to content

Commit

Permalink
migrated to turborepo, tsup & next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
onderonur committed Apr 6, 2024
1 parent 5294ea8 commit 1708584
Show file tree
Hide file tree
Showing 65 changed files with 7,047 additions and 35,911 deletions.
16 changes: 4 additions & 12 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"projectOwner": "onderonur",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": true,
"commitConvention": "none",
Expand All @@ -15,27 +13,21 @@
"name": "Eugene Fidelin",
"avatar_url": "https://avatars0.githubusercontent.com/u/895071?v=4",
"profile": "https://nl.linkedin.com/in/eugef",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "Evanc123",
"name": "Evan Cater",
"avatar_url": "https://avatars.githubusercontent.com/u/4010547?v=4",
"profile": "https://github.com/Evanc123",
"contributions": [
"doc"
]
"contributions": ["doc"]
},
{
"login": "groomain",
"name": "Romain",
"avatar_url": "https://avatars.githubusercontent.com/u/3601848?v=4",
"profile": "https://github.com/groomain",
"contributions": [
"example"
]
"contributions": ["example"]
}
],
"contributorsPerLine": 7
Expand Down
52 changes: 5 additions & 47 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
// This configuration only applies to the package manager root.
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ['react-app', 'plugin:react/recommended', 'airbnb', 'prettier'],
ignorePatterns: ['apps/**', 'packages/**'],
extends: ['@repo/eslint-config/library.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'prettier/prettier': 'warn',
'no-shadow': 'warn',
'no-unused-vars': 'off',
"prefer-destructuring": "warn",
'@typescript-eslint/no-unused-vars': 'warn',
// For optional chaining to not create linting errors
'no-unused-expressions': 'off',
"no-plusplus": "off",
"operator-assignment": "warn",
"object-shorthand": "warn",
'arrow-body-style': 'off',
"radix": "off",
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/order': 'off',
'import/newline-after-import': 'warn',
'no-use-before-define': 'off',
"@typescript-eslint/no-explicit-any": "warn",
'@typescript-eslint/no-use-before-define': 'warn',
'react/jsx-curly-newline': 'off',
'react/jsx-tag-spacing': 'warn',
'react/button-has-type': 'warn',
"react/jsx-fragments": "warn",
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
],
project: true,
},
};
15 changes: 15 additions & 0 deletions .github/composite-actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install
description: Sets up Node.js and runs install

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
shell: bash
run: npm ci
42 changes: 0 additions & 42 deletions .github/workflows/main.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Quality

on:
push:
branches:
# TODO: This will be replaced with `main` later.
- monorepo

# To cancel previous workflow when a new one is triggered.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Install
uses: ./.github/composite-actions/install

- name: Run format check
run: npm run format

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Install
uses: ./.github/composite-actions/install

- name: Run lint check
run: npm run lint

typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Install
uses: ./.github/composite-actions/install

- name: Run type check
run: npm run typecheck

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Install
uses: ./.github/composite-actions/install

- name: Run build
run: npm run build
39 changes: 36 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
*.log
.DS_Store
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.cache
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist


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

# Misc
.DS_Store
*.pem
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

6 changes: 2 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx tsdx lint
npx lint-staged
npm run typecheck
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# react-infinite-scroll-hook

![Build status](https://img.shields.io/github/actions/workflow/status/onderonur/react-infinite-scroll-hook/main.yml)
![Build status](https://img.shields.io/github/actions/workflow/status/onderonur/react-infinite-scroll-hook/quality.yml)
![License](https://img.shields.io/npm/l/react-infinite-scroll-hook)
![Version](https://img.shields.io/npm/v/react-infinite-scroll-hook)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

This is a hook to create infinite scroll components!
Expand Down
9 changes: 9 additions & 0 deletions apps/demo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@repo/eslint-config/next.js', '@repo/eslint-config/typescript.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
};
36 changes: 36 additions & 0 deletions apps/demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
5 changes: 5 additions & 0 deletions apps/demo/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
9 changes: 9 additions & 0 deletions apps/demo/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
images: {
unoptimized: true,
},
};

export default nextConfig;
32 changes: 32 additions & 0 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "demo",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint --max-warnings 0",
"lint:fix": "next lint --fix --max-warnings 0",
"start": "next start",
"typecheck": "tsc"
},
"dependencies": {
"next": "14.1.4",
"react": "^18",
"react-dom": "^18",
"react-infinite-scroll-hook": "*"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.19",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"postcss": "^8",
"tailwindcss": "^3.4.3",
"typescript": "^5"
}
}
Loading

0 comments on commit 1708584

Please sign in to comment.