highmark-cli 1.0.6 → 1.0.8

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,16 +1 @@
1
1
  "use strict";
2
-
3
- const { VERSION_1_0 } = require("../versions");
4
-
5
- function createConfiguration() {
6
- const version = VERSION_1_0,
7
- configuration = {
8
- version
9
- };
10
-
11
- return configuration;
12
- }
13
-
14
- module.exports = {
15
- createConfiguration
16
- };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ const { VERSION_1_1 } = require("../versions");
4
+
5
+ const { DEFAULT_CONTENTS_DEPTH } = require("../defaults");
6
+
7
+ function createConfiguration() {
8
+ const version = VERSION_1_1,
9
+ contentsDepth = DEFAULT_CONTENTS_DEPTH,
10
+ configuration = {
11
+ version,
12
+ contentsDepth
13
+ };
14
+
15
+ return configuration;
16
+ }
17
+
18
+ function migrateToVersion1_1(json) {
19
+ const version = VERSION_1_1,
20
+ contentsDepth = DEFAULT_CONTENTS_DEPTH;
21
+
22
+ json = Object.assign({}, json, {
23
+ version,
24
+ contentsDepth
25
+ });
26
+
27
+ return json;
28
+ }
29
+ module.exports = {
30
+ createConfiguration,
31
+ migrateToVersion1_1
32
+ };
@@ -3,8 +3,8 @@
3
3
  const { versionUtilities, configurationUtilities } = require("necessary");
4
4
 
5
5
  const { HIGHMARK } = require("./constants"),
6
- { VERSION_1_0 } = require("./versions"),
7
- { createConfiguration } = require("./configuration/version_1_0"),
6
+ { VERSION_1_0, VERSION_1_1 } = require("./versions"),
7
+ { createConfiguration, migrateToVersion1_1 } = require("./configuration/version_1_1"),
8
8
  { CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } = require("./messages");
9
9
 
10
10
  const { rc } = configurationUtilities,
@@ -15,6 +15,13 @@ const rcBaseExtension = HIGHMARK; ///
15
15
 
16
16
  setRCBaseExtension(rcBaseExtension);
17
17
 
18
+ function getContentsDepth() {
19
+ const configuration = readConfigurationFile(),
20
+ { contentsDepth } = configuration;
21
+
22
+ return contentsDepth;
23
+ }
24
+
18
25
  function createConfigurationFile() {
19
26
  const configuration = createConfiguration(),
20
27
  json = configuration; ///
@@ -27,8 +34,10 @@ function migrateConfigurationFile() {
27
34
 
28
35
  let json = readRCFile();
29
36
 
30
- const migrationMap = {},
31
- latestVersion = VERSION_1_0;
37
+ const migrationMap = {
38
+ [VERSION_1_0]: migrateToVersion1_1
39
+ },
40
+ latestVersion = VERSION_1_1;
32
41
 
33
42
  json = migrate(json, migrationMap, latestVersion);
34
43
 
@@ -53,6 +62,7 @@ function assertConfigurationFileExists() {
53
62
  }
54
63
 
55
64
  module.exports = {
65
+ getContentsDepth,
56
66
  createConfigurationFile,
57
67
  migrateConfigurationFile,
58
68
  checkConfigurationFileExists,
package/bin/defaults.js CHANGED
@@ -7,6 +7,7 @@ const DEFAULT_HELP = false,
7
7
  DEFAULT_QUIETLY = false,
8
8
  DEFAULT_VERSION = false,
9
9
  DEFAULT_COPY_FONTS = false,
10
+ DEFAULT_CONTENTS_DEPTH = 2,
10
11
  DEFAULT_INPUT_FILE_NAME = "default.md",
11
12
  DEFAULT_COPY_CLIENT_FILES = false;
12
13
 
@@ -18,6 +19,7 @@ module.exports = {
18
19
  DEFAULT_QUIETLY,
19
20
  DEFAULT_VERSION,
20
21
  DEFAULT_COPY_FONTS,
22
+ DEFAULT_CONTENTS_DEPTH,
21
23
  DEFAULT_INPUT_FILE_NAME,
22
24
  DEFAULT_COPY_CLIENT_FILES
23
25
  };
@@ -5,6 +5,7 @@ const { pathUtilities } = require("necessary");
5
5
  const importer = require("../importer");
6
6
 
7
7
  const { readFile } = require("../utilities/fileSystem"),
8
+ { getContentsDepth } = require("../configuration"),
8
9
  { classNameFromFilePath } = require("../utilities/division"),
9
10
  { nodeFromTokens, tokensFromContent } = require("../utilities/markdown"),
10
11
  { UNABLE_TO_CONVERT_MARKDOWN_TO_HTML_MESSAGE } = require("../messages");
@@ -41,13 +42,15 @@ function markdownHTMLOperation(proceed, abort, context) {
41
42
  return;
42
43
  }
43
44
 
44
- const divisionClassName = className, ///
45
+ const contentsDepth = getContentsDepth(),
46
+ divisionClassName = className, ///
45
47
  divisionMarkdownNode = node, ///
46
48
  divisionMarkdownNodes = [];
47
49
 
48
50
  Object.assign(context, {
49
51
  tokens,
50
52
  importer,
53
+ contentsDepth,
51
54
  divisionMarkdownNodes
52
55
  });
53
56
 
package/bin/versions.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
 
3
- const VERSION_1_0 = "1.0";
3
+ const VERSION_1_0 = "1.0",
4
+ VERSION_1_1 =- "1.1";
4
5
 
5
6
  module.exports = {
6
- VERSION_1_0
7
+ VERSION_1_0,
8
+ VERSION_1_1
7
9
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "highmark-cli",
3
3
  "author": "James Smith",
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/highmark-cli",
7
7
  "description": "Highmark's LIC tool.",
@@ -12,8 +12,8 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.28",
14
14
  "express": "^4.19.2",
15
- "highmark-client": "^0.0.88",
16
- "highmark-markdown": "^0.0.361",
15
+ "highmark-client": "^0.0.91",
16
+ "highmark-markdown": "^0.0.364",
17
17
  "lively-cli": "^2.0.65",
18
18
  "necessary": "^14.0.1",
19
19
  "occam-entities": "^1.0.106"