prev-cli 0.16.2 → 0.16.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.
package/dist/cli.js CHANGED
@@ -647,7 +647,8 @@ var defaultConfig = {
647
647
  theme: "system",
648
648
  contentWidth: "constrained",
649
649
  hidden: [],
650
- order: {}
650
+ order: {},
651
+ port: undefined
651
652
  };
652
653
  function validateConfig(raw) {
653
654
  const config = { ...defaultConfig };
@@ -670,6 +671,9 @@ function validateConfig(raw) {
670
671
  }
671
672
  }
672
673
  }
674
+ if (typeof obj.port === "number" && obj.port > 0 && obj.port < 65536) {
675
+ config.port = obj.port;
676
+ }
673
677
  }
674
678
  return config;
675
679
  }
@@ -1467,7 +1471,8 @@ async function main() {
1467
1471
  printHelp();
1468
1472
  process.exit(0);
1469
1473
  }
1470
- const port = values.port ? parseInt(values.port, 10) : undefined;
1474
+ const config = loadConfig(rootDir);
1475
+ const port = values.port ? parseInt(values.port, 10) : config.port;
1471
1476
  const days = values.days ? parseInt(values.days, 10) : 30;
1472
1477
  const include = values.include || [];
1473
1478
  try {
@@ -3,6 +3,7 @@ export interface PrevConfig {
3
3
  contentWidth: 'constrained' | 'full';
4
4
  hidden: string[];
5
5
  order: Record<string, string[]>;
6
+ port?: number;
6
7
  }
7
8
  export declare const defaultConfig: PrevConfig;
8
9
  export declare function validateConfig(raw: unknown): PrevConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prev-cli",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "Transform MDX directories into beautiful documentation websites",
5
5
  "type": "module",
6
6
  "license": "MIT",