@aidc-toolkit/dev 1.0.25-beta → 1.0.27-beta
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 +28 -23
- package/dist/eslint-config-template.d.ts +2 -0
- package/dist/eslint-config-template.d.ts.map +1 -0
- package/dist/eslint-config-template.js +118 -0
- package/dist/eslint-config-template.js.map +1 -0
- package/dist/index.d.ts +19 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -137
- package/dist/index.js.map +1 -1
- package/dist/tsup-config-template.d.ts +13 -0
- package/dist/tsup-config-template.d.ts.map +1 -0
- package/dist/tsup-config-template.js +25 -0
- package/dist/tsup-config-template.js.map +1 -0
- package/eslint.config.ts +1 -1
- package/package.json +12 -6
- package/src/index.ts +2 -2
- package/src/tsup-config-template.ts +15 -3
- package/tsconfig-config.json +13 -0
- package/tsconfig-src.json +8 -0
- package/tsconfig-template.json +32 -0
- package/tsconfig.json +9 -29
- package/tsup.config.ts +3 -2
- package/dist/index.cjs +0 -192
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -8
package/README.md
CHANGED
|
@@ -18,62 +18,67 @@ The AIDC Toolkit `dev` package contains development artefacts only; it is not in
|
|
|
18
18
|
|
|
19
19
|
## TypeScript Configuration
|
|
20
20
|
|
|
21
|
-
All AIDC Toolkit packages are expected to be built the same way, which implies that they all have the same TypeScript configuration. This is supported by the [`tsconfig.json` file](tsconfig.json) in this package. Core changes should be managed in that file, with other packages declaring their own `tsconfig.json` as follows:
|
|
21
|
+
All AIDC Toolkit packages are expected to be built the same way, which implies that they all have the same TypeScript configuration. This is supported by the [`tsconfig.json` file](tsconfig-template.json) in this package. Core changes should be managed in that file, with other packages declaring their own `tsconfig.json` as follows:
|
|
22
22
|
|
|
23
23
|
```json
|
|
24
24
|
{
|
|
25
|
-
"extends": "@aidc-toolkit/dev/tsconfig.json"
|
|
25
|
+
"extends": "@aidc-toolkit/dev/tsconfig-template.json"
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Options specific to the package may override or supplement the default options if required.
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## ESLint Configuration
|
|
32
32
|
|
|
33
|
-
AIDC Toolkit
|
|
33
|
+
All AIDC Toolkit packages are expected to follow a common coding style, enforced by [ESLint](https://eslint.org/), which implies that they all have the same ESLint configuration. This is supported by the [`eslint-config-template.ts` file](src/eslint-config-template.ts) in this package. Core changes should be managed in that file, with other packages declaring their own `eslint.config.ts` file as follows:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import {
|
|
36
|
+
import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
|
|
37
37
|
|
|
38
|
-
export default
|
|
38
|
+
export default esLintConfigAIDCToolkit;
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Rules specific to the package may override or supplement the default rules if required. If so, the `eslint.config.ts` file should be declared as follows:
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
|
-
import {
|
|
45
|
-
import { defineConfig } from "
|
|
44
|
+
import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
|
|
45
|
+
import { defineConfig } from "eslint/config";
|
|
46
46
|
// Additional imports here as required.
|
|
47
47
|
// ...
|
|
48
48
|
|
|
49
49
|
export default defineConfig([
|
|
50
|
-
|
|
51
|
-
// Additional
|
|
50
|
+
...esLintConfigAIDCToolkit,
|
|
51
|
+
// Additional rules here as required.
|
|
52
52
|
// ...
|
|
53
53
|
]);
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## tsup Configuration
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
AIDC Toolkit library packages are bundled using [tsup](https://tsup.egoist.dev). This is supported by the [`tsup-config-template.ts` file](src/tsup-config-template.ts) in this package. Core changes should be managed in that file, with other packages declaring their own `tsup.config.ts` file as follows:
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
|
-
import {
|
|
61
|
+
import { tsupConfig } from "@aidc-toolkit/dev";
|
|
62
|
+
import { defineConfig } from "tsup";
|
|
62
63
|
|
|
63
|
-
export default
|
|
64
|
+
export default defineConfig(tsupConfig);
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
Options specific to the package may override or supplement the default options if required.If so, the `tsup.config.ts` file should be declared as follows:
|
|
67
68
|
|
|
68
69
|
```typescript
|
|
69
|
-
import {
|
|
70
|
-
import { defineConfig } from "
|
|
70
|
+
import { tsupConfig } from "@aidc-toolkit/dev";
|
|
71
|
+
import { defineConfig } from "tsup";
|
|
71
72
|
// Additional imports here as required.
|
|
72
73
|
// ...
|
|
73
74
|
|
|
74
|
-
export default defineConfig(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
export default defineConfig((options) => {
|
|
76
|
+
const updatedOptions = tsupConfig(options);
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
...updatedOptions,
|
|
80
|
+
// Additional options here as required.
|
|
81
|
+
// ...
|
|
82
|
+
}
|
|
83
|
+
});
|
|
79
84
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-config-template.d.ts","sourceRoot":"","sources":["../src/eslint-config-template.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB,kCAoHlC,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
3
|
+
import esLintConfigLove from "eslint-config-love";
|
|
4
|
+
import jsdoc from "eslint-plugin-jsdoc";
|
|
5
|
+
import { defineConfig } from "eslint/config";
|
|
6
|
+
import tseslint from "typescript-eslint";
|
|
7
|
+
export const esLintConfigAIDCToolkit = defineConfig([
|
|
8
|
+
{
|
|
9
|
+
ignores: ["dist"]
|
|
10
|
+
},
|
|
11
|
+
esLintConfigLove,
|
|
12
|
+
js.configs.recommended,
|
|
13
|
+
...tseslint.configs.strictTypeChecked,
|
|
14
|
+
stylistic.configs.recommended,
|
|
15
|
+
jsdoc.configs["flat/recommended-typescript"],
|
|
16
|
+
{
|
|
17
|
+
languageOptions: {
|
|
18
|
+
parserOptions: {
|
|
19
|
+
projectService: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
linterOptions: {
|
|
23
|
+
reportUnusedDisableDirectives: "error"
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
"complexity": "off",
|
|
27
|
+
"max-depth": ["error", 10],
|
|
28
|
+
"max-lines": "off",
|
|
29
|
+
"no-negated-condition": "off",
|
|
30
|
+
"no-plusplus": "off",
|
|
31
|
+
// Handled by @typescript-eslint/no-unused-vars.
|
|
32
|
+
"no-unused-vars": "off",
|
|
33
|
+
"@typescript-eslint/class-literal-property-style": "off",
|
|
34
|
+
"@typescript-eslint/class-methods-use-this": "off",
|
|
35
|
+
"@typescript-eslint/init-declarations": "off",
|
|
36
|
+
"@typescript-eslint/max-params": "off",
|
|
37
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
38
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
39
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
40
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
41
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
|
42
|
+
argsIgnorePattern: "^_",
|
|
43
|
+
varsIgnorePattern: "^_",
|
|
44
|
+
caughtErrorsIgnorePattern: "^_"
|
|
45
|
+
}],
|
|
46
|
+
"@typescript-eslint/prefer-destructuring": "off",
|
|
47
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
48
|
+
"@typescript-eslint/unbound-method": ["error", {
|
|
49
|
+
ignoreStatic: true
|
|
50
|
+
}],
|
|
51
|
+
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
52
|
+
"@stylistic/brace-style": ["error", "1tbs", {
|
|
53
|
+
allowSingleLine: false
|
|
54
|
+
}],
|
|
55
|
+
"@stylistic/comma-dangle": ["error", "never"],
|
|
56
|
+
"@stylistic/generator-star-spacing": ["error", {
|
|
57
|
+
before: true,
|
|
58
|
+
after: true
|
|
59
|
+
}],
|
|
60
|
+
"@stylistic/indent": ["error", 4],
|
|
61
|
+
"@stylistic/indent-binary-ops": ["error", 4],
|
|
62
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
63
|
+
multiline: {
|
|
64
|
+
delimiter: "semi",
|
|
65
|
+
requireLast: true
|
|
66
|
+
},
|
|
67
|
+
singleline: {
|
|
68
|
+
delimiter: "semi"
|
|
69
|
+
}
|
|
70
|
+
}],
|
|
71
|
+
"@stylistic/no-trailing-spaces": ["off"],
|
|
72
|
+
"@stylistic/operator-linebreak": ["error", "after"],
|
|
73
|
+
"@stylistic/quotes": ["error", "double"],
|
|
74
|
+
"@stylistic/semi": ["error", "always"],
|
|
75
|
+
"@stylistic/object-curly-newline": ["error", {
|
|
76
|
+
ObjectExpression: {
|
|
77
|
+
multiline: true,
|
|
78
|
+
minProperties: 1
|
|
79
|
+
},
|
|
80
|
+
ObjectPattern: {
|
|
81
|
+
multiline: true,
|
|
82
|
+
minProperties: 1
|
|
83
|
+
}
|
|
84
|
+
}],
|
|
85
|
+
"@stylistic/object-property-newline": "error",
|
|
86
|
+
"@stylistic/yield-star-spacing": ["error", {
|
|
87
|
+
before: true,
|
|
88
|
+
after: true
|
|
89
|
+
}],
|
|
90
|
+
"jsdoc/require-description": ["warn", {
|
|
91
|
+
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
92
|
+
}],
|
|
93
|
+
"jsdoc/require-jsdoc": ["warn", {
|
|
94
|
+
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
95
|
+
}],
|
|
96
|
+
"jsdoc/require-returns": ["warn", {
|
|
97
|
+
checkGetters: false
|
|
98
|
+
}],
|
|
99
|
+
"jsdoc/require-yields-type": "off",
|
|
100
|
+
"jsdoc/tag-lines": ["warn", "any", {
|
|
101
|
+
count: 1,
|
|
102
|
+
startLines: 1
|
|
103
|
+
}]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
files: [
|
|
108
|
+
"test/**/*"
|
|
109
|
+
],
|
|
110
|
+
rules: {
|
|
111
|
+
"max-nested-callbacks": "off",
|
|
112
|
+
"jsdoc/require-jsdoc": "off",
|
|
113
|
+
"@typescript-eslint/dot-notation": "off",
|
|
114
|
+
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]);
|
|
118
|
+
//# sourceMappingURL=eslint-config-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-config-template.js","sourceRoot":"","sources":["../src/eslint-config-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;IAChD;QACI,OAAO,EAAE,CAAC,MAAM,CAAC;KACpB;IACD,gBAAgB;IAChB,EAAE,CAAC,OAAO,CAAC,WAAW;IACtB,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB;IACrC,SAAS,CAAC,OAAO,CAAC,WAAW;IAC7B,KAAK,CAAC,OAAO,CAAC,6BAA6B,CAAC;IAC5C;QACI,eAAe,EAAE;YACb,aAAa,EAAE;gBACX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;SACL;KACJ;IACD;QACI,KAAK,EAAE;YACH,WAAW;SACd;QACD,KAAK,EAAE;YACH,sBAAsB,EAAE,KAAK;YAC7B,qBAAqB,EAAE,KAAK;YAC5B,iCAAiC,EAAE,KAAK;YACxC,6CAA6C,EAAE,KAAK;SACvD;KACJ;CACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
3
|
+
* contributors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export * from "./eslint-config-template.js";
|
|
18
|
+
export * from "./tsup-config-template.js";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,140 +1,3 @@
|
|
|
1
|
-
// src/eslint-config-template.ts
|
|
2
|
-
import js from "@eslint/js";
|
|
3
|
-
import stylistic from "@stylistic/eslint-plugin";
|
|
4
|
-
import esLintConfigLove from "eslint-config-love";
|
|
5
|
-
import jsdoc from "eslint-plugin-jsdoc";
|
|
6
|
-
import { defineConfig } from "eslint/config";
|
|
7
|
-
import tseslint from "typescript-eslint";
|
|
8
|
-
var esLintConfigAIDCToolkit = defineConfig([
|
|
9
|
-
{
|
|
10
|
-
ignores: ["dist"]
|
|
11
|
-
},
|
|
12
|
-
esLintConfigLove,
|
|
13
|
-
js.configs.recommended,
|
|
14
|
-
...tseslint.configs.strictTypeChecked,
|
|
15
|
-
stylistic.configs.recommended,
|
|
16
|
-
jsdoc.configs["flat/recommended-typescript"],
|
|
17
|
-
{
|
|
18
|
-
languageOptions: {
|
|
19
|
-
parserOptions: {
|
|
20
|
-
projectService: true
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
linterOptions: {
|
|
24
|
-
reportUnusedDisableDirectives: "error"
|
|
25
|
-
},
|
|
26
|
-
rules: {
|
|
27
|
-
"complexity": "off",
|
|
28
|
-
"max-depth": ["error", 10],
|
|
29
|
-
"max-lines": "off",
|
|
30
|
-
"no-negated-condition": "off",
|
|
31
|
-
"no-plusplus": "off",
|
|
32
|
-
// Handled by @typescript-eslint/no-unused-vars.
|
|
33
|
-
"no-unused-vars": "off",
|
|
34
|
-
"@typescript-eslint/class-literal-property-style": "off",
|
|
35
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
36
|
-
"@typescript-eslint/init-declarations": "off",
|
|
37
|
-
"@typescript-eslint/max-params": "off",
|
|
38
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
39
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
|
40
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
41
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
42
|
-
"@typescript-eslint/no-unused-vars": ["error", {
|
|
43
|
-
argsIgnorePattern: "^_",
|
|
44
|
-
varsIgnorePattern: "^_",
|
|
45
|
-
caughtErrorsIgnorePattern: "^_"
|
|
46
|
-
}],
|
|
47
|
-
"@typescript-eslint/prefer-destructuring": "off",
|
|
48
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
49
|
-
"@typescript-eslint/unbound-method": ["error", {
|
|
50
|
-
ignoreStatic: true
|
|
51
|
-
}],
|
|
52
|
-
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
53
|
-
"@stylistic/brace-style": ["error", "1tbs", {
|
|
54
|
-
allowSingleLine: false
|
|
55
|
-
}],
|
|
56
|
-
"@stylistic/comma-dangle": ["error", "never"],
|
|
57
|
-
"@stylistic/generator-star-spacing": ["error", {
|
|
58
|
-
before: true,
|
|
59
|
-
after: true
|
|
60
|
-
}],
|
|
61
|
-
"@stylistic/indent": ["error", 4],
|
|
62
|
-
"@stylistic/indent-binary-ops": ["error", 4],
|
|
63
|
-
"@stylistic/member-delimiter-style": ["error", {
|
|
64
|
-
multiline: {
|
|
65
|
-
delimiter: "semi",
|
|
66
|
-
requireLast: true
|
|
67
|
-
},
|
|
68
|
-
singleline: {
|
|
69
|
-
delimiter: "semi"
|
|
70
|
-
}
|
|
71
|
-
}],
|
|
72
|
-
"@stylistic/no-trailing-spaces": ["off"],
|
|
73
|
-
"@stylistic/operator-linebreak": ["error", "after"],
|
|
74
|
-
"@stylistic/quotes": ["error", "double"],
|
|
75
|
-
"@stylistic/semi": ["error", "always"],
|
|
76
|
-
"@stylistic/object-curly-newline": ["error", {
|
|
77
|
-
ObjectExpression: {
|
|
78
|
-
multiline: true,
|
|
79
|
-
minProperties: 1
|
|
80
|
-
},
|
|
81
|
-
ObjectPattern: {
|
|
82
|
-
multiline: true,
|
|
83
|
-
minProperties: 1
|
|
84
|
-
}
|
|
85
|
-
}],
|
|
86
|
-
"@stylistic/object-property-newline": "error",
|
|
87
|
-
"@stylistic/yield-star-spacing": ["error", {
|
|
88
|
-
before: true,
|
|
89
|
-
after: true
|
|
90
|
-
}],
|
|
91
|
-
"jsdoc/require-description": ["warn", {
|
|
92
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
93
|
-
}],
|
|
94
|
-
"jsdoc/require-jsdoc": ["warn", {
|
|
95
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
96
|
-
}],
|
|
97
|
-
"jsdoc/require-returns": ["warn", {
|
|
98
|
-
checkGetters: false
|
|
99
|
-
}],
|
|
100
|
-
"jsdoc/require-yields-type": "off",
|
|
101
|
-
"jsdoc/tag-lines": ["warn", "any", {
|
|
102
|
-
count: 1,
|
|
103
|
-
startLines: 1
|
|
104
|
-
}]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
files: [
|
|
109
|
-
"test/**/*"
|
|
110
|
-
],
|
|
111
|
-
rules: {
|
|
112
|
-
"max-nested-callbacks": "off",
|
|
113
|
-
"jsdoc/require-jsdoc": "off",
|
|
114
|
-
"@typescript-eslint/dot-notation": "off",
|
|
115
|
-
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
]);
|
|
119
|
-
|
|
120
|
-
// src/tsup-config-template.ts
|
|
121
|
-
import { defineConfig as defineConfig2 } from "tsup";
|
|
122
|
-
var tsupConfigAIDCToolkit = defineConfig2((options) => {
|
|
123
|
-
const developmentMode = options.define?.["mode"] === "dev";
|
|
124
|
-
return {
|
|
125
|
-
name: "aidc-toolkit",
|
|
126
|
-
entry: ["src/index.ts"],
|
|
127
|
-
format: ["esm", "cjs"],
|
|
128
|
-
dts: true,
|
|
129
|
-
minify: !developmentMode,
|
|
130
|
-
sourcemap: developmentMode,
|
|
131
|
-
clean: true
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
export {
|
|
135
|
-
esLintConfigAIDCToolkit,
|
|
136
|
-
tsupConfigAIDCToolkit
|
|
137
|
-
};
|
|
138
1
|
/*!
|
|
139
2
|
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
140
3
|
* contributors
|
|
@@ -151,4 +14,6 @@ export {
|
|
|
151
14
|
* See the License for the specific language governing permissions and
|
|
152
15
|
* limitations under the License.
|
|
153
16
|
*/
|
|
17
|
+
export * from "./eslint-config-template.js";
|
|
18
|
+
export * from "./tsup-config-template.js";
|
|
154
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Options } from "tsup";
|
|
2
|
+
/**
|
|
3
|
+
* Create common configuration for tsup, parameterized by development mode. If `options.define?.["mode"] === "dev"`,
|
|
4
|
+
* tsup is running in development mode and will generate unminified, unbundled output with sourcemaps.
|
|
5
|
+
*
|
|
6
|
+
* @param options
|
|
7
|
+
* Initial options.
|
|
8
|
+
*
|
|
9
|
+
* @returns
|
|
10
|
+
* Updated options.
|
|
11
|
+
*/
|
|
12
|
+
export declare function tsupConfig(options: Options): Options;
|
|
13
|
+
//# sourceMappingURL=tsup-config-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup-config-template.d.ts","sourceRoot":"","sources":["../src/tsup-config-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAcpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create common configuration for tsup, parameterized by development mode. If `options.define?.["mode"] === "dev"`,
|
|
3
|
+
* tsup is running in development mode and will generate unminified, unbundled output with sourcemaps.
|
|
4
|
+
*
|
|
5
|
+
* @param options
|
|
6
|
+
* Initial options.
|
|
7
|
+
*
|
|
8
|
+
* @returns
|
|
9
|
+
* Updated options.
|
|
10
|
+
*/
|
|
11
|
+
export function tsupConfig(options) {
|
|
12
|
+
const developmentMode = options.define?.["mode"] === "dev";
|
|
13
|
+
return {
|
|
14
|
+
...options,
|
|
15
|
+
name: "aidc-toolkit",
|
|
16
|
+
tsconfig: "./tsconfig-src.json",
|
|
17
|
+
entry: ["src/index.ts"],
|
|
18
|
+
format: ["esm", "cjs"],
|
|
19
|
+
dts: true,
|
|
20
|
+
minify: !developmentMode,
|
|
21
|
+
sourcemap: developmentMode,
|
|
22
|
+
clean: true
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tsup-config-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsup-config-template.js","sourceRoot":"","sources":["../src/tsup-config-template.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACvC,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC;IAE3D,OAAO;QACH,GAAG,OAAO;QACV,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,qBAAqB;QAC/B,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QACtB,GAAG,EAAE,IAAI;QACT,MAAM,EAAE,CAAC,eAAe;QACxB,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,IAAI;KACd,CAAC;AACN,CAAC"}
|
package/eslint.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/dev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27-beta",
|
|
4
4
|
"description": "Shared development artefacts for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"homepage": "https://aidc-toolkit.com/",
|
|
8
|
-
"repository":
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/aidc-toolkit/dev.git"
|
|
11
|
+
},
|
|
9
12
|
"bugs": {
|
|
10
13
|
"url": "https://github.com/aidc-toolkit/dev/issues"
|
|
11
14
|
},
|
|
@@ -18,20 +21,23 @@
|
|
|
18
21
|
"scripts": {
|
|
19
22
|
"copy-workflows": "copy-files-from-to --config copy-workflows.json",
|
|
20
23
|
"lint": "eslint",
|
|
21
|
-
"
|
|
22
|
-
"build:
|
|
24
|
+
"tsc:core": "tsc --project tsconfig-src.json",
|
|
25
|
+
"build:dev": "rimraf dist && npm run tsc:core -- --declarationMap --sourceMap",
|
|
26
|
+
"build:release": "npm run tsc:core -- --noEmit && tsup",
|
|
23
27
|
"build:doc": "npm run build:dev"
|
|
24
28
|
},
|
|
25
29
|
"dependencies": {
|
|
26
30
|
"@eslint/js": "^9.39.1",
|
|
27
31
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
32
|
+
"@types/node": "^24.10.2",
|
|
28
33
|
"eslint": "^9.39.1",
|
|
29
34
|
"eslint-config-love": "^136.0.0",
|
|
30
|
-
"eslint-plugin-jsdoc": "^61.
|
|
35
|
+
"eslint-plugin-jsdoc": "^61.5.0",
|
|
31
36
|
"jiti": "^2.6.1",
|
|
37
|
+
"rimraf": "^6.1.2",
|
|
32
38
|
"tsup": "^8.5.1",
|
|
33
39
|
"tsx": "^4.21.0",
|
|
34
40
|
"typescript": "^5.9.3",
|
|
35
|
-
"typescript-eslint": "^8.
|
|
41
|
+
"typescript-eslint": "^8.49.0"
|
|
36
42
|
}
|
|
37
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export * from "./eslint-config-template";
|
|
18
|
-
export * from "./tsup-config-template";
|
|
17
|
+
export * from "./eslint-config-template.js";
|
|
18
|
+
export * from "./tsup-config-template.js";
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Options } from "tsup";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Create common configuration for tsup, parameterized by development mode. If `options.define?.["mode"] === "dev"`,
|
|
5
|
+
* tsup is running in development mode and will generate unminified, unbundled output with sourcemaps.
|
|
6
|
+
*
|
|
7
|
+
* @param options
|
|
8
|
+
* Initial options.
|
|
9
|
+
*
|
|
10
|
+
* @returns
|
|
11
|
+
* Updated options.
|
|
12
|
+
*/
|
|
13
|
+
export function tsupConfig(options: Options): Options {
|
|
4
14
|
const developmentMode = options.define?.["mode"] === "dev";
|
|
5
15
|
|
|
6
16
|
return {
|
|
17
|
+
...options,
|
|
7
18
|
name: "aidc-toolkit",
|
|
19
|
+
tsconfig: "./tsconfig-src.json",
|
|
8
20
|
entry: ["src/index.ts"],
|
|
9
21
|
format: ["esm", "cjs"],
|
|
10
22
|
dts: true,
|
|
@@ -12,4 +24,4 @@ export const tsupConfigAIDCToolkit = defineConfig((options) => {
|
|
|
12
24
|
sourcemap: developmentMode,
|
|
13
25
|
clean: true
|
|
14
26
|
};
|
|
15
|
-
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// https://aka.ms/tsconfig
|
|
2
|
+
{
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// Type checking.
|
|
5
|
+
"strict": true,
|
|
6
|
+
"exactOptionalPropertyTypes": true,
|
|
7
|
+
"noFallthroughCasesInSwitch": true,
|
|
8
|
+
"noImplicitOverride": true,
|
|
9
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
10
|
+
|
|
11
|
+
// Modules.
|
|
12
|
+
"module": "NodeNext",
|
|
13
|
+
"moduleResolution": "nodenext",
|
|
14
|
+
"noUncheckedSideEffectImports": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
|
|
17
|
+
// Emit.
|
|
18
|
+
"declaration": true,
|
|
19
|
+
|
|
20
|
+
// Interop constraints.
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
|
|
25
|
+
// Language and environment.
|
|
26
|
+
"target": "es2022",
|
|
27
|
+
"lib": ["ES2022"],
|
|
28
|
+
|
|
29
|
+
// Completeness.
|
|
30
|
+
"skipLibCheck": true
|
|
31
|
+
}
|
|
32
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
// https://aka.ms/tsconfig
|
|
2
1
|
{
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"module": "es2022",
|
|
13
|
-
"moduleResolution": "bundler",
|
|
14
|
-
"noUncheckedSideEffectImports": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
|
|
17
|
-
// Emit.
|
|
18
|
-
"declaration": true,
|
|
19
|
-
|
|
20
|
-
// Interop constraints.
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"esModuleInterop": true,
|
|
23
|
-
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
|
|
25
|
-
// Language and environment.
|
|
26
|
-
"target": "es2022",
|
|
27
|
-
|
|
28
|
-
// Completeness.
|
|
29
|
-
"skipLibCheck": true
|
|
30
|
-
}
|
|
2
|
+
"include": [],
|
|
3
|
+
"references": [
|
|
4
|
+
{
|
|
5
|
+
"path": "./tsconfig-src.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"path": "./tsconfig-config.json"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
31
11
|
}
|
package/tsup.config.ts
CHANGED
package/dist/index.cjs
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
esLintConfigAIDCToolkit: () => esLintConfigAIDCToolkit,
|
|
34
|
-
tsupConfigAIDCToolkit: () => tsupConfigAIDCToolkit
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(index_exports);
|
|
37
|
-
|
|
38
|
-
// src/eslint-config-template.ts
|
|
39
|
-
var import_js = __toESM(require("@eslint/js"), 1);
|
|
40
|
-
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
41
|
-
var import_eslint_config_love = __toESM(require("eslint-config-love"), 1);
|
|
42
|
-
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
|
43
|
-
var import_config = require("eslint/config");
|
|
44
|
-
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
45
|
-
var esLintConfigAIDCToolkit = (0, import_config.defineConfig)([
|
|
46
|
-
{
|
|
47
|
-
ignores: ["dist"]
|
|
48
|
-
},
|
|
49
|
-
import_eslint_config_love.default,
|
|
50
|
-
import_js.default.configs.recommended,
|
|
51
|
-
...import_typescript_eslint.default.configs.strictTypeChecked,
|
|
52
|
-
import_eslint_plugin.default.configs.recommended,
|
|
53
|
-
import_eslint_plugin_jsdoc.default.configs["flat/recommended-typescript"],
|
|
54
|
-
{
|
|
55
|
-
languageOptions: {
|
|
56
|
-
parserOptions: {
|
|
57
|
-
projectService: true
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
linterOptions: {
|
|
61
|
-
reportUnusedDisableDirectives: "error"
|
|
62
|
-
},
|
|
63
|
-
rules: {
|
|
64
|
-
"complexity": "off",
|
|
65
|
-
"max-depth": ["error", 10],
|
|
66
|
-
"max-lines": "off",
|
|
67
|
-
"no-negated-condition": "off",
|
|
68
|
-
"no-plusplus": "off",
|
|
69
|
-
// Handled by @typescript-eslint/no-unused-vars.
|
|
70
|
-
"no-unused-vars": "off",
|
|
71
|
-
"@typescript-eslint/class-literal-property-style": "off",
|
|
72
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
73
|
-
"@typescript-eslint/init-declarations": "off",
|
|
74
|
-
"@typescript-eslint/max-params": "off",
|
|
75
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
76
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
|
77
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
78
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
79
|
-
"@typescript-eslint/no-unused-vars": ["error", {
|
|
80
|
-
argsIgnorePattern: "^_",
|
|
81
|
-
varsIgnorePattern: "^_",
|
|
82
|
-
caughtErrorsIgnorePattern: "^_"
|
|
83
|
-
}],
|
|
84
|
-
"@typescript-eslint/prefer-destructuring": "off",
|
|
85
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
|
86
|
-
"@typescript-eslint/unbound-method": ["error", {
|
|
87
|
-
ignoreStatic: true
|
|
88
|
-
}],
|
|
89
|
-
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
90
|
-
"@stylistic/brace-style": ["error", "1tbs", {
|
|
91
|
-
allowSingleLine: false
|
|
92
|
-
}],
|
|
93
|
-
"@stylistic/comma-dangle": ["error", "never"],
|
|
94
|
-
"@stylistic/generator-star-spacing": ["error", {
|
|
95
|
-
before: true,
|
|
96
|
-
after: true
|
|
97
|
-
}],
|
|
98
|
-
"@stylistic/indent": ["error", 4],
|
|
99
|
-
"@stylistic/indent-binary-ops": ["error", 4],
|
|
100
|
-
"@stylistic/member-delimiter-style": ["error", {
|
|
101
|
-
multiline: {
|
|
102
|
-
delimiter: "semi",
|
|
103
|
-
requireLast: true
|
|
104
|
-
},
|
|
105
|
-
singleline: {
|
|
106
|
-
delimiter: "semi"
|
|
107
|
-
}
|
|
108
|
-
}],
|
|
109
|
-
"@stylistic/no-trailing-spaces": ["off"],
|
|
110
|
-
"@stylistic/operator-linebreak": ["error", "after"],
|
|
111
|
-
"@stylistic/quotes": ["error", "double"],
|
|
112
|
-
"@stylistic/semi": ["error", "always"],
|
|
113
|
-
"@stylistic/object-curly-newline": ["error", {
|
|
114
|
-
ObjectExpression: {
|
|
115
|
-
multiline: true,
|
|
116
|
-
minProperties: 1
|
|
117
|
-
},
|
|
118
|
-
ObjectPattern: {
|
|
119
|
-
multiline: true,
|
|
120
|
-
minProperties: 1
|
|
121
|
-
}
|
|
122
|
-
}],
|
|
123
|
-
"@stylistic/object-property-newline": "error",
|
|
124
|
-
"@stylistic/yield-star-spacing": ["error", {
|
|
125
|
-
before: true,
|
|
126
|
-
after: true
|
|
127
|
-
}],
|
|
128
|
-
"jsdoc/require-description": ["warn", {
|
|
129
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
130
|
-
}],
|
|
131
|
-
"jsdoc/require-jsdoc": ["warn", {
|
|
132
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
133
|
-
}],
|
|
134
|
-
"jsdoc/require-returns": ["warn", {
|
|
135
|
-
checkGetters: false
|
|
136
|
-
}],
|
|
137
|
-
"jsdoc/require-yields-type": "off",
|
|
138
|
-
"jsdoc/tag-lines": ["warn", "any", {
|
|
139
|
-
count: 1,
|
|
140
|
-
startLines: 1
|
|
141
|
-
}]
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
files: [
|
|
146
|
-
"test/**/*"
|
|
147
|
-
],
|
|
148
|
-
rules: {
|
|
149
|
-
"max-nested-callbacks": "off",
|
|
150
|
-
"jsdoc/require-jsdoc": "off",
|
|
151
|
-
"@typescript-eslint/dot-notation": "off",
|
|
152
|
-
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
]);
|
|
156
|
-
|
|
157
|
-
// src/tsup-config-template.ts
|
|
158
|
-
var import_tsup = require("tsup");
|
|
159
|
-
var tsupConfigAIDCToolkit = (0, import_tsup.defineConfig)((options) => {
|
|
160
|
-
const developmentMode = options.define?.["mode"] === "dev";
|
|
161
|
-
return {
|
|
162
|
-
name: "aidc-toolkit",
|
|
163
|
-
entry: ["src/index.ts"],
|
|
164
|
-
format: ["esm", "cjs"],
|
|
165
|
-
dts: true,
|
|
166
|
-
minify: !developmentMode,
|
|
167
|
-
sourcemap: developmentMode,
|
|
168
|
-
clean: true
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
172
|
-
0 && (module.exports = {
|
|
173
|
-
esLintConfigAIDCToolkit,
|
|
174
|
-
tsupConfigAIDCToolkit
|
|
175
|
-
});
|
|
176
|
-
/*!
|
|
177
|
-
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
178
|
-
* contributors
|
|
179
|
-
*
|
|
180
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
-
* you may not use this file except in compliance with the License.
|
|
182
|
-
* You may obtain a copy of the License at
|
|
183
|
-
*
|
|
184
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
-
*
|
|
186
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
187
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
-
* See the License for the specific language governing permissions and
|
|
190
|
-
* limitations under the License.
|
|
191
|
-
*/
|
|
192
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/eslint-config-template.ts","../src/tsup-config-template.ts"],"sourcesContent":["/*!\n * Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit\n * contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport * from \"./eslint-config-template\";\nexport * from \"./tsup-config-template\";\n","import js from \"@eslint/js\";\nimport stylistic from \"@stylistic/eslint-plugin\";\nimport esLintConfigLove from \"eslint-config-love\";\nimport jsdoc from \"eslint-plugin-jsdoc\";\nimport { defineConfig } from \"eslint/config\";\nimport tseslint from \"typescript-eslint\";\n\nexport const esLintConfigAIDCToolkit = defineConfig([\n {\n ignores: [\"dist\"]\n },\n esLintConfigLove,\n js.configs.recommended,\n ...tseslint.configs.strictTypeChecked,\n stylistic.configs.recommended,\n jsdoc.configs[\"flat/recommended-typescript\"],\n {\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n\n linterOptions: {\n reportUnusedDisableDirectives: \"error\"\n },\n\n rules: {\n \"complexity\": \"off\",\n \"max-depth\": [\"error\", 10],\n \"max-lines\": \"off\",\n \"no-negated-condition\": \"off\",\n \"no-plusplus\": \"off\",\n\n // Handled by @typescript-eslint/no-unused-vars.\n \"no-unused-vars\": \"off\",\n\n \"@typescript-eslint/class-literal-property-style\": \"off\",\n \"@typescript-eslint/class-methods-use-this\": \"off\",\n \"@typescript-eslint/init-declarations\": \"off\",\n \"@typescript-eslint/max-params\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/no-magic-numbers\": \"off\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"off\",\n \"@typescript-eslint/no-unused-vars\": [\"error\", {\n argsIgnorePattern: \"^_\",\n varsIgnorePattern: \"^_\",\n caughtErrorsIgnorePattern: \"^_\"\n }],\n \"@typescript-eslint/prefer-destructuring\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n \"@typescript-eslint/unbound-method\": [\"error\", {\n ignoreStatic: true\n }],\n\n \"@stylistic/array-bracket-newline\": [\"error\", \"consistent\"],\n \"@stylistic/brace-style\": [\"error\", \"1tbs\", {\n allowSingleLine: false\n }],\n \"@stylistic/comma-dangle\": [\"error\", \"never\"],\n \"@stylistic/generator-star-spacing\": [\"error\", {\n before: true,\n after: true\n }],\n \"@stylistic/indent\": [\"error\", 4],\n \"@stylistic/indent-binary-ops\": [\"error\", 4],\n \"@stylistic/member-delimiter-style\": [\"error\", {\n multiline: {\n delimiter: \"semi\",\n requireLast: true\n },\n singleline: {\n delimiter: \"semi\"\n }\n }],\n \"@stylistic/no-trailing-spaces\": [\"off\"],\n \"@stylistic/operator-linebreak\": [\"error\", \"after\"],\n \"@stylistic/quotes\": [\"error\", \"double\"],\n \"@stylistic/semi\": [\"error\", \"always\"],\n \"@stylistic/object-curly-newline\": [\"error\", {\n ObjectExpression: {\n multiline: true,\n minProperties: 1\n },\n ObjectPattern: {\n multiline: true,\n minProperties: 1\n }\n }],\n \"@stylistic/object-property-newline\": \"error\",\n \"@stylistic/yield-star-spacing\": [\"error\", {\n before: true,\n after: true\n }],\n\n \"jsdoc/require-description\": [\"warn\", {\n contexts: [\"ClassDeclaration\", \"ClassProperty\", \"FunctionDeclaration\", \"MethodDefinition\", \"TSEnumDeclaration\", \"TSInterfaceDeclaration\", \"TSModuleDeclaration\", \"TSTypeAliasDeclaration\"]\n }],\n \"jsdoc/require-jsdoc\": [\"warn\", {\n contexts: [\"ClassDeclaration\", \"ClassProperty\", \"FunctionDeclaration\", \"MethodDefinition\", \"TSEnumDeclaration\", \"TSInterfaceDeclaration\", \"TSModuleDeclaration\", \"TSTypeAliasDeclaration\"]\n }],\n \"jsdoc/require-returns\": [\"warn\", {\n checkGetters: false\n }],\n \"jsdoc/require-yields-type\": \"off\",\n \"jsdoc/tag-lines\": [\"warn\", \"any\", {\n count: 1,\n startLines: 1\n }]\n }\n },\n {\n files: [\n \"test/**/*\"\n ],\n rules: {\n \"max-nested-callbacks\": \"off\",\n \"jsdoc/require-jsdoc\": \"off\",\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-unsafe-type-assertion\": \"off\"\n }\n }\n]);\n","import { defineConfig } from \"tsup\";\n\nexport const tsupConfigAIDCToolkit = defineConfig((options) => {\n const developmentMode = options.define?.[\"mode\"] === \"dev\";\n\n return {\n name: \"aidc-toolkit\",\n entry: [\"src/index.ts\"],\n format: [\"esm\", \"cjs\"],\n dts: true,\n minify: !developmentMode,\n sourcemap: developmentMode,\n clean: true\n };\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gBAAe;AACf,2BAAsB;AACtB,gCAA6B;AAC7B,iCAAkB;AAClB,oBAA6B;AAC7B,+BAAqB;AAEd,IAAM,8BAA0B,4BAAa;AAAA,EAChD;AAAA,IACI,SAAS,CAAC,MAAM;AAAA,EACpB;AAAA,EACA,0BAAAA;AAAA,EACA,UAAAC,QAAG,QAAQ;AAAA,EACX,GAAG,yBAAAC,QAAS,QAAQ;AAAA,EACpB,qBAAAC,QAAU,QAAQ;AAAA,EAClB,2BAAAC,QAAM,QAAQ,6BAA6B;AAAA,EAC3C;AAAA,IACI,iBAAiB;AAAA,MACb,eAAe;AAAA,QACX,gBAAgB;AAAA,MACpB;AAAA,IACJ;AAAA,IAEA,eAAe;AAAA,MACX,+BAA+B;AAAA,IACnC;AAAA,IAEA,OAAO;AAAA,MACH,cAAc;AAAA,MACd,aAAa,CAAC,SAAS,EAAE;AAAA,MACzB,aAAa;AAAA,MACb,wBAAwB;AAAA,MACxB,eAAe;AAAA;AAAA,MAGf,kBAAkB;AAAA,MAElB,mDAAmD;AA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,QACvC,QAAQ;AAAA,QACR,OAAO;AAAA,MACX,CAAC;AAAA,MAED,6BAA6B,CAAC,QAAQ;AAAA,QAClC,UAAU,CAAC,oBAAoB,iBAAiB,uBAAuB,oBAAoB,qBAAqB,0BAA0B,uBAAuB,wBAAwB;AAAA,MAC7L,CAAC;AAAA,MACD,uBAAuB,CAAC,QAAQ;AAAA,QAC5B,UAAU,CAAC,oBAAoB,iBAAiB,uBAAuB,oBAAoB,qBAAqB,0BAA0B,uBAAuB,wBAAwB;AAAA,MAC7L,CAAC;AAAA,MACD,yBAAyB,CAAC,QAAQ;AAAA,QAC9B,cAAc;AAAA,MAClB,CAAC;AAAA,MACD,6BAA6B;AAAA,MAC7B,mBAAmB,CAAC,QAAQ,OAAO;AAAA,QAC/B,OAAO;AAAA,QACP,YAAY;AAAA,MAChB,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EACA;AAAA,IACI,OAAO;AAAA,MACH;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,MACH,wBAAwB;AAAA,MACxB,uBAAuB;AAAA,MACvB,mCAAmC;AAAA,MACnC,+CAA+C;AAAA,IACnD;AAAA,EACJ;AACJ,CAAC;;;AC3HD,kBAA6B;AAEtB,IAAM,4BAAwB,0BAAa,CAAC,YAAY;AAC3D,QAAM,kBAAkB,QAAQ,SAAS,MAAM,MAAM;AAErD,SAAO;AAAA,IACH,MAAM;AAAA,IACN,OAAO,CAAC,cAAc;AAAA,IACtB,QAAQ,CAAC,OAAO,KAAK;AAAA,IACrB,KAAK;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,EACX;AACJ,CAAC;","names":["esLintConfigLove","js","tseslint","stylistic","jsdoc"]}
|
package/dist/index.d.cts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as eslint_config from 'eslint/config';
|
|
2
|
-
import * as tsup from 'tsup';
|
|
3
|
-
|
|
4
|
-
declare const esLintConfigAIDCToolkit: eslint_config.Config[];
|
|
5
|
-
|
|
6
|
-
declare const tsupConfigAIDCToolkit: tsup.Options | tsup.Options[] | ((overrideOptions: tsup.Options) => tsup.Options | tsup.Options[] | Promise<tsup.Options | tsup.Options[]>);
|
|
7
|
-
|
|
8
|
-
export { esLintConfigAIDCToolkit, tsupConfigAIDCToolkit };
|