highmark-cli 0.0.174 → 0.0.176

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.
Files changed (95) hide show
  1. package/README.md +20 -2
  2. package/bin/abbreviations.js +6 -9
  3. package/bin/action/help.js +3 -3
  4. package/bin/action/publish.js +6 -9
  5. package/bin/action/server.js +2 -2
  6. package/bin/constants.js +2 -12
  7. package/bin/defaults.js +4 -6
  8. package/bin/main.js +7 -9
  9. package/bin/operation/copyClientFiles.js +19 -0
  10. package/bin/operation/copyFonts.js +5 -24
  11. package/bin/operation/html.js +5 -71
  12. package/bin/operation/server.js +1 -3
  13. package/bin/operation/watch.js +2 -4
  14. package/bin/options.js +4 -6
  15. package/package.json +2 -26
  16. package/.swcrc +0 -11
  17. package/bin/operation/copyCheckmark.js +0 -32
  18. package/bin/operation/copyClient.js +0 -51
  19. package/bin/utilities/client.js +0 -38
  20. package/checkmark.svg +0 -12
  21. package/client.js +0 -39623
  22. package/css/loading.css +0 -59
  23. package/lib/client.js +0 -74
  24. package/lib/constants.js +0 -70
  25. package/lib/createMethods.js +0 -84
  26. package/lib/customEventTypes.js +0 -74
  27. package/lib/localStorage.js +0 -41
  28. package/lib/migrate.js +0 -34
  29. package/lib/selectors.js +0 -26
  30. package/lib/state/version_1.js +0 -39
  31. package/lib/state.js +0 -153
  32. package/lib/styles.js +0 -82
  33. package/lib/utilities/element.js +0 -62
  34. package/lib/utilities/orientation.js +0 -39
  35. package/lib/versions.js +0 -13
  36. package/lib/view/button/closeMenu.js +0 -121
  37. package/lib/view/button/zoomMenuIn.js +0 -121
  38. package/lib/view/button/zoomMenuOut.js +0 -121
  39. package/lib/view/button.js +0 -160
  40. package/lib/view/checkbox.js +0 -193
  41. package/lib/view/div/buttons.js +0 -213
  42. package/lib/view/div/checkbox/fullScreen.js +0 -155
  43. package/lib/view/div/checkbox/invertColours.js +0 -154
  44. package/lib/view/div/checkbox/nativeGestures.js +0 -154
  45. package/lib/view/div/checkbox.js +0 -220
  46. package/lib/view/div/checkboxes.js +0 -213
  47. package/lib/view/div/menu.js +0 -301
  48. package/lib/view/div/overlay.js +0 -685
  49. package/lib/view/div/preloader.js +0 -204
  50. package/lib/view/div.js +0 -227
  51. package/lib/view/element.js +0 -164
  52. package/lib/view/span.js +0 -182
  53. package/lib/view/svg/closeMenu.js +0 -138
  54. package/lib/view/svg/zoomMenuIn.js +0 -146
  55. package/lib/view/svg/zoomMenuOut.js +0 -141
  56. package/lib/view/svg.js +0 -184
  57. package/lib/view.js +0 -247
  58. package/src/client.js +0 -70
  59. package/src/constants.js +0 -16
  60. package/src/createMethods.js +0 -105
  61. package/src/customEventTypes.js +0 -17
  62. package/src/localStorage.js +0 -40
  63. package/src/migrate.js +0 -19
  64. package/src/selectors.js +0 -5
  65. package/src/state/version_1.js +0 -32
  66. package/src/state.js +0 -152
  67. package/src/styles.js +0 -19
  68. package/src/utilities/element.js +0 -66
  69. package/src/utilities/orientation.js +0 -34
  70. package/src/versions.js +0 -3
  71. package/src/view/button/closeMenu.js +0 -16
  72. package/src/view/button/zoomMenuIn.js +0 -16
  73. package/src/view/button/zoomMenuOut.js +0 -16
  74. package/src/view/button.js +0 -38
  75. package/src/view/checkbox.js +0 -68
  76. package/src/view/div/buttons.js +0 -37
  77. package/src/view/div/checkbox/fullScreen.js +0 -40
  78. package/src/view/div/checkbox/invertColours.js +0 -37
  79. package/src/view/div/checkbox/nativeGestures.js +0 -38
  80. package/src/view/div/checkbox.js +0 -45
  81. package/src/view/div/checkboxes.js +0 -38
  82. package/src/view/div/menu.js +0 -88
  83. package/src/view/div/overlay.js +0 -602
  84. package/src/view/div/preloader.js +0 -25
  85. package/src/view/div.js +0 -47
  86. package/src/view/element.js +0 -16
  87. package/src/view/span.js +0 -20
  88. package/src/view/svg/closeMenu.js +0 -19
  89. package/src/view/svg/zoomMenuIn.js +0 -20
  90. package/src/view/svg/zoomMenuOut.js +0 -19
  91. package/src/view/svg.js +0 -24
  92. package/src/view.js +0 -64
  93. package/template/client.html +0 -4
  94. package/template/default.html +0 -71
  95. package/template/loading.html +0 -17
