highmark-cli 1.3.21 → 1.3.23

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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const indexOptions = require("../indexOptions"),
4
- watchOperation = require("../operation/watch"),
3
+ const watchOperation = require("../operation/watch"),
5
4
  copyFontsOperation = require("../operation/copyFonts"),
5
+ indexOptionsOperation = require("../operation/indexOptions"),
6
6
  markdownHTMLOperation = require("../operation/markdownHTML"),
7
7
  copyClientFilesOperation = require("../operation/copyClientFiles"),
8
8
  createClientHTMLOperation = require("../operation/createClientHTML"),
@@ -13,6 +13,7 @@ const { executeOperations } = require("../utilities/operation"),
13
13
 
14
14
  function publishAction(port, fonts, watch, client, quietly, inputFileName, projectDirectoryName) {
15
15
  const operations = [
16
+ indexOptionsOperation,
16
17
  markdownHTMLOperation,
17
18
  markdownStylesCSSOperation,
18
19
  createClientHTMLOperation,
@@ -26,7 +27,6 @@ function publishAction(port, fonts, watch, client, quietly, inputFileName, proje
26
27
  watch,
27
28
  client,
28
29
  quietly,
29
- indexOptions,
30
30
  inputFileName,
31
31
  projectDirectoryName
32
32
  };
package/bin/constants.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const FONT = "font",
4
- ERROR = "error",
3
+ const ERROR = "error",
5
4
  STRING = "string",
6
5
  NUMBER = "number",
7
6
  BOOLEAN = "boolean",
@@ -9,13 +8,15 @@ const FONT = "font",
9
8
  INFINITY = "Infinity",
10
9
  DOUBLE_DOTS = "..",
11
10
  EMPTY_STRING = "",
11
+ DOUBLE_SPACE = " ",
12
12
  HIGHMARK_CLI = "Highmark-CLI",
13
13
  LIVE_RELOAD_PATH = "/live-reload",
14
+ FONT_DIRECTORY_NAME = "font",
14
15
  DIVS_SELECTOR_STRING = "body > div",
16
+ INDEX_JSON_FILE_NAME = "index.json",
15
17
  DEFAULT_DIVISION_IDENTIFIER = "default";
16
18
 
17
19
  module.exports = {
18
- FONT,
19
20
  ERROR,
20
21
  STRING,
21
22
  NUMBER,
@@ -24,8 +25,11 @@ module.exports = {
24
25
  INFINITY,
25
26
  DOUBLE_DOTS,
26
27
  EMPTY_STRING,
28
+ DOUBLE_SPACE,
27
29
  HIGHMARK_CLI,
28
30
  LIVE_RELOAD_PATH,
31
+ FONT_DIRECTORY_NAME,
29
32
  DIVS_SELECTOR_STRING,
33
+ INDEX_JSON_FILE_NAME,
30
34
  DEFAULT_DIVISION_IDENTIFIER
31
35
  };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ const defaultIndexOptions = {
4
+ "phrases": [],
5
+ "plurals": [],
6
+ "acronyms": [],
7
+ "properNouns": [],
8
+ "ignoredWords": []
9
+ };
10
+
11
+ module.exports = defaultIndexOptions;
@@ -3,7 +3,7 @@
3
3
  const { copyFonts } = require("highmark-client"),
4
4
  { pathUtilities } = require("necessary");
5
5
 
6
- const { FONT } = require("../constants");
6
+ const { FONT_DIRECTORY_NAME } = require("../constants");
7
7
 
8
8
  const { concatenatePaths } = pathUtilities;
9
9
 
@@ -17,7 +17,7 @@ function copyFontsOperation(proceed, abort, context) {
17
17
  }
18
18
 
19
19
  const { projectDirectoryPath } = context,
20
- fontDirectoryPath = concatenatePaths(projectDirectoryPath, FONT);
20
+ fontDirectoryPath = concatenatePaths(projectDirectoryPath, FONT_DIRECTORY_NAME);
21
21
 
22
22
  copyFonts(fontDirectoryPath);
23
23
 
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ const { pathUtilities } = require("necessary");
4
+
5
+ const defaultIndexOptions = require("../defaultIndexOptions");
6
+
7
+ const { readFile, writeFile } = require("../utilities/fileSystem"),
8
+ { DOUBLE_SPACE, INDEX_JSON_FILE_NAME } = require("../constants");
9
+
10
+ const { concatenatePaths } = pathUtilities;
11
+
12
+ function indexOptionsOperation(proceed, abort, context) {
13
+ const { projectDirectoryName } = context;
14
+
15
+ let content,
16
+ indexOptions;
17
+
18
+ const indexJSONFilePath = concatenatePaths(projectDirectoryName, INDEX_JSON_FILE_NAME),
19
+ filePath = indexJSONFilePath;
20
+
21
+ content = readFile(filePath);
22
+
23
+ if (content === null) {
24
+ indexOptions = defaultIndexOptions; ///
25
+ } else {
26
+ let json,
27
+ jsonString;
28
+
29
+ jsonString = content; ///
30
+
31
+ json = JSON.parse(jsonString);
32
+
33
+ const { phrases = [],
34
+ plurals = [],
35
+ acronyms = [],
36
+ properNouns = [],
37
+ ignoredWords = [] } = json;
38
+
39
+ phrases.sort();
40
+ plurals.sort();
41
+ acronyms.sort();
42
+ properNouns.sort();
43
+ ignoredWords.sort();
44
+
45
+ json = {
46
+ phrases,
47
+ plurals,
48
+ acronyms,
49
+ properNouns,
50
+ ignoredWords
51
+ };
52
+
53
+ jsonString = JSON.stringify(json, null, DOUBLE_SPACE);
54
+
55
+ content = jsonString; ///
56
+
57
+ writeFile(indexJSONFilePath, content);
58
+
59
+ indexOptions = json; ///
60
+ }
61
+
62
+ Object.assign(context, {
63
+ indexOptions
64
+ });
65
+
66
+ proceed();
67
+ }
68
+
69
+ module.exports = indexOptionsOperation;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "highmark-cli",
3
3
  "author": "James Smith",
4
- "version": "1.3.21",
4
+ "version": "1.3.23",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/highmark-cli",
7
7
  "description": "Highmark's LIC tool.",
@@ -12,11 +12,11 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.28",
14
14
  "express": "^4.19.2",
15
- "highmark-client": "^0.0.104",
16
- "highmark-markdown": "^0.0.451",
15
+ "highmark-client": "^0.0.105",
16
+ "highmark-markdown": "^0.0.452",
17
17
  "lively-cli": "^2.0.65",
18
18
  "necessary": "^14.0.1",
19
- "occam-entities": "^1.0.123"
19
+ "occam-entities": "^1.0.124"
20
20
  },
21
21
  "bin": {
22
22
  "highmark": "./highmark.js"
@@ -1,134 +0,0 @@
1
- "use strict";
2
-
3
- const indexOptions = {
4
- "phrases": [
5
- "symbolic reasoning"
6
- ],
7
- "plurals": [
8
- "grammar",
9
- "language(s)"
10
- ],
11
- "acronyms": [
12
- "CLI",
13
- ],
14
- "properNouns": [
15
- "Occam"
16
- ],
17
- "ignoredWords": [
18
- "a",
19
- "all",
20
- "also",
21
- "an",
22
- "and",
23
- "another",
24
- "approach",
25
- "apt",
26
- "are",
27
- "as",
28
- "associated",
29
- "at",
30
- "between",
31
- "boils",
32
- "book",
33
- "but",
34
- "called",
35
- "cannot",
36
- "companion",
37
- "considerable",
38
- "contents",
39
- "controlled",
40
- "covers",
41
- "day",
42
- "detail",
43
- "detailed",
44
- "distinguish",
45
- "divers",
46
- "down",
47
- "encompasses",
48
- "end",
49
- "expert",
50
- "explains",
51
- "explanation",
52
- "explanations",
53
- "fact",
54
- "florence",
55
- "footnote",
56
- "former",
57
- "foundations",
58
- "future",
59
- "getting",
60
- "goes",
61
- "grips",
62
- "has",
63
- "have",
64
- "here",
65
- "how",
66
- "i",
67
- "ide",
68
- "in",
69
- "indeed",
70
- "index",
71
- "indexing",
72
- "into",
73
- "introduction",
74
- "is",
75
- "it",
76
- "its",
77
- "largely",
78
- "least",
79
- "limits",
80
- "list",
81
- "make",
82
- "more",
83
- "most",
84
- "natural",
85
- "near",
86
- "nebulously",
87
- "need",
88
- "not",
89
- "of",
90
- "often",
91
- "on",
92
- "ordered",
93
- "originally",
94
- "own",
95
- "paragraph",
96
- "parts",
97
- "possible",
98
- "provide",
99
- "purpose",
100
- "range",
101
- "reference",
102
- "s",
103
- "seemed",
104
- "services",
105
- "short",
106
- "some",
107
- "somewhat",
108
- "started",
109
- "subject",
110
- "support",
111
- "system",
112
- "test",
113
- "that",
114
- "the",
115
- "there",
116
- "these",
117
- "this",
118
- "to",
119
- "tried",
120
- "underlying",
121
- "unordered",
122
- "use",
123
- "useable",
124
- "used",
125
- "was",
126
- "well",
127
- "which",
128
- "will",
129
- "with",
130
- "word"
131
- ]
132
- };
133
-
134
- module.exports = indexOptions;