blodemd 0.0.11 → 0.0.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.
Files changed (86) hide show
  1. package/README.md +11 -47
  2. package/dev-server/app/layout.tsx +1 -1
  3. package/dev-server/next.config.js +19 -9
  4. package/dev-server/tsconfig.json +0 -3
  5. package/dist/cli.mjs +732 -123
  6. package/dist/cli.mjs.map +1 -1
  7. package/docs/app/globals.css +15 -1
  8. package/docs/components/api/api-playground.tsx +2 -2
  9. package/docs/components/docs/copy-page-menu.tsx +55 -27
  10. package/docs/components/docs/doc-header.tsx +1 -1
  11. package/docs/components/docs/doc-shell.tsx +89 -88
  12. package/docs/components/docs/doc-sidebar.tsx +6 -3
  13. package/docs/components/docs/doc-toc.tsx +1 -1
  14. package/docs/components/docs/mobile-nav.tsx +8 -16
  15. package/docs/components/docs/sidebar-scroll-area.tsx +58 -0
  16. package/docs/components/git/repo-picker.tsx +526 -0
  17. package/docs/components/mdx/agent-instructions.tsx +17 -0
  18. package/docs/components/mdx/code-block.tsx +6 -1
  19. package/docs/components/mdx/code-group.tsx +1 -1
  20. package/docs/components/mdx/iframe.tsx +62 -0
  21. package/docs/components/mdx/index.tsx +4 -0
  22. package/docs/components/mdx/tabs.tsx +5 -5
  23. package/docs/components/mdx/video.tsx +45 -12
  24. package/docs/components/third-parties.tsx +29 -0
  25. package/docs/components/ui/badge.tsx +61 -0
  26. package/docs/components/ui/breadcrumb.tsx +61 -41
  27. package/docs/components/ui/button-group.tsx +83 -0
  28. package/docs/components/ui/button.tsx +30 -55
  29. package/docs/components/ui/command.tsx +32 -4
  30. package/docs/components/ui/copy-button.tsx +12 -19
  31. package/docs/components/ui/dialog.tsx +50 -1
  32. package/docs/components/ui/input.tsx +16 -97
  33. package/docs/components/ui/kbd.tsx +98 -0
  34. package/docs/components/ui/morph-icon.tsx +79 -0
  35. package/docs/components/ui/popover.tsx +225 -30
  36. package/docs/components/ui/search.tsx +0 -9
  37. package/docs/components/ui/sheet.tsx +30 -1
  38. package/docs/components/ui/sidebar.tsx +332 -7
  39. package/docs/components/ui/site-footer.tsx +6 -4
  40. package/docs/components/ui/skeleton.tsx +11 -0
  41. package/docs/components/ui/switch.tsx +32 -0
  42. package/docs/components/ui/tabs.tsx +138 -0
  43. package/docs/lib/api-client.ts +72 -0
  44. package/docs/lib/contextual-options.ts +9 -0
  45. package/docs/lib/dashboard-session.ts +167 -0
  46. package/docs/lib/db.ts +13 -0
  47. package/docs/lib/env.ts +4 -3
  48. package/docs/lib/etag.ts +22 -0
  49. package/docs/lib/github-install.ts +33 -0
  50. package/docs/lib/project-authz.ts +46 -0
  51. package/docs/lib/routes.ts +5 -1
  52. package/docs/lib/supabase.ts +30 -6
  53. package/docs/lib/tenancy.ts +1 -0
  54. package/docs/lib/tenant-static.ts +206 -4
  55. package/docs/lib/tenants.ts +5 -1
  56. package/docs/lib/time-ago.ts +24 -0
  57. package/docs/lib/use-tab-observer.ts +71 -0
  58. package/package.json +3 -1
  59. package/packages/@repo/common/package.json +2 -2
  60. package/packages/@repo/contracts/dist/git.d.ts +28 -0
  61. package/packages/@repo/contracts/dist/git.d.ts.map +1 -0
  62. package/packages/@repo/contracts/dist/git.js +24 -0
  63. package/packages/@repo/contracts/dist/index.d.ts +1 -1
  64. package/packages/@repo/contracts/dist/index.d.ts.map +1 -1
  65. package/packages/@repo/contracts/dist/index.js +1 -1
  66. package/packages/@repo/contracts/package.json +2 -2
  67. package/packages/@repo/contracts/src/git.ts +31 -0
  68. package/packages/@repo/contracts/src/index.ts +1 -1
  69. package/packages/@repo/models/dist/docs-config.d.ts +6 -0
  70. package/packages/@repo/models/dist/docs-config.d.ts.map +1 -1
  71. package/packages/@repo/models/dist/docs-config.js +1 -0
  72. package/packages/@repo/models/package.json +2 -2
  73. package/packages/@repo/models/src/docs-config.ts +1 -0
  74. package/packages/@repo/prebuild/package.json +2 -2
  75. package/packages/@repo/previewing/dist/index.d.ts +3 -0
  76. package/packages/@repo/previewing/dist/index.d.ts.map +1 -1
  77. package/packages/@repo/previewing/dist/index.js +48 -0
  78. package/packages/@repo/previewing/package.json +2 -2
  79. package/packages/@repo/previewing/src/index.ts +56 -0
  80. package/packages/@repo/validation/package.json +2 -2
  81. package/packages/@repo/validation/src/blodemd-docs-schema.json +1 -0
  82. package/scripts/prepare-package.mjs +14 -0
  83. package/packages/@repo/contracts/dist/api-key.d.ts +0 -30
  84. package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
  85. package/packages/@repo/contracts/dist/api-key.js +0 -20
  86. package/packages/@repo/contracts/src/api-key.ts +0 -27
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  - **One-command deploy:** Push your entire docs folder to Blode.md with `blodemd push`.
10
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
- - **CI-friendly:** Authenticate via environment variables and use the GitHub Action for automated deploys.
12
+ - **Zero keys:** Sign in once with GitHub in your browser — the CLI handles the rest.
13
13
 
