Repository navigation
chore(cli): carry sidebar category and title as a command annotation (CLI-2686) #7723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mdonnalley
wants to merge
5
commits into
develop
Choose a base branch
from
mdonnalley/2686
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
817a8f2
chore(cli): carry sidebar category and title as a command annotation
mdonnalley 3967ed8
chore(cli): address sidebar review findings
mdonnalley 8faae2d
Merge branch 'develop' into mdonnalley/2686
mdonnalley 74bed0a
Merge branch 'develop' into mdonnalley/2686
mdonnalley a53bcae
Merge branch 'develop' into mdonnalley/2686
mdonnalley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /** | ||
| * Emits the docs-site CLI sidebar (`common-cli-sections.json`) from the Effect command tree. Run as | ||
| * `bun scripts/generate-docs-sidebar.ts > common-cli-sections.json`. | ||
| */ | ||
| import { BunRuntime } from "@effect/platform-bun"; | ||
| import { Console, Effect } from "effect"; | ||
| import { rootCommand } from "../src/cli/root.ts"; | ||
| import { buildDocsSidebar, stringifyDocsSidebar } from "../src/docs/docs-sidebar.ts"; | ||
|
|
||
| BunRuntime.runMain( | ||
| Effect.try(() => stringifyDocsSidebar(buildDocsSidebar(rootCommand))).pipe( | ||
| Effect.flatMap(Console.log), | ||
| ), | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { Context, Option } from "effect"; | ||
| import { Command } from "effect/cli"; | ||
| /** Sidebar sections in display order; top-level commands pick one with `withSidebar`. */ | ||
| export const DOCS_SIDEBAR_CATEGORIES = [ | ||
| { id: "general", title: "General" }, | ||
| { id: "testing", title: "Testing" }, | ||
| { id: "generate-types", title: "Generate Types" }, | ||
| { id: "database", title: "Database" }, | ||
| { id: "migrations", title: "Migrations" }, | ||
| { id: "seed", title: "Seed" }, | ||
| { id: "inspect", title: "Inspect" }, | ||
| { id: "logs", title: "Logs" }, | ||
| { id: "organizations", title: "Organizations" }, | ||
| { id: "projects", title: "Projects" }, | ||
| { id: "config", title: "Config" }, | ||
| { id: "branches", title: "Branches" }, | ||
| { id: "backups", title: "Backups" }, | ||
| { id: "edge-functions", title: "Edge Functions" }, | ||
| { id: "secrets", title: "Secrets" }, | ||
| { id: "storage", title: "Storage" }, | ||
| { id: "authentication", title: "Authentication" }, | ||
| { id: "custom-domains", title: "Custom Domains" }, | ||
| { id: "vanity-subdomains", title: "Vanity Subdomains" }, | ||
| { id: "encryption", title: "Encryption" }, | ||
| { id: "network-bans", title: "Network Bans" }, | ||
| { id: "network-restrictions", title: "Network Restrictions" }, | ||
| { id: "ssl-enforcement", title: "SSL Enforcement" }, | ||
| { id: "postgres-config", title: "Postgres Config" }, | ||
| { id: "sql-snippets", title: "SQL Snippets" }, | ||
| { id: "notebooks", title: "Notebooks" }, | ||
| { id: "services", title: "Services" }, | ||
| { id: "autocompletion-scripts", title: "Autocompletion Scripts" }, | ||
| { id: "telemetry", title: "Telemetry" }, | ||
| { id: "feedback", title: "Feedback" }, | ||
| ] as const; | ||
|
|
||
| export type DocsSidebarCategory = (typeof DOCS_SIDEBAR_CATEGORIES)[number]["id"]; | ||
|
|
||
| /** | ||
| * Docs-site sidebar placement. Top-level commands declare a category, which their subcommands | ||
| * inherit; any command may override its sidebar title, which defaults to its short description. | ||
| */ | ||
| export type CommandSidebar = | ||
| | { readonly category: DocsSidebarCategory; readonly title?: string } | ||
| | { readonly title: string; readonly category?: never }; | ||
|
|
||
| export class CommandSidebarAnnotation extends Context.Service< | ||
| CommandSidebarAnnotation, | ||
| CommandSidebar | ||
| >()("supabase/CommandSidebarAnnotation") {} | ||
|
|
||
| export const withSidebar = (sidebar: CommandSidebar) => | ||
| Command.annotate(CommandSidebarAnnotation, sidebar); | ||
|
|
||
| export const readSidebar = (command: Command.Command.Any): Option.Option<CommandSidebar> => | ||
| Context.getOption(command.annotations, CommandSidebarAnnotation); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.