@halospv3/hce.shared-config 2.6.4 → 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.
Files changed (152) hide show
  1. package/CHANGELOG.md +356 -101
  2. package/README.md +100 -87
  3. package/dotnet/.github/workflows/_unit_test.yml +6 -3
  4. package/dotnet/.github/workflows/ci.yml +2 -2
  5. package/dotnet/.github/workflows/dotnet-release.yml +31 -28
  6. package/dotnet/.github/workflows/sample-dotnet-build.yml +16 -11
  7. package/dotnet/ExecNupkgDeterministicator.README.md +20 -0
  8. package/dotnet/ExecNupkgDeterministicator.targets +173 -0
  9. package/dotnet/GitVersion.yml +3 -1
  10. package/dotnet/GitVersion6.0.yml +3 -1
  11. package/dotnet/HCE.Shared.sln +34 -0
  12. package/dotnet/HCE.Shared.targets +1 -0
  13. package/dotnet/PublishAll.targets +2 -0
  14. package/dotnet/SignAfterPack.targets +104 -0
  15. package/dotnet/samples/HCE.Shared.DeterministicNupkg/Dummy.cs +6 -0
  16. package/dotnet/samples/HCE.Shared.DeterministicNupkg/HCE.Shared.DeterministicNupkg.csproj +21 -0
  17. package/dotnet/samples/HCE.Shared.SignAfterPack/Class1.cs +6 -0
  18. package/dotnet/samples/HCE.Shared.SignAfterPack/HCE.Shared.SignAfterPack.csproj +21 -0
  19. package/dotnet/samples/HCE.Shared.SignAfterPack/sampleCert.samplepfx +0 -0
  20. package/dotnet/samples/README.md +7 -0
  21. package/package.json +72 -73
  22. package/src/CaseInsensitiveMap.ts +34 -0
  23. package/src/commitlintConfig.ts +17 -9
  24. package/src/debug.ts +3 -3
  25. package/src/dotnet/GithubNugetRegistryInfo.ts +60 -0
  26. package/src/dotnet/GitlabNugetRegistryInfo.ts +112 -0
  27. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
  28. package/src/dotnet/MSBuildProject.ts +557 -76
  29. package/src/dotnet/MSBuildProjectProperties.ts +280 -15
  30. package/src/dotnet/NugetProjectProperties.ts +608 -0
  31. package/src/dotnet/NugetRegistryInfo.ts +939 -0
  32. package/src/dotnet/helpers.ts +448 -0
  33. package/src/eslintConfig.ts +174 -71
  34. package/src/index.ts +1 -3
  35. package/src/semantic-release__commit-analyzer.d.ts +44 -38
  36. package/src/semantic-release__exec.d.ts +15 -0
  37. package/src/semantic-release__git.d.ts +85 -88
  38. package/src/semantic-release__github.d.ts +139 -139
  39. package/src/semanticReleaseConfig.ts +106 -47
  40. package/src/semanticReleaseConfigDotnet.ts +394 -104
  41. package/src/setupGitPluginSpec.ts +149 -57
  42. package/src/tsconfig.json +8 -8
  43. package/src/utils/Exact.ts +49 -0
  44. package/src/utils/GracefulRecursion.d.ts +12 -0
  45. package/src/utils/env.ts +44 -0
  46. package/src/utils/execAsync.ts +77 -0
  47. package/src/utils/miscTypes.ts +17 -0
  48. package/src/utils/reflection/FunctionLike.d.ts +17 -0
  49. package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
  50. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
  51. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
  52. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
  53. package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
  54. package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
  55. package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
  56. package/src/utils/reflection/filterForGetters.ts +59 -0
  57. package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
  58. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
  59. package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
  60. package/src/utils/reflection/getPrototypeOf.ts +12 -0
  61. package/src/utils/reflection/inheritance.ts +262 -0
  62. package/src/utils/reflection/isConstructor.ts +74 -0
  63. package/src/utils/reflection/isGetterDescriptor.ts +11 -0
  64. package/src/utils/reflection/listOwnGetters.ts +80 -0
  65. package/src/utils/reflection.ts +18 -0
  66. package/cjs/commitlintConfig-wrapper.mjs +0 -6
  67. package/cjs/commitlintConfig.cjs +0 -14
  68. package/cjs/commitlintConfig.cjs.map +0 -1
  69. package/cjs/commitlintConfig.d.ts +0 -4
  70. package/cjs/commitlintConfig.d.ts.map +0 -1
  71. package/cjs/debug.cjs +0 -13
  72. package/cjs/debug.cjs.map +0 -1
  73. package/cjs/debug.d.ts +0 -4
  74. package/cjs/debug.d.ts.map +0 -1
  75. package/cjs/dotnet/MSBuildProject.cjs +0 -84
  76. package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
  77. package/cjs/dotnet/MSBuildProject.d.ts +0 -42
  78. package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
  79. package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
  80. package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
  81. package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
  82. package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
  83. package/cjs/dotnet/createDummyNupkg.cjs +0 -26
  84. package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
  85. package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
  86. package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
  87. package/cjs/dotnet/dotnetGHPR.cjs +0 -173
  88. package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
  89. package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
  90. package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
  91. package/cjs/dotnet/dotnetGLPR.cjs +0 -41
  92. package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
  93. package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
  94. package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
  95. package/cjs/dotnet/dotnetHelpers.cjs +0 -141
  96. package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
  97. package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
  98. package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
  99. package/cjs/dotnet-wrapper.mjs +0 -6
  100. package/cjs/dotnet.cjs +0 -15
  101. package/cjs/dotnet.cjs.map +0 -1
  102. package/cjs/dotnet.d.ts +0 -7
  103. package/cjs/dotnet.d.ts.map +0 -1
  104. package/cjs/envUtils-wrapper.mjs +0 -6
  105. package/cjs/envUtils.cjs +0 -37
  106. package/cjs/envUtils.cjs.map +0 -1
  107. package/cjs/envUtils.d.ts +0 -15
  108. package/cjs/envUtils.d.ts.map +0 -1
  109. package/cjs/eslintConfig-wrapper.mjs +0 -6
  110. package/cjs/eslintConfig.cjs +0 -52
  111. package/cjs/eslintConfig.cjs.map +0 -1
  112. package/cjs/eslintConfig.d.ts +0 -3
  113. package/cjs/eslintConfig.d.ts.map +0 -1
  114. package/cjs/findStaticConfig-wrapper.mjs +0 -6
  115. package/cjs/findStaticConfig.cjs +0 -34
  116. package/cjs/findStaticConfig.cjs.map +0 -1
  117. package/cjs/findStaticConfig.d.ts +0 -2
  118. package/cjs/findStaticConfig.d.ts.map +0 -1
  119. package/cjs/index-wrapper.mjs +0 -6
  120. package/cjs/index.cjs +0 -10
  121. package/cjs/index.cjs.map +0 -1
  122. package/cjs/index.d.ts +0 -5
  123. package/cjs/index.d.ts.map +0 -1
  124. package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
  125. package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
  126. package/cjs/semantic-release__git.d.cjs +0 -2
  127. package/cjs/semantic-release__git.d.cjs.map +0 -1
  128. package/cjs/semantic-release__github.d.cjs +0 -2
  129. package/cjs/semantic-release__github.d.cjs.map +0 -1
  130. package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
  131. package/cjs/semanticReleaseConfig.cjs +0 -33
  132. package/cjs/semanticReleaseConfig.cjs.map +0 -1
  133. package/cjs/semanticReleaseConfig.d.ts +0 -4
  134. package/cjs/semanticReleaseConfig.d.ts.map +0 -1
  135. package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
  136. package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
  137. package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
  138. package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
  139. package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
  140. package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
  141. package/cjs/setupGitPluginSpec.cjs +0 -67
  142. package/cjs/setupGitPluginSpec.cjs.map +0 -1
  143. package/cjs/setupGitPluginSpec.d.ts +0 -19
  144. package/cjs/setupGitPluginSpec.d.ts.map +0 -1
  145. package/src/dotnet/createDummyNupkg.ts +0 -30
  146. package/src/dotnet/dotnetGHPR.ts +0 -232
  147. package/src/dotnet/dotnetGLPR.ts +0 -46
  148. package/src/dotnet/dotnetHelpers.ts +0 -184
  149. package/src/dotnet.ts +0 -6
  150. package/src/envUtils.ts +0 -36
  151. package/src/findStaticConfig.ts +0 -31
  152. package/static/.releaserc.yml +0 -35
