highmark-cli 0.0.178 → 0.0.180
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/README.md +1 -1
- package/bin/action/help.js +1 -1
- package/bin/constants.js +2 -1
- package/bin/messages.js +0 -2
- package/bin/operation/copyClientFiles.js +1 -1
- package/bin/operation/html.js +2 -39
- package/bin/operation/watch.js +14 -14
- package/bin/utilities/fileSystem.js +4 -31
- package/bin/utilities/path.js +1 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Options:
|
|
|
56
56
|
|
|
57
57
|
--copy-client-files|-c Copy the bundled client files next to the output file
|
|
58
58
|
|
|
59
|
-
--output-directory-path|-o The output directory path. The default is the current directory
|
|
59
|
+
--output-directory-path|-o The output directory path. The default is the current directory
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
## Contact
|
package/bin/action/help.js
CHANGED
|
@@ -31,7 +31,7 @@ Options:
|
|
|
31
31
|
|
|
32
32
|
--copy-client-files|-c Copy the bundled client files next to the output file
|
|
33
33
|
|
|
34
|
-
--output-directory-path|-o The output directory path. The default is the current directory
|
|
34
|
+
--output-directory-path|-o The output directory path. The default is the current directory
|
|
35
35
|
|
|
36
36
|
Further information:
|
|
37
37
|
|
package/bin/constants.js
CHANGED
|
@@ -4,8 +4,8 @@ const FONT = "font",
|
|
|
4
4
|
ERROR = "error",
|
|
5
5
|
PERIOD = ".",
|
|
6
6
|
HIGHMARK_CLI = "Highmark-CLI",
|
|
7
|
-
INDEX_HTML_FILE_NAME = "index.html",
|
|
8
7
|
LIVE_RELOAD_PATH = "/live-reload",
|
|
8
|
+
INDEX_HTML_FILE_NAME = "index.html",
|
|
9
9
|
DIVS_SELECTOR_STRING = "body > div",
|
|
10
10
|
INDEX_TEMPLATE_FILE_PATH = "template/index.html",
|
|
11
11
|
CLIENT_TEMPLATE_FILE_PATH = "template/client.html",
|
|
@@ -18,6 +18,7 @@ module.exports = {
|
|
|
18
18
|
PERIOD,
|
|
19
19
|
HIGHMARK_CLI,
|
|
20
20
|
LIVE_RELOAD_PATH,
|
|
21
|
+
INDEX_HTML_FILE_NAME,
|
|
21
22
|
DIVS_SELECTOR_STRING,
|
|
22
23
|
INDEX_TEMPLATE_FILE_PATH,
|
|
23
24
|
CLIENT_TEMPLATE_FILE_PATH,
|
package/bin/messages.js
CHANGED
|
@@ -11,7 +11,6 @@ const FAILED_SERVER_MESSAGE = "Failed to serve.",
|
|
|
11
11
|
UNABLE_TO_READ_DIRECTORY_MESSAGE = "Unable to read the directory.",
|
|
12
12
|
UNABLE_TO_CREATE_DIRECTORY_MESSAGE = "Unable to create the directory.",
|
|
13
13
|
UNABLE_TO_PARSE_MARKDOWN_FILE_MESSAGE = "Unable to parse the markdown file.",
|
|
14
|
-
UNABLE_TO_PARSE_TEMPLATE_FILE_MESSAGE = "Unable to parse the template file.",
|
|
15
14
|
UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE = "Unable to convert Markdown to HTML.",
|
|
16
15
|
UNABLE_TO_CONVERT_MARKDOWN_STYLES_TO_CSS_MESSAGE = "Unable to convert Markdown styles to CSS.";
|
|
17
16
|
|
|
@@ -27,7 +26,6 @@ module.exports = {
|
|
|
27
26
|
UNABLE_TO_READ_DIRECTORY_MESSAGE,
|
|
28
27
|
UNABLE_TO_CREATE_DIRECTORY_MESSAGE,
|
|
29
28
|
UNABLE_TO_PARSE_MARKDOWN_FILE_MESSAGE,
|
|
30
|
-
UNABLE_TO_PARSE_TEMPLATE_FILE_MESSAGE,
|
|
31
29
|
UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE,
|
|
32
30
|
UNABLE_TO_CONVERT_MARKDOWN_STYLES_TO_CSS_MESSAGE
|
|
33
31
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { copyFiles: copyClientFilesAsync } = require("highmark-client");
|
|
4
4
|
|
|
5
5
|
function copyClientFilesOperation(proceed, abort, context) {
|
|
6
6
|
const { copyClientFiles } = context;
|
package/bin/operation/html.js
CHANGED
|
@@ -1,48 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { pathUtilities, packageUtilities } = require("necessary"),
|
|
4
|
-
{ computerModernStyle: computerModernStyleCSS } = require("highmark-fonts");
|
|
5
|
-
|
|
6
|
-
const { directoryPathFromFilePath } = require("../utilities/path"),
|
|
7
|
-
{ writeFile, parseTemplateFile } = require("../utilities/fileSystem"),
|
|
8
|
-
{ INDEX_TEMPLATE_FILE_PATH } = require("../constants");
|
|
9
|
-
|
|
10
|
-
const { getPackagePath } = packageUtilities,
|
|
11
|
-
{ concatenatePaths } = pathUtilities;
|
|
12
|
-
|
|
13
3
|
function htmlOperation(proceed, abort, context) {
|
|
14
|
-
const { markdownHTML,
|
|
15
|
-
templateFilePath = getTemplateFilePath(context),
|
|
16
|
-
args = {
|
|
17
|
-
markdownHTML,
|
|
18
|
-
markdownStylesCSS,
|
|
19
|
-
computerModernStyleCSS
|
|
20
|
-
},
|
|
21
|
-
content = parseTemplateFile(templateFilePath, args);
|
|
4
|
+
const { markdownHTML, markdownStylesCSS } = context;
|
|
22
5
|
|
|
23
|
-
|
|
6
|
+
debugger
|
|
24
7
|
|
|
25
8
|
proceed();
|
|
26
9
|
}
|
|
27
10
|
|
|
28
11
|
module.exports = htmlOperation;
|
|
29
|
-
|
|
30
|
-
function getTemplateFilePath(context) {
|
|
31
|
-
let templateFilePath;
|
|
32
|
-
|
|
33
|
-
({templateFilePath} = context);
|
|
34
|
-
|
|
35
|
-
if (templateFilePath === null) {
|
|
36
|
-
const packagePath = getPackagePath(),
|
|
37
|
-
indexTemplateFilePath = concatenatePaths(packagePath, INDEX_TEMPLATE_FILE_PATH);
|
|
38
|
-
|
|
39
|
-
templateFilePath = indexTemplateFilePath; ///
|
|
40
|
-
} else {
|
|
41
|
-
const { inputFilePath } = context,
|
|
42
|
-
inputDirectoryPath = directoryPathFromFilePath(inputFilePath);
|
|
43
|
-
|
|
44
|
-
templateFilePath = concatenatePaths(inputDirectoryPath, templateFilePath); ///
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return templateFilePath;
|
|
48
|
-
}
|
package/bin/operation/watch.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { pathUtilities } = require("necessary"),
|
|
4
|
+
{ createLiveReloadHandler } = require("lively-cli");
|
|
4
5
|
|
|
5
|
-
const { LIVE_RELOAD_PATH } = require("../constants");
|
|
6
|
+
const { LIVE_RELOAD_PATH, INDEX_HTML_FILE_NAME } = require("../constants");
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const { watch } = context;
|
|
9
|
-
|
|
10
|
-
if (!watch) {
|
|
11
|
-
proceed();
|
|
12
|
-
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
8
|
+
const { concatenatePaths } = pathUtilities;
|
|
15
9
|
|
|
10
|
+
function watchOperation(proceed, abort, context) {
|
|
16
11
|
const { server = null } = context;
|
|
17
12
|
|
|
18
13
|
if (server === null) {
|
|
@@ -21,11 +16,16 @@ function watchOperation(proceed, abort, context) {
|
|
|
21
16
|
return;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
const {
|
|
25
|
-
watchPattern = outputDirectoryPath, ///
|
|
26
|
-
liveReloadHandler = createLiveReloadHandler(watchPattern, quietly);
|
|
19
|
+
const { watch } = context;
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
if (watch) {
|
|
22
|
+
const { quietly, outputDirectoryPath } = context,
|
|
23
|
+
indexHTMLFilePath = concatenatePaths(outputDirectoryPath, INDEX_HTML_FILE_NAME),
|
|
24
|
+
watchPattern = indexHTMLFilePath, ///
|
|
25
|
+
liveReloadHandler = createLiveReloadHandler(watchPattern, quietly);
|
|
26
|
+
|
|
27
|
+
server.get(LIVE_RELOAD_PATH, liveReloadHandler);
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
proceed();
|
|
31
31
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { pathUtilities,
|
|
3
|
+
const { pathUtilities, fileSystemUtilities } = require("necessary");
|
|
4
4
|
|
|
5
5
|
const { isEntryNameHiddenName } = require("../utilities/path"),
|
|
6
6
|
{ UNABLE_TO_COPY_FILE_MESSAGE,
|
|
7
7
|
UNABLE_TO_READ_FILE_MESSAGE,
|
|
8
8
|
UNABLE_TO_WRITE_FILE_MESSAGE,
|
|
9
9
|
UNABLE_TO_READ_DIRECTORY_MESSAGE,
|
|
10
|
-
UNABLE_TO_CREATE_DIRECTORY_MESSAGE
|
|
11
|
-
UNABLE_TO_PARSE_TEMPLATE_FILE_MESSAGE } = require("../messages");
|
|
10
|
+
UNABLE_TO_CREATE_DIRECTORY_MESSAGE } = require("../messages");
|
|
12
11
|
|
|
13
|
-
const {
|
|
14
|
-
{ concatenatePaths } = pathUtilities,
|
|
12
|
+
const { concatenatePaths } = pathUtilities,
|
|
15
13
|
{ isEntryFile,
|
|
16
14
|
checkEntryExists,
|
|
17
15
|
copyFile: copyFileAsync,
|
|
@@ -144,35 +142,10 @@ function createDirectory(directoryPath) {
|
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
|
|
147
|
-
function parseTemplateFile(templateFilePath, args) {
|
|
148
|
-
let content = null;
|
|
149
|
-
|
|
150
|
-
try {
|
|
151
|
-
const filePath = templateFilePath; ///
|
|
152
|
-
|
|
153
|
-
content = parseFile(filePath, args);
|
|
154
|
-
|
|
155
|
-
console.log(`Parse template file '${filePath}'.`);
|
|
156
|
-
} catch (error) {
|
|
157
|
-
let message;
|
|
158
|
-
|
|
159
|
-
message = UNABLE_TO_PARSE_TEMPLATE_FILE_MESSAGE;
|
|
160
|
-
|
|
161
|
-
console.log(message);
|
|
162
|
-
|
|
163
|
-
({ message } = error);
|
|
164
|
-
|
|
165
|
-
console.log(message);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return content;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
145
|
module.exports = {
|
|
172
146
|
copyFile,
|
|
173
147
|
readFile,
|
|
174
148
|
writeFile,
|
|
175
149
|
readDirectory,
|
|
176
|
-
createDirectory
|
|
177
|
-
parseTemplateFile
|
|
150
|
+
createDirectory
|
|
178
151
|
};
|
package/bin/utilities/path.js
CHANGED
|
@@ -4,23 +4,7 @@ const { pathUtilities } = require("necessary");
|
|
|
4
4
|
|
|
5
5
|
const { PERIOD } = require("../constants");
|
|
6
6
|
|
|
7
|
-
const { isPathName,
|
|
8
|
-
|
|
9
|
-
function isFilePathFileName(filePath) {
|
|
10
|
-
const path = filePath, ///
|
|
11
|
-
pathName = isPathName(path),
|
|
12
|
-
filePathFileName = pathName; ///
|
|
13
|
-
|
|
14
|
-
return filePathFileName;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function fileNameFromFilePath(filePath) {
|
|
18
|
-
const path = filePath, ///
|
|
19
|
-
bottommostName = bottommostNameFromPath(path),
|
|
20
|
-
fileName = bottommostName; ///
|
|
21
|
-
|
|
22
|
-
return fileName;
|
|
23
|
-
}
|
|
7
|
+
const { isPathName, pathWithoutBottommostNameFromPath } = pathUtilities;
|
|
24
8
|
|
|
25
9
|
function isEntryNameHiddenName(entryName) {
|
|
26
10
|
const nameHiddenName = /^\..+/.test(entryName);
|
|
@@ -46,8 +30,6 @@ function directoryPathFromFilePath(filePath) {
|
|
|
46
30
|
}
|
|
47
31
|
|
|
48
32
|
module.exports = {
|
|
49
|
-
isFilePathFileName,
|
|
50
|
-
fileNameFromFilePath,
|
|
51
33
|
isEntryNameHiddenName,
|
|
52
34
|
directoryPathFromFilePath
|
|
53
35
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "highmark-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.180",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/highmark-cli",
|
|
7
7
|
"description": "Extensible, styleable Markdown.",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.28",
|
|
14
14
|
"express": "^4.19.2",
|
|
15
|
-
"highmark-client": "^0.0.
|
|
15
|
+
"highmark-client": "^0.0.17",
|
|
16
16
|
"highmark-fonts": "^1.0.43",
|
|
17
17
|
"highmark-markdown": "^0.0.245",
|
|
18
18
|
"lively-cli": "^2.0.59",
|