highmark-cli 1.3.186 → 1.3.188
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/highmark.js +3 -3
- package/lib/abbreviations.js +17 -0
- package/lib/action/help.js +6 -0
- package/lib/action/initialise.js +17 -0
- package/lib/action/publish.js +35 -0
- package/lib/action/server.js +22 -0
- package/lib/action/setOptions.js +26 -0
- package/lib/action/version.js +10 -0
- package/lib/changeDirectory.js +24 -0
- package/lib/commands.js +9 -0
- package/lib/configuration/version_1_0.js +3 -0
- package/lib/configuration/version_1_1.js +13 -0
- package/lib/configuration/version_1_2.js +14 -0
- package/lib/configuration/version_1_3.js +31 -0
- package/lib/configuration.js +114 -0
- package/lib/constants.js +18 -0
- package/lib/defaultIndexOptions.js +11 -0
- package/lib/defaults.js +15 -0
- package/lib/descriptions.js +6 -0
- package/lib/importer.js +23 -0
- package/lib/jsonTypes.js +7 -0
- package/lib/main.js +62 -0
- package/lib/messages.js +25 -0
- package/lib/operation/copyClientFiles.js +12 -0
- package/lib/operation/copyFonts.js +17 -0
- package/lib/operation/createClientHTML.js +12 -0
- package/lib/operation/indexOptions.js +42 -0
- package/lib/operation/markdownHTML.js +48 -0
- package/lib/operation/markdownStylesCSS.js +42 -0
- package/lib/operation/prompt/charactersPerLine.js +29 -0
- package/lib/operation/prompt/contentsDepth.js +29 -0
- package/lib/operation/prompt/linesPerPage.js +31 -0
- package/lib/operation/server.js +26 -0
- package/lib/operation/setOptions.js +13 -0
- package/lib/operation/watch.js +16 -0
- package/lib/options.js +12 -0
- package/lib/prepare.js +38 -0
- package/lib/utilities/division.js +10 -0
- package/lib/utilities/filePath.js +11 -0
- package/lib/utilities/fileSystem.js +90 -0
- package/lib/utilities/json.js +108 -0
- package/lib/utilities/markdown.js +19 -0
- package/lib/utilities/operation.js +37 -0
- package/lib/utilities/path.js +7 -0
- package/lib/utilities/type.js +54 -0
- package/lib/utilities/validate.js +12 -0
- package/lib/versions.js +7 -0
- package/package.json +19 -3
- package/{bin → src}/abbreviations.js +12 -12
- package/{bin → src}/action/help.js +1 -3
- package/{bin → src}/action/initialise.js +3 -5
- package/src/action/publish.js +42 -0
- package/{bin → src}/action/server.js +5 -7
- package/{bin → src}/action/setOptions.js +8 -10
- package/src/action/version.js +13 -0
- package/{bin → src}/changeDirectory.js +4 -6
- package/src/commands.js +8 -0
- package/src/configuration/version_1_1.js +17 -0
- package/{bin → src}/configuration/version_1_2.js +3 -6
- package/{bin → src}/configuration/version_1_3.js +4 -8
- package/{bin → src}/configuration.js +14 -23
- package/src/constants.js +17 -0
- package/{bin → src}/defaultIndexOptions.js +1 -1
- package/src/defaults.js +14 -0
- package/src/descriptions.js +5 -0
- package/{bin → src}/importer.js +5 -7
- package/src/jsonTypes.js +6 -0
- package/{bin → src}/main.js +17 -19
- package/src/messages.js +24 -0
- package/{bin → src}/operation/copyClientFiles.js +2 -4
- package/{bin → src}/operation/copyFonts.js +4 -6
- package/{bin → src}/operation/createClientHTML.js +4 -6
- package/{bin → src}/operation/indexOptions.js +5 -7
- package/{bin → src}/operation/markdownHTML.js +9 -11
- package/{bin → src}/operation/markdownStylesCSS.js +7 -9
- package/{bin → src}/operation/prompt/charactersPerLine.js +5 -7
- package/{bin → src}/operation/prompt/contentsDepth.js +5 -7
- package/{bin → src}/operation/prompt/linesPerPage.js +7 -9
- package/{bin → src}/operation/server.js +4 -6
- package/{bin → src}/operation/setOptions.js +2 -4
- package/{bin → src}/operation/watch.js +5 -7
- package/src/options.js +11 -0
- package/{bin → src}/prepare.js +9 -11
- package/{bin → src}/utilities/division.js +3 -7
- package/{bin → src}/utilities/filePath.js +2 -7
- package/{bin → src}/utilities/fileSystem.js +9 -17
- package/{bin → src}/utilities/json.js +5 -10
- package/{bin → src}/utilities/markdown.js +4 -9
- package/{bin → src}/utilities/operation.js +2 -6
- package/{bin → src}/utilities/path.js +1 -5
- package/{bin → src}/utilities/type.js +3 -7
- package/src/utilities/validate.js +7 -0
- package/src/versions.js +6 -0
- package/bin/action/publish.js +0 -44
- package/bin/action/version.js +0 -15
- package/bin/commands.js +0 -17
- package/bin/configuration/version_1_1.js +0 -20
- package/bin/constants.js +0 -35
- package/bin/defaults.js +0 -29
- package/bin/descriptions.js +0 -11
- package/bin/jsonTypes.js +0 -13
- package/bin/messages.js +0 -51
- package/bin/options.js +0 -23
- package/bin/utilities/validate.js +0 -13
- package/bin/versions.js +0 -13
- /package/{bin → src}/configuration/version_1_0.js +0 -0
package/{bin → src}/prepare.js
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import changeDirectory from "./changeDirectory";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { DEFAULT_HELP, DEFAULT_VERSION, DEFAULT_SERVER } from "./defaults";
|
|
6
|
+
import { HELP_COMMAND,
|
|
7
|
+
SERVER_COMMAND,
|
|
8
|
+
VERSION_COMMAND,
|
|
9
|
+
PUBLISH_COMMAND,
|
|
10
|
+
INITIALISE_COMMAND,
|
|
11
|
+
SET_OPTIONS_COMMAND } from "./commands";
|
|
12
12
|
|
|
13
|
-
function prepare(command, argument, options, main) {
|
|
13
|
+
export default function prepare(command, argument, options, main) {
|
|
14
14
|
const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
|
|
15
15
|
|
|
16
16
|
if (false) {
|
|
@@ -56,5 +56,3 @@ function prepare(command, argument, options, main) {
|
|
|
56
56
|
|
|
57
57
|
main(command, argument, options);
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
module.exports = prepare;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { pathUtilities, arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { DEFAULT_DIVISION_IDENTIFIER } from "../constants";
|
|
6
6
|
|
|
7
7
|
const { second } = arrayUtilities,
|
|
8
8
|
{ isPathName, bottommostNameFromPath } = pathUtilities;
|
|
9
9
|
|
|
10
|
-
function classNameFromFilePath(filePath) {
|
|
10
|
+
export default function classNameFromFilePath(filePath) {
|
|
11
11
|
const path = filePath,
|
|
12
12
|
pathName = isPathName(path),
|
|
13
13
|
name = pathName ?
|
|
@@ -21,7 +21,3 @@ function classNameFromFilePath(filePath) {
|
|
|
21
21
|
|
|
22
22
|
return className;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
module.exports = {
|
|
26
|
-
classNameFromFilePath
|
|
27
|
-
}
|
|
@@ -6,11 +6,6 @@ const markdownStyleFilePathPattern = "^(?:[^\\/]+\\/){1,}[^\\.]+\\.mds$",
|
|
|
6
6
|
const markdownStyleFilePathRegularExpression = new RegExp(markdownStyleFilePathPattern),
|
|
7
7
|
defaultMarkdownStyleFilePathRegularExpression = new RegExp(defaultMarkdownStyleFilePathPattern);
|
|
8
8
|
|
|
9
|
-
function isFilePathMarkdownStyleFilePath(filePath) { return markdownStyleFilePathRegularExpression.test(filePath); }
|
|
9
|
+
export function isFilePathMarkdownStyleFilePath(filePath) { return markdownStyleFilePathRegularExpression.test(filePath); }
|
|
10
10
|
|
|
11
|
-
function isFilePathDefaultMarkdownStyleFilePath(filePath) { return defaultMarkdownStyleFilePathRegularExpression.test(filePath); }
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
isFilePathMarkdownStyleFilePath,
|
|
15
|
-
isFilePathDefaultMarkdownStyleFilePath
|
|
16
|
-
};
|
|
11
|
+
export function isFilePathDefaultMarkdownStyleFilePath(filePath) { return defaultMarkdownStyleFilePathRegularExpression.test(filePath); }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { pathUtilities, fileSystemUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { isEntryNameHiddenName } from "../utilities/path";
|
|
6
|
+
import { 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 }
|
|
10
|
+
UNABLE_TO_CREATE_DIRECTORY_MESSAGE } from "../messages";
|
|
11
11
|
|
|
12
12
|
const { concatenatePaths } = pathUtilities,
|
|
13
13
|
{ isEntryFile,
|
|
@@ -18,7 +18,7 @@ const { concatenatePaths } = pathUtilities,
|
|
|
18
18
|
readDirectory: readDirectoryAsync,
|
|
19
19
|
createDirectory: createDirectoryAsync } = fileSystemUtilities;
|
|
20
20
|
|
|
21
|
-
function copyFile(sourceFilePath, targetFilePath) {
|
|
21
|
+
export function copyFile(sourceFilePath, targetFilePath) {
|
|
22
22
|
let content = null;
|
|
23
23
|
|
|
24
24
|
try {
|
|
@@ -40,7 +40,7 @@ function copyFile(sourceFilePath, targetFilePath) {
|
|
|
40
40
|
return content;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function readFile(filePath) {
|
|
43
|
+
export function readFile(filePath) {
|
|
44
44
|
let content = null;
|
|
45
45
|
|
|
46
46
|
try {
|
|
@@ -62,7 +62,7 @@ function readFile(filePath) {
|
|
|
62
62
|
return content;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function writeFile(filePath, content) {
|
|
65
|
+
export function writeFile(filePath, content) {
|
|
66
66
|
try {
|
|
67
67
|
writeFileAsync(filePath, content);
|
|
68
68
|
|
|
@@ -80,7 +80,7 @@ function writeFile(filePath, content) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
function readDirectory(directoryPath, callback, recursive = true) {
|
|
83
|
+
export function readDirectory(directoryPath, callback, recursive = true) {
|
|
84
84
|
try {
|
|
85
85
|
const entryNames = readDirectoryAsync(directoryPath);
|
|
86
86
|
|
|
@@ -117,7 +117,7 @@ function readDirectory(directoryPath, callback, recursive = true) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
function createDirectory(directoryPath) {
|
|
120
|
+
export function createDirectory(directoryPath) {
|
|
121
121
|
const entryPath = directoryPath, ///
|
|
122
122
|
entryExists = checkEntryExists(entryPath);
|
|
123
123
|
|
|
@@ -141,11 +141,3 @@ function createDirectory(directoryPath) {
|
|
|
141
141
|
console.log(message);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
module.exports = {
|
|
146
|
-
copyFile,
|
|
147
|
-
readFile,
|
|
148
|
-
writeFile,
|
|
149
|
-
readDirectory,
|
|
150
|
-
createDirectory
|
|
151
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { typeOf } from "../utilities/type";
|
|
4
|
+
import { INFINITY } from "../constants";
|
|
5
|
+
import { ARRAY_JSON_TYPE, OBJECT_JSON_TYPE, PRIMITIVE_JSON_TYPE } from "../jsonTypes";
|
|
6
6
|
|
|
7
|
-
function serialiseJSON(json) {
|
|
7
|
+
export function serialiseJSON(json) {
|
|
8
8
|
const type = typeOf(json);
|
|
9
9
|
|
|
10
10
|
switch (type) {
|
|
@@ -42,7 +42,7 @@ function serialiseJSON(json) {
|
|
|
42
42
|
return json;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function unserialiseJSON(json) {
|
|
45
|
+
export function unserialiseJSON(json) {
|
|
46
46
|
const type = typeOf(json);
|
|
47
47
|
|
|
48
48
|
switch (type) {
|
|
@@ -80,11 +80,6 @@ function unserialiseJSON(json) {
|
|
|
80
80
|
return json;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
module.exports = {
|
|
84
|
-
serialiseJSON,
|
|
85
|
-
unserialiseJSON
|
|
86
|
-
};
|
|
87
|
-
|
|
88
83
|
function serialiseArray(array) {
|
|
89
84
|
array = array.map((json) => {
|
|
90
85
|
json = serialiseJSON(json); ///
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { MarkdownLexer, MarkdownParser } from "highmark-markdown";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { UNABLE_TO_PARSE_MARKDOWN_FILE_MESSAGE } from "../messages";
|
|
6
6
|
|
|
7
7
|
const markdownLexer = MarkdownLexer.fromNothing(),
|
|
8
8
|
markdownParser = MarkdownParser.fromNothing();
|
|
9
9
|
|
|
10
|
-
function tokensFromContent(content) {
|
|
10
|
+
export function tokensFromContent(content) {
|
|
11
11
|
const tokens = markdownLexer.tokenise(content);
|
|
12
12
|
|
|
13
13
|
return tokens;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function nodeFromTokens(tokens, startRuleName = null) {
|
|
16
|
+
export function nodeFromTokens(tokens, startRuleName = null) {
|
|
17
17
|
const ruleMap = markdownParser.getRuleMap(),
|
|
18
18
|
startRule = (startRuleName !== null) ?
|
|
19
19
|
ruleMap[startRuleName] :
|
|
@@ -29,8 +29,3 @@ function nodeFromTokens(tokens, startRuleName = null) {
|
|
|
29
29
|
|
|
30
30
|
return node;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
module.exports = {
|
|
34
|
-
tokensFromContent,
|
|
35
|
-
nodeFromTokens
|
|
36
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { asynchronousUtilities } from "necessary";
|
|
4
4
|
|
|
5
5
|
const { whilst } = asynchronousUtilities;
|
|
6
6
|
|
|
7
|
-
function executeOperations(operations, callback, context) {
|
|
7
|
+
export function executeOperations(operations, callback, context) {
|
|
8
8
|
const completed = true;
|
|
9
9
|
|
|
10
10
|
Object.assign(context, {
|
|
@@ -23,10 +23,6 @@ function executeOperations(operations, callback, context) {
|
|
|
23
23
|
}, context);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
module.exports = {
|
|
27
|
-
executeOperations
|
|
28
|
-
};
|
|
29
|
-
|
|
30
26
|
function executeOperation(next, done, context, index) {
|
|
31
27
|
const { operations } = context,
|
|
32
28
|
operationsLength = operations.length,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { STRING, NUMBER, BOOLEAN } from "../constants";
|
|
4
|
+
import { NULL_JSON_TYPE, ARRAY_JSON_TYPE, OBJECT_JSON_TYPE, PRIMITIVE_JSON_TYPE } from "../jsonTypes";
|
|
5
5
|
|
|
6
|
-
function typeOf(json) {
|
|
6
|
+
export function typeOf(json) {
|
|
7
7
|
let type;
|
|
8
8
|
|
|
9
9
|
const _null = isNull(json),
|
|
@@ -30,10 +30,6 @@ function typeOf(json) {
|
|
|
30
30
|
return type;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
module.exports = {
|
|
34
|
-
typeOf
|
|
35
|
-
};
|
|
36
|
-
|
|
37
33
|
function isNull(json) {
|
|
38
34
|
const _null = (json === null);
|
|
39
35
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function validateLinesPerPage(linesPerPage) { return /^\d*$/.test(linesPerPage); }
|
|
4
|
+
|
|
5
|
+
export function validateContentsDepth(contentsDepth) { return /^1|2|3|4$/.test(contentsDepth); }
|
|
6
|
+
|
|
7
|
+
export function validateCharactersPerLine(charactersPerLine) { return /^\d+$/.test(charactersPerLine); }
|
package/src/versions.js
ADDED
package/bin/action/publish.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const watchOperation = require("../operation/watch"),
|
|
4
|
-
copyFontsOperation = require("../operation/copyFonts"),
|
|
5
|
-
indexOptionsOperation = require("../operation/indexOptions"),
|
|
6
|
-
markdownHTMLOperation = require("../operation/markdownHTML"),
|
|
7
|
-
copyClientFilesOperation = require("../operation/copyClientFiles"),
|
|
8
|
-
createClientHTMLOperation = require("../operation/createClientHTML"),
|
|
9
|
-
markdownStylesCSSOperation = require("../operation/markdownStylesCSS");
|
|
10
|
-
|
|
11
|
-
const { executeOperations } = require("../utilities/operation"),
|
|
12
|
-
{ SUCCESSFUL_PUBLISH_MESSAGE, FAILED_PUBLISH_MESSAGE } = require("../messages");
|
|
13
|
-
|
|
14
|
-
function publishAction(port, fonts, watch, client, quietly, inputFileName, projectDirectoryName) {
|
|
15
|
-
const operations = [
|
|
16
|
-
indexOptionsOperation,
|
|
17
|
-
markdownHTMLOperation,
|
|
18
|
-
markdownStylesCSSOperation,
|
|
19
|
-
createClientHTMLOperation,
|
|
20
|
-
copyClientFilesOperation,
|
|
21
|
-
copyFontsOperation,
|
|
22
|
-
watchOperation
|
|
23
|
-
],
|
|
24
|
-
context = {
|
|
25
|
-
port,
|
|
26
|
-
fonts,
|
|
27
|
-
watch,
|
|
28
|
-
client,
|
|
29
|
-
quietly,
|
|
30
|
-
inputFileName,
|
|
31
|
-
projectDirectoryName
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
executeOperations(operations, (completed) => {
|
|
35
|
-
const success = completed, ///
|
|
36
|
-
message = success ?
|
|
37
|
-
SUCCESSFUL_PUBLISH_MESSAGE :
|
|
38
|
-
FAILED_PUBLISH_MESSAGE;
|
|
39
|
-
|
|
40
|
-
console.log(message);
|
|
41
|
-
}, context);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
module.exports = publishAction;
|
package/bin/action/version.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { packageUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const { HIGHMARK_CLI } = require("../constants");
|
|
6
|
-
|
|
7
|
-
const { getVersion } = packageUtilities;
|
|
8
|
-
|
|
9
|
-
function versionAction() {
|
|
10
|
-
const version = getVersion(); ///
|
|
11
|
-
|
|
12
|
-
console.log(`${HIGHMARK_CLI} version ${version}`);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = versionAction;
|
package/bin/commands.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const HELP_COMMAND = "help",
|
|
4
|
-
SERVER_COMMAND = "server",
|
|
5
|
-
VERSION_COMMAND = "version",
|
|
6
|
-
PUBLISH_COMMAND = 'publish',
|
|
7
|
-
INITIALISE_COMMAND = 'initialise',
|
|
8
|
-
SET_OPTIONS_COMMAND = "set-options";
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
HELP_COMMAND,
|
|
12
|
-
SERVER_COMMAND,
|
|
13
|
-
VERSION_COMMAND,
|
|
14
|
-
PUBLISH_COMMAND,
|
|
15
|
-
INITIALISE_COMMAND,
|
|
16
|
-
SET_OPTIONS_COMMAND
|
|
17
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { VERSION_1_1 } = require("../versions");
|
|
4
|
-
|
|
5
|
-
const { DEFAULT_CONTENTS_DEPTH } = require("../defaults");
|
|
6
|
-
|
|
7
|
-
function migrateToVersion1_1(json) {
|
|
8
|
-
const version = VERSION_1_1,
|
|
9
|
-
contentsDepth = DEFAULT_CONTENTS_DEPTH;
|
|
10
|
-
|
|
11
|
-
json = Object.assign({}, json, {
|
|
12
|
-
version,
|
|
13
|
-
contentsDepth
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return json;
|
|
17
|
-
}
|
|
18
|
-
module.exports = {
|
|
19
|
-
migrateToVersion1_1
|
|
20
|
-
};
|
package/bin/constants.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const ERROR = "error",
|
|
4
|
-
STRING = "string",
|
|
5
|
-
NUMBER = "number",
|
|
6
|
-
BOOLEAN = "boolean",
|
|
7
|
-
HIGHMARK = "highmark",
|
|
8
|
-
INFINITY = "Infinity",
|
|
9
|
-
DOUBLE_DOTS = "..",
|
|
10
|
-
EMPTY_STRING = "",
|
|
11
|
-
DOUBLE_SPACE = " ",
|
|
12
|
-
HIGHMARK_CLI = "Highmark-CLI",
|
|
13
|
-
LIVE_RELOAD_PATH = "/live-reload",
|
|
14
|
-
FONT_DIRECTORY_NAME = "font",
|
|
15
|
-
DIVS_SELECTOR_STRING = "body > div",
|
|
16
|
-
INDEX_JSON_FILE_NAME = "index.json",
|
|
17
|
-
DEFAULT_DIVISION_IDENTIFIER = "default";
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
ERROR,
|
|
21
|
-
STRING,
|
|
22
|
-
NUMBER,
|
|
23
|
-
BOOLEAN,
|
|
24
|
-
HIGHMARK,
|
|
25
|
-
INFINITY,
|
|
26
|
-
DOUBLE_DOTS,
|
|
27
|
-
EMPTY_STRING,
|
|
28
|
-
DOUBLE_SPACE,
|
|
29
|
-
HIGHMARK_CLI,
|
|
30
|
-
LIVE_RELOAD_PATH,
|
|
31
|
-
FONT_DIRECTORY_NAME,
|
|
32
|
-
DIVS_SELECTOR_STRING,
|
|
33
|
-
INDEX_JSON_FILE_NAME,
|
|
34
|
-
DEFAULT_DIVISION_IDENTIFIER
|
|
35
|
-
};
|
package/bin/defaults.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const DEFAULT_HELP = false,
|
|
4
|
-
DEFAULT_PORT = 8888,
|
|
5
|
-
DEFAULT_FONTS = false,
|
|
6
|
-
DEFAULT_WATCH = false,
|
|
7
|
-
DEFAULT_CLIENT = false,
|
|
8
|
-
DEFAULT_SERVER = false,
|
|
9
|
-
DEFAULT_QUIETLY = false,
|
|
10
|
-
DEFAULT_VERSION = false,
|
|
11
|
-
DEFAULT_LINES_PER_PAGE = Infinity,
|
|
12
|
-
DEFAULT_CONTENTS_DEPTH = 2,
|
|
13
|
-
DEFAULT_INPUT_FILE_NAME = "default.md",
|
|
14
|
-
DEFAULT_CHARACTERS_PER_LINE = 75;
|
|
15
|
-
|
|
16
|
-
module.exports = {
|
|
17
|
-
DEFAULT_HELP,
|
|
18
|
-
DEFAULT_PORT,
|
|
19
|
-
DEFAULT_FONTS,
|
|
20
|
-
DEFAULT_WATCH,
|
|
21
|
-
DEFAULT_CLIENT,
|
|
22
|
-
DEFAULT_SERVER,
|
|
23
|
-
DEFAULT_QUIETLY,
|
|
24
|
-
DEFAULT_VERSION,
|
|
25
|
-
DEFAULT_LINES_PER_PAGE,
|
|
26
|
-
DEFAULT_CONTENTS_DEPTH,
|
|
27
|
-
DEFAULT_INPUT_FILE_NAME,
|
|
28
|
-
DEFAULT_CHARACTERS_PER_LINE
|
|
29
|
-
};
|
package/bin/descriptions.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const LINES_PER_PAGE_DESCRIPTION = "Lines per page (leave blank for default of Infinity): ",
|
|
4
|
-
CONTENTS_DEPTH_DESCRIPTION = "Contents depth (from 1 to 4): ",
|
|
5
|
-
CHARACTERS_PER_LINE_DESCRIPTION = "Characters per line: "
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
LINES_PER_PAGE_DESCRIPTION,
|
|
9
|
-
CONTENTS_DEPTH_DESCRIPTION,
|
|
10
|
-
CHARACTERS_PER_LINE_DESCRIPTION
|
|
11
|
-
};
|
package/bin/jsonTypes.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const NULL_JSON_TYPE = "null",
|
|
4
|
-
ARRAY_JSON_TYPE = "array",
|
|
5
|
-
OBJECT_JSON_TYPE = "object",
|
|
6
|
-
PRIMITIVE_JSON_TYPE = "primitive";
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
NULL_JSON_TYPE,
|
|
10
|
-
ARRAY_JSON_TYPE,
|
|
11
|
-
OBJECT_JSON_TYPE,
|
|
12
|
-
PRIMITIVE_JSON_TYPE
|
|
13
|
-
};
|
package/bin/messages.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const NO_ARGUMENT_GIVEN_MESSAGE = "No argument has been given.",
|
|
4
|
-
COMMAND_NOT_RECOGNISED_MESSAGE = "The command is not recognised.",
|
|
5
|
-
INVALID_LINES_PER_PAGE_MESSAGE = "The lines per page must either be a number or left blank for the default of Infinity, which effectively suppresses pagination.",
|
|
6
|
-
INVALID_CONTENTS_DEPTH_MESSAGE = "The contents depth must be a number between 1 and 4 inclusive, with 1 being primary headings only, 4 down to quaternary headings.",
|
|
7
|
-
INVALID_CHARACTERS_PER_LINE_MESSAGE = "The characters per line must a number.",
|
|
8
|
-
FAILED_SERVER_MESSAGE = "Failed to serve.",
|
|
9
|
-
FAILED_PUBLISH_MESSAGE = "Failed to publish.",
|
|
10
|
-
FAILED_INITIALISE_MESSAGE = "Failed to create a configuration file because one is already present.",
|
|
11
|
-
FAILED_SET_OPTIONS_MESSAGE = "Failed to set the options.",
|
|
12
|
-
SUCCESSFUL_SERVER_MESSAGE = "Served successfully.",
|
|
13
|
-
SUCCESSFUL_PUBLISH_MESSAGE = "Published successfully.",
|
|
14
|
-
SUCCESSFUL_INITIALISE_MESSAGE = "The configuration file has been created successfully.",
|
|
15
|
-
SUCCESSFUL_SET_OPTIONS_MESSAGE = "The options have been set successfully.",
|
|
16
|
-
UNABLE_TO_COPY_FILE_MESSAGE = "Unable to copy the file.",
|
|
17
|
-
UNABLE_TO_READ_FILE_MESSAGE = "Unable to read the file.",
|
|
18
|
-
UNABLE_TO_WRITE_FILE_MESSAGE = "Unable to write the file.",
|
|
19
|
-
UNABLE_TO_START_SERVER_MESSAGE = "Unable to start the server",
|
|
20
|
-
UNABLE_TO_READ_DIRECTORY_MESSAGE = "Unable to read the directory.",
|
|
21
|
-
UNABLE_TO_CREATE_DIRECTORY_MESSAGE = "Unable to create the directory.",
|
|
22
|
-
UNABLE_TO_PARSE_MARKDOWN_FILE_MESSAGE = "Unable to parse the markdown file.",
|
|
23
|
-
CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE = "There is no configuration file. Run 'highmark initialise' to create one.",
|
|
24
|
-
UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE = "Unable to convert Markdown to HTML.",
|
|
25
|
-
UNABLE_TO_CONVERT_MARKDOWN_STYLES_TO_CSS_MESSAGE = "Unable to convert Markdown styles to CSS.";
|
|
26
|
-
|
|
27
|
-
module.exports = {
|
|
28
|
-
NO_ARGUMENT_GIVEN_MESSAGE,
|
|
29
|
-
COMMAND_NOT_RECOGNISED_MESSAGE,
|
|
30
|
-
INVALID_LINES_PER_PAGE_MESSAGE,
|
|
31
|
-
INVALID_CONTENTS_DEPTH_MESSAGE,
|
|
32
|
-
INVALID_CHARACTERS_PER_LINE_MESSAGE,
|
|
33
|
-
FAILED_SERVER_MESSAGE,
|
|
34
|
-
FAILED_PUBLISH_MESSAGE,
|
|
35
|
-
FAILED_INITIALISE_MESSAGE,
|
|
36
|
-
FAILED_SET_OPTIONS_MESSAGE,
|
|
37
|
-
SUCCESSFUL_SERVER_MESSAGE,
|
|
38
|
-
SUCCESSFUL_PUBLISH_MESSAGE,
|
|
39
|
-
SUCCESSFUL_INITIALISE_MESSAGE,
|
|
40
|
-
SUCCESSFUL_SET_OPTIONS_MESSAGE,
|
|
41
|
-
UNABLE_TO_COPY_FILE_MESSAGE,
|
|
42
|
-
UNABLE_TO_READ_FILE_MESSAGE,
|
|
43
|
-
UNABLE_TO_WRITE_FILE_MESSAGE,
|
|
44
|
-
UNABLE_TO_START_SERVER_MESSAGE,
|
|
45
|
-
UNABLE_TO_READ_DIRECTORY_MESSAGE,
|
|
46
|
-
UNABLE_TO_CREATE_DIRECTORY_MESSAGE,
|
|
47
|
-
UNABLE_TO_PARSE_MARKDOWN_FILE_MESSAGE,
|
|
48
|
-
CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE,
|
|
49
|
-
UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE,
|
|
50
|
-
UNABLE_TO_CONVERT_MARKDOWN_STYLES_TO_CSS_MESSAGE
|
|
51
|
-
};
|
package/bin/options.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const HELP_OPTION = "help",
|
|
4
|
-
PORT_OPTION = "port",
|
|
5
|
-
FONTS_OPTION = "fonts",
|
|
6
|
-
WATCH_OPTION = "watch",
|
|
7
|
-
CLIENT_OPTION = "client",
|
|
8
|
-
SERVER_OPTION = "server",
|
|
9
|
-
VERSION_OPTION = "version",
|
|
10
|
-
QUIETLY_OPTION = "quietly",
|
|
11
|
-
INPUT_FILE_NAME_OPTION = "input-file-name";
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
HELP_OPTION,
|
|
15
|
-
PORT_OPTION,
|
|
16
|
-
FONTS_OPTION,
|
|
17
|
-
WATCH_OPTION,
|
|
18
|
-
CLIENT_OPTION,
|
|
19
|
-
SERVER_OPTION,
|
|
20
|
-
VERSION_OPTION,
|
|
21
|
-
QUIETLY_OPTION,
|
|
22
|
-
INPUT_FILE_NAME_OPTION
|
|
23
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function validateLinesPerPage(linesPerPage) { return /^\d*$/.test(linesPerPage); }
|
|
4
|
-
|
|
5
|
-
function validateContentsDepth(contentsDepth) { return /^1|2|3|4$/.test(contentsDepth); }
|
|
6
|
-
|
|
7
|
-
function validateCharactersPerLine(charactersPerLine) { return /^\d+$/.test(charactersPerLine); }
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
validateLinesPerPage,
|
|
11
|
-
validateContentsDepth,
|
|
12
|
-
validateCharactersPerLine
|
|
13
|
-
};
|
package/bin/versions.js
DELETED
|
File without changes
|