@deot/dev-cli 1.0.8 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/dev-cli",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "main": "dist/index.es.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,45 +14,17 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@babel/core": "^7.21.4",
18
- "@babel/eslint-plugin": "^7.19.1",
19
- "@babel/preset-env": "^7.21.4",
20
- "@deot/dev-shared": "^1.0.2",
21
- "@microsoft/api-extractor": "^7.34.4",
22
- "@rollup/plugin-commonjs": "^24.1.0",
23
- "@rollup/plugin-node-resolve": "^15.0.2",
24
- "@rollup/plugin-replace": "^5.0.2",
25
- "@rollup/plugin-typescript": "11.1.0",
26
- "@types/jest": "^29.5.0",
27
- "@types/node": "^18.15.11",
28
- "@typescript-eslint/eslint-plugin": "^5.44.0",
29
- "@typescript-eslint/parser": "^5.44.0",
30
- "chalk": "^5.2.0",
31
- "commander": "^10.0.1",
32
- "conventional-commits-parser": "^3.2.4",
33
- "cross-env": "^7.0.3",
34
- "eslint": "^8.38.0",
35
- "eslint-config-airbnb-base": "^15.0.0",
36
- "eslint-plugin-import": "^2.27.5",
37
- "eslint-plugin-jsdoc": "^43.0.0",
38
- "eslint-plugin-markdown": "^3.0.0",
39
- "eslint-watch": "^8.0.0",
40
- "fs-extra": "^11.1.1",
41
- "husky": "^8.0.3",
42
- "inquirer": "^9.1.5",
43
- "inquirer-autocomplete-prompt": "^3.0.0",
44
- "jest": "^29.5.0",
45
- "jest-environment-jsdom": "^29.5.0",
46
- "lint-staged": "^13.2.1",
47
- "ora": "^6.1.2",
48
- "rollup": "^3.20.5",
49
- "semver": "^7.3.8",
50
- "ts-jest": "^29.1.0",
51
- "typescript": "^5.0.4",
52
- "upath": "^2.0.1"
17
+ "@deot/dev-adder": "^1.1.0",
18
+ "@deot/dev-builder": "^1.1.0",
19
+ "@deot/dev-extract": "^1.1.0",
20
+ "@deot/dev-linker": "^1.1.0",
21
+ "@deot/dev-shared": "^1.1.0",
22
+ "@deot/dev-tester": "^1.1.0",
23
+ "@deot/dev-releaser": "^1.1.0",
24
+ "commander": "^10.0.1"
53
25
  },
54
26
  "devDependencies": {
55
- "@deot/dev-test": "^1.0.2"
27
+ "@deot/dev-test": "^1.1.0"
56
28
  },
