mdts 0.16.1 → 0.18.0

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 (62) hide show
  1. package/README.md +4 -0
  2. package/dist/cli.js +29 -11
  3. package/dist/frontend/bundle.js +177 -89
  4. package/dist/frontend/markdown.css +40 -0
  5. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-U656AL7Q_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-PBZL5I3N_mjs.bundle.js} +4 -4
  6. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-F6HP7TQM_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-HDMCJU4V_mjs.bundle.js} +4 -4
  7. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-NVLQJR56_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-3K5VOQVL_mjs.bundle.js} +4 -4
  8. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-BFZMPI3H_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-RMMSAZCW_mjs.bundle.js} +4 -4
  9. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-7BOR55EZ_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-UPGHQEXC_mjs.bundle.js} +4 -4
  10. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-NHE76QYJ_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-KQ55EAFF_mjs.bundle.js} +4 -4
  11. package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-KMMF4GRG_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-KZPCXAKY_mjs.bundle.js} +4 -4
  12. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-VBA2DB6C_mjs.bundle.js +22 -0
  13. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-RAHNMMFH_mjs.bundle.js +22 -0
  14. package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_diagram-S2PKOQOG_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_diagram-P4PSJMXO_mjs.bundle.js} +4 -4
  15. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-LFFYTUFH_mjs.bundle.js +22 -0
  16. package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-ADFJNKIX_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-SKSYHLDU_mjs.bundle.js} +4 -4
  17. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-FVOUBMTO_mjs.bundle.js +22 -0
  18. package/dist/frontend/vendors-node_modules_cytoscape_dist_cytoscape_esm_mjs.bundle.js +1 -1
  19. package/dist/frontend/vendors-node_modules_dagre-d3-es_src_dagre_index_js.bundle.js +14 -14
  20. package/dist/frontend/vendors-node_modules_dagre-d3-es_src_graphlib_index_js.bundle.js +1 -1
  21. package/dist/frontend/vendors-node_modules_mermaid-js_parser_dist_mermaid-parser_core_mjs.bundle.js +476 -76
  22. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-VXUJARFQ_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-2XIMDMQ5_mjs.bundle.js} +4 -4
  23. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-WCTKOSBZ_mjs.bundle.js +52 -0
  24. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-IC4MRINW_mjs.bundle.js +32 -0
  25. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-DI55MBZ5_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-NQ4KR5QH_mjs.bundle.js} +7 -7
  26. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-WL4C6EOR_mjs.bundle.js +62 -0
  27. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-6UL2VRFP_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-KLK3FWXG_mjs.bundle.js} +5 -5
  28. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-E7M64L7V_mjs.bundle.js +42 -0
  29. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-IFDJBPK2_mjs.bundle.js +32 -0
  30. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-INFDFZHY_mjs.bundle.js +52 -0
  31. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-PKNHOUZH_mjs.bundle.js +72 -0
  32. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-JELNMOA3_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-A5KZAMGK_mjs.bundle.js} +4 -4
  33. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-K3NZZRJ6_mjs.bundle.js +42 -0
  34. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-PHBUUO56_mjs.bundle.js +22 -0
  35. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-XKPGCS4Q_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-4ABVD52K_mjs.bundle.js} +7 -7
  36. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-3W4ZIXB7_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-K7BYSVSG_mjs.bundle.js} +4 -4
  37. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-VGOIOE7T_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-YRQLILUH_mjs.bundle.js} +7 -7
  38. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-AYHSOK5B_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-337W2JSQ_mjs.bundle.js} +4 -4
  39. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-UZGBJVZJ_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-Z7DCOOCP_mjs.bundle.js} +7 -7
  40. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-TZEHDZUN_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-WA2Y5GQK_mjs.bundle.js} +4 -4
  41. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-2WXFIKYE_mjs.bundle.js +42 -0
  42. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-FKZM4ZOC_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-RAJIS63D_mjs.bundle.js} +4 -4
  43. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-IT6M3QCI_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-YZTLITO2_mjs.bundle.js} +4 -4
  44. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-LZ73GAT5_mjs.bundle.js +42 -0
  45. package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-PRI3JC2R_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-JWTSCODW_mjs.bundle.js} +4 -4
  46. package/dist/server/routes/diff.js +87 -0
  47. package/dist/server/routes/filetree.js +1 -1
  48. package/dist/server/server.js +32 -10
  49. package/package.json +2 -2
  50. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-2ON5EDUG_mjs.bundle.js +0 -22
  51. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-WZHVMYZB_mjs.bundle.js +0 -22
  52. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-WHAUD3N6_mjs.bundle.js +0 -22
  53. package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-4FDKWEC3_mjs.bundle.js +0 -22
  54. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-VD42YOAC_mjs.bundle.js +0 -52
  55. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-YG6GDRKO_mjs.bundle.js +0 -32
  56. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-B4BG7PRW_mjs.bundle.js +0 -52
  57. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-PSM6KHXK_mjs.bundle.js +0 -42
  58. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-QEK2KX5R_mjs.bundle.js +0 -32
  59. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-Q2GNP2WA_mjs.bundle.js +0 -52
  60. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-NV44I4VS_mjs.bundle.js +0 -62
  61. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-NY62KEGX_mjs.bundle.js +0 -42
  62. package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-WL72ISMW_mjs.bundle.js +0 -42
