superlore-cli 0.5.0 → 0.6.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/dist/index.d.ts +1 -1
- package/dist/index.js +17 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ declare function serializeSuperloreJson(config: SuperloreJson): string;
|
|
|
87
87
|
declare function resolveMcpPath(config: SuperloreJson): string | undefined;
|
|
88
88
|
|
|
89
89
|
/** The CLI version, kept in sync with package.json at build time. */
|
|
90
|
-
declare const VERSION = "0.
|
|
90
|
+
declare const VERSION = "0.6.0";
|
|
91
91
|
/** Build the argument parser. Exported for tests; `run()` wires it to argv. */
|
|
92
92
|
declare function buildCli(argv?: readonly string[]): cac.CAC;
|
|
93
93
|
/** Parse argv and dispatch. Reports unknown commands and unexpected errors cleanly. */
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
+
import { realpathSync } from "fs";
|
|
4
5
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5
6
|
import process3 from "process";
|
|
6
7
|
import { cac } from "cac";
|
|
@@ -1811,7 +1812,7 @@ function writeSkeleton(root, config) {
|
|
|
1811
1812
|
"fumadocs-core": "^16.8.2",
|
|
1812
1813
|
"fumadocs-mdx": "^14.3.1",
|
|
1813
1814
|
"fumadocs-ui": "^16.8.2",
|
|
1814
|
-
superlore: "^0.
|
|
1815
|
+
superlore: "^0.9.0",
|
|
1815
1816
|
"lucide-react": "^1.21.0",
|
|
1816
1817
|
...mcpEnabled ? (
|
|
1817
1818
|
// mcp-handler pins an EXACT sdk peer (1.26.0); npm errors on anything else (pnpm only
|
|
@@ -1889,7 +1890,7 @@ export default withMDX(config);
|
|
|
1889
1890
|
"source.config.ts",
|
|
1890
1891
|
`import { defineConfig, defineDocs } from "fumadocs-mdx/config";
|
|
1891
1892
|
import { superloreFrontmatterSchema } from "superlore/frontmatter";
|
|
1892
|
-
import {
|
|
1893
|
+
import { remarkSuperlore } from "superlore/mdx";
|
|
1893
1894
|
|
|
1894
1895
|
// Extend the superlore frontmatter schema in ONE place if you add custom fields.
|
|
1895
1896
|
export const docs = defineDocs({
|
|
@@ -1899,9 +1900,9 @@ export const docs = defineDocs({
|
|
|
1899
1900
|
|
|
1900
1901
|
export default defineConfig({
|
|
1901
1902
|
mdxOptions: {
|
|
1902
|
-
//
|
|
1903
|
-
//
|
|
1904
|
-
remarkPlugins: [
|
|
1903
|
+
// Markdown-first authoring, one plugin: \`\`\`superlore-canvas fences \u2192 <Canvas>, \`- [ ]\` task
|
|
1904
|
+
// lists \u2192 <Checklist>, and \`> [!NOTE]\` GitHub alerts \u2192 Callouts. Write natural markdown.
|
|
1905
|
+
remarkPlugins: [remarkSuperlore],
|
|
1905
1906
|
},
|
|
1906
1907
|
});
|
|
1907
1908
|
`
|
|
@@ -2477,7 +2478,7 @@ function printNextSteps(root, config) {
|
|
|
2477
2478
|
}
|
|
2478
2479
|
|
|
2479
2480
|
// src/index.ts
|
|
2480
|
-
var VERSION = "0.
|
|
2481
|
+
var VERSION = "0.6.0";
|
|
2481
2482
|
function buildCli(argv = process3.argv) {
|
|
2482
2483
|
const cli = cac("superlore");
|
|
2483
2484
|
cli.command("init [dir]", "Scaffold a new superlore knowledge base").option("--name <name>", "KB name").option("--type <type>", "KB type: company-kb | product-docs | personal-kb").option("--auth", "Enable the Google SSO auth gate").option("--no-auth", "Disable the auth gate").option("--allowed-domain <domain>", "Restrict SSO to one email domain (implies --auth)").option("--accent <color>", "Brand accent colour (any CSS colour)").option("--no-mcp", "Disable the MCP endpoint (on by default)").option("--connect", "Install the editor extension after scaffolding (skip the prompt)").option("--no-connect", "Don't set up the editor extension").option("-y, --yes", "Skip prompts; use flags + defaults").example("superlore init my-kb --type product-docs").example("superlore init acme --type company-kb --auth --allowed-domain acme.com").example("superlore init me --type personal-kb").action(
|
|
@@ -2536,8 +2537,16 @@ async function run(argv = process3.argv) {
|
|
|
2536
2537
|
process3.exit(1);
|
|
2537
2538
|
}
|
|
2538
2539
|
}
|
|
2539
|
-
|
|
2540
|
-
|
|
2540
|
+
function isEntrypoint() {
|
|
2541
|
+
const entry = process3.argv[1];
|
|
2542
|
+
if (!entry) return false;
|
|
2543
|
+
try {
|
|
2544
|
+
return realpathSync(fileURLToPath2(import.meta.url)) === realpathSync(entry);
|
|
2545
|
+
} catch {
|
|
2546
|
+
return false;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
if (isEntrypoint()) {
|
|
2541
2550
|
void run();
|
|
2542
2551
|
}
|
|
2543
2552
|
export {
|
package/package.json
CHANGED