@aidc-toolkit/dev 1.0.23-beta → 1.0.25-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 CHANGED
@@ -26,11 +26,36 @@ All AIDC Toolkit packages are expected to be built the same way, which implies t
26
26
  }
27
27
  ```
28
28
 
29
- Options specific to the package may override or supplement core options if required.
29
+ Options specific to the package may override or supplement the default options if required.
30
+
31
+ ## tsup Configuration
32
+
33
+ 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:
34
+
35
+ ```typescript
36
+ import { tsupConfigAIDCToolkit } from "@aidc-toolkit/dev";
37
+
38
+ export default tsupConfigAIDCToolkit;
39
+ ```
40
+
41
+ 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:
42
+
43
+ ```typescript
44
+ import { tsupConfigAIDCToolkit } from "@aidc-toolkit/dev";
45
+ import { defineConfig } from "tsup";
46
+ // Additional imports here as required.
47
+ // ...
48
+
49
+ export default defineConfig([
50
+ tsupConfigAIDCToolkit,
51
+ // Additional options here as required.
52
+ // ...
53
+ ]);
54
+ ```
30
55
 
31
56
  ## ESLint Configuration
32
57
 
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:
58
+ 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
59
 
35
60
  ```typescript
36
61
  import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
@@ -38,7 +63,7 @@ import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
38
63
  export default esLintConfigAIDCToolkit;
39
64
  ```
40
65
 
41
- Rules specific to the package may override or supplement core rules if required. If so, the `eslint.config.ts` file should be declared as follows:
66
+ 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
67
 
43
68
  ```typescript
44
69
  import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
package/dist/index.cjs ADDED
@@ -0,0 +1,192 @@
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
@@ -0,0 +1 @@
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;AAAA,MACnD,6CAA6C;AAAA,MAC7C,wCAAwC;AAAA,MACxC,iCAAiC;AAAA,M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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"]}
@@ -0,0 +1,8 @@
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 };
package/dist/index.d.ts CHANGED
@@ -1,18 +1,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
- //# sourceMappingURL=index.d.ts.map
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 };
package/dist/index.js CHANGED
@@ -1,3 +1,140 @@
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
+ };
1
138
  /*!
2
139
  * Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
3
140
  * contributors
@@ -14,5 +151,4 @@
14
151
  * See the License for the specific language governing permissions and
15
152
  * limitations under the License.
16
153
  */
17
- export * from "./eslint-config-template.js";
18
154
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"sources":["../src/eslint-config-template.ts","../src/tsup-config-template.ts"],"sourcesContent":["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,OAAO,QAAQ;AACf,OAAO,eAAe;AACtB,OAAO,sBAAsB;AAC7B,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AAEd,IAAM,0BAA0B,aAAa;AAAA,EAChD;AAAA,IACI,SAAS,CAAC,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG,QAAQ;AAAA,EACX,GAAG,SAAS,QAAQ;AAAA,EACpB,UAAU,QAAQ;AAAA,EAClB,MAAM,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;AAAA,MACnD,6CAA6C;AAAA,MAC7C,wCAAwC;AAAA,MACxC,iCAAiC;AAAA,MACjC,wCAAwC;AAAA,MAC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ClC,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,SAAS,gBAAAA,qBAAoB;AAEtB,IAAM,wBAAwBA,cAAa,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":["defineConfig"]}
package/eslint.config.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { esLintConfigAIDCToolkit } from "./dist";
1
+ import { esLintConfigAIDCToolkit } from "./src";
2
2
 
3
3
  export default esLintConfigAIDCToolkit;
package/package.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/dev",
3
- "version": "1.0.23-beta",
3
+ "version": "1.0.25-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": {
9
- "type": "git",
10
- "url": "git+https://github.com/aidc-toolkit/dev.git"
11
- },
8
+ "repository": "aidc-toolkit/dev",
12
9
  "bugs": {
13
10
  "url": "https://github.com/aidc-toolkit/dev/issues"
14
11
  },
@@ -21,29 +18,20 @@
21
18
  "scripts": {
22
19
  "copy-workflows": "copy-files-from-to --config copy-workflows.json",
23
20
  "lint": "eslint",
24
- "build:core": "rimraf dist && tsc --project",
25
- "build:dev": "npm run build:core -- tsconfig-build-dev-local.json",
26
- "build:release": "npm run build:core -- tsconfig-build-local.json",
27
- "build:doc": "npm run build:dev",
28
- "publish-alpha": "tsx src/publish/publish-alpha.ts $*",
29
- "publish-beta": "tsx src/publish/publish-beta.ts $*"
21
+ "build:dev": "tsup --define.mode=dev",
22
+ "build:release": "tsup",
23
+ "build:doc": "npm run build:dev"
30
24
  },
31
25
  "dependencies": {
32
26
  "@eslint/js": "^9.39.1",
33
- "@octokit/types": "^16.0.0",
34
27
  "@stylistic/eslint-plugin": "^5.6.1",
35
- "copy-files-from-to": "^3.13.0",
36
28
  "eslint": "^9.39.1",
37
- "eslint-config-love": "^134.0.0",
29
+ "eslint-config-love": "^136.0.0",
38
30
  "eslint-plugin-jsdoc": "^61.4.1",
39
31
  "jiti": "^2.6.1",
40
- "octokit": "^5.0.5",
41
- "rimraf": "^6.1.2",
42
- "ts-node": "^10.9.2",
43
- "tslog": "^4.10.2",
44
- "tsx": "^4.20.6",
32
+ "tsup": "^8.5.1",
33
+ "tsx": "^4.21.0",
45
34
  "typescript": "^5.9.3",
46
- "typescript-eslint": "^8.48.0",
47
- "yaml": "^2.8.1"
35
+ "typescript-eslint": "^8.48.1"
48
36
  }
49
37
  }
package/src/index.ts CHANGED
@@ -14,4 +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.js";
17
+ export * from "./eslint-config-template";
18
+ export * from "./tsup-config-template";
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export const tsupConfigAIDCToolkit = defineConfig((options) => {
4
+ const developmentMode = options.define?.["mode"] === "dev";
5
+
6
+ return {
7
+ name: "aidc-toolkit",
8
+ entry: ["src/index.ts"],
9
+ format: ["esm", "cjs"],
10
+ dts: true,
11
+ minify: !developmentMode,
12
+ sourcemap: developmentMode,
13
+ clean: true
14
+ };
15
+ });
package/tsconfig.json CHANGED
@@ -11,12 +11,14 @@
11
11
  // Modules.
12
12
  "module": "es2022",
13
13
  "moduleResolution": "bundler",
14
+ "noUncheckedSideEffectImports": true,
14
15
  "resolveJsonModule": true,
15
16
 
16
17
  // Emit.
17
18
  "declaration": true,
18
19
 
19
20
  // Interop constraints.
21
+ "erasableSyntaxOnly": true,
20
22
  "esModuleInterop": true,
21
23
  "forceConsistentCasingInFileNames": true,
22
24
 
package/tsup.config.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { tsupConfigAIDCToolkit } from "./src";
2
+
3
+ export default tsupConfigAIDCToolkit;
package/typedoc.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "$schema": "https://typedoc.org/schema.json",
3
- "exclude": ["src/locale/**/locale-strings.ts"],
3
+ "entryPoints": ["../../../src/index.ts"],
4
+ "exclude": ["../../../src/locale/**/locale-strings.ts"],
4
5
  "sourceLinkExternal": true,
6
+ "gitRevision": "{branch}",
5
7
  "groupOrder": [
6
8
  "Enumerations",
7
9
  "Type Aliases",