@diplodoc/cli 4.2.1 → 4.2.2-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 +53 -50
- package/build/index.js.map +3 -3
- package/build/linter.js +20 -21
- package/build/linter.js.map +3 -3
- package/package.json +14 -6
- package/src/cmd/build/index.ts +2 -1
- package/src/services/tocs.ts +2 -2
- package/src/steps/processPages.ts +2 -2
- package/src/utils/file.ts +11 -6
package/build/index.js
CHANGED
|
@@ -321,7 +321,7 @@ var import_path27 = require("path");
|
|
|
321
321
|
|
|
322
322
|
// src/services/tocs.ts
|
|
323
323
|
var import_path13 = require("path");
|
|
324
|
-
var
|
|
324
|
+
var import_fs3 = require("fs");
|
|
325
325
|
var import_js_yaml4 = require("js-yaml");
|
|
326
326
|
var import_shelljs2 = __toESM(require("shelljs"));
|
|
327
327
|
var import_walk_sync = __toESM(require("walk-sync"));
|
|
@@ -831,16 +831,19 @@ var glob = (pattern, options) => __async(void 0, null, function* () {
|
|
|
831
831
|
// src/utils/file.ts
|
|
832
832
|
var import_path7 = require("path");
|
|
833
833
|
var import_shelljs = __toESM(require("shelljs"));
|
|
834
|
-
var import_fs2 = require("fs");
|
|
835
834
|
function copyFiles(inputFolderPath, outputFolderPath, files) {
|
|
836
|
-
|
|
835
|
+
const dirs = /* @__PURE__ */ new Set();
|
|
836
|
+
files.forEach((pathToAsset) => {
|
|
837
837
|
const outputDir = (0, import_path7.resolve)(outputFolderPath, (0, import_path7.dirname)(pathToAsset));
|
|
838
838
|
const from = (0, import_path7.resolve)(inputFolderPath, pathToAsset);
|
|
839
839
|
const to = (0, import_path7.resolve)(outputFolderPath, pathToAsset);
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
if (!dirs.has(outputDir)) {
|
|
841
|
+
dirs.add(outputDir);
|
|
842
|
+
import_shelljs.default.mkdir("-p", outputDir);
|
|
843
|
+
}
|
|
844
|
+
import_shelljs.default.cp(from, to);
|
|
842
845
|
logger.copy(pathToAsset);
|
|
843
|
-
}
|
|
846
|
+
});
|
|
844
847
|
}
|
|
845
848
|
|
|
846
849
|
// src/services/authors.ts
|
|
@@ -1295,7 +1298,7 @@ __export(unarchive_exports, {
|
|
|
1295
1298
|
includerFunction: () => includerFunction3,
|
|
1296
1299
|
name: () => name3
|
|
1297
1300
|
});
|
|
1298
|
-
var
|
|
1301
|
+
var import_fs2 = require("fs");
|
|
1299
1302
|
var import_path11 = require("path");
|
|
1300
1303
|
var import_tar_stream = require("tar-stream");
|
|
1301
1304
|
var name3 = "unarchive";
|
|
@@ -1308,7 +1311,7 @@ var UnarchiveIncluderError = class extends Error {
|
|
|
1308
1311
|
};
|
|
1309
1312
|
function pipeline(readPath, writeBasePath) {
|
|
1310
1313
|
return new Promise((res, rej) => {
|
|
1311
|
-
const reader3 = (0,
|
|
1314
|
+
const reader3 = (0, import_fs2.createReadStream)(readPath);
|
|
1312
1315
|
reader3.on("error", (err) => {
|
|
1313
1316
|
rej(err);
|
|
1314
1317
|
});
|
|
@@ -1316,14 +1319,14 @@ function pipeline(readPath, writeBasePath) {
|
|
|
1316
1319
|
extractor2.on("error", (err) => {
|
|
1317
1320
|
rej(err);
|
|
1318
1321
|
});
|
|
1319
|
-
(0,
|
|
1322
|
+
(0, import_fs2.mkdirSync)(writeBasePath, { recursive: true });
|
|
1320
1323
|
extractor2.on("entry", (header, stream, next) => {
|
|
1321
1324
|
const { type, name: name4 } = header;
|
|
1322
1325
|
const writePath = (0, import_path11.join)(writeBasePath, name4);
|
|
1323
1326
|
const writeDirPath = type === "directory" ? writePath : (0, import_path11.dirname)(writePath);
|
|
1324
|
-
(0,
|
|
1327
|
+
(0, import_fs2.mkdirSync)(writeDirPath, { recursive: true });
|
|
1325
1328
|
if (type !== "directory") {
|
|
1326
|
-
const writer3 = (0,
|
|
1329
|
+
const writer3 = (0, import_fs2.createWriteStream)(writePath, { flags: "w" });
|
|
1327
1330
|
writer3.on("error", (err) => {
|
|
1328
1331
|
rej(err);
|
|
1329
1332
|
});
|
|
@@ -1482,7 +1485,7 @@ function add(path) {
|
|
|
1482
1485
|
vars
|
|
1483
1486
|
} = argv_default.getConfig();
|
|
1484
1487
|
const pathToDir = (0, import_path13.dirname)(path);
|
|
1485
|
-
const content = (0,
|
|
1488
|
+
const content = (0, import_fs3.readFileSync)((0, import_path13.resolve)(inputFolderPath, path), "utf8");
|
|
1486
1489
|
const parsedToc = (0, import_js_yaml4.load)(content);
|
|
1487
1490
|
if (parsedToc.stage === ignoreStage) {
|
|
1488
1491
|
return;
|
|
@@ -1509,7 +1512,7 @@ function add(path) {
|
|
|
1509
1512
|
const outputPath = (0, import_path13.resolve)(outputFolderPath, path);
|
|
1510
1513
|
const outputToc = (0, import_js_yaml4.dump)(parsedToc);
|
|
1511
1514
|
import_shelljs2.default.mkdir("-p", (0, import_path13.dirname)(outputPath));
|
|
1512
|
-
(0,
|
|
1515
|
+
(0, import_fs3.writeFileSync)(outputPath, outputToc);
|
|
1513
1516
|
}
|
|
1514
1517
|
prepareNavigationPaths(parsedToc, pathToDir);
|
|
1515
1518
|
});
|
|
@@ -1585,16 +1588,16 @@ function _copyTocDir(tocPath, destDir) {
|
|
|
1585
1588
|
const isMdFile = fileExtension === ".md";
|
|
1586
1589
|
import_shelljs2.default.mkdir("-p", (0, import_path13.parse)(to).dir);
|
|
1587
1590
|
if (isMdFile) {
|
|
1588
|
-
const fileContent = (0,
|
|
1591
|
+
const fileContent = (0, import_fs3.readFileSync)(from, "utf8");
|
|
1589
1592
|
const sourcePath = (0, import_path13.relative)(inputFolderPath, from);
|
|
1590
1593
|
const updatedFileContent = getContentWithUpdatedStaticMetadata({
|
|
1591
1594
|
fileContent,
|
|
1592
1595
|
sourcePath,
|
|
1593
1596
|
addSourcePath: true
|
|
1594
1597
|
});
|
|
1595
|
-
(0,
|
|
1598
|
+
(0, import_fs3.writeFileSync)(to, updatedFileContent);
|
|
1596
1599
|
} else {
|
|
1597
|
-
|
|
1600
|
+
import_shelljs2.default.cp(from, to);
|
|
1598
1601
|
}
|
|
1599
1602
|
});
|
|
1600
1603
|
}
|
|
@@ -1649,7 +1652,7 @@ function _replaceIncludes(path, items, tocDir, sourcesDir, vars) {
|
|
|
1649
1652
|
const includeTocPath = mode === "root_merge" /* ROOT_MERGE */ ? (0, import_path13.resolve)(sourcesDir, item.include.path) : (0, import_path13.resolve)(tocDir, item.include.path);
|
|
1650
1653
|
const includeTocDir = (0, import_path13.dirname)(includeTocPath);
|
|
1651
1654
|
try {
|
|
1652
|
-
const includeToc = (0, import_js_yaml4.load)((0,
|
|
1655
|
+
const includeToc = (0, import_js_yaml4.load)((0, import_fs3.readFileSync)(includeTocPath, "utf8"));
|
|
1653
1656
|
if (includeToc.stage === "tech-preview" /* TECH_PREVIEW */) {
|
|
1654
1657
|
continue;
|
|
1655
1658
|
}
|
|
@@ -1706,7 +1709,7 @@ function getTocDir(pagePath) {
|
|
|
1706
1709
|
if (!tocDir.includes(inputFolderPath)) {
|
|
1707
1710
|
throw new Error("Error while finding toc dir");
|
|
1708
1711
|
}
|
|
1709
|
-
if ((0,
|
|
1712
|
+
if ((0, import_fs3.existsSync)(tocPath)) {
|
|
1710
1713
|
return tocDir;
|
|
1711
1714
|
}
|
|
1712
1715
|
return getTocDir(tocDir);
|
|
@@ -1757,7 +1760,7 @@ var preset_default = {
|
|
|
1757
1760
|
|
|
1758
1761
|
// src/services/argv.ts
|
|
1759
1762
|
var import_path15 = require("path");
|
|
1760
|
-
var
|
|
1763
|
+
var import_fs4 = require("fs");
|
|
1761
1764
|
var _argv;
|
|
1762
1765
|
function getConfig() {
|
|
1763
1766
|
return _argv;
|
|
@@ -1770,7 +1773,7 @@ function init2(argv) {
|
|
|
1770
1773
|
_argv.vars = JSON.parse(argv.vars);
|
|
1771
1774
|
}
|
|
1772
1775
|
try {
|
|
1773
|
-
const ignorefile = (0,
|
|
1776
|
+
const ignorefile = (0, import_fs4.readFileSync)((0, import_path15.join)(_argv.rootInput, ".yfmignore"), "utf8");
|
|
1774
1777
|
const ignore = ignorefile.split("\n");
|
|
1775
1778
|
_argv.ignore = _argv.ignore.concat(ignore);
|
|
1776
1779
|
} catch (e) {
|
|
@@ -1787,7 +1790,7 @@ var argv_default = {
|
|
|
1787
1790
|
|
|
1788
1791
|
// src/services/leading.ts
|
|
1789
1792
|
var import_path16 = require("path");
|
|
1790
|
-
var
|
|
1793
|
+
var import_fs5 = require("fs");
|
|
1791
1794
|
var import_js_yaml5 = require("js-yaml");
|
|
1792
1795
|
var import_log4 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
1793
1796
|
function filterFile(path) {
|
|
@@ -1795,7 +1798,7 @@ function filterFile(path) {
|
|
|
1795
1798
|
const { input: inputFolderPath, vars } = argv_default.getConfig();
|
|
1796
1799
|
const pathToDir = (0, import_path16.dirname)(path);
|
|
1797
1800
|
const filePath = (0, import_path16.resolve)(inputFolderPath, path);
|
|
1798
|
-
const content = (0,
|
|
1801
|
+
const content = (0, import_fs5.readFileSync)(filePath, "utf8");
|
|
1799
1802
|
const parsedIndex = (0, import_js_yaml5.load)(content);
|
|
1800
1803
|
const combinedVars = __spreadValues(__spreadValues({}, preset_default.get(pathToDir)), vars);
|
|
1801
1804
|
try {
|
|
@@ -1838,7 +1841,7 @@ function filterFile(path) {
|
|
|
1838
1841
|
link.description = liquidField(link.description, combinedVars, path);
|
|
1839
1842
|
}
|
|
1840
1843
|
});
|
|
1841
|
-
(0,
|
|
1844
|
+
(0, import_fs5.writeFileSync)(filePath, (0, import_js_yaml5.dump)(parsedIndex));
|
|
1842
1845
|
} catch (error) {
|
|
1843
1846
|
import_log4.default.error(`Error while filtering index file: ${path}. Error message: ${error}`);
|
|
1844
1847
|
}
|
|
@@ -1980,14 +1983,14 @@ function processLogs(inputFolder) {
|
|
|
1980
1983
|
// src/steps/processPages.ts
|
|
1981
1984
|
var import_path22 = require("path");
|
|
1982
1985
|
var import_shelljs6 = __toESM(require("shelljs"));
|
|
1983
|
-
var
|
|
1986
|
+
var import_fs9 = require("fs");
|
|
1984
1987
|
var import_chalk4 = require("chalk");
|
|
1985
1988
|
var import_js_yaml7 = require("js-yaml");
|
|
1986
1989
|
var import_async = require("async");
|
|
1987
1990
|
var import_log11 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
1988
1991
|
|
|
1989
1992
|
// src/resolvers/md2md.ts
|
|
1990
|
-
var
|
|
1993
|
+
var import_fs6 = require("fs");
|
|
1991
1994
|
var import_path18 = require("path");
|
|
1992
1995
|
var import_shelljs5 = __toESM(require("shelljs"));
|
|
1993
1996
|
var import_log6 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
@@ -1999,7 +2002,7 @@ function resolveMd2Md(options) {
|
|
|
1999
2002
|
const resolvedInputPath = (0, import_path18.resolve)(input, inputPath);
|
|
2000
2003
|
const vars = getVarsPerFile(inputPath);
|
|
2001
2004
|
const content = yield getContentWithUpdatedMetadata(
|
|
2002
|
-
(0,
|
|
2005
|
+
(0, import_fs6.readFileSync)(resolvedInputPath, "utf8"),
|
|
2003
2006
|
metadata,
|
|
2004
2007
|
vars.__system
|
|
2005
2008
|
);
|
|
@@ -2013,7 +2016,7 @@ function resolveMd2Md(options) {
|
|
|
2013
2016
|
log: import_log6.default,
|
|
2014
2017
|
copyFile
|
|
2015
2018
|
});
|
|
2016
|
-
(0,
|
|
2019
|
+
(0, import_fs6.writeFileSync)(outputPath, result);
|
|
2017
2020
|
if (changelogs == null ? void 0 : changelogs.length) {
|
|
2018
2021
|
const mdFilename = (0, import_path18.basename)(outputPath, (0, import_path18.extname)(outputPath));
|
|
2019
2022
|
const outputDir = (0, import_path18.dirname)(outputPath);
|
|
@@ -2034,10 +2037,10 @@ function resolveMd2Md(options) {
|
|
|
2034
2037
|
)}`;
|
|
2035
2038
|
}
|
|
2036
2039
|
const changesPath = (0, import_path18.join)(outputDir, `changes-${changesName}.json`);
|
|
2037
|
-
if ((0,
|
|
2040
|
+
if ((0, import_fs6.existsSync)(changesPath)) {
|
|
2038
2041
|
throw new Error(`Changelog ${changesPath} already exists!`);
|
|
2039
2042
|
}
|
|
2040
|
-
(0,
|
|
2043
|
+
(0, import_fs6.writeFileSync)(
|
|
2041
2044
|
changesPath,
|
|
2042
2045
|
JSON.stringify(__spreadProps(__spreadValues({}, changes), {
|
|
2043
2046
|
source: mdFilename
|
|
@@ -2052,9 +2055,9 @@ function resolveMd2Md(options) {
|
|
|
2052
2055
|
function copyFile(targetPath, targetDestPath, options) {
|
|
2053
2056
|
import_shelljs5.default.mkdir("-p", (0, import_path18.dirname)(targetDestPath));
|
|
2054
2057
|
if (options) {
|
|
2055
|
-
const sourceIncludeContent = (0,
|
|
2058
|
+
const sourceIncludeContent = (0, import_fs6.readFileSync)(targetPath, "utf8");
|
|
2056
2059
|
const { result } = transformMd2Md(sourceIncludeContent, options);
|
|
2057
|
-
(0,
|
|
2060
|
+
(0, import_fs6.writeFileSync)(targetDestPath, result);
|
|
2058
2061
|
} else {
|
|
2059
2062
|
import_shelljs5.default.cp(targetPath, targetDestPath);
|
|
2060
2063
|
}
|
|
@@ -2110,7 +2113,7 @@ function transformMd2Md(input, options) {
|
|
|
2110
2113
|
|
|
2111
2114
|
// src/resolvers/md2html.ts
|
|
2112
2115
|
var import_path19 = require("path");
|
|
2113
|
-
var
|
|
2116
|
+
var import_fs7 = require("fs");
|
|
2114
2117
|
var import_js_yaml6 = __toESM(require("js-yaml"));
|
|
2115
2118
|
var import_transform = __toESM(require("@diplodoc/transform"));
|
|
2116
2119
|
var import_log7 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
@@ -2133,7 +2136,7 @@ function resolveMd2HTML(options) {
|
|
|
2133
2136
|
const relativePathToIndex = (0, import_path19.relative)(pathToDir, `${tocBase}${import_path19.sep}`);
|
|
2134
2137
|
const { input, lang, allowCustomResources } = argv_default.getConfig();
|
|
2135
2138
|
const resolvedPath = (0, import_path19.resolve)(input, inputPath);
|
|
2136
|
-
const content = (0,
|
|
2139
|
+
const content = (0, import_fs7.readFileSync)(resolvedPath, "utf8");
|
|
2137
2140
|
const transformFn = FileTransformer[fileExtension];
|
|
2138
2141
|
const { result } = transformFn(content, { path: inputPath });
|
|
2139
2142
|
const updatedMetadata = metadata && metadata.isContributorsEnabled ? yield getUpdatedMetadata(metadata, content, result == null ? void 0 : result.meta) : result.meta;
|
|
@@ -2161,7 +2164,7 @@ function resolveMd2HTML(options) {
|
|
|
2161
2164
|
const outputDir = (0, import_path19.dirname)(outputPath);
|
|
2162
2165
|
const relativePathToBundle = (0, import_path19.relative)((0, import_path19.resolve)(outputDir), (0, import_path19.resolve)(outputBundlePath));
|
|
2163
2166
|
const outputFileContent = generateStaticMarkup(props, relativePathToBundle);
|
|
2164
|
-
(0,
|
|
2167
|
+
(0, import_fs7.writeFileSync)(outputPath, outputFileContent);
|
|
2165
2168
|
logger.info(inputPath, PROCESSING_FINISHED);
|
|
2166
2169
|
return props;
|
|
2167
2170
|
});
|
|
@@ -2218,7 +2221,7 @@ function MdFileTransformer(content, transformOptions) {
|
|
|
2218
2221
|
var import_path20 = require("path");
|
|
2219
2222
|
var import_log8 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
2220
2223
|
var import_yfmlint = __toESM(require("@diplodoc/transform/lib/yfmlint"));
|
|
2221
|
-
var
|
|
2224
|
+
var import_fs8 = require("fs");
|
|
2222
2225
|
var import_chalk3 = require("chalk");
|
|
2223
2226
|
var FileLinter = {
|
|
2224
2227
|
".md": MdFileLinter
|
|
@@ -2228,7 +2231,7 @@ function lintPage(options) {
|
|
|
2228
2231
|
const { input } = argv_default.getConfig();
|
|
2229
2232
|
const resolvedPath = (0, import_path20.resolve)(input, inputPath);
|
|
2230
2233
|
try {
|
|
2231
|
-
const content = (0,
|
|
2234
|
+
const content = (0, import_fs8.readFileSync)(resolvedPath, "utf8");
|
|
2232
2235
|
const lintFn = FileLinter[fileExtension];
|
|
2233
2236
|
if (!lintFn) {
|
|
2234
2237
|
return;
|
|
@@ -2835,8 +2838,8 @@ function saveSinglePages(outputBundlePath) {
|
|
|
2835
2838
|
const singlePageFn = (0, import_path22.join)(tocDir, SINGLE_PAGE_FILENAME);
|
|
2836
2839
|
const singlePageDataFn = (0, import_path22.join)(tocDir, SINGLE_PAGE_DATA_FILENAME);
|
|
2837
2840
|
const singlePageContent = generateStaticMarkup(pageData, relativeOutputBundlePath);
|
|
2838
|
-
(0,
|
|
2839
|
-
(0,
|
|
2841
|
+
(0, import_fs9.writeFileSync)(singlePageFn, singlePageContent);
|
|
2842
|
+
(0, import_fs9.writeFileSync)(singlePageDataFn, JSON.stringify(pageData));
|
|
2840
2843
|
}))
|
|
2841
2844
|
);
|
|
2842
2845
|
} catch (error) {
|
|
@@ -2932,17 +2935,17 @@ function preparingPagesByOutputFormat(path, metaDataOptions, resolveConditions,
|
|
|
2932
2935
|
function processingYamlFile(path, metaDataOptions) {
|
|
2933
2936
|
const { pathToFile, outputFolderPath, inputFolderPath } = path;
|
|
2934
2937
|
const filePath = (0, import_path22.resolve)(inputFolderPath, pathToFile);
|
|
2935
|
-
const content = (0,
|
|
2938
|
+
const content = (0, import_fs9.readFileSync)(filePath, "utf8");
|
|
2936
2939
|
const parsedContent = (0, import_js_yaml7.load)(content);
|
|
2937
2940
|
if (metaDataOptions.resources) {
|
|
2938
2941
|
parsedContent.meta = __spreadValues(__spreadValues({}, parsedContent.meta), metaDataOptions.resources);
|
|
2939
2942
|
}
|
|
2940
|
-
(0,
|
|
2943
|
+
(0, import_fs9.writeFileSync)((0, import_path22.resolve)(outputFolderPath, pathToFile), (0, import_js_yaml7.dump)(parsedContent));
|
|
2941
2944
|
}
|
|
2942
2945
|
function copyFileWithoutChanges(resolvedPathToFile, outputDir, filename) {
|
|
2943
2946
|
const from = resolvedPathToFile;
|
|
2944
2947
|
const to = (0, import_path22.resolve)(outputDir, filename);
|
|
2945
|
-
|
|
2948
|
+
import_shelljs6.default.cp(from, to);
|
|
2946
2949
|
}
|
|
2947
2950
|
function processingFileToMd(path, metaDataOptions) {
|
|
2948
2951
|
return __async(this, null, function* () {
|
|
@@ -3059,7 +3062,7 @@ function lintPagesFallback(navigationPaths2) {
|
|
|
3059
3062
|
// src/steps/processServiceFiles.ts
|
|
3060
3063
|
var import_path24 = require("path");
|
|
3061
3064
|
var import_walk_sync4 = __toESM(require("walk-sync"));
|
|
3062
|
-
var
|
|
3065
|
+
var import_fs10 = require("fs");
|
|
3063
3066
|
var import_js_yaml8 = require("js-yaml");
|
|
3064
3067
|
var import_log13 = __toESM(require("@diplodoc/transform/lib/log"));
|
|
3065
3068
|
var import_shelljs7 = __toESM(require("shelljs"));
|
|
@@ -3091,7 +3094,7 @@ function preparingPresetFiles(getFilePathsByGlobals) {
|
|
|
3091
3094
|
for (const path of presetsFilePaths) {
|
|
3092
3095
|
logger.proc(path);
|
|
3093
3096
|
const pathToPresetFile = (0, import_path24.resolve)(inputFolderPath, path);
|
|
3094
|
-
const content = (0,
|
|
3097
|
+
const content = (0, import_fs10.readFileSync)(pathToPresetFile, "utf8");
|
|
3095
3098
|
const parsedPreset = (0, import_js_yaml8.load)(content);
|
|
3096
3099
|
preset_default.add(parsedPreset, path, varsPreset);
|
|
3097
3100
|
if (outputFormat === "md" && (!applyPresets || !resolveConditions)) {
|
|
@@ -3116,7 +3119,7 @@ function saveFilteredPresets(path, parsedPreset) {
|
|
|
3116
3119
|
lineWidth: 120
|
|
3117
3120
|
});
|
|
3118
3121
|
import_shelljs7.default.mkdir("-p", (0, import_path24.dirname)(outputPath));
|
|
3119
|
-
(0,
|
|
3122
|
+
(0, import_fs10.writeFileSync)(outputPath, outputPreset);
|
|
3120
3123
|
}
|
|
3121
3124
|
function preparingTocFiles(getFilePathsByGlobals) {
|
|
3122
3125
|
return __async(this, null, function* () {
|
|
@@ -3134,7 +3137,7 @@ function preparingTocFiles(getFilePathsByGlobals) {
|
|
|
3134
3137
|
}
|
|
3135
3138
|
|
|
3136
3139
|
// src/steps/processMapFile.ts
|
|
3137
|
-
var
|
|
3140
|
+
var import_fs11 = require("fs");
|
|
3138
3141
|
var import_path25 = require("path");
|
|
3139
3142
|
function prepareMapFile() {
|
|
3140
3143
|
const { output: outputFolderPath } = argv_default.getConfig();
|
|
@@ -3148,14 +3151,14 @@ function prepareMapFile() {
|
|
|
3148
3151
|
const navigationPaths2 = { files: [...new Set(navigationPathsWithoutExtensions)] };
|
|
3149
3152
|
const filesMapBuffer = Buffer.from(JSON.stringify(navigationPaths2, null, " "), "utf8");
|
|
3150
3153
|
const mapFile = (0, import_path25.join)(outputFolderPath, "files.json");
|
|
3151
|
-
(0,
|
|
3154
|
+
(0, import_fs11.writeFileSync)(mapFile, filesMapBuffer);
|
|
3152
3155
|
}
|
|
3153
3156
|
|
|
3154
3157
|
// src/cmd/build/index.ts
|
|
3155
3158
|
var import_shelljs8 = __toESM(require("shelljs"));
|
|
3156
3159
|
|
|
3157
3160
|
// src/cmd/publish/upload.ts
|
|
3158
|
-
var
|
|
3161
|
+
var import_fs12 = require("fs");
|
|
3159
3162
|
var import_walk_sync5 = __toESM(require("walk-sync"));
|
|
3160
3163
|
var import_path26 = require("path");
|
|
3161
3164
|
var import_client_s3 = require("@aws-sdk/client-s3");
|
|
@@ -3195,7 +3198,7 @@ function upload(props) {
|
|
|
3195
3198
|
ContentType: mimeType ? mimeType : void 0,
|
|
3196
3199
|
Bucket: bucket,
|
|
3197
3200
|
Key: convertBackSlashToSlash((0, import_path26.join)(prefix, pathToFile)),
|
|
3198
|
-
Body: (0,
|
|
3201
|
+
Body: (0, import_fs12.createReadStream)((0, import_path26.resolve)(input, pathToFile))
|
|
3199
3202
|
})
|
|
3200
3203
|
);
|
|
3201
3204
|
} catch (error) {
|
|
@@ -3433,7 +3436,6 @@ function preparingTemporaryFolders(userOutputFolder) {
|
|
|
3433
3436
|
import_shelljs8.default.mkdir("-p", userOutputFolder);
|
|
3434
3437
|
import_shelljs8.default.rm("-rf", args.input, args.output);
|
|
3435
3438
|
import_shelljs8.default.mkdir(args.input, args.output);
|
|
3436
|
-
import_shelljs8.default.chmod("-R", "u+w", args.input);
|
|
3437
3439
|
copyFiles(
|
|
3438
3440
|
args.rootInput,
|
|
3439
3441
|
args.input,
|
|
@@ -3444,6 +3446,7 @@ function preparingTemporaryFolders(userOutputFolder) {
|
|
|
3444
3446
|
ignore: ["node_modules/**", "*/node_modules/**"]
|
|
3445
3447
|
})
|
|
3446
3448
|
);
|
|
3449
|
+
import_shelljs8.default.chmod("-R", "u+w", args.input);
|
|
3447
3450
|
}
|
|
3448
3451
|
|
|
3449
3452
|
// src/cmd/publish/index.ts
|
|
@@ -4086,7 +4089,7 @@ import_yargs.default.command(build).command(publish).command(xliff).command(tran
|
|
|
4086
4089
|
default: false,
|
|
4087
4090
|
describe: "Run in quiet mode. Don't write logs to stdout",
|
|
4088
4091
|
type: "boolean"
|
|
4089
|
-
}).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.2.
|
|
4092
|
+
}).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.2.2-beta.0" : "").help().parse((0, import_helpers.hideBin)(process.argv), {}, (err, { strict }, output) => {
|
|
4090
4093
|
console.timeEnd(MAIN_TIMER_ID);
|
|
4091
4094
|
if (err) {
|
|
4092
4095
|
console.error(err);
|