@ahmedrowaihi/8n 6.0.5 → 6.0.6
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/adapter.cjs +2 -0
- package/dist/index.mjs +15 -9
- package/package.json +1 -1
- package/starter/package.json +5 -2
- package/starter/scripts/release.mts +47 -0
package/dist/adapter.cjs
CHANGED
|
@@ -8,12 +8,14 @@ const adapter = {
|
|
|
8
8
|
if (phase !== "phase-production-build") return config;
|
|
9
9
|
const basePath = process.env.NEXT_BASE_PATH || "";
|
|
10
10
|
const staticExport = process.env.NEXT_STATIC_EXPORT === "true";
|
|
11
|
+
const docsProjectDir = process.env.DOCS_PROJECT_DIR;
|
|
11
12
|
return {
|
|
12
13
|
...config,
|
|
13
14
|
...staticExport ? {
|
|
14
15
|
output: "export",
|
|
15
16
|
trailingSlash: true
|
|
16
17
|
} : {},
|
|
18
|
+
...!staticExport && docsProjectDir ? { distDir: (0, node_path.join)(docsProjectDir, ".next") } : {},
|
|
17
19
|
...basePath ? {
|
|
18
20
|
basePath,
|
|
19
21
|
assetPrefix: basePath
|
package/dist/index.mjs
CHANGED
|
@@ -3674,7 +3674,7 @@ async function checkSelfUpdate() {
|
|
|
3674
3674
|
});
|
|
3675
3675
|
if (!res.ok) return;
|
|
3676
3676
|
const { version: latest } = await res.json();
|
|
3677
|
-
const current = "6.0.
|
|
3677
|
+
const current = "6.0.6";
|
|
3678
3678
|
if (latest !== current) console.log(pc.yellow("⚠") + pc.dim(` new version available: `) + pc.cyan(latest) + pc.dim(` (current: ${current}) — run `) + pc.cyan("npm i -g @ahmedrowaihi/8n") + pc.dim(" to update"));
|
|
3679
3679
|
} catch {}
|
|
3680
3680
|
}
|
|
@@ -3767,7 +3767,7 @@ async function dev() {
|
|
|
3767
3767
|
|
|
3768
3768
|
//#endregion
|
|
3769
3769
|
//#region src/commands/build.ts
|
|
3770
|
-
async function build() {
|
|
3770
|
+
async function build({ server = false } = {}) {
|
|
3771
3771
|
const { config, contentDir } = await resolveProject();
|
|
3772
3772
|
console.log(pc.cyan("8n") + pc.dim(` build → ${contentDir}`));
|
|
3773
3773
|
await ensureDepsInstalled();
|
|
@@ -3775,9 +3775,9 @@ async function build() {
|
|
|
3775
3775
|
await runNext("build", buildEnv({
|
|
3776
3776
|
config,
|
|
3777
3777
|
contentDir,
|
|
3778
|
-
staticExport:
|
|
3778
|
+
staticExport: !server
|
|
3779
3779
|
}));
|
|
3780
|
-
console.log(pc.green("✓") + pc.dim(` build complete → out
|
|
3780
|
+
console.log(pc.green("✓") + pc.dim(` build complete → ${server ? ".next/" : "out/"}`));
|
|
3781
3781
|
}
|
|
3782
3782
|
|
|
3783
3783
|
//#endregion
|
|
@@ -3867,7 +3867,7 @@ summary: Initial release.
|
|
|
3867
3867
|
First version of the docs.
|
|
3868
3868
|
`
|
|
3869
3869
|
};
|
|
3870
|
-
const GITIGNORE_ENTRIES = ["out"];
|
|
3870
|
+
const GITIGNORE_ENTRIES = ["out", ".next"];
|
|
3871
3871
|
function isDirEmpty(dir) {
|
|
3872
3872
|
if (!existsSync(dir)) return true;
|
|
3873
3873
|
return readdirSync(dir).filter((f) => !f.startsWith(".")).length === 0;
|
|
@@ -3883,7 +3883,13 @@ function scaffold(targetDir) {
|
|
|
3883
3883
|
dev: "8n dev",
|
|
3884
3884
|
build: "8n build",
|
|
3885
3885
|
start: "8n start"
|
|
3886
|
-
}
|
|
3886
|
+
},
|
|
3887
|
+
dependencies: { "@ahmedrowaihi/8n": "latest" }
|
|
3888
|
+
}, null, 2) + "\n",
|
|
3889
|
+
"next.config.mjs": `// Required for Vercel to detect the Next.js framework.\n// The actual Next.js app is built by the 8n CLI internally.\nexport default {};\n`,
|
|
3890
|
+
"vercel.json": JSON.stringify({
|
|
3891
|
+
framework: "nextjs",
|
|
3892
|
+
buildCommand: "8n build --server"
|
|
3887
3893
|
}, null, 2) + "\n"
|
|
3888
3894
|
};
|
|
3889
3895
|
for (const [rel, content] of Object.entries(files)) {
|
|
@@ -3945,7 +3951,7 @@ async function mcp() {
|
|
|
3945
3951
|
const mcpDir = join(getStarterDir(), "content", "mcp", "en");
|
|
3946
3952
|
const server = new McpServer({
|
|
3947
3953
|
name: "8n",
|
|
3948
|
-
version: "6.0.
|
|
3954
|
+
version: "6.0.6"
|
|
3949
3955
|
});
|
|
3950
3956
|
server.registerTool("read_me", {
|
|
3951
3957
|
description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
|
|
@@ -4086,12 +4092,12 @@ Example: get_component({ name: "components" }) returns all available MDX compone
|
|
|
4086
4092
|
|
|
4087
4093
|
//#endregion
|
|
4088
4094
|
//#region src/index.ts
|
|
4089
|
-
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.
|
|
4095
|
+
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.6").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
|
|
4090
4096
|
if (cmd.opts().debug) process.env.DEBUG_8N = "1";
|
|
4091
4097
|
});
|
|
4092
4098
|
program.command("init").description("Scaffold a new docs project in the current directory").action(init);
|
|
4093
4099
|
program.command("dev").description("Start the dev server").action(dev);
|
|
4094
|
-
program.command("build").description("Build for production").action(build);
|
|
4100
|
+
program.command("build").description("Build for production").option("--server", "Build for server deployment (SSR) instead of static export").action((opts) => build(opts));
|
|
4095
4101
|
program.command("start").description("Start the production server").action(start);
|
|
4096
4102
|
program.command("mcp").description("Start the MCP server for AI-assisted docs authoring").action(mcp);
|
|
4097
4103
|
program.parse();
|
package/package.json
CHANGED
package/starter/package.json
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"generate:api": "tsx scripts/generate-docs.mts",
|
|
13
13
|
"types:check": "tsc --noEmit",
|
|
14
14
|
"lint": "biome check",
|
|
15
|
-
"format": "biome format --write"
|
|
15
|
+
"format": "biome format --write",
|
|
16
|
+
"release": "tsx scripts/release.mts",
|
|
17
|
+
"release:minor": "tsx scripts/release.mts minor",
|
|
18
|
+
"release:major": "tsx scripts/release.mts major"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
21
|
"@ai-sdk/anthropic": "^3.0.58",
|
|
@@ -103,5 +106,5 @@
|
|
|
103
106
|
"tsx": "^4.21.0",
|
|
104
107
|
"typescript": "^5.9.3"
|
|
105
108
|
},
|
|
106
|
-
"version": "6.0.
|
|
109
|
+
"version": "6.0.6"
|
|
107
110
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Bump version and push — CI handles build + publish.
|
|
4
|
+
* Usage: tsx scripts/release.mts [patch|minor|major]
|
|
5
|
+
*/
|
|
6
|
+
import { execSync } from "node:child_process";
|
|
7
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
|
|
10
|
+
const ROOT = new URL("..", import.meta.url).pathname;
|
|
11
|
+
|
|
12
|
+
function readJson(path: string) {
|
|
13
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function writeJson(path: string, data: object) {
|
|
17
|
+
writeFileSync(path, JSON.stringify(data, null, 2) + "\n");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function bumpVersion(version: string, type: "patch" | "minor" | "major"): string {
|
|
21
|
+
const [major, minor, patch] = version.split(".").map(Number);
|
|
22
|
+
if (type === "patch") return `${major}.${minor}.${patch + 1}`;
|
|
23
|
+
if (type === "minor") return `${major}.${minor + 1}.0`;
|
|
24
|
+
return `${major + 1}.0.0`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function run(cmd: string) {
|
|
28
|
+
execSync(cmd, { cwd: ROOT, stdio: "inherit" });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const bump = (process.argv[2] ?? "patch") as "patch" | "minor" | "major";
|
|
32
|
+
if (!["patch", "minor", "major"].includes(bump)) {
|
|
33
|
+
console.error("Usage: tsx scripts/release.mts [patch|minor|major]");
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const rootPkg = readJson(join(ROOT, "package.json"));
|
|
38
|
+
const newVersion = bumpVersion(rootPkg.version, bump);
|
|
39
|
+
rootPkg.version = newVersion;
|
|
40
|
+
writeJson(join(ROOT, "package.json"), rootPkg);
|
|
41
|
+
console.log(`✓ bumped to ${newVersion}`);
|
|
42
|
+
|
|
43
|
+
run("git add package.json");
|
|
44
|
+
run(`git commit -m "v${newVersion}"`);
|
|
45
|
+
run(`git tag v${newVersion}`);
|
|
46
|
+
run("git push --follow-tags");
|
|
47
|
+
console.log(`✓ pushed v${newVersion} — CI will publish`);
|