57
29
  "bin": {
58
30
  "ddc": "bin/cli.js"
@@ -1,233 +0,0 @@
1
- module.exports = {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "parserOptions": {
5
- "requireConfigFile": false,
6
- "ecmaVersion": 2020,
7
- "sourceType": "module",
8
- "ecmaFeatures": {
9
- "jsx": true,
10
- "tsx": true
11
- }
12
- },
13
- "env":
14
- {
15
- "browser": true,
16
- "node": true,
17
- "es6": true,
18
- "mocha": true
19
- },
20
- // 四个级别: base/essential/strongly-recommended/recommended, 使用最高约束
21
- "extends": [
22
- "eslint:recommended",
23
- "plugin:@typescript-eslint/recommended",
24
- "plugin:jsdoc/recommended",
25
- "plugin:markdown/recommended",
26
- "airbnb-base"
27
- ],
28
- "plugins": [
29
- "@babel",
30
- "@typescript-eslint",
31
- "markdown",
32
- "jsdoc"
33
- ],
34
- "settings": {
35
- "import/resolver": {
36
- "node": {
37
- "extensions": [
38
- ".js"
39
- ]
40
- }
41
- }
42
- },
43
- "globals": {
44
- "_global": "readonly"
45
- },
46
-
47
- // 避免全局类型出错
48
- "overrides": [
49
- {
50
- // .md有效
51
- "files": ["**/*.md"],
52
- "processor": "markdown/markdown"
53
- },
54
- {
55
- // 在md文件中标识:```js
56
- "files": ["**/*.md/*.js"],
57
- "rules": {
58
- "no-console": 0,
59
- "import/no-unresolved": 0,
60
- "no-undef": 0
61
- }
62
- },
63
-
64
- {
65
- "files": ["*.ts"],
66
- "rules": {
67
- "no-undef": 0
68
- }
69
- }
70
- ],
71
-
72
- "rules":
73
- {
74
- "import/no-import-module-exports": 0,
75
-
76
- // ts
77
- "@typescript-eslint/ban-ts-ignore": 0,
78
- "@typescript-eslint/explicit-function-return-type": 0,
79
- "@typescript-eslint/no-explicit-any": 0,
80
- "@typescript-eslint/no-var-requires": 0,
81
- "@typescript-eslint/no-empty-function": 0,
82
- "@typescript-eslint/no-use-before-define": 0,
83
- "@typescript-eslint/ban-ts-comment": 0,
84
- "@typescript-eslint/ban-types": 0,
85
- "@typescript-eslint/no-non-null-assertion": 0,
86
- "@typescript-eslint/explicit-module-boundary-types": 0,
87
- "@typescript-eslint/no-unused-vars": 1,
88
- "@typescript-eslint/no-inferrable-types": 0,
89
- // https://github.com/typescript-eslint/typescript-eslint/issues/2483
90
- "@typescript-eslint/no-shadow": "error",
91
- "@typescript-eslint/member-delimiter-style": 'warn',
92
- "no-shadow": "off",
93
-
94
- // "@typescript-eslint/no-unused-vars": [
95
- // "warn",
96
- // {
97
- // argsIgnorePattern: "^_",
98
- // varsIgnorePattern: "^_",
99
- // }
100
- // ],
101
-
102
- // airbnb
103
- "comma-dangle": ["warn", {
104
- "arrays": "never",
105
- "objects": "ignore",
106
- "imports": "never",
107
- "exports": "never",
108
- "functions": "ignore"
109
- }],
110
- "camelcase": 0,
111
- "dot-notation": 0,
112
- "new-parens": ["warn"],
113
- "no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
114
- "object-curly-newline": 0, // { a, b, c } 允许不换行
115
- "arrow-body-style": 0, // a => 1
116
- "arrow-parens": 0, // a => 1
117
- "quote-props": 0, // "a-1": 2
118
- "guard-for-in": 0, // xx.hasOwnProperty(key)
119
- "no-restricted-syntax": 0,
120
- "global-require": 0,
121
- "eqeqeq": 0,
122
- "no-plusplus": 0,
123
- "no-unused-expressions": 0,
124
- "no-undef": ["warn"],
125
- "no-unused-vars": 0,
126
- "import/no-extraneous-dependencies": 0,
127
- "import/prefer-default-export": 0,
128
- "import/newline-after-import": ["warn"],
129
- "import/first": 0,
130
- "import/no-unresolved": 0,
131
- "import/extensions": 0,
132
- "no-multiple-empty-lines": 0,
133
- "no-restricted-globals": 0,
134
- "no-param-reassign": 0,
135
- "no-use-before-define": 0,
136
- "consistent-return": 0,
137
- "no-useless-return": 0,
138
- "prefer-const": 0,
139
- "no-else-return": 0,
140
- "no-useless-escape": 0,
141
- "func-names": 0,
142
- "prefer-arrow-callback": 0,
143
- "no-bitwise": 0,
144
- "padded-blocks": 0, // {} 允许空行
145
- "no-return-assign": 0,
146
- "max-len": ["warn", { "code": 150, "ignoreComments": true }],
147
- "prefer-destructuring": 0,
148
- "prefer-template": 0,
149
- "no-nested-ternary": 0,
150
- "prefer-rest-params": 0,
151
- "class-methods-use-this": 0,
152
- // tab缩进
153
- "indent": ["warn", "tab", { "SwitchCase": 1 }],
154
- "no-tabs": 0,
155
- "quotes": 0,
156
- "no-console": 0,
157
- "no-debugger": 1,
158
- "no-var": 1,
159
- "import/named": 0,
160
- "semi": [
161
- 1,
162
- "always"
163
- ],
164
- "no-trailing-spaces": 0,
165
- "eol-last": 0,
166
- "no-underscore-dangle": 0,
167
- "no-alert": 0,
168
- "no-lone-blocks": 0,
169
- // 关键字周围强制使用空格
170
- "keyword-spacing": [
171
- "error",
172
- {
173
- "before": true,
174
- "after": true
175
- }
176
- ],
177
- // 大括号中强制使用空格
178
- "object-curly-spacing": [
179
- "warn",
180
- "always"
181
- ],
182
- // 单行代码块前后要加空格
183
- "block-spacing": [
184
- "warn",
185
- "always"
186
- ],
187
- // 逗号后面加空格
188
- "comma-spacing": [
189
- "warn",
190
- {
191
- "before": false,
192
- "after": true
193
- }
194
- ],
195
- // 分号后面加空格
196
- "semi-spacing": [
197
- "warn",
198
- {
199
- "before": false,
200
- "after": true
201
- }
202
- ],
203
- // 在注释前有空白
204
- "spaced-comment": [
205
- "warn",
206
- "always"
207
- ],
208
- // 箭头函数前后要有空格
209
- "arrow-spacing": [
210
- "warn",
211
- {
212
- "before": true,
213
- "after": true
214
- }
215
- ],
216
- // 对象字面量的属性中键和值之间使用一致的间距
217
- "key-spacing": [
218
- "warn",
219
- {
220
- "beforeColon": false,
221
- "afterColon": true
222
- }
223
- ],
224
- // 要求操作符周围有空格
225
- "space-infix-ops": [
226
- "warn",
227
- {
228
- "int32Hint": false
229
- }
230
- ],
231
- "jsx-quotes": 1,
232
- }
233
- };
@@ -1,76 +0,0 @@
1
- // this the shared base config for all packages.
2
- {
3
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
4
- "compiler": {
5
- "overrideTsconfig": {
6
- "compilerOptions": {
7
- "paths": null
8
- }
9
- }
10
- },
11
- "apiReport": {
12
- "enabled": true,
13
- "reportFolder": "<projectFolder>/temp/"
14
- },
15
-
16
- "docModel": {
17
- "enabled": true
18
- },
19
-
20
- "dtsRollup": {
21
- "enabled": true,
22
- "untrimmedFilePath": ""
23
- },
24
-
25
- "tsdocMetadata": {
26
- "enabled": false
27
- },
28
-
29
- "messages": {
30
- "compilerMessageReporting": {
31
- "default": {
32
- "logLevel": "warning"
33
- }
34
- },
35
-
36
- "extractorMessageReporting": {
37
- "default": {
38
- "logLevel": "warning",
39
- "addToApiReportFile": true
40
- },
41
-
42
- "ae-missing-release-tag": {
43
- "logLevel": "none"
44
- },
45
- "ae-wrong-input-file-type": {
46
- "logLevel": "none"
47
- }
48
- },
49
-
50
- "tsdocMessageReporting": {
51
- "default": {
52
- "logLevel": "warning"
53
- },
54
-
55
- "tsdoc-undefined-tag": {
56
- "logLevel": "none"
57
- },
58
-
59
- "tsdoc-escape-greater-than": {
60
- "logLevel": "none"
61
- },
62
-
63
- "tsdoc-malformed-inline-tag": {
64
- "logLevel": "none"
65
- },
66
-
67
- "tsdoc-escape-right-brace": {
68
- "logLevel": "none"
69
- },
70
-
71
- "tsdoc-unnecessary-backslash": {
72
- "logLevel": "none"
73
- }
74
- }
75
- }
76
- }
@@ -1,39 +0,0 @@
1
- import fs from 'fs';
2
-
3
- // eslint-disable-next-line max-len
4
- const commitRE = /^(revert: )?(void|fix|feat|docs|style|perf|test|types|build|chore|refactor|workflow|ci|wip|release|breaking change)(\(.+\))?: .{1,50}/;
5
- const mergeRE = /Merge branch /;
6
-
7
- const gitParams = process.env.HUSKY_GIT_PARAMS || process.argv.pop(); // 兼容husky@v4和husky@v8
8
- const commitMsg = fs.readFileSync(gitParams, 'utf-8').trim();
9
-
10
- if (!commitRE.test(commitMsg) && !mergeRE.test(commitMsg)) {
11
- console.error(
12
- `invalid commit message: "${commitMsg}".
13
-
14
- Examples:
15
-
16
- - fix(Button): incorrect style
17
- - feat(Button): incorrect style
18
- - docs(Button): fix typo
19
-
20
- Allowed Types:
21
-
22
- - fix:修补bug
23
- - feat:新功能(feature)
24
- - docs:文档(documentation)
25
- - style:不影响代码含义的更改,可能与代码格式有关,例如空格、缺少分号等
26
- - test:包括新的或更正以前的测试
27
- - chore:构建过程或辅助工具的变动
28
- - refactor:重构(即不是新增功能,也不是修改bug的代码变动)
29
- - perf:性能改进(performance improvements)
30
- - types:类型
31
- - build:影响构建系统或外部依赖项的更改
32
- - ci: 持续集成相关
33
- - breaking change:破坏性修改
34
- - void:无类型,通常用于初始化
35
- - Merge branch 'foo' into 'bar'
36
- `
37
- );
38
- process.exit(1);
39
- }
@@ -1,60 +0,0 @@
1
- const options = JSON.parse(decodeURIComponent(process.env.TEST_OPTIONS || '{}'));
2
- const { workspace, packageFolderName } = options;
3
- const rootDir = process.cwd();
4
-
5
- const testDirPrefix = workspace
6
- ? `<rootDir>/${workspace}/${packageFolderName || '*'}/__tests__`
7
- : `<rootDir>/__tests__`;
8
-
9
- const collectDirPrefix = workspace
10
- ? `<rootDir>/${workspace}/${packageFolderName || '*'}/src`
11
- : `<rootDir>/src`;
12
-
13
- export default {
14
- preset: 'ts-jest',
15
- transform: {
16
- '^.+\\.tsx?$': [
17
- 'ts-jest',
18
- {
19
- tsconfig: {
20
- module: 'esnext',
21
- target: 'esnext',
22
- sourceMap: true
23
- }
24
- }
25
- ],
26
- // 这里主要用于编译node_modules内的js
27
- '^.+\\.jsx?$': 'babel-jest'
28
- },
29
-
30
- testEnvironment: 'jsdom', // or node
31
- // 匹配相关
32
- moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
33
- // 匹配规则很重要
34
- rootDir,
35
- watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
36
- testPathIgnorePatterns: [
37
- '/node_modules/'
38
- ],
39
- testMatch: [
40
- `${testDirPrefix}/**.(spec|test).[jt]s?(x)`
41
- ],
42
-
43
- collectCoverage: true,
44
- coverageDirectory: 'coverage',
45
- collectCoverageFrom: [
46
- `${collectDirPrefix}/**/*.ts`
47
- ],
48
- coverageThreshold: {
49
- global: {
50
- branches: 95,
51
- functions: 95,
52
- lines: 95,
53
- statements: 95,
54
- }
55
- },
56
- globals: {
57
- __VERSION__: 'test',
58
- __TEST__: true
59
- }
60
- };
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "lib": ["esnext", "dom"],
7
- "types": ["node", "jest"],
8
- "jsx": "preserve",
9
- "strict": true,
10
- "sourceMap": false,
11
- "declaration": false,
12
- "resolveJsonModule": true,
13
- "esModuleInterop": true,
14
- "noImplicitAny": false,
15
- "removeComments": true,
16
- "allowSyntheticDefaultImports": true
17
- }
18
- }