@ahmedrowaihi/8n 0.5.6 → 0.5.7

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.
Files changed (2) hide show
  1. package/dist/index.mjs +14 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { builtinModules, createRequire } from "node:module";
3
3
  import { spawn } from "node:child_process";
4
4
  import path, { delimiter, dirname, join, normalize, resolve } from "node:path";
5
- import fs, { appendFileSync, existsSync, mkdirSync, promises, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
5
+ import fs, { appendFileSync, cpSync, existsSync, mkdirSync, promises, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
6
6
  import process$1, { cwd } from "node:process";
7
7
  import { PassThrough } from "node:stream";
8
8
  import c from "node:readline";
@@ -15146,7 +15146,7 @@ async function checkSelfUpdate() {
15146
15146
  });
15147
15147
  if (!res.ok) return;
15148
15148
  const { version: latest } = await res.json();
15149
- const current = "0.5.6";
15149
+ const current = "0.5.7";
15150
15150
  if (latest !== current) console.log(import_picocolors.default.yellow("⚠") + import_picocolors.default.dim(` new CLI version available: `) + import_picocolors.default.cyan(latest) + import_picocolors.default.dim(` (current: ${current}) — run `) + import_picocolors.default.cyan("npm i -g @ahmedrowaihi/8n") + import_picocolors.default.dim(" to update"));
15151
15151
  } catch {}
15152
15152
  }
@@ -15293,12 +15293,22 @@ async function build() {
15293
15293
  stdio: "inherit",
15294
15294
  env: buildEnv(config, contentDir)
15295
15295
  } });
15296
+ const src = join(sudocsDir, ".next");
15296
15297
  const outDir = join(process.cwd(), ".8n");
15297
15298
  if (existsSync(outDir)) rmSync(outDir, {
15298
15299
  recursive: true,
15299
15300
  force: true
15300
15301
  });
15301
- renameSync(join(sudocsDir, ".next"), outDir);
15302
+ try {
15303
+ renameSync(src, outDir);
15304
+ } catch (err) {
15305
+ if (err.code !== "EXDEV") throw err;
15306
+ cpSync(src, outDir, { recursive: true });
15307
+ rmSync(src, {
15308
+ recursive: true,
15309
+ force: true
15310
+ });
15311
+ }
15302
15312
  console.log(import_picocolors.default.green("✓") + import_picocolors.default.dim(` build complete → ${outDir}`));
15303
15313
  }
15304
15314
 
@@ -15439,7 +15449,7 @@ async function init() {
15439
15449
 
15440
15450
  //#endregion
15441
15451
  //#region src/index.ts
15442
- const program = new Command().name("8n").description("Run your Thmanyah docs site").version("0.5.6").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
15452
+ const program = new Command().name("8n").description("Run your Thmanyah docs site").version("0.5.7").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
15443
15453
  if (cmd.opts().debug) process.env.DEBUG_8N = "1";
15444
15454
  });
15445
15455
  program.command("init").description("Scaffold a new docs project in the current directory").action(init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedrowaihi/8n",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Thmanyah Docs — run your docs site from your content directory",
5
5
  "type": "module",
6
6
  "bin": {