@halospv3/hce.shared-config 2.6.2 → 2.6.4-develop.1
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 +31 -0
- package/README.md +6 -0
- package/cjs/commitlintConfig.cjs.map +1 -1
- package/cjs/debug.cjs.map +1 -1
- package/cjs/dotnet/MSBuildProject.cjs.map +1 -1
- package/cjs/dotnet/MSBuildProjectProperties.cjs.map +1 -1
- package/cjs/dotnet/createDummyNupkg.cjs.map +1 -1
- package/cjs/dotnet/dotnetGHPR.cjs +41 -18
- package/cjs/dotnet/dotnetGHPR.cjs.map +1 -1
- package/cjs/dotnet/dotnetGHPR.d.ts +2 -2
- package/cjs/dotnet/dotnetGHPR.d.ts.map +1 -1
- package/cjs/dotnet/dotnetGLPR.cjs.map +1 -1
- package/cjs/dotnet/dotnetHelpers.cjs +3 -3
- package/cjs/dotnet/dotnetHelpers.cjs.map +1 -1
- package/cjs/dotnet/dotnetHelpers.d.ts +1 -1
- package/cjs/dotnet/dotnetHelpers.d.ts.map +1 -1
- package/cjs/envUtils.cjs.map +1 -1
- package/cjs/envUtils.d.ts +0 -1
- package/cjs/envUtils.d.ts.map +1 -1
- package/cjs/eslintConfig.cjs +1 -7
- package/cjs/eslintConfig.cjs.map +1 -1
- package/cjs/eslintConfig.d.ts +1 -2
- package/cjs/eslintConfig.d.ts.map +1 -1
- package/cjs/findStaticConfig.cjs.map +1 -1
- package/cjs/semanticReleaseConfig.cjs.map +1 -1
- package/cjs/semanticReleaseConfig.d.ts.map +1 -1
- package/cjs/semanticReleaseConfigDotnet.cjs.map +1 -1
- package/cjs/setupGitPluginSpec.cjs +0 -1
- package/cjs/setupGitPluginSpec.cjs.map +1 -1
- package/cjs/setupGitPluginSpec.d.ts.map +1 -1
- package/dotnet/.github/workflows/_unit_test.yml +1 -1
- package/package.json +4 -9
- package/src/dotnet/dotnetGHPR.ts +72 -19
- package/src/dotnet/dotnetHelpers.ts +4 -4
- package/src/eslintConfig.ts +4 -13
- package/src/setupGitPluginSpec.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
|
+
## [2.6.4-develop.1](https://github.com/halospv3/hce.shared/compare/v2.6.3...v2.6.4-develop.1) (2025-07-03)
|
|
2
|
+
|
|
3
|
+
## [2.6.3](https://github.com/halospv3/hce.shared/compare/v2.6.2...v2.6.3) (2025-07-02)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **deps, deps-dev, eslint:** upgrade group "eslint" for ESLint 9 ([173db90](https://github.com/halospv3/hce.shared/commit/173db90e773f47219311280d71124c31573384ff))
|
|
8
|
+
* **deps, deps-dev:** bump group "eslint" ([b4bd1a5](https://github.com/halospv3/hce.shared/commit/b4bd1a535548ce206b0b68b9cbb9b2f8830947a3))
|
|
9
|
+
* **deps:** 🚑️ fix GitHub advisories ([261fcf2](https://github.com/halospv3/hce.shared/commit/261fcf253af789b99fdab47794a9efb737480851))
|
|
10
|
+
* **deps:** bump @types/node to 20.19.4 ([24136f4](https://github.com/halospv3/hce.shared/commit/24136f4f69857ab431af89cd36900bb975269b25))
|
|
11
|
+
* **deps:** bump `@octokit/request` to 9.2.4 ([a92bf8e](https://github.com/halospv3/hce.shared/commit/a92bf8eb77566fd85188455f43614bcd09a843c3))
|
|
12
|
+
* **deps:** bump `@semantic-release/github` to 10.3.5 ([a6786fe](https://github.com/halospv3/hce.shared/commit/a6786feeeb0ccd813b569b5fd8ee848c19e5c690))
|
|
13
|
+
* **deps:** bump ajv to 8.17.1 ([50bd762](https://github.com/halospv3/hce.shared/commit/50bd762740228961a63b71d00c7199af33544d73))
|
|
14
|
+
* **deps:** bump globals to 15.15.0 ([8199785](https://github.com/halospv3/hce.shared/commit/8199785fa01ea937b5cdc1a2c5d6fd44375f7c79))
|
|
15
|
+
* **deps:** bump group "commitlint" ([60f2fd4](https://github.com/halospv3/hce.shared/commit/60f2fd4c1bb46a64c8d963efc976fab712dc2e71))
|
|
16
|
+
* **deps:** bump group "semantic-release" ([2aa0dff](https://github.com/halospv3/hce.shared/commit/2aa0dff55f8cdb64509f2b5ab7ac2194f8268fb3))
|
|
17
|
+
* **deps:** bump husky to 9.1.7 ([b8b0b1e](https://github.com/halospv3/hce.shared/commit/b8b0b1e4734f8705856e76e8ac89d8f3cd702960))
|
|
18
|
+
* **deps:** bump semantic-release-export-data to 2.8.1 ([1dccb43](https://github.com/halospv3/hce.shared/commit/1dccb43ed95155bb69d1d56758b7548a0fd5e31e))
|
|
19
|
+
* **deps:** bump transitive dep tslib to 2.8.1 ([16b327f](https://github.com/halospv3/hce.shared/commit/16b327f4af22f5750692a53aec6938d10f5420a5))
|
|
20
|
+
* **deps:** bump typescript to 5.8.3 ([19c0344](https://github.com/halospv3/hce.shared/commit/19c03443e8f2f4a5efb1f6171af6e43dc413b5f0))
|
|
21
|
+
* **deps:** remove unused dep `@octokit/request` ([b000049](https://github.com/halospv3/hce.shared/commit/b0000495bdaac34f300f5d5dbc3b495615465d84))
|
|
22
|
+
* **dotnet.GHPR:** un-enclose `dotnet push` args; fix error detection ([ccdce25](https://github.com/halospv3/hce.shared/commit/ccdce25aee4c27f406cb8353f98c38767d203f81))
|
|
23
|
+
* **dotnet.helpers, dotnet.GHPR:** remove `async` modifiers and `Promise` return types from all functions affecting `semanticReleaseConfigDotnet` ([659836c](https://github.com/halospv3/hce.shared/commit/659836ca7424b434791d50585f4eafebcd78e446)), closes [#407](https://github.com/halospv3/hce.shared/issues/407)
|
|
24
|
+
* **dotnet.helpers:** add missing `return` ([5998d54](https://github.com/halospv3/hce.shared/commit/5998d54438e67849b9d305ff7c15b47ff4721456))
|
|
25
|
+
|
|
26
|
+
## [2.6.1-develop.3](https://github.com/halospv3/hce.shared/compare/v2.6.1-develop.2...v2.6.1-develop.3) (2025-03-19)
|
|
27
|
+
|
|
1
28
|
## [2.6.2](https://github.com/halospv3/hce.shared/compare/v2.6.1...v2.6.2) (2024-09-28)
|
|
2
29
|
|
|
30
|
+
## [2.6.1-develop.2](https://github.com/halospv3/hce.shared/compare/v2.6.1-develop.1...v2.6.1-develop.2) (2024-09-20)
|
|
31
|
+
|
|
3
32
|
## [2.6.1](https://github.com/halospv3/hce.shared/compare/v2.6.0...v2.6.1) (2024-07-23)
|
|
4
33
|
|
|
34
|
+
## [2.6.1-develop.1](https://github.com/halospv3/hce.shared/compare/v2.6.0...v2.6.1-develop.1) (2024-07-23)
|
|
35
|
+
|
|
5
36
|
### Bug Fixes
|
|
6
37
|
|
|
7
38
|
* **deps:** :ambulance: bump ws to 8.18.0 (>=8.17.1) ([d0dcf52](https://github.com/halospv3/hce.shared/commit/d0dcf527ad2b98f550840c9375c92c2d15ae1d57))
|
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# HCE.Shared
|
|
2
2
|
|
|
3
|
+
## NOTICE
|
|
4
|
+
|
|
5
|
+
> Activity is held up by a rewrite for the `next/3.0.0` branch.
|
|
6
|
+
>
|
|
7
|
+
> A fix for the `2.x` branch may be feasible if all that's wrong is async functions in CJS. The `2.x` release channel will not receive feature updates, but fixes and dependency updates are acceptable.
|
|
8
|
+
|
|
3
9
|
Infrastructure resources shared with other HaloSPV3 repositories.
|
|
4
10
|
|
|
5
11
|
It is recommended to "install" this repo via [Node Package Manager](#npm)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitlintConfig.cjs","sources":["../src/commitlintConfig.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA,MAAM,QAAQ,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"commitlintConfig.cjs","sources":["../src/commitlintConfig.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA,MAAM,QAAQ,GAAG,CAAC;AACb,MAAC,gBAAgB,GAAG;AACzB,EAAE,OAAO,EAAE,CAAC,iCAAiC,CAAC;AAC9C,EAAE,KAAK,EAAE;AACT,IAAI,sBAAsB,EAAE,CAAC,QAAQ,CAAC;AACtC,IAAI,wBAAwB,EAAE,CAAC,QAAQ,CAAC;AACxC,IAAI,mBAAmB,EAAE,CAAC,QAAQ;AAClC;AACA;;;;"}
|
package/cjs/debug.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.cjs","sources":["../src/debug.ts"],"sourcesContent":null,"names":["debug"],"mappings":";;;;;;;;AACK,MAAC,MAAM,GAAGA,sBAAK,CAAC,6BAA6B
|
|
1
|
+
{"version":3,"file":"debug.cjs","sources":["../src/debug.ts"],"sourcesContent":null,"names":["debug"],"mappings":";;;;;;;;AACK,MAAC,MAAM,GAAGA,sBAAK,CAAC,6BAA6B;AAClD,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;AAChC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSBuildProject.cjs","sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":null,"names":["MSBuildProjectProperties","execFileSync"],"mappings":";;;;;AAGA;AACA;AACA;AACY,MAAC,kCAAkC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAIA,iDAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU
|
|
1
|
+
{"version":3,"file":"MSBuildProject.cjs","sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":null,"names":["MSBuildProjectProperties","execFileSync"],"mappings":";;;;;AAGA;AACA;AACA;AACY,MAAC,kCAAkC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAIA,iDAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAA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G,CAAC,EAAE;AAC7B,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AACjC,MAAM,IAAI,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,KAAK,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,IAAI,KAAK,CAAC,+GAA+G,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAClR,KAAK,MAAM;AACX,MAAM,KAAK,GAAG;AACd,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI;AACjC,OAAO;AACP;AACA,IAAI,OAAO;AACX,MAAM,GAAG,cAAc;AACvB,MAAM,GAAG;AACT,KAAK;AACL;AACA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSBuildProjectProperties.cjs","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":null,"names":["isAbsolute","resolve","existsSync","basename"],"mappings":";;;;;AAGA;AACA;AACA;AACO,MAAM,wBAAwB,CAAC;AACtC,EAAE,QAAQ,GAAG,EAAE
|
|
1
|
+
{"version":3,"file":"MSBuildProjectProperties.cjs","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":null,"names":["isAbsolute","resolve","existsSync","basename"],"mappings":";;;;;AAGA;AACA;AACA;AACO,MAAM,wBAAwB,CAAC;AACtC,EAAE,QAAQ,GAAG,EAAE;AACf,EAAE,eAAe,GAAG,EAAE;AACtB,EAAE,gBAAgB,GAAG,EAAE;AACvB,EAAE,iBAAiB,GAAG,EAAE;AACxB,EAAE,kBAAkB,GAAG,EAAE;AACzB,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE;AACvC,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,IAAI,IAAI,CAACA,eAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAGC,YAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1E,IAAI,IAAI,CAACC,kBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAEC,aAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5I;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDummyNupkg.cjs","sources":["../../src/dotnet/createDummyNupkg.ts"],"sourcesContent":null,"names":["dirSync","join","existsSync","unlinkSync","execSync","dirname"],"mappings":";;;;;;;AAIO,SAAS,gBAAgB,GAAG;AACnC,EAAE,MAAM,SAAS,GAAGA,WAAO,CAAC;AAC5B,IAAI,aAAa,EAAE
|
|
1
|
+
{"version":3,"file":"createDummyNupkg.cjs","sources":["../../src/dotnet/createDummyNupkg.ts"],"sourcesContent":null,"names":["dirSync","join","existsSync","unlinkSync","execSync","dirname"],"mappings":";;;;;;;AAIO,SAAS,gBAAgB,GAAG;AACnC,EAAE,MAAM,SAAS,GAAGA,WAAO,CAAC;AAC5B,IAAI,aAAa,EAAE;AACnB,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAGC,SAAI,CAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,CAAC;;AAEpE;AACA,EAAE,IAAIC,kBAAU,CAAC,gBAAgB,CAAC,EAAEC,kBAAU,CAAC,gBAAgB,CAAC;AAChE,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG,EAAE,SAAS,CAAC,IAAI;AACvB,IAAI,QAAQ,EAAE;AACd,GAAG;AACH,EAAEC,2BAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC;AACtD,EAAE,MAAM,OAAO,GAAGA,2BAAQ,CAAC,CAAC,mDAAmD,EAAEC,YAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AACtH,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,EAAE,IAAI,EAAE;AAC/H,EAAE,IAAI,CAACH,kBAAU,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,uDAAuD,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;AACzJ,EAAE,OAAO,gBAAgB;AACzB;;;;"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
const strict = require('node:assert/strict');
|
|
4
4
|
const node_child_process = require('node:child_process');
|
|
5
|
-
const node_util = require('node:util');
|
|
6
5
|
const envUtils = require('../envUtils.cjs');
|
|
7
6
|
const createDummyNupkg = require('./createDummyNupkg.cjs');
|
|
7
|
+
const types = require('node:util/types');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @param tokenEnvVar The name of the environment variable containing the NUGET token
|
|
10
|
+
* @param tokenEnvVar The name of the environment variable containing the NUGET token
|
|
11
11
|
* @returns `true` if the token can be used to push nupkg to the given Nuget registry
|
|
12
12
|
* @throws
|
|
13
13
|
* - TypeError: The environment variable ${tokenEnvVar} is undefined!
|
|
14
|
-
* - Error:
|
|
14
|
+
* - Error:
|
|
15
15
|
* - The value of the token in ${tokenEnvVar} begins with 'github_pat_' which means it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.
|
|
16
16
|
* - The GitHub API response header lacked "x-oauth-scopes". This indicates the token we provided is not a workflow token nor a Personal Access Token (classic) and can never have permission to push packages.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
function tokenCanWritePackages(tokenEnvVar, url) {
|
|
19
19
|
/* double-check the token exists */
|
|
20
20
|
const info = isTokenDefined(tokenEnvVar);
|
|
21
21
|
strict.ok(info.isDefined);
|
|
@@ -23,28 +23,51 @@ async function tokenCanWritePackages(tokenEnvVar, url) {
|
|
|
23
23
|
console.debug(`tokenCanWritePackages was called without a NuGet Source URL. Defaulting to use ${`${nugetGitHubUrlBase}/\${GITHUB_REPOSITORY_OWNER}/index.json`} where GITHUB_REPOSITORY_OWNER is '${getOwner()}'`);
|
|
24
24
|
url = getNugetGitHubUrl();
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
strict.notDeepStrictEqual(url, '');
|
|
26
|
+
if (url === undefined || url === '') throw new Error('The NuGet source is undefined or empty!');
|
|
28
27
|
if (info.fallback) tokenEnvVar = info.fallback;
|
|
29
28
|
const tokenValue = envUtils.getEnvVarValue(tokenEnvVar);
|
|
30
29
|
if (tokenValue === undefined) throw new TypeError(`The environment variable ${tokenEnvVar} is undefined!`);
|
|
31
30
|
if (tokenValue.startsWith('github_pat_')) throw new Error(`The value of the token in ${tokenEnvVar} begins with 'github_pat_' which means it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.`);
|
|
32
31
|
const dummyNupkgPath = createDummyNupkg.createDummyNupkg();
|
|
33
|
-
const promiseExec = node_util.promisify(node_child_process.exec);
|
|
34
32
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
let pushResult = undefined;
|
|
34
|
+
try {
|
|
35
|
+
pushResult = node_child_process.spawnSync('dotnet', ['nuget', 'push', dummyNupkgPath, '--source', url, '--api-key', tokenValue, '--skip-duplicate', '--force-english-output'], {
|
|
36
|
+
stdio: 'pipe',
|
|
37
|
+
encoding: 'utf8',
|
|
38
|
+
shell: process.platform === 'win32' && node_child_process.spawnSync('dotnet.exe', {
|
|
39
|
+
windowsHide: true
|
|
40
|
+
}).status === null ? 'cmd.exe' : undefined,
|
|
41
|
+
windowsHide: true
|
|
42
|
+
});
|
|
43
|
+
} catch (_error) {
|
|
44
|
+
// censor token
|
|
45
|
+
const error = !types.isNativeError(_error) ? new Error(`dotnet nuget push failed. \n${String(_error)}`) : _error;
|
|
46
|
+
const tokenPattern = new RegExp(tokenValue, 'g');
|
|
47
|
+
error.message = error.message.replace(tokenPattern, '***');
|
|
48
|
+
if (error.stack) error.stack = error.stack.replace(tokenPattern, '***');
|
|
49
|
+
if ('cmd' in error && typeof error.cmd === 'string') error.cmd = error.cmd.replace(tokenPattern, '***');
|
|
50
|
+
if ('stdout' in error && typeof error.stdout === 'string') error.stdout = error.stdout.replace(tokenPattern, '***');
|
|
51
|
+
if ('stderr' in error && typeof error.stderr === 'string') {
|
|
52
|
+
error.stderr = error.stderr.replace(tokenPattern, '***');
|
|
53
|
+
}
|
|
54
|
+
if ('spawnargs' in error && Array.isArray(error.spawnargs)) {
|
|
55
|
+
error.spawnargs = error.spawnargs.map(arg => {
|
|
56
|
+
return typeof arg === 'string' ? arg.replace(tokenPattern, '***') : arg;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
const errNewline = pushResult.stdout.includes('\r\n') ? '\r\n' : pushResult.stdout.includes('\r') ? '\r' : '\n';
|
|
39
62
|
|
|
40
63
|
// if any *lines* start with "error: " or "Error: ", log stderr
|
|
41
|
-
const errorCount = pushResult.
|
|
42
|
-
if (errorCount > 0) console.error(pushResult.
|
|
64
|
+
const errorCount = pushResult.stdout.split(errNewline).filter(line => line.trim().startsWith('error: ') || line.trim().startsWith('Error: ')).length;
|
|
65
|
+
if (errorCount > 0) console.error(pushResult.stdout);
|
|
43
66
|
|
|
44
67
|
// if any lines start with "warn : ", log stdout
|
|
45
|
-
const warningCount = pushResult.stdout.split(errNewline
|
|
68
|
+
const warningCount = pushResult.stdout.split(errNewline).filter(line => line.trim().startsWith('warn : ')).length;
|
|
46
69
|
if (warningCount > 0) console.warn(pushResult.stdout);
|
|
47
|
-
const hasAuthError = pushResult.
|
|
70
|
+
const hasAuthError = pushResult.stdout.includes('401 (Unauthorized)');
|
|
48
71
|
|
|
49
72
|
// return true is no lines contain error indicators.
|
|
50
73
|
return errorCount === 0 && hasAuthError === false;
|
|
@@ -73,7 +96,7 @@ function getNugetGitHubUrl() {
|
|
|
73
96
|
}
|
|
74
97
|
|
|
75
98
|
/**
|
|
76
|
-
* If tokenEnvVar is NOT 'GITHUB_TOKEN', then test if the token is defined and return the boolean.
|
|
99
|
+
* If tokenEnvVar is NOT 'GITHUB_TOKEN', then test if the token is defined and return the boolean.
|
|
77
100
|
* Else If tokenEnvVar is 'GITHUB_TOKEN' and defined, then return true.
|
|
78
101
|
* Else If tokenEnvVar is 'GITHUB_TOKEN' and undefined, then set tokenEnvVar to 'GH_TOKEN', test if GH_TOKEN is defined, and return the boolean.
|
|
79
102
|
* @param tokenEnvVar the name of the environment variable with the token's value. Defaults to 'GITHUB_TOKEN'. If environment variable 'GITHUB_TOKEN' is undefined, falls back to 'GH_TOKEN'.
|
|
@@ -105,7 +128,7 @@ function isTokenDefined(tokenEnvVar = 'GITHUB_TOKEN') {
|
|
|
105
128
|
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, `undefined`.
|
|
106
129
|
* note: `url` defaults to job's repository owner's GitHub registry in GitHub Actions workflow. If GITHUB_REPOSITORY_OWNER is not defined, then an error will be logged and `undefined` will be returned.
|
|
107
130
|
*/
|
|
108
|
-
|
|
131
|
+
function getGithubNugetRegistryPair(tokenEnvVar = 'GITHUB_TOKEN', url = getNugetGitHubUrl()) {
|
|
109
132
|
const errors = [];
|
|
110
133
|
const _isTokenDefinedInfo = isTokenDefined(tokenEnvVar);
|
|
111
134
|
let canTokenWritePackages = undefined;
|
|
@@ -115,7 +138,7 @@ async function getGithubNugetRegistryPair(tokenEnvVar = 'GITHUB_TOKEN', url = ge
|
|
|
115
138
|
if (_isTokenDefinedInfo.isDefined) {
|
|
116
139
|
if (_isTokenDefinedInfo.fallback) tokenEnvVar = _isTokenDefinedInfo.fallback;
|
|
117
140
|
try {
|
|
118
|
-
canTokenWritePackages =
|
|
141
|
+
canTokenWritePackages = tokenCanWritePackages(tokenEnvVar, url);
|
|
119
142
|
} catch (err) {
|
|
120
143
|
if (err instanceof Error) errors.push(err);else errors.push(new Error(String(err)));
|
|
121
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetGHPR.cjs","sources":["../../src/dotnet/dotnetGHPR.ts"],"sourcesContent":null,"names":["ok","
|
|
1
|
+
{"version":3,"file":"dotnetGHPR.cjs","sources":["../../src/dotnet/dotnetGHPR.ts"],"sourcesContent":null,"names":["ok","getEnvVarValue","createDummyNupkg","spawnSync","isNativeError"],"mappings":";;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAqB,CAAC,WAAW,EAAE,GAAG,EAAE;AACxD;AACA,EAAE,MAAM,IAAI,GAAG,cAAc,CAAC,WAAW,CAAC;AAC1C,EAAEA,SAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AACpB,EAAE,IAAI,GAAG,KAAK,SAAS,EAAE;AACzB,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,+EAA+E,EAAE,CAAC,EAAE,kBAAkB,CAAC,uCAAuC,CAAC,CAAC,mCAAmC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACtN,IAAI,GAAG,GAAG,iBAAiB,EAAE;AAC7B;AACA,EAAE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,EAAE,MAAM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,IAAIA,uBAAc,CAAC,YAAY,CAAC,KAAK,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AAC5E,IAAI,OAAO,CAAC,KAAK,CAAC,wDAAwD,GAAG,MAAM,CAAC,KAAK,CAAC;AAC1F,IAAI,OAAO,SAAS;AACpB;AACA,EAAE,MAAM,MAAM;AACd;;;;;;;;;"}
|
|
@@ -8,7 +8,7 @@ import type { NuGetRegistryInfo } from './dotnetHelpers.js';
|
|
|
8
8
|
* - The value of the token in ${tokenEnvVar} begins with 'github_pat_' which means it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.
|
|
9
9
|
* - The GitHub API response header lacked "x-oauth-scopes". This indicates the token we provided is not a workflow token nor a Personal Access Token (classic) and can never have permission to push packages.
|
|
10
10
|
*/
|
|
11
|
-
export declare function tokenCanWritePackages(tokenEnvVar: string, url?: string):
|
|
11
|
+
export declare function tokenCanWritePackages(tokenEnvVar: string, url?: string): boolean;
|
|
12
12
|
export declare const nugetGitHubUrlBase = "https://nuget.pkg.github.com";
|
|
13
13
|
/** @deprecated use {@link getNugetGitHubUrl()} instead. */
|
|
14
14
|
export declare const nugetGitHubUrl: string | undefined;
|
|
@@ -33,5 +33,5 @@ export declare function isTokenDefined(tokenEnvVar?: string): {
|
|
|
33
33
|
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, `undefined`.
|
|
34
34
|
* note: `url` defaults to job's repository owner's GitHub registry in GitHub Actions workflow. If GITHUB_REPOSITORY_OWNER is not defined, then an error will be logged and `undefined` will be returned.
|
|
35
35
|
*/
|
|
36
|
-
export declare function getGithubNugetRegistryPair(tokenEnvVar?: string | 'GITHUB_TOKEN' | 'GH_TOKEN', url?: string | undefined):
|
|
36
|
+
export declare function getGithubNugetRegistryPair(tokenEnvVar?: string | 'GITHUB_TOKEN' | 'GH_TOKEN', url?: string | undefined): NuGetRegistryInfo | undefined;
|
|
37
37
|
//# sourceMappingURL=dotnetGHPR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetGHPR.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetGHPR.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dotnetGHPR.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetGHPR.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,WAuGtE;AAOD,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AAEjE,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,MAAM,GAAG,SAA+B,CAAC;AAGtE,wBAAgB,iBAAiB,uBAMhC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,SAAiB,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAetG;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACzC,WAAW,GAAE,MAAM,GAAG,cAAc,GAAG,UAA2B,EAClE,GAAG,GAAE,MAAM,GAAG,SAA+B,GAC3C,iBAAiB,GAAG,SAAS,CAuD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetGLPR.cjs","sources":["../../src/dotnet/dotnetGLPR.ts"],"sourcesContent":null,"names":["getEnv","getEnvVarValue"],"mappings":";;;;AACA,MAAM;AACN,EAAE,aAAa;AACf,EAAE
|
|
1
|
+
{"version":3,"file":"dotnetGLPR.cjs","sources":["../../src/dotnet/dotnetGLPR.ts"],"sourcesContent":null,"names":["getEnv","getEnvVarValue"],"mappings":";;;;AACA,MAAM;AACN,EAAE,aAAa;AACf,EAAE;AACF,CAAC,GAAGA,eAAM,EAAE;AACZ,MAAM,MAAM,GAAG;AACf,EAAE,aAAa,EAAE,eAAe;AAChC,EAAE,aAAa,EAAE;AACjB,CAAC;AACW,MAAC,iBAAiB,GAAG;AACrB,MAAC,kBAAkB,GAAG;AACtB,MAAC,cAAc,GAAG,aAAa,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,0BAA0B,CAAC,GAAG;;AAExI;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,0BAA0B,CAAC,WAAW,GAAG,iBAAiB,EAAE,GAAG,GAAG,cAAc,EAAE;AAClG;AACA,EAAE,IAAI,CAACC,uBAAc,CAAC,WAAW,CAAC,EAAE;AACpC,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,yBAAyB,EAAE,WAAW,CAAC,yHAAyH,CAAC,CAAC,CAAC;AAChM,IAAI,OAAO,SAAS;AACpB;AACA,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAO;AACX,MAAM,WAAW;AACjB,MAAM;AACN,KAAK;AACL;AACA,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,0BAA0B,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,+EAA+E,CAAC,CAAC,CAAC;AACzL,EAAE,OAAO,SAAS;AAClB;;;;;;;"}
|
|
@@ -113,12 +113,12 @@ const nugetDefault = {
|
|
|
113
113
|
* @param pushToGitHub
|
|
114
114
|
* @returns
|
|
115
115
|
*/
|
|
116
|
-
|
|
116
|
+
function configureDotnetNugetPush(nupkgDir = './publish', registries = [nugetDefault], pushToGitHub = true) {
|
|
117
117
|
if (registries.some(registry => registry.url.trim() === '')) throw new Error('The URL for one of the provided NuGet registries was empty or whitespace.');
|
|
118
118
|
|
|
119
119
|
// if user did not specify a GitHub NuGet Registry, try determine default values and add the Source.
|
|
120
120
|
if (pushToGitHub && !registries.some(reg => reg.url.startsWith(dotnetGHPR.nugetGitHubUrlBase))) {
|
|
121
|
-
const ghPair =
|
|
121
|
+
const ghPair = dotnetGHPR.getGithubNugetRegistryPair();
|
|
122
122
|
if (ghPair) {
|
|
123
123
|
registries.push(ghPair);
|
|
124
124
|
}
|
|
@@ -132,7 +132,7 @@ async function configureDotnetNugetPush(nupkgDir = './publish', registries = [nu
|
|
|
132
132
|
return registries.map(registry => {
|
|
133
133
|
const tokenValue = envUtils.getEnvVarValue(registry.tokenEnvVar);
|
|
134
134
|
strict.ok(envUtils.getEnvVarValue('SKIP_TOKEN') === 'true' || tokenValue, `The environment variable ${registry.tokenEnvVar} is undefined!`);
|
|
135
|
-
`dotnet nuget push ${nupkgDir} --source ${registry.url} --token ${tokenValue ?? '**placeholder**'}`;
|
|
135
|
+
return `dotnet nuget push ${nupkgDir} --source ${registry.url} --token ${tokenValue ?? '**placeholder**'}`;
|
|
136
136
|
}).join(' && ');
|
|
137
137
|
}
|
|
138
138
|
exports.configureDotnetNugetPush = configureDotnetNugetPush;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProject","MSBuildProjectPreDefinedProperties","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","getEnvVarValue","ok"],"mappings":";;;;;;;;AAKA,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
|
|
1
|
+
{"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProject","MSBuildProjectPreDefinedProperties","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","getEnvVarValue","ok"],"mappings":";;;;;;;;AAKA,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;;AAE3M;AACA,EAAE,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,IAAI,IAAIA,6BAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;AACtG;;AAEA,EAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,IAAI;AAC3C,IAAI,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;AAC3C,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;AACvG,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;AACjC;AACA,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,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AAS,EAAE,UAAU,IAAI,iBAAiB,CAAC,CAAC;AAC9G,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;AACjB;;;;;;"}
|
|
@@ -22,5 +22,5 @@ export declare const nugetDefault: NuGetRegistryInfo;
|
|
|
22
22
|
* @param pushToGitHub
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
|
-
export declare function configureDotnetNugetPush(nupkgDir?: string, registries?: NuGetRegistryInfo[], pushToGitHub?: boolean):
|
|
25
|
+
export declare function configureDotnetNugetPush(nupkgDir?: string, registries?: NuGetRegistryInfo[], pushToGitHub?: boolean): string;
|
|
26
26
|
//# sourceMappingURL=dotnetHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,wBAAgB,wBAAwB,CACvC,QAAQ,SAAc,EACtB,UAAU,GAAE,iBAAiB,EAAmB,EAChD,YAAY,UAAO,GACjB,MAAM,CA2BR"}
|
package/cjs/envUtils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envUtils.cjs","sources":["../src/envUtils.ts"],"sourcesContent":null,"names":["loadDotenv","env"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,aAAa,EAAE,SAAS,EAAE;AACjD,EAAEA,aAAU,CAAC,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"envUtils.cjs","sources":["../src/envUtils.ts"],"sourcesContent":null,"names":["loadDotenv","env"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,aAAa,EAAE,SAAS,EAAE;AACjD,EAAEA,aAAU,CAAC,aAAa,CAAC;AAC3B,EAAE,IAAI,SAAS,EAAE,MAAM,CAAC,MAAM,CAACC,gBAAG,EAAE,SAAS,CAAC;AAC9C,EAAE,OAAOA,gBAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE;AACvC,EAAE,IAAI,KAAK,GAAGA,gBAAG,CAAC,MAAM,CAAC;AACzB,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,IAAI;AACR,MAAMD,aAAU,EAAE;AAClB,KAAK,CAAC,OAAO,GAAG,EAAE;AAClB,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAChC;AACA,IAAI,KAAK,GAAGC,gBAAG,CAAC,MAAM,CAAC;AACvB;AACA,EAAE,OAAO,KAAK;AACd;;;;;"}
|
package/cjs/envUtils.d.ts
CHANGED
package/cjs/envUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envUtils.d.ts","sourceRoot":"","sources":["../src/envUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envUtils.d.ts","sourceRoot":"","sources":["../src/envUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAGxE;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,aAAa,CAAC,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAO5G;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYjE"}
|
package/cjs/eslintConfig.cjs
CHANGED
|
@@ -17,7 +17,6 @@ const require$1 = node_module.createRequire(typeof document === 'undefined' ? re
|
|
|
17
17
|
const globals = require$1("globals");
|
|
18
18
|
// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
|
|
19
19
|
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
|
|
20
|
-
|
|
21
20
|
const globalIgnores = {
|
|
22
21
|
name: "global ignores",
|
|
23
22
|
ignores: ["_tsout/**/*", "_tsout/*", "_tsout/", "cjs/**/*", "cjs/*/*", "cjs/*", "mjs/**/*", "mjs/*", "mjs/", "node_modules/**/*", "**/node_modules/**/*"]
|
|
@@ -44,12 +43,7 @@ const eslintConfig = tseslint__default.default.config({
|
|
|
44
43
|
ignores: globalIgnores.ignores,
|
|
45
44
|
languageOptions: {
|
|
46
45
|
parserOptions: {
|
|
47
|
-
|
|
48
|
-
// @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.
|
|
49
|
-
EXPERIMENTAL_useProjectService: {
|
|
50
|
-
allowDefaultProjectForFiles: ["./*.js"],
|
|
51
|
-
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
|
|
52
|
-
}
|
|
46
|
+
useProjectService: true
|
|
53
47
|
},
|
|
54
48
|
globals: globals.node
|
|
55
49
|
}
|
package/cjs/eslintConfig.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,kQAAe,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,kQAAe,CAAC;AAC9C,MAAM,OAAO,GAAGD,SAAO,CAAC,SAAS,CAAC;AAClC;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;AAC1J,CAAC;AACD,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;AACzB,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;AACzB,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;AACzB,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,iBAAiB,EAAE;AACzB,KAAK;AACL,IAAI,OAAO,EAAE,OAAO,CAAC;AACrB;AACA,CAAC,EAAE,aAAa,CAAC;;;;"}
|
package/cjs/eslintConfig.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: TSESLint.FlatConfig.ConfigArray;
|
|
1
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
3
2
|
export default _default;
|
|
4
3
|
//# sourceMappingURL=eslintConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslintConfig.d.ts","sourceRoot":"","sources":["../src/eslintConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eslintConfig.d.ts","sourceRoot":"","sources":["../src/eslintConfig.ts"],"names":[],"mappings":";AA2BA,wBAoDE"}
|
|
@@ -1 +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
|
|
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;AACtC,EAAE,IAAI,OAAO,GAAGA,sBAAa,CAACC,qBAAI,CAAC,OAAO,CAAC,sQAAe,CAAC,CAAC;AAC5D,EAAE,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;AAC7C,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,sQAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AACzO,IAAI,OAAO,GAAGA,qBAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AACnC,IAAI,YAAY,GAAGA,qBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;AAC3C;AACA,EAAE,OAAO,YAAY;AACrB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReleaseConfig.cjs","sources":["../src/semanticReleaseConfig.ts"],"sourcesContent":null,"names":["DefaultOptions"],"mappings":";;;;AACY,MAAC,cAAc,GAAG,CAAC,mCAAmC,EAAE,2CAA2C,EAAE,uBAAuB,EAAE,0BAA0B
|
|
1
|
+
{"version":3,"file":"semanticReleaseConfig.cjs","sources":["../src/semanticReleaseConfig.ts"],"sourcesContent":null,"names":["DefaultOptions"],"mappings":";;;;AACY,MAAC,cAAc,GAAG,CAAC,mCAAmC,EAAE,2CAA2C,EAAE,uBAAuB,EAAE,0BAA0B;AACxJ,MAAC,UAAU,GAAG;AAC1B;AACA,EAAE,MAAM,EAAE,qBAAqB;AAC/B,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE;AACrB,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,UAAU,EAAE;AAChB,GAAG,CAAC;AACJ,EAAE,OAAO,EAAE,CAAC,CAAC,mCAAmC,EAAE,EAAE,CAAC,EAAE,CAAC,8BAA8B,EAAE,EAAE,CAAC,EAAE,CAAC,2CAA2C,EAAE,EAAE,CAAC,EAAE,CAAC,6BAA6B,EAAE,EAAE,CAAC,EAAE,CAAC,uBAAuB,EAAEA,iCAAc,CAAC;AAC9N;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,CAAC,wBAAwB,EAAE,EAAE,CAAC,EAAE,CAAC,0BAA0B,EAAE;AAC/D,IAAI,MAAM,EAAE,CAAC;AACb,MAAM,IAAI,EAAE;AACZ,KAAK;AACL,GAAG,CAAC;AACJ;;AAEA;AACA;AACA;;;;;"}
|
|
@@ -1 +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,EAAE,SAAS,UAAU,EAK/C,CAAC;AAEF,eAAO,MAAM,UAAU,
|
|
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,EAAE,SAAS,UAAU,EAK/C,CAAC;AAEF,eAAO,MAAM,UAAU,EAmClB,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReleaseConfigDotnet.cjs","sources":["../src/semanticReleaseConfigDotnet.ts"],"sourcesContent":null,"names":["defaultPlugins","setupGitPluginSpec","configurePrepareCmd","configureDotnetNugetPush","inspect","baseConfig","getEnvVarValue"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"semanticReleaseConfigDotnet.cjs","sources":["../src/semanticReleaseConfigDotnet.ts"],"sourcesContent":null,"names":["defaultPlugins","setupGitPluginSpec","configurePrepareCmd","configureDotnetNugetPush","inspect","baseConfig","getEnvVarValue"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,MAAM,EAAE;AAC7C;AACA,EAAE,MAAM,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,IAAIA,oCAAc,CAAC,CAAC;AAC1D,EAAE,MAAM,CAAC,OAAO,GAAGC,qCAAkB,CAAC,MAAM,CAAC,OAAO,CAAC;AACrD,EAAE,OAAO,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE;AAChF,EAAE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC;AAC9G,EAAE,MAAM,CAAC,OAAO,CAAC,IA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AAI,MAAM,IAAI,KAAK,CAAC,CAAC,yDAAyD,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxH;AACA,EAAE,IAAI,MAAM,GAAG;AACf,IAAI,GAAGD;AACP,GAAG;AACH,EAAE,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC;AACvC,EAAE,IAAI,iBAAiB,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,CAAC;AACjG,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE;AACrB,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,yBAAyB,EAAED,iBAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACzF;AACA,EAAE,OAAO,MAAM;AACf;;;;;;;"}
|
|
@@ -4,7 +4,6 @@ const GitPluginId = '@semantic-release/git';
|
|
|
4
4
|
/** As specified at https://github.com/semantic-release/git#options */
|
|
5
5
|
const DefaultOptions = {
|
|
6
6
|
assets: ['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'],
|
|
7
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
8
7
|
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
|
|
9
8
|
};
|
|
10
9
|
function gitAssetsToArray(assets) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupGitPluginSpec.cjs","sources":["../src/setupGitPluginSpec.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAY,MAAC,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"setupGitPluginSpec.cjs","sources":["../src/setupGitPluginSpec.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAY,MAAC,WAAW,GAAG;AAC3B;AACY,MAAC,cAAc,GAAG;AAC9B,EAAE,M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AAC,MAAM,CAAC;AAC/F,EAAE,MAAM,WAAW,GAAG,EAAE;;AAExB;AACA,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK;AACrC,IAAI,IAAI,CAAC,GAAG,cAAc,IAAI,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE;AACxE;AACA,MAAM,MAAM;AACZ,QAAQ;AACR,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,MAAM;AACZ,QAAQ;AACR,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B;AACA,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtG,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO;AAChF,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACzB;AACA,GAAG,CAAC;AACJ,EAAE,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;AAChD,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3B;AACA,EAAE,OAAO,UAAU;AACnB;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupGitPluginSpec.d.ts","sourceRoot":"","sources":["../src/setupGitPluginSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,eAAO,MAAM,WAAW,0BAA0B,CAAC;AACnD,sEAAsE;AACtE,eAAO,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"setupGitPluginSpec.d.ts","sourceRoot":"","sources":["../src/setupGitPluginSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,eAAO,MAAM,WAAW,0BAA0B,CAAC;AACnD,sEAAsE;AACtE,eAAO,MAAM,cAAc;;;CAGL,CAAC;AASvB;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CA+CtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halospv3/hce.shared-config",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4-develop.1",
|
|
4
4
|
"description": "Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"halo",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"@commitlint/config-conventional": "^19.2.2",
|
|
55
55
|
"@commitlint/types": "^19.0.3",
|
|
56
56
|
"@eslint/js": "^9.3.0",
|
|
57
|
-
"@octokit/request": "^9.1.0",
|
|
58
57
|
"@semantic-release/changelog": "^6.0.3",
|
|
59
58
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
60
59
|
"@semantic-release/exec": "^6.0.3",
|
|
@@ -62,13 +61,10 @@
|
|
|
62
61
|
"@semantic-release/github": "^10.0.4",
|
|
63
62
|
"@semantic-release/npm": "^12.0.0",
|
|
64
63
|
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
65
|
-
"@stylistic/eslint-plugin": "^
|
|
66
|
-
"@types/eslint__js": "^8.42.3",
|
|
64
|
+
"@stylistic/eslint-plugin": "^5.0.0",
|
|
67
65
|
"@types/js-yaml": "^4.0.9",
|
|
68
66
|
"@types/node": "^20.12.12",
|
|
69
67
|
"@types/semantic-release": "^20.0.6",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
71
|
-
"@typescript-eslint/parser": "^7.10.0",
|
|
72
68
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
73
69
|
"debug": "^4.3.4",
|
|
74
70
|
"eslint-plugin-jsonc": "^2.15.1",
|
|
@@ -78,7 +74,7 @@
|
|
|
78
74
|
"node-fetch": "^3.3.2",
|
|
79
75
|
"semantic-release": "^24.0.0",
|
|
80
76
|
"semantic-release-export-data": "^1.0.1",
|
|
81
|
-
"typescript-eslint": "^
|
|
77
|
+
"typescript-eslint": "^8.35.1"
|
|
82
78
|
},
|
|
83
79
|
"devDependencies": {
|
|
84
80
|
"@babel/cli": "^7.24.6",
|
|
@@ -88,12 +84,11 @@
|
|
|
88
84
|
"@tsconfig/node-lts": "^20.1.2",
|
|
89
85
|
"@types/babel__core": "^7.20.5",
|
|
90
86
|
"@types/debug": "^4.1.12",
|
|
91
|
-
"@types/eslint__eslintrc": "^2.1.1",
|
|
92
87
|
"@types/tmp": "^0.2.6",
|
|
93
88
|
"ajv": "^8.13.0",
|
|
94
89
|
"ajv-draft-04": "^1.0.0",
|
|
95
90
|
"dotenv": "^16.4.5",
|
|
96
|
-
"eslint": "^
|
|
91
|
+
"eslint": "^9.0.0",
|
|
97
92
|
"node-fetch": "^3.3.2",
|
|
98
93
|
"packemon": "^4.0.1",
|
|
99
94
|
"prettier": "^3.2.5",
|
package/src/dotnet/dotnetGHPR.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { promisify } from 'node:util';
|
|
1
|
+
import { ok } from 'node:assert/strict';
|
|
2
|
+
import { spawnSync, type ExecException, type SpawnSyncReturns } from 'node:child_process';
|
|
4
3
|
import { getEnvVarValue } from '../envUtils.js';
|
|
5
4
|
import { createDummyNupkg } from './createDummyNupkg.js';
|
|
6
5
|
import type { NuGetRegistryInfo } from './dotnetHelpers.js';
|
|
6
|
+
import { isNativeError } from 'node:util/types';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @param tokenEnvVar The name of the environment variable containing the NUGET token
|
|
9
|
+
* @param tokenEnvVar The name of the environment variable containing the NUGET token
|
|
10
10
|
* @returns `true` if the token can be used to push nupkg to the given Nuget registry
|
|
11
11
|
* @throws
|
|
12
12
|
* - TypeError: The environment variable ${tokenEnvVar} is undefined!
|
|
13
|
-
* - Error:
|
|
13
|
+
* - Error:
|
|
14
14
|
* - The value of the token in ${tokenEnvVar} begins with 'github_pat_' which means it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.
|
|
15
15
|
* - The GitHub API response header lacked "x-oauth-scopes". This indicates the token we provided is not a workflow token nor a Personal Access Token (classic) and can never have permission to push packages.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export function tokenCanWritePackages(tokenEnvVar: string, url?: string) {
|
|
18
18
|
/* double-check the token exists */
|
|
19
19
|
const info = isTokenDefined(tokenEnvVar);
|
|
20
20
|
ok(info.isDefined)
|
|
@@ -24,8 +24,8 @@ export async function tokenCanWritePackages(tokenEnvVar: string, url?: string) {
|
|
|
24
24
|
url = getNugetGitHubUrl();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if (url === undefined || url === '')
|
|
28
|
+
throw new Error('The NuGet source is undefined or empty!')
|
|
29
29
|
|
|
30
30
|
if (info.fallback)
|
|
31
31
|
tokenEnvVar = info.fallback;
|
|
@@ -38,23 +38,76 @@ export async function tokenCanWritePackages(tokenEnvVar: string, url?: string) {
|
|
|
38
38
|
throw new Error(`The value of the token in ${tokenEnvVar} begins with 'github_pat_' which means it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.`)
|
|
39
39
|
|
|
40
40
|
const dummyNupkgPath = createDummyNupkg();
|
|
41
|
-
const promiseExec = promisify(exec);
|
|
42
41
|
|
|
43
42
|
try {
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
let pushResult: SpawnSyncReturns<string> | undefined = undefined;
|
|
44
|
+
try {
|
|
45
|
+
pushResult = spawnSync(
|
|
46
|
+
'dotnet',
|
|
47
|
+
[
|
|
48
|
+
'nuget',
|
|
49
|
+
'push',
|
|
50
|
+
dummyNupkgPath,
|
|
51
|
+
'--source',
|
|
52
|
+
url,
|
|
53
|
+
'--api-key',
|
|
54
|
+
tokenValue,
|
|
55
|
+
'--skip-duplicate',
|
|
56
|
+
'--force-english-output'
|
|
57
|
+
],
|
|
58
|
+
{
|
|
59
|
+
stdio: 'pipe',
|
|
60
|
+
encoding: 'utf8',
|
|
61
|
+
shell: process.platform === 'win32' && spawnSync('dotnet.exe', { windowsHide: true }).status === null
|
|
62
|
+
? 'cmd.exe'
|
|
63
|
+
: undefined,
|
|
64
|
+
windowsHide: true,
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
catch (_error) {
|
|
69
|
+
// censor token
|
|
70
|
+
const error = !isNativeError(_error)
|
|
71
|
+
? new Error(`dotnet nuget push failed. \n${String(_error)}`)
|
|
72
|
+
: _error;
|
|
73
|
+
|
|
74
|
+
const tokenPattern = new RegExp(tokenValue, 'g');
|
|
75
|
+
|
|
76
|
+
error.message = error.message.replace(tokenPattern,'***');
|
|
77
|
+
|
|
78
|
+
if (error.stack)
|
|
79
|
+
error.stack = error.stack.replace(tokenPattern, '***');
|
|
80
|
+
if ('cmd' in error && typeof error.cmd === 'string')
|
|
81
|
+
error.cmd = error.cmd.replace(tokenPattern, '***');
|
|
82
|
+
if ('stdout' in error && typeof error.stdout === 'string')
|
|
83
|
+
error.stdout = error.stdout.replace(tokenPattern, '***');
|
|
84
|
+
if ('stderr' in error&& typeof error.stderr === 'string') {
|
|
85
|
+
error.stderr = error.stderr.replace(tokenPattern, '***');
|
|
86
|
+
}
|
|
87
|
+
if ('spawnargs' in error && Array.isArray(error.spawnargs)) {
|
|
88
|
+
error.spawnargs = error.spawnargs.map(arg => {
|
|
89
|
+
return typeof arg === 'string'
|
|
90
|
+
? arg.replace(tokenPattern, '***')
|
|
91
|
+
: arg;
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const errNewline = pushResult.stdout.includes('\r\n') ? '\r\n' : pushResult.stdout.includes('\r') ? '\r' : '\n';
|
|
46
99
|
|
|
47
100
|
// if any *lines* start with "error: " or "Error: ", log stderr
|
|
48
|
-
const errorCount = pushResult.
|
|
101
|
+
const errorCount = pushResult.stdout.split(errNewline).filter(line => line.trim().startsWith('error: ') || line.trim().startsWith('Error: ')).length;
|
|
49
102
|
if (errorCount > 0)
|
|
50
|
-
console.error(pushResult.
|
|
103
|
+
console.error(pushResult.stdout);
|
|
51
104
|
|
|
52
105
|
// if any lines start with "warn : ", log stdout
|
|
53
|
-
const warningCount = pushResult.stdout.split(errNewline
|
|
106
|
+
const warningCount = pushResult.stdout.split(errNewline).filter(line => line.trim().startsWith('warn : ')).length;
|
|
54
107
|
if (warningCount > 0)
|
|
55
108
|
console.warn(pushResult.stdout);
|
|
56
109
|
|
|
57
|
-
const hasAuthError = pushResult.
|
|
110
|
+
const hasAuthError = pushResult.stdout.includes('401 (Unauthorized)');
|
|
58
111
|
|
|
59
112
|
// return true is no lines contain error indicators.
|
|
60
113
|
return errorCount === 0 && hasAuthError === false;
|
|
@@ -86,7 +139,7 @@ export function getNugetGitHubUrl() {
|
|
|
86
139
|
}
|
|
87
140
|
|
|
88
141
|
/**
|
|
89
|
-
* If tokenEnvVar is NOT 'GITHUB_TOKEN', then test if the token is defined and return the boolean.
|
|
142
|
+
* If tokenEnvVar is NOT 'GITHUB_TOKEN', then test if the token is defined and return the boolean.
|
|
90
143
|
* Else If tokenEnvVar is 'GITHUB_TOKEN' and defined, then return true.
|
|
91
144
|
* Else If tokenEnvVar is 'GITHUB_TOKEN' and undefined, then set tokenEnvVar to 'GH_TOKEN', test if GH_TOKEN is defined, and return the boolean.
|
|
92
145
|
* @param tokenEnvVar the name of the environment variable with the token's value. Defaults to 'GITHUB_TOKEN'. If environment variable 'GITHUB_TOKEN' is undefined, falls back to 'GH_TOKEN'.
|
|
@@ -118,10 +171,10 @@ export function isTokenDefined(tokenEnvVar = 'GITHUB_TOKEN'): { isDefined: boole
|
|
|
118
171
|
* @returns {(NuGetRegistryInfo | undefined)} a {@link NuGetRegistryInfo} object if {@link tokenEnvVar} and {@link url} are defined. Else, `undefined`.
|
|
119
172
|
* note: `url` defaults to job's repository owner's GitHub registry in GitHub Actions workflow. If GITHUB_REPOSITORY_OWNER is not defined, then an error will be logged and `undefined` will be returned.
|
|
120
173
|
*/
|
|
121
|
-
export
|
|
174
|
+
export function getGithubNugetRegistryPair(
|
|
122
175
|
tokenEnvVar: string | 'GITHUB_TOKEN' | 'GH_TOKEN' = 'GITHUB_TOKEN',
|
|
123
176
|
url: string | undefined = getNugetGitHubUrl(),
|
|
124
|
-
):
|
|
177
|
+
): NuGetRegistryInfo | undefined {
|
|
125
178
|
const errors: Error[] = [];
|
|
126
179
|
const _isTokenDefinedInfo = isTokenDefined(tokenEnvVar);
|
|
127
180
|
let canTokenWritePackages = undefined;
|
|
@@ -140,7 +193,7 @@ export async function getGithubNugetRegistryPair(
|
|
|
140
193
|
if (_isTokenDefinedInfo.fallback)
|
|
141
194
|
tokenEnvVar = _isTokenDefinedInfo.fallback;
|
|
142
195
|
try {
|
|
143
|
-
canTokenWritePackages =
|
|
196
|
+
canTokenWritePackages = tokenCanWritePackages(tokenEnvVar, url);
|
|
144
197
|
}
|
|
145
198
|
catch (err) {
|
|
146
199
|
if (err instanceof Error)
|
|
@@ -150,17 +150,17 @@ export const nugetDefault: NuGetRegistryInfo = {
|
|
|
150
150
|
* @param pushToGitHub
|
|
151
151
|
* @returns
|
|
152
152
|
*/
|
|
153
|
-
export
|
|
153
|
+
export function configureDotnetNugetPush(
|
|
154
154
|
nupkgDir = './publish',
|
|
155
155
|
registries: NuGetRegistryInfo[] = [nugetDefault],
|
|
156
156
|
pushToGitHub = true,
|
|
157
|
-
) {
|
|
157
|
+
): string {
|
|
158
158
|
if (registries.some((registry) => registry.url.trim() === ''))
|
|
159
159
|
throw new Error('The URL for one of the provided NuGet registries was empty or whitespace.');
|
|
160
160
|
|
|
161
161
|
// if user did not specify a GitHub NuGet Registry, try determine default values and add the Source.
|
|
162
162
|
if (pushToGitHub && !registries.some((reg) => reg.url.startsWith(nugetGitHubUrlBase))) {
|
|
163
|
-
const ghPair =
|
|
163
|
+
const ghPair: NuGetRegistryInfo | undefined = getGithubNugetRegistryPair();
|
|
164
164
|
if (ghPair) {
|
|
165
165
|
registries.push(ghPair);
|
|
166
166
|
}
|
|
@@ -177,7 +177,7 @@ export async function configureDotnetNugetPush(
|
|
|
177
177
|
(registry) => {
|
|
178
178
|
const tokenValue = getEnvVarValue(registry.tokenEnvVar);
|
|
179
179
|
ok(getEnvVarValue('SKIP_TOKEN') === 'true' || tokenValue, `The environment variable ${registry.tokenEnvVar} is undefined!`);
|
|
180
|
-
`dotnet nuget push ${nupkgDir} --source ${registry.url} --token ${tokenValue ?? '**placeholder**'}`
|
|
180
|
+
return `dotnet nuget push ${nupkgDir} --source ${registry.url} --token ${tokenValue ?? '**placeholder**'}`
|
|
181
181
|
}
|
|
182
182
|
)
|
|
183
183
|
.join(' && ');
|
package/src/eslintConfig.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import eslint from "@eslint/js";
|
|
2
|
-
import { type TSESLint } from "@typescript-eslint/utils";
|
|
3
2
|
import jsonc from "eslint-plugin-jsonc";
|
|
4
3
|
import { createRequire } from "module";
|
|
5
|
-
import tseslint from "typescript-eslint";
|
|
4
|
+
import tseslint, { type ConfigWithExtends } from "typescript-eslint";
|
|
6
5
|
|
|
7
6
|
// CJS compatibility; it started transpiling to a top-level await after upgrading from packemon 4.0.1 to 4.1.0
|
|
8
7
|
const require = createRequire(import.meta.url);
|
|
9
8
|
const globals = require("globals") as typeof import("globals", {with: {type: "json"}});
|
|
10
9
|
// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
|
|
11
10
|
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
|
|
12
|
-
|
|
13
|
-
const globalIgnores: TSESLint.FlatConfig.Config = {
|
|
11
|
+
const globalIgnores: ConfigWithExtends = {
|
|
14
12
|
name: "global ignores",
|
|
15
13
|
ignores: [
|
|
16
14
|
"_tsout/**/*",
|
|
@@ -58,7 +56,7 @@ export default tseslint.config(
|
|
|
58
56
|
{
|
|
59
57
|
name: "TSJS",
|
|
60
58
|
extends: [
|
|
61
|
-
eslint.configs.recommended as
|
|
59
|
+
eslint.configs.recommended as ConfigWithExtends,
|
|
62
60
|
...tseslint.configs.strict,
|
|
63
61
|
...tseslint.configs.stylistic
|
|
64
62
|
],
|
|
@@ -73,14 +71,7 @@ export default tseslint.config(
|
|
|
73
71
|
ignores: globalIgnores.ignores,
|
|
74
72
|
languageOptions: {
|
|
75
73
|
parserOptions: {
|
|
76
|
-
|
|
77
|
-
// @ts-expect-error TS2322 Type '{ allowDefaultProjectForFiles: string[]; }' is not assignable to type 'boolean | undefined'.
|
|
78
|
-
EXPERIMENTAL_useProjectService: {
|
|
79
|
-
allowDefaultProjectForFiles: [
|
|
80
|
-
"./*.js"
|
|
81
|
-
],
|
|
82
|
-
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
|
|
83
|
-
}
|
|
74
|
+
useProjectService: true
|
|
84
75
|
},
|
|
85
76
|
globals: globals.node
|
|
86
77
|
}
|
|
@@ -5,7 +5,6 @@ export const GitPluginId = '@semantic-release/git';
|
|
|
5
5
|
/** As specified at https://github.com/semantic-release/git#options */
|
|
6
6
|
export const DefaultOptions = {
|
|
7
7
|
assets: ['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'],
|
|
8
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
9
8
|
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
|
|
10
9
|
} satisfies GitOptions;
|
|
11
10
|
|