@ahmedrowaihi/8n 6.0.4 → 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 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.4";
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: true
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.4"
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.4").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
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
@@ -30,5 +30,5 @@
30
30
  "typescript": "^5.9.3",
31
31
  "zod": "^4.3.6"
32
32
  },
33
- "version": "6.0.4"
33
+ "version": "6.0.6"
34
34
  }
@@ -4,7 +4,7 @@ on:
4
4
  push:
5
5
  branches: [main]
6
6
  paths:
7
- - cli/package.json
7
+ - package.json
8
8
  workflow_dispatch:
9
9
 
10
10
  jobs:
@@ -13,6 +13,16 @@ jobs:
13
13
  steps:
14
14
  - uses: actions/checkout@v4
15
15
 
16
+ - name: Sync version from starter to cli
17
+ run: |
18
+ VERSION=$(node -p "require('./package.json').version")
19
+ node -e "
20
+ const fs = require('fs');
21
+ const pkg = JSON.parse(fs.readFileSync('./cli/package.json', 'utf8'));
22
+ pkg.version = '$VERSION';
23
+ fs.writeFileSync('./cli/package.json', JSON.stringify(pkg, null, 2) + '\n');
24
+ "
25
+
16
26
  - name: Check if version is already published
17
27
  id: version_check
18
28
  run: |
@@ -1,5 +1,8 @@
1
1
  /** @type {import('next').NextConfig} */
2
2
  const config = {
3
+ turbopack: {
4
+ root: import.meta.dirname,
5
+ },
3
6
  reactStrictMode: true,
4
7
  adapterPath: process.env.NEXT_ADAPTER_PATH,
5
8
 
@@ -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.4"
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`);