-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[♻️]: Refactor to prepare for v2 (#2)
* Add workflows * Update PR template * Add test config * Update COC and Contribution docs * Update code linter and formatter * Update tsconfigs * Update dependencies and scripts * Fix linter warnings * Fix es module * Add `--passWithNoTests` to test cmd
- Loading branch information
Showing
31 changed files
with
5,444 additions
and
1,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
.swc | ||
.github | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: | ||
- "next" | ||
pull_request: | ||
schedule: | ||
# on sunday of each month at 5:55 | ||
- cron: "55 5 * * 0" | ||
workflow_call: | ||
|
||
jobs: | ||
analyze: | ||
name: "Analyze" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: | ||
- javascript | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "🎬 Initialize CodeQL" | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: "🏗️ Autobuild" | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: "🧐 Perform CodeQL Analysis" | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Development | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
name: Test components | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: "📦 install dependencies" | ||
run: pnpm install | ||
|
||
- name: "🔍 run tests" | ||
run: pnpm test | ||
|
||
lint: | ||
name: Code standards | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: "☁️ checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "🔧 setup pnpm" | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: "🔧 setup node" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: "📦 install dependencies" | ||
run: pnpm install | ||
|
||
- name: "🔍 lint code" | ||
run: pnpm lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: "📦 install dependencies" | ||
run: pnpm install | ||
|
||
- name: "🧱 build package" | ||
run: pnpm build | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: "🚀 publish package" | ||
run: npx tsx ./scripts/ci/publish-package.ts | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
.swc | ||
.github | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"packageManager": "yarn", | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"useEditorConfig": true, | ||
"trailingComma": "none", | ||
"arrowParens": "avoid" | ||
"trailingComma": "all", | ||
"arrowParens": "avoid", | ||
"bracketSameLine": false, | ||
"endOfLine": "lf", | ||
"htmlWhitespaceSensitivity": "css", | ||
"jsxSingleQuote": false, | ||
"singleAttributePerLine": true, | ||
"plugins": ["prettier-plugin-organize-imports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import nextJest from "next/jest.js"; | ||
|
||
const createJestConfig = nextJest({ dir: "./" }); | ||
|
||
/** | ||
* @type {import("jest").Config} | ||
*/ | ||
const jestConfig = { | ||
verbose: true, | ||
setupFilesAfterEnv: ["<rootDir>/tests/jest.setup.ts"], | ||
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"], | ||
testRegex: ".*\\.test\\.tsx?$", | ||
testEnvironment: "jest-environment-jsdom", | ||
preset: "ts-jest", | ||
}; | ||
|
||
export default createJestConfig(jestConfig); |
Oops, something went wrong.