Skip to content

Commit d5b0234

Browse files
committed
ci: setup test ci
1 parent aec4563 commit d5b0234

File tree

15 files changed

+219
-1895
lines changed

15 files changed

+219
-1895
lines changed

.eslintrc.json

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

.github/actions/setup/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Setup
2+
description: Setup the environment
3+
4+
inputs:
5+
node-version:
6+
description: The version of node.js
7+
required: false
8+
default: '20'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- uses: pnpm/[email protected]
14+
with:
15+
run_install: false
16+
17+
- name: Setup node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ inputs.node-version }}
21+
cache: pnpm
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install
25+
run: pnpm install
26+
shell: bash
27+
28+
- uses: nrwl/nx-set-shas@v4
29+
30+
- name: Build packages
31+
run: pnpm build
32+
shell: bash
File renamed without changes.

.github/workflow/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci
2+
3+
on:
4+
merge_group:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
CI: true
16+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
needs: install-deps
22+
steps:
23+
- name: Checkout code repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- uses: ./.github/actions/setup
29+
30+
- name: Run lint
31+
run: pnpm lint:ox --format github
32+
33+
- name: Run prettier
34+
run: pnpm lint:prettier
35+
36+
- name: Run typecheck
37+
run: pnpm typecheck
38+
39+
- name: Run package
40+
run: pnpm package

.oxlintrc.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"plugins": ["import", "typescript", "unicorn", "promise"],
3+
"rules": {
4+
"no-console": "error",
5+
"eslint/no-unused-vars": "off",
6+
"unicorn/prefer-array-some": "error",
7+
"unicorn/no-useless-promise-resolve-reject": "error",
8+
"unicorn/no-unnecessary-await": "error",
9+
"unicorn/no-useless-fallback-in-spread": "error",
10+
"unicorn/filename-case": [
11+
"error",
12+
{
13+
"case": "kebabCase"
14+
}
15+
],
16+
"unicorn/prefer-date-now": "error",
17+
"unicorn/prefer-blob-reading-methods": "error",
18+
"unicorn/no-typeof-undefined": "error",
19+
"unicorn/no-new-array": "error",
20+
"import/no-cycle": [
21+
"error",
22+
{
23+
"ignoreTypes": true
24+
}
25+
],
26+
"import/sort-imports": "error",
27+
"import/no-duplicates": "error",
28+
"import/no-import-assign": "error",
29+
"import/no-self-import": "error",
30+
"typescript/consistent-type-imports": "error",
31+
"typescript/no-import-type-side-effects": "error"
32+
}
33+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

.vscode/launch.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
15-
],
16-
"outFiles": [
17-
"${workspaceFolder}/dist/**/*.js"
18-
],
19-
"preLaunchTask": "npm: watch"
20-
}
21-
]
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
14+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
15+
"preLaunchTask": "npm: watch"
16+
}
17+
]
2218
}

package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,34 +210,31 @@
210210
"package": "npm run compile:clear && npm run compile:view && npm run compile:style && tsup",
211211
"tsc": "tsc --noEmit",
212212
"pretest": "npm run tsc && npm run lint",
213-
"lint": "eslint src --ext ts",
213+
"lint:ox": "oxlint -c .oxlintrc.json",
214+
"lint:ox:fix": "oxlint -c .oxlintrc.json --fix",
215+
"lint:prettier": "prettier . --check",
216+
"lint:prettier:fix": "prettier . --write",
217+
"typecheck": "tsc --noEmit",
214218
"vscode-package": "vsce package --no-dependencies"
215219
},
216220
"devDependencies": {
217-
"@babel/runtime": "^7.25.6",
221+
"@babel/runtime": "^7.26.7",
218222
"@milkdown/crepe": "^7.6.2",
219223
"@milkdown/kit": "^7.6.2",
220224
"@types/lodash.throttle": "^4.1.9",
221225
"@types/node": "~22.12.0",
222226
"@types/vscode": "^1.59.0",
223-
"@typescript-eslint/eslint-plugin": "^8.0.0",
224-
"@typescript-eslint/parser": "^8.0.0",
225227
"@uiw/codemirror-theme-vscode": "^4.23.2",
226228
"concurrently": "^9.0.0",
227229
"esbuild": "^0.24.2",
228-
"eslint": "^9.0.0",
229-
"eslint-config-prettier": "^10.0.0",
230-
"eslint-plugin-header": "^3.1.1",
231-
"eslint-plugin-import": "^2.27.5",
232-
"eslint-plugin-prettier": "^5.0.0",
233-
"eslint-plugin-simple-import-sort": "^12.0.0",
234230
"glob": "^11.0.0",
235231
"lodash.throttle": "^4.1.1",
236232
"normalize.css": "^8.0.1",
233+
"oxlint": "^0.15.9",
237234
"prettier": "^3.0.0",
238235
"rimraf": "^6.0.1",
239236
"tsup": "^8.3.6",
240237
"typescript": "^5.6.2"
241238
},
242-
"packageManager": "[email protected]+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
239+
"packageManager": "[email protected]"
243240
}

0 commit comments

Comments
 (0)