Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/cli/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const DEFAULT_CONFIG_BASE = {
pythonAi: [],
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
// Go ecosystem defaults
goWebFramework: "gin",
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/helpers/core/command-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export async function createProjectHandler(
pythonAi: [],
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "none",
goWebFramework: "none",
goOrm: "none",
Expand Down
4 changes: 4 additions & 0 deletions apps/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ import {
type PythonAuth,
PythonTaskQueueSchema,
type PythonTaskQueue,
PythonGraphqlSchema,
type PythonGraphql,
PythonQualitySchema,
type PythonQuality,
GoWebFrameworkSchema,
Expand Down Expand Up @@ -269,6 +271,7 @@ export const router = os.router({
pythonAi: z.array(PythonAiSchema).optional().describe("Python AI/ML frameworks"),
pythonAuth: PythonAuthSchema.optional().describe("Python auth library (authlib, jwt)"),
pythonTaskQueue: PythonTaskQueueSchema.optional().describe("Python task queue (celery)"),
pythonGraphql: PythonGraphqlSchema.optional().describe("Python GraphQL framework (strawberry)"),
pythonQuality: PythonQualitySchema.optional().describe("Python code quality (ruff)"),
// Go ecosystem options
goWebFramework: GoWebFrameworkSchema.optional().describe("Go web framework (gin, echo, fiber)"),
Expand Down Expand Up @@ -593,6 +596,7 @@ export async function createVirtual(
pythonAi: options.pythonAi || [],
pythonAuth: options.pythonAuth || "none",
pythonTaskQueue: options.pythonTaskQueue || "none",
pythonGraphql: options.pythonGraphql || "none",
pythonQuality: options.pythonQuality || "none",
// Go ecosystem options
goWebFramework: options.goWebFramework || "none",
Expand Down
6 changes: 5 additions & 1 deletion apps/cli/src/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
PythonAuthSchema,
PythonOrmSchema,
PythonQualitySchema,
PythonGraphqlSchema,
PythonTaskQueueSchema,
PythonValidationSchema,
PythonWebFrameworkSchema,
Expand Down Expand Up @@ -196,6 +197,7 @@ const SCHEMA_MAP: Record<string, z.ZodType> = {
pythonAi: PythonAiSchema,
pythonAuth: PythonAuthSchema,
pythonTaskQueue: PythonTaskQueueSchema,
pythonGraphql: PythonGraphqlSchema,
pythonQuality: PythonQualitySchema,
goWebFramework: GoWebFrameworkSchema,
goOrm: GoOrmSchema,
Expand All @@ -213,7 +215,7 @@ const ECOSYSTEM_CATEGORIES: Record<string, string[]> = {
"search", "fileStorage", "astroIntegration",
],
rust: ["rustWebFramework", "rustFrontend", "rustOrm", "rustApi", "rustCli", "rustLibraries", "rustLogging", "rustErrorHandling", "rustCaching"],
python: ["pythonWebFramework", "pythonOrm", "pythonValidation", "pythonAi", "pythonAuth", "pythonTaskQueue", "pythonQuality"],
python: ["pythonWebFramework", "pythonOrm", "pythonValidation", "pythonAi", "pythonAuth", "pythonTaskQueue", "pythonGraphql", "pythonQuality"],
go: ["goWebFramework", "goOrm", "goApi", "goCli", "goLogging"],
shared: ["ecosystem", "packageManager", "addons", "examples", "webDeploy", "serverDeploy", "dbSetup"],
};
Expand Down Expand Up @@ -339,6 +341,7 @@ function buildProjectConfig(
pythonAi: (input.pythonAi as ProjectConfig["pythonAi"]) ?? [],
pythonAuth: (input.pythonAuth as ProjectConfig["pythonAuth"]) ?? "none",
pythonTaskQueue: (input.pythonTaskQueue as ProjectConfig["pythonTaskQueue"]) ?? "none",
pythonGraphql: (input.pythonGraphql as ProjectConfig["pythonGraphql"]) ?? "none",
pythonQuality: (input.pythonQuality as ProjectConfig["pythonQuality"]) ?? "none",
goWebFramework: (input.goWebFramework as ProjectConfig["goWebFramework"]) ?? "none",
goOrm: (input.goOrm as ProjectConfig["goOrm"]) ?? "none",
Expand Down Expand Up @@ -435,6 +438,7 @@ function buildCompatibilityInput(input: Record<string, unknown>): CompatibilityI
pythonAi: ((input.pythonAi as string[]) ?? []).join(",") || "none",
pythonAuth: (input.pythonAuth as string) ?? "none",
pythonTaskQueue: (input.pythonTaskQueue as string) ?? "none",
pythonGraphql: (input.pythonGraphql as string) ?? "none",
pythonQuality: (input.pythonQuality as string) ?? "none",
goWebFramework: (input.goWebFramework as string) ?? "none",
goOrm: (input.goOrm as string) ?? "none",
Expand Down
8 changes: 8 additions & 0 deletions apps/cli/src/prompts/config-prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import type {
PythonAuth,
PythonOrm,
PythonQuality,
PythonGraphql,
PythonTaskQueue,
PythonValidation,
PythonWebFramework,
Expand Down Expand Up @@ -104,6 +105,7 @@ import { getPaymentsChoice } from "./payments";
import {
getPythonAiChoice,
getPythonAuthChoice,
getPythonGraphqlChoice,
getPythonOrmChoice,
getPythonQualityChoice,
getPythonTaskQueueChoice,
Expand Down Expand Up @@ -189,6 +191,7 @@ type PromptGroupResults = {
pythonAi: PythonAi[];
pythonAuth: PythonAuth;
pythonTaskQueue: PythonTaskQueue;
pythonGraphql: PythonGraphql;
pythonQuality: PythonQuality;
// Go ecosystem
goWebFramework: GoWebFramework;
Expand Down Expand Up @@ -482,6 +485,10 @@ export async function gatherConfig(
if (results.ecosystem !== "python") return Promise.resolve("none" as PythonTaskQueue);
return getPythonTaskQueueChoice(flags.pythonTaskQueue);
},
pythonGraphql: ({ results }) => {
if (results.ecosystem !== "python") return Promise.resolve("none" as PythonGraphql);
return getPythonGraphqlChoice(flags.pythonGraphql);
},
pythonQuality: ({ results }) => {
if (results.ecosystem !== "python") return Promise.resolve("none" as PythonQuality);
return getPythonQualityChoice(flags.pythonQuality);
Expand Down Expand Up @@ -590,6 +597,7 @@ export async function gatherConfig(
pythonAi: result.pythonAi,
pythonAuth: result.pythonAuth,
pythonTaskQueue: result.pythonTaskQueue,
pythonGraphql: result.pythonGraphql,
pythonQuality: result.pythonQuality,
// Go ecosystem options
goWebFramework: result.goWebFramework,
Expand Down
28 changes: 28 additions & 0 deletions apps/cli/src/prompts/python-ecosystem.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {
PythonAi,
PythonAuth,
PythonGraphql,
PythonOrm,
PythonQuality,
PythonTaskQueue,
Expand Down Expand Up @@ -226,6 +227,33 @@ export async function getPythonTaskQueueChoice(pythonTaskQueue?: PythonTaskQueue
return response;
}

export async function getPythonGraphqlChoice(pythonGraphql?: PythonGraphql) {
if (pythonGraphql !== undefined) return pythonGraphql;

const options = [
{
value: "strawberry" as const,
label: "Strawberry",
hint: "Python GraphQL library using dataclasses and type hints",
},
{
value: "none" as const,
label: "None",
hint: "No GraphQL framework",
},
];

const response = await navigableSelect<PythonGraphql>({
message: "Select Python GraphQL framework",
options,
initialValue: "none",
});

if (isCancel(response)) return exitCancelled("Operation cancelled");

return response;
}

export async function getPythonQualityChoice(pythonQuality?: PythonQuality) {
if (pythonQuality !== undefined) return pythonQuality;

Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/utils/bts-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function writeBtsConfig(projectConfig: ProjectConfig) {
pythonAi: projectConfig.pythonAi,
pythonAuth: projectConfig.pythonAuth,
pythonTaskQueue: projectConfig.pythonTaskQueue,
pythonGraphql: projectConfig.pythonGraphql,
pythonQuality: projectConfig.pythonQuality,
goWebFramework: projectConfig.goWebFramework,
goOrm: projectConfig.goOrm,
Expand Down
5 changes: 5 additions & 0 deletions apps/cli/src/utils/config-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import type {
PythonAuth,
PythonOrm,
PythonQuality,
PythonGraphql,
PythonTaskQueue,
PythonValidation,
PythonWebFramework,
Expand Down Expand Up @@ -342,6 +343,10 @@ export function processFlags(options: CLIInput, projectName?: string) {
config.pythonTaskQueue = options.pythonTaskQueue as PythonTaskQueue;
}

if (options.pythonGraphql !== undefined) {
config.pythonGraphql = options.pythonGraphql as PythonGraphql;
}

if (options.pythonQuality !== undefined) {
config.pythonQuality = options.pythonQuality as PythonQuality;
}
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/utils/generate-reproducible-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function getPythonFlags(config: ProjectConfig) {
flags.push(formatArrayFlag("python-ai", config.pythonAi));
flags.push(`--python-auth ${config.pythonAuth}`);
flags.push(`--python-task-queue ${config.pythonTaskQueue}`);
flags.push(`--python-graphql ${config.pythonGraphql}`);
flags.push(`--python-quality ${config.pythonQuality}`);
appendSharedNonTypeScriptFlags(flags, config);

Expand Down
3 changes: 3 additions & 0 deletions apps/cli/test/add-history-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ describe("CLI history command", () => {
"--python-ai none " +
"--python-auth none " +
"--python-task-queue celery " +
"--python-graphql none " +
"--python-quality ruff " +
"--addons none " +
"--examples none " +
Expand Down Expand Up @@ -231,6 +232,8 @@ describe("CLI history command", () => {
"none",
"--python-task-queue",
"celery",
"--python-graphql",
"none",
"--python-quality",
"ruff",
"--addons",
Expand Down
5 changes: 5 additions & 0 deletions apps/cli/test/generate-reproducible-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function makeConfig(overrides: Partial<ProjectConfig> = {}): ProjectConfig {
pythonAi: [],
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "none",
goWebFramework: "none",
goOrm: "none",
Expand Down Expand Up @@ -121,6 +122,7 @@ describe("generateReproducibleCommand", () => {
pythonAi: [],
pythonAuth: "none",
pythonTaskQueue: "celery",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md"],
});
Expand All @@ -134,6 +136,7 @@ describe("generateReproducibleCommand", () => {
"--python-ai none " +
"--python-auth none " +
"--python-task-queue celery " +
"--python-graphql none " +
"--python-quality ruff " +
"--addons none " +
"--examples none " +
Expand Down Expand Up @@ -186,6 +189,7 @@ describe("generateReproducibleCommand", () => {
pythonAi: ["langchain", "openai-sdk"],
pythonAuth: "none",
pythonTaskQueue: "celery",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md", "agents-md"],
});
Expand All @@ -201,6 +205,7 @@ describe("generateReproducibleCommand", () => {
"--python-ai langchain openai-sdk " +
"--python-auth none " +
"--python-task-queue celery " +
"--python-graphql none " +
"--python-quality ruff " +
"--addons skills " +
"--examples none " +
Expand Down
5 changes: 5 additions & 0 deletions apps/cli/test/template-snapshots.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ describe("Template Snapshots - Python Ecosystem", () => {
pythonValidation: "pydantic" as const,
pythonAi: [] as const,
pythonTaskQueue: "celery" as const,
pythonGraphql: "none" as const,
pythonQuality: "ruff" as const,
},
},
Expand All @@ -515,6 +516,7 @@ describe("Template Snapshots - Python Ecosystem", () => {
pythonValidation: "pydantic" as const,
pythonAi: ["langchain"] as const,
pythonTaskQueue: "none" as const,
pythonGraphql: "none" as const,
pythonQuality: "ruff" as const,
},
},
Expand All @@ -527,6 +529,7 @@ describe("Template Snapshots - Python Ecosystem", () => {
pythonValidation: "pydantic" as const,
pythonAi: ["openai-sdk", "anthropic-sdk"] as const,
pythonTaskQueue: "none" as const,
pythonGraphql: "none" as const,
pythonQuality: "none" as const,
},
},
Expand All @@ -539,6 +542,7 @@ describe("Template Snapshots - Python Ecosystem", () => {
pythonValidation: "pydantic" as const,
pythonAi: [] as const,
pythonTaskQueue: "none" as const,
pythonGraphql: "none" as const,
pythonQuality: "ruff" as const,
},
},
Expand All @@ -551,6 +555,7 @@ describe("Template Snapshots - Python Ecosystem", () => {
pythonValidation: "pydantic" as const,
pythonAi: [] as const,
pythonTaskQueue: "none" as const,
pythonGraphql: "none" as const,
pythonQuality: "ruff" as const,
},
},
Expand Down
23 changes: 23 additions & 0 deletions apps/web/src/lib/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3003,6 +3003,24 @@ export const TECH_OPTIONS: Record<
default: true,
},
],
pythonGraphql: [
{
id: "strawberry",
name: "Strawberry",
description: "Python GraphQL library using dataclasses and type hints",
icon: "https://cdn.simpleicons.org/graphql/E10098",
color: "from-pink-500 to-red-600",
default: false,
},
{
id: "none",
name: "No GraphQL",
description: "Skip Python GraphQL framework selection",
icon: "",
color: "from-gray-400 to-gray-600",
default: true,
},
],
pythonQuality: [
{
id: "ruff",
Expand Down Expand Up @@ -3274,6 +3292,7 @@ export const ECOSYSTEM_CATEGORIES: Record<Ecosystem, TechCategory[]> = {
"pythonAi",
"pythonAuth",
"pythonTaskQueue",
"pythonGraphql",
"pythonQuality",
"aiDocs",
"git",
Expand Down Expand Up @@ -4153,6 +4172,7 @@ export const PRESET_TEMPLATES: {
pythonAi: "none",
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md"],
git: "true",
Expand All @@ -4173,6 +4193,7 @@ export const PRESET_TEMPLATES: {
pythonAi: "none",
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md"],
git: "true",
Expand All @@ -4193,6 +4214,7 @@ export const PRESET_TEMPLATES: {
pythonAi: "langchain",
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md"],
git: "true",
Expand All @@ -4213,6 +4235,7 @@ export const PRESET_TEMPLATES: {
pythonAi: "anthropic-sdk",
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
aiDocs: ["claude-md"],
git: "true",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/lib/preview-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function stackStateToProjectConfig(input: Partial<StackState>): ProjectCo
pythonAi: stack.pythonAi === "none" ? [] : ([stack.pythonAi] as ProjectConfig["pythonAi"]),
pythonAuth: stack.pythonAuth as ProjectConfig["pythonAuth"],
pythonTaskQueue: stack.pythonTaskQueue as ProjectConfig["pythonTaskQueue"],
pythonGraphql: stack.pythonGraphql as ProjectConfig["pythonGraphql"],
pythonQuality: stack.pythonQuality as ProjectConfig["pythonQuality"],
goWebFramework: stack.goWebFramework as ProjectConfig["goWebFramework"],
goOrm: stack.goOrm as ProjectConfig["goOrm"],
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/lib/stack-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type StackState = {
pythonAi: string;
pythonAuth: string;
pythonTaskQueue: string;
pythonGraphql: string;
pythonQuality: string;
goWebFramework: string;
goOrm: string;
Expand Down Expand Up @@ -146,6 +147,7 @@ export const DEFAULT_STACK: StackState = {
pythonAi: "none",
pythonAuth: "none",
pythonTaskQueue: "none",
pythonGraphql: "none",
pythonQuality: "ruff",
goWebFramework: "gin",
goOrm: "gorm",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/lib/stack-option-normalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const STACK_OPTION_CATEGORY_BY_KEY: Partial<Record<keyof StackState, OptionCateg
pythonValidation: "pythonValidation",
pythonAi: "pythonAi",
pythonTaskQueue: "pythonTaskQueue",
pythonGraphql: "pythonGraphql",
pythonQuality: "pythonQuality",
goWebFramework: "goWebFramework",
goOrm: "goOrm",
Expand Down
Loading
Loading