package/README.md CHANGED
@@ -32,13 +32,31 @@ These are the commands and options:
32
32
 
33
33
  Commands:
34
34
 
35
- [help] Show this help
35
+ help Show this help
36
36
 
37
+ version Show the version
38
+
39
+ [publish] Publish the input Markdown file to the output HTML file
40
+
37
41
  Options:
38
42
 
39
43
  --help|-h Show this help
40
-
44
+
41
45
  --version|-v Show the version
46
+
47
+ --port|-p The server port, the default being 8888
48
+
49
+ --watch|-w Watch for changes to the client file and in the output directory
50
+
51
+ --server|-s Start a server to view the output file
52
+
53
+ --copy-fonts|-f Copy the fonts to a fonts folder next to the output file
54
+
55
+ --input-file-path|-i The input file path, the default being 'default.md'
56
+
57
+ --copy-client-files|-c Copy the bundled client files next to the output file
58
+
59
+ --output-directory-path|-o The output directory path. The default is the current directory.
42
60
  ```
43
61
 
44
62
  ## Contact
@@ -9,10 +9,9 @@ const { HELP_OPTION,
9
9
  VERSION_OPTION,
10
10
  QUIETLY_OPTION,
11
11
  COPY_FONTS_OPTION,
12
- COPY_CLIENT_OPTION,
13
12
  INPUT_FILE_PATH_OPTION,
14
- OUTPUT_FILE_PATH_OPTION,
15
- TEMPLATE_FILE_PATH_OPTION } = options;
13
+ COPY_CLIENT_FILES_OPTION,
14
+ OUTPUT_DIRECTORY_PATH_OPTION } = options;
16
15
 
17
16
  const h = HELP_OPTION,
18
17
  p = PORT_OPTION,
@@ -21,10 +20,9 @@ const h = HELP_OPTION,
21
20
  v = VERSION_OPTION,
22
21
  q = QUIETLY_OPTION,
23
22
  f = COPY_FONTS_OPTION,
24
- c = COPY_CLIENT_OPTION,
25
23
  i = INPUT_FILE_PATH_OPTION,
26
- o = OUTPUT_FILE_PATH_OPTION,
27
- t = TEMPLATE_FILE_PATH_OPTION;
24
+ c = COPY_CLIENT_FILES_OPTION,
25
+ o = OUTPUT_DIRECTORY_PATH_OPTION;
28
26
 
29
27
  module.exports = {
30
28
  h,
@@ -34,8 +32,7 @@ module.exports = {
34
32
  v,
35
33
  q,
36
34
  f,
37
- c,
38
35
  i,
39
- o,
40
- t
36
+ c,
37
+ o
41
38
  };
@@ -27,11 +27,11 @@ Options:
27
27
 
28
28
  --copy-fonts|-f Copy the fonts to a fonts folder next to the output file
29
29
 
30
- --copy-client|-c Copy the bundled client file next to the output file
31
-
32
30
  --input-file-path|-i The input file path, the default being 'default.md'
33
31
 
34
- --output-file-path|-o The output file path, the default being 'index.html'
32
+ --copy-client-files|-c Copy the bundled client files next to the output file
33
+
34
+ --output-directory-path|-o The output directory path. The default is the current directory.
35
35
 
36
36
  Further information:
37
37
 
@@ -4,20 +4,18 @@ const htmlOperation = require("../operation/html"),
4
4
  watchOperation = require("../operation/watch"),
5
5
  serverOperation = require("../operation/server"),
6
6
  copyFontsOperation = require("../operation/copyFonts"),
7
- copyClientOperation = require("../operation/copyClient"),
8
7
  markdownHTMLOperation = require("../operation/markdownHTML"),
9
- copyCheckmarkOperation = require("../operation/copyCheckmark"),
8
+ copyClientFilesOperation = require("../operation/copyClientFiles"),
10
9
  markdownStylesCSSOperation = require("../operation/markdownStylesCSS");
11
10
 
12
11
  const { executeOperations } = require("../utilities/operation"),
13
12
  { SUCCESSFUL_PUBLISH_MESSAGE, FAILED_PUBLISH_MESSAGE } = require("../messages");
14
13
 
15
- function publishAction(port, watch, server, quietly, copyFonts, copyClient, inputFilePath, outputFilePath, templateFilePath) {
14
+ function publishAction(port, watch, server, quietly, copyFonts, inputFilePath, copyClientFiles, outputDirectoryPath) {
16
15
  const operations = [
17
- markdownStylesCSSOperation,
18
16
  markdownHTMLOperation,
19
- copyCheckmarkOperation,
20
- copyClientOperation,
17
+ markdownStylesCSSOperation,
18
+ copyClientFilesOperation,
21
19
  copyFontsOperation,
22
20
  htmlOperation,
23
21
  serverOperation,
@@ -29,10 +27,9 @@ function publishAction(port, watch, server, quietly, copyFonts, copyClient, inpu
29
27
  server,
30
28
  quietly,
31
29
  copyFonts,
32
- copyClient,
33
30
  inputFilePath,
34
- outputFilePath,
35
- templateFilePath
31
+ copyClientFiles,
32
+ outputDirectoryPath
36
33
  };
37
34
 
38
35
  executeOperations(operations, (completed) => {
@@ -6,7 +6,7 @@ const watchOperation = require("../operation/watch"),
6
6
  const { executeOperations } = require("../utilities/operation"),
7
7
  { SUCCESSFUL_SERVER_MESSAGE, FAILED_SERVER_MESSAGE } = require("../messages");
8
8
 
9
- function serverAction(port, watch, server, quietly, outputFilePath) {
9
+ function serverAction(port, watch, server, quietly, outputDirectoryPath) {
10
10
  const operations = [
11
11
  serverOperation,
12
12
  watchOperation
@@ -16,7 +16,7 @@ function serverAction(port, watch, server, quietly, outputFilePath) {
16
16
  watch,
17
17
  server,
18
18
  quietly,
19
- outputFilePath
19
+ outputDirectoryPath
20
20
  };
21
21
 
22
22
  executeOperations(operations, (completed) => {
package/bin/constants.js CHANGED
@@ -3,35 +3,25 @@
3
3
  const FONT = "font",
4
4
  ERROR = "error",
5
5
  PERIOD = ".",
6
- DEFER_DELAY = 100,
7
6
  EMPTY_STRING = "",
8
7
  HIGHMARK_CLI = "Highmark-CLI",
9
- CLIENT_FILE_NAME = "client.js",
10
8
  LIVE_RELOAD_PATH = "/live-reload",
11
- CHECKMARK_FILE_NAME = "checkmark.svg",
12
- LOADING_CSS_FILE_PATH = "css/loading.css",
13
9
  CLIENT_SELECTOR_STRING = "body > div.view > div.overlay > div",
14
10
  RAW_HTML_SELECTOR_STRING = "body > div",
11
+ INDEX_TEMPLATE_FILE_PATH = "template/index.html",
15
12
  CLIENT_TEMPLATE_FILE_PATH = "template/client.html",
16
- DEFAULT_TEMPLATE_FILE_PATH = "template/default.html",
17
- LOADING_TEMPLATE_FILE_PATH = "template/loading.html",
18
13
  DEFAULT_DIVISION_IDENTIFIER = "default";
19
14
 
20
15
  module.exports = {
21
16
  FONT,
22
17
  ERROR,
23
18
  PERIOD,
24
- DEFER_DELAY,
25
19
  EMPTY_STRING,
26
20
  HIGHMARK_CLI,
27
- CLIENT_FILE_NAME,
28
21
  LIVE_RELOAD_PATH,
29
- CHECKMARK_FILE_NAME,
30
- LOADING_CSS_FILE_PATH,
31
22
  CLIENT_SELECTOR_STRING,
32
23
  RAW_HTML_SELECTOR_STRING,
24
+ INDEX_TEMPLATE_FILE_PATH,
33
25
  CLIENT_TEMPLATE_FILE_PATH,
34
- DEFAULT_TEMPLATE_FILE_PATH,
35
- LOADING_TEMPLATE_FILE_PATH,
36
26
  DEFAULT_DIVISION_IDENTIFIER
37
27
  };
package/bin/defaults.js CHANGED
@@ -5,10 +5,9 @@ const DEFAULT_PORT = 8888,
5
5
  DEFAULT_SERVER = false,
6
6
  DEFAULT_QUIETLY = false,
7
7
  DEFAULT_COPY_FONTS = false,
8
- DEFAULT_COPY_CLIENT = false,
9
8
  DEFAULT_INPUT_FILE_PATH = "default.md",
10
- DEFAULT_OUTPUT_FILE_PATH = "index.html",
11
- DEFAULT_TEMPLATE_FILE_PATH = null;
9
+ DEFAULT_COPY_CLIENT_FILES = false,
10
+ DEFAULT_OUTPUT_DIRECTORY_PATH = ".";
12
11
 
13
12
  module.exports = {
14
13
  DEFAULT_PORT,
@@ -16,8 +15,7 @@ module.exports = {
16
15
  DEFAULT_SERVER,
17
16
  DEFAULT_QUIETLY,
18
17
  DEFAULT_COPY_FONTS,
19
- DEFAULT_COPY_CLIENT,
20
18
  DEFAULT_INPUT_FILE_PATH,
21
- DEFAULT_OUTPUT_FILE_PATH,
22
- DEFAULT_TEMPLATE_FILE_PATH
19
+ DEFAULT_COPY_CLIENT_FILES,
20
+ DEFAULT_OUTPUT_DIRECTORY_PATH
23
21
  };
package/bin/main.js CHANGED
@@ -6,16 +6,15 @@ const helpAction = require("./action/help"),
6
6
  publishAction = require("./action/publish");
7
7
 
8
8
  const { HELP_OPTION, SERVER_OPTION, VERSION_OPTION } = require("./options"),
9
- { HELP_COMMAND, SERVER_COMMAND, VERSION_COMMAND, PUBLISH_COMMAND } = require("./commands"),
9
+ { HELP_COMMAND, SERVER_COMMAND, VERSION_COMMAND } = require("./commands"),
10
10
  { DEFAULT_PORT,
11
11
  DEFAULT_WATCH,
12
12
  DEFAULT_SERVER,
13
13
  DEFAULT_QUIETLY,
14
14
  DEFAULT_COPY_FONTS,
15
- DEFAULT_COPY_CLIENT,
16
15
  DEFAULT_INPUT_FILE_PATH,
17
- DEFAULT_OUTPUT_FILE_PATH,
18
- DEFAULT_TEMPLATE_FILE_PATH } = require("./defaults");
16
+ DEFAULT_COPY_CLIENT_FILES,
17
+ DEFAULT_OUTPUT_DIRECTORY_PATH } = require("./defaults");
19
18
 
20
19
  function main(command, argument, options) {
21
20
  const commandMissing = (command === null),
@@ -27,10 +26,9 @@ function main(command, argument, options) {
27
26
  server = DEFAULT_SERVER,
28
27
  quietly = DEFAULT_QUIETLY,
29
28
  copyFonts = DEFAULT_COPY_FONTS,
30
- copyClient = DEFAULT_COPY_CLIENT,
31
29
  inputFilePath = DEFAULT_INPUT_FILE_PATH,
32
- outputFilePath = DEFAULT_OUTPUT_FILE_PATH,
33
- templateFilePath = DEFAULT_TEMPLATE_FILE_PATH } = options;
30
+ copyClientFiles = DEFAULT_COPY_CLIENT_FILES,
31
+ outputDirectoryPath = DEFAULT_OUTPUT_DIRECTORY_PATH } = options;
34
32
 
35
33
  if (false) {
36
34
  ///
@@ -56,7 +54,7 @@ function main(command, argument, options) {
56
54
  case SERVER_COMMAND: {
57
55
  const server = true;
58
56
 
59
- serverAction(port, watch, server, quietly, outputFilePath);
57
+ serverAction(port, watch, server, quietly, outputDirectoryPath);
60
58
 
61
59
  break;
62
60
  }
@@ -68,7 +66,7 @@ function main(command, argument, options) {
68
66
  }
69
67
 
70
68
  default: {
71
- publishAction(port, watch, server, quietly, copyFonts, copyClient, inputFilePath, outputFilePath, templateFilePath);
69
+ publishAction(port, watch, server, quietly, copyFonts, inputFilePath, copyClientFiles, outputDirectoryPath);
72
70
 
73
71
  break;
74
72
  }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ const { copyClientFiles: copyClientFilesAsync } = require("highmark-client");
4
+
5
+ function copyClientFilesOperation(proceed, abort, context) {
6
+ const { copyClientFiles } = context;
7
+
8
+ if (copyClientFiles) {
9
+ const { markdownHTML, markdownStylesCSS, outputDirectoryPath } = context,
10
+ targetDirectoryPath = outputDirectoryPath, ///
11
+ includeFonts = false;
12
+
13
+ copyClientFilesAsync(markdownHTML, markdownStylesCSS, targetDirectoryPath, includeFonts);
14
+ }
15
+
16
+ proceed();
17
+ }
18
+
19
+ module.exports = copyClientFilesOperation;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  const { pathUtilities } = require("necessary"),
4
- { getFontDirectoryPath } = require("highmark-fonts");
4
+ { copyFonts: copyFontsAsync } = require("highmark-client");
5
5
 
6
- const { FONT } = require("../constants"),
7
- { copyFile, readDirectory, createDirectory } = require("../utilities/fileSystem"),
8
- { fileNameFromFilePath, directoryPathFromFilePath } = require("../utilities/path");
6
+ const { FONT } = require("../constants");
9
7
 
10
8
  const { concatenatePaths } = pathUtilities;
11
9
 
@@ -18,27 +16,10 @@ function copyFontsOperation(proceed, abort, context) {
18
16
  return;
19
17
  }
20
18
 
21
- let fontDirectoryPath;
19
+ const { outputDirectoryPath } = context,
20
+ fontDirectoryPath = concatenatePaths(outputDirectoryPath, FONT);
22
21
 
23
- const { outputFilePath } = context,
24
- outputDirectoryPath = directoryPathFromFilePath(outputFilePath);
25
-
26
- fontDirectoryPath = concatenatePaths(outputDirectoryPath, FONT);
27
-
28
- createDirectory(fontDirectoryPath);
29
-
30
- fontDirectoryPath = getFontDirectoryPath();
31
-
32
- const recursive = false,
33
- targetDirectoryPath = concatenatePaths(outputDirectoryPath, FONT);
34
-
35
- readDirectory(fontDirectoryPath, (filePath) => {
36
- const fileName = fileNameFromFilePath(filePath),
37
- sourceFilePath = filePath, ///
38
- targetFilePath = concatenatePaths(targetDirectoryPath, fileName); ///
39
-
40
- copyFile(sourceFilePath, targetFilePath);
41
- }, recursive);
22
+ copyFontsAsync(fontDirectoryPath);
42
23
 
43
24
  proceed();
44
25
  }
@@ -1,27 +1,19 @@
1
1
  "use strict";
2
2
 
3
- const { liveReloadSnippet } = require("lively-cli"),
4
- { pathUtilities, packageUtilities } = require("necessary"),
3
+ const { pathUtilities, packageUtilities } = require("necessary"),
5
4
  { computerModernStyle: computerModernStyleCSS } = require("highmark-fonts");
6
5
 
7
- const { readFile } = require("../utilities/fileSystem"),
8
- { directoryPathFromFilePath } = require("../utilities/path"),
6
+ const { directoryPathFromFilePath } = require("../utilities/path"),
9
7
  { writeFile, parseTemplateFile } = require("../utilities/fileSystem"),
10
- { EMPTY_STRING, LOADING_CSS_FILE_PATH, CLIENT_TEMPLATE_FILE_PATH, DEFAULT_TEMPLATE_FILE_PATH, LOADING_TEMPLATE_FILE_PATH } = require("../constants");
8
+ { INDEX_TEMPLATE_FILE_PATH } = require("../constants");
11
9
 
12
10
  const { getPackagePath } = packageUtilities,
13
11
  { concatenatePaths } = pathUtilities;
14
12
 
15
13
  function htmlOperation(proceed, abort, context) {
16
14
  const { markdownHTML, outputFilePath, markdownStylesCSS } = context,
17
- clientHTML = getClientHTML(context),
18
- loadingCSS = getLoadingCSS(context),
19
- loadingHTML = getLoadingHTML(context),
20
15
  templateFilePath = getTemplateFilePath(context),
21
16
  args = {
22
- clientHTML,
23
- loadingCSS,
24
- loadingHTML,
25
17
  markdownHTML,
26
18
  markdownStylesCSS,
27
19
  computerModernStyleCSS
@@ -35,64 +27,6 @@ function htmlOperation(proceed, abort, context) {
35
27
 
36
28
  module.exports = htmlOperation;
37
29
 
38
- function getClientHTML(context) {
39
- let clientHTML;
40
-
41
- const { copyClient } = context;
42
-
43
- if (copyClient) {
44
- const packagePath = getPackagePath(),
45
- templateFilePath = concatenatePaths(packagePath, CLIENT_TEMPLATE_FILE_PATH),
46
- args = {
47
- liveReloadSnippet
48
- },
49
- content = parseTemplateFile(templateFilePath, args);
50
-
51
- clientHTML = content; ///
52
- } else {
53
- clientHTML = EMPTY_STRING;
54
- }
55
-
56
- return clientHTML;
57
- }
58
-
59
- function getLoadingCSS(context) {
60
- let loadingCSS;
61
-
62
- const { copyClient } = context;
63
-
64
- if (copyClient) {
65
- const packagePath = getPackagePath(),
66
- filePath = concatenatePaths(packagePath, LOADING_CSS_FILE_PATH),
67
- content = readFile(filePath);
68
-
69
- loadingCSS = content; ///
70
- } else {
71
- loadingCSS = EMPTY_STRING;
72
- }
73
-
74
- return loadingCSS;
75
- }
76
-
77
- function getLoadingHTML(context) {
78
- let loadingHTML;
79
-
80
- const { copyClient } = context;
81
-
82
- if (copyClient) {
83
- const packagePath = getPackagePath(),
84
- templateFilePath = concatenatePaths(packagePath, LOADING_TEMPLATE_FILE_PATH),
85
- args = {},
86
- content = parseTemplateFile(templateFilePath, args);
87
-
88
- loadingHTML = content; ///
89
- } else {
90
- loadingHTML = EMPTY_STRING;
91
- }
92
-
93
- return loadingHTML;
94
- }
95
-
96
30
  function getTemplateFilePath(context) {
97
31
  let templateFilePath;
98
32
 
@@ -100,9 +34,9 @@ function getTemplateFilePath(context) {
100
34
 
101
35
  if (templateFilePath === null) {
102
36
  const packagePath = getPackagePath(),
103
- defaultTemplateFilePath = templateFilePath = concatenatePaths(packagePath, DEFAULT_TEMPLATE_FILE_PATH);
37
+ indexTemplateFilePath = concatenatePaths(packagePath, INDEX_TEMPLATE_FILE_PATH);
104
38
 
105
- templateFilePath = defaultTemplateFilePath; ///
39
+ templateFilePath = indexTemplateFilePath; ///
106
40
  } else {
107
41
  const { inputFilePath } = context,
108
42
  inputDirectoryPath = directoryPathFromFilePath(inputFilePath);
@@ -3,7 +3,6 @@
3
3
  const express = require("express");
4
4
 
5
5
  const { ERROR } = require("../constants"),
6
- { directoryPathFromFilePath } = require("../utilities/path"),
7
6
  { UNABLE_TO_START_SERVER_MESSAGE } = require("../messages");
8
7
 
9
8
  function serverOperation(proceed, abort, context) {
@@ -21,8 +20,7 @@ function serverOperation(proceed, abort, context) {
21
20
  server
22
21
  });
23
22
 
24
- const { port, outputFilePath } = context,
25
- outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
23
+ const { port, outputDirectoryPath } = context,
26
24
  staticRouter = express.static(outputDirectoryPath);
27
25
 
28
26
  server.use(staticRouter);
@@ -2,8 +2,7 @@
2
2
 
3
3
  const { createLiveReloadHandler } = require("lively-cli");
4
4
 
5
- const { LIVE_RELOAD_PATH } = require("../constants"),
6
- { directoryPathFromFilePath } = require("../utilities/path");
5
+ const { LIVE_RELOAD_PATH } = require("../constants");
7
6
 
8
7
  function watchOperation(proceed, abort, context) {
9
8
  const { watch } = context;
@@ -22,8 +21,7 @@ function watchOperation(proceed, abort, context) {
22
21
  return;
23
22
  }
24
23
 
25
- const { quietly, outputFilePath } = context,
26
- outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
24
+ const { quietly, outputDirectoryPath } = context,
27
25
  watchPattern = outputDirectoryPath, ///
28
26
  liveReloadHandler = createLiveReloadHandler(watchPattern, quietly);
29
27
 
package/bin/options.js CHANGED
@@ -7,10 +7,9 @@ const HELP_OPTION = "help",
7
7
  VERSION_OPTION = "version",
8
8
  QUIETLY_OPTION = "quietly",
9
9
  COPY_FONTS_OPTION = "copy-fonts",
10
- COPY_CLIENT_OPTION = "copy-client",
11
10
  INPUT_FILE_PATH_OPTION = "input-file-path",
12
- OUTPUT_FILE_PATH_OPTION = "output-file-path",
13
- TEMPLATE_FILE_PATH_OPTION = "output-file-path";
11
+ COPY_CLIENT_FILES_OPTION = "copy-client-files",
12
+ OUTPUT_DIRECTORY_PATH_OPTION = "output-directory-path";
14
13
 
15
14
  module.exports = {
16
15
  HELP_OPTION,
@@ -20,8 +19,7 @@ module.exports = {
20
19
  VERSION_OPTION,
21
20
  QUIETLY_OPTION,
22
21
  COPY_FONTS_OPTION,
23
- COPY_CLIENT_OPTION,
24
22
  INPUT_FILE_PATH_OPTION,
25
- OUTPUT_FILE_PATH_OPTION,
26
- TEMPLATE_FILE_PATH_OPTION
23
+ COPY_CLIENT_FILES_OPTION,
24
+ OUTPUT_DIRECTORY_PATH_OPTION
27
25
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "highmark-cli",
3
3
  "author": "James Smith",
4
- "version": "0.0.174",
4
+ "version": "0.0.176",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/highmark-cli",
7
7
  "description": "Extensible, styleable Markdown.",
@@ -12,37 +12,13 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.28",
14
14
  "express": "^4.19.2",
15
+ "highmark-client": "^0.0.10",
15
16
  "highmark-fonts": "^1.0.43",
16
17
  "highmark-markdown": "^0.0.245",
17
18
  "lively-cli": "^2.0.59",
18
19
  "necessary": "^13.6.6",
19
20
  "occam-entities": "^1.0.95"
20
21
  },
21
- "devDependencies": {
22
- "@swc/core": "^1.5.6",
23
- "easy": "^17.1.3",
24
- "easy-layout": "^6.0.153",
25
- "easy-mobile": "^1.0.20",
26
- "easy-with-style": "^3.0.356",
27
- "esbuild": "^0.9.2",
28
- "fragmented": "^3.1.7",
29
- "juxtapose": "^4.0.85",
30
- "sufficient": "^2.0.56",
31
- "watchful-cli": "^1.7.44"
32
- },
33
- "scripts": {
34
- "start": "node ./bin/main.js",
35
- "clean": "rm -rf ./lib",
36
- "watchful": "watchful -m --transpiler=swc --bundler=esbuild --source-directory=./src --lib-directory=./lib --entry-file=client.js --bundle-file=./client.js --wait=100",
37
- "batch": "npm run watchful batch --",
38
- "batch-debug": "npm run watchful batch -- --debug",
39
- "incremental": "npm run watchful incremental --",
40
- "incremental-debug": "npm run watchful incremental -- --debug",
41
- "build": "npm run clean && npm run batch",
42
- "build-debug": "npm run clean && npm run batch-debug",
43
- "watch": "npm run clean && npm run batch && npm run incremental",
44
- "watch-debug": "npm run clean && npm run batch-debug && npm run incremental-debug"
45
- },
46
22
  "bin": {
47
23
  "highmark": "./highmark.js"
48
24
  }
package/.swcrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "jsc": {
3
- "parser": {
4
- "syntax": "ecmascript",
5
- "jsx": true
6
- }
7
- },
8
- "module": {
9
- "type": "commonjs"
10
- }
11
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- const { pathUtilities, packageUtilities } = require("necessary");
4
-
5
- const { copyFile } = require("../utilities/fileSystem"),
6
- { CHECKMARK_FILE_NAME } = require("../constants"),
7
- { directoryPathFromFilePath } = require("../utilities/path");
8
-
9
- const { getPackagePath } = packageUtilities,
10
- { concatenatePaths } = pathUtilities;
11
-
12
- function copyCheckmarkOperation(proceed, abort, context) {
13
- const { copyClient } = context;
14
-
15
- if (!copyClient) {
16
- proceed();
17
-
18
- return;
19
- }
20
-
21
- const { outputFilePath } = context,
22
- packagePath = getPackagePath(),
23
- outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
24
- sourceFilePath = concatenatePaths(packagePath, CHECKMARK_FILE_NAME), ///
25
- targetFilePath = concatenatePaths(outputDirectoryPath, CHECKMARK_FILE_NAME); ///
26
-
27
- copyFile(sourceFilePath, targetFilePath);
28
-
29
- proceed();
30
- }
31
-
32
- module.exports = copyCheckmarkOperation;
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- const { watch: watchFile } = require("lively-cli");
4
-
5
- const { DEFER_DELAY } = require("../constants"),
6
- { copyClientFile: copyClientFileEx, getClientSourceFilePath } = require("../utilities/client");
7
-
8
- function copyClientOperation(proceed, abort, context) {
9
- const { copyClient } = context;
10
-
11
- if (!copyClient) {
12
- proceed();
13
-
14
- return;
15
- }
16
-
17
- copyClientFile();
18
-
19
- let { server } = context;
20
-
21
- if (!server) {
22
- proceed();
23
-
24
- return;
25
- }
26
-
27
- const { quietly } = context,
28
- clientSSourceFilePath = getClientSourceFilePath(context),
29
- watchPattern = clientSSourceFilePath, ///
30
- registerHandler = watchFile(watchPattern, quietly);
31
-
32
- registerHandler(copyClientFile);
33
-
34
- proceed();
35
-
36
- function copyClientFile() {
37
- copyClientFileEx(context);
38
-
39
- defer(() => {
40
- registerHandler(copyClientFile);
41
- });
42
- }
43
- }
44
-
45
- module.exports = copyClientOperation;
46
-
47
- function defer(func) {
48
- const delay = DEFER_DELAY;
49
-
50
- setTimeout(func, delay);
51
- }