blodemd 0.0.8 → 0.0.9

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 (61) hide show
  1. package/README.md +25 -9
  2. package/dev-server/app/[[...slug]]/page.tsx +1 -0
  3. package/dev-server/next.config.js +11 -13
  4. package/dev-server/package.json +1 -1
  5. package/dev-server/tsconfig.json +3 -0
  6. package/dist/cli.mjs +869 -184
  7. package/dist/cli.mjs.map +1 -1
  8. package/docs/components/api/api-playground.tsx +255 -80
  9. package/docs/components/api/api-reference.tsx +11 -1
  10. package/docs/components/docs/contextual-menu.tsx +227 -142
  11. package/docs/components/docs/copy-page-menu.tsx +132 -85
  12. package/docs/components/docs/doc-header.tsx +13 -3
  13. package/docs/components/docs/doc-shell.tsx +22 -11
  14. package/docs/components/docs/mobile-nav.tsx +0 -6
  15. package/docs/components/mdx/code-group.tsx +171 -62
  16. package/docs/components/mdx/tabs.tsx +131 -26
  17. package/docs/components/ui/input.tsx +0 -1
  18. package/docs/components/ui/search.tsx +241 -132
  19. package/docs/lib/content-root.ts +33 -0
  20. package/docs/lib/content-source.ts +70 -0
  21. package/docs/lib/contextual-options.ts +20 -0
  22. package/docs/lib/docs-runtime.tsx +595 -0
  23. package/docs/lib/edge-config.ts +95 -0
  24. package/docs/lib/env.ts +22 -0
  25. package/docs/lib/openapi-proxy.ts +88 -0
  26. package/docs/lib/platform-config.ts +6 -0
  27. package/docs/lib/routes.ts +39 -0
  28. package/docs/lib/supabase.ts +13 -0
  29. package/docs/lib/tenancy.ts +322 -0
  30. package/docs/lib/tenant-headers.ts +14 -0
  31. package/docs/lib/tenant-static.ts +529 -0
  32. package/docs/lib/tenant-utility-context.ts +62 -0
  33. package/docs/lib/tenants.ts +68 -0
  34. package/docs/lib/use-mobile.ts +19 -0
  35. package/package.json +3 -2
  36. package/packages/@repo/common/dist/index.d.ts +7 -0
  37. package/packages/@repo/common/dist/index.d.ts.map +1 -1
  38. package/packages/@repo/common/dist/index.js +42 -0
  39. package/packages/@repo/common/src/index.ts +50 -0
  40. package/packages/@repo/contracts/dist/project.d.ts +1 -1
  41. package/packages/@repo/contracts/dist/project.js +1 -1
  42. package/packages/@repo/contracts/src/project.ts +1 -1
  43. package/packages/@repo/models/dist/docs-config.d.ts +194 -29
  44. package/packages/@repo/models/dist/docs-config.d.ts.map +1 -1
  45. package/packages/@repo/models/dist/docs-config.js +3 -28
  46. package/packages/@repo/models/src/docs-config.ts +5 -31
  47. package/packages/@repo/previewing/dist/blob-source.d.ts.map +1 -1
  48. package/packages/@repo/previewing/dist/blob-source.js +7 -2
  49. package/packages/@repo/previewing/dist/fs-source.d.ts.map +1 -1
  50. package/packages/@repo/previewing/dist/fs-source.js +2 -3
  51. package/packages/@repo/previewing/dist/index.d.ts.map +1 -1
  52. package/packages/@repo/previewing/dist/index.js +1 -41
  53. package/packages/@repo/previewing/src/blob-source.ts +7 -4
  54. package/packages/@repo/previewing/src/fs-source.ts +2 -3
  55. package/packages/@repo/previewing/src/index.ts +3 -55
  56. package/packages/@repo/validation/dist/index.d.ts +2 -2
  57. package/packages/@repo/validation/dist/index.d.ts.map +1 -1
  58. package/packages/@repo/validation/dist/index.js +2 -2
  59. package/packages/@repo/validation/package.json +1 -0
  60. package/packages/@repo/validation/src/{mintlify-docs-schema.json → blodemd-docs-schema.json} +346 -1794
  61. package/packages/@repo/validation/src/index.ts +4 -4
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  </p>
8
8
 
9
9
  - **One-command deploy:** Push your entire docs folder to Blode.md with `blodemd push`.
10
- - **Scaffold in seconds:** Generate a ready-to-edit docs folder with `blodemd init`.
10
+ - **Scaffold in seconds:** Generate a ready-to-edit docs folder with `blodemd new`.
11
11
  - **Config validation:** Catch `docs.json` errors before deploying.
12
12
  - **CI-friendly:** Authenticate via environment variables and use the GitHub Action for automated deploys.
13
13
 
@@ -23,13 +23,27 @@ Or run without installing:
23
23
  npx blodemd
24
24
  ```
25
25
 
26
- Requires Node.js 20.17+ and <25.
26
+ Requires Node.js 20.17+.
27
27
 
28
28
  ## Quick Start
29
29
 
30
30
  ```bash
