Skip to content

Commit 21a3ca3

Browse files
committed
feat: wormhole and devtools splited is completed
1 parent 937559c commit 21a3ca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2346
-695
lines changed

.eslintignore

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

.eslintrc.cjs

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

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,4 @@ dist
1111
*.vsix
1212
.vscode-test/
1313

14-
# 忽略test下的生成文件
15-
test/api-*/src/*
16-
test/api-*/*openapi*.*
17-
test/api-*/*swagger*.*
18-
test/api-*/alova.config.*
19-
!test/api-*/src/.gitkeep
20-
!test/api-common/*
14+
alova_tmp_*

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension",
14+
"-u",
15+
"tdd",
16+
"--disable-extensions"
17+
],
18+
"cwd": "${workspaceFolder}/packages/vscode-extension",
19+
"outFiles": ["${workspaceFolder}/packages/vscode-extension/out/**/*.js"],
20+
"preLaunchTask": "${defaultBuildTask}"
21+
}
22+
]
23+
}

.vscode/tasks.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "watch",
8+
"type": "npm",
9+
"script": "watch:esbuild",
10+
"problemMatcher": "$esbuild-watch",
11+
"isBackground": true,
12+
"options": {
13+
"cwd": "${workspaceFolder}/packages/vscode-extension"
14+
},
15+
"group": {
16+
"kind": "build",
17+
"isDefault": true
18+
},
19+
"presentation": {
20+
"group": "watch",
21+
"reveal": "never"
22+
}
23+
}
24+
]
25+
}

