Skip to content

Commit

Permalink
feat: migrate to next 15
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomez committed Nov 29, 2024
1 parent 920c99b commit 025f28f
Show file tree
Hide file tree
Showing 27 changed files with 8,280 additions and 7,466 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
7 changes: 7 additions & 0 deletions .commitlintrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
"body-max-line-length": [0, "always"],
"footer-max-line-length": [0, "always"]
}
}
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run tests
run: pnpm test
74 changes: 74 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Quality

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
prettier:
name: 'Prettier'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run Prettier check
run: pnpm run prettier-check

eslint:
name: 'ESLint'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run ESLint check
run: pnpm run lint

types:
name: 'TypeScript'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run TypeScript type check
run: pnpm run type-check
60 changes: 0 additions & 60 deletions .github/workflows/release.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { relative } from 'path'

const buildEslintCommand = (filenames) =>
`pnpm eslint --fix ${filenames
.map((f) => relative(process.cwd(), f))
.join(' ')}`

export default {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
}
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
60 changes: 60 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import pluginJs from '@eslint/js'
import tsParser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import-x'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import sort from 'eslint-plugin-sort'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import globals from 'globals'
import { configs as tseslintConfigs } from 'typescript-eslint'

export default [
{
files: ['**/*.{js,mjs,cjs,ts}'],
ignores: ['eslint.config.js'],
},
{
languageOptions: {
globals: globals.browser,
parser: tsParser,
},
},
pluginJs.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
eslintPluginUnicorn.configs['flat/recommended'],
...tseslintConfigs.recommended,
eslintPluginPrettierRecommended,
{
files: ['**/*.{js,mjs,cjs,ts}'],
ignores: ['eslint.config.js'],
plugins: {
'simple-import-sort': simpleImportSort,
sort: sort,
},
rules: {
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
camelcase: 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'error',
eqeqeq: 'error',
'import-x/first': 'error',
'import-x/newline-after-import': 'error',
'import-x/no-duplicates': 'error',
'import-x/no-named-as-default-member': 'error',
'no-shadow': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'sort/destructuring-properties': 'error',
'sort/imports': 'off',
'sort/object-properties': 'error',
'sort/type-properties': 'error',
'unicorn/no-null': 'off',
},
},
]
Loading

0 comments on commit 025f28f

Please sign in to comment.