mdboard 1.2.0 → 1.3.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.
package/bin.js CHANGED
@@ -27,20 +27,44 @@ if (command === '--help' || command === '-h') {
27
27
  }
28
28
 
29
29
  if (command === 'init') {
30
- require('./init.js');
30
+ const initArgs = args.slice(1).filter(a => !a.startsWith('--'));
31
+ process.env.MDBOARD_INIT_NAME = initArgs[0] || '';
32
+ require('./src/cli/init.js');
31
33
  } else if (command === 'help') {
32
34
  printHelp();
33
35
  process.exit(0);
34
36
  } else if (command === 'cache') {
35
37
  handleCache();
38
+ } else if (command === 'status') {
39
+ const { resolveProjectDir } = require('./src/cli/cli');
40
+ const { generateStatus } = require('./src/cli/status');
41
+ generateStatus(resolveProjectDir(args));
42
+ } else if (command === 'sync') {
43
+ const { resolveProjectDir, parseFlags } = require('./src/cli/cli');
44
+ const { runSync } = require('./src/cli/sync');
45
+ const { flags } = parseFlags(args.slice(1));
46
+ runSync(resolveProjectDir(args), { fix: !!flags.fix });
47
+ } else if (command === 'theme') {
48
+ const { handleTheme } = require('./src/cli/theme');
49
+ handleTheme(args.slice(1));
50
+ process.exit(0);
51
+ } else if (command === 'create') {
52
+ const { resolveProjectDir, handleCreate } = require('./src/cli/cli');
53
+ handleCreate(resolveProjectDir(args), args.slice(1));
54
+ } else if (command === 'update') {
55
+ const { resolveProjectDir, handleUpdate } = require('./src/cli/cli');
56
+ handleUpdate(resolveProjectDir(args), args.slice(1));
57
+ } else if (command === 'delete') {
58
+ const { resolveProjectDir, handleDelete } = require('./src/cli/cli');
59
+ handleDelete(resolveProjectDir(args), args.slice(1));
36
60
  } else {
37
61
  // Default: start server. Pass all args through.
38
- require('./server.js');
62
+ require('./src/server/server.js');
39
63
  }
40
64
 
41
65
  function handleCache() {
42
66
  const subCmd = args[1];
43
- const { listCache, cleanCache, CACHE_DIR } = require('./workspace');
67
+ const { listCache, cleanCache, CACHE_DIR } = require('./src/core/workspace');
44
68
 
45
69
  if (subCmd === 'list') {
46
70
  const entries = listCache();
@@ -76,27 +100,31 @@ function printHelp() {
76
100
 
77
101
  Usage:
78
102
  mdboard Start the dashboard server
79
- mdboard init Scaffold a new project/ directory
103
+ mdboard init [name] Scaffold a new workspace (prompts if no name)
104
+ mdboard status Generate project/status.md from current state
105
+ mdboard sync [--fix] Check consistency; --fix to auto-correct
106
+ mdboard create <entity> Create milestone, epic, task, or sprint
107
+ mdboard update <entity> Update an entity's frontmatter fields
108
+ mdboard delete <entity> Delete an entity and clean references
109
+ mdboard theme List available themes
110
+ mdboard theme <name> Set theme globally
111
+ mdboard theme <n> --project Set theme for current project
80
112
  mdboard cache list|clean Manage remote source cache
81
113
  mdboard --version Print version
82
114
  mdboard --help Show this help
83
115
 
116
+ CRUD examples:
117
+ mdboard create milestone "MVP"
118
+ mdboard create epic "Auth" --milestone mvp
119
+ mdboard create task "Login" --milestone mvp --epic auth
120
+ mdboard create sprint --milestone mvp --goal "Sprint 1"
121
+ mdboard update task TASK-001 --status in-progress
122
+ mdboard delete task TASK-001
123
+
84
124
  Server options:
85
125
  --project <path> Workspace root directory (default: cwd)
86
126
  --port <number> Server port (default: 3333)
87
127
  --config <path> Path to mdboard.json config file
88
128
  --workspace <path> Path to workspace.json
89
-
90
- Multi-repo workspace:
91
- Create a workspace.json in your project root to manage
92
- multiple repositories from a single dashboard.
93
-
94
- Examples:
95
- npx mdboard Start dashboard in current directory
96
- npx mdboard init Create project/ with templates
97
- npx mdboard --port 4000 Start on port 4000
98
- npx mdboard --workspace ./workspace.json
99
- npx mdboard cache list Show cached remote repos
100
- npx mdboard cache clean Clear remote cache
101
129
  `);
102
130
  }
package/build.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ const CLIENT_DIR = path.join(__dirname, 'src', 'client');
8
+ const OUT_FILE = path.join(__dirname, 'index.html');
9
+
10
+ const JS_FILES = [
11
+ 'themes.js',
12
+ 'core.js',
13
+ 'workspace.js',
14
+ 'editor.js',
15
+ 'board.js',
16
+ 'table.js',
17
+ 'milestones.js',
18
+ 'metrics.js',
19
+ 'overview.js',
20
+ 'notes.js',
21
+ 'panel.js',
22
+ 'history.js',
23
+ 'app.js',
24
+ ];
25
+
26
+ // Read template
27
+ const template = fs.readFileSync(path.join(CLIENT_DIR, 'template.html'), 'utf8');
28
+
29
+ // Read CSS
30
+ const css = fs.readFileSync(path.join(CLIENT_DIR, 'styles.css'), 'utf8');
31
+
32
+ // Read and concatenate JS files
33
+ const js = JS_FILES
34
+ .map(f => fs.readFileSync(path.join(CLIENT_DIR, f), 'utf8'))
35
+ .join('\n\n');
36
+
37
+ // Replace placeholders
38
+ let output = template.replace('<!-- STYLES -->', css);
39
+ output = output.replace('<!-- SCRIPTS -->', js);
40
+
41
+ fs.writeFileSync(OUT_FILE, output, 'utf8');
42
+
43
+ const lines = output.split('\n').length;
44
+ console.log(`Built index.html (${lines} lines, ${Buffer.byteLength(output)} bytes)`);