@nodesify/astria 1.0.0 → 1.0.2
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/LICENSE +21 -21
- package/README.md +65 -65
- package/dist/commands/add.d.ts +7 -7
- package/dist/commands/add.js +33 -33
- package/dist/commands/affected.d.ts +5 -5
- package/dist/commands/affected.js +29 -29
- package/dist/commands/cluster.d.ts +1 -1
- package/dist/commands/cluster.js +50 -50
- package/dist/commands/diagnose.d.ts +4 -4
- package/dist/commands/diagnose.js +19 -19
- package/dist/commands/diff.d.ts +1 -1
- package/dist/commands/diff.js +35 -35
- package/dist/commands/explain.d.ts +3 -3
- package/dist/commands/explain.js +37 -37
- package/dist/commands/export.d.ts +6 -6
- package/dist/commands/export.js +32 -32
- package/dist/commands/feedback.d.ts +11 -11
- package/dist/commands/feedback.js +40 -40
- package/dist/commands/global.d.ts +6 -6
- package/dist/commands/global.js +60 -60
- package/dist/commands/history.d.ts +4 -4
- package/dist/commands/history.js +27 -27
- package/dist/commands/hook-guard.d.ts +1 -1
- package/dist/commands/hook-guard.js +144 -144
- package/dist/commands/hook.d.ts +2 -2
- package/dist/commands/hook.js +52 -52
- package/dist/commands/install.d.ts +2 -2
- package/dist/commands/install.js +39 -39
- package/dist/commands/map.d.ts +5 -5
- package/dist/commands/map.js +15 -15
- package/dist/commands/mcp.d.ts +3 -3
- package/dist/commands/mcp.js +14 -14
- package/dist/commands/merge.d.ts +1 -1
- package/dist/commands/merge.js +50 -50
- package/dist/commands/migrate.d.ts +3 -3
- package/dist/commands/migrate.js +74 -74
- package/dist/commands/path.d.ts +5 -5
- package/dist/commands/path.js +18 -18
- package/dist/commands/prs.d.ts +4 -4
- package/dist/commands/prs.js +132 -132
- package/dist/commands/query.d.ts +9 -9
- package/dist/commands/query.js +21 -21
- package/dist/commands/run.d.ts +9 -9
- package/dist/commands/run.js +68 -68
- package/dist/commands/stats.d.ts +3 -3
- package/dist/commands/stats.js +17 -17
- package/dist/commands/status.d.ts +3 -3
- package/dist/commands/status.js +56 -56
- package/dist/commands/tree.d.ts +5 -5
- package/dist/commands/tree.js +52 -52
- package/dist/commands/update.d.ts +6 -6
- package/dist/commands/update.js +65 -65
- package/dist/commands/watch.d.ts +3 -3
- package/dist/commands/watch.js +113 -113
- package/dist/commands/wiki.d.ts +6 -6
- package/dist/commands/wiki.js +59 -59
- package/dist/index.d.ts +4 -4
- package/dist/index.js +249 -249
- package/dist/install/hooks.d.ts +11 -11
- package/dist/install/hooks.js +306 -306
- package/dist/install/index.d.ts +2 -2
- package/dist/install/index.js +361 -361
- package/dist/install/markdown-inject.d.ts +6 -6
- package/dist/install/markdown-inject.js +177 -177
- package/dist/install/platforms.d.ts +12 -12
- package/dist/install/platforms.js +129 -129
- package/dist/install/settings-inject.d.ts +17 -17
- package/dist/install/settings-inject.js +424 -424
- package/dist/native.d.ts +31 -31
- package/dist/native.js +106 -106
- package/package.json +72 -72
- package/skills/skill-aider.md +40 -40
- package/skills/skill-codex.md +46 -46
- package/skills/skill-copilot.md +46 -46
- package/skills/skill-cursor.md +39 -39
- package/skills/skill-gemini.md +46 -46
- package/skills/skill-kiro.md +39 -39
- package/skills/skill-opencode.md +44 -44
- package/skills/skill-trae.md +46 -46
- package/skills/skill.md +266 -266
- package/dist/graphify.node +0 -4
package/dist/commands/watch.js
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.watchCommand = watchCommand;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const native_1 = require("../native");
|
|
40
|
-
const CODE_EXTENSIONS = new Set([
|
|
41
|
-
'.py', '.js', '.jsx', '.mjs', '.ts', '.tsx',
|
|
42
|
-
'.rs', '.go', '.java', '.c', '.h', '.cpp', '.cc', '.cxx', '.hpp',
|
|
43
|
-
]);
|
|
44
|
-
const SKIP_DIRS = new Set(['.astria', 'node_modules', 'target', '.git', 'dist', '__pycache__']);
|
|
45
|
-
async function watchCommand(watchPath, opts) {
|
|
46
|
-
const debounceMs = parseInt(opts.debounce || '3000', 10);
|
|
47
|
-
const resolved = path.resolve(watchPath);
|
|
48
|
-
if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) {
|
|
49
|
-
console.error(`Error: "${resolved}" is not a valid directory`);
|
|
50
|
-
process.exitCode = 1;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let changedFiles = new Set();
|
|
54
|
-
let timer = null;
|
|
55
|
-
let watcher;
|
|
56
|
-
try {
|
|
57
|
-
watcher = fs.watch(resolved, { recursive: true }, (_event, filename) => {
|
|
58
|
-
if (!filename)
|
|
59
|
-
return;
|
|
60
|
-
const filePath = filename.replace(/\\/g, '/');
|
|
61
|
-
const parts = filePath.split('/');
|
|
62
|
-
if (parts.some((p) => SKIP_DIRS.has(p)))
|
|
63
|
-
return;
|
|
64
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
65
|
-
if (!CODE_EXTENSIONS.has(ext))
|
|
66
|
-
return;
|
|
67
|
-
changedFiles.add(filePath);
|
|
68
|
-
if (timer)
|
|
69
|
-
clearTimeout(timer);
|
|
70
|
-
timer = setTimeout(() => {
|
|
71
|
-
const batch = [...changedFiles];
|
|
72
|
-
changedFiles.clear();
|
|
73
|
-
console.log(`\n[astria] ${batch.length} file(s) changed, rebuilding...`);
|
|
74
|
-
try {
|
|
75
|
-
const result = (0, native_1.runPipeline)(resolved);
|
|
76
|
-
console.log(`[astria] Rebuilt: ${result.nodesAdded} nodes, ${result.edgesAdded} edges, ${result.communities} communities`);
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
console.error(`[astria] Rebuild failed:`, e.message || e);
|
|
80
|
-
}
|
|
81
|
-
}, debounceMs);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
catch (err) {
|
|
85
|
-
console.error(`Error: Failed to watch "${resolved}": ${err.message || err}`);
|
|
86
|
-
process.exitCode = 1;
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
console.log(`[astria] Watching ${resolved} (debounce: ${debounceMs}ms)`);
|
|
90
|
-
console.log('[astria] Press Ctrl+C to stop');
|
|
91
|
-
if (process.platform === 'win32') {
|
|
92
|
-
const readline = require('readline');
|
|
93
|
-
const rl = readline.createInterface({ input: process.stdin });
|
|
94
|
-
rl.on('SIGINT', () => {
|
|
95
|
-
console.log('\n[astria] Stopped.');
|
|
96
|
-
watcher.close();
|
|
97
|
-
rl.close();
|
|
98
|
-
process.exit(0);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
process.on('SIGINT', () => {
|
|
103
|
-
console.log('\n[astria] Stopped.');
|
|
104
|
-
watcher.close();
|
|
105
|
-
process.exit(0);
|
|
106
|
-
});
|
|
107
|
-
process.on('SIGTERM', () => {
|
|
108
|
-
console.log('\n[astria] Stopped.');
|
|
109
|
-
watcher.close();
|
|
110
|
-
process.exit(0);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.watchCommand = watchCommand;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const native_1 = require("../native");
|
|
40
|
+
const CODE_EXTENSIONS = new Set([
|
|
41
|
+
'.py', '.js', '.jsx', '.mjs', '.ts', '.tsx',
|
|
42
|
+
'.rs', '.go', '.java', '.c', '.h', '.cpp', '.cc', '.cxx', '.hpp',
|
|
43
|
+
]);
|
|
44
|
+
const SKIP_DIRS = new Set(['.astria', 'node_modules', 'target', '.git', 'dist', '__pycache__']);
|
|
45
|
+
async function watchCommand(watchPath, opts) {
|
|
46
|
+
const debounceMs = parseInt(opts.debounce || '3000', 10);
|
|
47
|
+
const resolved = path.resolve(watchPath);
|
|
48
|
+
if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) {
|
|
49
|
+
console.error(`Error: "${resolved}" is not a valid directory`);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
let changedFiles = new Set();
|
|
54
|
+
let timer = null;
|
|
55
|
+
let watcher;
|
|
56
|
+
try {
|
|
57
|
+
watcher = fs.watch(resolved, { recursive: true }, (_event, filename) => {
|
|
58
|
+
if (!filename)
|
|
59
|
+
return;
|
|
60
|
+
const filePath = filename.replace(/\\/g, '/');
|
|
61
|
+
const parts = filePath.split('/');
|
|
62
|
+
if (parts.some((p) => SKIP_DIRS.has(p)))
|
|
63
|
+
return;
|
|
64
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
65
|
+
if (!CODE_EXTENSIONS.has(ext))
|
|
66
|
+
return;
|
|
67
|
+
changedFiles.add(filePath);
|
|
68
|
+
if (timer)
|
|
69
|
+
clearTimeout(timer);
|
|
70
|
+
timer = setTimeout(() => {
|
|
71
|
+
const batch = [...changedFiles];
|
|
72
|
+
changedFiles.clear();
|
|
73
|
+
console.log(`\n[astria] ${batch.length} file(s) changed, rebuilding...`);
|
|
74
|
+
try {
|
|
75
|
+
const result = (0, native_1.runPipeline)(resolved);
|
|
76
|
+
console.log(`[astria] Rebuilt: ${result.nodesAdded} nodes, ${result.edgesAdded} edges, ${result.communities} communities`);
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
console.error(`[astria] Rebuild failed:`, e.message || e);
|
|
80
|
+
}
|
|
81
|
+
}, debounceMs);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
console.error(`Error: Failed to watch "${resolved}": ${err.message || err}`);
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
console.log(`[astria] Watching ${resolved} (debounce: ${debounceMs}ms)`);
|
|
90
|
+
console.log('[astria] Press Ctrl+C to stop');
|
|
91
|
+
if (process.platform === 'win32') {
|
|
92
|
+
const readline = require('readline');
|
|
93
|
+
const rl = readline.createInterface({ input: process.stdin });
|
|
94
|
+
rl.on('SIGINT', () => {
|
|
95
|
+
console.log('\n[astria] Stopped.');
|
|
96
|
+
watcher.close();
|
|
97
|
+
rl.close();
|
|
98
|
+
process.exit(0);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
process.on('SIGINT', () => {
|
|
103
|
+
console.log('\n[astria] Stopped.');
|
|
104
|
+
watcher.close();
|
|
105
|
+
process.exit(0);
|
|
106
|
+
});
|
|
107
|
+
process.on('SIGTERM', () => {
|
|
108
|
+
console.log('\n[astria] Stopped.');
|
|
109
|
+
watcher.close();
|
|
110
|
+
process.exit(0);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
114
|
//# sourceMappingURL=watch.js.map
|
package/dist/commands/wiki.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function wikiCommand(opts: {
|
|
2
|
-
graph: string;
|
|
3
|
-
out: string;
|
|
4
|
-
maxNodes: string;
|
|
5
|
-
format: string;
|
|
6
|
-
}): Promise<void>;
|
|
1
|
+
export declare function wikiCommand(opts: {
|
|
2
|
+
graph: string;
|
|
3
|
+
out: string;
|
|
4
|
+
maxNodes: string;
|
|
5
|
+
format: string;
|
|
6
|
+
}): Promise<void>;
|
|
7
7
|
//# sourceMappingURL=wiki.d.ts.map
|
package/dist/commands/wiki.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.wikiCommand = wikiCommand;
|
|
37
|
-
const path = __importStar(require("path"));
|
|
38
|
-
const native_1 = require("../native");
|
|
39
|
-
async function wikiCommand(opts) {
|
|
40
|
-
try {
|
|
41
|
-
const resolved = path.isAbsolute(opts.out)
|
|
42
|
-
? opts.out
|
|
43
|
-
: path.join(opts.graph, opts.out);
|
|
44
|
-
if (opts.format === 'obsidian') {
|
|
45
|
-
const notes = (0, native_1.exportObsidian)(opts.graph, opts.out);
|
|
46
|
-
console.log(`Obsidian vault exported: ${notes} notes -> ${resolved}`);
|
|
47
|
-
console.log(`Open ${resolved} as a vault in Obsidian (astria.canvas included)`);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const maxNodes = parseInt(opts.maxNodes, 10) || 25;
|
|
51
|
-
const count = (0, native_1.exportWiki)(opts.graph, opts.out, maxNodes);
|
|
52
|
-
console.log(`Wiki exported: ${count} articles -> ${resolved}`);
|
|
53
|
-
console.log(`Start at: ${path.join(resolved, 'index.md')}`);
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
console.error(`Error: ${e.message || e}`);
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.wikiCommand = wikiCommand;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const native_1 = require("../native");
|
|
39
|
+
async function wikiCommand(opts) {
|
|
40
|
+
try {
|
|
41
|
+
const resolved = path.isAbsolute(opts.out)
|
|
42
|
+
? opts.out
|
|
43
|
+
: path.join(opts.graph, opts.out);
|
|
44
|
+
if (opts.format === 'obsidian') {
|
|
45
|
+
const notes = (0, native_1.exportObsidian)(opts.graph, opts.out);
|
|
46
|
+
console.log(`Obsidian vault exported: ${notes} notes -> ${resolved}`);
|
|
47
|
+
console.log(`Open ${resolved} as a vault in Obsidian (astria.canvas included)`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const maxNodes = parseInt(opts.maxNodes, 10) || 25;
|
|
51
|
+
const count = (0, native_1.exportWiki)(opts.graph, opts.out, maxNodes);
|
|
52
|
+
console.log(`Wiki exported: ${count} articles -> ${resolved}`);
|
|
53
|
+
console.log(`Start at: ${path.join(resolved, 'index.md')}`);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
console.error(`Error: ${e.message || e}`);
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
//# sourceMappingURL=wiki.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
declare const program: Command;
|
|
4
|
-
export { program };
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
declare const program: Command;
|
|
4
|
+
export { program };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|