nerdbank-gitversioning 3.7.70-alpha → 3.7.77-alpha
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/asyncio.js +30 -19
- package/asyncio.js.map +1 -1
- package/asyncprocess.d.ts +0 -1
- package/asyncprocess.js +25 -3
- package/asyncprocess.js.map +1 -1
- package/core.js +25 -3
- package/core.js.map +1 -1
- package/index.js +31 -47
- package/index.js.map +1 -1
- package/nbgv.cli/tools/net6.0/any/Nerdbank.GitVersioning.dll +0 -0
- package/nbgv.cli/tools/net6.0/any/Nerdbank.GitVersioning.pdb +0 -0
- package/nbgv.cli/tools/net6.0/any/System.Text.Json.dll +0 -0
- package/nbgv.cli/tools/net6.0/any/nbgv.deps.json +21 -51
- package/nbgv.cli/tools/net6.0/any/nbgv.dll +0 -0
- package/nbgv.cli/tools/net6.0/any/nbgv.exe +0 -0
- package/npmVersion.js +27 -13
- package/npmVersion.js.map +1 -1
- package/package.json +5 -7
package/asyncio.js
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
'use string';
|
|
2
2
|
"use strict";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
11
25
|
};
|
|
12
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
14
|
-
|
|
27
|
+
exports.existsAsync = existsAsync;
|
|
28
|
+
exports.mkdirAsync = mkdirAsync;
|
|
29
|
+
exports.mkdirIfNotExistAsync = mkdirIfNotExistAsync;
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
15
31
|
function existsAsync(path) {
|
|
16
32
|
return new Promise(resolve => fs.exists(path, resolve));
|
|
17
33
|
}
|
|
18
|
-
exports.existsAsync = existsAsync;
|
|
19
34
|
;
|
|
20
35
|
function mkdirAsync(path) {
|
|
21
36
|
return new Promise((resolve, reject) => fs.mkdir(path, err => {
|
|
@@ -27,14 +42,10 @@ function mkdirAsync(path) {
|
|
|
27
42
|
}
|
|
28
43
|
}));
|
|
29
44
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
yield mkdirAsync(path);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
45
|
+
async function mkdirIfNotExistAsync(path) {
|
|
46
|
+
if (!(await existsAsync(path))) {
|
|
47
|
+
await mkdirAsync(path);
|
|
48
|
+
}
|
|
37
49
|
}
|
|
38
|
-
exports.mkdirIfNotExistAsync = mkdirIfNotExistAsync;
|
|
39
50
|
|
|
40
51
|
//# sourceMappingURL=asyncio.js.map
|
package/asyncio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/asyncio.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"sources":["../ts/asyncio.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAIb,kCAEC;AAED,gCAIC;AAED,oDAIC;AAhBD,uCAAyB;AAEzB,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,IAAI,OAAO,CAAU,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAAA,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAY;IACnC,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;QAC9D,IAAI,GAAG,EAAE,CAAC;YAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;aAAM,CAAC;YAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;IACpD,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,IAAY;IACnD,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC7B,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC","file":"asyncio.js","sourcesContent":["'use string';\r\n\r\nimport * as fs from 'fs';\r\n\r\nexport function existsAsync(path: string) {\r\n return new Promise<boolean>(resolve => fs.exists(path, resolve));\r\n};\r\n\r\nexport function mkdirAsync(path: string) {\r\n return new Promise<any>((resolve, reject) => fs.mkdir(path, err => {\r\n if (err) { reject(err); } else { resolve(null) }\r\n }));\r\n}\r\n\r\nexport async function mkdirIfNotExistAsync(path: string) {\r\n if (!(await existsAsync(path))) {\r\n await mkdirAsync(path);\r\n }\r\n}\r\n"]}
|
package/asyncprocess.d.ts
CHANGED
package/asyncprocess.js
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.execAsync =
|
|
4
|
-
const cp = require("child_process");
|
|
26
|
+
exports.execAsync = execAsync;
|
|
27
|
+
const cp = __importStar(require("child_process"));
|
|
5
28
|
function execAsync(command, options) {
|
|
6
29
|
return new Promise((resolve, reject) => cp.exec(command, options, (error, stdout, stderr) => {
|
|
7
30
|
if (error) {
|
|
@@ -12,7 +35,6 @@ function execAsync(command, options) {
|
|
|
12
35
|
}
|
|
13
36
|
}));
|
|
14
37
|
}
|
|
15
|
-
exports.execAsync = execAsync;
|
|
16
38
|
;
|
|
17
39
|
|
|
18
40
|
//# sourceMappingURL=asyncprocess.js.map
|
package/asyncprocess.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/asyncprocess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../ts/asyncprocess.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,8BASC;AAhBD,kDAAoC;AAOpC,SAAgB,SAAS,CAAC,OAAe,EAAE,OAAwB;IAC/D,OAAO,IAAI,OAAO,CACd,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACrE,IAAI,KAAK,EAAE,CAAC;YACR,MAAM,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,CAAC;IACL,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC;AAAA,CAAC","file":"asyncprocess.js","sourcesContent":["import * as cp from 'child_process';\r\n\r\nexport interface IExecAsyncResult {\r\n stdout: string;\r\n stderr: string;\r\n}\r\n\r\nexport function execAsync(command: string, options?: cp.ExecOptions) {\r\n return new Promise<IExecAsyncResult>(\r\n (resolve, reject) => cp.exec(command, options, (error, stdout, stderr) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve({ stdout: stdout, stderr: stderr });\r\n }\r\n }));\r\n};\r\n"]}
|
package/core.js
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNbgvCommand =
|
|
4
|
-
const path = require("path");
|
|
26
|
+
exports.getNbgvCommand = getNbgvCommand;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
5
28
|
const nbgvPath = 'nbgv.cli';
|
|
6
29
|
function getNbgvCommand(dotnetCommand) {
|
|
7
30
|
var command = dotnetCommand || 'dotnet';
|
|
8
31
|
const nbgvDll = path.join(__dirname, nbgvPath, "tools", "net6.0", "any", "nbgv.dll");
|
|
9
32
|
return `${command} "${nbgvDll}"`;
|
|
10
33
|
}
|
|
11
|
-
exports.getNbgvCommand = getNbgvCommand;
|
|
12
34
|
|
|
13
35
|
//# sourceMappingURL=core.js.map
|
package/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../ts/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wCAIC;AARD,2CAA6B;AAE7B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B,SAAgB,cAAc,CAAC,aAAsB;IACjD,IAAI,OAAO,GAAG,aAAa,IAAI,QAAQ,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACrF,OAAO,GAAG,OAAO,KAAK,OAAO,GAAG,CAAC;AACrC,CAAC","file":"core.js","sourcesContent":["import * as fs from 'fs';\r\nimport * as path from 'path';\r\n\r\nconst nbgvPath = 'nbgv.cli';\r\n\r\nexport function getNbgvCommand(dotnetCommand?: string): string {\r\n var command = dotnetCommand || 'dotnet';\r\n const nbgvDll = path.join(__dirname, nbgvPath, \"tools\", \"net6.0\", \"any\", \"nbgv.dll\");\r\n return `${command} \"${nbgvDll}\"`;\r\n}\r\n"]}
|
package/index.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
|
|
3
|
+
exports.getVersion = getVersion;
|
|
4
|
+
exports.setPackageVersion = setPackageVersion;
|
|
5
|
+
exports.resetPackageVersionPlaceholder = resetPackageVersionPlaceholder;
|
|
14
6
|
const asyncprocess_1 = require("./asyncprocess");
|
|
15
7
|
const core_1 = require("./core");
|
|
16
8
|
/**
|
|
@@ -18,55 +10,47 @@ const core_1 = require("./core");
|
|
|
18
10
|
* @param projectDirectory The directory of the source code to get the version of.
|
|
19
11
|
* @param dotnetCommand The location of the dotnet command line executable
|
|
20
12
|
*/
|
|
21
|
-
function getVersion(projectDirectory, dotnetCommand) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
13
|
+
async function getVersion(projectDirectory, dotnetCommand) {
|
|
14
|
+
projectDirectory = projectDirectory || '.';
|
|
15
|
+
var versionText = await (0, asyncprocess_1.execAsync)(`${(0, core_1.getNbgvCommand)(dotnetCommand)} get-version --format json`, { cwd: projectDirectory });
|
|
16
|
+
if (versionText.stderr) {
|
|
17
|
+
throw versionText.stderr;
|
|
18
|
+
}
|
|
19
|
+
var directResult = JSON.parse(versionText.stdout);
|
|
20
|
+
var result = {};
|
|
21
|
+
for (var field in directResult) {
|
|
22
|
+
const camelCaseFieldName = field.charAt(0).toLowerCase() + field.slice(1);
|
|
23
|
+
result[camelCaseFieldName] = directResult[field];
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
35
26
|
}
|
|
36
|
-
exports.getVersion = getVersion;
|
|
37
27
|
/**
|
|
38
28
|
* Sets an NPM package version based on the git height and version.json.
|
|
39
29
|
* @param packageDirectory The directory of the package about to be published.
|
|
40
30
|
* @param srcDirectory The directory of the source code behind the package, if different than the packageDirectory.
|
|
41
31
|
* @param dotnetCommand The location of the dotnet command line executable
|
|
42
32
|
*/
|
|
43
|
-
function setPackageVersion(packageDirectory, srcDirectory, dotnetCommand) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
});
|
|
33
|
+
async function setPackageVersion(packageDirectory, srcDirectory, dotnetCommand) {
|
|
34
|
+
packageDirectory = packageDirectory || '.';
|
|
35
|
+
srcDirectory = srcDirectory || packageDirectory;
|
|
36
|
+
const gitVersion = await getVersion(srcDirectory, dotnetCommand);
|
|
37
|
+
console.log(`Setting package version to ${gitVersion.npmPackageVersion}`);
|
|
38
|
+
var result = await (0, asyncprocess_1.execAsync)(`npm version ${gitVersion.npmPackageVersion} --no-git-tag-version --allow-same-version`, { cwd: packageDirectory });
|
|
39
|
+
if (result.stderr) {
|
|
40
|
+
console.log(result.stderr);
|
|
41
|
+
}
|
|
54
42
|
}
|
|
55
|
-
exports.setPackageVersion = setPackageVersion;
|
|
56
43
|
/**
|
|
57
44
|
* Sets the package version to 0.0.0-placeholder, so as to obviously indicate
|
|
58
45
|
* that the version isn't set in the source code version of package.json.
|
|
59
46
|
* @param srcDirectory The directory of the source code behind the package, if different.
|
|
60
47
|
*/
|
|
61
|
-
function resetPackageVersionPlaceholder(srcDirectory) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
48
|
+
async function resetPackageVersionPlaceholder(srcDirectory) {
|
|
49
|
+
srcDirectory = srcDirectory || '.';
|
|
50
|
+
var result = await (0, asyncprocess_1.execAsync)(`npm version 0.0.0-placeholder --no-git-tag-version --allow-same-version`, { cwd: srcDirectory });
|
|
51
|
+
if (result.stderr) {
|
|
52
|
+
console.log(result.stderr);
|
|
53
|
+
}
|
|
69
54
|
}
|
|
70
|
-
exports.resetPackageVersionPlaceholder = resetPackageVersionPlaceholder;
|
|
71
55
|
|
|
72
56
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAuCb,gCAeC;AAQD,8CASC;AAOD,wEAMC;AAlFD,iDAA2C;AAC3C,iCAAwC;AA+BxC;;;;GAIG;AACI,KAAK,UAAU,UAAU,CAAC,gBAAyB,EAAE,aAAsB;IAC9E,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC;IAC3C,IAAI,WAAW,GAAG,MAAM,IAAA,wBAAS,EAAC,GAAG,IAAA,qBAAc,EAAC,aAAa,CAAC,4BAA4B,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAA;IAC1H,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,WAAW,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,KAAK,IAAI,YAAY,EAAE,CAAC;QAC7B,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,kBAAkB,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;IAED,OAAoB,MAAM,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAC,gBAAyB,EAAE,YAAqB,EAAE,aAAsB;IAC5G,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC;IAC3C,YAAY,GAAG,YAAY,IAAI,gBAAgB,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,8BAA8B,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC1E,IAAI,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,eAAe,UAAU,CAAC,iBAAiB,4CAA4C,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACjJ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;AACL,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,8BAA8B,CAAC,YAAqB;IACtE,YAAY,GAAG,YAAY,IAAI,GAAG,CAAC;IACnC,IAAI,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,yEAAyE,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/H,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;AACL,CAAC","file":"index.js","sourcesContent":["'use strict';\r\n\r\nimport { execAsync } from './asyncprocess';\r\nimport { getNbgvCommand } from './core';\r\n\r\n/**\r\n * The various aspects of a version that can be calculated.\r\n */\r\nexport interface IGitVersion {\r\n cloudBuildNumber: string,\r\n cloudBuildNumberEnabled: boolean,\r\n buildMetadataWithCommitId: string,\r\n assemblyVersion: string,\r\n assemblyFileVersion: string,\r\n assemblyInformationalVersion: string,\r\n publicRelease: boolean,\r\n prereleaseVersion: string,\r\n simpleVersion: string,\r\n buildNumber: string,\r\n majorMinorVersion: string,\r\n gitCommitId: string,\r\n gitCommitIdShort: string,\r\n versionHeight: string,\r\n version: string,\r\n cloudBuildVersionVarsEnabled: boolean,\r\n cloudBuildVersionVars: string,\r\n buildMetadata: string,\r\n buildMetadataFragment: string,\r\n nuGetPackageVersion: string,\r\n npmPackageVersion: string,\r\n semVer1: string,\r\n semVer2: string\r\n}\r\n\r\n/**\r\n * Gets an object describing various aspects of the version of a project.\r\n * @param projectDirectory The directory of the source code to get the version of.\r\n * @param dotnetCommand The location of the dotnet command line executable\r\n */\r\nexport async function getVersion(projectDirectory?: string, dotnetCommand?: string): Promise<IGitVersion> {\r\n projectDirectory = projectDirectory || '.';\r\n var versionText = await execAsync(`${getNbgvCommand(dotnetCommand)} get-version --format json`, { cwd: projectDirectory })\r\n if (versionText.stderr) {\r\n throw versionText.stderr;\r\n }\r\n\r\n var directResult = JSON.parse(versionText.stdout);\r\n var result = {};\r\n for (var field in directResult) {\r\n const camelCaseFieldName = field.charAt(0).toLowerCase() + field.slice(1);\r\n result[camelCaseFieldName] = directResult[field];\r\n }\r\n\r\n return <IGitVersion>result;\r\n}\r\n\r\n/**\r\n * Sets an NPM package version based on the git height and version.json.\r\n * @param packageDirectory The directory of the package about to be published.\r\n * @param srcDirectory The directory of the source code behind the package, if different than the packageDirectory.\r\n * @param dotnetCommand The location of the dotnet command line executable\r\n */\r\nexport async function setPackageVersion(packageDirectory?: string, srcDirectory?: string, dotnetCommand?: string) {\r\n packageDirectory = packageDirectory || '.';\r\n srcDirectory = srcDirectory || packageDirectory;\r\n const gitVersion = await getVersion(srcDirectory, dotnetCommand);\r\n console.log(`Setting package version to ${gitVersion.npmPackageVersion}`);\r\n var result = await execAsync(`npm version ${gitVersion.npmPackageVersion} --no-git-tag-version --allow-same-version`, { cwd: packageDirectory });\r\n if (result.stderr) {\r\n console.log(result.stderr);\r\n }\r\n}\r\n\r\n/**\r\n * Sets the package version to 0.0.0-placeholder, so as to obviously indicate\r\n * that the version isn't set in the source code version of package.json.\r\n * @param srcDirectory The directory of the source code behind the package, if different.\r\n */\r\nexport async function resetPackageVersionPlaceholder(srcDirectory?: string) {\r\n srcDirectory = srcDirectory || '.';\r\n var result = await execAsync(`npm version 0.0.0-placeholder --no-git-tag-version --allow-same-version`, { cwd: srcDirectory });\r\n if (result.stderr) {\r\n console.log(result.stderr);\r\n }\r\n}\r\n"]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
"compilationOptions": {},
|
|
7
7
|
"targets": {
|
|
8
8
|
".NETCoreApp,Version=v6.0": {
|
|
9
|
-
"nbgv/3.7.
|
|
9
|
+
"nbgv/3.7.77-alpha": {
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"CSharpIsNullAnalyzer": "0.1.
|
|
11
|
+
"CSharpIsNullAnalyzer": "0.1.593",
|
|
12
12
|
"DotNetAnalyzers.DocumentationAnalyzers": "1.0.0-beta.59",
|
|
13
13
|
"Microsoft.Build": "16.11.0",
|
|
14
|
-
"Microsoft.SourceLink.GitHub": "8.0.0",
|
|
15
14
|
"Nerdbank.GitVersioning.Core": "1.0.0",
|
|
16
15
|
"Nerdbank.GitVersioning.LKG": "3.4.173-alpha",
|
|
17
16
|
"NuGet.PackageManagement": "6.9.1",
|
|
@@ -19,13 +18,13 @@
|
|
|
19
18
|
"StyleCop.Analyzers.Unstable": "1.2.0.556",
|
|
20
19
|
"System.CommandLine": "2.0.0-beta4.22272.1",
|
|
21
20
|
"System.Diagnostics.Tools": "4.3.0",
|
|
22
|
-
"Nerdbank.GitVersioning": "3.7.
|
|
21
|
+
"Nerdbank.GitVersioning": "3.7.77.5761"
|
|
23
22
|
},
|
|
24
23
|
"runtime": {
|
|
25
24
|
"nbgv.dll": {}
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
|
-
"CSharpIsNullAnalyzer/0.1.
|
|
27
|
+
"CSharpIsNullAnalyzer/0.1.593": {},
|
|
29
28
|
"DotNetAnalyzers.DocumentationAnalyzers/1.0.0-beta.59": {
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"DotNetAnalyzers.DocumentationAnalyzers.Unstable": "1.0.0.59"
|
|
@@ -112,7 +111,7 @@
|
|
|
112
111
|
"System.Reflection.Metadata": "1.6.0",
|
|
113
112
|
"System.Security.Principal.Windows": "4.7.0",
|
|
114
113
|
"System.Text.Encoding.CodePages": "4.0.1",
|
|
115
|
-
"System.Text.Json": "8.0.
|
|
114
|
+
"System.Text.Json": "8.0.4",
|
|
116
115
|
"System.Threading.Tasks.Dataflow": "8.0.0"
|
|
117
116
|
},
|
|
118
117
|
"runtime": {
|
|
@@ -133,7 +132,6 @@
|
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
},
|
|
136
|
-
"Microsoft.Build.Tasks.Git/8.0.0": {},
|
|
137
135
|
"Microsoft.CSharp/4.3.0": {
|
|
138
136
|
"dependencies": {
|
|
139
137
|
"System.Collections": "4.3.0",
|
|
@@ -206,13 +204,6 @@
|
|
|
206
204
|
},
|
|
207
205
|
"Microsoft.NETCore.Platforms/3.1.0": {},
|
|
208
206
|
"Microsoft.NETCore.Targets/1.1.0": {},
|
|
209
|
-
"Microsoft.SourceLink.Common/8.0.0": {},
|
|
210
|
-
"Microsoft.SourceLink.GitHub/8.0.0": {
|
|
211
|
-
"dependencies": {
|
|
212
|
-
"Microsoft.Build.Tasks.Git": "8.0.0",
|
|
213
|
-
"Microsoft.SourceLink.Common": "8.0.0"
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
207
|
"Microsoft.Web.Xdt/3.0.0": {
|
|
217
208
|
"runtime": {
|
|
218
209
|
"lib/netstandard2.0/Microsoft.Web.XmlTransform.dll": {
|
|
@@ -800,7 +791,7 @@
|
|
|
800
791
|
}
|
|
801
792
|
}
|
|
802
793
|
},
|
|
803
|
-
"System.Text.Json/8.0.
|
|
794
|
+
"System.Text.Json/8.0.4": {
|
|
804
795
|
"dependencies": {
|
|
805
796
|
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
|
|
806
797
|
"System.Text.Encodings.Web": "8.0.0"
|
|
@@ -808,7 +799,7 @@
|
|
|
808
799
|
"runtime": {
|
|
809
800
|
"lib/net6.0/System.Text.Json.dll": {
|
|
810
801
|
"assemblyVersion": "8.0.0.0",
|
|
811
|
-
"fileVersion": "8.0.
|
|
802
|
+
"fileVersion": "8.0.724.31311"
|
|
812
803
|
}
|
|
813
804
|
}
|
|
814
805
|
},
|
|
@@ -866,35 +857,35 @@
|
|
|
866
857
|
"Microsoft.DotNet.PlatformAbstractions": "3.1.6",
|
|
867
858
|
"Nerdbank.GitVersioning.LKG": "3.4.173-alpha",
|
|
868
859
|
"Newtonsoft.Json": "13.0.3",
|
|
869
|
-
"System.Text.Json": "8.0.
|
|
860
|
+
"System.Text.Json": "8.0.4",
|
|
870
861
|
"Validation": "2.5.51"
|
|
871
862
|
},
|
|
872
863
|
"runtime": {
|
|
873
864
|
"Nerdbank.GitVersioning.dll": {}
|
|
874
865
|
}
|
|
875
866
|
},
|
|
876
|
-
"Nerdbank.GitVersioning/3.7.
|
|
867
|
+
"Nerdbank.GitVersioning/3.7.77.5761": {
|
|
877
868
|
"runtime": {
|
|
878
869
|
"Nerdbank.GitVersioning.dll": {
|
|
879
|
-
"assemblyVersion": "3.7.
|
|
880
|
-
"fileVersion": "3.7.
|
|
870
|
+
"assemblyVersion": "3.7.77.5761",
|
|
871
|
+
"fileVersion": "3.7.77.5761"
|
|
881
872
|
}
|
|
882
873
|
}
|
|
883
874
|
}
|
|
884
875
|
}
|
|
885
876
|
},
|
|
886
877
|
"libraries": {
|
|
887
|
-
"nbgv/3.7.
|
|
878
|
+
"nbgv/3.7.77-alpha": {
|
|
888
879
|
"type": "project",
|
|
889
880
|
"serviceable": false,
|
|
890
881
|
"sha512": ""
|
|
891
882
|
},
|
|
892
|
-
"CSharpIsNullAnalyzer/0.1.
|
|
883
|
+
"CSharpIsNullAnalyzer/0.1.593": {
|
|
893
884
|
"type": "package",
|
|
894
885
|
"serviceable": true,
|
|
895
|
-
"sha512": "sha512-
|
|
896
|
-
"path": "csharpisnullanalyzer/0.1.
|
|
897
|
-
"hashPath": "csharpisnullanalyzer.0.1.
|
|
886
|
+
"sha512": "sha512-iNPmcgZy7dPCtbKET2/aCq47NECBZG2brIXTW1AleFysxHufmRE3Xy30AlJtfbKzMrRU4MO8cu04c7MfGeUDjg==",
|
|
887
|
+
"path": "csharpisnullanalyzer/0.1.593",
|
|
888
|
+
"hashPath": "csharpisnullanalyzer.0.1.593.nupkg.sha512"
|
|
898
889
|
},
|
|
899
890
|
"DotNetAnalyzers.DocumentationAnalyzers/1.0.0-beta.59": {
|
|
900
891
|
"type": "package",
|
|
@@ -938,13 +929,6 @@
|
|
|
938
929
|
"path": "microsoft.build.framework/16.11.0",
|
|
939
930
|
"hashPath": "microsoft.build.framework.16.11.0.nupkg.sha512"
|
|
940
931
|
},
|
|
941
|
-
"Microsoft.Build.Tasks.Git/8.0.0": {
|
|
942
|
-
"type": "package",
|
|
943
|
-
"serviceable": true,
|
|
944
|
-
"sha512": "sha512-bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==",
|
|
945
|
-
"path": "microsoft.build.tasks.git/8.0.0",
|
|
946
|
-
"hashPath": "microsoft.build.tasks.git.8.0.0.nupkg.sha512"
|
|
947
|
-
},
|
|
948
932
|
"Microsoft.CSharp/4.3.0": {
|
|
949
933
|
"type": "package",
|
|
950
934
|
"serviceable": true,
|
|
@@ -1001,20 +985,6 @@
|
|
|
1001
985
|
"path": "microsoft.netcore.targets/1.1.0",
|
|
1002
986
|
"hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512"
|
|
1003
987
|
},
|
|
1004
|
-
"Microsoft.SourceLink.Common/8.0.0": {
|
|
1005
|
-
"type": "package",
|
|
1006
|
-
"serviceable": true,
|
|
1007
|
-
"sha512": "sha512-dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==",
|
|
1008
|
-
"path": "microsoft.sourcelink.common/8.0.0",
|
|
1009
|
-
"hashPath": "microsoft.sourcelink.common.8.0.0.nupkg.sha512"
|
|
1010
|
-
},
|
|
1011
|
-
"Microsoft.SourceLink.GitHub/8.0.0": {
|
|
1012
|
-
"type": "package",
|
|
1013
|
-
"serviceable": true,
|
|
1014
|
-
"sha512": "sha512-G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
|
|
1015
|
-
"path": "microsoft.sourcelink.github/8.0.0",
|
|
1016
|
-
"hashPath": "microsoft.sourcelink.github.8.0.0.nupkg.sha512"
|
|
1017
|
-
},
|
|
1018
988
|
"Microsoft.Web.Xdt/3.0.0": {
|
|
1019
989
|
"type": "package",
|
|
1020
990
|
"serviceable": true,
|
|
@@ -1421,12 +1391,12 @@
|
|
|
1421
1391
|
"path": "system.text.encodings.web/8.0.0",
|
|
1422
1392
|
"hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512"
|
|
1423
1393
|
},
|
|
1424
|
-
"System.Text.Json/8.0.
|
|
1394
|
+
"System.Text.Json/8.0.4": {
|
|
1425
1395
|
"type": "package",
|
|
1426
1396
|
"serviceable": true,
|
|
1427
|
-
"sha512": "sha512-
|
|
1428
|
-
"path": "system.text.json/8.0.
|
|
1429
|
-
"hashPath": "system.text.json.8.0.
|
|
1397
|
+
"sha512": "sha512-bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
|
|
1398
|
+
"path": "system.text.json/8.0.4",
|
|
1399
|
+
"hashPath": "system.text.json.8.0.4.nupkg.sha512"
|
|
1430
1400
|
},
|
|
1431
1401
|
"System.Threading/4.3.0": {
|
|
1432
1402
|
"type": "package",
|
|
@@ -1468,7 +1438,7 @@
|
|
|
1468
1438
|
"serviceable": false,
|
|
1469
1439
|
"sha512": ""
|
|
1470
1440
|
},
|
|
1471
|
-
"Nerdbank.GitVersioning/3.7.
|
|
1441
|
+
"Nerdbank.GitVersioning/3.7.77.5761": {
|
|
1472
1442
|
"type": "reference",
|
|
1473
1443
|
"serviceable": false,
|
|
1474
1444
|
"sha512": ""
|
|
Binary file
|
|
Binary file
|
package/npmVersion.js
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
11
25
|
};
|
|
12
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const lib = require("./index");
|
|
14
|
-
(() =>
|
|
27
|
+
const lib = __importStar(require("./index"));
|
|
28
|
+
(async () => {
|
|
15
29
|
if (process.argv[2] === '--reset') {
|
|
16
|
-
|
|
30
|
+
await lib.resetPackageVersionPlaceholder();
|
|
17
31
|
}
|
|
18
32
|
else {
|
|
19
|
-
|
|
33
|
+
await lib.setPackageVersion();
|
|
20
34
|
}
|
|
21
|
-
})
|
|
35
|
+
})();
|
|
22
36
|
|
|
23
37
|
//# sourceMappingURL=npmVersion.js.map
|
package/npmVersion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/npmVersion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../ts/npmVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA8B;AAE9B,CAAC,KAAK,IAAI,EAAE;IACR,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,GAAG,CAAC,8BAA8B,EAAE,CAAC;IAC/C,CAAC;SAAM,CAAC;QACJ,MAAM,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;AACL,CAAC,CAAC,EAAE,CAAC","file":"npmVersion.js","sourcesContent":["#!/usr/bin/env node\r\n\r\nimport * as lib from './index'\r\n\r\n(async () => {\r\n if (process.argv[2] === '--reset') {\r\n await lib.resetPackageVersionPlaceholder();\r\n } else {\r\n await lib.setPackageVersion();\r\n }\r\n})();\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nerdbank-gitversioning",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.77-alpha",
|
|
4
4
|
"description": "Stamps your NPM packages with semver 2.0 compliant git commit specific version information.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Andrew Arnott",
|
|
@@ -24,21 +24,19 @@
|
|
|
24
24
|
"versioning"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/camel-case": "^1.2.1",
|
|
28
27
|
"@types/node": "^18.7.14",
|
|
29
|
-
"del": "^7.
|
|
30
|
-
"gulp": "^
|
|
28
|
+
"del": "^7.1.0",
|
|
29
|
+
"gulp": "^5.0.0",
|
|
31
30
|
"gulp-cli": "^3.0.0",
|
|
32
31
|
"gulp-sourcemaps": "3.0.0",
|
|
33
32
|
"gulp-typescript": "^5.0.1",
|
|
34
33
|
"gulp-util": "^3.0.8",
|
|
35
34
|
"merge2": "^1.4.1",
|
|
36
35
|
"path": "^0.12.7",
|
|
36
|
+
"source-map": "^0.7.4",
|
|
37
37
|
"typescript": "^5.0.4"
|
|
38
38
|
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"camel-case": "^4.1.2"
|
|
41
|
-
},
|
|
39
|
+
"dependencies": {},
|
|
42
40
|
"scripts": {
|
|
43
41
|
"build": "gulp"
|
|
44
42
|
}
|