@@ -1,145 +1,145 @@
1
- declare module "@semantic-release/github" {
2
- /**
3
- * @see https://github.com/semantic-release/github#configuration
4
- */
5
- export interface Env extends NodeJS.ProcessEnv {
6
- /**
7
- * __Required__. The token used to authenticate with GitHub.
8
- */
9
- GITHUB_TOKEN?: string,
10
- /**
11
- * {@inheritDoc GitHubEnv.GITHUB_TOKEN}
12
- */
13
- GH_TOKEN?: string,
1
+ declare module '@semantic-release/github' {
2
+ /**
3
+ * @see https://github.com/semantic-release/github#configuration
4
+ */
5
+ export interface Env extends NodeJS.ProcessEnv {
6
+ /**
7
+ * __Required__. The token used to authenticate with GitHub.
8
+ */
9
+ GITHUB_TOKEN?: string;
10
+ /**
11
+ * {@inheritDoc GitHubEnv.GITHUB_TOKEN}
12
+ */
13
+ GH_TOKEN?: string;
14
14
 
15
- /**
16
- * The GitHub server endpoint.
17
- */
18
- GITHUB_URL?: string,
19
- /**
20
- * {@inheritDoc GitHubEnv.GITHUB_URL}
21
- */
22
- GH_URL?: string,
15
+ /**
16
+ * The GitHub server endpoint.
17
+ */
18
+ GITHUB_URL?: string;
19
+ /**
20
+ * {@inheritDoc GitHubEnv.GITHUB_URL}
21
+ */
22
+ GH_URL?: string;
23
23
 
24
- /**
25
- * The GitHub API prefix, relative to {@link Env.GITHUB_URL GITHUB_URL}.
26
- */
27
- GITHUB_PREFIX?: string,
28
- /** {@inheritDoc GitHubEnv.GITHUB_PREFIX} */
29
- GH_PREFIX?: string,
24
+ /**
25
+ * The GitHub API prefix, relative to {@link Env.GITHUB_URL GITHUB_URL}.
26
+ */
27
+ GITHUB_PREFIX?: string;
28
+ /** {@inheritDoc GitHubEnv.GITHUB_PREFIX} */
29
+ GH_PREFIX?: string;
30
30
 
31
- /**
32
- * The GitHub API endpoint. Note that this overwrites {@link Env.GITHUB_PREFIX GITHUB_PREFIX}.
33
- */
34
- GITHUB_API_URL?: string
35
- }
31
+ /**
32
+ * The GitHub API endpoint. Note that this overwrites {@link Env.GITHUB_PREFIX GITHUB_PREFIX}.
33
+ */
34
+ GITHUB_API_URL?: string;
35
+ }
36
36
 
37
- /** https://github.com/isaacs/node-glob#glob-primer */
38
- type Glob = string;
37
+ /** https://github.com/isaacs/node-glob#glob-primer */
38
+ type Glob = string;
39
39
 
40
- /** @see https://github.com/semantic-release/github#assets */
41
- interface Asset {
42
- /** __Required__. A {@link https://github.com/isaacs/node-glob#glob-primer glob} to identify the files to upload. */
43
- path: Glob,
44
- /**
45
- * The name of the downloadable file on the GitHub release.
46
- * @defaultValue File name extracted from the {@link Asset.path path}.
47
- */
48
- name?: string,
49
- /** Short description of the file displayed on the GitHub release. */
50
- label?: string
51
- }
40
+ /** @see https://github.com/semantic-release/github#assets */
41
+ interface Asset {
42
+ /** __Required__. A {@link https://github.com/isaacs/node-glob#glob-primer glob} to identify the files to upload. */
43
+ path: Glob;
44
+ /**
45
+ * The name of the downloadable file on the GitHub release.
46
+ * Defaults to the file name extracted from the {@link Asset.path}.
47
+ */
48
+ name?: string;
49
+ /** Short description of the file displayed on the GitHub release. */
50
+ label?: string;
51
+ }
52
52
 
53
- /** @see https://github.com/semantic-release/github#configuration */
54
- export interface Options {
55
- /**
56
- * The GitHub server endpoint.
57
- * @defaultValue {@link Env.GH_URL GH_URL} or {@link Env.GITHUB_URL GITHUB_URL} environment variables.
58
- */
59
- githubUrl?: string,
60
- /**
61
- * The GitHub API prefix, relative to `githubUrl`.
62
- * @defaultValue {@link Env.GH_PREFIX GH_PREFIX} or {@link Env.GITHUB_PREFIX GITHUB_PREFIX} environment variables
63
- */
64
- githubApiPathPrefix?: string,
65
- /**
66
- * The GitHub API endpoint.
67
- * Note that this overwrites {@link Options.githubApiPathPrefix githubApiPathPrefix}.
68
- */
69
- githubApiUrl?: string,
70
- /**
71
- * The proxy to use to access the GitHub API.
72
- * Set to `false` to disable usage of proxy.
73
- * See {@link https://github.com/semantic-release/github#proxy proxy}.
74
- */
75
- proxy?: string | false,
76
- /**
77
- * An array of files to upload to the release.
78
- * See {@link https://github.com/semantic-release/github#assets assets}.
79
- */
80
- assets?: Glob | (Asset | Glob)[],
81
- /**
82
- * The comment to add to each issue and pull request resolved by the release.
83
- * Set to `false` to disable commenting on issues and pull requests.
84
- * See {@link https://github.com/semantic-release/github?tab=readme-ov-file#successcomment successComment}.
85
- * @defaultValue `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)`
86
- */
87
- successComment?: string | false,
88
- /**
89
- * The content of the issue created when a release fails.
90
- * Set to `false` to disable opening an issue when a release fails.
91
- * See {@link https://github.com/semantic-release/github?tab=readme-ov-file#failcomment failComment}.
92
- * @defaultValue Friendly message with links to semantic-release documentation and support, with the list of errors that caused the release to fail.
93
- */
94
- failComment?: string | false,
95
- /**
96
- * The title of the issue created when a release fails.
97
- * Set to `false` to disable opening an issue when a release fails.
98
- * @defaultValue `The automated release is failing 🚨`
99
- */
100
- failTitle?: string | false,
101
- /**
102
- * The {@link https://help.github.com/articles/about-labels labels} to add to the issue created when a release fails.
103
- * Set to `false` to not add any label.
104
- * @default ['semantic-release']
105
- */
106
- labels?: string[] | false,
107
- /**
108
- * The {@link https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users assignees} to add to the issue created when a release fails.
109
- */
110
- assignees?: unknown,
111
- /**
112
- * The {@link https://help.github.com/articles/about-labels labels} to add to each issue and pull request resolved by the release.
113
- * Set to `false` to not add any label.
114
- * See {@link https://github.com/semantic-release/github#releasedlabels releasedLabels}.
115
- * @default [ 'released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>' ]
116
- */
117
- releasedLabels?: string[],
118
- /**
119
- * Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See {@link https://github.com/semantic-release/github#addReleases addReleases}.
120
- * @default false
121
- */
122
- addReleases?: false | "bottom" | "top",
123
- /**
124
- * A boolean indicating if a GitHub Draft Release should be created instead of publishing an actual GitHub Release.
125
- * @default false
126
- */
127
- draftRelease?: boolean,
128
- /**
129
- * A {@link https://lodash.com/docs#template Lodash template} to customize the github release's name
130
- * @default '<%= nextverison.name %>'
131
- */
132
- releaseNameTemplate?: string,
133
- /**
134
- * A {@link https://lodash.com/docs#template Lodash template} to customize the github release's body
135
- * @default '<%= nextverison.notes %>'
136
- */
137
- releaseBodyTemplate?: string,
138
- /**
139
- * The category name in which to create a linked discussion to the release.
140
- * Set to `false` to disable creating discussion for a release.
141
- * @default false
142
- */
143
- discussionCategoryName?: string | false
144
- }
145
- }
53
+ /** @see https://github.com/semantic-release/github#configuration */
54
+ export interface Options {
55
+ /**
56
+ * The GitHub server endpoint.
57
+ * Defaults to the values of the {@link Env.GH_URL GH_URL} or {@link Env.GITHUB_URL GITHUB_URL} environment variables.
58
+ */
59
+ githubUrl?: string;
60
+ /**
61
+ * The GitHub API prefix, relative to `githubUrl`.
62
+ * Defaults to the values of the {@link Env.GH_PREFIX GH_PREFIX} or {@link Env.GITHUB_PREFIX GITHUB_PREFIX} environment variables
63
+ */
64
+ githubApiPathPrefix?: string;
65
+ /**
66
+ * The GitHub API endpoint.
67
+ * Note that this overwrites {@link Options.githubApiPathPrefix githubApiPathPrefix}.
68
+ */
69
+ githubApiUrl?: string;
70
+ /**
71
+ * The proxy to use to access the GitHub API.
72
+ * Set to `false` to disable usage of proxy.
73
+ * See {@link https://github.com/semantic-release/github#proxy proxy}.
74
+ */
75
+ proxy?: string | false;
76
+ /**
77
+ * An array of files to upload to the release.
78
+ * See {@link https://github.com/semantic-release/github#assets assets}.
79
+ */
80
+ assets?: Glob | (Asset | Glob)[];
81
+ /**
82
+ * The comment to add to each issue and pull request resolved by the release.
83
+ * Set to `false` to disable commenting on issues and pull requests.
84
+ * See {@link https://github.com/semantic-release/github?tab=readme-ov-file#successcomment successComment}.
85
+ * Defaults to `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)`
86
+ */
87
+ successComment?: string | false;
88
+ /**
89
+ * The content of the issue created when a release fails.
90
+ * Set to `false` to disable opening an issue when a release fails.
91
+ * See {@link https://github.com/semantic-release/github?tab=readme-ov-file#failcomment failComment}.
92
+ * Defaults to a friendly message with links to semantic-release documentation and support, with the list of errors that caused the release to fail.
93
+ */
94
+ failComment?: string | false;
95
+ /**
96
+ * The title of the issue created when a release fails.
97
+ * Set to `false` to disable opening an issue when a release fails.
98
+ * Defaults to `The automated release is failing 🚨`
99
+ */
100
+ failTitle?: string | false;
101
+ /**
102
+ * The {@link https://help.github.com/articles/about-labels labels} to add to the issue created when a release fails.
103
+ * Set to `false` to not add any label.
104
+ * @default ['semantic-release']
105
+ */
106
+ labels?: string[] | false;
107
+ /**
108
+ * The {@link https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users assignees} to add to the issue created when a release fails.
109
+ */
110
+ assignees?: unknown;
111
+ /**
112
+ * The {@link https://help.github.com/articles/about-labels labels} to add to each issue and pull request resolved by the release.
113
+ * Set to `false` to not add any label.
114
+ * See {@link https://github.com/semantic-release/github#releasedlabels releasedLabels}.
115
+ * @default [ 'released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>' ]
116
+ */
117
+ releasedLabels?: string[];
118
+ /**
119
+ * Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See {@link https://github.com/semantic-release/github#addReleases addReleases}.
120
+ * @default false
121
+ */
122
+ addReleases?: false | 'bottom' | 'top';
123
+ /**
124
+ * A boolean indicating if a GitHub Draft Release should be created instead of publishing an actual GitHub Release.
125
+ * @default false
126
+ */
127
+ draftRelease?: boolean;
128
+ /**
129
+ * A {@link https://lodash.com/docs#template Lodash template} to customize the github release's name
130
+ * @default '<%= nextRelease.name %>'
131
+ */
132
+ releaseNameTemplate?: string;
133
+ /**
134
+ * A {@link https://lodash.com/docs#template Lodash template} to customize the github release's body
135
+ * @default '<%= nextRelease.notes %>'
136
+ */
137
+ releaseBodyTemplate?: string;
138
+ /**
139
+ * The category name in which to create a linked discussion to the release.
140
+ * Set to `false` to disable creating discussion for a release.
141
+ * @default false
142
+ */
143
+ discussionCategoryName?: string | false;
144
+ }
145
+ }
@@ -1,52 +1,111 @@
1
- import type { Options as GitOptions } from '@semantic-release/git';
2
- import type { Options as GithubOptions } from '@semantic-release/github';
1
+ import type { Options as SRCommitAnalyzerOptions } from '@semantic-release/commit-analyzer';
2
+ import type { Options as SRExecOptions } from '@semantic-release/exec';
3
+ import type { Options as SRGitOptions } from '@semantic-release/git';
4
+ import type { Options as SRGithubOptions } from '@semantic-release/github';
3
5
  import type { Options, PluginSpec } from 'semantic-release';
