@aidc-toolkit/dev 0.9.7-beta → 0.9.9-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/LICENSE +0 -27
- package/README.md +17 -2
- package/config/release.json +6 -6
- package/dist/index.cjs +22 -4
- package/dist/index.js +19 -1
- package/package.json +11 -11
- package/src/{eslint.config.template.ts → eslint-config-template.ts} +2 -0
- package/src/index.ts +17 -1
- package/src/release.ts +27 -20
package/LICENSE
CHANGED
|
@@ -172,30 +172,3 @@
|
|
|
172
172
|
defend, and hold each Contributor harmless for any liability
|
|
173
173
|
incurred by, or claims asserted against, such Contributor by reason
|
|
174
174
|
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright © 2024 Dolphin Data Development Ltd.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Development Package
|
|
2
2
|
|
|
3
|
+
**Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit contributors**
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
|
|
6
|
+
License. You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
|
11
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
⚠️ **This software is in beta**, with production release is scheduled for 2024Q4. To follow the status of that and other
|
|
16
|
+
projects, go to the AIDC Toolkit [projects](https://github.com/orgs/aidc-toolkit/projects) page.
|
|
17
|
+
|
|
3
18
|
The AIDC Toolkit `dev` package contains development artefacts only; it is not intended to be used as anything other than
|
|
4
19
|
a development dependency.
|
|
5
20
|
|
|
@@ -20,8 +35,8 @@ Options specific to the package may override or supplement core options if requi
|
|
|
20
35
|
## ESLint Configuration
|
|
21
36
|
|
|
22
37
|
All AIDC Toolkit packages are expected to follow a common coding style (enforced by [ESLint](https://eslint.org/)),
|
|
23
|
-
which implies that they all have the same ESLint configuration. This is supported by the [`eslint
|
|
24
|
-
file](src/eslint
|
|
38
|
+
which implies that they all have the same ESLint configuration. This is supported by the [`eslint-config-template.ts`
|
|
39
|
+
file](src/eslint-config-template.ts) in this package. Core changes should be managed in that file, with other packages
|
|
25
40
|
declaring their own `eslint.config.js` file as follows:
|
|
26
41
|
|
|
27
42
|
```javascript
|
package/config/release.json
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"organization": "aidc-toolkit",
|
|
3
3
|
"repositories": {
|
|
4
4
|
"dev": {
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.9-beta"
|
|
6
6
|
},
|
|
7
7
|
"core": {
|
|
8
|
-
"version": "0.9.
|
|
8
|
+
"version": "0.9.9-beta"
|
|
9
9
|
},
|
|
10
10
|
"utility": {
|
|
11
|
-
"version": "0.9.
|
|
11
|
+
"version": "0.9.9-beta"
|
|
12
12
|
},
|
|
13
13
|
"gs1": {
|
|
14
14
|
"name": "gs1",
|
|
15
|
-
"version": "0.9.
|
|
15
|
+
"version": "0.9.9-beta"
|
|
16
16
|
},
|
|
17
17
|
"demo": {
|
|
18
|
-
"version": "0.9.
|
|
18
|
+
"version": "0.9.9-beta"
|
|
19
19
|
},
|
|
20
20
|
"aidc-toolkit.github.io": {
|
|
21
21
|
"directory": "doc",
|
|
22
|
-
"version": "0.9.
|
|
22
|
+
"version": "0.9.9-beta"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -28,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
esLintConfigAIDCToolkit: () => esLintConfigAIDCToolkit
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
|
-
// src/eslint
|
|
37
|
+
// src/eslint-config-template.ts
|
|
38
38
|
var import_js = __toESM(require("@eslint/js"), 1);
|
|
39
39
|
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
40
40
|
var import_eslint_config_love = __toESM(require("eslint-config-love"), 1);
|
|
@@ -60,6 +60,7 @@ var esLintConfigAIDCToolkit = import_typescript_eslint.default.config(
|
|
|
60
60
|
},
|
|
61
61
|
rules: {
|
|
62
62
|
"complexity": "off",
|
|
63
|
+
"max-lines": "off",
|
|
63
64
|
"no-dupe-class-members": "off",
|
|
64
65
|
"no-redeclare": "off",
|
|
65
66
|
"no-unused-vars": "off",
|
|
@@ -133,6 +134,7 @@ var esLintConfigAIDCToolkit = import_typescript_eslint.default.config(
|
|
|
133
134
|
"test/**/*"
|
|
134
135
|
],
|
|
135
136
|
rules: {
|
|
137
|
+
"max-nested-callbacks": "off",
|
|
136
138
|
"jsdoc/require-jsdoc": "off",
|
|
137
139
|
"@typescript-eslint/dot-notation": "off",
|
|
138
140
|
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
@@ -143,3 +145,19 @@ var esLintConfigAIDCToolkit = import_typescript_eslint.default.config(
|
|
|
143
145
|
0 && (module.exports = {
|
|
144
146
|
esLintConfigAIDCToolkit
|
|
145
147
|
});
|
|
148
|
+
/*!
|
|
149
|
+
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
150
|
+
* contributors
|
|
151
|
+
*
|
|
152
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
153
|
+
* you may not use this file except in compliance with the License.
|
|
154
|
+
* You may obtain a copy of the License at
|
|
155
|
+
*
|
|
156
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
157
|
+
*
|
|
158
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
159
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
160
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
161
|
+
* See the License for the specific language governing permissions and
|
|
162
|
+
* limitations under the License.
|
|
163
|
+
*/
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/eslint
|
|
1
|
+
// src/eslint-config-template.ts
|
|
2
2
|
import js from "@eslint/js";
|
|
3
3
|
import stylistic from "@stylistic/eslint-plugin";
|
|
4
4
|
import esLintConfigLove from "eslint-config-love";
|
|
@@ -24,6 +24,7 @@ var esLintConfigAIDCToolkit = tseslint.config(
|
|
|
24
24
|
},
|
|
25
25
|
rules: {
|
|
26
26
|
"complexity": "off",
|
|
27
|
+
"max-lines": "off",
|
|
27
28
|
"no-dupe-class-members": "off",
|
|
28
29
|
"no-redeclare": "off",
|
|
29
30
|
"no-unused-vars": "off",
|
|
@@ -97,6 +98,7 @@ var esLintConfigAIDCToolkit = tseslint.config(
|
|
|
97
98
|
"test/**/*"
|
|
98
99
|
],
|
|
99
100
|
rules: {
|
|
101
|
+
"max-nested-callbacks": "off",
|
|
100
102
|
"jsdoc/require-jsdoc": "off",
|
|
101
103
|
"@typescript-eslint/dot-notation": "off",
|
|
102
104
|
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
@@ -106,3 +108,19 @@ var esLintConfigAIDCToolkit = tseslint.config(
|
|
|
106
108
|
export {
|
|
107
109
|
esLintConfigAIDCToolkit
|
|
108
110
|
};
|
|
111
|
+
/*!
|
|
112
|
+
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
113
|
+
* contributors
|
|
114
|
+
*
|
|
115
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
116
|
+
* you may not use this file except in compliance with the License.
|
|
117
|
+
* You may obtain a copy of the License at
|
|
118
|
+
*
|
|
119
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
120
|
+
*
|
|
121
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
122
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
123
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
124
|
+
* See the License for the specific language governing permissions and
|
|
125
|
+
* limitations under the License.
|
|
126
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/dev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9-beta",
|
|
4
4
|
"description": "Shared development artefacts for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
"copy-workflows": "copy-files-from-to --config copy-workflows.json",
|
|
23
23
|
"lint": "eslint .",
|
|
24
24
|
"release": "tsx src/release.ts",
|
|
25
|
-
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
26
|
-
"build-doc": "npm run build"
|
|
25
|
+
"build-dist": "tsup src/index.ts --format cjs,esm --dts",
|
|
26
|
+
"build-doc": "npm run build-dist"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"copy-files-from-to": "^3.12.0",
|
|
30
|
-
"eslint": "^9.
|
|
30
|
+
"eslint": "^9.17.0",
|
|
31
31
|
"ts-node": "^10.9.2",
|
|
32
32
|
"tsup": "^8.3.5",
|
|
33
33
|
"tsx": "^4.19.2",
|
|
34
34
|
"typescript": "^5.7.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eslint/js": "^9.
|
|
37
|
+
"@eslint/js": "^9.17.0",
|
|
38
38
|
"@octokit/types": "^13.6.2",
|
|
39
|
-
"@rollup/rollup-linux-x64-gnu": "^4.
|
|
40
|
-
"@stylistic/eslint-plugin": "^2.12.
|
|
41
|
-
"eslint-config-love": "^
|
|
42
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
43
|
-
"octokit": "^4.0.
|
|
44
|
-
"typescript-eslint": "^8.
|
|
39
|
+
"@rollup/rollup-linux-x64-gnu": "^4.29.1",
|
|
40
|
+
"@stylistic/eslint-plugin": "^2.12.1",
|
|
41
|
+
"eslint-config-love": "^114.0.0",
|
|
42
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
43
|
+
"octokit": "^4.0.3",
|
|
44
|
+
"typescript-eslint": "^8.19.0",
|
|
45
45
|
"yaml": "^2.6.1"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -26,6 +26,7 @@ export const esLintConfigAIDCToolkit = tseslint.config(
|
|
|
26
26
|
|
|
27
27
|
rules: {
|
|
28
28
|
"complexity": "off",
|
|
29
|
+
"max-lines": "off",
|
|
29
30
|
"no-dupe-class-members": "off",
|
|
30
31
|
"no-redeclare": "off",
|
|
31
32
|
"no-unused-vars": "off",
|
|
@@ -102,6 +103,7 @@ export const esLintConfigAIDCToolkit = tseslint.config(
|
|
|
102
103
|
"test/**/*"
|
|
103
104
|
],
|
|
104
105
|
rules: {
|
|
106
|
+
"max-nested-callbacks": "off",
|
|
105
107
|
"jsdoc/require-jsdoc": "off",
|
|
106
108
|
"@typescript-eslint/dot-notation": "off",
|
|
107
109
|
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
package/src/index.ts
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
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";
|
package/src/release.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from "child_process";
|
|
2
2
|
import * as fs from "fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
+
import * as util from "node:util";
|
|
4
5
|
import { Octokit } from "octokit";
|
|
5
6
|
import { parse as yamlParse } from "yaml";
|
|
6
7
|
|
|
@@ -16,6 +17,11 @@ interface Configuration {
|
|
|
16
17
|
*/
|
|
17
18
|
organization: string;
|
|
18
19
|
|
|
20
|
+
/**
|
|
21
|
+
* If true, the fact that the repository is uncommitted is ignored. For development and testing purposes only.
|
|
22
|
+
*/
|
|
23
|
+
ignoreUncommitted?: boolean;
|
|
24
|
+
|
|
19
25
|
/**
|
|
20
26
|
* Repositories.
|
|
21
27
|
*/
|
|
@@ -30,11 +36,6 @@ interface Configuration {
|
|
|
30
36
|
*/
|
|
31
37
|
version: string;
|
|
32
38
|
}>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* If true, the fact that the repository is uncommitted is ignored. For development and testing purposes only.
|
|
36
|
-
*/
|
|
37
|
-
ignoreUncommitted?: boolean;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -208,6 +209,7 @@ async function release(): Promise<void> {
|
|
|
208
209
|
});
|
|
209
210
|
|
|
210
211
|
let allSkipped = true;
|
|
212
|
+
let firstRepository = true;
|
|
211
213
|
|
|
212
214
|
for (const name of Object.keys(configuration.repositories)) {
|
|
213
215
|
const repository = configuration.repositories[name];
|
|
@@ -289,8 +291,15 @@ async function release(): Promise<void> {
|
|
|
289
291
|
for (const dependency of linkDependencies) {
|
|
290
292
|
run(false, "npm", "link", dependency);
|
|
291
293
|
}
|
|
292
|
-
} else
|
|
293
|
-
|
|
294
|
+
} else {
|
|
295
|
+
if (!allSkipped) {
|
|
296
|
+
throw new Error(`Repository ${name} is supposed to be skipped but at least one prior repository has been updated`);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// First repository is excluded as it hosts development artefacts only, including the configuration file for this process.
|
|
300
|
+
if (!firstRepository && run(true, "git", "tag", "--points-at", "HEAD", tag).length === 0) {
|
|
301
|
+
throw new Error(`Repository ${name} has at least one commit since version ${repository.version}`);
|
|
302
|
+
}
|
|
294
303
|
}
|
|
295
304
|
break;
|
|
296
305
|
|
|
@@ -321,18 +330,16 @@ async function release(): Promise<void> {
|
|
|
321
330
|
let hasReleaseWorkflow = false;
|
|
322
331
|
|
|
323
332
|
if (fs.existsSync(workflowsPath)) {
|
|
324
|
-
for (const workflowFile of fs.readdirSync(workflowsPath)) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const workflowOn = (yamlParse(fs.readFileSync(path.resolve(workflowsPath, workflowFile)).toString()) as WorkflowConfiguration).on;
|
|
333
|
+
for (const workflowFile of fs.readdirSync(workflowsPath).filter(workflowFile => workflowFile.endsWith(".yml"))) {
|
|
334
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Workflow configuration format is known.
|
|
335
|
+
const workflowOn = (yamlParse(fs.readFileSync(path.resolve(workflowsPath, workflowFile)).toString()) as WorkflowConfiguration).on;
|
|
328
336
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
337
|
+
if (workflowOn.push !== undefined && (workflowOn.push.branches === undefined || workflowOn.push.branches.includes("main"))) {
|
|
338
|
+
hasPushWorkflow = true;
|
|
339
|
+
}
|
|
332
340
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
341
|
+
if (workflowOn.release !== undefined && (workflowOn.release.types === undefined || workflowOn.release.types.includes("published"))) {
|
|
342
|
+
hasReleaseWorkflow = true;
|
|
336
343
|
}
|
|
337
344
|
}
|
|
338
345
|
}
|
|
@@ -348,9 +355,7 @@ async function release(): Promise<void> {
|
|
|
348
355
|
let workflowRunID = -1;
|
|
349
356
|
|
|
350
357
|
do {
|
|
351
|
-
await
|
|
352
|
-
setTimeout(resolve, 2000);
|
|
353
|
-
});
|
|
358
|
+
await util.promisify(setTimeout)(2000);
|
|
354
359
|
|
|
355
360
|
const response = await octokit.rest.actions.listWorkflowRunsForRepo({
|
|
356
361
|
...octokitParameterBase,
|
|
@@ -443,6 +448,8 @@ async function release(): Promise<void> {
|
|
|
443
448
|
}
|
|
444
449
|
|
|
445
450
|
saveState();
|
|
451
|
+
|
|
452
|
+
firstRepository = false;
|
|
446
453
|
}
|
|
447
454
|
|
|
448
455
|
// All repositories released.
|