31
- # Scaffold a new docs folder
32
- blodemd init
31
+ # Create a new docs site
32
+ # Empty directories scaffold in place.
33
+ # Non-empty directories get a Mint-style safety prompt.
34
+ blodemd new
35
+
36
+ # Skip prompts and use defaults
37
+ blodemd new --yes
38
+
39
+ # Scaffold the current directory explicitly
40
+ blodemd new .
41
+
42
+ # Set the project slug explicitly
43
+ blodemd new --name acme-docs
44
+
45
+ # Create the richer starter template
46
+ blodemd new --template starter
33
47
 
34
48
  # Preview locally
35
49
  blodemd dev
@@ -44,7 +58,7 @@ blodemd push
44
58
  ## Commands
45
59
 
46
60
  ```bash
47
- blodemd init [dir] Scaffold a docs folder (default: docs)
61
+ blodemd new [directory] Create a new blode.md documentation site
48
62
  blodemd login Authenticate with your API key
49
63
  blodemd logout Remove stored credentials
50
64
  blodemd whoami Show current authentication
@@ -65,6 +79,10 @@ blodemd dev [dir] Start the local docs preview server
65
79
 
66
80
  The CLI reads the project slug from the `name` field in `docs.json` when `--project` is not set.
67
81
 
82
+ Interactive `blodemd new` inspects the current directory first. In an empty directory it scaffolds there and prompts for the project slug. In a non-empty directory it offers a Mint-style choice between creating a `docs/` subdirectory and scaffolding the current directory. Non-interactive runs fall back to `docs/`, and `--yes` accepts those defaults without prompting.
83
+
84
+ Use `blodemd new --template starter` when you want the full starter layout with a repo README, `.gitignore`, `CLAUDE.md`, `AGENTS.md` as a symlink or pointer, SVG branding assets, and example content. The default `blodemd new` scaffold stays minimal and only writes `docs.json` plus `index.mdx`. The command stops with an error if the target directory already contains scaffolded files.
85
+
68
86
  ### `dev` Options
69
87
 
70
88
  ```bash
@@ -90,10 +108,8 @@ The CLI looks for a `docs.json` file in the docs directory. Minimal example:
90
108
 
91
109
  ```json
92
110
  {
93
- "$schema": "https://docs.blode.md/docs.json",
111
+ "$schema": "https://blode.md/docs.json",
94
112
  "name": "my-project",
95
- "theme": "mint",
96
- "colors": { "primary": "#0D9373" },
97
113
  "navigation": {
98
114
  "groups": [{ "group": "Getting Started", "pages": ["index"] }]
99
115
  }
@@ -112,4 +128,4 @@ The package exports the `DeploymentResponse` type for use in custom deployment s
112
128
 
113
129
  ## License
114
130
 
115
- [MIT](../../LICENSE)
131
+ This repository is licensed under MIT. Generated docs folders do not include a license file by default.
@@ -98,6 +98,7 @@ const PreviewPage = async ({
98
98
  <ApiReference
99
99
  entry={shell.openApiEntry}
100
100
  proxyEnabled={shell.openapiProxyEnabled}
101
+ proxyPath="/blodemd-internal/proxy"
101
102
  />
102
103
  );
103
104
  rawContent = shell.openApiEntry.operation.description ?? "";
@@ -1,8 +1,13 @@
1
1
  import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
2
3
 
3
- // When running in standalone mode (npm-installed CLI), the CLI sets this
4
- // to the directory containing shipped @repo packages.
4
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
5
  const packagesDir = process.env.BLODEMD_PACKAGES_DIR;
6
+ const turbopackRoot =
7
+ process.env.BLODEMD_TURBOPACK_ROOT ||
8
+ (packagesDir
9
+ ? path.resolve(__dirname, "..")
10
+ : path.resolve(__dirname, "../.."));
6
11
 
7
12
  /** @type {import('next').NextConfig} */
8
13
  const nextConfig = {
@@ -29,17 +34,10 @@ const nextConfig = {
29
34
  "@repo/previewing",
30
35
  "@repo/validation",
31
36
  ],
32
- webpack: (config) => {
33
- if (packagesDir) {
34
- // In standalone mode, @repo packages live in the CLI's packages/ dir.
35
- // Add it as a module resolution root so webpack (and transpilePackages)
36
- // can resolve @repo/common from packages/@repo/common/.
37
- config.resolve.modules = [
38
- path.resolve(packagesDir),
39
- ...(config.resolve.modules || []),
40
- ];
41
- }
42
- return config;
37
+ turbopack: {
38
+ // The dev server consumes sibling docs/ and workspace packages/
39
+ // directories, so Turbopack needs a root that includes them.
40
+ root: turbopackRoot,
43
41
  },
44
42
  };
45
43
 
@@ -4,7 +4,7 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "next dev --webpack",
7
+ "dev": "next dev --turbopack",
8
8
  "build": "next build",
9
9
  "start": "next start",
10
10
  "lint": "oxlint .",
@@ -23,6 +23,9 @@
23
23
  ],
24
24
  "@dev/*": [
25
25
  "./*"
26
+ ],
27
+ "@repo/*": [
28
+ "../packages/@repo/*/src/index.ts"
26
29
  ]
27
30
  },
28
31
  "plugins": [