4
6
  import { DefaultOptions } from './setupGitPluginSpec.js';
5
7
 
6
- export const defaultPlugins: readonly PluginSpec[] = [
7
- '@semantic-release/commit-analyzer',
8
- '@semantic-release/release-notes-generator',
9
- '@semantic-release/npm',
10
- '@semantic-release/github',
11
- ];
8
+ export interface SRReleaseNotesGeneratorOptions {
9
+ /**
10
+ * conventional-changelog preset.
11
+ * @default 'angular'
12
+ */
13
+ preset?: 'angular' | 'atom' | 'codemirror' | 'ember' | 'eslint' | 'express' | 'jquery' | 'jscs' | 'jshint' | 'conventionalcommits' | (string & Record<never, never>) | undefined;
14
+ /**
15
+ * Requireable npm package with a custom conventional-changelog preset.
16
+ */
17
+ config?: string | undefined;
18
+ /**
19
+ * Additional `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`.
20
+ */
21
+ parserOpts: object;
22
+ /**
23
+ * Additional `conventional-changelog-writer` options that will overwrite ones loaded by `preset` or `config`.
24
+ */
25
+ writerOpts: object;
26
+ }
12
27
 
13
- export const baseConfig = {
14
- /** @see https://semantic-release.gitbook.io/semantic-release/usage/plugins#plugin-options-configuration */
15
- preset: 'conventionalcommits',
16
- branches: [
17
- 'main',
18
- {
19
- name: 'develop',
20
- channel: 'develop',
21
- prerelease: true
22
- }
23
- ],
24
- plugins: [
25
- ["@semantic-release/commit-analyzer", {}],
26
- ["semantic-release-export-data", {}],
27
- ["@semantic-release/release-notes-generator", {}],
28
- ["@semantic-release/changelog", {}],
29
- [
30
- "@semantic-release/git",
31
- DefaultOptions
32
- ] as PluginSpec<GitOptions>,
33
- // Arbitrary shell commands - https://github.com/semantic-release/exec
34
- // hint: set 'prepareCmd' to`dotnet publish`.
35
- // Because this is sorted after @semantic-release / git, the new Git tag will
36
- // be visible to dotnet(and GitVersion).Dotnet artifacts will be
37
- // versioned accordingly.
38
- // Plugins' Steps: https://github.com/semantic-release/semantic-release/blob/master/docs/extending/plugins-list.md
39
- ["@semantic-release/exec", {}],
40
- ["@semantic-release/github",
41
- {
42
- assets: [{
43
- path: './publish/*'
44
- }]
45
- }
46
- ] as PluginSpec<GithubOptions>
47
- ]
48
- } as Options;
28
+ /**
29
+ * A two-type PluginSpec to tie a plugin's name to its Options type. This is
30
+ * intended for use by plugins to associate their Options type with their plugin
31
+ * name.
32
+ */
33
+ export type PluginSpecTuple<P extends string = string, T = unknown> = [P, T];
34
+ export type PluginSpecSRCommitAnalyzer<V extends SRCommitAnalyzerOptions = SRCommitAnalyzerOptions> = PluginSpecTuple<'@semantic-release/commit-analyzer', V>;
35
+ export type PluginSpecSRChangelog<V extends Record<'changelogFile' | 'changelogTitle', string>> = PluginSpecTuple<'@semantic-release/changelog', V>;
36
+ export type PluginSpecExportData<V extends Record<string, unknown> = Record<string, unknown>> = PluginSpecTuple<'semantic-release-export-data', V>;
37
+ export type PluginSpecSRReleaseNotesGen<V extends SRReleaseNotesGeneratorOptions = SRReleaseNotesGeneratorOptions> = PluginSpecTuple<'@semantic-release/release-notes-generator', V>;
38
+ export type PluginSpecSRExec<V extends SRExecOptions = SRExecOptions> = PluginSpecTuple<'@semantic-release/exec', V>;
39
+ export type PluginSpecSRGit<V extends SRGitOptions = SRGitOptions> = PluginSpecTuple<'@semantic-release/git', V>;
40
+ export type PluginSpecSRGithub<V extends SRGithubOptions = SRGithubOptions> = PluginSpecTuple<'@semantic-release/github', V>;
49
41
 
