@diplodoc/cli 4.5.0 → 4.5.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +20 -14
- package/build/index.js.map +2 -2
- package/build/linter.js +1 -0
- package/build/linter.js.map +2 -2
- package/package.json +4 -2
- package/src/constants.ts +1 -0
- package/src/steps/processPages.ts +8 -3
- package/src/vcs-connector/github.ts +19 -12
package/build/index.js
CHANGED
|
@@ -190,6 +190,7 @@ var REGEXP_INCLUDE_FILE_PATH = new RegExp("(?<=[(]).+(?=[)])", "g");
|
|
|
190
190
|
var REGEXP_AUTHOR = new RegExp("(?<=author:\\s).+(?=\\r?\\n)", "g");
|
|
191
191
|
var MIN_CHUNK_SIZE = Number(process.env.MIN_CHUNK_SIZE) || 1e3;
|
|
192
192
|
var WORKERS_COUNT = Number(process.env.WORKERS_COUNT) || os.cpus().length - 1;
|
|
193
|
+
var PAGE_PROCESS_CONCURRENCY = Number(process.env.PAGE_PROCESS_CONCURRENCY) || 500;
|
|
193
194
|
var metadataBorder = "---";
|
|
194
195
|
|
|
195
196
|
// src/validator.ts
|
|
@@ -2447,6 +2448,7 @@ var authorByGitEmail = /* @__PURE__ */ new Map();
|
|
|
2447
2448
|
var authorByPath = /* @__PURE__ */ new Map();
|
|
2448
2449
|
var contributorsByPath = /* @__PURE__ */ new Map();
|
|
2449
2450
|
var contributorsData = /* @__PURE__ */ new Map();
|
|
2451
|
+
var loginUserMap = /* @__PURE__ */ new Map();
|
|
2450
2452
|
function getGitHubVCSConnector() {
|
|
2451
2453
|
return __async(this, null, function* () {
|
|
2452
2454
|
const { contributors } = argv_default.getConfig();
|
|
@@ -2655,18 +2657,23 @@ function getFileContributorsByPath(path) {
|
|
|
2655
2657
|
}
|
|
2656
2658
|
function getUserByLogin(octokit, userLogin) {
|
|
2657
2659
|
return __async(this, null, function* () {
|
|
2658
|
-
|
|
2659
|
-
if (!
|
|
2660
|
-
|
|
2660
|
+
let result = loginUserMap.get(userLogin);
|
|
2661
|
+
if (!result) {
|
|
2662
|
+
const user = yield github_default.getRepoUser(octokit, userLogin);
|
|
2663
|
+
if (!user) {
|
|
2664
|
+
return null;
|
|
2665
|
+
}
|
|
2666
|
+
const { avatar_url: avatar, html_url: url2, email, login, name: name4 } = user;
|
|
2667
|
+
result = {
|
|
2668
|
+
avatar,
|
|
2669
|
+
email,
|
|
2670
|
+
login,
|
|
2671
|
+
name: name4,
|
|
2672
|
+
url: url2
|
|
2673
|
+
};
|
|
2674
|
+
loginUserMap.set(userLogin, result);
|
|
2661
2675
|
}
|
|
2662
|
-
|
|
2663
|
-
return {
|
|
2664
|
-
avatar,
|
|
2665
|
-
email,
|
|
2666
|
-
login,
|
|
2667
|
-
name: name4,
|
|
2668
|
-
url: url2
|
|
2669
|
-
};
|
|
2676
|
+
return result;
|
|
2670
2677
|
});
|
|
2671
2678
|
}
|
|
2672
2679
|
function addNestedContributorsForPathFunction(path, nestedContributors) {
|
|
@@ -2738,10 +2745,9 @@ function processPages(outputBundlePath) {
|
|
|
2738
2745
|
const vcsConnector = yield getVCSConnector();
|
|
2739
2746
|
plugins_exports.setPlugins();
|
|
2740
2747
|
const navigationPaths2 = tocs_default.getNavigationPaths();
|
|
2741
|
-
const concurrency = 500;
|
|
2742
2748
|
yield (0, import_async.mapLimit)(
|
|
2743
2749
|
navigationPaths2,
|
|
2744
|
-
|
|
2750
|
+
PAGE_PROCESS_CONCURRENCY,
|
|
2745
2751
|
(0, import_async.asyncify)((pathToFile) => __async(this, null, function* () {
|
|
2746
2752
|
const pathData = getPathData(
|
|
2747
2753
|
pathToFile,
|
|
@@ -4089,7 +4095,7 @@ import_yargs.default.command(build).command(publish).command(xliff).command(tran
|
|
|
4089
4095
|
default: false,
|
|
4090
4096
|
describe: "Run in quiet mode. Don't write logs to stdout",
|
|
4091
4097
|
type: "boolean"
|
|
4092
|
-
}).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.5.0" : "").help().parse((0, import_helpers.hideBin)(process.argv), {}, (err, { strict }, output) => {
|
|
4098
|
+
}).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.5.1-beta.0" : "").help().parse((0, import_helpers.hideBin)(process.argv), {}, (err, { strict }, output) => {
|
|
4093
4099
|
console.timeEnd(MAIN_TIMER_ID);
|
|
4094
4100
|
if (err) {
|
|
4095
4101
|
console.error(err);
|