14
14
  ## Install
15
15
 
@@ -28,30 +28,16 @@ Requires Node.js 20.17+.
28
28
  ## Quick Start
29
29
 
30
30
  ```bash
31
+ # Sign in with GitHub (opens your browser)
32
+ blodemd login
33
+
31
34
  # Create a new docs site
32
- # Empty directories scaffold in place.
33
- # Non-empty directories get a Mint-style safety prompt.
34
35
  blodemd new
35
36
 
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
47
-
48
37
  # Preview locally
49
38
  blodemd dev
50
39
 
51
- # Authenticate
52
- blodemd login
53
-
54
- # Deploy your docs
40
+ # Deploy
55
41
  blodemd push
56
42
  ```
57
43
 
@@ -59,7 +45,7 @@ blodemd push
59
45
 
60
46
  ```bash
61
47
  blodemd new [directory] Create a new blode.md documentation site
62
- blodemd login Authenticate with your API key
48
+ blodemd login Sign in with GitHub in your browser
63
49
  blodemd logout Remove stored credentials
64
50
  blodemd whoami Show current authentication
65
51
  blodemd validate [dir] Validate docs.json
@@ -72,16 +58,11 @@ blodemd dev [dir] Start the local docs preview server
72
58
  ```
73
59
  --project <slug> Project slug (env: BLODEMD_PROJECT)
74
60
  --api-url <url> API URL (env: BLODEMD_API_URL)
75
- --api-key <token> API key (env: BLODEMD_API_KEY)
76
61
  --branch <name> Git branch (env: BLODEMD_BRANCH)
77
62
  --message <msg> Deploy message (env: BLODEMD_COMMIT_MESSAGE)
78
63
  ```
79
64
 
80
- The CLI reads the project slug from the `name` field in `docs.json` when `--project` is not set.
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.
65
+ The CLI reads the project slug from the `slug` field in `docs.json` when `--project` is not set.
85
66
 
86
67
  ### `dev` Options
87
68
 
@@ -91,16 +72,9 @@ Use `blodemd new --template starter` when you want the full starter layout with
91
72
  --no-open Don't open the browser automatically
92
73
  ```
93
74
 
94
- ## CI / GitHub Actions
75
+ ## Auto-deploy without the CLI
95
76
 