50
- /// (OPTIONAL) update static Version strings before Git plugin
51
- // https://github.com/jpoehnelt/semantic-release-replace-plugin
52
- // https://github.com/droidsolutions/semantic-release-update-file
42
+ /**
43
+ * @satisfies { Readonly<PluginSpec[]> }
44
+ */
45
+ export const defaultPlugins = Object.freeze([
46
+ '@semantic-release/commit-analyzer',
47
+ '@semantic-release/release-notes-generator',
48
+ '@semantic-release/npm',
49
+ '@semantic-release/github',
50
+ ] as const) satisfies readonly PluginSpec[];
51
+
52
+ // define as const for string literals in type, then...
53
+ /**
54
+ * @see baseConfig
55
+ */
56
+ const _baseConfig = {
57
+ /** @see https://semantic-release.gitbook.io/semantic-release/usage/plugins#plugin-options-configuration */
58
+ preset: 'conventionalcommits' as const,
59
+ branches: [
60
+ 'main',
61
+ { name: 'develop', channel: 'develop', prerelease: true },
62
+ ] as ['main', { name: 'develop'; channel: 'develop'; prerelease: true }],
63
+ plugins: [
64
+ ['@semantic-release/commit-analyzer', {}],
65
+ ['semantic-release-export-data', {}],
66
+ ['@semantic-release/release-notes-generator', {}],
67
+ ['@semantic-release/changelog', {}],
68
+ ['@semantic-release/git', DefaultOptions],
69
+ ['@semantic-release/exec', {}],
70
+ ['@semantic-release/github', { addReleases: 'bottom', assets: [{ path: './publish/*' }] }],
71
+ ] as [
72
+ PluginSpecSRCommitAnalyzer,
73
+ PluginSpecExportData,
74
+ PluginSpecSRReleaseNotesGen,
75
+ PluginSpecSRChangelog<Record<'changelogFile' | 'changelogTitle', string>>,
76
+ PluginSpecSRGit<typeof DefaultOptions>,
77
+ PluginSpecSRExec,
78
+ PluginSpecSRGithub<{ addReleases: 'bottom'; assets: [{ path: './publish/*' }] }>,
79
+ ] | PluginSpec[],
80
+ };
81
+
82
+ /**
83
+ * The base configuration for various Semantic Release scenarios.
84
+ * - Prefers preset "conventionalcommits"
85
+ * (Conventional-Changelog-ConventionalCommits).
86
+ * - Creates tags and release commits on "main" branch, pre-releases on
87
+ * "develop" branch in "develop" channel.
88
+ * - Creates GitHub Releases.
89
+ * - Exports the following variables as GitHub Actions outputs:
90
+ * - "new-release-published": "true" | "false"
91
+ * - "new-release-version" : string
92
+ * - "new-release-git-tag" : string
93
+ * - includes default plugins (except `@semantic-release/npm`) and more
94
+ * - `@semantic-release/commit-analyzer`
95
+ * - semantic-release-export-data
96
+ * - `@semantic-release/release-notes-generator`
97
+ * - `@semantic-release/changelog`
98
+ * - `@semantic-release/git`
99
+ * - add modified CHANGELOG.md in release commit
100
+ * - `@semantic-release/exec`
101
+ * - does nothing by default. Included for convenience.
102
+ * - `@semantic-release/github`
103
+ * - uploads all files from `./publish/*`. This is non-recursive.
104
+ * - adds a list of links to related release pages (e.g. the release's page on npmjs.com)
105
+ *
106
+ * (OPTIONAL) update static Version strings before Git plugin
107
+ * - https://github.com/jpoehnelt/semantic-release-replace-plugin
108
+ * - https://github.com/droidsolutions/semantic-release-update-file
109
+ * @satisfies {Options}
110
+ */
111
+ export const baseConfig: typeof _baseConfig = _baseConfig satisfies Options;