Skip to content

Commit 416a719

Browse files
authored
Implement shadcn registry and improve UI (#20)
* chore: update dependencies and improve tool editor UI - Updated @tanstack/react-form to version 1.13.2 and other related packages to 1.125.3 in package.json. - Renamed "shuffleDNS" to "shuffledns" in shuffledns.json for consistency. - Enhanced styling in HelpMenu and JsonOutput components for better UI experience. - Added FloatingToolNames component to display floating tool names with animations in the main route. - Removed default SSR setting in router configuration for improved performance. - Simplified tool name display logic in tool index route. - Cleaned up unused imports and improved code readability across various components. * Refactor for shadcn registry * Move files for registry * Move files * Fix tags * Fix formatting
1 parent 8c33749 commit 416a719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1962
-626
lines changed

bun.lock

Lines changed: 267 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mcp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
33
import { z } from "zod";
44
import { readFileSync, readdirSync } from "fs";
55
import { join } from "path";
6-
import { type Tool } from "src/lib/types/tool-editor";
6+
import { type Tool } from "@/registry/commandly/lib/types/commandly";
77

88
const server = new McpServer({
99
name: "commandly",

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
"start": "bun run ./.output/server/index.mjs",
1111
"build": "vite build",
1212
"lint": "oxlint",
13+
"format": "prettier --write .",
1314
"test": "vitest run --config ./vitest.config.ts",
1415
"test:watch": "vitest --config ./vitest.config.ts",
1516
"test:ui": "vitest --ui",
1617
"coverage": "vitest run --coverage",
17-
"build:specification": "bun run ./specification/generate.ts",
18+
"specification:build": "bun run ./scripts/generate-specification.ts",
19+
"registry:build": "shadcn build",
1820
"mcp": "bun run mcp/index.ts"
1921
},
2022
"dependencies": {
@@ -27,13 +29,13 @@
2729
"@radix-ui/react-slot": "^1.2.3",
2830
"@tailwindcss/postcss": "^4.1.11",
2931
"@tailwindcss/vite": "^4.1.11",
30-
"@tanstack/react-form": "^1.12.4",
32+
"@tanstack/react-form": "^1.13.2",
3133
"@tanstack/react-pacer": "^0.8.0",
3234
"@tanstack/react-query": "^5.81.5",
33-
"@tanstack/react-router": "^1.124.0",
34-
"@tanstack/react-router-with-query": "^1.124.0",
35-
"@tanstack/react-start": "^1.124.1",
36-
"@tanstack/zod-adapter": "^1.124.0",
35+
"@tanstack/react-router": "^1.125.3",
36+
"@tanstack/react-router-with-query": "^1.125.3",
37+
"@tanstack/react-start": "^1.125.3",
38+
"@tanstack/zod-adapter": "^1.125.3",
3739
"ai": "^4.3.16",
3840
"class-variance-authority": "^0.7.1",
3941
"clsx": "^2.1.1",
@@ -50,12 +52,12 @@
5052
"tailwindcss-animate": "^1.0.7",
5153
"uuid": "^11.1.0",
5254
"vite": "^6.3.5",
53-
"zod": "^3.25.73"
55+
"zod": "^3.25.74"
5456
},
5557
"devDependencies": {
5658
"@tanstack/react-query-devtools": "^5.81.5",
57-
"@tanstack/react-router-devtools": "^1.124.0",
58-
"@tanstack/router-plugin": "^1.124.0",
59+
"@tanstack/react-router-devtools": "^1.125.3",
60+
"@tanstack/router-plugin": "^1.125.3",
5961
"@testing-library/jest-dom": "^6.6.3",
6062
"@testing-library/react": "^16.3.0",
6163
"@testing-library/user-event": "^14.6.1",
@@ -67,6 +69,7 @@
6769
"@vitest/coverage-v8": "3.2.4",
6870
"jsdom": "^26.1.0",
6971
"oxlint": "^1.5.0",
72+
"shadcn": "^2.8.0-canary.1",
7073
"typescript": "^5.8.3",
7174
"vite-tsconfig-paths": "^5.1.4",
7275
"vitest": "^3.2.4"

public/r/all.json

Lines changed: 132 additions & 0 deletions
Large diffs are not rendered by default.

public/r/commandly-types.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
3+
"name": "commandly-types",
4+
"type": "registry:lib",
5+
"title": "Commandly Types",
6+
"description": "TypeScript type definitions for the Commandly tool editor system including schemas for tools, commands, and parameters.",
7+
"dependencies": ["zod"],
8+
"files": [
9+
{
10+
"path": "registry/commandly/lib/types/commandly.ts",
11+
"content": "import { z } from \"zod/v4\";\n\nexport const CommandSchema = z.object({\n id: z.uuidv7(),\n parentCommandId: z.uuidv7().optional(),\n name: z.string(),\n description: z.string(),\n isDefault: z.boolean(),\n sortOrder: z.number()\n});\nexport type Command = z.infer<typeof CommandSchema>;\n\nexport const ParameterEnumValueSchema = z.object({\n id: z.uuidv7(),\n parameterId: z.uuidv7(),\n value: z.string(),\n displayName: z.string(),\n description: z.string(),\n isDefault: z.boolean(),\n sortOrder: z.number()\n});\nexport type ParameterEnumValue = z.infer<typeof ParameterEnumValueSchema>;\n\nexport const ParameterValidationTypeSchema = z.enum([\n \"min_length\",\n \"max_length\",\n \"min_value\",\n \"max_value\",\n \"regex\"\n]);\nexport type ParameterValidationType = z.infer<\n typeof ParameterValidationTypeSchema\n>;\n\nexport const ParameterValidationSchema = z.object({\n id: z.string(),\n parameterId: z.string(),\n validationType: ParameterValidationTypeSchema,\n validationValue: z.string(),\n errorMessage: z.string()\n});\nexport type ParameterValidation = z.infer<typeof ParameterValidationSchema>;\nexport const ParameterDependencyTypeSchema = z.enum([\n \"requires\",\n \"conflicts_with\"\n]);\nexport type ParameterDependencyType = z.infer<\n typeof ParameterDependencyTypeSchema\n>;\nexport const ParameterDependencySchema = z.object({\n id: z.string(),\n parameterId: z.string(),\n dependsOnParameterId: z.string(),\n dependencyType: ParameterDependencyTypeSchema,\n conditionValue: z.string().optional()\n});\n\nexport type ParameterValue = string | number | boolean;\n\nexport type ParameterDependency = z.infer<typeof ParameterDependencySchema>;\n\nexport const ParameterMetadataSchema = z.object({\n tags: z.array(z.string()).optional()\n});\nexport type ParameterMetadata = z.infer<typeof ParameterMetadataSchema>;\nexport const ParameterTypeSchema = z.enum([\"Flag\", \"Option\", \"Argument\"]);\nexport type ParameterType = z.infer<typeof ParameterTypeSchema>;\n\nexport const ParameterDataTypeSchema = z.enum([\n \"String\",\n \"Number\",\n \"Boolean\",\n \"Enum\"\n]);\nexport type ParameterDataType = z.infer<typeof ParameterDataTypeSchema>;\n\nexport const ParameterSchema = z.object({\n id: z.string(),\n name: z.string(),\n commandId: z.uuidv7().optional(),\n description: z.string(),\n metadata: ParameterMetadataSchema.optional(),\n parameterType: ParameterTypeSchema,\n dataType: ParameterDataTypeSchema,\n isRequired: z.boolean(),\n isRepeatable: z.boolean(),\n isGlobal: z.boolean(),\n defaultValue: z.string().optional(),\n shortFlag: z.string().optional(),\n longFlag: z.string(),\n position: z.number().optional(),\n sortOrder: z.number().optional(),\n arraySeparator: z.string().optional(),\n keyValueSeparator: z.string().optional(),\n enumValues: z.array(ParameterEnumValueSchema),\n validations: z.array(ParameterValidationSchema).optional(),\n dependencies: z.array(ParameterDependencySchema).optional()\n});\nexport type Parameter = z.infer<typeof ParameterSchema>;\n\nexport const ExclusionTypeSchema = z.enum([\n \"mutual_exclusive\",\n \"required_one_of\"\n]);\nexport type ExclusionType = z.infer<typeof ExclusionTypeSchema>;\n\nexport const ExclusionGroupSchema = z.object({\n id: z.string().optional(),\n commandId: z.string().optional(),\n name: z.string(),\n exclusionType: ExclusionTypeSchema,\n parameterIds: z.array(z.string())\n});\nexport type ExclusionGroup = z.infer<typeof ExclusionGroupSchema>;\n\nexport const SavedCommandSchema = z.object({\n id: z.string(),\n command: z.string()\n});\nexport type SavedCommand = z.infer<typeof SavedCommandSchema>;\n\nexport const SupportedToolInputTypeSchema = z.enum([\n \"StandardInput\",\n \"Parameter\"\n]);\nexport type SupportedToolInputType = z.infer<\n typeof SupportedToolInputTypeSchema\n>;\n\nexport const SupportedToolOutputTypeSchema = z.enum([\n \"StandardOutput\",\n \"File\",\n \"Directory\"\n]);\nexport type SupportedToolOutputType = z.infer<\n typeof SupportedToolOutputTypeSchema\n>;\n\nexport const ToolSchema = z.object({\n id: z.string().optional(),\n name: z.string(),\n displayName: z.string(),\n description: z.string().optional(),\n version: z.string().optional(),\n category: z.string().optional(),\n tags: z.array(z.string()).optional(),\n url: z.url().optional(),\n commands: z.array(CommandSchema),\n parameters: z.array(ParameterSchema),\n exclusionGroups: z.array(ExclusionGroupSchema),\n supportedInput: z.array(SupportedToolInputTypeSchema),\n supportedOutput: z.array(SupportedToolOutputTypeSchema)\n});\nexport type Tool = z.infer<typeof ToolSchema>;\n\nexport const AIParseRequestSchema = z.object({\n helpText: z.string(),\n toolName: z.string().optional()\n});\nexport type AIParseRequest = z.infer<typeof AIParseRequestSchema>;\n\nexport const AIParseResponseSchema = z.object({\n success: z.boolean(),\n data: ToolSchema.optional(),\n error: z.string().optional()\n});\nexport type AIParseResponse = z.infer<typeof AIParseResponseSchema>;\n\nexport const newToolSchema = z.object({\n displayName: z.string(),\n name: z.string(),\n version: z.string().optional(),\n description: z.string().optional(),\n url: z.url().optional()\n});\nexport type ManualNewTool = z.infer<typeof newToolSchema>;\n",
12+
"type": "registry:lib"
13+
},
14+
{
15+
"path": "registry/commandly/lib/types/commandly-nested.ts",
16+
"content": "import { ParameterValidation, ParameterDependencyType, ParameterType, ParameterDataType, ParameterMetadata, ExclusionType, SupportedToolInputType, SupportedToolOutputType } from \"../../types\";\n\nexport interface NestedCommand {\n name: string;\n description: string;\n isDefault: boolean;\n sortOrder: number;\n parameters: NestedParameter[];\n subcommands: NestedCommand[];\n}\n\nexport interface NestedParameterEnumValue {\n value: string;\n displayName: string;\n description: string;\n isDefault: boolean;\n sortOrder: number;\n}\n\nexport type NestedParameterValidation = Omit<\n ParameterValidation,\n \"id\" | \"parameterId\"\n>;\n\nexport interface NestedParameterDependency {\n dependsOnParameter: string;\n dependencyType: ParameterDependencyType;\n conditionValue?: string;\n}\n\nexport interface NestedParameter {\n name: string;\n description: string;\n parameterType: ParameterType;\n dataType: ParameterDataType;\n metadata?: ParameterMetadata;\n isRequired: boolean;\n isRepeatable: boolean;\n isGlobal: boolean;\n defaultValue?: string;\n shortFlag?: string;\n longFlag: string;\n position?: number;\n sortOrder?: number;\n arraySeparator?: string;\n keyValueSeparator?: string;\n enumValues: NestedParameterEnumValue[];\n validations: NestedParameterValidation[];\n dependencies: NestedParameterDependency[];\n}\n\nexport interface NestedExclusionGroup {\n name: string;\n exclusionType: ExclusionType;\n parameters: string[];\n}\n\nexport interface NestedTool {\n name: string;\n displayName: string;\n description?: string;\n version?: string;\n url?: string;\n globalParameters: NestedParameter[];\n commands: NestedCommand[];\n exclusionGroups: NestedExclusionGroup[];\n supportedInput: SupportedToolInputType[];\n supportedOutput: SupportedToolOutputType[];\n}\n",
17+
"type": "registry:lib"
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)