package/README.md CHANGED
@@ -103,3 +103,7 @@ Experience mdts in action with real examples and interactive features.
103
103
 
104
104
  Found a bug? Have an idea? Want to send a PR?
105
105
  See [CONTRIBUTING.md](./CONTRIBUTING.md) for details — we'd love to have your help!
106
+
107
+ ## Author
108
+
109
+ [@unhappychoice](https://unhappychoice.com)
package/dist/cli.js CHANGED
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -15,7 +24,7 @@ const DEFAULT_DIRECTORY = '.';
15
24
  class CLI {
16
25
  run() {
17
26
  return this.requireOpen()
18
- .then((open) => {
27
+ .then((open) => __awaiter(this, void 0, void 0, function* () {
19
28
  const program = new commander_1.Command();
20
29
  const packageJsonPath = path_1.default.join(__dirname, '..', 'package.json');
21
30
  const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, 'utf8'));
@@ -23,37 +32,46 @@ class CLI {
23
32
  .version(packageJson.version)
24
33
  .description('A zero-config CLI tool to preview local Markdown files in a browser')
25
34
  .option('-H, --host <host>', 'host to listen on', 'localhost')
26
- .option('-p, --port <port>', 'port to serve on', String(DEFAULT_PORT))
35
+ .option('-p, --port <port>', 'port to serve on (use "auto" to find an available port)', String(DEFAULT_PORT))
27
36
  .option('-s, --silent', 'suppress server logs', false)
28
37
  .option('--no-open', 'do not open the browser automatically')
29
38
  .option('-g, --glob <patterns...>', 'glob patterns to filter markdown files (e.g. "docs/*.md")')
30
39
  .argument('[directory]', 'directory to serve', DEFAULT_DIRECTORY)
31
- .action((directory, options) => {
40
+ .action((directory, options) => __awaiter(this, void 0, void 0, function* () {
32
41
  logger_1.logger.setSilent(options.silent);
33
42
  logger_1.logger.showLogo();
34
43
  logger_1.logger.log('Announcement', '🎉 Thanks for using mdts!');
35
44
  logger_1.logger.log('Announcement', '✨ Like it? Star it on GitHub: https://github.com/unhappychoice/mdts');
36
45
  logger_1.logger.log('CLI', '⚙ Options: ' + JSON.stringify(options));
37
- const port = parseInt(options.port, 10);
46
+ const autoPort = options.port === 'auto';
47
+ const port = autoPort ? DEFAULT_PORT : parseInt(options.port, 10);
38
48
  const host = options.host;
39
49
  const absoluteDirectory = path_1.default.resolve(process.cwd(), directory);
40
50
  const context = options.glob
41
51
  ? (0, glob_1.resolveGlobPatterns)(absoluteDirectory, options.glob)
42
52
  : { directory: absoluteDirectory };
43
- (0, server_1.serve)(context, port, host);
53
+ let actualPort;
54
+ try {
55
+ ({ port: actualPort } = yield (0, server_1.serve)(context, port, host, autoPort));
56
+ }
57
+ catch (err) {
58
+ logger_1.logger.error(`❌ Failed to start server: ${err instanceof Error ? err.message : err}`);
59
+ process.exitCode = 1;
60
+ return;
61
+ }
44
62
  const readmePath = path_1.default.join(context.directory, 'README.md');
45
63
  const initialPath = (0, fs_1.existsSync)(readmePath) ? '/README.md' : '';
46
64
  const displayHost = (host === '0.0.0.0' || host === '::') ? 'localhost' : host;
47
65
  if (options.open) {
48
- logger_1.logger.log('CLI', `🌐 Opening browser at http://${displayHost}:${port}${initialPath}`);
49
- open(`http://${displayHost}:${port}${initialPath}`);
66
+ logger_1.logger.log('CLI', `🌐 Opening browser at http://${displayHost}:${actualPort}${initialPath}`);
67
+ open(`http://${displayHost}:${actualPort}${initialPath}`);
50
68
  }
51
69
  else {
52
- logger_1.logger.log('CLI', `🌐 Server running at http://${displayHost}:${port}${initialPath}`);
70
+ logger_1.logger.log('CLI', `🌐 Server running at http://${displayHost}:${actualPort}${initialPath}`);
53
71
  }
54
- });
55
- program.parse(process.argv);
56
- });
72
+ }));
73
+ yield program.parseAsync(process.argv);
74
+ }));
57
75
  }
58
76
  requireOpen() {
59
77
  return import('open').then((module) => module.default);