honkit 3.7.0 → 3.7.3
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/lib/__tests__/init.js +1 -1
- package/lib/__tests__/snapshot-honkit.js +1 -1
- package/lib/api/decodeGlobal.js +1 -1
- package/lib/api/encodeConfig.js +0 -4
- package/lib/api/encodeGlobal.js +9 -9
- package/lib/api/encodeNavigation.js +0 -4
- package/lib/api/encodePage.js +1 -5
- package/lib/api/encodeProgress.js +1 -6
- package/lib/api/encodeSummary.js +3 -5
- package/lib/bin.js +1 -1
- package/lib/cli/build.js +3 -3
- package/lib/cli/buildEbook.js +2 -2
- package/lib/cli/getBook.js +1 -1
- package/lib/cli/index.js +1 -1
- package/lib/cli/init.js +1 -1
- package/lib/cli/parse.js +1 -1
- package/lib/cli/serve.js +7 -7
- package/lib/cli/server.js +3 -3
- package/lib/constants/__tests__/configSchema.js +7 -7
- package/lib/constants/configDefault.js +1 -1
- package/lib/constants/defaultFilters.js +2 -2
- package/lib/constants/defaultPlugins.js +1 -2
- package/lib/fs/__tests__/mock.js +1 -1
- package/lib/index.js +1 -1
- package/lib/init.js +1 -1
- package/lib/json/encodeBook.js +5 -5
- package/lib/json/encodeBookWithPage.js +3 -3
- package/lib/json/encodeGlossary.js +1 -1
- package/lib/json/encodeLanguages.js +1 -1
- package/lib/json/encodeOutput.js +1 -1
- package/lib/json/encodeOutputWithPage.js +3 -3
- package/lib/json/encodePage.js +9 -8
- package/lib/json/encodeReadme.js +1 -1
- package/lib/json/encodeSummary.js +1 -1
- package/lib/json/encodeSummaryArticle.js +8 -1
- package/lib/json/encodeSummaryArticleWithCache.js +36 -0
- package/lib/models/__tests__/plugin.js +24 -0
- package/lib/models/__tests__/summaryArticle.js +55 -0
- package/lib/models/__tests__/templateBlock.js +2 -2
- package/lib/models/book.js +1 -1
- package/lib/models/config.js +1 -1
- package/lib/models/fs.js +5 -5
- package/lib/models/glossaryEntry.js +1 -1
- package/lib/models/ignore.js +2 -2
- package/lib/models/output.js +1 -1
- package/lib/models/page.js +1 -1
- package/lib/models/parser.js +11 -11
- package/lib/models/plugin.js +7 -4
- package/lib/models/pluginDependency.js +1 -18
- package/lib/models/templateBlock.js +3 -3
- package/lib/modifiers/config/__tests__/addPlugin.js +1 -1
- package/lib/modifiers/config/__tests__/removePlugin.js +3 -3
- package/lib/modifiers/config/__tests__/togglePlugin.js +2 -2
- package/lib/modifiers/config/addPlugin.js +2 -3
- package/lib/modifiers/config/isDefaultPlugin.js +1 -1
- package/lib/modifiers/config/removePlugin.js +2 -2
- package/lib/modifiers/config/togglePlugin.js +1 -1
- package/lib/modifiers/summary/__tests__/editPartTitle.js +3 -3
- package/lib/modifiers/summary/__tests__/insertArticle.js +2 -2
- package/lib/modifiers/summary/__tests__/insertPart.js +2 -2
- package/lib/modifiers/summary/__tests__/mergeAtLevel.js +2 -2
- package/lib/modifiers/summary/__tests__/moveArticle.js +3 -3
- package/lib/modifiers/summary/__tests__/moveArticleAfter.js +5 -5
- package/lib/modifiers/summary/__tests__/removeArticle.js +1 -1
- package/lib/modifiers/summary/editArticleRef.js +1 -1
- package/lib/modifiers/summary/editArticleTitle.js +1 -1
- package/lib/modifiers/summary/indexPartLevels.js +1 -1
- package/lib/modifiers/summary/insertArticle.js +2 -2
- package/lib/modifiers/summary/insertPart.js +1 -1
- package/lib/modifiers/summary/moveArticle.js +2 -2
- package/lib/modifiers/summary/moveArticleAfter.js +4 -4
- package/lib/modifiers/summary/removeArticle.js +2 -2
- package/lib/modifiers/summary/removePart.js +1 -1
- package/lib/modifiers/summary/unshiftArticle.js +1 -1
- package/lib/output/Generator.js +2 -0
- package/lib/output/__tests__/ebook.js +1 -1
- package/lib/output/__tests__/json.js +3 -3
- package/lib/output/__tests__/plugin-hooks.js +3 -3
- package/lib/output/__tests__/website.js +8 -8
- package/lib/output/callHook.js +1 -1
- package/lib/output/callPageHook.js +1 -1
- package/lib/output/createTemplateEngine.js +1 -0
- package/lib/output/ebook/getConvertOptions.js +8 -8
- package/lib/output/ebook/getPDFTemplate.js +3 -1
- package/lib/output/ebook/index.js +1 -1
- package/lib/output/ebook/onFinish.js +3 -3
- package/lib/output/generateAssets.js +1 -1
- package/lib/output/generateBook.js +54 -46
- package/lib/output/generatePage.js +5 -5
- package/lib/output/generatePages.js +3 -3
- package/lib/output/getModifiers.js +2 -2
- package/lib/output/helper/fileToURL.js +1 -1
- package/lib/output/helper/resolveFileToURL.js +1 -1
- package/lib/output/index.js +0 -2
- package/lib/output/json/onFinish.js +1 -1
- package/lib/output/json/onPage.js +2 -2
- package/lib/output/modifiers/__tests__/addHeadingId.js +2 -2
- package/lib/output/modifiers/__tests__/annotateText.js +3 -3
- package/lib/output/modifiers/__tests__/fetchRemoteImages.js +2 -2
- package/lib/output/modifiers/__tests__/highlightCode.js +5 -5
- package/lib/output/modifiers/__tests__/inlinePng.js +1 -1
- package/lib/output/modifiers/__tests__/inlineSvg.js +2 -2
- package/lib/output/modifiers/__tests__/resolveImages.js +3 -3
- package/lib/output/modifiers/__tests__/resolveLinks.js +7 -7
- package/lib/output/modifiers/__tests__/svgToImg.js +2 -2
- package/lib/output/modifiers/addHeadingId.js +2 -2
- package/lib/output/modifiers/annotateText.js +1 -1
- package/lib/output/modifiers/fetchRemoteImages.js +1 -1
- package/lib/output/modifiers/highlightCode.js +2 -2
- package/lib/output/modifiers/inlineAssets.js +1 -1
- package/lib/output/modifiers/inlinePng.js +1 -1
- package/lib/output/modifiers/inlineSvg.js +1 -1
- package/lib/output/modifiers/resolveImages.js +1 -1
- package/lib/output/modifiers/resolveLinks.js +1 -1
- package/lib/output/modifiers/svgToImg.js +2 -2
- package/lib/output/preparePages.js +1 -1
- package/lib/output/preparePlugins.js +1 -1
- package/lib/output/testing/createMock.js +2 -2
- package/lib/output/testing/generateMock.js +3 -3
- package/lib/output/website/__tests__/i18n.js +6 -6
- package/lib/output/website/copyPluginAssets.js +4 -6
- package/lib/output/website/createTemplateEngine.js +7 -8
- package/lib/output/website/onFinish.js +3 -3
- package/lib/output/website/onInit.js +1 -1
- package/lib/output/website/onPage.js +5 -5
- package/lib/output/website/prepareI18n.js +2 -2
- package/lib/output/website/prepareResources.js +2 -2
- package/lib/output/website/state.js +1 -1
- package/lib/parse/__tests__/listAssets.js +6 -6
- package/lib/parse/__tests__/parseBook.js +6 -6
- package/lib/parse/__tests__/parseGlossary.js +4 -4
- package/lib/parse/__tests__/parseIgnore.js +2 -2
- package/lib/parse/__tests__/parsePageFromString.js +3 -3
- package/lib/parse/__tests__/parseReadme.js +5 -5
- package/lib/parse/__tests__/parseSummary.js +4 -4
- package/lib/parse/lookupStructureFile.js +1 -1
- package/lib/parse/parseBook.js +3 -3
- package/lib/parse/parseConfig.js +2 -2
- package/lib/parse/parseGlossary.js +1 -1
- package/lib/parse/parseIgnore.js +1 -1
- package/lib/parse/parseLanguages.js +1 -1
- package/lib/parse/parsePage.js +1 -1
- package/lib/parse/parsePageFromString.js +2 -2
- package/lib/parse/parsePagesList.js +2 -2
- package/lib/parse/parseReadme.js +1 -1
- package/lib/parse/parseStructureFile.js +1 -1
- package/lib/parse/parseSummary.js +1 -1
- package/lib/parse/validateConfig.js +2 -2
- package/lib/parse/walkSummary.js +1 -1
- package/lib/plugins/PluginResolver.js +5 -5
- package/lib/plugins/__tests__/listDependencies.js +6 -6
- package/lib/plugins/__tests__/sortDependencies.js +4 -4
- package/lib/plugins/__tests__/validatePlugin.js +3 -3
- package/lib/plugins/listDependencies.js +1 -1
- package/lib/plugins/listDepsForBook.js +1 -1
- package/lib/plugins/listResources.js +0 -3
- package/lib/plugins/loadForBook.js +2 -2
- package/lib/plugins/loadPlugin.js +2 -2
- package/lib/plugins/validateConfig.js +2 -2
- package/lib/plugins/validatePlugin.js +1 -1
- package/lib/templating/__tests__/conrefsLoader.js +11 -8
- package/lib/templating/__tests__/postRender.js +4 -4
- package/lib/templating/__tests__/replaceShortcuts.js +2 -2
- package/lib/templating/conrefsLoader.js +1 -1
- package/lib/templating/render.js +1 -1
- package/lib/templating/renderFile.js +2 -2
- package/lib/templating/replaceShortcuts.js +2 -2
- package/lib/templating/themesLoader.js +1 -1
- package/lib/utils/command.js +1 -33
- package/lib/utils/error.js +10 -10
- package/lib/utils/fs.js +6 -6
- package/lib/utils/git.js +4 -4
- package/lib/utils/promise.js +6 -6
- package/package.json +9 -8
- package/CHANGELOG.md +0 -448
- package/lib/plugins/__tests__/findInstalled.js +0 -25
- package/lib/plugins/findInstalled.js +0 -87
|
@@ -14,6 +14,6 @@ const prepareResources_1 = __importDefault(require("./prepareResources"));
|
|
|
14
14
|
@return {Output}
|
|
15
15
|
*/
|
|
16
16
|
function onInit(output) {
|
|
17
|
-
return promise_1.default(output).then(prepareI18n_1.default).then(prepareResources_1.default).then(copyPluginAssets_1.default);
|
|
17
|
+
return (0, promise_1.default)(output).then(prepareI18n_1.default).then(prepareResources_1.default).then(copyPluginAssets_1.default);
|
|
18
18
|
}
|
|
19
19
|
exports.default = onInit;
|
|
@@ -29,13 +29,13 @@ function onPage(output, page) {
|
|
|
29
29
|
const plugins = output.getPlugins();
|
|
30
30
|
const state = output.getState();
|
|
31
31
|
const resources = state.getResources();
|
|
32
|
-
const engine = createTemplateEngine_1.default(output, page.getPath());
|
|
32
|
+
const engine = (0, createTemplateEngine_1.default)(output, page.getPath());
|
|
33
33
|
// Output file path
|
|
34
|
-
const filePath = fileToOutput_1.default(output, file.getPath());
|
|
34
|
+
const filePath = (0, fileToOutput_1.default)(output, file.getPath());
|
|
35
35
|
// Calcul relative path to the root
|
|
36
36
|
const outputDirName = path_1.default.dirname(filePath);
|
|
37
37
|
const basePath = location_1.default.normalize(path_1.default.relative(outputDirName, "./"));
|
|
38
|
-
return modifiers_1.default.modifyHTML(page, getModifiers_1.default(output, page)).then((resultPage) => {
|
|
38
|
+
return modifiers_1.default.modifyHTML(page, (0, getModifiers_1.default)(output, page)).then((resultPage) => {
|
|
39
39
|
// Generate the context
|
|
40
40
|
const context = json_1.default.encodeOutputWithPage(output, resultPage);
|
|
41
41
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'plugins' does not exist on type '{ summa... Remove this comment to see the full error message
|
|
@@ -47,7 +47,7 @@ function onPage(output, page) {
|
|
|
47
47
|
getJSContext: function () {
|
|
48
48
|
return {
|
|
49
49
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'page' does not exist on type '{ summary:... Remove this comment to see the full error message
|
|
50
|
-
page: omit_keys_1.default(context.page, "content"),
|
|
50
|
+
page: (0, omit_keys_1.default)(context.page, "content"),
|
|
51
51
|
config: context.config,
|
|
52
52
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'file' does not exist on type '{ summary:... Remove this comment to see the full error message
|
|
53
53
|
file: context.file,
|
|
@@ -66,7 +66,7 @@ function onPage(output, page) {
|
|
|
66
66
|
return (templating_1.default.renderFile(engine, `${prefix}/page.html`, context)
|
|
67
67
|
// Write it to the disk
|
|
68
68
|
.then((tplOut) => {
|
|
69
|
-
return writeFile_1.default(output, filePath, tplOut.getContent());
|
|
69
|
+
return (0, writeFile_1.default)(output, filePath, tplOut.getContent());
|
|
70
70
|
}));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -16,13 +16,13 @@ const listSearchPaths_1 = __importDefault(require("./listSearchPaths"));
|
|
|
16
16
|
function prepareI18n(output) {
|
|
17
17
|
const state = output.getState();
|
|
18
18
|
const i18n = state.getI18n();
|
|
19
|
-
const searchPaths = listSearchPaths_1.default(output);
|
|
19
|
+
const searchPaths = (0, listSearchPaths_1.default)(output);
|
|
20
20
|
searchPaths.reverse().forEach((searchPath) => {
|
|
21
21
|
const i18nRoot = path_1.default.resolve(searchPath, "_i18n");
|
|
22
22
|
if (!fs_1.default.existsSync(i18nRoot))
|
|
23
23
|
return;
|
|
24
24
|
i18n.load(i18nRoot);
|
|
25
25
|
});
|
|
26
|
-
return promise_1.default(output);
|
|
26
|
+
return (0, promise_1.default)(output);
|
|
27
27
|
}
|
|
28
28
|
exports.default = prepareI18n;
|
|
@@ -22,11 +22,11 @@ function prepareResources(output) {
|
|
|
22
22
|
let result = immutable_1.default.Map();
|
|
23
23
|
return promise_1.default.forEach(plugins, (plugin) => {
|
|
24
24
|
const pluginResources = plugin.getResources(type);
|
|
25
|
-
return promise_1.default()
|
|
25
|
+
return (0, promise_1.default)()
|
|
26
26
|
.then(() => {
|
|
27
27
|
// Apply resources if is a function
|
|
28
28
|
if (is_1.default.fn(pluginResources)) {
|
|
29
|
-
return promise_1.default().then(pluginResources.bind(context));
|
|
29
|
+
return (0, promise_1.default)().then(pluginResources.bind(context));
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
32
|
return pluginResources;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const i18n_t_1 = __importDefault(require("i18n-t"));
|
|
7
7
|
const immutable_1 = __importDefault(require("immutable"));
|
|
8
8
|
class GeneratorState extends immutable_1.default.Record({
|
|
9
|
-
i18n: i18n_t_1.default(),
|
|
9
|
+
i18n: (0, i18n_t_1.default)(),
|
|
10
10
|
// List of plugins' resources
|
|
11
11
|
resources: immutable_1.default.Map(),
|
|
12
12
|
}) {
|
|
@@ -11,7 +11,7 @@ const parseGlossary_1 = __importDefault(require("../parseGlossary"));
|
|
|
11
11
|
const parseBook_1 = __importDefault(require("../parseBook"));
|
|
12
12
|
describe("listAssets", () => {
|
|
13
13
|
test("should not list glossary as asset", () => {
|
|
14
|
-
const fs = mock_1.default({
|
|
14
|
+
const fs = (0, mock_1.default)({
|
|
15
15
|
"GLOSSARY.md": "# Glossary\n\n## Hello\nDescription for hello",
|
|
16
16
|
"assetFile.js": "",
|
|
17
17
|
assets: {
|
|
@@ -19,9 +19,9 @@ describe("listAssets", () => {
|
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
const book = book_1.default.createForFS(fs);
|
|
22
|
-
return parseGlossary_1.default(book)
|
|
22
|
+
return (0, parseGlossary_1.default)(book)
|
|
23
23
|
.then((resultBook) => {
|
|
24
|
-
return listAssets_1.default(resultBook, immutable_1.default.Map());
|
|
24
|
+
return (0, listAssets_1.default)(resultBook, immutable_1.default.Map());
|
|
25
25
|
})
|
|
26
26
|
.then((assets) => {
|
|
27
27
|
expect(assets.size).toBe(2);
|
|
@@ -30,7 +30,7 @@ describe("listAssets", () => {
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
test("should not list README.md of pages as asset", () => {
|
|
33
|
-
const fs = mock_1.default({
|
|
33
|
+
const fs = (0, mock_1.default)({
|
|
34
34
|
"book.json": JSON.stringify({
|
|
35
35
|
root: "./test",
|
|
36
36
|
}),
|
|
@@ -52,9 +52,9 @@ describe("listAssets", () => {
|
|
|
52
52
|
.set("sub/README-sub.md", "sub")
|
|
53
53
|
.set("sub/sub/README-subsub.md", "sub/sub");
|
|
54
54
|
const book = book_1.default.createForFS(fs);
|
|
55
|
-
return parseBook_1.default(book)
|
|
55
|
+
return (0, parseBook_1.default)(book)
|
|
56
56
|
.then((resultBook) => {
|
|
57
|
-
return listAssets_1.default(resultBook, pages);
|
|
57
|
+
return (0, listAssets_1.default)(resultBook, pages);
|
|
58
58
|
})
|
|
59
59
|
.then((assets) => {
|
|
60
60
|
expect(assets.size).toBe(0);
|
|
@@ -8,7 +8,7 @@ const mock_1 = __importDefault(require("../../fs/mock"));
|
|
|
8
8
|
const parseBook_1 = __importDefault(require("../parseBook"));
|
|
9
9
|
describe("parseBook", () => {
|
|
10
10
|
test("should parse multilingual book", () => {
|
|
11
|
-
const fs = mock_1.default({
|
|
11
|
+
const fs = (0, mock_1.default)({
|
|
12
12
|
"LANGS.md": "# Languages\n\n* [en](en)\n* [fr](fr)",
|
|
13
13
|
en: {
|
|
14
14
|
"README.md": "Hello",
|
|
@@ -18,7 +18,7 @@ describe("parseBook", () => {
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
const book = book_1.default.createForFS(fs);
|
|
21
|
-
return parseBook_1.default(book).then((resultBook) => {
|
|
21
|
+
return (0, parseBook_1.default)(book).then((resultBook) => {
|
|
22
22
|
const languages = resultBook.getLanguages();
|
|
23
23
|
const books = resultBook.getBooks();
|
|
24
24
|
expect(resultBook.isMultilingual()).toBe(true);
|
|
@@ -27,7 +27,7 @@ describe("parseBook", () => {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
test("should extend configuration for multilingual book", () => {
|
|
30
|
-
const fs = mock_1.default({
|
|
30
|
+
const fs = (0, mock_1.default)({
|
|
31
31
|
"LANGS.md": "# Languages\n\n* [en](en)\n* [fr](fr)",
|
|
32
32
|
"book.json": '{ "title": "Test", "author": "HonKit" }',
|
|
33
33
|
en: {
|
|
@@ -39,7 +39,7 @@ describe("parseBook", () => {
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
const book = book_1.default.createForFS(fs);
|
|
42
|
-
return parseBook_1.default(book).then((resultBook) => {
|
|
42
|
+
return (0, parseBook_1.default)(book).then((resultBook) => {
|
|
43
43
|
const books = resultBook.getBooks();
|
|
44
44
|
expect(resultBook.isMultilingual()).toBe(true);
|
|
45
45
|
expect(books.size).toBe(2);
|
|
@@ -54,7 +54,7 @@ describe("parseBook", () => {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
test("should parse book in a directory", () => {
|
|
57
|
-
const fs = mock_1.default({
|
|
57
|
+
const fs = (0, mock_1.default)({
|
|
58
58
|
"book.json": JSON.stringify({
|
|
59
59
|
root: "./test",
|
|
60
60
|
}),
|
|
@@ -65,7 +65,7 @@ describe("parseBook", () => {
|
|
|
65
65
|
},
|
|
66
66
|
});
|
|
67
67
|
const book = book_1.default.createForFS(fs);
|
|
68
|
-
return parseBook_1.default(book).then((resultBook) => {
|
|
68
|
+
return (0, parseBook_1.default)(book).then((resultBook) => {
|
|
69
69
|
const readme = resultBook.getReadme();
|
|
70
70
|
const summary = resultBook.getSummary();
|
|
71
71
|
const articles = summary.getArticlesAsList();
|
|
@@ -8,11 +8,11 @@ const mock_1 = __importDefault(require("../../fs/mock"));
|
|
|
8
8
|
const parseGlossary_1 = __importDefault(require("../parseGlossary"));
|
|
9
9
|
describe("parseGlossary", () => {
|
|
10
10
|
test("should parse glossary if exists", () => {
|
|
11
|
-
const fs = mock_1.default({
|
|
11
|
+
const fs = (0, mock_1.default)({
|
|
12
12
|
"GLOSSARY.md": "# Glossary\n\n## Hello\nDescription for hello",
|
|
13
13
|
});
|
|
14
14
|
const book = book_1.default.createForFS(fs);
|
|
15
|
-
return parseGlossary_1.default(book).then((resultBook) => {
|
|
15
|
+
return (0, parseGlossary_1.default)(book).then((resultBook) => {
|
|
16
16
|
const glossary = resultBook.getGlossary();
|
|
17
17
|
const file = glossary.getFile();
|
|
18
18
|
const entries = glossary.getEntries();
|
|
@@ -21,9 +21,9 @@ describe("parseGlossary", () => {
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
test("should not fail if doesn't exist", () => {
|
|
24
|
-
const fs = mock_1.default({});
|
|
24
|
+
const fs = (0, mock_1.default)({});
|
|
25
25
|
const book = book_1.default.createForFS(fs);
|
|
26
|
-
return parseGlossary_1.default(book).then((resultBook) => {
|
|
26
|
+
return (0, parseGlossary_1.default)(book).then((resultBook) => {
|
|
27
27
|
const glossary = resultBook.getGlossary();
|
|
28
28
|
const file = glossary.getFile();
|
|
29
29
|
expect(file.exists()).toBeFalsy();
|
|
@@ -7,7 +7,7 @@ const book_1 = __importDefault(require("../../models/book"));
|
|
|
7
7
|
const mock_1 = __importDefault(require("../../fs/mock"));
|
|
8
8
|
const parseIgnore_1 = __importDefault(require("../parseIgnore"));
|
|
9
9
|
describe("parseIgnore", () => {
|
|
10
|
-
const fs = mock_1.default({
|
|
10
|
+
const fs = (0, mock_1.default)({
|
|
11
11
|
".ignore": "test-1.js",
|
|
12
12
|
".gitignore": "test-2.js\ntest-3.js",
|
|
13
13
|
".bookignore": "!test-3.js",
|
|
@@ -17,7 +17,7 @@ describe("parseIgnore", () => {
|
|
|
17
17
|
});
|
|
18
18
|
function getBook() {
|
|
19
19
|
const book = book_1.default.createForFS(fs);
|
|
20
|
-
return parseIgnore_1.default(book);
|
|
20
|
+
return (0, parseIgnore_1.default)(book);
|
|
21
21
|
}
|
|
22
22
|
test("should load rules from .ignore", () => {
|
|
23
23
|
return getBook().then((book) => {
|
|
@@ -9,7 +9,7 @@ describe("parsePageFromString", () => {
|
|
|
9
9
|
const page = new page_1.default();
|
|
10
10
|
test("should parse YAML frontmatter", () => {
|
|
11
11
|
const CONTENT = "---\nhello: true\nworld: \"cool\"\n---\n# Hello World\n";
|
|
12
|
-
const newPage = parsePageFromString_1.default(page, CONTENT);
|
|
12
|
+
const newPage = (0, parsePageFromString_1.default)(page, CONTENT);
|
|
13
13
|
expect(newPage.getDir()).toBe("ltr");
|
|
14
14
|
expect(newPage.getContent()).toBe("# Hello World\n");
|
|
15
15
|
const attrs = newPage.getAttributes();
|
|
@@ -19,14 +19,14 @@ describe("parsePageFromString", () => {
|
|
|
19
19
|
});
|
|
20
20
|
test("should parse text direction (english)", () => {
|
|
21
21
|
const CONTENT = "Hello World";
|
|
22
|
-
const newPage = parsePageFromString_1.default(page, CONTENT);
|
|
22
|
+
const newPage = (0, parsePageFromString_1.default)(page, CONTENT);
|
|
23
23
|
expect(newPage.getDir()).toBe("ltr");
|
|
24
24
|
expect(newPage.getContent()).toBe("Hello World");
|
|
25
25
|
expect(newPage.getAttributes().size).toBe(0);
|
|
26
26
|
});
|
|
27
27
|
test("should parse text direction (arab)", () => {
|
|
28
28
|
const CONTENT = "مرحبا بالعالم";
|
|
29
|
-
const newPage = parsePageFromString_1.default(page, CONTENT);
|
|
29
|
+
const newPage = (0, parsePageFromString_1.default)(page, CONTENT);
|
|
30
30
|
expect(newPage.getDir()).toBe("rtl");
|
|
31
31
|
expect(newPage.getContent()).toBe("مرحبا بالعالم");
|
|
32
32
|
expect(newPage.getAttributes().size).toBe(0);
|
|
@@ -9,11 +9,11 @@ const book_1 = __importDefault(require("../../models/book"));
|
|
|
9
9
|
const parseReadme_1 = __importDefault(require("../parseReadme"));
|
|
10
10
|
describe("parseReadme", () => {
|
|
11
11
|
test("should parse summary if exists", () => {
|
|
12
|
-
const fs = mock_1.default({
|
|
12
|
+
const fs = (0, mock_1.default)({
|
|
13
13
|
"README.md": "# Hello\n\nAnd here is the description.",
|
|
14
14
|
});
|
|
15
15
|
const book = book_1.default.createForFS(fs);
|
|
16
|
-
return parseReadme_1.default(book).then((resultBook) => {
|
|
16
|
+
return (0, parseReadme_1.default)(book).then((resultBook) => {
|
|
17
17
|
const readme = resultBook.getReadme();
|
|
18
18
|
const file = readme.getFile();
|
|
19
19
|
expect(file.exists()).toBeTruthy();
|
|
@@ -22,12 +22,12 @@ describe("parseReadme", () => {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
test("should fail if doesn't exist", () => {
|
|
25
|
-
const fs = mock_1.default({});
|
|
25
|
+
const fs = (0, mock_1.default)({});
|
|
26
26
|
const book = book_1.default.createForFS(fs);
|
|
27
|
-
return parseReadme_1.default(book).then((resultBook) => {
|
|
27
|
+
return (0, parseReadme_1.default)(book).then((resultBook) => {
|
|
28
28
|
throw new Error("It should have fail");
|
|
29
29
|
}, () => {
|
|
30
|
-
return promise_1.default();
|
|
30
|
+
return (0, promise_1.default)();
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
});
|
|
@@ -8,20 +8,20 @@ const mock_1 = __importDefault(require("../../fs/mock"));
|
|
|
8
8
|
const parseSummary_1 = __importDefault(require("../parseSummary"));
|
|
9
9
|
describe("parseSummary", () => {
|
|
10
10
|
test("should parse summary if exists", () => {
|
|
11
|
-
const fs = mock_1.default({
|
|
11
|
+
const fs = (0, mock_1.default)({
|
|
12
12
|
"SUMMARY.md": "# Summary\n\n* [Hello](hello.md)",
|
|
13
13
|
});
|
|
14
14
|
const book = book_1.default.createForFS(fs);
|
|
15
|
-
return parseSummary_1.default(book).then((resultBook) => {
|
|
15
|
+
return (0, parseSummary_1.default)(book).then((resultBook) => {
|
|
16
16
|
const summary = resultBook.getSummary();
|
|
17
17
|
const file = summary.getFile();
|
|
18
18
|
expect(file.exists()).toBeTruthy();
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
test("should not fail if doesn't exist", () => {
|
|
22
|
-
const fs = mock_1.default({});
|
|
22
|
+
const fs = (0, mock_1.default)({});
|
|
23
23
|
const book = book_1.default.createForFS(fs);
|
|
24
|
-
return parseSummary_1.default(book).then((resultBook) => {
|
|
24
|
+
return (0, parseSummary_1.default)(book).then((resultBook) => {
|
|
25
25
|
const summary = resultBook.getSummary();
|
|
26
26
|
const file = summary.getFile();
|
|
27
27
|
expect(file.exists()).toBeFalsy();
|
|
@@ -16,6 +16,6 @@ const findParsableFile_1 = __importDefault(require("./findParsableFile"));
|
|
|
16
16
|
function lookupStructureFile(book, type) {
|
|
17
17
|
const config = book.getConfig();
|
|
18
18
|
const fileToSearch = config.getValue(["structure", type]);
|
|
19
|
-
return findParsableFile_1.default(book, fileToSearch);
|
|
19
|
+
return (0, findParsableFile_1.default)(book, fileToSearch);
|
|
20
20
|
}
|
|
21
21
|
exports.default = lookupStructureFile;
|
package/lib/parse/parseBook.js
CHANGED
|
@@ -19,7 +19,7 @@ const parseLanguages_1 = __importDefault(require("./parseLanguages"));
|
|
|
19
19
|
@return {Promise<Book>}
|
|
20
20
|
*/
|
|
21
21
|
function parseBookContent(book) {
|
|
22
|
-
return promise_1.default(book).then(parseReadme_1.default).then(parseSummary_1.default).then(parseGlossary_1.default);
|
|
22
|
+
return (0, promise_1.default)(book).then(parseReadme_1.default).then(parseSummary_1.default).then(parseGlossary_1.default);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
Parse a multilingual book
|
|
@@ -34,7 +34,7 @@ function parseMultilingualBook(book) {
|
|
|
34
34
|
const langID = lang.getID();
|
|
35
35
|
const child = book_1.default.createFromParent(currentBook, langID);
|
|
36
36
|
let ignore = currentBook.getIgnore();
|
|
37
|
-
return promise_1.default(child)
|
|
37
|
+
return (0, promise_1.default)(child)
|
|
38
38
|
.then(parseConfig_1.default)
|
|
39
39
|
.then(parseBookContent)
|
|
40
40
|
.then((result) => {
|
|
@@ -52,7 +52,7 @@ function parseMultilingualBook(book) {
|
|
|
52
52
|
@return {Promise<Book>}
|
|
53
53
|
*/
|
|
54
54
|
function parseBook(book) {
|
|
55
|
-
return timing_1.default.measure("parse.book", promise_1.default(book)
|
|
55
|
+
return timing_1.default.measure("parse.book", (0, promise_1.default)(book)
|
|
56
56
|
.then(parseIgnore_1.default)
|
|
57
57
|
.then(parseConfig_1.default)
|
|
58
58
|
.then(parseLanguages_1.default)
|
package/lib/parse/parseConfig.js
CHANGED
|
@@ -35,11 +35,11 @@ function parseConfig(book) {
|
|
|
35
35
|
if (err.code != "MODULE_NOT_FOUND")
|
|
36
36
|
throw err;
|
|
37
37
|
else
|
|
38
|
-
return promise_1.default(false);
|
|
38
|
+
return (0, promise_1.default)(false);
|
|
39
39
|
});
|
|
40
40
|
}).then((result) => {
|
|
41
41
|
let values = result ? result.values : {};
|
|
42
|
-
values = validateConfig_1.default(values);
|
|
42
|
+
values = (0, validateConfig_1.default)(values);
|
|
43
43
|
// Set the file
|
|
44
44
|
if (result.file) {
|
|
45
45
|
config = config.setFile(result.file);
|
|
@@ -13,7 +13,7 @@ const glossary_1 = __importDefault(require("../models/glossary"));
|
|
|
13
13
|
*/
|
|
14
14
|
function parseGlossary(book) {
|
|
15
15
|
const logger = book.getLogger();
|
|
16
|
-
return parseStructureFile_1.default(book, "glossary").spread((file, entries) => {
|
|
16
|
+
return (0, parseStructureFile_1.default)(book, "glossary").spread((file, entries) => {
|
|
17
17
|
if (!file) {
|
|
18
18
|
return book;
|
|
19
19
|
}
|
package/lib/parse/parseIgnore.js
CHANGED
|
@@ -34,7 +34,7 @@ function parseIgnore(book) {
|
|
|
34
34
|
return fs.readAsString(filename).then((content) => {
|
|
35
35
|
ignore = ignore.add(content.toString().split(/\r?\n/));
|
|
36
36
|
}, (err) => {
|
|
37
|
-
return promise_1.default();
|
|
37
|
+
return (0, promise_1.default)();
|
|
38
38
|
});
|
|
39
39
|
}).then(() => {
|
|
40
40
|
return book.setIgnore(ignore);
|
|
@@ -13,7 +13,7 @@ const languages_1 = __importDefault(require("../models/languages"));
|
|
|
13
13
|
*/
|
|
14
14
|
function parseLanguages(book) {
|
|
15
15
|
const logger = book.getLogger();
|
|
16
|
-
return parseStructureFile_1.default(book, "langs").spread((file, result) => {
|
|
16
|
+
return (0, parseStructureFile_1.default)(book, "langs").spread((file, result) => {
|
|
17
17
|
if (!file) {
|
|
18
18
|
return book;
|
|
19
19
|
}
|
package/lib/parse/parsePage.js
CHANGED
|
@@ -15,7 +15,7 @@ function parsePage(book, page) {
|
|
|
15
15
|
const fs = book.getContentFS();
|
|
16
16
|
const file = page.getFile();
|
|
17
17
|
return fs.readAsString(file.getPath()).then((content) => {
|
|
18
|
-
return parsePageFromString_1.default(page, content);
|
|
18
|
+
return (0, parsePageFromString_1.default)(page, content);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
exports.default = parsePage;
|
|
@@ -15,11 +15,11 @@ const direction_1 = __importDefault(require("direction"));
|
|
|
15
15
|
*/
|
|
16
16
|
function parsePageFromString(page, content) {
|
|
17
17
|
// Parse page YAML
|
|
18
|
-
const parsed = front_matter_1.default(content);
|
|
18
|
+
const parsed = (0, front_matter_1.default)(content);
|
|
19
19
|
return page.merge({
|
|
20
20
|
content: parsed.body,
|
|
21
21
|
attributes: immutable_1.default.fromJS(parsed.attributes),
|
|
22
|
-
dir: direction_1.default(parsed.body),
|
|
22
|
+
dir: (0, direction_1.default)(parsed.body),
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
exports.default = parsePageFromString;
|
|
@@ -21,7 +21,7 @@ function parseFilePage(book, filePath) {
|
|
|
21
21
|
.statFile(filePath)
|
|
22
22
|
.then((file) => {
|
|
23
23
|
const page = page_1.default.createForFile(file);
|
|
24
|
-
return parsePage_1.default(book, page);
|
|
24
|
+
return (0, parsePage_1.default)(book, page);
|
|
25
25
|
}, (err) => {
|
|
26
26
|
// file doesn't exist
|
|
27
27
|
return null;
|
|
@@ -44,7 +44,7 @@ function parsePagesList(book) {
|
|
|
44
44
|
let map = immutable_1.default.OrderedMap();
|
|
45
45
|
// Parse pages from summary
|
|
46
46
|
return (timing_1.default
|
|
47
|
-
.measure("parse.listPages", walkSummary_1.default(summary, (article) => {
|
|
47
|
+
.measure("parse.listPages", (0, walkSummary_1.default)(summary, (article) => {
|
|
48
48
|
if (!article.isPage())
|
|
49
49
|
return;
|
|
50
50
|
const filepath = article.getPath();
|
package/lib/parse/parseReadme.js
CHANGED
|
@@ -14,7 +14,7 @@ const error_1 = __importDefault(require("../utils/error"));
|
|
|
14
14
|
*/
|
|
15
15
|
function parseReadme(book) {
|
|
16
16
|
const logger = book.getLogger();
|
|
17
|
-
return parseStructureFile_1.default(book, "readme").spread((file, result) => {
|
|
17
|
+
return (0, parseStructureFile_1.default)(book, "readme").spread((file, result) => {
|
|
18
18
|
if (!file) {
|
|
19
19
|
throw new error_1.default.FileNotFoundError({ filename: "README" });
|
|
20
20
|
}
|
|
@@ -55,7 +55,7 @@ function parseFile(fs, file, type) {
|
|
|
55
55
|
*/
|
|
56
56
|
function parseStructureFile(book, type) {
|
|
57
57
|
const fs = book.getContentFS();
|
|
58
|
-
return lookupStructureFile_1.default(book, type).then((file) => {
|
|
58
|
+
return (0, lookupStructureFile_1.default)(book, type).then((file) => {
|
|
59
59
|
if (!file)
|
|
60
60
|
return [undefined, undefined];
|
|
61
61
|
return parseFile(fs, file, type);
|
|
@@ -18,7 +18,7 @@ function parseSummary(book) {
|
|
|
18
18
|
const readme = book.getReadme();
|
|
19
19
|
const logger = book.getLogger();
|
|
20
20
|
const readmeFile = readme.getFile();
|
|
21
|
-
return parseStructureFile_1.default(book, "summary").spread((file, result) => {
|
|
21
|
+
return (0, parseStructureFile_1.default)(book, "summary").spread((file, result) => {
|
|
22
22
|
let summary;
|
|
23
23
|
if (!file) {
|
|
24
24
|
logger.warn.ln("no summary file in this book");
|
|
@@ -25,7 +25,7 @@ function validateConfig(bookJson) {
|
|
|
25
25
|
throw new error_1.default.ConfigurationError(new Error(result.errors[0].stack));
|
|
26
26
|
}
|
|
27
27
|
// Insert default values
|
|
28
|
-
const defaults = json_schema_defaults_1.default(configSchema_1.default);
|
|
29
|
-
return mergeDefaults_1.default(bookJson, defaults);
|
|
28
|
+
const defaults = (0, json_schema_defaults_1.default)(configSchema_1.default);
|
|
29
|
+
return (0, mergeDefaults_1.default)(bookJson, defaults);
|
|
30
30
|
}
|
|
31
31
|
exports.default = validateConfig;
|
package/lib/parse/walkSummary.js
CHANGED
|
@@ -13,7 +13,7 @@ const promise_1 = __importDefault(require("../utils/promise"));
|
|
|
13
13
|
*/
|
|
14
14
|
function walkArticles(articles, fn) {
|
|
15
15
|
return promise_1.default.forEach(articles, (article) => {
|
|
16
|
-
return promise_1.default(fn(article)).then(() => {
|
|
16
|
+
return (0, promise_1.default)(fn(article)).then(() => {
|
|
17
17
|
return walkArticles(article.getArticles(), fn);
|
|
18
18
|
});
|
|
19
19
|
});
|
|
@@ -29,7 +29,7 @@ const util = __importStar(require("./package-name-util"));
|
|
|
29
29
|
const try_resolve_1 = __importDefault(require("try-resolve"));
|
|
30
30
|
const SPECIAL_PACKAGE_NAME = [
|
|
31
31
|
"highlight",
|
|
32
|
-
"theme-default",
|
|
32
|
+
"theme-default", // → @honkit/honkit-plugin-theme-default
|
|
33
33
|
];
|
|
34
34
|
/**
|
|
35
35
|
* This class aim to resolve honkit's package name and get the module path.
|
|
@@ -65,11 +65,11 @@ class PluginResolver {
|
|
|
65
65
|
// e.g.) load theme-default as @honkit/honkit-plugins-theme-default
|
|
66
66
|
const honkitScopePackageName = `@honkit/${honkitFullPackageName}`;
|
|
67
67
|
// In sometimes, HonKit package has not main field - so search package.json
|
|
68
|
-
const pkgPath = try_resolve_1.default(path_1.default.join(baseDir, honkitFullPackageName, "/package.json")) ||
|
|
69
|
-
try_resolve_1.default(path_1.default.join(baseDir, gitbookFullPackageName, "/package.json")) ||
|
|
70
|
-
try_resolve_1.default(path_1.default.join(baseDir, packageName, "/package.json")) ||
|
|
68
|
+
const pkgPath = (0, try_resolve_1.default)(path_1.default.join(baseDir, honkitFullPackageName, "/package.json")) ||
|
|
69
|
+
(0, try_resolve_1.default)(path_1.default.join(baseDir, gitbookFullPackageName, "/package.json")) ||
|
|
70
|
+
(0, try_resolve_1.default)(path_1.default.join(baseDir, packageName, "/package.json")) ||
|
|
71
71
|
(SPECIAL_PACKAGE_NAME.includes(packageName) &&
|
|
72
|
-
try_resolve_1.default(path_1.default.join(baseDir, honkitScopePackageName, "/package.json")));
|
|
72
|
+
(0, try_resolve_1.default)(path_1.default.join(baseDir, honkitScopePackageName, "/package.json")));
|
|
73
73
|
if (!pkgPath) {
|
|
74
74
|
throw new ReferenceError(`Failed to load HonKit's plugin module: "${packageName}" is not found.
|
|
75
75
|
|
|
@@ -9,20 +9,20 @@ const toNames_1 = __importDefault(require("../toNames"));
|
|
|
9
9
|
describe("listDependencies", () => {
|
|
10
10
|
test("must list default", () => {
|
|
11
11
|
const deps = pluginDependency_1.default.listFromString("ga,great");
|
|
12
|
-
const plugins = listDependencies_1.default(deps);
|
|
13
|
-
const names = toNames_1.default(plugins);
|
|
12
|
+
const plugins = (0, listDependencies_1.default)(deps);
|
|
13
|
+
const names = (0, toNames_1.default)(plugins);
|
|
14
14
|
expect(names).toEqual(["ga", "great", "highlight", "search", "lunr", "fontsettings", "theme-default"]);
|
|
15
15
|
});
|
|
16
16
|
test("must list from array with -", () => {
|
|
17
17
|
const deps = pluginDependency_1.default.listFromString("ga,-great");
|
|
18
|
-
const plugins = listDependencies_1.default(deps);
|
|
19
|
-
const names = toNames_1.default(plugins);
|
|
18
|
+
const plugins = (0, listDependencies_1.default)(deps);
|
|
19
|
+
const names = (0, toNames_1.default)(plugins);
|
|
20
20
|
expect(names).toEqual(["ga", "highlight", "search", "lunr", "fontsettings", "theme-default"]);
|
|
21
21
|
});
|
|
22
22
|
test("must remove default plugins using -", () => {
|
|
23
23
|
const deps = pluginDependency_1.default.listFromString("ga,-search");
|
|
24
|
-
const plugins = listDependencies_1.default(deps);
|
|
25
|
-
const names = toNames_1.default(plugins);
|
|
24
|
+
const plugins = (0, listDependencies_1.default)(deps);
|
|
25
|
+
const names = (0, toNames_1.default)(plugins);
|
|
26
26
|
expect(names).toEqual(["ga", "highlight", "lunr", "fontsettings", "theme-default"]);
|
|
27
27
|
});
|
|
28
28
|
});
|
|
@@ -9,8 +9,8 @@ const toNames_1 = __importDefault(require("../toNames"));
|
|
|
9
9
|
describe("sortDependencies", () => {
|
|
10
10
|
test("must load themes after plugins", () => {
|
|
11
11
|
const allPlugins = pluginDependency_1.default.listFromArray(["hello", "theme-test", "world"]);
|
|
12
|
-
const sorted = sortDependencies_1.default(allPlugins);
|
|
13
|
-
const names = toNames_1.default(sorted);
|
|
12
|
+
const sorted = (0, sortDependencies_1.default)(allPlugins);
|
|
13
|
+
const names = (0, toNames_1.default)(sorted);
|
|
14
14
|
expect(names).toEqual(["hello", "world", "theme-test"]);
|
|
15
15
|
});
|
|
16
16
|
test("must keep order of themes", () => {
|
|
@@ -21,8 +21,8 @@ describe("sortDependencies", () => {
|
|
|
21
21
|
"theme-test2",
|
|
22
22
|
"world",
|
|
23
23
|
]);
|
|
24
|
-
const sorted = sortDependencies_1.default(allPlugins);
|
|
25
|
-
const names = toNames_1.default(sorted);
|
|
24
|
+
const sorted = (0, sortDependencies_1.default)(allPlugins);
|
|
25
|
+
const names = (0, toNames_1.default)(sorted);
|
|
26
26
|
expect(names).toEqual(["hello", "world", "theme-test", "theme-test1", "theme-test2"]);
|
|
27
27
|
});
|
|
28
28
|
});
|
|
@@ -10,10 +10,10 @@ const validatePlugin_1 = __importDefault(require("../validatePlugin"));
|
|
|
10
10
|
describe("validatePlugin", () => {
|
|
11
11
|
test("must not validate a not loaded plugin", () => {
|
|
12
12
|
const plugin = plugin_1.default.createFromString("test");
|
|
13
|
-
return validatePlugin_1.default(plugin).then(() => {
|
|
13
|
+
return (0, validatePlugin_1.default)(plugin).then(() => {
|
|
14
14
|
throw new Error("Should not be validate");
|
|
15
15
|
}, (err) => {
|
|
16
|
-
return promise_1.default();
|
|
16
|
+
return (0, promise_1.default)();
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
test("alpha plugin can loaded plugin", () => {
|
|
@@ -94,6 +94,6 @@ describe("validatePlugin", () => {
|
|
|
94
94
|
package: immutable_1.default.fromJS(testPkgRequireAlphaVersion),
|
|
95
95
|
content: immutable_1.default.fromJS({}),
|
|
96
96
|
});
|
|
97
|
-
return validatePlugin_1.default(plugin);
|
|
97
|
+
return (0, validatePlugin_1.default)(plugin);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -15,6 +15,6 @@ const listDependencies_1 = __importDefault(require("./listDependencies"));
|
|
|
15
15
|
function listDepsForBook(book) {
|
|
16
16
|
const config = book.getConfig();
|
|
17
17
|
const plugins = config.getPluginDependencies();
|
|
18
|
-
return listDependencies_1.default(plugins);
|
|
18
|
+
return (0, listDependencies_1.default)(plugins);
|
|
19
19
|
}
|
|
20
20
|
exports.default = listDepsForBook;
|
|
@@ -9,9 +9,6 @@ const location_1 = __importDefault(require("../utils/location"));
|
|
|
9
9
|
const pluginResources_1 = __importDefault(require("../constants/pluginResources"));
|
|
10
10
|
/**
|
|
11
11
|
List all resources from a list of plugins
|
|
12
|
-
|
|
13
|
-
@param {OrderedMap<String:Plugin>}
|
|
14
|
-
@param {string} type
|
|
15
12
|
@return {Map<String:List<{url, path}>}
|
|
16
13
|
*/
|
|
17
14
|
function listResources(plugins, resources) {
|
|
@@ -18,7 +18,7 @@ function loadForBook(book) {
|
|
|
18
18
|
/**
|
|
19
19
|
* @type {List<PluginDependency>}
|
|
20
20
|
*/
|
|
21
|
-
const requirements = listDepsForBook_1.default(book);
|
|
21
|
+
const requirements = (0, listDepsForBook_1.default)(book);
|
|
22
22
|
const pluginResolver = new PluginResolver_1.PluginResolver();
|
|
23
23
|
const installedPlugins = requirements.map((dep) => {
|
|
24
24
|
const name = dep.getName();
|
|
@@ -32,7 +32,7 @@ function loadForBook(book) {
|
|
|
32
32
|
logger.info.ln(`${requirements.size} explicitly listed`);
|
|
33
33
|
}
|
|
34
34
|
return Promise.all(installedPlugins.map((plugin) => {
|
|
35
|
-
return loadPlugin_1.loadPlugin(book, plugin);
|
|
35
|
+
return (0, loadPlugin_1.loadPlugin)(book, plugin);
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
38
|
exports.default = loadForBook;
|