@ahmedrowaihi/8n 0.5.11 → 0.5.13
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 +10 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15073,7 +15073,7 @@ const configSchema = objectType({
|
|
|
15073
15073
|
//#region src/load-config.ts
|
|
15074
15074
|
async function resolveConfig() {
|
|
15075
15075
|
const { config } = await loadConfig({
|
|
15076
|
-
name: "
|
|
15076
|
+
name: "8n",
|
|
15077
15077
|
defaults: configSchema.parse({})
|
|
15078
15078
|
});
|
|
15079
15079
|
return configSchema.parse(config);
|
|
@@ -15147,7 +15147,7 @@ async function checkSelfUpdate() {
|
|
|
15147
15147
|
});
|
|
15148
15148
|
if (!res.ok) return;
|
|
15149
15149
|
const { version: latest } = await res.json();
|
|
15150
|
-
const current = "0.5.
|
|
15150
|
+
const current = "0.5.13";
|
|
15151
15151
|
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"));
|
|
15152
15152
|
} catch {}
|
|
15153
15153
|
}
|
|
@@ -15224,16 +15224,20 @@ function getSudocsBin(sudocsDir, name) {
|
|
|
15224
15224
|
return join(sudocsDir, "node_modules", ".bin", name);
|
|
15225
15225
|
}
|
|
15226
15226
|
function buildEnv(config, contentDir) {
|
|
15227
|
+
const ghRepo = process.env.GITHUB_REPOSITORY;
|
|
15228
|
+
const ghServer = process.env.GITHUB_SERVER_URL ?? "https://github.com";
|
|
15229
|
+
const ghPagesUrl = ghRepo ? `${ghServer}/${ghRepo}` : void 0;
|
|
15230
|
+
const ghPagesBasePath = ghRepo ? `/${ghRepo.split("/")[1]}` : void 0;
|
|
15227
15231
|
return {
|
|
15228
15232
|
...process.env,
|
|
15229
15233
|
CONTENT_DIR: contentDir,
|
|
15230
15234
|
LOCALES: (config.locales ?? ["en"]).join(","),
|
|
15231
15235
|
NEXT_PUBLIC_SITE_NAME: config.siteName ?? "Docs",
|
|
15232
|
-
NEXT_PUBLIC_GITHUB_REPO: config.github?.repo,
|
|
15236
|
+
NEXT_PUBLIC_GITHUB_REPO: config.github?.repo ?? ghPagesUrl,
|
|
15233
15237
|
SECTIONS: JSON.stringify(config.sections ?? {}),
|
|
15234
15238
|
NEXT_PUBLIC_NAV_LINKS: JSON.stringify(config.nav?.links ?? []),
|
|
15235
15239
|
NEXT_PUBLIC_ANIMATIONS: config.animations === false ? "false" : "true",
|
|
15236
|
-
NEXT_BASE_PATH: config.basePath ?? ""
|
|
15240
|
+
NEXT_BASE_PATH: config.basePath ?? ghPagesBasePath ?? ""
|
|
15237
15241
|
};
|
|
15238
15242
|
}
|
|
15239
15243
|
|
|
@@ -15331,7 +15335,7 @@ async function start() {
|
|
|
15331
15335
|
//#endregion
|
|
15332
15336
|
//#region src/commands/init.ts
|
|
15333
15337
|
const SCAFFOLD = {
|
|
15334
|
-
["
|
|
15338
|
+
["8n.config.ts"]: `export default {
|
|
15335
15339
|
content: "./content",
|
|
15336
15340
|
locales: ["en"],
|
|
15337
15341
|
siteName: "Docs",
|
|
@@ -15451,7 +15455,7 @@ async function init() {
|
|
|
15451
15455
|
|
|
15452
15456
|
//#endregion
|
|
15453
15457
|
//#region src/index.ts
|
|
15454
|
-
const program = new Command().name("8n").description("Run your Thmanyah docs site").version("0.5.
|
|
15458
|
+
const program = new Command().name("8n").description("Run your Thmanyah docs site").version("0.5.13").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
|
|
15455
15459
|
if (cmd.opts().debug) process.env.DEBUG_8N = "1";
|
|
15456
15460
|
});
|
|
15457
15461
|
program.command("init").description("Scaffold a new docs project in the current directory").action(init);
|