highmark-cli 0.0.175 → 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.
@@ -4,9 +4,8 @@ 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"),
@@ -14,10 +13,9 @@ const { executeOperations } = require("../utilities/operation"),
14
13
 
15
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,
package/bin/constants.js CHANGED
@@ -3,12 +3,9 @@
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
9
  CLIENT_SELECTOR_STRING = "body > div.view > div.overlay > div",
13
10
  RAW_HTML_SELECTOR_STRING = "body > div",
14
11
  INDEX_TEMPLATE_FILE_PATH = "template/index.html",
@@ -19,12 +16,9 @@ module.exports = {
19
16
  FONT,
20
17
  ERROR,
21
18
  PERIOD,
22
- DEFER_DELAY,
23
19
  EMPTY_STRING,
24
20
  HIGHMARK_CLI,
25
- CLIENT_FILE_NAME,
26
21
  LIVE_RELOAD_PATH,
27
- CHECKMARK_FILE_NAME,
28
22
  CLIENT_SELECTOR_STRING,
29
23
  RAW_HTML_SELECTOR_STRING,
30
24
  INDEX_TEMPLATE_FILE_PATH,
@@ -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,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- const { copyFonts: copyFontsAsync } = require("highmark-client");
3
+ const { pathUtilities } = require("necessary"),
4
+ { copyFonts: copyFontsAsync } = require("highmark-client");
4
5
 
5
- const { FONT } = require("../constants"),
6
- { directoryPathFromFilePath } = require("../utilities/path");
6
+ const { FONT } = require("../constants");
7
7
 
8
8
  const { concatenatePaths } = pathUtilities;
9
9
 
@@ -16,8 +16,7 @@ function copyFontsOperation(proceed, abort, context) {
16
16
  return;
17
17
  }
18
18
 
19
- const { outputFilePath } = context,
20
- outputDirectoryPath = directoryPathFromFilePath(outputFilePath),
19
+ const { outputDirectoryPath } = context,
21
20
  fontDirectoryPath = concatenatePaths(outputDirectoryPath, FONT);
22
21
 
23
22
  copyFontsAsync(fontDirectoryPath);
@@ -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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "highmark-cli",
3
3
  "author": "James Smith",
4
- "version": "0.0.175",
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,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.28",
14
14
  "express": "^4.19.2",
15
- "highmark-client": "^0.0.8",
15
+ "highmark-client": "^0.0.10",
16
16
  "highmark-fonts": "^1.0.43",
17
17
  "highmark-markdown": "^0.0.245",
18
18
  "lively-cli": "^2.0.59",
@@ -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
- }