@ahmedrowaihi/8n 0.3.0 → 0.4.1

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 +48 -11
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -15070,10 +15070,7 @@ const pipelineType = ZodPipeline.create;
15070
15070
  const configSchema = objectType({
15071
15071
  content: stringType().default("./content"),
15072
15072
  locales: arrayType(stringType()).min(1).default(["en"]),
15073
- github: objectType({
15074
- repo: stringType(),
15075
- branch: stringType().default("main")
15076
- }).optional(),
15073
+ github: objectType({ repo: stringType() }).optional(),
15077
15074
  siteName: stringType().optional(),
15078
15075
  version: stringType().optional(),
15079
15076
  sections: recordType(unionType([literalType(false), objectType({
@@ -15084,7 +15081,8 @@ const configSchema = objectType({
15084
15081
  nav: objectType({ links: arrayType(objectType({
15085
15082
  text: stringType(),
15086
15083
  url: stringType()
15087
- })).default([]) }).default({})
15084
+ })).default([]) }).default({}),
15085
+ animations: booleanType().default(true)
15088
15086
  });
15089
15087
 
15090
15088
  //#endregion
@@ -37053,9 +37051,10 @@ function buildEnv(config, contentDir) {
37053
37051
  CONTENT_DIR: contentDir,
37054
37052
  LOCALES: (config.locales ?? ["en"]).join(","),
37055
37053
  NEXT_PUBLIC_SITE_NAME: config.siteName ?? "Docs",
37056
- GITHUB_REPO: config.github?.repo,
37054
+ NEXT_PUBLIC_GITHUB_REPO: config.github?.repo,
37057
37055
  SECTIONS: JSON.stringify(config.sections ?? {}),
37058
- NAV_LINKS: JSON.stringify(config.nav?.links ?? [])
37056
+ NEXT_PUBLIC_NAV_LINKS: JSON.stringify(config.nav?.links ?? []),
37057
+ NEXT_PUBLIC_ANIMATIONS: config.animations === false ? "false" : "true"
37059
37058
  };
37060
37059
  }
37061
37060
 
@@ -37066,10 +37065,35 @@ async function dev() {
37066
37065
  const contentDir = resolve(process.cwd(), config.content ?? "./content");
37067
37066
  const fallbackDir = resolve(process.cwd(), ".sudocs");
37068
37067
  console.log(import_picocolors.default.cyan("8n") + import_picocolors.default.dim(` dev → ${contentDir}`));
37069
- if (!process.env.SUDOCS_LOCAL) console.log(import_picocolors.default.dim(" checking for updates..."));
37070
- const { updated, hash, dir: sudocsDir } = await prepareSudocs(fallbackDir, { version: config.version });
37071
- if (updated) console.log(import_picocolors.default.green("") + import_picocolors.default.dim(` starter updated to ${hash.slice(0, 7)}`));
37072
- if (process.env.SUDOCS_LOCAL) console.log(import_picocolors.default.yellow("") + import_picocolors.default.dim(` using local starter → ${sudocsDir}`));
37068
+ if (process.env.SUDOCS_LOCAL) {
37069
+ const { dir: sudocsDir } = await prepareSudocs(fallbackDir, { version: config.version });
37070
+ console.log(import_picocolors.default.yellow("") + import_picocolors.default.dim(` using local starter ${sudocsDir}`));
37071
+ await R$1(getSudocsBin(sudocsDir, "next"), ["dev"], { nodeOptions: {
37072
+ cwd: sudocsDir,
37073
+ stdio: "inherit",
37074
+ env: buildEnv(config, contentDir)
37075
+ } });
37076
+ return;
37077
+ }
37078
+ console.log(import_picocolors.default.dim(" checking for updates..."));
37079
+ let sudocsDir;
37080
+ try {
37081
+ const result = await prepareSudocs(fallbackDir, { version: config.version });
37082
+ sudocsDir = result.dir;
37083
+ const short = result.hash === "local" ? "local" : result.hash.slice(0, 7);
37084
+ if (result.updated) console.log(import_picocolors.default.green("✓") + ` starter updated to ${import_picocolors.default.cyan(short)}`);
37085
+ else console.log(import_picocolors.default.green("✓") + import_picocolors.default.dim(` already on latest (${short})`));
37086
+ } catch (err) {
37087
+ if (existsSync(fallbackDir)) {
37088
+ console.log(import_picocolors.default.yellow("⚠") + import_picocolors.default.dim(" update check failed — using cached starter"));
37089
+ console.log(import_picocolors.default.dim(` ${err.message}`));
37090
+ sudocsDir = fallbackDir;
37091
+ } else {
37092
+ console.error(import_picocolors.default.red("✗") + " failed to download starter and no cache found");
37093
+ console.error(import_picocolors.default.dim(` ${err.message}`));
37094
+ process.exit(1);
37095
+ }
37096
+ }
37073
37097
  await R$1(getSudocsBin(sudocsDir, "next"), ["dev"], { nodeOptions: {
37074
37098
  cwd: sudocsDir,
37075
37099
  stdio: "inherit",
@@ -37159,6 +37183,19 @@ description: How to install and set up the project.
37159
37183
  ## Installation
37160
37184
 
37161
37185
  Add your installation steps here.
37186
+ `,
37187
+ ["content/home/en/index.mdx"]: `---
37188
+ title: Home
37189
+ ---
37190
+
37191
+ <div className="flex flex-col items-center justify-center text-center flex-1 gap-6 px-6 py-24">
37192
+ <h1 className="text-4xl sm:text-5xl md:text-6xl font-bold leading-tight tracking-tight max-w-2xl">
37193
+ Welcome to your docs.
37194
+ </h1>
37195
+ <p className="text-muted-foreground text-lg max-w-md leading-relaxed">
37196
+ Edit \`content/home/en/index.mdx\` to customize this page.
37197
+ </p>
37198
+ </div>
37162
37199
  `,
37163
37200
  ["content/changelog/en/meta.json"]: JSON.stringify({ title: "Changelog" }, null, 2) + "\n",
37164
37201
  ["content/changelog/en/v1.0.0.mdx"]: `---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedrowaihi/8n",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Thmanyah Docs — run your docs site from your content directory",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,7 +24,7 @@
24
24
  "picocolors": "^1.1.0",
25
25
  "tinyexec": "^1.0.0",
26
26
  "tsdown": "^0.20.0",
27
- "@ahmedrowaihi/8n-core": "0.1.0"
27
+ "@ahmedrowaihi/8n-core": "0.2.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tsdown",