@halospv3/hce.shared-config 2.3.2 → 2.4.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.
Files changed (39) hide show
  1. package/README.md +159 -77
  2. package/cjs/debug.cjs +13 -0
  3. package/cjs/debug.cjs.map +1 -0
  4. package/cjs/debug.d.ts +4 -0
  5. package/cjs/debug.d.ts.map +1 -0
  6. package/cjs/dotnet/dotnetHelpers.cjs +83 -87
  7. package/cjs/dotnet/dotnetHelpers.cjs.map +1 -1
  8. package/cjs/dotnet/dotnetHelpers.d.ts +3 -3
  9. package/cjs/dotnet/dotnetHelpers.d.ts.map +1 -1
  10. package/cjs/eslintConfig.cjs +7 -3
  11. package/cjs/eslintConfig.cjs.map +1 -1
  12. package/cjs/eslintConfig.d.ts.map +1 -1
  13. package/cjs/semanticReleaseConfig.cjs +27 -10
  14. package/cjs/semanticReleaseConfig.cjs.map +1 -1
  15. package/cjs/semanticReleaseConfig.d.ts +1 -1
  16. package/cjs/semanticReleaseConfig.d.ts.map +1 -1
  17. package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +2 -1
  18. package/cjs/semanticReleaseConfigDotnet.cjs +53 -21
  19. package/cjs/semanticReleaseConfigDotnet.cjs.map +1 -1
  20. package/cjs/semanticReleaseConfigDotnet.d.ts +22 -4
  21. package/cjs/semanticReleaseConfigDotnet.d.ts.map +1 -1
  22. package/cjs/setupGitPluginSpec.cjs +2 -1
  23. package/cjs/setupGitPluginSpec.cjs.map +1 -1
  24. package/cjs/setupGitPluginSpec.d.ts +1 -0
  25. package/cjs/setupGitPluginSpec.d.ts.map +1 -1
  26. package/dotnet/.github/workflows/_unit_test.yml +0 -2
  27. package/dotnet/.github/workflows/ci.yml +2 -2
  28. package/dotnet/.github/workflows/dotnet-release.yml +9 -23
  29. package/dotnet/.github/workflows/sample-dotnet-build.yml +5 -3
  30. package/dotnet/HCE.Shared.CI.props +1 -1
  31. package/dotnet/HCE.Shared.props +4 -2
  32. package/package.json +3 -3
  33. package/src/debug.ts +9 -0
  34. package/src/dotnet/dotnetHelpers.ts +113 -108
  35. package/src/eslintConfig.ts +5 -1
  36. package/src/semantic-release__git.d.ts +24 -0
  37. package/src/semanticReleaseConfig.ts +46 -8
  38. package/src/semanticReleaseConfigDotnet.ts +68 -23
  39. package/src/setupGitPluginSpec.ts +2 -1
package/README.md CHANGED
@@ -16,6 +16,43 @@ npm install --save-dev @halospv3/hce.shared-config
16
16
 
17
17
  ### 2. Customize Semantic Release
18
18
 
