host-mdx 2.4.1 → 2.4.3

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 (2) hide show
  1. package/index.js +10 -5
  2. package/package.json +1 -2
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import fs from "fs";
2
2
  import os from "os";
3
3
  import net from "net";
4
- import _ from 'lodash';
5
4
  import path from "path";
6
5
  import sirv from "sirv";
7
6
  import polka from "polka";
@@ -248,14 +247,14 @@ export function isPathInside(parentPath, childPath) {
248
247
  );
249
248
  }
250
249
  export async function setupConfigs(inputPath) {
251
-
252
250
  let configFilePath = path.join(inputPath, CONFIG_FILE_NAME);
251
+ let configs = { ...DEFAULT_CONFIGS };
253
252
  if (fs.existsSync(configFilePath)) {
254
- let cleanConfigFilePath = pathToFileURL(configFilePath).href
255
- return { ...DEFAULT_CONFIGS, ...(await import(cleanConfigFilePath)) };
253
+ let cleanConfigFilePath = pathToFileURL(configFilePath).href;
254
+ configs = { ...configs, ...(await import(cleanConfigFilePath)) };
256
255
  }
257
256
 
258
- return _.cloneDeep(DEFAULT_CONFIGS);
257
+ return configs;
259
258
  }
260
259
  export function createTempDir() {
261
260
  // Create default temp html dir
@@ -467,6 +466,12 @@ export async function createSite(inputPath = "", outputPath = "", pathsToCreate
467
466
  // Broadcast site creation ended
468
467
  log(wasInterrupted ? `Site creation was interrupted!` : `Completed site creation at ${outputPath}`);
469
468
  await configs?.onSiteCreateEnd?.(inputPath, outputPath, !isHardReloading, wasInterrupted);
469
+
470
+
471
+ // Throw error on interruption, This was done to make sure `alteredPaths` retains old values
472
+ if (wasInterrupted) {
473
+ throw new Error(`Site creation interrupted!`);
474
+ }
470
475
  }
471
476
 
472
477
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "host-mdx",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "A cli tool to create and serve a static html website from a given mdx directory",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,7 +20,6 @@
20
20
  "dependencies": {
21
21
  "chokidar": "^5.0.0",
22
22
  "ignore": "^7.0.5",
23
- "lodash": "^4.17.23",
24
23
  "lowlight": "^3.3.0",
25
24
  "mdx-bundler": "^10.1.1",
26
25
  "p-limit": "^7.3.0",