96
- Use the `mblode/blodemd/packages/deploy-action` composite action to deploy on every push:
97
-
98
- ```yaml
99
- - uses: mblode/blodemd/packages/deploy-action@main
100
- with:
101
- api-key: ${{ secrets.BLODEMD_API_KEY }}
102
- directory: docs
103
- ```
77
+ Install the **Blode.md GitHub App** from your project's Git tab in the dashboard. Pushes to your configured branch deploy automatically no CLI, no tokens, no workflows.
104
78
 
105
79
  ## Configuration
106
80
 
@@ -109,23 +83,13 @@ The CLI looks for a `docs.json` file in the docs directory. Minimal example:
109
83
  ```json
110
84
  {
111
85
  "$schema": "https://blode.md/docs.json",
112
- "name": "my-project",
113
- "navigation": {
114
- "groups": [{ "group": "Getting Started", "pages": ["index"] }]
115
- }
86
+ "slug": "my-project",
87
+ "name": "My Project"
116
88
  }
117
89
  ```
118
90
 
119
91
  The CLI searches for `docs.json` in the current directory, then `docs/`, then `apps/docs/`.
120
92
 
121
- ## Programmatic API
122
-
123
- ```typescript
124
- import type { DeploymentResponse } from "blodemd";
125
- ```
126
-
127
- The package exports the `DeploymentResponse` type for use in custom deployment scripts.
128
-
129
93
  ## License
130
94
 
131
95
  This repository is licensed under MIT. Generated docs folders do not include a license file by default.
@@ -29,7 +29,7 @@ export default function RootLayout({
29
29
  className={`${glide.variable} ${GeistMono.variable}`}
30
30
  suppressHydrationWarning
31
31
  >
32
- <body className="relative flex w-full flex-col justify-center overflow-x-hidden scroll-smooth bg-background font-sans antialiased [--header-height:calc(var(--spacing)*14)]">
32
+ <body className="relative flex w-full flex-col justify-center overflow-x-hidden scroll-smooth bg-background font-sans antialiased [--header-height:calc(var(--spacing)*16)]">
33
33
  <DevReloadScript />
34
34
  <Providers>{children}</Providers>
35
35
  </body>
@@ -3,12 +3,29 @@ import { fileURLToPath } from "node:url";
3
3
 
4
4
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
5
  const packagesDir = process.env.BLODEMD_PACKAGES_DIR;
6
+ const isStandalone = Boolean(packagesDir);
6
7
  const turbopackRoot =
7
8
  process.env.BLODEMD_TURBOPACK_ROOT ||
8
- (packagesDir
9
+ (isStandalone
9
10
  ? path.resolve(__dirname, "..")
10
11
  : path.resolve(__dirname, "../.."));
11
12
 
13
+ // In monorepo mode we transpile @repo/* from source so edits to the
14
+ // package src/ files hot-reload. In standalone mode the @repo packages
15
+ // ship pre-built `dist/` via their package.json `exports`; transpiling
16
+ // their `src/` would make Turbopack miss the `.js` → `.ts` resolution
17
+ // for same-package imports, so we let Next consume the compiled output.
18
+ const repoTranspilePackages = isStandalone
19
+ ? []
20
+ : [
21
+ "@repo/common",
22
+ "@repo/contracts",
23
+ "@repo/models",
24
+ "@repo/prebuild",
25
+ "@repo/previewing",
26
+ "@repo/validation",
27
+ ];
28
+
12
29
  /** @type {import('next').NextConfig} */
13
30
  const nextConfig = {
14
31
  allowedDevOrigins: ["127.0.0.1"],
@@ -26,14 +43,7 @@ const nextConfig = {
26
43
  images: {
27
44
  unoptimized: true,
28
45
  },
29
- transpilePackages: [
30
- "@repo/common",
31
- "@repo/contracts",
32
- "@repo/models",
33
- "@repo/prebuild",
34
- "@repo/previewing",
35
- "@repo/validation",
36
- ],
46
+ transpilePackages: repoTranspilePackages,
37
47
  turbopack: {
38
48
  // The dev server consumes sibling docs/ and workspace packages/
39
49
  // directories, so Turbopack needs a root that includes them.
@@ -23,9 +23,6 @@
23
23
  ],
24
24
  "@dev/*": [
25
25
  "./*"
26
- ],
27
- "@repo/*": [
28
- "../packages/@repo/*/src/index.ts"
29
26
  ]
30
27
  },
31
28
  "plugins": [