@ahmedrowaihi/8n 6.0.28 → 6.0.30

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.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.28";
3677
+ const current = "6.0.30";
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
  }
@@ -3778,7 +3778,7 @@ async function dev() {
3778
3778
  async function build({ server = false } = {}) {
3779
3779
  const { config, contentDir } = await resolveProject();
3780
3780
  const projectDir = process.cwd();
3781
- console.log(pc.cyan("8n") + pc.dim(` v6.0.28 build → ${contentDir}`));
3781
+ console.log(pc.cyan("8n") + pc.dim(` v6.0.30 build → ${contentDir}`));
3782
3782
  if (server) await runNextFlat(projectDir, "build", buildEnv({
3783
3783
  config,
3784
3784
  contentDir,
@@ -3929,12 +3929,7 @@ function scaffold(targetDir) {
3929
3929
  "next": "^16.2.0"
3930
3930
  }
3931
3931
  }, null, 2) + "\n",
3932
- "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`,
3933
- "vercel.json": JSON.stringify({
3934
- framework: "nextjs",
3935
- installCommand: "npm install && ./node_modules/.bin/8n install",
3936
- buildCommand: "8n build --server"
3937
- }, null, 2) + "\n"
3932
+ "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`
3938
3933
  };
3939
3934
  for (const [rel, content] of Object.entries(files)) {
3940
3935
  const abs = resolve(targetDir, rel);
@@ -3981,11 +3976,11 @@ async function init() {
3981
3976
  }
3982
3977
 
3983
3978
  //#endregion
3984
- //#region src/commands/install.ts
3985
- async function install() {
3979
+ //#region src/commands/eject.ts
3980
+ async function eject() {
3986
3981
  const starterDir = getStarterDir();
3987
3982
  const projectDir = process.cwd();
3988
- console.log(pc.cyan("8n") + pc.dim(" install"));
3983
+ console.log(pc.cyan("8n") + pc.dim(" eject"));
3989
3984
  process.stdout.write(pc.dim(" copying starter files...\n"));
3990
3985
  cpSync(starterDir, projectDir, {
3991
3986
  recursive: true,
@@ -4021,6 +4016,71 @@ async function install() {
4021
4016
  process.stdout.write(pc.green("✓") + pc.dim(" project ready\n"));
4022
4017
  }
4023
4018
 
4019
+ //#endregion
4020
+ //#region src/commands/deploy.ts
4021
+ const TARGETS = ["vercel", "github"];
4022
+ const FILES = {
4023
+ vercel: { "vercel.json": JSON.stringify({
4024
+ framework: "nextjs",
4025
+ installCommand: "npm install && ./node_modules/.bin/8n eject",
4026
+ buildCommand: "8n build --server"
4027
+ }, null, 2) + "\n" },
4028
+ github: { ".github/workflows/deploy.yml": `name: Deploy to GitHub Pages
4029
+
4030
+ on:
4031
+ push:
4032
+ branches: [main]
4033
+
4034
+ concurrency:
4035
+ group: pages
4036
+ cancel-in-progress: true
4037
+
4038
+ permissions:
4039
+ contents: read
4040
+ pages: write
4041
+ id-token: write
4042
+
4043
+ jobs:
4044
+ deploy:
4045
+ runs-on: ubuntu-latest
4046
+ environment:
4047
+ name: github-pages
4048
+ url: \${{ steps.deployment.outputs.page_url }}
4049
+ steps:
4050
+ - uses: actions/checkout@v4
4051
+ - uses: actions/setup-node@v4
4052
+ with:
4053
+ node-version: 20
4054
+ - run: npm install
4055
+ - run: npx 8n build
4056
+ - uses: actions/upload-pages-artifact@v3
4057
+ with:
4058
+ path: out/
4059
+ - uses: actions/deploy-pages@v4
4060
+ id: deployment
4061
+ ` }
4062
+ };
4063
+ function deploy(target) {
4064
+ if (!TARGETS.includes(target)) {
4065
+ console.log(pc.red(` unknown target: ${target}`) + pc.dim(` available: ${TARGETS.join(", ")}`));
4066
+ process.exit(1);
4067
+ }
4068
+ const files = FILES[target];
4069
+ let created = 0;
4070
+ for (const [rel, content] of Object.entries(files)) {
4071
+ const abs = resolve(process.cwd(), rel);
4072
+ if (existsSync(abs)) {
4073
+ console.log(pc.dim(` skip ${rel}`));
4074
+ continue;
4075
+ }
4076
+ mkdirSync(resolve(abs, ".."), { recursive: true });
4077
+ writeFileSync(abs, content);
4078
+ console.log(pc.green(" create") + pc.dim(` ${rel}`));
4079
+ created++;
4080
+ }
4081
+ if (created === 0) console.log(pc.dim(" already configured"));
4082
+ }
4083
+
4024
4084
  //#endregion
4025
4085
  //#region src/commands/mcp.ts
4026
4086
  async function listMdFiles(dir) {
@@ -4036,7 +4096,7 @@ async function mcp() {
4036
4096
  const mcpDir = join(getStarterDir(), "content", "mcp", "en");
4037
4097
  const server = new McpServer({
4038
4098
  name: "8n",
4039
- version: "6.0.28"
4099
+ version: "6.0.30"
4040
4100
  });
4041
4101
  server.registerTool("read_me", {
4042
4102
  description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
@@ -4177,14 +4237,15 @@ Example: get_component({ name: "components" }) returns all available MDX compone
4177
4237
 
4178
4238
  //#endregion
4179
4239
  //#region src/index.ts
4180
- const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.28").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
4240
+ const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.30").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
4181
4241
  if (cmd.opts().debug) process.env.DEBUG_8N = "1";
4182
4242
  });
4183
4243
  program.command("init").description("Scaffold a new docs project in the current directory").action(init);
4184
4244
  program.command("dev").description("Start the dev server").action(dev);
4185
4245
  program.command("build").description("Build for production").option("--server", "Build for server deployment (SSR) instead of static export").action((opts) => build(opts));
4186
4246
  program.command("start").description("Start the production server").action(start);
4187
- program.command("install").description("Install starter dependencies").action(install);
4247
+ program.command("eject").description("Unpack starter into the project root for CI/Vercel builds").action(eject);
4248
+ program.command("deploy <target>").description("Generate deployment config — targets: vercel, github").action(deploy);
4188
4249
  program.command("mcp").description("Start the MCP server for AI-assisted docs authoring").action(mcp);
4189
4250
  program.parse();
4190
4251
 
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.28"
33
+ "version": "6.0.30"
34
34
  }
@@ -106,5 +106,5 @@
106
106
  "tsx": "^4.21.0",
107
107
  "typescript": "^5.9.3"
108
108
  },
109
- "version": "6.0.28"
109
+ "version": "6.0.30"
110
110
  }