@halospv3/hce.shared-config 2.6.5 → 3.0.0-develop.2
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/CHANGELOG.md +340 -101
- package/README.md +100 -87
- package/dotnet/.github/workflows/_unit_test.yml +6 -3
- package/dotnet/.github/workflows/ci.yml +2 -2
- package/dotnet/.github/workflows/dotnet-release.yml +31 -28
- package/dotnet/.github/workflows/sample-dotnet-build.yml +16 -11
- package/dotnet/ExecNupkgDeterministicator.README.md +20 -0
- package/dotnet/ExecNupkgDeterministicator.targets +173 -0
- package/dotnet/GitVersion.yml +3 -1
- package/dotnet/GitVersion6.0.yml +3 -1
- package/dotnet/HCE.Shared.sln +34 -0
- package/dotnet/HCE.Shared.targets +1 -0
- package/dotnet/PublishAll.targets +2 -0
- package/dotnet/SignAfterPack.targets +104 -0
- package/dotnet/samples/HCE.Shared.DeterministicNupkg/Dummy.cs +6 -0
- package/dotnet/samples/HCE.Shared.DeterministicNupkg/HCE.Shared.DeterministicNupkg.csproj +21 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/Class1.cs +6 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/HCE.Shared.SignAfterPack.csproj +21 -0
- package/dotnet/samples/HCE.Shared.SignAfterPack/sampleCert.samplepfx +0 -0
- package/dotnet/samples/README.md +7 -0
- package/package.json +72 -73
- package/src/CaseInsensitiveMap.ts +34 -0
- package/src/commitlintConfig.ts +17 -9
- package/src/debug.ts +3 -3
- package/src/dotnet/GithubNugetRegistryInfo.ts +60 -0
- package/src/dotnet/GitlabNugetRegistryInfo.ts +112 -0
- package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
- package/src/dotnet/MSBuildProject.ts +557 -76
- package/src/dotnet/MSBuildProjectProperties.ts +280 -15
- package/src/dotnet/NugetProjectProperties.ts +608 -0
- package/src/dotnet/NugetRegistryInfo.ts +939 -0
- package/src/dotnet/helpers.ts +448 -0
- package/src/eslintConfig.ts +174 -71
- package/src/index.ts +1 -3
- package/src/semantic-release__commit-analyzer.d.ts +44 -38
- package/src/semantic-release__exec.d.ts +15 -0
- package/src/semantic-release__git.d.ts +85 -88
- package/src/semantic-release__github.d.ts +139 -139
- package/src/semanticReleaseConfig.ts +106 -47
- package/src/semanticReleaseConfigDotnet.ts +394 -104
- package/src/setupGitPluginSpec.ts +149 -57
- package/src/tsconfig.json +8 -8
- package/src/utils/Exact.ts +49 -0
- package/src/utils/GracefulRecursion.d.ts +12 -0
- package/src/utils/env.ts +44 -0
- package/src/utils/execAsync.ts +77 -0
- package/src/utils/miscTypes.ts +17 -0
- package/src/utils/reflection/FunctionLike.d.ts +17 -0
- package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
- package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
- package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
- package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
- package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
- package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
- package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
- package/src/utils/reflection/filterForGetters.ts +59 -0
- package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
- package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
- package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
- package/src/utils/reflection/getPrototypeOf.ts +12 -0
- package/src/utils/reflection/inheritance.ts +262 -0
- package/src/utils/reflection/isConstructor.ts +74 -0
- package/src/utils/reflection/isGetterDescriptor.ts +11 -0
- package/src/utils/reflection/listOwnGetters.ts +80 -0
- package/src/utils/reflection.ts +18 -0
- package/cjs/commitlintConfig-wrapper.mjs +0 -6
- package/cjs/commitlintConfig.cjs +0 -14
- package/cjs/commitlintConfig.cjs.map +0 -1
- package/cjs/commitlintConfig.d.ts +0 -4
- package/cjs/commitlintConfig.d.ts.map +0 -1
- package/cjs/debug.cjs +0 -13
- package/cjs/debug.cjs.map +0 -1
- package/cjs/debug.d.ts +0 -4
- package/cjs/debug.d.ts.map +0 -1
- package/cjs/dotnet/MSBuildProject.cjs +0 -84
- package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
- package/cjs/dotnet/MSBuildProject.d.ts +0 -42
- package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
- package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
- package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
- package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
- package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
- package/cjs/dotnet/createDummyNupkg.cjs +0 -26
- package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
- package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
- package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
- package/cjs/dotnet/dotnetGHPR.cjs +0 -173
- package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
- package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
- package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
- package/cjs/dotnet/dotnetGLPR.cjs +0 -41
- package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
- package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
- package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
- package/cjs/dotnet/dotnetHelpers.cjs +0 -141
- package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
- package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
- package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
- package/cjs/dotnet-wrapper.mjs +0 -6
- package/cjs/dotnet.cjs +0 -15
- package/cjs/dotnet.cjs.map +0 -1
- package/cjs/dotnet.d.ts +0 -7
- package/cjs/dotnet.d.ts.map +0 -1
- package/cjs/envUtils-wrapper.mjs +0 -6
- package/cjs/envUtils.cjs +0 -37
- package/cjs/envUtils.cjs.map +0 -1
- package/cjs/envUtils.d.ts +0 -15
- package/cjs/envUtils.d.ts.map +0 -1
- package/cjs/eslintConfig-wrapper.mjs +0 -6
- package/cjs/eslintConfig.cjs +0 -52
- package/cjs/eslintConfig.cjs.map +0 -1
- package/cjs/eslintConfig.d.ts +0 -3
- package/cjs/eslintConfig.d.ts.map +0 -1
- package/cjs/findStaticConfig-wrapper.mjs +0 -6
- package/cjs/findStaticConfig.cjs +0 -34
- package/cjs/findStaticConfig.cjs.map +0 -1
- package/cjs/findStaticConfig.d.ts +0 -2
- package/cjs/findStaticConfig.d.ts.map +0 -1
- package/cjs/index-wrapper.mjs +0 -6
- package/cjs/index.cjs +0 -10
- package/cjs/index.cjs.map +0 -1
- package/cjs/index.d.ts +0 -5
- package/cjs/index.d.ts.map +0 -1
- package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
- package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
- package/cjs/semantic-release__git.d.cjs +0 -2
- package/cjs/semantic-release__git.d.cjs.map +0 -1
- package/cjs/semantic-release__github.d.cjs +0 -2
- package/cjs/semantic-release__github.d.cjs.map +0 -1
- package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
- package/cjs/semanticReleaseConfig.cjs +0 -33
- package/cjs/semanticReleaseConfig.cjs.map +0 -1
- package/cjs/semanticReleaseConfig.d.ts +0 -4
- package/cjs/semanticReleaseConfig.d.ts.map +0 -1
- package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
- package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
- package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
- package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
- package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
- package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
- package/cjs/setupGitPluginSpec.cjs +0 -67
- package/cjs/setupGitPluginSpec.cjs.map +0 -1
- package/cjs/setupGitPluginSpec.d.ts +0 -19
- package/cjs/setupGitPluginSpec.d.ts.map +0 -1
- package/src/dotnet/createDummyNupkg.ts +0 -30
- package/src/dotnet/dotnetGHPR.ts +0 -232
- package/src/dotnet/dotnetGLPR.ts +0 -46
- package/src/dotnet/dotnetHelpers.ts +0 -184
- package/src/dotnet.ts +0 -6
- package/src/envUtils.ts +0 -36
- package/src/findStaticConfig.ts +0 -31
- package/static/.releaserc.yml +0 -35
package/src/eslintConfig.ts
CHANGED
|
@@ -1,80 +1,183 @@
|
|
|
1
|
-
import eslint from
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import stylistic, { type RuleOptions } from '@stylistic/eslint-plugin';
|
|
3
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
4
|
+
import jsonc from 'eslint-plugin-jsonc';
|
|
5
|
+
import globals from 'globals/globals.json' with { type: 'json' };
|
|
6
|
+
import tseslint from 'typescript-eslint';
|
|
5
7
|
|
|
6
|
-
// CJS compatibility; it started transpiling to a top-level await after upgrading from packemon 4.0.1 to 4.1.0
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
const globals = require("globals") as typeof import("globals", {with: {type: "json"}});
|
|
9
8
|
// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
|
|
10
9
|
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
|
|
11
|
+
const globalIgnores: TSESLint.FlatConfig.Config = {
|
|
12
|
+
name: 'global ignores',
|
|
13
|
+
ignores: [
|
|
14
|
+
'_tsout/**/*',
|
|
15
|
+
'_tsout/*',
|
|
16
|
+
'_tsout/',
|
|
17
|
+
'cjs/**/*',
|
|
18
|
+
'cjs/*/*',
|
|
19
|
+
'cjs/*',
|
|
20
|
+
'mjs/**/*',
|
|
21
|
+
'mjs/*',
|
|
22
|
+
'mjs/',
|
|
23
|
+
'node_modules/**/*',
|
|
24
|
+
'**/node_modules/**/*',
|
|
25
|
+
'**/*.tsbuildinfo',
|
|
26
|
+
'**/bin/**/*',
|
|
27
|
+
'**/obj/**/*',
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const json_json = {
|
|
32
|
+
/** jsonc config union types are a pain to work with. Each union member is mutually exclusive to the others */
|
|
33
|
+
...jsonc.configs['flat/recommended-with-json']
|
|
34
|
+
.map(v => v as JsoncCfgReducerIn)
|
|
35
|
+
.flatMap(a => jsonCfgReducer(a, {}))
|
|
36
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
37
|
+
.reduce((accumulator, element) => jsonCfgReducer(accumulator, element), {} as JsoncCfgReducerOut),
|
|
38
|
+
name: 'flat/recommended-with-json - https://github.com/ota-meshi/eslint-plugin-jsonc' as const,
|
|
39
|
+
files: ['*.json', '**/*.json'] as ['*.json', '**/*.json'],
|
|
40
|
+
ignores: globalIgnores.ignores,
|
|
26
41
|
};
|
|
42
|
+
const json_json5 = {
|
|
43
|
+
/** jsonc config union types are a pain to work with. Each union member is mutually exclusive to the others */
|
|
44
|
+
...jsonc.configs['flat/recommended-with-json5']
|
|
45
|
+
.map(v => v as JsoncCfgReducerIn)
|
|
46
|
+
.flatMap(a => jsonCfgReducer(a, {}))
|
|
47
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
48
|
+
.reduce((accumulator, element) => jsonCfgReducer(accumulator, element), {} as JsoncCfgReducerOut),
|
|
49
|
+
name: 'flat/recommended-with-json5 - https://github.com/ota-meshi/eslint-plugin-jsonc' as const,
|
|
50
|
+
files: ['*.json5', '**/*.json5'] as ['*.json5', '**/*.json5'],
|
|
51
|
+
ignores: globalIgnores.ignores,
|
|
52
|
+
};
|
|
53
|
+
const json_jsonc = {
|
|
54
|
+
/** jsonc config union types are a pain to work with. Each union member is mutually exclusive to the others */
|
|
55
|
+
...jsonc.configs['flat/recommended-with-jsonc']
|
|
56
|
+
.map(v => v as JsoncCfgReducerIn)
|
|
57
|
+
.flatMap(a => jsonCfgReducer(a, {}))
|
|
58
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
59
|
+
.reduce((accumulator, element) => jsonCfgReducer(accumulator, element), {} as JsoncCfgReducerOut),
|
|
60
|
+
name: 'flat/recommended-with-jsonc - https://github.com/ota-meshi/eslint-plugin-jsonc' as const,
|
|
61
|
+
files: ['*.jsonc', '**/*.jsonc'] as ['*.jsonc', '**/*.jsonc'],
|
|
62
|
+
ignores: globalIgnores.ignores,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const stylisticWarn = stylistic.configs.customize({
|
|
66
|
+
quoteProps: 'as-needed',
|
|
67
|
+
semi: true,
|
|
68
|
+
indent: 2,
|
|
69
|
+
}) as TSESLint.FlatConfig.Config & { rules: { [K in keyof RuleOptions]: TSESLint.SharedConfig.RuleLevel | [TSESLint.SharedConfig.RuleLevel, ...RuleOptions[K]] } };
|
|
70
|
+
// change all stylistic error-severity to warn-severity. Style violations should not denote code errors.
|
|
71
|
+
for (const key in stylisticWarn.rules) {
|
|
72
|
+
const element = stylisticWarn.rules[key];
|
|
73
|
+
if (Array.isArray(element) && (element[0] === 2 || element[0] === 'error'))
|
|
74
|
+
element[0] = 'warn';
|
|
75
|
+
else if (element === 2 || element === 'error') {
|
|
76
|
+
stylisticWarn.rules[key] = 'warn' satisfies TSESLint.SharedConfig.RuleLevel;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
27
79
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
80
|
+
stylisticWarn.rules['@stylistic/no-extra-parens'] = [
|
|
81
|
+
'warn',
|
|
82
|
+
'all',
|
|
83
|
+
{
|
|
84
|
+
allowParensAfterCommentPattern: '@type|@satisfies',
|
|
85
|
+
nestedBinaryExpressions: false,
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
stylisticWarn.rules['@stylistic/semi'] = [
|
|
90
|
+
'warn',
|
|
91
|
+
'always',
|
|
92
|
+
{
|
|
93
|
+
omitLastInOneLineBlock: false,
|
|
94
|
+
omitLastInOneLineClassBody: false,
|
|
95
|
+
},
|
|
96
|
+
] satisfies TSESLint.SharedConfig.RuleEntry | [TSESLint.SharedConfig.RuleLevelAndOptions, RuleOptions['@stylistic/semi'][0], RuleOptions['@stylistic/semi'][1]];
|
|
97
|
+
|
|
98
|
+
const config: TSESLint.FlatConfig.ConfigArray = tseslint.config(
|
|
99
|
+
json_json,
|
|
100
|
+
json_json5,
|
|
101
|
+
json_jsonc,
|
|
102
|
+
{
|
|
103
|
+
name: 'TSJS',
|
|
104
|
+
extends: [
|
|
105
|
+
eslint.configs.recommended,
|
|
106
|
+
...tseslint.configs.strictTypeChecked,
|
|
107
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
108
|
+
stylisticWarn,
|
|
109
|
+
],
|
|
110
|
+
files: [
|
|
111
|
+
'**/*.ts',
|
|
112
|
+
'**/*.cts',
|
|
113
|
+
'**/*.mts',
|
|
114
|
+
'**/*.js',
|
|
115
|
+
'**/*.cjs',
|
|
116
|
+
'**/*.mjs',
|
|
117
|
+
'**/*.jsx',
|
|
118
|
+
'**/*.tsx',
|
|
119
|
+
],
|
|
120
|
+
ignores: globalIgnores.ignores,
|
|
121
|
+
languageOptions: {
|
|
122
|
+
parserOptions: {
|
|
123
|
+
projectService: true,
|
|
124
|
+
},
|
|
125
|
+
globals: globals.node,
|
|
37
126
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
127
|
+
},
|
|
128
|
+
globalIgnores,
|
|
129
|
+
);
|
|
130
|
+
export default config;
|
|
131
|
+
|
|
132
|
+
type JsoncCfgReducerIn = Partial<typeof jsonc.configs['flat/recommended-with-jsonc'][number]>
|
|
133
|
+
| Partial<typeof jsonc.configs['flat/recommended-with-json5'][number]>;
|
|
134
|
+
|
|
135
|
+
interface JsoncCfgReducerOut {
|
|
136
|
+
files: NonNullable<(typeof jsonc.configs)['flat/base'][number]['files']> | ['*.json', '**/*.json', '*.json5', '**/*.json5', '*.jsonc', '**/*.jsonc'];
|
|
137
|
+
plugins: typeof jsonc.configs['flat/base'][number]['plugins'];
|
|
138
|
+
languageOptions: {
|
|
139
|
+
parser: typeof import('jsonc-eslint-parser');
|
|
140
|
+
};
|
|
141
|
+
rules: NonNullable<
|
|
142
|
+
typeof jsonc['configs']['flat/recommended-with-json5'][number]['rules']
|
|
143
|
+
| typeof jsonc.configs['flat/recommended-with-jsonc'][number]['rules']
|
|
144
|
+
>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Merge erroneously mutually-exclusive configs from `eslint-plugin-jsonc`.
|
|
149
|
+
* @param a A config exported by `eslint-plugin-jsonc` -OR- the output of this function.
|
|
150
|
+
* @param b A config exported by `eslint-plugin-jsonc` -OR- the output of this function.
|
|
151
|
+
* @returns A merged combination of {@link a} and {@link b}.
|
|
152
|
+
*/
|
|
153
|
+
function jsonCfgReducer(
|
|
154
|
+
a: JsoncCfgReducerIn | JsoncCfgReducerOut,
|
|
155
|
+
b: JsoncCfgReducerIn | JsoncCfgReducerOut,
|
|
156
|
+
): JsoncCfgReducerOut {
|
|
157
|
+
const baseRules = jsonc.configs['flat/base']
|
|
158
|
+
.find(
|
|
159
|
+
v => v.rules !== undefined,
|
|
160
|
+
)?.rules ?? (() => { throw new Error('Unable to find jsonc base rules'); })();
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
files: jsonc.configs['flat/base']
|
|
164
|
+
.filter(v => v.files !== undefined)
|
|
165
|
+
.flatMap(v => v.files),
|
|
166
|
+
plugins: {
|
|
167
|
+
jsonc: jsonc.configs['flat/base']
|
|
168
|
+
.find(v =>
|
|
169
|
+
v.plugins?.jsonc !== undefined,
|
|
170
|
+
)?.plugins?.jsonc ?? (() => { throw new Error('Unable to find jsonc plugin'); })(),
|
|
46
171
|
},
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"*.jsonc",
|
|
52
|
-
"**/*.jsonc"
|
|
53
|
-
],
|
|
54
|
-
ignores: globalIgnores.ignores
|
|
172
|
+
languageOptions: {
|
|
173
|
+
parser: jsonc.configs['flat/base']
|
|
174
|
+
.find(v => v.languageOptions?.parser)
|
|
175
|
+
?.languageOptions?.parser ?? (() => { throw new Error('Unable to find jsonc parser'); })(),
|
|
55
176
|
},
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
...tseslint.configs.strict,
|
|
61
|
-
...tseslint.configs.stylistic
|
|
62
|
-
],
|
|
63
|
-
files: [
|
|
64
|
-
"**/*.ts",
|
|
65
|
-
"**/*.cts",
|
|
66
|
-
"**/*.mts",
|
|
67
|
-
"**/*.js",
|
|
68
|
-
"**/*.cjs",
|
|
69
|
-
"**/*.mjs"
|
|
70
|
-
],
|
|
71
|
-
ignores: globalIgnores.ignores,
|
|
72
|
-
languageOptions: {
|
|
73
|
-
parserOptions: {
|
|
74
|
-
useProjectService: true
|
|
75
|
-
},
|
|
76
|
-
globals: globals.node
|
|
77
|
-
}
|
|
177
|
+
rules: {
|
|
178
|
+
...a.rules,
|
|
179
|
+
...b.rules,
|
|
180
|
+
...baseRules,
|
|
78
181
|
},
|
|
79
|
-
|
|
80
|
-
|
|
182
|
+
};
|
|
183
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,44 +1,50 @@
|
|
|
1
1
|
declare module '@semantic-release/commit-analyzer' {
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
interface RuleObject {
|
|
4
|
+
type?: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
release: string;
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface CommitAnalyzerConfig {
|
|
12
|
-
preset?: string,
|
|
13
|
-
config?: string,
|
|
14
|
-
parserOpts?: AnyRecord,
|
|
15
|
-
releaseRules?: string | RuleObject[],
|
|
16
|
-
presetConfig?: AnyRecord
|
|
17
|
-
}
|
|
9
|
+
type AnyRecord = Record<keyof unknown, unknown>;
|
|
18
10
|
|
|
11
|
+
export interface CommitAnalyzerConfig {
|
|
12
|
+
preset?: string;
|
|
13
|
+
config?: string;
|
|
14
|
+
parserOpts?: AnyRecord;
|
|
19
15
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} pluginConfig The plugin configuration.
|
|
23
|
-
* @param {String} pluginConfig.preset conventional-changelog preset ('angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint')
|
|
24
|
-
* @param {String} pluginConfig.config Requireable npm package with a custom conventional-changelog preset
|
|
25
|
-
* @param {String|Array} pluginConfig.releaseRules A `String` to load an external module or an `Array` of rules.
|
|
26
|
-
* @param {Object} pluginConfig.parserOpts Additional `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`.
|
|
27
|
-
* @param {Object} context The semantic-release context.
|
|
28
|
-
* @param {Array<Object>} context.commits The commits to analyze.
|
|
29
|
-
* @param {String} context.cwd The current working directory.
|
|
30
|
-
*
|
|
31
|
-
* @returns {Promise<String|null>} the type of release to create based on the list of commits or `null` if no release has to be done.
|
|
32
|
-
*
|
|
33
|
-
* @see 'file://./../node_modules/@semantic-release/commit-analyzer/index.js'
|
|
16
|
+
* Can be a string only if the string is a path to a modules whose default export provides {@link RuleObject}[].
|
|
17
|
+
* See https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#external-package--file
|
|
34
18
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
19
|
+
releaseRules?: string | RuleObject[];
|
|
20
|
+
presetConfig?: AnyRecord;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Options = CommitAnalyzerConfig;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Determine the type of release to create based on a list of commits.
|
|
27
|
+
* @param pluginConfig The plugin configuration.
|
|
28
|
+
* @param pluginConfig.preset conventional-changelog preset ('angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint')
|
|
29
|
+
* @param pluginConfig.config Require-able npm package with a custom conventional-changelog preset
|
|
30
|
+
* @param pluginConfig.releaseRules A `String` to load an external module or an `Array` of rules.
|
|
31
|
+
* @param pluginConfig.parserOpts Additional `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`.
|
|
32
|
+
* @param context The semantic-release context.
|
|
33
|
+
* @param context.commits The commits to analyze.
|
|
34
|
+
* @param context.cwd The current working directory.
|
|
35
|
+
* @returns the type of release to create based on the list of commits or `null` if no release has to be done.
|
|
36
|
+
* @see 'file://./../node_modules/@semantic-release/commit-analyzer/index.js'
|
|
37
|
+
*/
|
|
38
|
+
export function analyzeCommits(
|
|
39
|
+
pluginConfig: {
|
|
40
|
+
preset: string;
|
|
41
|
+
config: string;
|
|
42
|
+
releaseRules: string | AnyRecord[];
|
|
43
|
+
parserOpts: unknown;
|
|
44
|
+
},
|
|
45
|
+
context: {
|
|
46
|
+
commits: object[];
|
|
47
|
+
cwd: string;
|
|
48
|
+
},
|
|
49
|
+
): Promise<string | null>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare module '@semantic-release/exec' {
|
|
2
|
+
interface Options {
|
|
3
|
+
verifyConditionsCmd?: string;
|
|
4
|
+
analyzeCommitsCmd?: string;
|
|
5
|
+
verifyReleaseCmd?: string;
|
|
6
|
+
generateNotesCmd?: string;
|
|
7
|
+
prepareCmd?: string;
|
|
8
|
+
addChannelCmd?: string;
|
|
9
|
+
publishCmd?: string;
|
|
10
|
+
successCmd?: string;
|
|
11
|
+
failCmd?: string;
|
|
12
|
+
shell?: string;
|
|
13
|
+
execCwd?: string;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,91 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable jsdoc/tag-lines, jsdoc/require-param, jsdoc/require-returns */
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link ../node_modules/@semantic-release/git/index.js}
|
|
4
|
+
*/
|
|
2
5
|
declare module '@semantic-release/git' {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
6
|
+
import type { GlobalConfig, PrepareContext, VerifyConditionsContext } from 'semantic-release';
|
|
7
|
+
export type MicromatchGlob = string;
|
|
8
|
+
export interface AssetObject {
|
|
9
|
+
path: MicromatchGlob;
|
|
10
|
+
}
|
|
11
|
+
export type AssetEntry = AssetObject | MicromatchGlob;
|
|
12
|
+
export interface Options {
|
|
13
|
+
/**
|
|
14
|
+
* Files to include in the release commit. Set to `false` to disable adding files to the release commit.
|
|
15
|
+
* @default ['CHANGELOG.md','package.json','package-lock.json','npm-shrinkwrap.json']
|
|
16
|
+
* @description
|
|
17
|
+
* Can be an Array or a single entry. Each entry can be either:
|
|
18
|
+
* - a glob
|
|
19
|
+
* - or an Object with a path property containing a glob.
|
|
20
|
+
*
|
|
21
|
+
* Each entry in the assets Array is globbed individually. A glob can be a String ("dist/\*\*\/\*.js" or "dist/mylib.js") or an Array of Strings that will be globbed together (["dist/\*\*", "!\*\*\/\*.css"]).
|
|
22
|
+
*
|
|
23
|
+
* If a directory is configured, all the files under this directory and its children will be included.
|
|
24
|
+
*
|
|
25
|
+
* Note: If a file has a match in assets it will be included even if it also has a match in .gitignore.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // include all js files in the dist directory, but not in its sub-directories.
|
|
29
|
+
* 'dist/*.js'
|
|
30
|
+
* // include all js files in the dist directory and its sub-directories.
|
|
31
|
+
* 'dist/**\/*.js'
|
|
32
|
+
* // include all files in the dist directory and its sub-directories excluding the css files.
|
|
33
|
+
* [['dist', '!**\/*.css']]
|
|
34
|
+
* // include package.json and all files in the dist directory and its sub-directories excluding the css files.
|
|
35
|
+
* [['dist', '!**\/*.css'], 'package.json']
|
|
36
|
+
* // include all js and css files in the dist directory and its sub-directories excluding the minified version.
|
|
37
|
+
* [['dist/**\/*.{js,css}', '!**\/*.min.*']]
|
|
38
|
+
*/
|
|
39
|
+
assets?: AssetEntry | AssetEntry[] | false;
|
|
40
|
+
/**
|
|
41
|
+
* The message for the release commit.
|
|
42
|
+
* @default `chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}`
|
|
43
|
+
* @description
|
|
44
|
+
* The message for the release commit is generated with Lodash template. The following variables are available:
|
|
45
|
+
* | Parameter | Description |
|
|
46
|
+
* | ----------------- | ----------- |
|
|
47
|
+
* | branch | The branch from which the release is done. |
|
|
48
|
+
* | branch.name | The branch name. |
|
|
49
|
+
* | branch.type | The type of branch. |
|
|
50
|
+
* | branch.channel | The distribution channel on which to publish releases from this branch. |
|
|
51
|
+
* | branch.range | The range of semantic versions to support on this branch. |
|
|
52
|
+
* | branch.prerelease | The pre-release detonation to append to semantic versions released from this branch. |
|
|
53
|
+
* | lastRelease | Object with version, gitTag and gitHead of the last release. |
|
|
54
|
+
* | nextRelease | Object with version, gitTag, gitHead and notes of the release being done. |
|
|
55
|
+
*
|
|
56
|
+
* Note: It is recommended to include `[skip ci]` in the commit message to not trigger a new build. Some CI service support the `[skip ci]` keyword only in the subject of the message.
|
|
57
|
+
*
|
|
58
|
+
* #### `message` examples
|
|
59
|
+
* The `message` `Release <%= nextRelease.version %> - <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %> [skip ci]\n\n<%= nextRelease.notes %>` will generate the commit message:
|
|
60
|
+
* > Release v1.0.0 - Oct. 21, 2015 1:24 AM [skip ci]
|
|
61
|
+
* >
|
|
62
|
+
* > ## 1.0.0
|
|
63
|
+
* >
|
|
64
|
+
* > ### Features
|
|
65
|
+
* > * Generate 1.21 gigawatts of electricity
|
|
66
|
+
* >
|
|
67
|
+
* > ...
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
message?: string;
|
|
71
|
+
}
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
lastRelease,
|
|
86
|
-
nextRelease: { version, notes, gitTag },
|
|
87
|
-
logger: { log(_0: string, _1: unknown | number): void },
|
|
88
|
-
}
|
|
89
|
-
): Promise<void>;
|
|
90
|
-
export { prepare, verifyConditions };
|
|
73
|
+
function verifyConditions(
|
|
74
|
+
pluginConfig: Options,
|
|
75
|
+
context: VerifyConditionsContext & {
|
|
76
|
+
options: {
|
|
77
|
+
prepare: unknown;
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
): void;
|
|
81
|
+
function prepare(
|
|
82
|
+
pluginConfig: Options,
|
|
83
|
+
context: PrepareContext & {
|
|
84
|
+
options: GlobalConfig;
|
|
85
|
+
},
|
|
86
|
+
): Promise<void>;
|
|
87
|
+
export { prepare, verifyConditions };
|
|
91
88
|
}
|