Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor project structure #277

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .biomeignore

This file was deleted.

13 changes: 6 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
18 changes: 0 additions & 18 deletions .github/tsc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Node v17
uses: actions/setup-node@v2
- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 17
cache: npm
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: npm i

- name: Register Problem Matcher
run: echo "##[add-matcher].github/tsc.json"
run: pnpm install --frozen-lockfile

- name: Run TypeScript compiler
run: npm run build
- name: Build package
run: pnpm run build

- name: Build docs
run: npm run docs
run: pnpm run docs

- name: Commit docs
run: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

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

- name: Build
run: pnpm run build

- name: Publish to npm
run: pnpm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
70 changes: 45 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,63 @@
name: Build and lint
on: [push, pull_request]
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: linting and formatting
biome:
name: Biome
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Node v17
uses: actions/setup-node@v2
with:
node-version: 17
cache: npm

- name: Install dependencies
run: npm i
- name: Setup Biome
uses: biomejs/setup-biome@v2

- name: Run ESLint
run: npm run lint && npm run format
- name: Run Biome
run: biome ci .

typescript:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node v17
uses: actions/setup-node@v2
- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 17
cache: npm
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: npm i

- name: Register Problem Matcher
run: echo "##[add-matcher].github/tsc.json"
run: pnpm install --frozen-lockfile

- name: Run TypeScript compiler
run: npm run typecheck
run: pnpm run typecheck

vitest:
name: Vitest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

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

- name: Run Vitest
run: pnpm run test
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"biomejs.biome",
"christian-kohler.npm-intellisense",
"christian-kohler.path-intellisense",
"codezombiech.gitignore",
"eamodio.gitlens",
"github.vscode-pull-request-github",
"vitest.explorer"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"npm.packageManager": "pnpm",
"typescript.tsdk": "node_modules/typescript/lib"
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Thanks for contributing to one of our packages!

## Contributing

Before doing anything, make sure you have node.js (at least v16.x.x) and git installed.
Before doing anything, make sure you have node.js (at least v18.x.x) and git installed.

We use ESlint with Prettier to enforce consistent style in our code.
We recommend setting up ESlint in your favorite code editor.

Before contributing, run `npm i` to install all dependencies.
Before contributing, run `pnpm i --frozen-lockfile` to install all dependencies.
Remember to write tests and documentation comments.
Afterwards, run `npx turbo run build lint docs` to check whether the tests pass and the code builds properly.
Afterwards, run `pnpm turbo run build lint docs` to check whether the tests pass and the code builds properly.
If you need any help with the code, visit our [support server](https://discord.gg/wKbtU5cBCk) on Discord.

## Code of Conduct
Expand Down
24 changes: 17 additions & 7 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"organizeImports": {
"enabled": true
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"files": {
"ignore": ["package.json"]
},
"linter": {
"enabled": true,
Expand All @@ -14,6 +20,9 @@
"recommended": true,
"noForEach": "off"
},
"correctness": {
"noUnusedImports": "error"
},
"style": {
"recommended": true,
"noParameterAssign": "off"
Expand All @@ -23,10 +32,11 @@
"noExplicitAny": "off"
},
"nursery": {
"noUnusedImports": "error",
"noDuplicateJsonKeys": "error",
"noUselessLoneBlockStatements": "error"
"noDuplicateJsonKeys": "error"
}
}
},
"organizeImports": {
"enabled": true
}
}
}
Loading
Loading