@halospv3/hce.shared-config 2.2.3 → 2.3.0
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 +2 -0
- package/LICENSE +1 -1
- package/README.md +116 -88
- package/cjs/commitlintConfig-wrapper.mjs +6 -0
- package/cjs/commitlintConfig.cjs +14 -0
- package/cjs/commitlintConfig.cjs.map +1 -0
- package/cjs/commitlintConfig.d.ts +4 -0
- package/cjs/commitlintConfig.d.ts.map +1 -0
- package/cjs/dotnet/MSBuildProject.cjs +85 -0
- package/cjs/dotnet/MSBuildProject.cjs.map +1 -0
- package/cjs/dotnet/MSBuildProject.d.ts +42 -0
- package/cjs/dotnet/MSBuildProject.d.ts.map +1 -0
- package/cjs/dotnet/MSBuildProjectProperties.cjs +22 -0
- package/cjs/dotnet/MSBuildProjectProperties.cjs.map +1 -0
- package/cjs/dotnet/MSBuildProjectProperties.d.ts +13 -0
- package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +1 -0
- package/cjs/dotnet/dotnetGHPR.cjs +60 -0
- package/cjs/dotnet/dotnetGHPR.cjs.map +1 -0
- package/cjs/dotnet/dotnetGHPR.d.ts +14 -0
- package/cjs/dotnet/dotnetGHPR.d.ts.map +1 -0
- package/cjs/dotnet/dotnetGLPR.cjs +41 -0
- package/cjs/dotnet/dotnetGLPR.cjs.map +1 -0
- package/cjs/dotnet/dotnetGLPR.d.ts +13 -0
- package/cjs/dotnet/dotnetGLPR.d.ts.map +1 -0
- package/cjs/dotnet/dotnetHelpers.cjs +144 -0
- package/cjs/dotnet/dotnetHelpers.cjs.map +1 -0
- package/cjs/dotnet/dotnetHelpers.d.ts +26 -0
- package/cjs/dotnet/dotnetHelpers.d.ts.map +1 -0
- package/cjs/dotnet-wrapper.mjs +6 -0
- package/cjs/dotnet.cjs +13 -0
- package/cjs/dotnet.cjs.map +1 -0
- package/cjs/dotnet.d.ts +6 -0
- package/cjs/dotnet.d.ts.map +1 -0
- package/cjs/eslintConfig-wrapper.mjs +6 -0
- package/cjs/eslintConfig.cjs +55 -0
- package/cjs/eslintConfig.cjs.map +1 -0
- package/cjs/eslintConfig.d.ts +4 -0
- package/cjs/eslintConfig.d.ts.map +1 -0
- package/cjs/findStaticConfig-wrapper.mjs +6 -0
- package/cjs/findStaticConfig.cjs +34 -0
- package/cjs/findStaticConfig.cjs.map +1 -0
- package/cjs/findStaticConfig.d.ts +2 -0
- package/cjs/findStaticConfig.d.ts.map +1 -0
- package/cjs/index.cjs +5 -35
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.ts +2 -5
- package/cjs/index.d.ts.map +1 -1
- package/cjs/semantic-release__git.d.cjs +2 -0
- package/cjs/semantic-release__git.d.cjs.map +1 -0
- package/cjs/semanticReleaseConfig-wrapper.mjs +6 -0
- package/cjs/semanticReleaseConfig.cjs +16 -0
- package/cjs/semanticReleaseConfig.cjs.map +1 -0
- package/cjs/semanticReleaseConfig.d.ts +4 -0
- package/cjs/semanticReleaseConfig.d.ts.map +1 -0
- package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +6 -0
- package/cjs/semanticReleaseConfigDotnet.cjs +74 -0
- package/cjs/semanticReleaseConfigDotnet.cjs.map +1 -0
- package/cjs/semanticReleaseConfigDotnet.d.ts +30 -0
- package/cjs/semanticReleaseConfigDotnet.d.ts.map +1 -0
- package/cjs/setupGitPluginSpec-wrapper.mjs +6 -0
- package/cjs/setupGitPluginSpec.cjs +67 -0
- package/cjs/setupGitPluginSpec.cjs.map +1 -0
- package/cjs/setupGitPluginSpec.d.ts +18 -0
- package/cjs/setupGitPluginSpec.d.ts.map +1 -0
- package/dotnet/HCE.Shared.CI.props +8 -0
- package/dotnet/HCE.Shared.props +6 -0
- package/dotnet/HCE.Shared.targets +9 -0
- package/dotnet/PublishAll.targets +43 -0
- package/dotnet/ZipPublishDir.targets +20 -9
- package/dotnet/dotnet-build.ps1 +67 -0
- package/package.json +72 -41
- package/src/commitlintConfig.ts +15 -0
- package/src/dotnet/MSBuildProject.ts +83 -0
- package/src/dotnet/MSBuildProjectProperties.ts +28 -0
- package/src/dotnet/dotnetGHPR.ts +76 -0
- package/src/dotnet/dotnetGLPR.ts +46 -0
- package/src/dotnet/dotnetHelpers.ts +182 -0
- package/src/dotnet.ts +5 -0
- package/src/eslintConfig.ts +86 -0
- package/src/findStaticConfig.ts +31 -0
- package/src/index.ts +2 -40
- package/src/semantic-release__git.d.ts +67 -0
- package/src/semanticReleaseConfig.ts +15 -0
- package/src/semanticReleaseConfigDotnet.ts +78 -0
- package/src/setupGitPluginSpec.ts +75 -0
- package/src/tsconfig.json +10 -0
- package/static/.releaserc.yml +2 -3
- package/commitlint.config.ts +0 -10
- package/dotnet/.releaserc.cjs +0 -77
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const node_console = require('node:console');
|
|
4
|
+
const _process$env = process.env,
|
|
5
|
+
CI_API_V4_URL = _process$env.CI_API_V4_URL,
|
|
6
|
+
CI_PROJECT_ID = _process$env.CI_PROJECT_ID;
|
|
7
|
+
const nameof = {
|
|
8
|
+
CI_API_V4_URL: 'CI_API_V4_URL',
|
|
9
|
+
CI_PROJECT_ID: 'CI_PROJECT_ID'
|
|
10
|
+
};
|
|
11
|
+
const GitLabTokenEnvVar = 'CI_JOB_TOKEN';
|
|
12
|
+
const nugetGitLabUrlBase = CI_API_V4_URL;
|
|
13
|
+
const nugetGitLabUrl = CI_API_V4_URL && CI_PROJECT_ID ? `${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/nuget/index.json` : undefined;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get a {@link NuGetRegistryInfo} for pushing to your GitLab Packages NuGet registry.
|
|
17
|
+
* @export
|
|
18
|
+
* @param {string} [tokenEnvVar=GitLabTokenEnvVar] The name of environment variable storing the GitLab Packages NuGet registry API key. Defaults to {@link GitLabTokenEnvVar}.
|
|
19
|
+
* @param {string} [url=nugetGitLabUrl] The url of the GitLab Packages NuGet registry. Defaults to {@link nugetGitLabUrl}.
|
|
20
|
+
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, undefined.
|
|
21
|
+
*/
|
|
22
|
+
function getGitlabNugetRegistryPair(tokenEnvVar = GitLabTokenEnvVar, url = nugetGitLabUrl) {
|
|
23
|
+
// yes, this is stupid. No, I won't change it.
|
|
24
|
+
if (!process.env[tokenEnvVar]) {
|
|
25
|
+
node_console.error(new Error(`The environment variable ${tokenEnvVar} was specified as the source of the token to push a NuGet package to GitLab, but the environment variable does not exist.`));
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (url) {
|
|
29
|
+
return {
|
|
30
|
+
tokenEnvVar,
|
|
31
|
+
url
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
node_console.error(new Error(`The environment variables ${nameof.CI_API_V4_URL} or ${nameof.CI_PROJECT_ID} do not exist and a custom GitLab Packages NuGet registry URL was not provided.`));
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
exports.GitLabTokenEnvVar = GitLabTokenEnvVar;
|
|
38
|
+
exports.getGitlabNugetRegistryPair = getGitlabNugetRegistryPair;
|
|
39
|
+
exports.nugetGitLabUrl = nugetGitLabUrl;
|
|
40
|
+
exports.nugetGitLabUrlBase = nugetGitLabUrlBase;
|
|
41
|
+
//# sourceMappingURL=dotnetGLPR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetGLPR.cjs","sources":["../../src/dotnet/dotnetGLPR.ts"],"sourcesContent":null,"names":["error"],"mappings":";;;;AACA,MAAM;AACN,EAAE,aAAa;AACf,EAAE,aAAa;AACf,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;AAChB,MAAM,MAAM,GAAG;AACf,EAAE,aAAa,EAAE,eAAe;AAChC,EAAE,aAAa,EAAE,eAAe;AAChC,CAAC,CAAC;AACU,MAAC,iBAAiB,GAAG,eAAe;AACpC,MAAC,kBAAkB,GAAG,cAAc;AACpC,MAAC,cAAc,GAAG,aAAa,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,0BAA0B,CAAC,GAAG,UAAU;AAClJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,0BAA0B,CAAC,WAAW,GAAG,iBAAiB,EAAE,GAAG,GAAG,cAAc,EAAE;AAClG;AACA,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;AACjC,IAAIA,kBAAK,CAAC,IAAI,KAAK,CAAC,CAAC,yBAAyB,EAAE,WAAW,CAAC,yHAAyH,CAAC,CAAC,CAAC,CAAC;AACzL,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG;AACH,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAO;AACX,MAAM,WAAW;AACjB,MAAM,GAAG;AACT,KAAK,CAAC;AACN,GAAG;AACH,EAAEA,kBAAK,CAAC,IAAI,KAAK,CAAC,CAAC,0BAA0B,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,+EAA+E,CAAC,CAAC,CAAC,CAAC;AAClL,EAAE,OAAO,SAAS,CAAC;AACnB;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NuGetRegistryInfo } from './dotnetHelpers.js';
|
|
2
|
+
export declare const GitLabTokenEnvVar = "CI_JOB_TOKEN";
|
|
3
|
+
export declare const nugetGitLabUrlBase: string | undefined;
|
|
4
|
+
export declare const nugetGitLabUrl: string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Get a {@link NuGetRegistryInfo} for pushing to your GitLab Packages NuGet registry.
|
|
7
|
+
* @export
|
|
8
|
+
* @param {string} [tokenEnvVar=GitLabTokenEnvVar] The name of environment variable storing the GitLab Packages NuGet registry API key. Defaults to {@link GitLabTokenEnvVar}.
|
|
9
|
+
* @param {string} [url=nugetGitLabUrl] The url of the GitLab Packages NuGet registry. Defaults to {@link nugetGitLabUrl}.
|
|
10
|
+
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, undefined.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getGitlabNugetRegistryPair(tokenEnvVar?: string, url?: string | undefined): NuGetRegistryInfo | undefined;
|
|
13
|
+
//# sourceMappingURL=dotnetGLPR.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetGLPR.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetGLPR.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAQ5D,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,kBAAkB,oBAAgB,CAAC;AAChD,eAAO,MAAM,cAAc,EAAE,MAAM,GAAG,SAGzB,CAAC;AAEd;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,WAAW,GAAE,MAA0B,EACvC,GAAG,GAAE,MAAM,GAAG,SAA0B,GACtC,iBAAiB,GAAG,SAAS,CAmB/B"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const strict = require('node:assert/strict');
|
|
4
|
+
const dotnetGHPR = require('./dotnetGHPR.cjs');
|
|
5
|
+
const dotnetGLPR = require('./dotnetGLPR.cjs');
|
|
6
|
+
const MSBuildProject = require('./MSBuildProject.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Build a prepareCmd string from .NET project paths and `dotnet nuget sign` arguments.
|
|
10
|
+
*
|
|
11
|
+
* todo: parse Solution files to publish all projects with default Publish parameters (as evaluated by MSBuild). If multi-targeting frameworks and/or runtime, evaluate those properties for Publish permutation matrix.
|
|
12
|
+
* todo: cleanup, docs
|
|
13
|
+
* @export
|
|
14
|
+
* @param {string[]} projectsToPublish
|
|
15
|
+
* @param {string[]} projectsToPackAndPush Relative and/or full file paths of projects to pass to `dotnet pack`. By default, these will be output to `./publish/`.
|
|
16
|
+
* @param {string[]} dotnetNugetSignArgs Arguments appended to `dotnet nuget sign`. You can also append '&&' if you want to start a new command or if you want to sign different sets of packages with different keys.
|
|
17
|
+
*/
|
|
18
|
+
function configurePrepareCmd(projectsToPublish, projectsToPackAndPush, dotnetNugetSignArgs = ['./publish']) {
|
|
19
|
+
// These are later evaluated with MSBuild, but are passed via --framework and --runtime arguments instead of -p:TargetFramework
|
|
20
|
+
const publishProperties = MSBuildProject.MSBuildProjectPreDefinedProperties;
|
|
21
|
+
function formatDotnetPublish() {
|
|
22
|
+
/* Fun Fact: You can define a property and get the evaluated value in the same command!
|
|
23
|
+
```pwsh
|
|
24
|
+
dotnet msbuild .\src\HXE.csproj -property:RuntimeIdentifiers="""place;holder""" -getProperty:RuntimeIdentifiers
|
|
25
|
+
place;holder
|
|
26
|
+
```
|
|
27
|
+
enclosing with """ is required in pwsh to prevent the semicolon from breaking the string.
|
|
28
|
+
*/
|
|
29
|
+
let dotnetPublishArgs;
|
|
30
|
+
if (Array.isArray(projectsToPublish) && projectsToPublish.length > 0) {
|
|
31
|
+
// each may have TargetFramework OR TargetFrameworks (plural)
|
|
32
|
+
const evaluatedProjects = projectsToPublish.map(proj => new MSBuildProject.MSBuildProject(proj, publishProperties));
|
|
33
|
+
// args appended to "dotnet publish", joined by space
|
|
34
|
+
dotnetPublishArgs = evaluatedProjects.flatMap(proj => {
|
|
35
|
+
const args = [proj.Properties.FullPath];
|
|
36
|
+
function appendCustomProperties() {
|
|
37
|
+
// convert to dictionary and filter for user-defined properties.
|
|
38
|
+
const dictionary = Object.entries(proj.Properties).filter(p => !publishProperties.includes(p[0]));
|
|
39
|
+
if (dictionary.length > 0) {
|
|
40
|
+
/* format remaining properties as "-p:Property=Value" and append to args */
|
|
41
|
+
args.push(...dictionary.map(keyValuePair => `-p:${keyValuePair[0]}=${keyValuePair[1]}`));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
appendCustomProperties();
|
|
45
|
+
const cmdPermutations = []; // forEach, run dotnet [...args,...v]
|
|
46
|
+
|
|
47
|
+
function formatFrameworksAndRuntimes() {
|
|
48
|
+
const RIDs = proj.Properties.RuntimeIdentifiers.length > 0 ? proj.Properties.RuntimeIdentifiers.split(';') : [];
|
|
49
|
+
const TFMs = proj.Properties.TargetFrameworks.length > 0 ? proj.Properties.TargetFrameworks.split(';') : [];
|
|
50
|
+
if (RIDs.length > 0) {
|
|
51
|
+
if (TFMs.length > 0) {
|
|
52
|
+
for (const RID of RIDs) {
|
|
53
|
+
for (const TFM of TFMs) {
|
|
54
|
+
cmdPermutations.push(['--runtime', RID, '--framework', TFM]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
// assume singular TFM. No need to specify it.
|
|
59
|
+
for (const RID of RIDs) {
|
|
60
|
+
cmdPermutations.push(['--runtime', RID]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} else if (TFMs.length > 0) {
|
|
64
|
+
for (const TFM of TFMs) {
|
|
65
|
+
cmdPermutations.push(['--framework', TFM]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
formatFrameworksAndRuntimes();
|
|
70
|
+
return cmdPermutations.length > 0 ? cmdPermutations.map(permArgs => [...args, ...permArgs]) // string[][]
|
|
71
|
+
: [args]; // string[][]
|
|
72
|
+
}); // string[][][] -> string[][]
|
|
73
|
+
} else throw new Error(`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`);
|
|
74
|
+
return dotnetPublishArgs.map(args => `dotnet publish ${args.join(' ')}`).join(' && ');
|
|
75
|
+
}
|
|
76
|
+
function formatDotnetPack() {
|
|
77
|
+
return projectsToPackAndPush.map(v => `dotnet pack ${v}`).join(' && ');
|
|
78
|
+
}
|
|
79
|
+
function formatDotnetNugetSign() {
|
|
80
|
+
switch (dotnetNugetSignArgs.length) {
|
|
81
|
+
case 0:
|
|
82
|
+
return '';
|
|
83
|
+
default:
|
|
84
|
+
return `dotnet nuget sign ${dotnetNugetSignArgs.join(' ')}`;
|
|
85
|
+
// default: {
|
|
86
|
+
// throw new Error("")
|
|
87
|
+
// // this needs a rework.
|
|
88
|
+
// const packagePaths: string[] = [];
|
|
89
|
+
// dotnetNugetSignArgs.forEach((dotnetNugetSignArg, i) => {
|
|
90
|
+
// // if current arg doesn't start with '-' and (current arg is first -OR- previous arg also does not start with '-')...
|
|
91
|
+
// if (!dotnetNugetSignArg.startsWith("-") && (i === 0 || (i > 0 && !dotnetNugetSignArgs[i - 1].startsWith("-")))) {
|
|
92
|
+
// // ...then it's probably a package path.
|
|
93
|
+
// packagePaths.push(dotnetNugetSignArg);
|
|
94
|
+
// }
|
|
95
|
+
// });
|
|
96
|
+
// if (packagePaths.length === 0)
|
|
97
|
+
// return `dotnet nuget sign ${dotnetNugetSignArgs.join(" ")}`
|
|
98
|
+
// else return
|
|
99
|
+
// }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const dotnetPublish = formatDotnetPublish();
|
|
103
|
+
const dotnetPack = formatDotnetPack();
|
|
104
|
+
const dotnetNugetSign = formatDotnetNugetSign();
|
|
105
|
+
return [dotnetPublish, dotnetPack, dotnetNugetSign].join(' && ');
|
|
106
|
+
}
|
|
107
|
+
const nugetDefault = {
|
|
108
|
+
tokenEnvVar: 'NUGET_TOKEN',
|
|
109
|
+
url: 'https://api.nuget.org/v3/index.json'
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* todo
|
|
114
|
+
* @param nupkgDir
|
|
115
|
+
* @param registries
|
|
116
|
+
* @param pushToGitHub
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
async function configureDotnetNugetPush(nupkgDir = './publish', registries = [nugetDefault], pushToGitHub = true) {
|
|
120
|
+
if (registries.some(registry => registry.url.trim() === '')) throw new Error('The URL for one of the provided NuGet registries was empty or whitespace.');
|
|
121
|
+
|
|
122
|
+
// if user did not specify a GitHub NuGet Registry, try determine default values and add the Source.
|
|
123
|
+
if (pushToGitHub && !registries.some(reg => reg.url.startsWith(dotnetGHPR.nugetGitHubUrlBase))) {
|
|
124
|
+
const ghPair = await dotnetGHPR.getGithubNugetRegistryPair();
|
|
125
|
+
if (ghPair) {
|
|
126
|
+
registries.push(ghPair);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (!registries.some(reg => reg.url.startsWith(dotnetGHPR.nugetGitHubUrlBase))) {
|
|
130
|
+
const glPair = dotnetGLPR.getGitlabNugetRegistryPair();
|
|
131
|
+
if (glPair) {
|
|
132
|
+
registries.push(glPair);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return registries.map(registry => {
|
|
136
|
+
const tokenValue = process.env[registry.tokenEnvVar];
|
|
137
|
+
strict.ok(tokenValue, `The environment variable ${registry.tokenEnvVar} is undefined!`);
|
|
138
|
+
`dotnet nuget push ${nupkgDir} --source ${registry.url} --token ${tokenValue}`;
|
|
139
|
+
}).join(' && ');
|
|
140
|
+
}
|
|
141
|
+
exports.configureDotnetNugetPush = configureDotnetNugetPush;
|
|
142
|
+
exports.configurePrepareCmd = configurePrepareCmd;
|
|
143
|
+
exports.nugetDefault = nugetDefault;
|
|
144
|
+
//# sourceMappingURL=dotnetHelpers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProjectPreDefinedProperties","MSBuildProject","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","ok"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,iBAAiB,EAAE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E,UAAU,CAAC,CAAC,CAAC;AACnF,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a prepareCmd string from .NET project paths and `dotnet nuget sign` arguments.
|
|
3
|
+
*
|
|
4
|
+
* todo: parse Solution files to publish all projects with default Publish parameters (as evaluated by MSBuild). If multi-targeting frameworks and/or runtime, evaluate those properties for Publish permutation matrix.
|
|
5
|
+
* todo: cleanup, docs
|
|
6
|
+
* @export
|
|
7
|
+
* @param {string[]} projectsToPublish
|
|
8
|
+
* @param {string[]} projectsToPackAndPush Relative and/or full file paths of projects to pass to `dotnet pack`. By default, these will be output to `./publish/`.
|
|
9
|
+
* @param {string[]} dotnetNugetSignArgs Arguments appended to `dotnet nuget sign`. You can also append '&&' if you want to start a new command or if you want to sign different sets of packages with different keys.
|
|
10
|
+
*/
|
|
11
|
+
export declare function configurePrepareCmd(projectsToPublish: string[], projectsToPackAndPush: string[], dotnetNugetSignArgs?: string[]): string;
|
|
12
|
+
export interface NuGetRegistryInfo {
|
|
13
|
+
tokenEnvVar: string;
|
|
14
|
+
url: string;
|
|
15
|
+
user?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare const nugetDefault: NuGetRegistryInfo;
|
|
18
|
+
/**
|
|
19
|
+
* todo
|
|
20
|
+
* @param nupkgDir
|
|
21
|
+
* @param registries
|
|
22
|
+
* @param pushToGitHub
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare function configureDotnetNugetPush(nupkgDir?: string, registries?: NuGetRegistryInfo[], pushToGitHub?: boolean): Promise<string>;
|
|
26
|
+
//# sourceMappingURL=dotnetHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnetHelpers.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetHelpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,mBAAmB,GAAE,MAAM,EAAkB,UAiH7C;AAED,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AACD,eAAO,MAAM,YAAY,EAAE,iBAG1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC7C,QAAQ,SAAc,EACtB,UAAU,GAAE,iBAAiB,EAAmB,EAChD,YAAY,UAAO,mBA4BnB"}
|
package/cjs/dotnet.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const dotnetGHPR$1 = require('./dotnet/dotnetGHPR.cjs');
|
|
4
|
+
const dotnetGLPR$1 = require('./dotnet/dotnetGLPR.cjs');
|
|
5
|
+
const dotnetHelpers$1 = require('./dotnet/dotnetHelpers.cjs');
|
|
6
|
+
const MSBuildProject = require('./dotnet/MSBuildProject.cjs');
|
|
7
|
+
const MSBuildProjectProperties = require('./dotnet/MSBuildProjectProperties.cjs');
|
|
8
|
+
exports.dotnetGHPR = dotnetGHPR$1;
|
|
9
|
+
exports.dotnetGLPR = dotnetGLPR$1;
|
|
10
|
+
exports.dotnetHelpers = dotnetHelpers$1;
|
|
11
|
+
exports.msbuildProject = MSBuildProject;
|
|
12
|
+
exports.msbuildProjectProperties = MSBuildProjectProperties;
|
|
13
|
+
//# sourceMappingURL=dotnet.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet.cjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/cjs/dotnet.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as dotnetGHPR from "./dotnet/dotnetGHPR.js";
|
|
2
|
+
export * as dotnetGLPR from "./dotnet/dotnetGLPR.js";
|
|
3
|
+
export * as dotnetHelpers from "./dotnet/dotnetHelpers.js";
|
|
4
|
+
export * as msbuildProject from "./dotnet/MSBuildProject.js";
|
|
5
|
+
export * as msbuildProjectProperties from "./dotnet/MSBuildProjectProperties.js";
|
|
6
|
+
//# sourceMappingURL=dotnet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet.d.ts","sourceRoot":"","sources":["../src/dotnet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,wBAAwB,MAAM,sCAAsC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsonc = require('eslint-plugin-jsonc');
|
|
4
|
+
const tseslint = require('typescript-eslint');
|
|
5
|
+
const eslint = require('@eslint/js');
|
|
6
|
+
const globals = require('globals');
|
|
7
|
+
const _interopDefault = e => e && e.__esModule ? e : {
|
|
8
|
+
default: e
|
|
9
|
+
};
|
|
10
|
+
const jsonc__default = /*#__PURE__*/_interopDefault(jsonc);
|
|
11
|
+
const tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
|
|
12
|
+
const eslint__default = /*#__PURE__*/_interopDefault(eslint);
|
|
13
|
+
const globals__default = /*#__PURE__*/_interopDefault(globals);
|
|
14
|
+
|
|
15
|
+
// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
|
|
16
|
+
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
|
|
17
|
+
|
|
18
|
+
const globalIgnores = {
|
|
19
|
+
name: "global ignores",
|
|
20
|
+
ignores: ["_tsout/**/*", "_tsout/*", "_tsout/", "cjs/**/*", "cjs/*/*", "cjs/*", "mjs/**/*", "mjs/*", "mjs/", "node_modules/**/*", "**/node_modules/**/*"]
|
|
21
|
+
};
|
|
22
|
+
const eslintConfig = tseslint__default.default.config({
|
|
23
|
+
name: "flat/recommended-with-json - https://github.com/ota-meshi/eslint-plugin-jsonc",
|
|
24
|
+
extends: jsonc__default.default.configs["flat/recommended-with-json"],
|
|
25
|
+
files: ["*.json", "**/*.json"],
|
|
26
|
+
ignores: globalIgnores.ignores
|
|
27
|
+
}, {
|
|
28
|
+
name: "flat/recommended-with-json5 - https://github.com/ota-meshi/eslint-plugin-jsonc",
|
|
29
|
+
extends: jsonc__default.default.configs["flat/recommended-with-json5"],
|
|
30
|
+
files: ["*.json5", "**/*.json5"],
|
|
31
|
+
ignores: globalIgnores.ignores
|
|
32
|
+
}, {
|
|
33
|
+
name: "flat/recommended-with-jsonc - https://github.com/ota-meshi/eslint-plugin-jsonc",
|
|
34
|
+
extends: jsonc__default.default.configs["flat/recommended-with-jsonc"],
|
|
35
|
+
files: ["*.jsonc", "**/*.jsonc"],
|
|
36
|
+
ignores: globalIgnores.ignores
|
|
37
|
+
}, {
|
|
38
|
+
name: "TSJS",
|
|
39
|
+
extends: [eslint__default.default.configs.recommended, ...tseslint__default.default.configs.strict, ...tseslint__default.default.configs.stylistic],
|
|
40
|
+
files: ["**/*.ts", "**/*.cts", "**/*.mts", "**/*.js", "**/*.cjs", "**/*.mjs"],
|
|
41
|
+
ignores: globalIgnores.ignores,
|
|
42
|
+
languageOptions: {
|
|
43
|
+
parserOptions: {
|
|
44
|
+
project: true,
|
|
45
|
+
// @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.
|
|
46
|
+
EXPERIMENTAL_useProjectService: {
|
|
47
|
+
allowDefaultProjectForFiles: ["./*.js"],
|
|
48
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
globals: globals__default.default.node
|
|
52
|
+
}
|
|
53
|
+
}, globalIgnores);
|
|
54
|
+
module.exports = eslintConfig;
|
|
55
|
+
//# sourceMappingURL=eslintConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslintConfig.cjs","sources":["../src/eslintConfig.ts"],"sourcesContent":null,"names":["tseslint","jsonc","eslint","globals"],"mappings":";;;;;;;;;;;;;;AAKA;AACA;AACA;AACA,MAAM,aAAa,GAAG;AACtB,EAAE,IAAI,EAAE,gBAAgB;AACxB,EAAE,OAAO,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,sBAAsB,CAAC;AAC3J,CAAC,CAAC;AACF,qBAAeA,yBAAQ,CAAC,MAAM,CAAC;AAC/B,EAAE,IAAI,EAAE,+EAA+E;AACvF,EAAE,OAAO,EAAEC,sBAAK,CAAC,OAAO,CAAC,4BAA4B,CAAC;AACtD,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;AAChC,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO;AAChC,CAAC,EAAE;AACH,EAAE,IAAI,EAAE,gFAAgF;AACxF,EAAE,OAAO,EAAEA,sBAAK,CAAC,OAAO,CAAC,6BAA6B,CAAC;AACvD,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;AAClC,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO;AAChC,CAAC,EAAE;AACH,EAAE,IAAI,EAAE,gFAAgF;AACxF,EAAE,OAAO,EAAEA,sBAAK,CAAC,OAAO,CAAC,6BAA6B,CAAC;AACvD,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;AAClC,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO;AAChC,CAAC,EAAE;AACH,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,OAAO,EAAE,CAACC,uBAAM,CAAC,OAAO,CAAC,WAAW,EAAE,GAAGF,yBAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAGA,yBAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;AAClG,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC;AAC/E,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO;AAChC,EAAE,eAAe,EAAE;AACnB,IAAI,aAAa,EAAE;AACnB,MAAM,OAAO,EAAE,IAAI;AACnB;AACA,MAAM,8BAA8B,EAAE;AACtC,QAAQ,2BAA2B,EAAE,CAAC,QAAQ,CAAC;AAC/C,QAAQ,+DAA+D,EAAE,EAAE;AAC3E,OAAO;AACP,KAAK;AACL,IAAI,OAAO,EAAEG,wBAAO,CAAC,IAAI;AACzB,GAAG;AACH,CAAC,EAAE,aAAa,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslintConfig.d.ts","sourceRoot":"","sources":["../src/eslintConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;;AAwBzD,wBA2DE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const node_fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const node_url = require('node:url');
|
|
6
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
|
+
const _interopDefault = e => e && e.__esModule ? e : {
|
|
8
|
+
default: e
|
|
9
|
+
};
|
|
10
|
+
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
11
|
+
|
|
12
|
+
/// ../static/.releaserc.yml
|
|
13
|
+
function findStaticConfig() {
|
|
14
|
+
const glob = 'static/.releaserc.yml';
|
|
15
|
+
let dirPath = node_url.fileURLToPath(path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('findStaticConfig.cjs', document.baseURI).href));
|
|
16
|
+
let combinedPath = path__default.default.join(dirPath, glob);
|
|
17
|
+
while (!node_fs.existsSync(combinedPath)) {
|
|
18
|
+
/* file:// + dirname behavior on Windows. 'root' is empty when 'file://' is present.
|
|
19
|
+
* file:///C:/Repos
|
|
20
|
+
* file:///C:
|
|
21
|
+
* file://
|
|
22
|
+
* .
|
|
23
|
+
*/
|
|
24
|
+
// DEBUG.log(dirPath);
|
|
25
|
+
// DEBUG.log(combinedPath.href);
|
|
26
|
+
/** Throw if we reached root. */
|
|
27
|
+
if (path__default.default.dirname(dirPath) === '') throw new Error(`Failed to get full path for HCE.Shared's shared configuration. HCE.Shared recursively searched parent directories for '${glob}' starting from '${path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('findStaticConfig.cjs', document.baseURI).href)}'`);
|
|
28
|
+
dirPath = path__default.default.dirname(dirPath);
|
|
29
|
+
combinedPath = path__default.default.join(dirPath, glob);
|
|
30
|
+
}
|
|
31
|
+
return combinedPath;
|
|
32
|
+
}
|
|
33
|
+
exports.findStaticConfig = findStaticConfig;
|
|
34
|
+
//# sourceMappingURL=findStaticConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findStaticConfig.cjs","sources":["../src/findStaticConfig.ts"],"sourcesContent":null,"names":["fileURLToPath","path","existsSync"],"mappings":";;;;;;;;;;;AAIA;AACO,SAAS,gBAAgB,GAAG;AACnC,EAAE,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACvC,EAAE,IAAI,OAAO,GAAGA,sBAAa,CAACC,qBAAI,CAAC,OAAO,CAAC,yMAAe,CAAC,CAAC,CAAC;AAC7D,EAAE,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC9C,EAAE,OAAO,CAACC,kBAAU,CAAC,YAAY,CAAC,EAAE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAID,qBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,uHAAuH,EAAE,IAAI,CAAC,iBAAiB,EAAEA,qBAAI,CAAC,OAAO,CAAC,yMAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1O,IAAI,OAAO,GAAGA,qBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACpC,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5C,GAAG;AACH,EAAE,OAAO,YAAY,CAAC;AACtB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findStaticConfig.d.ts","sourceRoot":"","sources":["../src/findStaticConfig.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,MAAM,CAyBzC"}
|
package/cjs/index.cjs
CHANGED
|
@@ -1,40 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const path = require('node:path');
|
|
5
|
-
const node_url = require('node:url');
|
|
6
|
-
const jsYaml = require('js-yaml');
|
|
7
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
|
-
const _interopDefault = e => e && e.__esModule ? e : {
|
|
9
|
-
default: e
|
|
10
|
-
};
|
|
11
|
-
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
12
|
-
const jsYaml__default = /*#__PURE__*/_interopDefault(jsYaml);
|
|
3
|
+
const semanticReleaseConfig = require('./semanticReleaseConfig.cjs');
|
|
13
4
|
|
|
14
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Runs HCE.Shared and returns a semantic-release "shareable configuration" object.
|
|
7
|
+
*/
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
const glob = "static/.releaserc.yml";
|
|
18
|
-
let dirPath = node_url.fileURLToPath(path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href));
|
|
19
|
-
let combinedPath = path__default.default.join(dirPath, glob);
|
|
20
|
-
while (!node_fs.existsSync(combinedPath)) {
|
|
21
|
-
/* file:// + dirname behavior on Windows. 'root' is empty when 'file://' is present.
|
|
22
|
-
* file:///C:/Repos
|
|
23
|
-
* file:///C:
|
|
24
|
-
* file://
|
|
25
|
-
* .
|
|
26
|
-
*/
|
|
27
|
-
// DEBUG.log(dirPath);
|
|
28
|
-
// DEBUG.log(combinedPath.href);
|
|
29
|
-
/** Throw if we reached root. */
|
|
30
|
-
if (path__default.default.dirname(dirPath) === "") throw new Error(`Failed to get full path for HCE.Shared's shared configuration. HCE.Shared recursively searched parent directories for '${glob}' starting from '${path__default.default.dirname(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)}'`);
|
|
31
|
-
dirPath = path__default.default.dirname(dirPath);
|
|
32
|
-
combinedPath = path__default.default.join(dirPath, glob);
|
|
33
|
-
}
|
|
34
|
-
return combinedPath;
|
|
35
|
-
}
|
|
36
|
-
const options = jsYaml__default.default.load(node_fs.readFileSync(findStaticConfig(), {
|
|
37
|
-
encoding: "utf8"
|
|
38
|
-
}));
|
|
39
|
-
module.exports = options;
|
|
9
|
+
module.exports = semanticReleaseConfig.baseConfig;
|
|
40
10
|
//# sourceMappingURL=index.cjs.map
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":null,"names":[
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":null,"names":[],"mappings":";;;;AAAA;AACA;AACA;;;;"}
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { Options } from "semantic-release";
|
|
2
|
-
declare const options: Options;
|
|
3
1
|
/**
|
|
4
2
|
* Runs HCE.Shared and returns a semantic-release "shareable configuration" object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default options;
|
|
3
|
+
*/
|
|
4
|
+
export { baseConfig as default } from './semanticReleaseConfig.js';
|
|
8
5
|
//# sourceMappingURL=index.d.ts.map
|
package/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;EAEE;AACF,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-release__git.d.cjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const node_fs = require('node:fs');
|
|
4
|
+
const jsYaml = require('js-yaml');
|
|
5
|
+
const findStaticConfig = require('./findStaticConfig.cjs');
|
|
6
|
+
const _interopDefault = e => e && e.__esModule ? e : {
|
|
7
|
+
default: e
|
|
8
|
+
};
|
|
9
|
+
const jsYaml__default = /*#__PURE__*/_interopDefault(jsYaml);
|
|
10
|
+
const defaultPlugins = ['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github'];
|
|
11
|
+
const baseConfig = jsYaml__default.default.load(node_fs.readFileSync(findStaticConfig.findStaticConfig(), {
|
|
12
|
+
encoding: 'utf8'
|
|
13
|
+
}));
|
|
14
|
+
exports.baseConfig = baseConfig;
|
|
15
|
+
exports.defaultPlugins = defaultPlugins;
|
|
16
|
+
//# sourceMappingURL=semanticReleaseConfig.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticReleaseConfig.cjs","sources":["../src/semanticReleaseConfig.ts"],"sourcesContent":null,"names":["jsYaml","readFileSync","findStaticConfig"],"mappings":";;;;;;;;;;AAGY,MAAC,cAAc,GAAG,CAAC,mCAAmC,EAAE,2CAA2C,EAAE,uBAAuB,EAAE,0BAA0B,EAAE;AAC1J,MAAC,UAAU,GAAGA,uBAAM,CAAC,IAAI,CAACC,oBAAY,CAACC,iCAAgB,EAAE,EAAE;AACvE,EAAE,QAAQ,EAAE,MAAM;AAClB,CAAC,CAAC;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticReleaseConfig.d.ts","sourceRoot":"","sources":["../src/semanticReleaseConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG5D,eAAO,MAAM,cAAc,cAK1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAEb,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
const node_console = require('node:console');
|
|
9
|
+
const dotnetHelpers = require('./dotnet/dotnetHelpers.cjs');
|
|
10
|
+
const semanticReleaseConfig = require('./semanticReleaseConfig.cjs');
|
|
11
|
+
const setupGitPluginSpec = require('./setupGitPluginSpec.cjs');
|
|
12
|
+
|
|
13
|
+
/** Semantic-Release Config Factory (dotnet)
|
|
14
|
+
* A functional Semantic-Release configuration for dotnet projects
|
|
15
|
+
*
|
|
16
|
+
* extends {@link baseConfig }
|
|
17
|
+
*
|
|
18
|
+
* <-- TABLE OF CONTENTS -->
|
|
19
|
+
* - evaluateProperties
|
|
20
|
+
* - configureDotnetRelease
|
|
21
|
+
* - Insert-Edit Plugins
|
|
22
|
+
* - Append Plugins
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* TODO: options/params for inserts/edits. NOT ready for production. Currently, this can only add Git plugin's options if undefined or one or more is missing.
|
|
28
|
+
* Insert (`array.splice`) and/or configure plugins.\
|
|
29
|
+
* Can be used to...\
|
|
30
|
+
* ...load plugin A before plugin B\
|
|
31
|
+
* ...edit a plugin's existing configuration
|
|
32
|
+
*
|
|
33
|
+
* @param config An instance of {@link Options}
|
|
34
|
+
* @returns a modified copy of {@link config}
|
|
35
|
+
*/
|
|
36
|
+
function insertAndEditPlugins(config) {
|
|
37
|
+
const newConfig = config;
|
|
38
|
+
// const insertAndEditCommands = [];
|
|
39
|
+
newConfig.plugins = [...(config.plugins ?? semanticReleaseConfig.defaultPlugins)];
|
|
40
|
+
newConfig.plugins = setupGitPluginSpec.setupGitPluginSpec(newConfig.plugins);
|
|
41
|
+
return newConfig;
|
|
42
|
+
}
|
|
43
|
+
function appendPlugins(config, projectsToPublish, projectsToPackAndPush) {
|
|
44
|
+
const newConfig = config;
|
|
45
|
+
if (newConfig.plugins === undefined) throw new Error('Plugins array was undefined when it should be an array!');
|
|
46
|
+
newConfig.plugins.push(
|
|
47
|
+
// APPEND this array of [pluginName, pluginConfig] to plugins
|
|
48
|
+
// https://github.com/semantic-release/exec#usage
|
|
49
|
+
['@semantic-release/exec', {
|
|
50
|
+
// 'ZipPublishDir' zips each publish folder to ./publish/*.zip
|
|
51
|
+
prepareCmd: dotnetHelpers.configurePrepareCmd(projectsToPublish, projectsToPackAndPush),
|
|
52
|
+
publishCmd: dotnetHelpers.configureDotnetNugetPush()
|
|
53
|
+
}]);
|
|
54
|
+
return newConfig;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @type {import("semantic-release").Options}
|
|
59
|
+
*/
|
|
60
|
+
function getConfig(projectsToPublish, projectsToPackAndPush) {
|
|
61
|
+
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
62
|
+
node_console.log(`hce.shared-config:\n${JSON.stringify(semanticReleaseConfig.baseConfig, null, 2)}`);
|
|
63
|
+
}
|
|
64
|
+
let newConfig = _objectSpread({}, semanticReleaseConfig.baseConfig);
|
|
65
|
+
newConfig = insertAndEditPlugins(newConfig);
|
|
66
|
+
newConfig = appendPlugins(newConfig, projectsToPublish, projectsToPackAndPush);
|
|
67
|
+
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
68
|
+
node_console.log(`modified plugins array:\n${JSON.stringify(newConfig.plugins, null, 2)}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.appendPlugins = appendPlugins;
|
|
72
|
+
exports.getConfig = getConfig;
|
|
73
|
+
exports.insertAndEditPlugins = insertAndEditPlugins;
|
|
74
|
+
//# sourceMappingURL=semanticReleaseConfigDotnet.cjs.map
|