@halospv3/hce.shared-config 3.0.0-develop.2 → 3.0.0-develop.21
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 +164 -0
- package/dotnet/.github/workflows/_unit_test.yml +0 -3
- package/dotnet/.github/workflows/dotnet-release.yml +0 -3
- package/dotnet/.github/workflows/sample-dotnet-build.yml +0 -3
- package/dotnet/PublishAll.targets +3 -2
- package/dotnet/ZipPublishDir.targets +24 -29
- package/mjs/CaseInsensitiveMap.d.ts +12 -0
- package/mjs/CaseInsensitiveMap.d.ts.map +1 -0
- package/mjs/CaseInsensitiveMap.mjs +33 -0
- package/mjs/CaseInsensitiveMap.mjs.map +1 -0
- package/mjs/commitlintConfig.d.ts +12 -0
- package/mjs/commitlintConfig.d.ts.map +1 -0
- package/mjs/commitlintConfig.mjs +13 -0
- package/mjs/commitlintConfig.mjs.map +1 -0
- package/mjs/debug.d.ts +6 -0
- package/mjs/debug.d.ts.map +1 -0
- package/mjs/debug.mjs +9 -0
- package/mjs/debug.mjs.map +1 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.d.ts +38 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.d.ts.map +1 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs +43 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts +62 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts.map +1 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +99 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -0
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts +2 -0
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts.map +1 -0
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +41 -0
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -0
- package/mjs/dotnet/MSBuildProject.d.ts +256 -0
- package/mjs/dotnet/MSBuildProject.d.ts.map +1 -0
- package/mjs/dotnet/MSBuildProject.mjs +447 -0
- package/mjs/dotnet/MSBuildProject.mjs.map +1 -0
- package/mjs/dotnet/MSBuildProjectProperties.d.ts +170 -0
- package/mjs/dotnet/MSBuildProjectProperties.d.ts.map +1 -0
- package/mjs/dotnet/MSBuildProjectProperties.mjs +260 -0
- package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -0
- package/mjs/dotnet/NugetProjectProperties.d.ts +379 -0
- package/mjs/dotnet/NugetProjectProperties.d.ts.map +1 -0
- package/mjs/dotnet/NugetProjectProperties.mjs +577 -0
- package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -0
- package/mjs/dotnet/NugetRegistryInfo.d.ts +384 -0
- package/mjs/dotnet/NugetRegistryInfo.d.ts.map +1 -0
- package/mjs/dotnet/NugetRegistryInfo.mjs +752 -0
- package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -0
- package/mjs/dotnet/helpers.d.ts +63 -0
- package/mjs/dotnet/helpers.d.ts.map +1 -0
- package/mjs/dotnet/helpers.mjs +354 -0
- package/mjs/dotnet/helpers.mjs.map +1 -0
- package/mjs/dotnet/index.d.ts +9 -0
- package/mjs/dotnet/index.d.ts.map +1 -0
- package/mjs/dotnet/index.mjs +9 -0
- package/mjs/dotnet/index.mjs.map +1 -0
- package/mjs/dotnet.d.ts +2 -0
- package/mjs/dotnet.d.ts.map +1 -0
- package/mjs/dotnet.mjs +9 -0
- package/mjs/dotnet.mjs.map +1 -0
- package/mjs/eslintConfig.d.ts +4 -0
- package/mjs/eslintConfig.d.ts.map +1 -0
- package/mjs/eslintConfig.mjs +98 -0
- package/mjs/eslintConfig.mjs.map +1 -0
- package/mjs/index.d.ts +3 -0
- package/mjs/index.d.ts.map +1 -0
- package/mjs/index.mjs +4 -0
- package/mjs/index.mjs.map +1 -0
- package/mjs/insertPlugins.d.ts +18 -0
- package/mjs/insertPlugins.d.ts.map +1 -0
- package/mjs/insertPlugins.mjs +73 -0
- package/mjs/insertPlugins.mjs.map +1 -0
- package/mjs/semantic-release__commit-analyzer.d.mjs +2 -0
- package/mjs/semantic-release__commit-analyzer.d.mjs.map +1 -0
- package/mjs/semantic-release__exec.d.mjs +2 -0
- package/mjs/semantic-release__exec.d.mjs.map +1 -0
- package/mjs/semantic-release__git.d.mjs +2 -0
- package/mjs/semantic-release__git.d.mjs.map +1 -0
- package/mjs/semantic-release__github.d.mjs +2 -0
- package/mjs/semantic-release__github.d.mjs.map +1 -0
- package/mjs/semanticReleaseConfig.d.ts +97 -0
- package/mjs/semanticReleaseConfig.d.ts.map +1 -0
- package/mjs/semanticReleaseConfig.mjs +63 -0
- package/mjs/semanticReleaseConfig.mjs.map +1 -0
- package/mjs/semanticReleaseConfigDotnet.d.ts +109 -0
- package/mjs/semanticReleaseConfigDotnet.d.ts.map +1 -0
- package/mjs/semanticReleaseConfigDotnet.mjs +268 -0
- package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -0
- package/mjs/setupGitPluginSpec.d.ts +22 -0
- package/mjs/setupGitPluginSpec.d.ts.map +1 -0
- package/mjs/setupGitPluginSpec.mjs +144 -0
- package/mjs/setupGitPluginSpec.mjs.map +1 -0
- package/mjs/utils/Exact.d.ts +20 -0
- package/mjs/utils/Exact.d.ts.map +1 -0
- package/mjs/utils/Exact.mjs +75 -0
- package/mjs/utils/Exact.mjs.map +1 -0
- package/mjs/utils/GracefulRecursion.d.mjs +2 -0
- package/mjs/utils/GracefulRecursion.d.mjs.map +1 -0
- package/mjs/utils/env.d.ts +24 -0
- package/mjs/utils/env.d.ts.map +1 -0
- package/mjs/utils/env.mjs +39 -0
- package/mjs/utils/env.mjs.map +1 -0
- package/mjs/utils/execAsync.d.ts +37 -0
- package/mjs/utils/execAsync.d.ts.map +1 -0
- package/mjs/utils/execAsync.mjs +59 -0
- package/mjs/utils/execAsync.mjs.map +1 -0
- package/mjs/utils/miscTypes.d.ts +13 -0
- package/mjs/utils/miscTypes.d.ts.map +1 -0
- package/mjs/utils/miscTypes.mjs +10 -0
- package/mjs/utils/miscTypes.mjs.map +1 -0
- package/mjs/utils/reflection/FunctionLike.d.mjs +2 -0
- package/mjs/utils/reflection/FunctionLike.d.mjs.map +1 -0
- package/mjs/utils/reflection/GetterDescriptor.d.mjs +2 -0
- package/mjs/utils/reflection/GetterDescriptor.d.mjs.map +1 -0
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs +2 -0
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs.map +1 -0
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs +2 -0
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs.map +1 -0
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs +2 -0
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs.map +1 -0
- package/mjs/utils/reflection/OwnKeyOf.d.mjs +2 -0
- package/mjs/utils/reflection/OwnKeyOf.d.mjs.map +1 -0
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs +2 -0
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs.map +1 -0
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs +2 -0
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs.map +1 -0
- package/mjs/utils/reflection/filterForGetters.d.ts +7 -0
- package/mjs/utils/reflection/filterForGetters.d.ts.map +1 -0
- package/mjs/utils/reflection/filterForGetters.mjs +27 -0
- package/mjs/utils/reflection/filterForGetters.mjs.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts +22 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs +34 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts +56 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +72 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -0
- package/mjs/utils/reflection/getPrototypeChainOf.d.ts +16 -0
- package/mjs/utils/reflection/getPrototypeChainOf.d.ts.map +1 -0
- package/mjs/utils/reflection/getPrototypeChainOf.mjs +55 -0
- package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -0
- package/mjs/utils/reflection/getPrototypeOf.d.ts +8 -0
- package/mjs/utils/reflection/getPrototypeOf.d.ts.map +1 -0
- package/mjs/utils/reflection/getPrototypeOf.mjs +10 -0
- package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -0
- package/mjs/utils/reflection/inheritance.d.ts +180 -0
- package/mjs/utils/reflection/inheritance.d.ts.map +1 -0
- package/mjs/utils/reflection/inheritance.mjs +148 -0
- package/mjs/utils/reflection/inheritance.mjs.map +1 -0
- package/mjs/utils/reflection/isConstructor.d.ts +17 -0
- package/mjs/utils/reflection/isConstructor.d.ts.map +1 -0
- package/mjs/utils/reflection/isConstructor.mjs +63 -0
- package/mjs/utils/reflection/isConstructor.mjs.map +1 -0
- package/mjs/utils/reflection/isGetterDescriptor.d.ts +9 -0
- package/mjs/utils/reflection/isGetterDescriptor.d.ts.map +1 -0
- package/mjs/utils/reflection/isGetterDescriptor.mjs +12 -0
- package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -0
- package/mjs/utils/reflection/listOwnGetters.d.ts +26 -0
- package/mjs/utils/reflection/listOwnGetters.d.ts.map +1 -0
- package/mjs/utils/reflection/listOwnGetters.mjs +39 -0
- package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -0
- package/mjs/utils/reflection.d.ts +18 -0
- package/mjs/utils/reflection.d.ts.map +1 -0
- package/mjs/utils/reflection.mjs +10 -0
- package/mjs/utils/reflection.mjs.map +1 -0
- package/package.json +17 -17
- package/src/debug.ts +5 -4
- package/src/dotnet/GithubNugetRegistryInfo.ts +17 -9
- package/src/dotnet/GitlabNugetRegistryInfo.ts +19 -5
- package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +53 -36
- package/src/dotnet/MSBuildProject.ts +150 -5
- package/src/dotnet/MSBuildProjectProperties.ts +2 -1
- package/src/dotnet/NugetProjectProperties.ts +3 -2
- package/src/dotnet/NugetRegistryInfo.ts +94 -8
- package/src/dotnet/helpers.ts +87 -53
- package/src/dotnet/index.ts +8 -0
- package/src/dotnet.ts +1 -0
- package/src/insertPlugins.ts +116 -0
- package/src/semantic-release__exec.d.ts +1 -1
- package/src/semanticReleaseConfig.ts +8 -3
- package/src/semanticReleaseConfigDotnet.ts +90 -88
- package/src/setupGitPluginSpec.ts +4 -1
- package/src/tsconfig.json +1 -1
- package/src/utils/execAsync.ts +13 -1
- package/src/utils/miscTypes.ts +4 -3
- package/src/utils/reflection/inheritance.ts +1 -1
- package/tsconfig.base.json +54 -0
- package/tsconfig.json +22 -0
- package/tsconfig.mjs.json +8 -0
|
@@ -20,7 +20,7 @@ import { getEnvVarValue } from './utils/env.js';
|
|
|
20
20
|
import { baseConfig } from './semanticReleaseConfig.js';
|
|
21
21
|
import { NugetRegistryInfo } from './dotnet/NugetRegistryInfo.js';
|
|
22
22
|
import { MSBuildProject } from './dotnet/MSBuildProject.js';
|
|
23
|
-
import {
|
|
23
|
+
import { insertPlugin } from './insertPlugins.js';
|
|
24
24
|
|
|
25
25
|
type UnArray<T> = T extends (infer U)[] ? U : T;
|
|
26
26
|
interface SRConfigDotnetOptions extends Omit<typeof baseConfig, 'plugins'> {
|
|
@@ -80,7 +80,7 @@ export class SemanticReleaseConfigDotnet {
|
|
|
80
80
|
this._projectsToPublish = p;
|
|
81
81
|
}
|
|
82
82
|
else if (debug.enabled) {
|
|
83
|
-
debug
|
|
83
|
+
debug(new Error('At least one project must be published. `projectsToPackAndPush` is empty and environment variable `PROJECTS_TO_PUBLISH` is undefined or empty.'));
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -91,7 +91,7 @@ export class SemanticReleaseConfigDotnet {
|
|
|
91
91
|
this._projectsToPackAndPush = p;
|
|
92
92
|
}
|
|
93
93
|
else if (debug.enabled) {
|
|
94
|
-
debug
|
|
94
|
+
debug(new Error('projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.'));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -120,91 +120,86 @@ export class SemanticReleaseConfigDotnet {
|
|
|
120
120
|
afterPluginsIDs: string[],
|
|
121
121
|
insertPluginIDs: string[],
|
|
122
122
|
beforePluginsIDs: string[],
|
|
123
|
-
) {
|
|
124
|
-
|
|
125
|
-
typeof v === 'string' ? v : v[0],
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
// if any beforePluginIDs are ordered before the last afterPlugin, throw. Impossible to sort.
|
|
129
|
-
|
|
130
|
-
const indexOfLastAfter = afterPluginsIDs
|
|
131
|
-
.filter(v => pluginIDs.includes(v))
|
|
132
|
-
.map(v => pluginIDs.indexOf(v))
|
|
133
|
-
.sort()
|
|
134
|
-
.find((_v, i, obj) => i === obj.length - 1);
|
|
135
|
-
if (!indexOfLastAfter)
|
|
136
|
-
throw new ReferenceError(
|
|
137
|
-
'An attempt to get the last element of an array returned undefined.',
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
const indicesOfBefore = beforePluginsIDs
|
|
141
|
-
.filter(v => pluginIDs.includes(v))
|
|
142
|
-
.map(v => pluginIDs.indexOf(v))
|
|
143
|
-
.sort();
|
|
144
|
-
|
|
145
|
-
// This for-of collects *all* sorting errors. The resulting AggregateError
|
|
146
|
-
// notifies the API user of *all* errors in the order rather than just the
|
|
147
|
-
// first error encountered.
|
|
148
|
-
const errors: Error[] = [];
|
|
149
|
-
for (const index of indicesOfBefore) {
|
|
150
|
-
if (index <= indexOfLastAfter) {
|
|
151
|
-
errors.push(
|
|
152
|
-
new Error(
|
|
153
|
-
`insertPlugin was instructed to insert one or more plugins after [${afterPluginsIDs.map(v => '"' + v + '"').join(', ')}] and before [${beforePluginsIDs.map(v => `"${v}"`).join(', ')}], but ${JSON.stringify(pluginIDs[indexOfLastAfter])} comes after ${JSON.stringify(pluginIDs[index])}!`,
|
|
154
|
-
),
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
if (errors.length > 0)
|
|
159
|
-
throw new AggregateError(errors, 'One or more errors occurred while inserting plugin configs into the Semantic Release config!');
|
|
160
|
-
|
|
161
|
-
// insert plugin(s)
|
|
162
|
-
this.options.plugins.splice(
|
|
163
|
-
indexOfLastAfter + 1,
|
|
164
|
-
0,
|
|
165
|
-
...insertPluginIDs.map(id =>
|
|
166
|
-
[id, {}] as [string, unknown],
|
|
167
|
-
),
|
|
168
|
-
);
|
|
123
|
+
): void {
|
|
124
|
+
this.options.plugins = insertPlugin(this.options.plugins, afterPluginsIDs, insertPluginIDs, beforePluginsIDs);
|
|
169
125
|
}
|
|
170
126
|
|
|
171
127
|
/**
|
|
172
128
|
* generate dotnet commands for \@semantic-release/exec, appending commands with ' && ' when necessary.
|
|
173
|
-
*
|
|
174
|
-
* @
|
|
129
|
+
*
|
|
130
|
+
* Note: All strings in {@link this.ProjectsToPackAndPush} will be converted to basic {@link NugetRegistryInfo} instances with default values.
|
|
131
|
+
* If you need specific NRI settings or you need to push to GitLab-like or GitHub-like registries, instantiate them instead of passing their paths.
|
|
132
|
+
* @todo change to builder method? e.g. static async SetupDotnetCommands(this: SemanticReleaseConfigDotnet): Promise<SemanticReleaseConfigDotnet>
|
|
133
|
+
* @todo Add options param to allow users to enable pushing to GitLab, GitHub, NuGet.org with default settings -OR- with entirely custom settings.
|
|
175
134
|
* @see https://github.com/semantic-release/exec#usage
|
|
176
135
|
*/
|
|
177
136
|
async setupDotnetCommands(): Promise<void> {
|
|
178
|
-
|
|
137
|
+
let srExecIndex = this.options.plugins.findIndex(
|
|
179
138
|
v => v[0] === '@semantic-release/exec',
|
|
180
139
|
);
|
|
140
|
+
if (srExecIndex === -1) {
|
|
141
|
+
const message = `\
|
|
142
|
+
Unable to find\`['@semantic-release/exec', unknown]\` in plugins array!
|
|
143
|
+
Appending it to the end of the array...This may cause an unexpected order of operations!`;
|
|
144
|
+
console.warn(message);
|
|
145
|
+
srExecIndex = this.options.plugins.push(['@semantic-release/exec', {}]) - 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
181
148
|
const execOptions = this.options.plugins[srExecIndex] as SRExecOptions;
|
|
182
149
|
|
|
183
|
-
// TODO: move configurePrepareCmd into SemanticReleaseConfigDotnet
|
|
184
150
|
// ensure all packable projects are evaluated
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
185
152
|
this._projectsToPackAndPush = await Promise.all(
|
|
186
|
-
this.
|
|
187
|
-
if (typeof
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
this._evaluatedProjects.push(msbp);
|
|
201
|
-
|
|
202
|
-
return new NugetRegistryInfo({ project: msbp });
|
|
153
|
+
this._projectsToPackAndPush.map(async (project) => {
|
|
154
|
+
if (typeof project === 'string') {
|
|
155
|
+
const packableProjects = await Promise.all(
|
|
156
|
+
await MSBuildProject.PackableProjectsToMSBuildProjects(
|
|
157
|
+
[project],
|
|
158
|
+
),
|
|
159
|
+
);
|
|
160
|
+
if (packableProjects.length === 0)
|
|
161
|
+
throw new Error('No MSBuildProject instances were returned!');
|
|
162
|
+
this._evaluatedProjects.push(...packableProjects);
|
|
163
|
+
|
|
164
|
+
// if the user doesn't want a defaulted NRI, they should pass their own NRI (or derived) instance.
|
|
165
|
+
return packableProjects.map(project => new NugetRegistryInfo({ project }));
|
|
203
166
|
}
|
|
204
|
-
else return
|
|
167
|
+
else return [project];
|
|
205
168
|
}),
|
|
206
|
-
);
|
|
169
|
+
).then(p => p.flat()) as NugetRegistryInfo[];
|
|
170
|
+
|
|
207
171
|
// todo: double-check token-testing commands. Are they formatted prepended correctly?
|
|
172
|
+
const verifyConditionsCmdAppendix = await Promise.all(
|
|
173
|
+
this._projectsToPackAndPush
|
|
174
|
+
.map(async project =>
|
|
175
|
+
await project.PackDummyPackage({})
|
|
176
|
+
.then(() =>
|
|
177
|
+
project.GetPushDummyCommand({}),
|
|
178
|
+
),
|
|
179
|
+
),
|
|
180
|
+
).then(cmds =>
|
|
181
|
+
cmds.join(' && '),
|
|
182
|
+
);
|
|
183
|
+
execOptions.verifyConditionsCmd
|
|
184
|
+
= execOptions.verifyConditionsCmd && execOptions.verifyConditionsCmd.trim().length > 0
|
|
185
|
+
? `${execOptions.verifyConditionsCmd} && ${verifyConditionsCmdAppendix}`
|
|
186
|
+
: verifyConditionsCmdAppendix;
|
|
187
|
+
|
|
188
|
+
const verifyReleaseCmdAppendix = await Promise.all(
|
|
189
|
+
this.ProjectsToPackAndPush
|
|
190
|
+
.filter(project =>
|
|
191
|
+
typeof project !== 'string',
|
|
192
|
+
).map(project =>
|
|
193
|
+
project.GetIsNextVersionAlreadyPublishedCommand(),
|
|
194
|
+
),
|
|
195
|
+
).then(cmds =>
|
|
196
|
+
cmds.join(' && '),
|
|
197
|
+
);
|
|
198
|
+
execOptions.verifyReleaseCmd
|
|
199
|
+
= execOptions.verifyReleaseCmd && execOptions.verifyReleaseCmd.trim().length > 0
|
|
200
|
+
? `${execOptions.verifyReleaseCmd} && ${verifyReleaseCmdAppendix}`
|
|
201
|
+
: verifyConditionsCmdAppendix;
|
|
202
|
+
|
|
208
203
|
const prepareCmdAppendix = await configurePrepareCmd(
|
|
209
204
|
this._projectsToPublish,
|
|
210
205
|
this._projectsToPackAndPush,
|
|
@@ -212,7 +207,7 @@ export class SemanticReleaseConfigDotnet {
|
|
|
212
207
|
|
|
213
208
|
// 'ZipPublishDir' zips each publish folder to ./publish/*.zip
|
|
214
209
|
execOptions.prepareCmd
|
|
215
|
-
= execOptions.prepareCmd
|
|
210
|
+
= execOptions.prepareCmd && execOptions.prepareCmd.trim().length > 0
|
|
216
211
|
? `${execOptions.prepareCmd} && ${prepareCmdAppendix}`
|
|
217
212
|
: prepareCmdAppendix;
|
|
218
213
|
|
|
@@ -223,7 +218,7 @@ export class SemanticReleaseConfigDotnet {
|
|
|
223
218
|
this._projectsToPackAndPush,
|
|
224
219
|
);
|
|
225
220
|
execOptions.publishCmd
|
|
226
|
-
= execOptions.publishCmd && execOptions.publishCmd.length > 0
|
|
221
|
+
= execOptions.publishCmd && execOptions.publishCmd.trim().length > 0
|
|
227
222
|
? `${execOptions.publishCmd} && ${publishCmdAppendix}`
|
|
228
223
|
: publishCmdAppendix;
|
|
229
224
|
}
|
|
@@ -338,16 +333,24 @@ export class SemanticReleaseConfigDotnet {
|
|
|
338
333
|
}
|
|
339
334
|
|
|
340
335
|
/**
|
|
341
|
-
* Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet`
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
* paths
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* If
|
|
350
|
-
*
|
|
336
|
+
* Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet`
|
|
337
|
+
* publish, pack, and nuget-push.
|
|
338
|
+
* @param projectsToPublish
|
|
339
|
+
* An array of dotnet projects' relative paths -OR- an array of
|
|
340
|
+
* {@link MSBuildProject} instances.
|
|
341
|
+
* - If `MSBuildProject[]`, the instances will be used as-is.
|
|
342
|
+
* - If `[]`, tries getting projects' semi-colon-separated relative paths from
|
|
343
|
+
* the `PROJECTS_TO_PUBLISH` environment variable.
|
|
344
|
+
* - If configured as recommended, the projects' publish outputs will be zipped
|
|
345
|
+
* to '$PWD/publish' for use in the `publish` semantic-release step e.g. for a
|
|
346
|
+
* GitHub release.
|
|
347
|
+
* @param projectsToPackAndPush An array of dotnet projects' relative paths -OR-
|
|
348
|
+
* an array of instances of {@link NugetRegistryInfo} and/or derived classes.
|
|
349
|
+
* - If `NugetRegistryInfo[]`, no conversions or modifications will occur.
|
|
350
|
+
* - If `string[]`, the project paths will be converted to
|
|
351
|
+
* {@link NugetRegistryInfo} instances with default values. This may be undesired.
|
|
352
|
+
* - If `[]`, `dotnet pack` and `dotnet nuget push` commands will not be configured.
|
|
353
|
+
* - If `undefined`, tries getting projects' semi-colon-separated relative paths
|
|
351
354
|
* from the `PROJECTS_TO_PACK_AND_PUSH` environment variable.
|
|
352
355
|
* With the recommended configuration, `dotnet pack` will write the nupkg/snupkg
|
|
353
356
|
* files to `$PWD/publish` where they will be globbed by `dotnet nuget push`.
|
|
@@ -361,7 +364,7 @@ export async function getConfig(
|
|
|
361
364
|
projectsToPackAndPush?: string[] | NugetRegistryInfo[],
|
|
362
365
|
): Promise<Options> {
|
|
363
366
|
if (debug.enabled) {
|
|
364
|
-
debug
|
|
367
|
+
debug(
|
|
365
368
|
'hce.shared-config:\n' + inspect(baseConfig, false, Infinity, true),
|
|
366
369
|
);
|
|
367
370
|
}
|
|
@@ -407,9 +410,8 @@ export async function getConfig(
|
|
|
407
410
|
|
|
408
411
|
const options: Options = config.toOptions();
|
|
409
412
|
if (debug.enabled) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
);
|
|
413
|
+
debug('modified plugins array:');
|
|
414
|
+
debug(inspect(options.plugins, false, Infinity));
|
|
413
415
|
}
|
|
414
416
|
|
|
415
417
|
return options;
|
|
@@ -8,7 +8,10 @@ export const GitPluginId = '@semantic-release/git';
|
|
|
8
8
|
* To use, assign or create an object with the same (but mutable) properties and deeply-copy to the object
|
|
9
9
|
* @satisfies { GitOptions }
|
|
10
10
|
*/
|
|
11
|
-
export const DefaultOptions
|
|
11
|
+
export const DefaultOptions: {
|
|
12
|
+
readonly assets: ['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'];
|
|
13
|
+
readonly message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}';
|
|
14
|
+
} = {
|
|
12
15
|
assets: [
|
|
13
16
|
'README.md',
|
|
14
17
|
'CHANGELOG.md',
|
package/src/tsconfig.json
CHANGED
package/src/utils/execAsync.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable jsdoc/no-defaults */
|
|
2
2
|
import { type } from 'arktype';
|
|
3
|
+
import type { ObjectType } from 'arktype/internal/methods/object.ts';
|
|
3
4
|
import { exec } from 'node:child_process';
|
|
4
5
|
import { constants } from 'node:os';
|
|
5
6
|
import { promisify } from 'node:util';
|
|
@@ -39,7 +40,18 @@ export async function execAsync(command: string, setStderrAsCause = false): Prom
|
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const T_ExecException
|
|
43
|
+
const T_ExecException: ObjectType<{
|
|
44
|
+
name: string;
|
|
45
|
+
message: string;
|
|
46
|
+
stack?: string | undefined;
|
|
47
|
+
cause?: unknown;
|
|
48
|
+
cmd?: string | null | undefined;
|
|
49
|
+
killed?: boolean | null | undefined;
|
|
50
|
+
code?: number | null | undefined;
|
|
51
|
+
signal?: 'SIGABRT' | 'SIGALRM' | 'SIGBUS' | 'SIGCHLD' | 'SIGCONT' | 'SIGFPE' | 'SIGHUP' | 'SIGILL' | 'SIGINT' | 'SIGIO' | 'SIGIOT' | 'SIGKILL' | 'SIGPIPE' | 'SIGPOLL' | 'SIGPROF' | 'SIGPWR' | 'SIGQUIT' | 'SIGSEGV' | 'SIGSTKFLT' | 'SIGSTOP' | 'SIGSYS' | 'SIGTERM' | 'SIGTRAP' | 'SIGTSTP' | 'SIGTTIN' | 'SIGTTOU' | 'SIGUNUSED' | 'SIGURG' | 'SIGUSR1' | 'SIGUSR2' | 'SIGVTALRM' | 'SIGWINCH' | 'SIGXCPU' | 'SIGXFSZ' | 'SIGBREAK' | 'SIGLOST' | 'SIGINFO' | null | undefined;
|
|
52
|
+
stdout?: string | undefined;
|
|
53
|
+
stderr?: string | undefined;
|
|
54
|
+
}> = type('Error').and({
|
|
43
55
|
'cmd?': 'string | null',
|
|
44
56
|
'killed?': 'boolean | null',
|
|
45
57
|
'code?': 'number | null',
|
package/src/utils/miscTypes.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type } from 'arktype';
|
|
1
|
+
import { type, type Type } from 'arktype';
|
|
2
|
+
import type { StringType } from 'arktype/internal/methods/string.ts';
|
|
2
3
|
|
|
3
|
-
export const tBooleanString = type('"true" | "false"');
|
|
4
|
+
export const tBooleanString: StringType<'false' | 'true'> = type('"true" | "false"');
|
|
4
5
|
export type BooleanString = typeof tBooleanString.infer;
|
|
5
6
|
|
|
6
|
-
export const tEmptyOrBooleanString = type(tBooleanString.or('""'));
|
|
7
|
+
export const tEmptyOrBooleanString: Type<'' | 'false' | 'true'> = type(tBooleanString.or('""'));
|
|
7
8
|
export type EmptyOrBooleanString = typeof tEmptyOrBooleanString.infer;
|
|
8
9
|
|
|
9
10
|
export type Integer<N extends number> = `${N}` extends `${number}.${number}` ? never : N;
|
|
@@ -23,7 +23,7 @@ export type BaseClassProto = (() => object) & {
|
|
|
23
23
|
* The `[[Prototype]]` of all base classes.
|
|
24
24
|
* @since 3.0.0
|
|
25
25
|
*/
|
|
26
|
-
export const baseClassProto = getPrototypeOf(Object as BaseClass<ObjectConstructor>);
|
|
26
|
+
export const baseClassProto: BaseClassProto = getPrototypeOf(Object as BaseClass<ObjectConstructor>);
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* [INTERNAL]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig#",
|
|
3
|
+
"//": {
|
|
4
|
+
"Typescript Node.js Target Mapping": "https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping",
|
|
5
|
+
"Node.js ECMAScript Mapping": "https://node.green/",
|
|
6
|
+
"vscode-versions": "https://github.com/ewanharris/vscode-versions",
|
|
7
|
+
"Recommended TSConfig Bases": "https://github.com/tsconfig/bases?tab=readme-ov-file#table-of-tsconfigs",
|
|
8
|
+
"Available/Latest GitHub Runner Images": "https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images",
|
|
9
|
+
"Node.js versions in GitHub Runner Images": {
|
|
10
|
+
"Ubuntu 2404 - Node.js version(s)": {
|
|
11
|
+
"installed": "https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#language-and-runtime",
|
|
12
|
+
"cached": "https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#nodejs"
|
|
13
|
+
},
|
|
14
|
+
"macOS 14": {
|
|
15
|
+
"installed": "https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#language-and-runtime",
|
|
16
|
+
"cached": "https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#nodejs"
|
|
17
|
+
},
|
|
18
|
+
"Windows Server 2022": {
|
|
19
|
+
"!note!": "[Windows 19 and 22] Node.js version 16 will be removed from Windows images on 2025-05-05. See https://github.com/actions/runner-images/issues/11710",
|
|
20
|
+
"installed": "https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#language-and-runtime",
|
|
21
|
+
"cached": "https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#nodejs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"compileOnSave": true,
|
|
26
|
+
"extends": "./node_modules/@tsconfig/node20/tsconfig.json",
|
|
27
|
+
"compilerOptions": {
|
|
28
|
+
"composite": true,
|
|
29
|
+
"declarationMap": true,
|
|
30
|
+
"emitDeclarationOnly": true,
|
|
31
|
+
"forceConsistentCasingInFileNames": true,
|
|
32
|
+
"isolatedDeclarations": true,
|
|
33
|
+
"isolatedModules": true,
|
|
34
|
+
"module": "Node18",
|
|
35
|
+
"noEmitOnError": true,
|
|
36
|
+
"noErrorTruncation": true,
|
|
37
|
+
"noFallthroughCasesInSwitch": true,
|
|
38
|
+
"noImplicitOverride": true,
|
|
39
|
+
"noImplicitReturns": true,
|
|
40
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
41
|
+
"noUncheckedIndexedAccess": true,
|
|
42
|
+
"noUnusedLocals": true,
|
|
43
|
+
"noUnusedParameters": true,
|
|
44
|
+
"resolveJsonModule": true,
|
|
45
|
+
"skipLibCheck": true,
|
|
46
|
+
"sourceMap": true,
|
|
47
|
+
"verbatimModuleSyntax": true
|
|
48
|
+
},
|
|
49
|
+
"exclude": [
|
|
50
|
+
"**/node_modules/**",
|
|
51
|
+
"**/tsconfig.json",
|
|
52
|
+
"**/tsconfig.*.json"
|
|
53
|
+
]
|
|
54
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowImportingTsExtensions": true,
|
|
5
|
+
"outDir": "_tsout",
|
|
6
|
+
"target": "es2020",
|
|
7
|
+
"erasableSyntaxOnly": true
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"./*.cts",
|
|
11
|
+
"./*.mts",
|
|
12
|
+
"./*.ts"
|
|
13
|
+
],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "./tests/tsconfig.json"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "./src/tsconfig.json"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|