eslint.config.mjs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
import prettier from 'eslint-plugin-prettier';
5+
import globals from 'globals';
6+
7+
const { dirname } = import.meta;
8+
const compat = new FlatCompat({
9+
baseDirectory: dirname
10+
});
11+
12+
export default [
13+
{
14+
ignores: [
15+
'**/out',
16+
'**/dist',
17+
'**/__mocks__',
18+
'**/*.handlebars',
19+
'**/.vscode-test',
20+
'**/.vscode-test.mjs',
21+
'*.{js,mjs,cjs}',
22+
'packages/wormhole/typings',
23+
'design',
24+
'test-demos/**/*'
25+
]
26+
},
27+
...compat.extends('airbnb', 'airbnb-typescript', 'prettier'),
28+
{
29+
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
30+
plugins: {
31+
'@typescript-eslint': typescriptEslint,
32+
prettier
33+
},
34+
35+
languageOptions: {
36+
globals: {
37+
...globals.browser,
38+
...globals.node
39+
},
40+
41+
parser: tsParser,
42+
ecmaVersion: 'latest',
43+
sourceType: 'commonjs',
44+
45+
parserOptions: {
46+
project: './tsconfig.json',
47+
tsconfigRootDir: dirname
48+
}
49+
},
50+
51+
rules: {
52+
'prettier/prettier': 'error',
53+
54+
// eslint-airbnb
55+
'import/extensions': 'off',
56+
'import/no-extraneous-dependencies': 'off',
57+
'no-param-reassign': 'off',
58+
'no-restricted-syntax': 'off',
59+
'no-underscore-dangle': 'off',
60+
'import/no-mutable-exports': 'off',
61+
'no-nested-ternary': 'off',
62+
'no-multi-assign': 'off',
63+
'consistent-return': 'off',
64+
'no-restricted-exports': 'off',
65+
'linebreak-style': 'off',
66+
'no-unused-vars': 'off',
67+
'import/order': 'off',
68+
'import/no-relative-packages': 'off',
69+
'guard-for-in': 'off',
70+
'max-classes-per-file': 'off',
71+
'no-await-in-loop': 'off',
72+
'func-names': 'off',
73+
'no-continue': 'off',
74+
'no-empty': 'off',
75+
76+
// @typescript-eslint
77+
'@typescript-eslint/no-explicit-any': 'off',
78+
'@typescript-eslint/no-unused-vars': [
79+
'error',
80+
{
81+
args: 'after-used',
82+
argsIgnorePattern: '^_',
83+
varsIgnorePattern: 'Unused'
84+
}
85+
],
86+
'@typescript-eslint/no-empty-function': 'off',
87+
'@typescript-eslint/ban-ts-comment': 'off',
88+
'@typescript-eslint/no-var-requires': 'off',
89+
'@typescript-eslint/no-this-alias': 'off',
90+
'@typescript-eslint/no-unused-expressions': 'off',
91+
'@typescript-eslint/no-implied-eval': 'off',
92+
'@typescript-eslint/no-shadow': 'off',
93+
'@typescript-eslint/no-use-before-define': 'off',
94+
'@typescript-eslint/lines-between-class-members': 'off',
95+
'@typescript-eslint/no-throw-literal': 'off'
96+
}
97+
}
98+
];

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@alova/devtools",
2+
"name": "alova-devtools",
33
"displayName": "Alova",
44
"description": "devtool kits for alova.js",
55
"version": "0.0.0",
@@ -10,13 +10,14 @@
1010
},
1111
"scripts": {
1212
"test": "vitest",
13-
"lint": "eslint . --ext .js,.ts",
13+
"lint": "eslint",
1414
"lint:fix": "npm run lint -- --fix",
1515
"format": "prettier --check .",
1616
"format:fix": "prettier --write .",
1717
"api-test": "tsx scripts/api-test.ts",
1818
"commit": "git-cz && git push",
19-
"prepare": "husky"
19+
"prepare": "husky",
20+
"watch:extension": "pnpm --filter=alova-vscode-extension watch:esbuild"
2021
},
2122
"license": "MIT",
2223
"repository": {
@@ -38,18 +39,20 @@
3839
"@types/node": "^18.19.0",
3940
"@types/rimraf": "^4.0.5",
4041
"@types/serialize-javascript": "^5.0.4",
41-
"@typescript-eslint/eslint-plugin": "^7.13.0",
42-
"@typescript-eslint/parser": "^7.13.0",
42+
"@typescript-eslint/eslint-plugin": "^8.13.0",
43+
"@typescript-eslint/parser": "^8.13.0",
44+
"changeset": "^0.2.6",
4345
"commitizen": "^4.3.0",
4446
"cz-conventional-changelog": "^3.3.0",
4547
"dts-bundle-generator": "^9.5.1",
46-
"eslint": "^8.57.0",
48+
"eslint": "^9.14.0",
4749
"eslint-config-airbnb": "^19.0.4",
4850
"eslint-config-airbnb-typescript": "^18.0.0",
4951
"eslint-config-prettier": "^9.1.0",
50-
"eslint-plugin-prettier": "^5.1.3",
52+
"eslint-plugin-prettier": "^5.2.1",
5153
"husky": "^9.0.11",
5254
"lint-staged": "^15.2.2",
55+
"ncp": "^2.0.0",
5356
"npm-run-all": "^4.1.5",
5457
"prettier": "^3.2.5",
5558
"prettier-plugin-organize-imports": "^3.2.4",
@@ -65,5 +68,9 @@
6568
"commitizen": {
6669
"path": "./node_modules/cz-conventional-changelog"
6770
}
71+
},
72+
"dependencies": {
73+
"@eslint/eslintrc": "^3.1.0",
74+
"globals": "^15.12.0"
6875
}
6976
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vscode/test-cli';
22

33
export default defineConfig({
4-
files: 'out/test/**/*.test.js'
4+
files: 'out/test/**/*.spec.js'
55
});

packages/vscode-extension/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "Run Extension",
1010
"type": "extensionHost",
1111
"request": "launch",
12-
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
12+
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "-u", "tdd", "--disable-extensions"],
1313
"outFiles": ["${workspaceFolder}/out/**/*.js"],
1414
"preLaunchTask": "${defaultBuildTask}"
1515
}

packages/vscode-extension/.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.vscode/**
22
.vscode-test/**
3-
dist/**
3+
out/**
44
src/**
55
.gitignore
66
.yarnrc

0 commit comments

Comments
 (0)