honkit 5.1.2 → 5.1.4
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/cli/buildEbook.js +2 -2
- package/lib/fs/tmpdir.d.ts +8 -0
- package/lib/fs/tmpdir.d.ts.map +1 -0
- package/lib/fs/tmpdir.js +20 -0
- package/lib/utils/fs.d.ts +8 -0
- package/lib/utils/fs.d.ts.map +1 -1
- package/lib/utils/fs.js +8 -1
- package/package.json +7 -7
package/lib/cli/buildEbook.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const tmp_1 = __importDefault(require("tmp"));
|
|
8
7
|
const promise_1 = __importDefault(require("../utils/promise"));
|
|
9
8
|
const fs_1 = __importDefault(require("../utils/fs"));
|
|
10
9
|
const parse_1 = __importDefault(require("../parse"));
|
|
@@ -12,6 +11,7 @@ const output_1 = __importDefault(require("../output"));
|
|
|
12
11
|
const options_1 = __importDefault(require("./options"));
|
|
13
12
|
const getBook_1 = __importDefault(require("./getBook"));
|
|
14
13
|
const page_cache_1 = require("../output/page-cache");
|
|
14
|
+
const tmpdir_1 = require("../fs/tmpdir");
|
|
15
15
|
function default_1(format) {
|
|
16
16
|
return {
|
|
17
17
|
name: `${format} [book] [output]`,
|
|
@@ -22,7 +22,7 @@ function default_1(format) {
|
|
|
22
22
|
// Output file will be stored in
|
|
23
23
|
const outputFile = args[1] || `book${extension}`;
|
|
24
24
|
// Create temporary directory
|
|
25
|
-
const outputFolder =
|
|
25
|
+
const outputFolder = (0, tmpdir_1.createTmpDirWithRealPath)();
|
|
26
26
|
const book = (0, getBook_1.default)(args, kwargs);
|
|
27
27
|
const logger = book.getLogger();
|
|
28
28
|
const Generator = output_1.default.getGenerator("ebook");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a temporary directory with a real path
|
|
3
|
+
* ebook-convert requires a real path to work
|
|
4
|
+
* https://github.com/honkit/honkit/issues/394
|
|
5
|
+
* @param prefix "honkit-"
|
|
6
|
+
*/
|
|
7
|
+
export declare const createTmpDirWithRealPath: (prefix?: string) => string;
|
|
8
|
+
//# sourceMappingURL=tmpdir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tmpdir.d.ts","sourceRoot":"","sources":["../../src/fs/tmpdir.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,YAAY,MAAM,WAGtD,CAAC"}
|
package/lib/fs/tmpdir.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTmpDirWithRealPath = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
/**
|
|
11
|
+
* Create a temporary directory with a real path
|
|
12
|
+
* ebook-convert requires a real path to work
|
|
13
|
+
* https://github.com/honkit/honkit/issues/394
|
|
14
|
+
* @param prefix "honkit-"
|
|
15
|
+
*/
|
|
16
|
+
const createTmpDirWithRealPath = (prefix = "honkit-") => {
|
|
17
|
+
const tmpDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), prefix));
|
|
18
|
+
return fs_1.default.realpathSync(tmpDir);
|
|
19
|
+
};
|
|
20
|
+
exports.createTmpDirWithRealPath = createTmpDirWithRealPath;
|
package/lib/utils/fs.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import fs from "fs";
|
|
|
3
3
|
declare function writeStream(filename: any, st: any): any;
|
|
4
4
|
declare function fileExists(filename: any): any;
|
|
5
5
|
declare function genTmpFile(opts: any): any;
|
|
6
|
+
/**
|
|
7
|
+
* Generate temporary dir
|
|
8
|
+
* @deprecated use tmpdir.ts
|
|
9
|
+
* @param opts
|
|
10
|
+
*/
|
|
6
11
|
declare function genTmpDir(opts: any): any;
|
|
7
12
|
declare function download(uri: string, destFilePath: string): Promise<any>;
|
|
8
13
|
declare function uniqueFilename(base: any, filename: any): any;
|
|
@@ -47,6 +52,9 @@ declare const _default: {
|
|
|
47
52
|
copy: any;
|
|
48
53
|
copyDir: any;
|
|
49
54
|
tmpFile: typeof genTmpFile;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated use tmpdir.ts
|
|
57
|
+
*/
|
|
50
58
|
tmpDir: typeof genTmpDir;
|
|
51
59
|
download: typeof download;
|
|
52
60
|
uniqueFilename: typeof uniqueFilename;
|
package/lib/utils/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAYpB,iBAAS,WAAW,CAAC,QAAQ,KAAA,EAAE,EAAE,KAAA,OA0BhC;AAGD,iBAAS,UAAU,CAAC,QAAQ,KAAA,OAY3B;AAGD,iBAAS,UAAU,CAAC,IAAI,KAAA,OAEvB;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAYpB,iBAAS,WAAW,CAAC,QAAQ,KAAA,EAAE,EAAE,KAAA,OA0BhC;AAGD,iBAAS,UAAU,CAAC,QAAQ,KAAA,OAY3B;AAGD,iBAAS,UAAU,CAAC,IAAI,KAAA,OAEvB;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,IAAI,KAAA,OAEtB;AA0BD,iBAAe,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAaxD;AAGD,iBAAS,cAAc,CAAC,IAAI,KAAA,EAAE,QAAQ,KAAA,OAcrC;AAGD,iBAAS,UAAU,CAAC,QAAQ,KAAA,OAI3B;AAGD,iBAAS,KAAK,CAAC,IAAI,KAAA,OAIlB;AAED;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,QAAQ,KAAA,EAAE,SAAS,KAAA,OAMtC;AAED;;;;;;GAMG;AACH,iBAAS,QAAQ,CAAC,UAAU,KAAA,EAAE,QAAQ,KAAA,UAOrC;AAED;;;;;GAKG;AACH,iBAAS,YAAY,CAAC,UAAU,KAAA,OAQ/B;;;;;;;;;;;;;;;;;IAiCG;;OAEG;;;;;;;;AAjCP,wBAwCE"}
|
package/lib/utils/fs.js
CHANGED
|
@@ -53,7 +53,11 @@ function fileExists(filename) {
|
|
|
53
53
|
function genTmpFile(opts) {
|
|
54
54
|
return promise_1.default.nfcall(tmp_1.default.file, opts).get(0);
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Generate temporary dir
|
|
58
|
+
* @deprecated use tmpdir.ts
|
|
59
|
+
* @param opts
|
|
60
|
+
*/
|
|
57
61
|
function genTmpDir(opts) {
|
|
58
62
|
return promise_1.default.nfcall(tmp_1.default.dir, opts).get(0);
|
|
59
63
|
}
|
|
@@ -189,6 +193,9 @@ exports.default = {
|
|
|
189
193
|
copy: promise_1.default.nfbind(cp_1.default),
|
|
190
194
|
copyDir: promise_1.default.nfbind(cpr_1.default),
|
|
191
195
|
tmpFile: genTmpFile,
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated use tmpdir.ts
|
|
198
|
+
*/
|
|
192
199
|
tmpDir: genTmpDir,
|
|
193
200
|
download: download,
|
|
194
201
|
uniqueFilename: uniqueFilename,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "honkit",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "HonKit is building beautiful books using Markdown.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"git",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"updateSnapshot": "jest src -u"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@honkit/asciidoc": "^5.1.
|
|
41
|
-
"@honkit/honkit-plugin-highlight": "^5.1.
|
|
42
|
-
"@honkit/honkit-plugin-theme-default": "^5.1.
|
|
43
|
-
"@honkit/markdown-legacy": "^5.1.
|
|
40
|
+
"@honkit/asciidoc": "^5.1.4",
|
|
41
|
+
"@honkit/honkit-plugin-highlight": "^5.1.4",
|
|
42
|
+
"@honkit/honkit-plugin-theme-default": "^5.1.4",
|
|
43
|
+
"@honkit/markdown-legacy": "^5.1.4",
|
|
44
44
|
"bash-color": "^0.0.4",
|
|
45
45
|
"cheerio": "^1.0.0-rc.12",
|
|
46
46
|
"chokidar": "^3.3.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"urijs": "^1.19.6"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@honkit/internal-test-utils": "^5.1.
|
|
92
|
+
"@honkit/internal-test-utils": "^5.1.4",
|
|
93
93
|
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
|
|
94
94
|
"@types/cheerio": "^0.22.31",
|
|
95
95
|
"@types/nunjucks": "^3.2.2",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"rimraf": "^3.0.2",
|
|
100
100
|
"typescript": "^4.1.3"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "1c26afb66065cd7437e0e8f9d226327d49259313"
|
|
103
103
|
}
|