@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,75 @@
|
|
|
1
|
+
import type { PluginSpec } from 'semantic-release';
|
|
2
|
+
import type { AssetEntry, Options as GitOptions } from '@semantic-release/git';
|
|
3
|
+
|
|
4
|
+
export const GitPluginId = '@semantic-release/git';
|
|
5
|
+
export const DefaultOptions = {
|
|
6
|
+
assets: ['CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'],
|
|
7
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
8
|
+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
|
|
9
|
+
} satisfies GitOptions;
|
|
10
|
+
|
|
11
|
+
function gitAssetsToArray(assets: AssetEntry | AssetEntry[] | false | undefined) {
|
|
12
|
+
if (assets === undefined || assets === false) return [];
|
|
13
|
+
if (Array.isArray(assets)) return assets;
|
|
14
|
+
if (typeof assets === 'string') return [assets];
|
|
15
|
+
return assets.path === 'string' ? [assets.path] : [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* https://github.com/semantic-release/git#options
|
|
20
|
+
*
|
|
21
|
+
* This plugin may be deprecated at a later date.
|
|
22
|
+
* Why do you need to commit during release?
|
|
23
|
+
* If you don't need to update a changelog or version in a file, then you don't need this.
|
|
24
|
+
*
|
|
25
|
+
* @returns A {@link PluginSpec} array with {@link PluginSpec<GitOptions>}. If Git plugin not in original array, returns the original array.
|
|
26
|
+
* todo: deprecate for generic or parameterized function
|
|
27
|
+
*/
|
|
28
|
+
export function setupGitPluginSpec(plugins: PluginSpec[]): PluginSpec[] {
|
|
29
|
+
let newPlugins = plugins;
|
|
30
|
+
let gitPluginIndex = -1;
|
|
31
|
+
|
|
32
|
+
function pluginSpecIsGit(pluginSpec: PluginSpec, pluginSpecIndex: number) {
|
|
33
|
+
if (pluginSpec === GitPluginId || pluginSpec[0] === GitPluginId) {
|
|
34
|
+
gitPluginIndex = pluginSpecIndex;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// if Git plugin not in load order, return as-is.
|
|
41
|
+
if (!newPlugins.some(pluginSpecIsGit)) return plugins;
|
|
42
|
+
|
|
43
|
+
// if string, replace with tuple with default options.
|
|
44
|
+
newPlugins = newPlugins.map((plugin) =>
|
|
45
|
+
plugin === GitPluginId ? [GitPluginId, DefaultOptions] : plugin,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// ensure assets is an array
|
|
49
|
+
(newPlugins[gitPluginIndex][1] as GitOptions).assets = gitAssetsToArray(
|
|
50
|
+
(newPlugins[gitPluginIndex][1] as GitOptions).assets,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const discardPile: number[] = [];
|
|
54
|
+
|
|
55
|
+
// de-duplicate Git plugin entries; assign single entry to newPlugins[gitPluginIndex]
|
|
56
|
+
newPlugins.forEach((current, i) => {
|
|
57
|
+
if (i > gitPluginIndex && pluginSpecIsGit(current, gitPluginIndex)) {
|
|
58
|
+
// convert its assets to an array
|
|
59
|
+
const { assets } = newPlugins[i][1] as GitOptions;
|
|
60
|
+
const { message } = newPlugins[i][1] as GitOptions;
|
|
61
|
+
// push unique assets to first entry's assets array
|
|
62
|
+
if (assets !== undefined)
|
|
63
|
+
((newPlugins[gitPluginIndex][1] as GitOptions).assets as AssetEntry[]).push(
|
|
64
|
+
...gitAssetsToArray(assets),
|
|
65
|
+
);
|
|
66
|
+
if (message !== undefined) (newPlugins[gitPluginIndex][1] as GitOptions).message = message;
|
|
67
|
+
discardPile.push(i);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
for (const i of discardPile.sort().reverse()) {
|
|
71
|
+
newPlugins.splice(i, 1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return newPlugins;
|
|
75
|
+
}
|
package/static/.releaserc.yml
CHANGED
|
@@ -22,7 +22,7 @@ plugins: # https://semantic-release.gitbook.io/semantic-release/v/beta/usage/con
|
|
|
22
22
|
- CHANGELOG.md
|
|
23
23
|
# Arbitrary shell commands - https://github.com/semantic-release/exec
|
|
24
24
|
# hint: set 'prepareCmd' to `dotnet publish`.
|
|
25
|
-
# Because this is sorted after @semantic-release/git, the new Git tag will
|
|
25
|
+
# Because this is sorted after @semantic-release/git, the new Git tag will
|
|
26
26
|
# be visible to dotnet (and GitVersion). Dotnet artifacts will be
|
|
27
27
|
# versioned accordingly.
|
|
28
28
|
# Plugins' Steps: https://github.com/semantic-release/semantic-release/blob/master/docs/extending/plugins-list.md
|
|
@@ -30,7 +30,6 @@ plugins: # https://semantic-release.gitbook.io/semantic-release/v/beta/usage/con
|
|
|
30
30
|
- - "@semantic-release/github"
|
|
31
31
|
- assets:
|
|
32
32
|
- path: ./publish/*
|
|
33
|
-
|
|
34
|
-
## (OPTIONAL) update static Version strings.
|
|
33
|
+
## (OPTIONAL) update static Version strings before Git plugin
|
|
35
34
|
# https://github.com/jpoehnelt/semantic-release-replace-plugin
|
|
36
35
|
# https://github.com/droidsolutions/semantic-release-update-file
|
package/commitlint.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RuleConfigSeverity, type UserConfig } from "@commitlint/types";
|
|
2
|
-
const commitlint: UserConfig = {
|
|
3
|
-
extends: ["@commitlint/config-conventional"],
|
|
4
|
-
rules: {
|
|
5
|
-
"body-max-line-length": [RuleConfigSeverity.Disabled],
|
|
6
|
-
"footer-max-line-length": [RuleConfigSeverity.Disabled],
|
|
7
|
-
"header-max-length": [RuleConfigSeverity.Disabled]
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
export default commitlint
|
package/dotnet/.releaserc.cjs
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/** Semantic-Release configuration for GroupBox.Avalonia
|
|
2
|
-
* @extends { hceSharedConfig }
|
|
3
|
-
*
|
|
4
|
-
* <-- TABLE OF CONTENTS -->
|
|
5
|
-
* - Insert-Edit Plugins
|
|
6
|
-
* - Append Plugins
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef { object } PluginOptionsGit
|
|
11
|
-
* @prop { string } message
|
|
12
|
-
* @prop {[ string | [string] | {path:string} ]} assets
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @type {import("semantic-release").Options}
|
|
17
|
-
*/
|
|
18
|
-
const hceSharedConfig = require('@halospv3/hce.shared-config')
|
|
19
|
-
if (process.argv.includes("--debug") || process.argv.includes("--verbose")) {
|
|
20
|
-
console.info("hce.shared-config:\n" + JSON.stringify(hceSharedConfig, null, 2))
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @type { typeof hceSharedConfig.plugins }
|
|
24
|
-
*/
|
|
25
|
-
const newPlugins = hceSharedConfig.plugins;
|
|
26
|
-
|
|
27
|
-
//#region Insert-Edit Plugins
|
|
28
|
-
/* Insert and/or configure plugins. Can be used to load plugin A's Prepare step
|
|
29
|
-
before plugin B's Prepare step. or edit a plugin's existing configuration */
|
|
30
|
-
for (var i = 0; i < newPlugins.length; i++) {
|
|
31
|
-
/** e.g.
|
|
32
|
-
//#region Git Options | https://github.com/semantic-release/git#options
|
|
33
|
-
// if defined without plugin options, replace with tuple-like array with assets option defined.
|
|
34
|
-
if (plugins[i] === "@semantic-release/git") {
|
|
35
|
-
plugins[i] = [plugins[i], { assets: ["README.md", "CHANGELOG.md"] }]
|
|
36
|
-
}
|
|
37
|
-
if (plugins[i][0] === "@semantic-release/git") {
|
|
38
|
-
// if assets array undefined, define it
|
|
39
|
-
if (!plugins[i][1].assets) {
|
|
40
|
-
plugins[i][1].assets = [];
|
|
41
|
-
}
|
|
42
|
-
// ensure README.md is in assets array
|
|
43
|
-
if (!plugins[i][1].assets.some(a => a === "README.md" || a.path === "README.md")) {
|
|
44
|
-
plugins[i][1].assets.push("README.md");
|
|
45
|
-
}
|
|
46
|
-
// ensure CHANGELOG.md is in assets array
|
|
47
|
-
if (!plugins[i][1].assets.some(a => a === "CHANGELOG.md" || a.path === "CHANGELOG.md")) {
|
|
48
|
-
plugins[i][1].assets.push("CHANGELOG.md");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
//#endregion Git Options
|
|
52
|
-
*/
|
|
53
|
-
}
|
|
54
|
-
//#endregion Insert-Edit Plugins
|
|
55
|
-
|
|
56
|
-
//#region Append Plugins
|
|
57
|
-
newPlugins.push(
|
|
58
|
-
// APPEND this array of [pluginName, pluginConfig] to plugins
|
|
59
|
-
// https://github.com/semantic-release/exec#usage
|
|
60
|
-
["@semantic-release/exec", {
|
|
61
|
-
// 'ZipPublishDir' zips each publish folder to ./publish/*.zip
|
|
62
|
-
prepareCmd: "dotnet publish ./GroupBox.Avalonia/GroupBox.Avalonia.csproj && dotnet publish ./GroupBox.Avalonia.Sample/GroupBox.Avalonia.Sample.csproj"
|
|
63
|
-
}]
|
|
64
|
-
)
|
|
65
|
-
//#endregion Append Plugins
|
|
66
|
-
|
|
67
|
-
if (process.argv.includes("--debug") || process.argv.includes("--verbose")) {
|
|
68
|
-
console.info("modified plugins array:\n" + JSON.stringify(newPlugins, null, 2))
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @type {import("semantic-release").Options}
|
|
73
|
-
*/
|
|
74
|
-
module.exports = {
|
|
75
|
-
extends: "@halospv3/hce.shared-config",
|
|
76
|
-
plugins: newPlugins
|
|
77
|
-
};
|