mwts 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -7
- package/dist/eslint.config.js +88 -0
- package/dist/eslint.ignores.js +3 -0
- package/dist/src/clean.d.ts +0 -1
- package/dist/src/clean.js +1 -2
- package/dist/src/clean.js.map +1 -1
- package/dist/src/cli.d.ts +3 -2
- package/dist/src/cli.js +61 -17
- package/dist/src/cli.js.map +1 -1
- package/dist/src/index.d.ts +7 -2
- package/dist/src/index.js +84 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/init.d.ts +2 -6
- package/dist/src/init.js +172 -24
- package/dist/src/init.js.map +1 -1
- package/dist/src/util.d.ts +3 -5
- package/dist/src/util.js +16 -12
- package/dist/src/util.js.map +1 -1
- package/eslint.config.js +89 -0
- package/eslint.ignores.js +1 -0
- package/package.json +35 -33
- package/tsconfig-midway.json +5 -7
- package/tsconfig.json +8 -5
- package/.eslintrc.json +0 -58
- package/dist/.eslintrc.json +0 -58
- package/dist/src/clean.d.ts.map +0 -1
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/init.d.ts.map +0 -1
- package/dist/src/util.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mwts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "MidwayJS TypeScript Style",
|
|
5
5
|
"repository": "midwayjs/mwts",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"CHANGELOG.md",
|
|
12
12
|
"dist/src",
|
|
13
13
|
"dist/template",
|
|
14
|
-
"
|
|
14
|
+
"eslint.config.js",
|
|
15
|
+
"eslint.ignores.js",
|
|
15
16
|
".prettierrc.json",
|
|
16
|
-
".eslintrc.json",
|
|
17
17
|
"LICENSE",
|
|
18
18
|
"tsconfig-midway.json",
|
|
19
19
|
"tsconfig.json"
|
|
@@ -32,55 +32,57 @@
|
|
|
32
32
|
"fix": "eslint --fix '**/*.ts'"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
35
|
+
"node": ">=20.19.0"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [],
|
|
38
38
|
"license": "Apache-2.0",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@typescript-eslint/
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"eslint
|
|
45
|
-
"eslint-
|
|
46
|
-
"eslint-plugin-
|
|
40
|
+
"@eslint/js": "^10.0.1",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
42
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
43
|
+
"chalk": "^4.1.2",
|
|
44
|
+
"eslint": "^10.0.0",
|
|
45
|
+
"eslint-config-prettier": "^10.1.8",
|
|
46
|
+
"eslint-plugin-n": "^17.24.0",
|
|
47
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
47
48
|
"execa": "^5.0.0",
|
|
49
|
+
"globals": "^16.4.0",
|
|
48
50
|
"inquirer": "^7.3.3",
|
|
49
51
|
"json5": "^2.1.3",
|
|
50
52
|
"meow": "^9.0.0",
|
|
51
53
|
"ncp": "^2.0.0",
|
|
52
|
-
"prettier": "^
|
|
54
|
+
"prettier": "^3.6.2",
|
|
53
55
|
"rimraf": "^3.0.2",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
+
"typescript-eslint": "^8.56.0",
|
|
57
|
+
"update-notifier": "^6.0.2",
|
|
58
|
+
"write-file-atomic": "^6.0.0"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
|
-
"@npm/types": "^
|
|
61
|
+
"@npm/types": "^2.0.0",
|
|
59
62
|
"@types/cross-spawn": "^6.0.2",
|
|
60
|
-
"@types/eslint": "^
|
|
61
|
-
"@types/fs-extra": "^
|
|
62
|
-
"@types/inquirer": "^
|
|
63
|
-
"@types/json5": "
|
|
64
|
-
"@types/mocha": "^
|
|
63
|
+
"@types/eslint": "^9.0.0",
|
|
64
|
+
"@types/fs-extra": "^11.0.0",
|
|
65
|
+
"@types/inquirer": "^8.0.0",
|
|
66
|
+
"@types/json5": "2.2.0",
|
|
67
|
+
"@types/mocha": "^10.0.0",
|
|
65
68
|
"@types/ncp": "^2.0.4",
|
|
66
|
-
"@types/node": "^
|
|
67
|
-
"@types/prettier": "^2.1.1",
|
|
69
|
+
"@types/node": "^22.7.5",
|
|
68
70
|
"@types/rimraf": "^3.0.0",
|
|
69
|
-
"@types/sinon": "^
|
|
71
|
+
"@types/sinon": "^21.0.0",
|
|
70
72
|
"@types/tmp": "^0.2.0",
|
|
71
|
-
"@types/update-notifier": "^
|
|
72
|
-
"@types/write-file-atomic": "^
|
|
73
|
-
"c8": "^
|
|
73
|
+
"@types/update-notifier": "^6.0.8",
|
|
74
|
+
"@types/write-file-atomic": "^4.0.0",
|
|
75
|
+
"c8": "^10.1.2",
|
|
74
76
|
"cross-spawn": "^7.0.3",
|
|
75
|
-
"fs-extra": "^
|
|
77
|
+
"fs-extra": "^11.0.0",
|
|
76
78
|
"inline-fixtures": "^1.1.0",
|
|
77
|
-
"js-green-licenses": "^
|
|
78
|
-
"mocha": "^
|
|
79
|
-
"sinon": "^
|
|
80
|
-
"tmp": "0.2.
|
|
81
|
-
"typescript": "
|
|
79
|
+
"js-green-licenses": "^4.0.0",
|
|
80
|
+
"mocha": "^11.0.0",
|
|
81
|
+
"sinon": "^21.0.0",
|
|
82
|
+
"tmp": "0.2.4",
|
|
83
|
+
"typescript": "^5.6.3"
|
|
82
84
|
},
|
|
83
85
|
"peerDependencies": {
|
|
84
|
-
"typescript": ">=
|
|
86
|
+
"typescript": ">=5"
|
|
85
87
|
}
|
|
86
88
|
}
|
package/tsconfig-midway.json
CHANGED
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"allowUnreachableCode": false,
|
|
4
4
|
"allowUnusedLabels": false,
|
|
5
|
-
"
|
|
6
|
-
"declarationMap": true,
|
|
5
|
+
"composite": true,
|
|
7
6
|
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"lib": ["
|
|
7
|
+
"lib": ["ES2023"],
|
|
9
8
|
"module": "commonjs",
|
|
10
9
|
"noEmitOnError": true,
|
|
11
10
|
"noFallthroughCasesInSwitch": true,
|
|
12
11
|
"noImplicitReturns": true,
|
|
13
12
|
"pretty": true,
|
|
14
13
|
"sourceMap": true,
|
|
14
|
+
"stripInternal": true,
|
|
15
15
|
"strict": true,
|
|
16
|
-
"target": "
|
|
16
|
+
"target": "ES2022"
|
|
17
17
|
},
|
|
18
|
-
"exclude": [
|
|
19
|
-
"node_modules"
|
|
20
|
-
]
|
|
18
|
+
"exclude": ["node_modules"]
|
|
21
19
|
}
|
package/tsconfig.json
CHANGED
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"rootDir": ".",
|
|
5
5
|
"outDir": "dist",
|
|
6
|
-
"resolveJsonModule": true
|
|
6
|
+
"resolveJsonModule": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"checkJs": false,
|
|
9
|
+
"skipLibCheck": true
|
|
7
10
|
},
|
|
8
11
|
"include": [
|
|
12
|
+
"eslint.config.js",
|
|
13
|
+
"eslint.ignores.js",
|
|
14
|
+
"src/**/*.js",
|
|
9
15
|
"src/**/*.ts",
|
|
10
16
|
"test/**/*.ts"
|
|
11
17
|
],
|
|
12
|
-
"exclude": [
|
|
13
|
-
"test/fixtures/**/*.*",
|
|
14
|
-
"template/**/*.*",
|
|
15
|
-
]
|
|
18
|
+
"exclude": ["test/fixtures/**/*.*", "template/**/*.*"]
|
|
16
19
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"eslint:recommended",
|
|
4
|
-
"plugin:node/recommended",
|
|
5
|
-
"prettier"
|
|
6
|
-
],
|
|
7
|
-
"plugins": [
|
|
8
|
-
"node",
|
|
9
|
-
"prettier"
|
|
10
|
-
],
|
|
11
|
-
"rules": {
|
|
12
|
-
"prettier/prettier": "error",
|
|
13
|
-
"block-scoped-var": "error",
|
|
14
|
-
"eqeqeq": ["error", "always", {"null": "ignore"}],
|
|
15
|
-
"no-var": "error",
|
|
16
|
-
"prefer-const": "error",
|
|
17
|
-
"eol-last": "error",
|
|
18
|
-
"prefer-arrow-callback": "error",
|
|
19
|
-
"no-constant-condition": "off",
|
|
20
|
-
"no-process-exit": "off",
|
|
21
|
-
"no-trailing-spaces": "error",
|
|
22
|
-
"quotes": ["warn", "single", { "avoidEscape": true }]
|
|
23
|
-
},
|
|
24
|
-
"overrides": [
|
|
25
|
-
{
|
|
26
|
-
"files": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
|
|
27
|
-
"parser": "@typescript-eslint/parser",
|
|
28
|
-
"extends": [
|
|
29
|
-
"plugin:@typescript-eslint/recommended"
|
|
30
|
-
],
|
|
31
|
-
"rules": {
|
|
32
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
|
33
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
34
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
35
|
-
"@typescript-eslint/no-warning-comments": "off",
|
|
36
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
37
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
38
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
39
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
40
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
41
|
-
"@typescript-eslint/camelcase": "off",
|
|
42
|
-
"@typescript-eslint/interface-name-prefix": "off",
|
|
43
|
-
"node/no-missing-import": "off",
|
|
44
|
-
"node/no-empty-function": "off",
|
|
45
|
-
"node/no-unsupported-features/es-syntax": "off",
|
|
46
|
-
"node/no-missing-require": "off",
|
|
47
|
-
"node/no-unpublished-import": "warn",
|
|
48
|
-
"node/shebang": "off",
|
|
49
|
-
"no-dupe-class-members": "off",
|
|
50
|
-
"require-atomic-updates": "off"
|
|
51
|
-
},
|
|
52
|
-
"parserOptions": {
|
|
53
|
-
"ecmaVersion": 2018,
|
|
54
|
-
"sourceType": "module"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
package/dist/.eslintrc.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"eslint:recommended",
|
|
4
|
-
"plugin:node/recommended",
|
|
5
|
-
"prettier"
|
|
6
|
-
],
|
|
7
|
-
"plugins": [
|
|
8
|
-
"node",
|
|
9
|
-
"prettier"
|
|
10
|
-
],
|
|
11
|
-
"rules": {
|
|
12
|
-
"prettier/prettier": "error",
|
|
13
|
-
"block-scoped-var": "error",
|
|
14
|
-
"eqeqeq": ["error", "always", { "null": "ignore" }],
|
|
15
|
-
"no-var": "error",
|
|
16
|
-
"prefer-const": "error",
|
|
17
|
-
"eol-last": "error",
|
|
18
|
-
"prefer-arrow-callback": "error",
|
|
19
|
-
"no-constant-condition": "off",
|
|
20
|
-
"no-process-exit": "off",
|
|
21
|
-
"no-trailing-spaces": "error",
|
|
22
|
-
"quotes": ["warn", "single", { "avoidEscape": true }]
|
|
23
|
-
},
|
|
24
|
-
"overrides": [
|
|
25
|
-
{
|
|
26
|
-
"files": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
|
|
27
|
-
"parser": "@typescript-eslint/parser",
|
|
28
|
-
"extends": [
|
|
29
|
-
"plugin:@typescript-eslint/recommended"
|
|
30
|
-
],
|
|
31
|
-
"rules": {
|
|
32
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
|
33
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
34
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
35
|
-
"@typescript-eslint/no-warning-comments": "off",
|
|
36
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
37
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
38
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
39
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
40
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
41
|
-
"@typescript-eslint/camelcase": "off",
|
|
42
|
-
"@typescript-eslint/interface-name-prefix": "off",
|
|
43
|
-
"node/no-missing-import": "off",
|
|
44
|
-
"node/no-empty-function": "off",
|
|
45
|
-
"node/no-unsupported-features/es-syntax": "off",
|
|
46
|
-
"node/no-missing-require": "off",
|
|
47
|
-
"node/no-unpublished-import": "warn",
|
|
48
|
-
"node/shebang": "off",
|
|
49
|
-
"no-dupe-class-members": "off",
|
|
50
|
-
"require-atomic-updates": "off"
|
|
51
|
-
},
|
|
52
|
-
"parserOptions": {
|
|
53
|
-
"ecmaVersion": 2018,
|
|
54
|
-
"sourceType": "module"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
package/dist/src/clean.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/clean.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOhC;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB9D"}
|
package/dist/src/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAcA,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,oBAAY,iBAAiB,GAAG,CAC9B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,CAAC,EAAE,OAAO,KACV,OAAO,CAAC,OAAO,CAAC,CAAC;AAsCtB;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAKzC;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAK3C;AASD,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAwEzE"}
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
package/dist/src/init.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA6CzC,wBAAsB,UAAU,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO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