@aidc-toolkit/dev 0.9.15-beta → 0.9.16-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/config/release.json +10 -7
- package/dist/command-util.js +32 -0
- package/dist/command-util.js.map +1 -0
- package/dist/eslint-config-template.js +99 -0
- package/dist/eslint-config-template.js.map +1 -0
- package/dist/index.js +3 -171
- package/dist/index.js.map +1 -0
- package/dist/publish-dev.js +72 -0
- package/dist/publish-dev.js.map +1 -0
- package/package.json +6 -6
- package/src/release.ts +12 -10
- package/tsconfig-build-dev-local.json +8 -0
- package/tsconfig-build-dev.json +8 -0
- package/tsconfig-build-local.json +11 -0
- package/{tsconfig-declaration.json → tsconfig-build.json} +1 -4
- package/tsconfig.json +5 -9
- package/dist/index.cjs +0 -225
- package/dist/index.d.cts +0 -10
- package/tsconfig-declaration-local.json +0 -14
- package/tsup.config.ts +0 -8
package/config/release.json
CHANGED
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
"organization": "aidc-toolkit",
|
|
3
3
|
"repositories": {
|
|
4
4
|
"dev": {
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.16-beta"
|
|
6
6
|
},
|
|
7
7
|
"core": {
|
|
8
|
-
"version": "0.9.
|
|
8
|
+
"version": "0.9.16-beta"
|
|
9
9
|
},
|
|
10
10
|
"utility": {
|
|
11
|
-
"version": "0.9.
|
|
11
|
+
"version": "0.9.16-beta"
|
|
12
12
|
},
|
|
13
13
|
"gs1": {
|
|
14
|
-
"version": "0.9.
|
|
14
|
+
"version": "0.9.16-beta"
|
|
15
15
|
},
|
|
16
16
|
"demo": {
|
|
17
|
-
"version": "0.9.
|
|
17
|
+
"version": "0.9.16-beta"
|
|
18
18
|
},
|
|
19
19
|
"app-extension": {
|
|
20
|
-
"version": "0.9.
|
|
20
|
+
"version": "0.9.16-beta"
|
|
21
|
+
},
|
|
22
|
+
"app-generator": {
|
|
23
|
+
"version": "0.9.16-beta"
|
|
21
24
|
},
|
|
22
25
|
"aidc-toolkit.github.io": {
|
|
23
26
|
"directory": "doc",
|
|
24
|
-
"version": "0.9.
|
|
27
|
+
"version": "0.9.16-beta"
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
|
+
/**
|
|
3
|
+
* Run a command and optionally capture its output.
|
|
4
|
+
*
|
|
5
|
+
* @param captureOutput
|
|
6
|
+
* If true, output is captured and returned.
|
|
7
|
+
*
|
|
8
|
+
* @param command
|
|
9
|
+
* Command to run.
|
|
10
|
+
*
|
|
11
|
+
* @param args
|
|
12
|
+
* Arguments to command.
|
|
13
|
+
*
|
|
14
|
+
* @returns
|
|
15
|
+
* Output if captured or empty array if not.
|
|
16
|
+
*/
|
|
17
|
+
export function run(captureOutput, command, ...args) {
|
|
18
|
+
const spawnResult = spawnSync(command, args, {
|
|
19
|
+
stdio: ["inherit", captureOutput ? "pipe" : "inherit", "inherit"]
|
|
20
|
+
});
|
|
21
|
+
if (spawnResult.error !== undefined) {
|
|
22
|
+
throw spawnResult.error;
|
|
23
|
+
}
|
|
24
|
+
if (spawnResult.status === null) {
|
|
25
|
+
throw new Error(`Terminated by signal ${spawnResult.signal}`);
|
|
26
|
+
}
|
|
27
|
+
if (spawnResult.status !== 0) {
|
|
28
|
+
throw new Error(`Failed with status ${spawnResult.status}`);
|
|
29
|
+
}
|
|
30
|
+
return captureOutput ? spawnResult.stdout.toString().split("\n").slice(0, -1) : [];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=command-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-util.js","sourceRoot":"","sources":["../src/command-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,GAAG,CAAC,aAAsB,EAAE,OAAe,EAAE,GAAG,IAAc;IAC1E,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE;QACzC,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC;KACpE,CAAC,CAAC;IAEH,IAAI,WAAW,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,WAAW,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,sBAAsB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
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 tseslint from "typescript-eslint";
|
|
6
|
+
export const esLintConfigAIDCToolkit = tseslint.config({
|
|
7
|
+
ignores: ["dist"]
|
|
8
|
+
}, js.configs.recommended, ...tseslint.configs.strictTypeChecked, stylistic.configs.recommended, jsdoc.configs["flat/recommended-typescript"], esLintConfigLove, {
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parserOptions: {
|
|
11
|
+
projectService: true
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
linterOptions: {
|
|
15
|
+
reportUnusedDisableDirectives: "error"
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
"complexity": "off",
|
|
19
|
+
"max-depth": ["error", 10],
|
|
20
|
+
"max-lines": "off",
|
|
21
|
+
"no-dupe-class-members": "off",
|
|
22
|
+
"no-redeclare": "off",
|
|
23
|
+
"no-unused-vars": "off",
|
|
24
|
+
"@typescript-eslint/class-literal-property-style": "off",
|
|
25
|
+
"@typescript-eslint/class-methods-use-this": "off",
|
|
26
|
+
"@typescript-eslint/init-declarations": "off",
|
|
27
|
+
"@typescript-eslint/max-params": "off",
|
|
28
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
29
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
30
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
31
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
32
|
+
"@typescript-eslint/no-unused-vars": [
|
|
33
|
+
"error",
|
|
34
|
+
{
|
|
35
|
+
argsIgnorePattern: "^_",
|
|
36
|
+
varsIgnorePattern: "^_",
|
|
37
|
+
caughtErrorsIgnorePattern: "^_"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"@typescript-eslint/prefer-destructuring": "off",
|
|
41
|
+
"@typescript-eslint/unbound-method": ["error", {
|
|
42
|
+
ignoreStatic: true
|
|
43
|
+
}],
|
|
44
|
+
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
45
|
+
"@stylistic/brace-style": ["error", "1tbs", {
|
|
46
|
+
allowSingleLine: false
|
|
47
|
+
}],
|
|
48
|
+
"@stylistic/comma-dangle": ["error", "never"],
|
|
49
|
+
"@stylistic/indent": ["error", 4],
|
|
50
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
51
|
+
multiline: {
|
|
52
|
+
delimiter: "semi",
|
|
53
|
+
requireLast: true
|
|
54
|
+
},
|
|
55
|
+
singleline: {
|
|
56
|
+
delimiter: "semi"
|
|
57
|
+
}
|
|
58
|
+
}],
|
|
59
|
+
"@stylistic/no-trailing-spaces": ["off"],
|
|
60
|
+
"@stylistic/operator-linebreak": ["error", "after"],
|
|
61
|
+
"@stylistic/quotes": ["error", "double"],
|
|
62
|
+
"@stylistic/semi": ["error", "always"],
|
|
63
|
+
"@stylistic/object-curly-newline": ["error", {
|
|
64
|
+
ObjectExpression: {
|
|
65
|
+
multiline: true,
|
|
66
|
+
minProperties: 1
|
|
67
|
+
},
|
|
68
|
+
ObjectPattern: {
|
|
69
|
+
multiline: true,
|
|
70
|
+
minProperties: 1
|
|
71
|
+
}
|
|
72
|
+
}],
|
|
73
|
+
"@stylistic/object-property-newline": "error",
|
|
74
|
+
"jsdoc/require-description": ["warn", {
|
|
75
|
+
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
76
|
+
}],
|
|
77
|
+
"jsdoc/require-jsdoc": ["warn", {
|
|
78
|
+
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
79
|
+
}],
|
|
80
|
+
"jsdoc/require-returns": ["warn", {
|
|
81
|
+
checkGetters: false
|
|
82
|
+
}],
|
|
83
|
+
"jsdoc/tag-lines": ["warn", "any", {
|
|
84
|
+
count: 1,
|
|
85
|
+
startLines: 1
|
|
86
|
+
}]
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
files: [
|
|
90
|
+
"test/**/*"
|
|
91
|
+
],
|
|
92
|
+
rules: {
|
|
93
|
+
"max-nested-callbacks": "off",
|
|
94
|
+
"jsdoc/require-jsdoc": "off",
|
|
95
|
+
"@typescript-eslint/dot-notation": "off",
|
|
96
|
+
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//# 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,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAClD;IACI,OAAO,EAAE,CAAC,MAAM,CAAC;CACpB,EACD,EAAE,CAAC,OAAO,CAAC,WAAW,EACtB,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EACrC,SAAS,CAAC,OAAO,CAAC,WAAW,EAC7B,KAAK,CAAC,OAAO,CAAC,6BAA6B,CAAC,EAC5C,gBAAgB,EAChB;IACI,eAAe,EAAE;QACb,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ;IAED,aAAa,EAAE;QACX,6BAA6B,EAAE,OAAO;KACzC;IAED,KAAK,EAAE;QACH,YAAY,EAAE,KAAK;QACnB,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1B,WAAW,EAAE,KAAK;QAClB,uBAAuB,EAAE,KAAK;QAC9B,cAAc,EAAE,KAAK;QACrB,gBAAgB,EAAE,KAAK;QAEvB,iDAAiD,EAAE,KAAK;QACxD,2CAA2C,EAAE,KAAK;QAClD,sCAAsC,EAAE,KAAK;QAC7C,+BAA+B,EAAE,KAAK;QACtC,sCAAsC,EAAE,KAAK;QAC7C,yCAAyC,EAAE,KAAK;QAChD,qCAAqC,EAAE,KAAK;QAC5C,mDAAmD,EAAE,KAAK;QAC1D,mCAAmC,EAAE;YACjC,OAAO;YACP;gBACI,iBAAiB,EAAE,I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,EAAE;gBAC5B,QAAQ,EAAE,CAAC,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,wBAAwB,CAAC;aAC7L,CAAC;QACF,uBAAuB,EAAE,CAAC,MAAM,EAAE;gBAC9B,YAAY,EAAE,KAAK;aACtB,CAAC;QACF,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE;gBAC/B,KAAK,EAAE,CAAC;gBACR,UAAU,EAAE,CAAC;aAChB,CAAC;KACL;CACJ,EACD;IACI,KAAK,EAAE;QACH,WAAW;KACd;IACD,KAAK,EAAE;QACH,sBAAsB,EAAE,KAAK;QAC7B,qBAAqB,EAAE,KAAK;QAC5B,iCAAiC,EAAE,KAAK;QACxC,6CAA6C,EAAE,KAAK;KACvD;CACJ,CACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,174 +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 tseslint from "typescript-eslint";
|
|
7
|
-
var esLintConfigAIDCToolkit = tseslint.config(
|
|
8
|
-
{
|
|
9
|
-
ignores: ["dist"]
|
|
10
|
-
},
|
|
11
|
-
js.configs.recommended,
|
|
12
|
-
...tseslint.configs.strictTypeChecked,
|
|
13
|
-
stylistic.configs.recommended,
|
|
14
|
-
jsdoc.configs["flat/recommended-typescript"],
|
|
15
|
-
esLintConfigLove,
|
|
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-dupe-class-members": "off",
|
|
30
|
-
"no-redeclare": "off",
|
|
31
|
-
"no-unused-vars": "off",
|
|
32
|
-
"@typescript-eslint/class-literal-property-style": "off",
|
|
33
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
34
|
-
"@typescript-eslint/init-declarations": "off",
|
|
35
|
-
"@typescript-eslint/max-params": "off",
|
|
36
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
37
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
|
38
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
39
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
40
|
-
"@typescript-eslint/no-unused-vars": [
|
|
41
|
-
"error",
|
|
42
|
-
{
|
|
43
|
-
argsIgnorePattern: "^_",
|
|
44
|
-
varsIgnorePattern: "^_",
|
|
45
|
-
caughtErrorsIgnorePattern: "^_"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"@typescript-eslint/prefer-destructuring": "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/indent": ["error", 4],
|
|
58
|
-
"@stylistic/member-delimiter-style": ["error", {
|
|
59
|
-
multiline: {
|
|
60
|
-
delimiter: "semi",
|
|
61
|
-
requireLast: true
|
|
62
|
-
},
|
|
63
|
-
singleline: {
|
|
64
|
-
delimiter: "semi"
|
|
65
|
-
}
|
|
66
|
-
}],
|
|
67
|
-
"@stylistic/no-trailing-spaces": ["off"],
|
|
68
|
-
"@stylistic/operator-linebreak": ["error", "after"],
|
|
69
|
-
"@stylistic/quotes": ["error", "double"],
|
|
70
|
-
"@stylistic/semi": ["error", "always"],
|
|
71
|
-
"@stylistic/object-curly-newline": ["error", {
|
|
72
|
-
ObjectExpression: {
|
|
73
|
-
multiline: true,
|
|
74
|
-
minProperties: 1
|
|
75
|
-
},
|
|
76
|
-
ObjectPattern: {
|
|
77
|
-
multiline: true,
|
|
78
|
-
minProperties: 1
|
|
79
|
-
}
|
|
80
|
-
}],
|
|
81
|
-
"@stylistic/object-property-newline": "error",
|
|
82
|
-
"jsdoc/require-description": ["warn", {
|
|
83
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
84
|
-
}],
|
|
85
|
-
"jsdoc/require-jsdoc": ["warn", {
|
|
86
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
87
|
-
}],
|
|
88
|
-
"jsdoc/require-returns": ["warn", {
|
|
89
|
-
checkGetters: false
|
|
90
|
-
}],
|
|
91
|
-
"jsdoc/tag-lines": ["warn", "any", {
|
|
92
|
-
count: 1,
|
|
93
|
-
startLines: 1
|
|
94
|
-
}]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
files: [
|
|
99
|
-
"test/**/*"
|
|
100
|
-
],
|
|
101
|
-
rules: {
|
|
102
|
-
"max-nested-callbacks": "off",
|
|
103
|
-
"jsdoc/require-jsdoc": "off",
|
|
104
|
-
"@typescript-eslint/dot-notation": "off",
|
|
105
|
-
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
// src/publish-dev.ts
|
|
111
|
-
import * as fs from "fs";
|
|
112
|
-
|
|
113
|
-
// src/command-util.ts
|
|
114
|
-
import { spawnSync } from "child_process";
|
|
115
|
-
function run(captureOutput, command, ...args) {
|
|
116
|
-
const spawnResult = spawnSync(command, args, {
|
|
117
|
-
stdio: ["inherit", captureOutput ? "pipe" : "inherit", "inherit"]
|
|
118
|
-
});
|
|
119
|
-
if (spawnResult.error !== void 0) {
|
|
120
|
-
throw spawnResult.error;
|
|
121
|
-
}
|
|
122
|
-
if (spawnResult.status === null) {
|
|
123
|
-
throw new Error(`Terminated by signal ${spawnResult.signal}`);
|
|
124
|
-
}
|
|
125
|
-
if (spawnResult.status !== 0) {
|
|
126
|
-
throw new Error(`Failed with status ${spawnResult.status}`);
|
|
127
|
-
}
|
|
128
|
-
return captureOutput ? spawnResult.stdout.toString().split("\n").slice(0, -1) : [];
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/publish-dev.ts
|
|
132
|
-
function zeroPadded(n, length) {
|
|
133
|
-
return `${"0".repeat(length - 1)}${n}`.slice(-length);
|
|
134
|
-
}
|
|
135
|
-
function fixAlphaDependencies(atOrganization, dependencies) {
|
|
136
|
-
if (dependencies !== void 0) {
|
|
137
|
-
for (const dependency in dependencies) {
|
|
138
|
-
if (dependency.split("/")[0] === atOrganization) {
|
|
139
|
-
dependencies[dependency] = "alpha";
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function publishDev() {
|
|
145
|
-
run(false, "npm", "update", "--save");
|
|
146
|
-
const now = /* @__PURE__ */ new Date();
|
|
147
|
-
const packageConfigurationPath = "package.json";
|
|
148
|
-
const backupPackageConfigurationPath = "_package.json";
|
|
149
|
-
const packageConfiguration = JSON.parse(fs.readFileSync(packageConfigurationPath).toString());
|
|
150
|
-
const atOrganization = packageConfiguration.name.split("/")[0];
|
|
151
|
-
fixAlphaDependencies(atOrganization, packageConfiguration.devDependencies);
|
|
152
|
-
fixAlphaDependencies(atOrganization, packageConfiguration.dependencies);
|
|
153
|
-
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}
|
|
154
|
-
`);
|
|
155
|
-
fs.renameSync(packageConfigurationPath, backupPackageConfigurationPath);
|
|
156
|
-
try {
|
|
157
|
-
const [majorVersion, minorVersion, patchVersion] = packageConfiguration.version.split("-")[0].split(".").map((versionString) => Number(versionString));
|
|
158
|
-
packageConfiguration.version = `${majorVersion}.${minorVersion}.${patchVersion + 1}-alpha.${now.getFullYear()}${zeroPadded(now.getMonth() + 1, 2)}${zeroPadded(now.getDate(), 2)}${zeroPadded(now.getHours(), 2)}${zeroPadded(now.getMinutes(), 2)}`;
|
|
159
|
-
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}
|
|
160
|
-
`);
|
|
161
|
-
run(false, "npm", "run", "build:dev");
|
|
162
|
-
run(false, "npm", "publish", "--tag", "alpha");
|
|
163
|
-
} finally {
|
|
164
|
-
fs.rmSync(packageConfigurationPath);
|
|
165
|
-
fs.renameSync(backupPackageConfigurationPath, packageConfigurationPath);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
export {
|
|
169
|
-
esLintConfigAIDCToolkit,
|
|
170
|
-
publishDev
|
|
171
|
-
};
|
|
172
1
|
/*!
|
|
173
2
|
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
174
3
|
* contributors
|
|
@@ -185,3 +14,6 @@ export {
|
|
|
185
14
|
* See the License for the specific language governing permissions and
|
|
186
15
|
* limitations under the License.
|
|
187
16
|
*/
|
|
17
|
+
export * from "./eslint-config-template.js";
|
|
18
|
+
export * from "./publish-dev.js";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import { run } from "./command-util.js";
|
|
3
|
+
/**
|
|
4
|
+
* Convert a number to a zero-padded string.
|
|
5
|
+
*
|
|
6
|
+
* @param n
|
|
7
|
+
* Number.
|
|
8
|
+
*
|
|
9
|
+
* @param length
|
|
10
|
+
* Length of required string.
|
|
11
|
+
*
|
|
12
|
+
* @returns
|
|
13
|
+
* Zero-padded string.
|
|
14
|
+
*/
|
|
15
|
+
function zeroPadded(n, length) {
|
|
16
|
+
return `${"0".repeat(length - 1)}${n}`.slice(-length);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fix alpha dependencies from the organization.
|
|
20
|
+
*
|
|
21
|
+
* @param atOrganization
|
|
22
|
+
* '@' symbol and organization.
|
|
23
|
+
* @param dependencies
|
|
24
|
+
* Dependencies.
|
|
25
|
+
*/
|
|
26
|
+
function fixAlphaDependencies(atOrganization, dependencies) {
|
|
27
|
+
if (dependencies !== undefined) {
|
|
28
|
+
for (const dependency in dependencies) {
|
|
29
|
+
if (dependency.split("/")[0] === atOrganization) {
|
|
30
|
+
// npm update --save updates this with the latest.
|
|
31
|
+
dependencies[dependency] = "alpha";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Publish to development npm registry.
|
|
38
|
+
*/
|
|
39
|
+
export function publishDev() {
|
|
40
|
+
// Ensure that packages are up to date.
|
|
41
|
+
run(false, "npm", "update", "--save");
|
|
42
|
+
const now = new Date();
|
|
43
|
+
const packageConfigurationPath = "package.json";
|
|
44
|
+
const backupPackageConfigurationPath = "_package.json";
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Package configuration format is known.
|
|
46
|
+
const packageConfiguration = JSON.parse(fs.readFileSync(packageConfigurationPath).toString());
|
|
47
|
+
const atOrganization = packageConfiguration.name.split("/")[0];
|
|
48
|
+
fixAlphaDependencies(atOrganization, packageConfiguration.devDependencies);
|
|
49
|
+
fixAlphaDependencies(atOrganization, packageConfiguration.dependencies);
|
|
50
|
+
// Save the package configuration.
|
|
51
|
+
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}\n`);
|
|
52
|
+
// Backup the package configuration file.
|
|
53
|
+
fs.renameSync(packageConfigurationPath, backupPackageConfigurationPath);
|
|
54
|
+
try {
|
|
55
|
+
// Strip pre-release identifier if any and parse semantic version into its components.
|
|
56
|
+
const [majorVersion, minorVersion, patchVersion] = packageConfiguration.version.split("-")[0].split(".").map(versionString => Number(versionString));
|
|
57
|
+
// Set version to alpha version with incremental patch version number.
|
|
58
|
+
packageConfiguration.version = `${majorVersion}.${minorVersion}.${patchVersion + 1}-alpha.${now.getFullYear()}${zeroPadded(now.getMonth() + 1, 2)}${zeroPadded(now.getDate(), 2)}${zeroPadded(now.getHours(), 2)}${zeroPadded(now.getMinutes(), 2)}`;
|
|
59
|
+
// Save the package configuration.
|
|
60
|
+
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}\n`);
|
|
61
|
+
// Run the development build.
|
|
62
|
+
run(false, "npm", "run", "build:dev");
|
|
63
|
+
// Publish to the registry.
|
|
64
|
+
run(false, "npm", "publish", "--tag", "alpha");
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
// Restore the package configuration file.
|
|
68
|
+
fs.rmSync(packageConfigurationPath);
|
|
69
|
+
fs.renameSync(backupPackageConfigurationPath, packageConfigurationPath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=publish-dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-dev.js","sourceRoot":"","sources":["../src/publish-dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAA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AC,MAAM,CAAC,wBAAwB,CAAC,CAAC;QACpC,EAAE,CAAC,UAAU,CAAC,8BAA8B,EAAE,wBAAwB,CAAC,CAAC;IAC5E,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/dev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.16-beta",
|
|
4
4
|
"description": "Shared development artefacts for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"copy-workflows": "copy-files-from-to --config copy-workflows.json",
|
|
23
23
|
"lint": "eslint",
|
|
24
|
-
"build:core": "
|
|
25
|
-
"build:dev": "npm run build:core
|
|
26
|
-
"build:release": "npm run build:core --
|
|
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
27
|
"build:doc": "npm run build:dev",
|
|
28
28
|
"publish-dev": "bin/publish-dev-local",
|
|
29
29
|
"release": "tsx src/release.ts"
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@eslint/js": "^9.20.0",
|
|
39
39
|
"@octokit/types": "^13.8.0",
|
|
40
|
-
"@stylistic/eslint-plugin": "^4.0
|
|
40
|
+
"@stylistic/eslint-plugin": "^4.1.0",
|
|
41
41
|
"eslint": "^9.21.0",
|
|
42
42
|
"eslint-config-love": "^118.0.0",
|
|
43
43
|
"eslint-plugin-jsdoc": "^50.6.3",
|
|
44
44
|
"jiti": "^2.4.2",
|
|
45
45
|
"octokit": "^4.1.2",
|
|
46
|
+
"rimraf": "^6.0.1",
|
|
46
47
|
"ts-node": "^10.9.2",
|
|
47
|
-
"tsup": "^8.3.6",
|
|
48
48
|
"tsx": "^4.19.3",
|
|
49
49
|
"typescript": "^5.7.3",
|
|
50
50
|
"typescript-eslint": "^8.25.0",
|
package/src/release.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as util from "node:util";
|
|
|
6
6
|
import { Octokit } from "octokit";
|
|
7
7
|
import { parse as yamlParse } from "yaml";
|
|
8
8
|
|
|
9
|
-
import configurationJSON from "../config/release.json"
|
|
10
|
-
import secureConfigurationJSON from "../config/release.secure.json"
|
|
9
|
+
import configurationJSON from "../config/release.json";
|
|
10
|
+
import secureConfigurationJSON from "../config/release.secure.json";
|
|
11
11
|
import { run } from "./command-util.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -113,7 +113,7 @@ interface WorkflowConfiguration {
|
|
|
113
113
|
/**
|
|
114
114
|
* Supported states.
|
|
115
115
|
*/
|
|
116
|
-
type State = "skipped" | "install" | "build" | "commit" | "tag" | "push" | "workflow (push)" | "release" | "workflow (release)" | "complete";
|
|
116
|
+
type State = "skipped" | "install" | "build" | "commit" | "tag" | "push" | "workflow (push)" | "release" | "workflow (release)" | "restore alpha" | "complete";
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Release.
|
|
@@ -400,14 +400,16 @@ async function release(): Promise<void> {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
await step(name, "restore alpha", () => {
|
|
404
|
+
// Restore dependencies to "alpha" version for development.
|
|
405
|
+
const devDependenciesUpdated = updateDependencies(packageConfiguration.devDependencies, true);
|
|
406
|
+
const dependenciesUpdated = updateDependencies(packageConfiguration.dependencies, true);
|
|
406
407
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
if (devDependenciesUpdated || dependenciesUpdated) {
|
|
409
|
+
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}\n`);
|
|
410
|
+
run(false, "git", "commit", "--all", "--message=Restored alpha version.");
|
|
411
|
+
}
|
|
412
|
+
});
|
|
411
413
|
|
|
412
414
|
state[name] = "complete";
|
|
413
415
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
// https://aka.ms/tsconfig
|
|
2
1
|
{
|
|
3
2
|
"compilerOptions": {
|
|
4
|
-
// Type checking.
|
|
5
3
|
"strict": true,
|
|
6
4
|
"exactOptionalPropertyTypes": true,
|
|
7
5
|
"noFallthroughCasesInSwitch": true,
|
|
8
6
|
"noImplicitOverride": true,
|
|
9
7
|
"noPropertyAccessFromIndexSignature": true,
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
"
|
|
9
|
+
"module": "ES2022",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
13
11
|
"resolveJsonModule": true,
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
"declaration": true,
|
|
14
|
+
|
|
16
15
|
"esModuleInterop": true,
|
|
17
16
|
"forceConsistentCasingInFileNames": true,
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
"target": "ESNext",
|
|
21
|
-
"useDefineForClassFields": true,
|
|
18
|
+
"target": "ES2022",
|
|
22
19
|
|
|
23
|
-
// Completeness.
|
|
24
20
|
"skipLibCheck": true
|
|
25
21
|
}
|
|
26
22
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1,225 +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
|
-
publishDev: () => publishDev
|
|
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_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
44
|
-
var esLintConfigAIDCToolkit = import_typescript_eslint.default.config(
|
|
45
|
-
{
|
|
46
|
-
ignores: ["dist"]
|
|
47
|
-
},
|
|
48
|
-
import_js.default.configs.recommended,
|
|
49
|
-
...import_typescript_eslint.default.configs.strictTypeChecked,
|
|
50
|
-
import_eslint_plugin.default.configs.recommended,
|
|
51
|
-
import_eslint_plugin_jsdoc.default.configs["flat/recommended-typescript"],
|
|
52
|
-
import_eslint_config_love.default,
|
|
53
|
-
{
|
|
54
|
-
languageOptions: {
|
|
55
|
-
parserOptions: {
|
|
56
|
-
projectService: true
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
linterOptions: {
|
|
60
|
-
reportUnusedDisableDirectives: "error"
|
|
61
|
-
},
|
|
62
|
-
rules: {
|
|
63
|
-
"complexity": "off",
|
|
64
|
-
"max-depth": ["error", 10],
|
|
65
|
-
"max-lines": "off",
|
|
66
|
-
"no-dupe-class-members": "off",
|
|
67
|
-
"no-redeclare": "off",
|
|
68
|
-
"no-unused-vars": "off",
|
|
69
|
-
"@typescript-eslint/class-literal-property-style": "off",
|
|
70
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
71
|
-
"@typescript-eslint/init-declarations": "off",
|
|
72
|
-
"@typescript-eslint/max-params": "off",
|
|
73
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
74
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
|
75
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
76
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "off",
|
|
77
|
-
"@typescript-eslint/no-unused-vars": [
|
|
78
|
-
"error",
|
|
79
|
-
{
|
|
80
|
-
argsIgnorePattern: "^_",
|
|
81
|
-
varsIgnorePattern: "^_",
|
|
82
|
-
caughtErrorsIgnorePattern: "^_"
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
"@typescript-eslint/prefer-destructuring": "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/indent": ["error", 4],
|
|
95
|
-
"@stylistic/member-delimiter-style": ["error", {
|
|
96
|
-
multiline: {
|
|
97
|
-
delimiter: "semi",
|
|
98
|
-
requireLast: true
|
|
99
|
-
},
|
|
100
|
-
singleline: {
|
|
101
|
-
delimiter: "semi"
|
|
102
|
-
}
|
|
103
|
-
}],
|
|
104
|
-
"@stylistic/no-trailing-spaces": ["off"],
|
|
105
|
-
"@stylistic/operator-linebreak": ["error", "after"],
|
|
106
|
-
"@stylistic/quotes": ["error", "double"],
|
|
107
|
-
"@stylistic/semi": ["error", "always"],
|
|
108
|
-
"@stylistic/object-curly-newline": ["error", {
|
|
109
|
-
ObjectExpression: {
|
|
110
|
-
multiline: true,
|
|
111
|
-
minProperties: 1
|
|
112
|
-
},
|
|
113
|
-
ObjectPattern: {
|
|
114
|
-
multiline: true,
|
|
115
|
-
minProperties: 1
|
|
116
|
-
}
|
|
117
|
-
}],
|
|
118
|
-
"@stylistic/object-property-newline": "error",
|
|
119
|
-
"jsdoc/require-description": ["warn", {
|
|
120
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
121
|
-
}],
|
|
122
|
-
"jsdoc/require-jsdoc": ["warn", {
|
|
123
|
-
contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
|
|
124
|
-
}],
|
|
125
|
-
"jsdoc/require-returns": ["warn", {
|
|
126
|
-
checkGetters: false
|
|
127
|
-
}],
|
|
128
|
-
"jsdoc/tag-lines": ["warn", "any", {
|
|
129
|
-
count: 1,
|
|
130
|
-
startLines: 1
|
|
131
|
-
}]
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
files: [
|
|
136
|
-
"test/**/*"
|
|
137
|
-
],
|
|
138
|
-
rules: {
|
|
139
|
-
"max-nested-callbacks": "off",
|
|
140
|
-
"jsdoc/require-jsdoc": "off",
|
|
141
|
-
"@typescript-eslint/dot-notation": "off",
|
|
142
|
-
"@typescript-eslint/no-unsafe-type-assertion": "off"
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
// src/publish-dev.ts
|
|
148
|
-
var fs = __toESM(require("fs"), 1);
|
|
149
|
-
|
|
150
|
-
// src/command-util.ts
|
|
151
|
-
var import_child_process = require("child_process");
|
|
152
|
-
function run(captureOutput, command, ...args) {
|
|
153
|
-
const spawnResult = (0, import_child_process.spawnSync)(command, args, {
|
|
154
|
-
stdio: ["inherit", captureOutput ? "pipe" : "inherit", "inherit"]
|
|
155
|
-
});
|
|
156
|
-
if (spawnResult.error !== void 0) {
|
|
157
|
-
throw spawnResult.error;
|
|
158
|
-
}
|
|
159
|
-
if (spawnResult.status === null) {
|
|
160
|
-
throw new Error(`Terminated by signal ${spawnResult.signal}`);
|
|
161
|
-
}
|
|
162
|
-
if (spawnResult.status !== 0) {
|
|
163
|
-
throw new Error(`Failed with status ${spawnResult.status}`);
|
|
164
|
-
}
|
|
165
|
-
return captureOutput ? spawnResult.stdout.toString().split("\n").slice(0, -1) : [];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// src/publish-dev.ts
|
|
169
|
-
function zeroPadded(n, length) {
|
|
170
|
-
return `${"0".repeat(length - 1)}${n}`.slice(-length);
|
|
171
|
-
}
|
|
172
|
-
function fixAlphaDependencies(atOrganization, dependencies) {
|
|
173
|
-
if (dependencies !== void 0) {
|
|
174
|
-
for (const dependency in dependencies) {
|
|
175
|
-
if (dependency.split("/")[0] === atOrganization) {
|
|
176
|
-
dependencies[dependency] = "alpha";
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function publishDev() {
|
|
182
|
-
run(false, "npm", "update", "--save");
|
|
183
|
-
const now = /* @__PURE__ */ new Date();
|
|
184
|
-
const packageConfigurationPath = "package.json";
|
|
185
|
-
const backupPackageConfigurationPath = "_package.json";
|
|
186
|
-
const packageConfiguration = JSON.parse(fs.readFileSync(packageConfigurationPath).toString());
|
|
187
|
-
const atOrganization = packageConfiguration.name.split("/")[0];
|
|
188
|
-
fixAlphaDependencies(atOrganization, packageConfiguration.devDependencies);
|
|
189
|
-
fixAlphaDependencies(atOrganization, packageConfiguration.dependencies);
|
|
190
|
-
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}
|
|
191
|
-
`);
|
|
192
|
-
fs.renameSync(packageConfigurationPath, backupPackageConfigurationPath);
|
|
193
|
-
try {
|
|
194
|
-
const [majorVersion, minorVersion, patchVersion] = packageConfiguration.version.split("-")[0].split(".").map((versionString) => Number(versionString));
|
|
195
|
-
packageConfiguration.version = `${majorVersion}.${minorVersion}.${patchVersion + 1}-alpha.${now.getFullYear()}${zeroPadded(now.getMonth() + 1, 2)}${zeroPadded(now.getDate(), 2)}${zeroPadded(now.getHours(), 2)}${zeroPadded(now.getMinutes(), 2)}`;
|
|
196
|
-
fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}
|
|
197
|
-
`);
|
|
198
|
-
run(false, "npm", "run", "build:dev");
|
|
199
|
-
run(false, "npm", "publish", "--tag", "alpha");
|
|
200
|
-
} finally {
|
|
201
|
-
fs.rmSync(packageConfigurationPath);
|
|
202
|
-
fs.renameSync(backupPackageConfigurationPath, packageConfigurationPath);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
206
|
-
0 && (module.exports = {
|
|
207
|
-
esLintConfigAIDCToolkit,
|
|
208
|
-
publishDev
|
|
209
|
-
});
|
|
210
|
-
/*!
|
|
211
|
-
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
212
|
-
* contributors
|
|
213
|
-
*
|
|
214
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
215
|
-
* you may not use this file except in compliance with the License.
|
|
216
|
-
* You may obtain a copy of the License at
|
|
217
|
-
*
|
|
218
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
-
*
|
|
220
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
-
* See the License for the specific language governing permissions and
|
|
224
|
-
* limitations under the License.
|
|
225
|
-
*/
|
package/dist/index.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
-
|
|
3
|
-
declare const esLintConfigAIDCToolkit: _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Publish to development npm registry.
|
|
7
|
-
*/
|
|
8
|
-
declare function publishDev(): void;
|
|
9
|
-
|
|
10
|
-
export { esLintConfigAIDCToolkit, publishDev };
|