19
+ WARNING! Defining a property will _overwrite_ the previous value. Arrays and
20
+ objects are _not_ merged. You can...
21
+
22
+ - Assign to certain top-level variables (e.g. `options.preset`) to avoid
23
+ modifying the plugins array. Caveat: only *some* plugins read these properties.
24
+ - Write your config in MJS; It is recommended you use
25
+ [deepmerge](https://www.npmjs.com/package/deepmerge) to recursively merge
26
+ objects and arrays instead of using `extends`. Doing so will allow your IDE to
27
+ tell you when a shareable config cannot be found.
28
+
29
+ #### Base Config
30
+
31
+ > - Uses the [conventionalcommits preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits).
32
+ > - Releases `main` branch; Pre-releases `develop`.
33
+ > - Adds and configures [`semantic-release-export-data`](https://github.com/felipecrs/semantic-release-export-data) to export `new-release-published` and `new-release-version` to GitHub Actions' outputs.
34
+ > - Adds and configures [`@semantic-release/changelog`](https://github.com/semantic-release/changelog) to update CHANGELOG.md.
35
+ > - Configures [`@semantic-release/git`](https://github.com/semantic-release/git) to add README.md and CHANGELOG.md in a release commit if they have changes. Uses GitHub job's token to commit.
36
+ > - Configures [`@semantic-release/github`](https://github.com/semantic-release/github) to release all files found in `$PWD/publish`.
37
+
38
+ ##### Usage
39
+
40
+ ```js
41
+ // releaserc.config.js
42
+ import hceSharedConfig from "@halospv3/hce.shared-config"
43
+
44
+ // modify it however you wish before the export statement!
45
+
46
+ export default hceSharedConfig;
47
+ ```
48
+
49
+ ```js
50
+ // releaserc.config.js
51
+ export default {
52
+ extends: ["@halospv3/hce.shared-config"]
53
+ }
54
+ ```
55
+
19
56
  ```json
20
57
  // package.json
21
58
  {
@@ -25,31 +62,104 @@ npm install --save-dev @halospv3/hce.shared-config
25
62
  }
26
63
  ```
27
64
 
28
- WARNING! Defining a property will _overwrite_ the previous value. Arrays and objects are _not_
29
- merged. You can...
65
+ #### Dotnet Config
66
+
67
+ > An extension of our base config.
68
+ > Exports a function with parameters for 'projects to pack' and 'projects to push (to nuget)'.
69
+ > Although `@halospv3/hce.shared-config/semanticReleaseConfigDotnet` can be used
70
+ via `extends` and configured via the `PROJECTS_TO_PUBLISH` and
71
+ `PROJECTS_TO_PACK_AND_PUSH` environment variables, it is recommended to call
72
+ the function and pass it parameters so errors are caught before they reach
73
+ production.
74
+ >
75
+ > Differences to the base config:
76
+ > - Utilizes `@semantic-release/exec` for shell commands.
77
+ > - Executes `dotnet publish` and `dotnet pack` upon the configured projects during the `prepare` step.
78
+ > - (WIP) Executes `dotnet nuget sign` during `prepare` upon the `dotnet pack` outputs if `projectsToPackAndPush` is not set to `false` (default: `[]`).
79
+ > - Executes `dotnet nuget push` during the `publish` step.
80
+
81
+ ##### Usage
82
+
83
+ ```js
84
+ // releaserc.config.js
85
+ import { getConfig } from "@halospv3/hce.shared-config/semanticReleaseConfigDotnet"
86
+
87
+ /* Caveat: semantic-release will version and release all specified projects under the same Git tags and GitHub releases.
88
+ * To version and release them separately, use [https://github.com/pmowrer/semantic-release-monorepo](semantic-release-monorepo).
89
+ */
90
+
91
+ /* `prepareCmd` will contain command lines to publish
92
+ * both Library and Sample to your GitHub release.
93
+ * Their `TargetFrameworks` and `RuntimeIdentifiers`
94
+ * properties will be evaluated and a command line
95
+ * will be added for each unique combination,
96
+ * _regardless of compatibility and intended combinations_.
97
+ */
98
+ const projectsToPublish = [
99
+ "./Library/Library.csproj",
100
+ "./Sample/Sample.csproj"
101
+ ];
102
+ /*
103
+ * `prepareCmd` will also contain `dotnet pack` and
104
+ * `dotnet nuget sign` commands to pack Library to a nupkg.
105
+ * `publishCmd` will contain `dotnet nuget push` commands
106
+ * to push Library to Nuget.org and GitHub Package Registry.
107
+ */
108
+ const projectsToPackAndPush = ["./Library/Library.csproj"];
109
+
110
+ // runs getConfig and exports its return value
111
+ export default getConfig(projectsToPublish, projectsToPackAndPush)
112
+ ```
113
+
114
+ ###### `extends` key in a javascript config file
115
+
116
+ Using `extends` is NOT recommended, but I won't stop you.
117
+ Your projects' paths must be assigned to environment variables. See [Dotnet Config](#dotnet-config).
118
+ ```js
119
+ // releaserc.config.js (if {"type": "module"} in package.json)
120
+ export default {
121
+ extends: ["@halospv3/hce.shared-config"]
122
+ }
123
+ ```
124
+
125
+ ```js
126
+ // releaserc.config.js (if {"type": "commonjs"} in package.json)
127
+ module.exports = {
128
+ extends: ["@halospv3/hce.shared-config"]
129
+ }
130
+ ```
30
131
 
31
- - Assign to top-level variables to avoid modifying the plugins array.
32
- - Write your config in CJS and manually merge objects and arrays.
132
+ ###### `release` key in package.json
33
133
 
34
- **Configs**
134
+ ```json
135
+ // package.json
136
+ // `npm install --save-dev cross-env`
137
+ {
138
+ "scripts":{
139
+ "release":"cross-env PROJECTS_TO_PUBLISH=\"./Library/Library.csproj;./Sample/Sample.csproj\" semantic-release"
140
+ },
141
+ "release": {
142
+ "extends": ["@halospv3/hce.shared-config/semanticReleaseConfigDotnet"]
143
+ }
144
+ }
145
+ ```
35
146
 
36
- - `hce.shared-config`: [static/.releaserc.yml](static/.releaserc.yml)
37
- - [dotnet/.releaserc.cjs](dotnet/.releaserc.cjs) based on [BinToss/GroupBox.Avalonia's Semantic Release config](https://github.com/BinToss/GroupBox.Avalonia).
147
+ ---
38
148
 
39
149
  **Notable Plugin Properties**
40
150
 
41
151
  - [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer#options)
42
- - preset (set to conventionalcommits)
152
+ - preset (set to `conventionalcommits`)
43
153
  - parserOpts
44
154
  - releaseRules
45
155
  - [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator#options)
46
- - preset (set to conventionalcommits)
156
+ - preset (set to `conventionalcommits`)
47
157
  - parserOpts
48
158
  - writerOpts
49
159
  - [`@semantic-release/changelog`](https://github.com/semantic-release/changelog#options)
50
- - changelogFile (default: CHANGELOG.md)
160
+ - changelogFile (default: `'CHANGELOG.md'`)
51
161
  - [`@semantic-release/git`](https://github.com/semantic-release/git#options)
52
- - assets (default: ['CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'])
162
+ - assets (default: `['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json']`)
53
163
  - `@semantic-release/exec`
54
164
  - prepareCmd
55
165
  - [`@semantic-release/github`](https://github.com/semantic-release/github#options)
@@ -62,7 +172,7 @@ merged. You can...
62
172
  // package.json
63
173
  {
64
174
  "commitlint": {
65
- "extends": ["@halospv3/hce.shared-config/commitLintConfig"]
175
+ "extends": ["@halospv3/hce.shared-config/commitlintConfig"]
66
176
  }
67
177
  }
68
178
  ```
@@ -70,11 +180,12 @@ or
70
180
 
71
181
  ```ts
72
182
  /* eslint-disable import/no-default-export */
73
- import commitlintConfig from '@halospv3/hce.shared-config/commitLintConfig';
183
+ import commitlintConfig from '@halospv3/hce.shared-config/commitlintConfig';
74
184
 
75
185
  export default commitlintConfig;
76
186
  ```
77
187
 
188
+ Then...
78
189
  ```sh
79
190
  npx husky
80
191
  npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
@@ -82,52 +193,29 @@ npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
82
193
 
83
194
  ### 4. (dotnet) Add/Edit Directory.Build.props
84
195
 
85
- > Example Directory.Build.props from [BinToss/GroupBox.Avalonia](https://github.com/BinToss/GroupBox.Avalonia)
86
-
87
196
  ```xml
88
197
  <Project>
198
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.targets"/>
199
+
89
200
  <PropertyGroup>
90
201
  <RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
91
202
  <HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
92
- <GitVersion_Path Condition="'$(GitVersion_Path)' == ''">$(HCESharedDir)GitVersion.yml</GitVersion_Path>
93
- <AvaloniaVersion>11.0.10</AvaloniaVersion>
94
- </PropertyGroup>
95
-
96
- <PropertyGroup Condition="'$(CI)' == 'true'">
97
- <Configuration>Release</Configuration>
98
- <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
99
- <Deterministic>true</Deterministic>
100
- </PropertyGroup>
101
-
102
- <Import Project="$(HCESharedDir)/dotnet/ZipPublishDir.targets" />
103
- </Project>
104
- ```
105
-
106
- ---
107
-
108
- Add the file `Directory.Build.props` to your repository's root directory or solution directory if
109
- you haven't already. Then, add the following properties:
110
-
111
- ```xml
112
- <Project> <!-- Minimal requirements for dotnet/msbuild integration -->
113
- <Import Project="./node_modules/@halospv3/hce.shared-config/dotnet/ZipPublishDir.targets" />
114
- <PropertyGroup>
115
- <ProjectRootDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</ProjectRootDir>
116
- <HCESharedDir>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/</HCESharedDir>
203
+ <!--<GitVersion_Path Condition="'$(GitVersion_Path)' == ''">Path/To/Your/GitVersion.yml</GitVersion_Path>-->
117
204
  </PropertyGroup>
118
205
  </Project>
119
206
  ```
120
207
 
121
208
  These may evaluate to the following:
122
- | Property | Evaluated Value|
123
- | - | - |
124
- |`ProjectRootDir` | `c:\Repos\HaloSPV3\HCE.Shared\` |
209
+ | Property | Evaluated Value|
210
+ | ------------ | -------------- |
211
+ |`RepoRootDir` | `c:\Repos\HaloSPV3\HCE.Shared\` |
125
212
  |`HCESharedDir`| `c:\Repos\HaloSPV3\HCE.Shared\node_modules\@halospv3\hce.shared-config\` |
126
213
 
127
- <br/>
128
-
129
214
  #### CI/CD-Only Properties
130
215
 
216
+ > Note: Already included when importing HCE.Shared.targets
217
+ > If you don't import HCE.Shared.targets, you may import HCE.Shared.CI.props or define your own conditional property group.
218
+
131
219
  If you want properties set only in a CI/CD environment (e.g. a GitHub workflow), add the following
132
220
  conditional property group to the props file:
133
221
 
@@ -159,10 +247,29 @@ If you're satisfied by [dotnet/GitVersion.yml](dotnet/GitVersion.yml), you can c
159
247
  to use this config file. GitVersion does not have 'extend' functionality typical of Node.js
160
248
  packages.
161
249
 
250
+ You can...
251
+
252
+ ...define it yourself
162
253
  ```xml
163
- <PropertyGroup>
164
- <GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
165
- </PropertyGroup>
254
+ <Project>
255
+ <PropertyGroup>
256
+ <GitVersion_Path>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/dotnet/GitVersion.yml</GitVersion_Path>
257
+ </PropertyGroup>
258
+ </Project>
259
+ ```
260
+
261
+ ...import HCE.Shared.props
262
+ ```xml
263
+ <Project>
264
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
265
+ </Project>
266
+ ```
267
+
268
+ ...import HCE.Shared.Targets (which imports HCE.Shared.props)
269
+ ```xml
270
+ <Project>
271
+ <Import Project="$(HCESharedDir)/dotnet/HCE.Shared.props">
272
+ </Project>
166
273
  ```
167
274
 
168
275
  ## Tips
@@ -172,12 +279,7 @@ packages.
172
279
  If you want to use this information in other Semantic Release steps, you'll need
173
280
  `semantic-release-export-data`.
174
281
 
175
- ```sh
176
- npm i -D semantic-release-export-data
177
- ```
178
-
179
282
  Run the following to preview the version:
180
-
181
283
  ```sh
182
284
  npx semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,semantic-release-export-data"
183
285
  ```
@@ -185,7 +287,7 @@ npx semantic-release --dry-run --plugins "@semantic-release/commit-analyzer,sema
185
287
  If the first plugin doesn't run into any issues and infers a version bump from unreleased commits,
186
288
  it will print the next version to the console. The
187
289
  [second plugin](https://github.com/felipecrs/semantic-release-export-data#readme) will export the
188
- next version and other information as GitHub Action Step exports.
290
+ next version and other information as [GitHub Action Step outputs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-output-as-url).
189
291
 
190
292
  ### Don't intend to publish a Node package?
191
293
 
@@ -197,10 +299,12 @@ Add the following to `package.json`:
197
299
  }
198
300
  ```
199
301
 
200
- ## TODO:
302
+ ## WIP
201
303
 
202
304
  ### Reusable, configurable GitHub workflows
203
305
 
306
+ See callable workflows such as [dotnet-ci](./.github/workflows/dotnet-ci.yml)
307
+
204
308
  ```yml
205
309
  jobs:
206
310
  release:
@@ -213,25 +317,3 @@ jobs:
213
317
  - src/lib/lib.csproj
214
318
  - src/lib-sample/sample.csproj
215
319
  ```
216
-
217
- ### Ease Semantic Release Configuration
218
-
219
- JSON/YAML configs _could_ have merge-edit capabilities driven by data from custom, top-level
220
- properties. Each property would contain the command moniker and the config data (parameters) similar
221
- to RPC implementations. This will require quite a bit of datatype validation behind the scenes.
222
-
223
- ```json
224
- {
225
- "modify_plugins": {
226
- "op": "Append",
227
- "data": [
228
- [
229
- "newplugin",
230
- {
231
- "newpluginoption": true
232
- }
233
- ]
234
- ]
235
- }
236
- }
237
- ```
package/cjs/debug.cjs ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const debug = require('debug');
4
+ const _interopDefault = e => e && e.__esModule ? e : {
5
+ default: e
6
+ };
7
+ const debug__default = /*#__PURE__*/_interopDefault(debug);
8
+ const _debug = debug__default.default('@halospv3/hce.shared-config');
9
+ if (process.argv.some(v => v.includes('--debug')) || debug__default.default.enabled('*')) {
10
+ debug__default.default.enable(_debug.namespace);
11
+ }
12
+ module.exports = _debug;
13
+ //# sourceMappingURL=debug.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.cjs","sources":["../src/debug.ts"],"sourcesContent":null,"names":["debug"],"mappings":";;;;;;;;AACK,MAAC,MAAM,GAAGA,sBAAK,CAAC,6BAA6B,EAAE;AACpD,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAIA,sBAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AACzE,EAAEA,sBAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACjC;;;;"}
package/cjs/debug.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import debug from 'debug';
2
+ declare const _debug: debug.Debugger;
3
+ export default _debug;
4
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,MAAM,gBAAuC,CAAC;AAMpD,eAAe,MAAM,CAAC"}
@@ -4,6 +4,86 @@ const strict = require('node:assert/strict');
4
4
  const dotnetGHPR = require('./dotnetGHPR.cjs');
5
5
  const dotnetGLPR = require('./dotnetGLPR.cjs');
6
6
  const MSBuildProject = require('./MSBuildProject.cjs');
7
+ function formatDotnetPublish(projectsToPublish, publishProperties) {
8
+ /* Fun Fact: You can define a property and get the evaluated value in the same command!
9
+ ```pwsh
10
+ dotnet msbuild .\src\HXE.csproj -property:RuntimeIdentifiers="""place;holder""" -getProperty:RuntimeIdentifiers
11
+ place;holder
12
+ ```
13
+ enclosing with """ is required in pwsh to prevent the semicolon from breaking the string.
14
+ */
15
+ if (!(Array.isArray(projectsToPublish) && projectsToPublish.length > 0)) throw new Error(`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`);
16
+
17
+ // each may have TargetFramework OR TargetFrameworks (plural)
18
+ const evaluatedProjects = projectsToPublish.map(proj => new MSBuildProject.MSBuildProject(proj, publishProperties));
19
+ // args appended to "dotnet publish", joined by space
20
+
21
+ return evaluatedProjects.flatMap(proj => {
22
+ const args = [proj.Properties.FullPath];
23
+ function appendCustomProperties(publishProperties) {
24
+ // convert to dictionary and filter for user-defined properties.
25
+ const dictionary = Object.entries(proj.Properties).filter(p => !publishProperties.includes(p[0]));
26
+ if (dictionary.length > 0) {
27
+ /* format remaining properties as "-p:Property=Value" and append to args */
28
+ args.push(...dictionary.map(keyValuePair => `-p:${keyValuePair[0]}=${keyValuePair[1]}`));
29
+ }
30
+ }
31
+ appendCustomProperties(publishProperties);
32
+ const cmdPermutations = []; // forEach, run dotnet [...args,...v]
33
+
34
+ function formatFrameworksAndRuntimes() {
35
+ const RIDs = proj.Properties.RuntimeIdentifiers.length > 0 ? proj.Properties.RuntimeIdentifiers.split(';') : [];
36
+ const TFMs = proj.Properties.TargetFrameworks.length > 0 ? proj.Properties.TargetFrameworks.split(';') : [];
37
+ if (RIDs.length > 0) {
38
+ if (TFMs.length > 0) {
39
+ for (const RID of RIDs) {
40
+ for (const TFM of TFMs) {
41
+ cmdPermutations.push(['--runtime', RID, '--framework', TFM]);
42
+ }
43
+ }
44
+ } else {
45
+ // assume singular TFM. No need to specify it.
46
+ for (const RID of RIDs) {
47
+ cmdPermutations.push(['--runtime', RID]);
48
+ }
49
+ }
50
+ } else if (TFMs.length > 0) {
51
+ for (const TFM of TFMs) {
52
+ cmdPermutations.push(['--framework', TFM]);
53
+ }
54
+ }
55
+ }
56
+ formatFrameworksAndRuntimes();
57
+ return cmdPermutations.length > 0 ? cmdPermutations.map(permArgs => [...args, ...permArgs]) // string[][]
58
+ : [args]; // string[][]
59
+ }).map(args => `dotnet publish ${args.join(' ')}`).join(' && ');
60
+ }
61
+ function formatDotnetPack(projectsToPackAndPush) {
62
+ return projectsToPackAndPush === false ? "" : projectsToPackAndPush.map(v => `dotnet pack ${v}`).join(' && ');
63
+ }
64
+ function formatDotnetNugetSign(dotnetNugetSignArgs) {
65
+ switch (dotnetNugetSignArgs.length) {
66
+ case 0:
67
+ return '';
68
+ default:
69
+ return `dotnet nuget sign ${dotnetNugetSignArgs.join(' ')}`;
70
+ // default: {
71
+ // throw new Error("")
72
+ // // this needs a rework.
73
+ // const packagePaths: string[] = [];
74
+ // dotnetNugetSignArgs.forEach((dotnetNugetSignArg, i) => {
75
+ // // if current arg doesn't start with '-' and (current arg is first -OR- previous arg also does not start with '-')...
76
+ // if (!dotnetNugetSignArg.startsWith("-") && (i === 0 || (i > 0 && !dotnetNugetSignArgs[i - 1].startsWith("-")))) {
77
+ // // ...then it's probably a package path.
78
+ // packagePaths.push(dotnetNugetSignArg);
79
+ // }
80
+ // });
81
+ // if (packagePaths.length === 0)
82
+ // return `dotnet nuget sign ${dotnetNugetSignArgs.join(" ")}`
83
+ // else return
84
+ // }
85
+ }
86
+ }
7
87
 
8
88
  /**
9
89
  * Build a prepareCmd string from .NET project paths and `dotnet nuget sign` arguments.
@@ -12,97 +92,13 @@ const MSBuildProject = require('./MSBuildProject.cjs');
12
92
  * todo: cleanup, docs
13
93
  * @export
14
94
  * @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/`.
95
+ * @param {string[]|false} projectsToPackAndPush Relative and/or full file paths of projects to pass to `dotnet pack`. By default, these will be output to `./publish/`.
16
96
  * @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
97
  */
18
98
  function configurePrepareCmd(projectsToPublish, projectsToPackAndPush, dotnetNugetSignArgs = ['./publish']) {
19
99
  // These are later evaluated with MSBuild, but are passed via --framework and --runtime arguments instead of -p:TargetFramework
20
100
  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
- if (!(Array.isArray(projectsToPublish) && projectsToPublish.length > 0)) throw new Error(`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`);
30
-
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
- const 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
-
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(' && ');
101
+ return [formatDotnetPublish(projectsToPublish, publishProperties), formatDotnetPack(projectsToPackAndPush), formatDotnetNugetSign(dotnetNugetSignArgs)].join(' && ');
106
102
  }
107
103
  const nugetDefault = {
108
104
  tokenEnvVar: 'NUGET_TOKEN',
@@ -110,7 +106,7 @@ const nugetDefault = {
110
106
  };
111
107
 
112
108
  /**
113
- * todo
109
+ * todo -
114
110
  * @param nupkgDir
115
111
  * @param registries
116
112
  * @param pushToGitHub
@@ -1 +1 @@
1
- {"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProjectPreDefin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,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;AACrF,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AACnF,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB;;;;;;"}
1
+ {"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProject","MSBuildProjectPreDefinedProperties","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","ok"],"mappings":";;;;;;;AAIA,SAAS,mBAAmB,CAAC,iBAAiB,EAAE,iBAAiB,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,2BAA2B,EAAE,OAAO,iBAAiB,CAAC,uDAAuD,CAAC,CAAC,CAAC;AAC5M;AACA;AACA,EAAE,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,IAAI,IAAIA,6BAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACvG;AACA;AACA,EAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,IAAI;AAC3C,IAAI,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC5C,IAAI,SAAS,sBAAsB,CAAC,iBAAiB,EAAE;AACvD;AACA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;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C;AAChD,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG;AACH,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,IAAI;AACpC,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACzD,IAAIC,SAAE,CAAC,UAAU,EAAE,CAAC,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;AACrF,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AACnF,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB;;;;;;"}
@@ -5,10 +5,10 @@
5
5
  * todo: cleanup, docs
6
6
  * @export
7
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/`.
8
+ * @param {string[]|false} projectsToPackAndPush Relative and/or full file paths of projects to pass to `dotnet pack`. By default, these will be output to `./publish/`.
9
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
10
  */
11
- export declare function configurePrepareCmd(projectsToPublish: string[], projectsToPackAndPush: string[], dotnetNugetSignArgs?: string[]): string;
11
+ export declare function configurePrepareCmd(projectsToPublish: string[], projectsToPackAndPush: string[] | false, dotnetNugetSignArgs?: string[]): string;
12
12
  export interface NuGetRegistryInfo {
13
13
  tokenEnvVar: string;
14
14
  url: string;
@@ -16,7 +16,7 @@ export interface NuGetRegistryInfo {
16
16
  }
17
17
  export declare const nugetDefault: NuGetRegistryInfo;
18
18
  /**
19
- * todo
19
+ * todo -
20
20
  * @param nupkgDir
21
21
  * @param registries
22
22
  * @param pushToGitHub
@@ -1 +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,UA8G7C;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"}
1
+ {"version":3,"file":"dotnetHelpers.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetHelpers.ts"],"names":[],"mappings":"AA8GA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,GAAG,KAAK,EACvC,mBAAmB,GAAE,MAAM,EAAkB,UAU7C;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"}
@@ -3,15 +3,19 @@
3
3
  const jsonc = require('eslint-plugin-jsonc');
4
4
  const tseslint = require('typescript-eslint');
5
5
  const eslint = require('@eslint/js');
6
- const globals = require('globals');
6
+ const node_module = require('node:module');
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
8
  const _interopDefault = e => e && e.__esModule ? e : {
8
9
  default: e
9
10
  };
10
11
  const jsonc__default = /*#__PURE__*/_interopDefault(jsonc);
11
12
  const tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
12
13
  const eslint__default = /*#__PURE__*/_interopDefault(eslint);
13
- const globals__default = /*#__PURE__*/_interopDefault(globals);
14
14
 
15
+ // CJS compatibility; it started transpiling to a top-level await after upgrading from packemon 4.0.1 to 4.1.0
16
+ const require$1 = node_module.createRequire(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL('eslintConfig.cjs', document.baseURI).href);
17
+ const globals = require$1("globals");
18
+ console.log(globals);
15
19
  // https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
16
20
  // https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
17
21
 
@@ -48,7 +52,7 @@ const eslintConfig = tseslint__default.default.config({
48
52
  maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
49
53
  }
50
54
  },
51
- globals: globals__default.default.node
55
+ globals: globals.node
52
56
  }
53
57
  }, globalIgnores);
54
58
  module.exports = eslintConfig;
@@ -1 +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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L,IAAI,OAAO,EAAEG,wBAAO,CAAC,IAAI;AACzB,GAAG;AACH,CAAC,EAAE,aAAa,CAAC;;;;"}
1
+ {"version":3,"file":"eslintConfig.cjs","sources":["../src/eslintConfig.ts"],"sourcesContent":null,"names":["require","createRequire","tseslint","jsonc","eslint"],"mappings":";;;;;;;;;;;;;;AAKA;AACA,MAAMA,SAAO,GAAGC,yBAAa,CAAC,qMAAe,CAAC,CAAC;AAC/C,MAAM,OAAO,GAAGD,SAAO,CAAC,SAAS,CAAC,CAAC;AACnC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACrB;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,qBAAeE,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,EA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