@itwin/build-tools 4.0.0-dev.61 → 4.0.0-dev.66
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/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@itwin/build-tools",
|
3
|
-
"version": "4.0.0-dev.
|
3
|
+
"version": "4.0.0-dev.66",
|
4
4
|
"description": "Bentley build tools",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
8
|
-
"url": "https://github.com/iTwin/itwinjs-core
|
8
|
+
"url": "https://github.com/iTwin/itwinjs-core.git",
|
9
|
+
"directory": "tools/build"
|
9
10
|
},
|
10
11
|
"bin": {
|
11
12
|
"betools": "bin/betools.js"
|
@@ -52,7 +53,6 @@
|
|
52
53
|
},
|
53
54
|
"scripts": {
|
54
55
|
"build": "tsc 1>&2",
|
55
|
-
"build:ci": "npm run -s build",
|
56
56
|
"clean": "rimraf ../../modules .rush/temp/package-deps*.json",
|
57
57
|
"docs": "",
|
58
58
|
"lint": "eslint -f visualstudio --config package.json --no-eslintrc \"./src/**/*.ts\" 1>&2",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
5
5
|
|
6
6
|
const FS = require("fs-extra");
|
7
7
|
const path = require("path");
|
@@ -10,7 +10,7 @@ const path = require("path");
|
|
10
10
|
// so find the project root using rush env variable if available.
|
11
11
|
const rootPackageJson = process.env.RUSHSTACK_FILE_ERROR_BASE_FOLDER
|
12
12
|
? path.join(process.env.RUSHSTACK_FILE_ERROR_BASE_FOLDER, "package.json")
|
13
|
-
: "../../../../package.json"
|
13
|
+
: "../../../../package.json";
|
14
14
|
|
15
15
|
// Check if path to root package.json is valid.
|
16
16
|
const rootPackageJsonPath = require.resolve(rootPackageJson);
|
@@ -20,9 +20,10 @@ const packageJsonPath = path.join(process.cwd(), "package.json");
|
|
20
20
|
const packageJson = JSON.parse(FS.readFileSync(packageJsonPath));
|
21
21
|
const version = packageJson.version;
|
22
22
|
const repositoryUrl = packageJson.repository?.url;
|
23
|
+
const repositoryDirectory = packageJson.repository?.directory;
|
23
24
|
|
24
|
-
if (!version || !repositoryUrl) {
|
25
|
-
throw new Error(
|
25
|
+
if (!version || !repositoryUrl || !repositoryDirectory) {
|
26
|
+
throw new Error("version or repository info not found in package.json");
|
26
27
|
}
|
27
28
|
|
28
29
|
// Appends the directory of the package root to the Typedoc JSON output
|
@@ -32,11 +33,14 @@ function addPackageMetadata(file, directory) {
|
|
32
33
|
const pathToRootFolder = path.dirname(rootPackageJsonPath);
|
33
34
|
const packageRoot = directory.substring(pathToRootFolder.length + 1);
|
34
35
|
const jsonContents = JSON.parse(contents);
|
36
|
+
|
35
37
|
jsonContents["packageRoot"] = packageRoot.endsWith("src")
|
36
38
|
? packageRoot
|
37
39
|
: `${packageRoot}\\${"src"}`;
|
38
40
|
jsonContents["version"] = version;
|
39
41
|
jsonContents["repositoryUrl"] = repositoryUrl;
|
42
|
+
jsonContents["repositoryDirectory"] = repositoryDirectory;
|
43
|
+
|
40
44
|
FS.writeFileSync(file, Buffer.from(JSON.stringify(jsonContents, null, 2)));
|
41
45
|
}
|
42
46
|
}
|