create-glitch-stack 0.1.0
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.
- package/README.md +258 -0
- package/dist/chunk-DcJyvSSG.mjs +2 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +2 -0
- package/dist/index.d.mts +414 -0
- package/dist/index.mjs +2 -0
- package/dist/src-vYrrSKp2.mjs +2 -0
- package/dist/virtual.d.mts +5 -0
- package/dist/virtual.mjs +2 -0
- package/package.json +103 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as _trpc_server0 from "@trpc/server";
|
|
3
|
+
import * as better_result0 from "better-result";
|
|
4
|
+
import { Result, Result as Result$1 } from "better-result";
|
|
5
|
+
import { TrpcCliMeta, createCli } from "trpc-cli";
|
|
6
|
+
import z from "zod";
|
|
7
|
+
import { EMBEDDED_TEMPLATES, GeneratorError, GeneratorError as GeneratorError$1, GeneratorOptions, TEMPLATE_COUNT, VirtualDirectory, VirtualFile, VirtualFileSystem, VirtualFileTree, VirtualFileTree as VirtualFileTree$1, VirtualNode, generate } from "@glitch-stack/template-generator";
|
|
8
|
+
|
|
9
|
+
//#region src/types.d.ts
|
|
10
|
+
|
|
11
|
+
import * as import__glitch_stack_types from "@glitch-stack/types";
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/helpers/core/command-handlers.d.ts
|
|
14
|
+
/**
|
|
15
|
+
* Result type for project creation
|
|
16
|
+
*/
|
|
17
|
+
interface CreateProjectResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
projectConfig: types_d_exports.ProjectConfig;
|
|
20
|
+
reproducibleCommand: string;
|
|
21
|
+
timeScaffolded: string;
|
|
22
|
+
elapsedTimeMs: number;
|
|
23
|
+
projectDirectory: string;
|
|
24
|
+
relativePath: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/helpers/core/add-handler.d.ts
|
|
29
|
+
interface AddResult {
|
|
30
|
+
success: boolean;
|
|
31
|
+
addedAddons: types_d_exports.Addons[];
|
|
32
|
+
projectDir: string;
|
|
33
|
+
dryRun?: boolean;
|
|
34
|
+
plannedFileCount?: number;
|
|
35
|
+
error?: string;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/utils/errors.d.ts
|
|
39
|
+
declare const UserCancelledError_base: better_result0.TaggedErrorClass<"UserCancelledError", {
|
|
40
|
+
message: string;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* User cancelled the operation (e.g., Ctrl+C in prompts)
|
|
44
|
+
*/
|
|
45
|
+
declare class UserCancelledError extends UserCancelledError_base {
|
|
46
|
+
constructor(args?: {
|
|
47
|
+
message?: string;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
declare const CLIError_base: better_result0.TaggedErrorClass<"CLIError", {
|
|
51
|
+
message: string;
|
|
52
|
+
cause?: unknown;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* General CLI error for validation failures, invalid flags, etc.
|
|
56
|
+
*/
|
|
57
|
+
declare class CLIError extends CLIError_base {}
|
|
58
|
+
declare const ValidationError_base: better_result0.TaggedErrorClass<"ValidationError", {
|
|
59
|
+
field?: string;
|
|
60
|
+
value?: unknown;
|
|
61
|
+
message: string;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Validation error for config/flag validation failures
|
|
65
|
+
*/
|
|
66
|
+
declare class ValidationError extends ValidationError_base {
|
|
67
|
+
constructor(args: {
|
|
68
|
+
field?: string;
|
|
69
|
+
value?: unknown;
|
|
70
|
+
message: string;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
declare const CompatibilityError_base: better_result0.TaggedErrorClass<"CompatibilityError", {
|
|
74
|
+
options: string[];
|
|
75
|
+
message: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Compatibility error for incompatible option combinations
|
|
79
|
+
*/
|
|
80
|
+
declare class CompatibilityError extends CompatibilityError_base {
|
|
81
|
+
constructor(args: {
|
|
82
|
+
options: string[];
|
|
83
|
+
message: string;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
declare const DirectoryConflictError_base: better_result0.TaggedErrorClass<"DirectoryConflictError", {
|
|
87
|
+
directory: string;
|
|
88
|
+
message: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Directory conflict error when target directory exists and is not empty
|
|
92
|
+
*/
|
|
93
|
+
declare class DirectoryConflictError extends DirectoryConflictError_base {
|
|
94
|
+
constructor(args: {
|
|
95
|
+
directory: string;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
declare const ProjectCreationError_base: better_result0.TaggedErrorClass<"ProjectCreationError", {
|
|
99
|
+
phase: string;
|
|
100
|
+
message: string;
|
|
101
|
+
cause?: unknown;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Project creation error for failures during scaffolding
|
|
105
|
+
*/
|
|
106
|
+
declare class ProjectCreationError extends ProjectCreationError_base {
|
|
107
|
+
constructor(args: {
|
|
108
|
+
phase: string;
|
|
109
|
+
message: string;
|
|
110
|
+
cause?: unknown;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
declare const DatabaseSetupError_base: better_result0.TaggedErrorClass<"DatabaseSetupError", {
|
|
114
|
+
provider: string;
|
|
115
|
+
message: string;
|
|
116
|
+
cause?: unknown;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Database setup error for failures during database configuration
|
|
120
|
+
*/
|
|
121
|
+
declare class DatabaseSetupError extends DatabaseSetupError_base {
|
|
122
|
+
constructor(args: {
|
|
123
|
+
provider: string;
|
|
124
|
+
message: string;
|
|
125
|
+
cause?: unknown;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/index.d.ts
|
|
130
|
+
declare const SchemaNameSchema: z.ZodDefault<z.ZodEnum<{
|
|
131
|
+
all: "all";
|
|
132
|
+
cli: "cli";
|
|
133
|
+
database: "database";
|
|
134
|
+
orm: "orm";
|
|
135
|
+
backend: "backend";
|
|
136
|
+
runtime: "runtime";
|
|
137
|
+
frontend: "frontend";
|
|
138
|
+
addons: "addons";
|
|
139
|
+
examples: "examples";
|
|
140
|
+
packageManager: "packageManager";
|
|
141
|
+
api: "api";
|
|
142
|
+
auth: "auth";
|
|
143
|
+
payments: "payments";
|
|
144
|
+
webDeploy: "webDeploy";
|
|
145
|
+
serverDeploy: "serverDeploy";
|
|
146
|
+
directoryConflict: "directoryConflict";
|
|
147
|
+
template: "template";
|
|
148
|
+
addonOptions: "addonOptions";
|
|
149
|
+
createInput: "createInput";
|
|
150
|
+
addInput: "addInput";
|
|
151
|
+
projectConfig: "projectConfig";
|
|
152
|
+
glitchStackConfig: "glitchStackConfig";
|
|
153
|
+
initResult: "initResult";
|
|
154
|
+
}>>;
|
|
155
|
+
type SchemaName = z.infer<typeof SchemaNameSchema>;
|
|
156
|
+
declare function getSchemaResult(name: SchemaName): unknown;
|
|
157
|
+
declare const router: _trpc_server0.TRPCBuiltRouter<{
|
|
158
|
+
ctx: object;
|
|
159
|
+
meta: TrpcCliMeta;
|
|
160
|
+
errorShape: _trpc_server0.TRPCDefaultErrorShape;
|
|
161
|
+
transformer: false;
|
|
162
|
+
}, _trpc_server0.TRPCDecorateCreateRouterOptions<{
|
|
163
|
+
create: _trpc_server0.TRPCMutationProcedure<{
|
|
164
|
+
input: [string | undefined, {
|
|
165
|
+
template?: "none" | "t3" | "uniwind" | undefined;
|
|
166
|
+
yes?: boolean | undefined;
|
|
167
|
+
yolo?: boolean | undefined;
|
|
168
|
+
dryRun?: boolean | undefined;
|
|
169
|
+
verbose?: boolean | undefined;
|
|
170
|
+
database?: "none" | "sqlite" | "postgres" | "mysql" | undefined;
|
|
171
|
+
orm?: "none" | "drizzle" | "prisma" | undefined;
|
|
172
|
+
auth?: "none" | "better-auth" | "clerk" | undefined;
|
|
173
|
+
payments?: "none" | "polar" | undefined;
|
|
174
|
+
frontend?: ("none" | "tanstack-start" | "next" | "angular" | "native-uniwind" | "astro")[] | undefined;
|
|
175
|
+
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "husky" | "mcp" | "turborepo" | "fumadocs" | "ultracite" | "opentui" | "wxt" | "skills")[] | undefined;
|
|
176
|
+
examples?: ("none" | "todo" | "ai")[] | undefined;
|
|
177
|
+
git?: boolean | undefined;
|
|
178
|
+
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
179
|
+
install?: boolean | undefined;
|
|
180
|
+
backend?: "none" | "hono" | "express" | "fastify" | "nest" | "self" | undefined;
|
|
181
|
+
runtime?: "none" | "bun" | "node" | "workers" | undefined;
|
|
182
|
+
api?: "none" | "trpc" | "orpc" | undefined;
|
|
183
|
+
webDeploy?: "none" | "cloudflare" | undefined;
|
|
184
|
+
serverDeploy?: "none" | "cloudflare" | undefined;
|
|
185
|
+
directoryConflict?: "merge" | "overwrite" | "increment" | "error" | undefined;
|
|
186
|
+
renderTitle?: boolean | undefined;
|
|
187
|
+
}];
|
|
188
|
+
output: CreateProjectResult | undefined;
|
|
189
|
+
meta: TrpcCliMeta;
|
|
190
|
+
}>;
|
|
191
|
+
createJson: _trpc_server0.TRPCMutationProcedure<{
|
|
192
|
+
input: {
|
|
193
|
+
projectName?: string | undefined;
|
|
194
|
+
template?: "none" | "t3" | "uniwind" | undefined;
|
|
195
|
+
yes?: boolean | undefined;
|
|
196
|
+
yolo?: boolean | undefined;
|
|
197
|
+
dryRun?: boolean | undefined;
|
|
198
|
+
verbose?: boolean | undefined;
|
|
199
|
+
addonOptions?: {
|
|
200
|
+
wxt?: {
|
|
201
|
+
template: "vanilla" | "vue" | "react";
|
|
202
|
+
devPort?: number | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
fumadocs?: {
|
|
205
|
+
template: "tanstack-start" | "next-mdx" | "next-mdx-static" | "waku" | "tanstack-start-spa";
|
|
206
|
+
devPort?: number | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
opentui?: {
|
|
209
|
+
template: "react" | "core";
|
|
210
|
+
} | undefined;
|
|
211
|
+
mcp?: {
|
|
212
|
+
scope?: "project" | "global" | undefined;
|
|
213
|
+
servers?: ("better-auth" | "clerk" | "polar" | "glitch-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "astro-docs" | "planetscale" | "neon" | "supabase" | "expo")[] | undefined;
|
|
214
|
+
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "mcporter" | "vscode" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
215
|
+
} | undefined;
|
|
216
|
+
skills?: {
|
|
217
|
+
scope?: "project" | "global" | undefined;
|
|
218
|
+
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "goose" | "github-copilot" | "windsurf" | "roo" | "kilo" | "openhands" | "trae" | "amp" | "pi" | "qoder" | "qwen-code" | "kiro-cli" | "droid" | "command-code" | "clawdbot" | "zencoder" | "neovate" | "mcpjam")[] | undefined;
|
|
219
|
+
selections?: {
|
|
220
|
+
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "msmps/opentui-skill" | "haydenbleasel/ultracite";
|
|
221
|
+
skills: string[];
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
} | undefined;
|
|
224
|
+
ultracite?: {
|
|
225
|
+
linter?: "biome" | "eslint" | undefined;
|
|
226
|
+
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "zed" | "windsurf" | "trae" | "kiro")[] | undefined;
|
|
227
|
+
agents?: ("cline" | "codex" | "opencode" | "goose" | "amp" | "droid" | "claude" | "jules" | "copilot" | "aider" | "firebase-studio" | "open-hands" | "gemini" | "junie" | "augmentcode" | "kilo-code" | "roo-code" | "warp" | "crush" | "qwen" | "amazon-q-cli" | "firebender" | "cursor-cli" | "mistral-vibe" | "vercel")[] | undefined;
|
|
228
|
+
hooks?: ("cursor" | "windsurf" | "claude")[] | undefined;
|
|
229
|
+
} | undefined;
|
|
230
|
+
} | undefined;
|
|
231
|
+
database?: "none" | "sqlite" | "postgres" | "mysql" | undefined;
|
|
232
|
+
orm?: "none" | "drizzle" | "prisma" | undefined;
|
|
233
|
+
auth?: "none" | "better-auth" | "clerk" | undefined;
|
|
234
|
+
payments?: "none" | "polar" | undefined;
|
|
235
|
+
frontend?: ("none" | "tanstack-start" | "next" | "angular" | "native-uniwind" | "astro")[] | undefined;
|
|
236
|
+
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "husky" | "mcp" | "turborepo" | "fumadocs" | "ultracite" | "opentui" | "wxt" | "skills")[] | undefined;
|
|
237
|
+
examples?: ("none" | "todo" | "ai")[] | undefined;
|
|
238
|
+
git?: boolean | undefined;
|
|
239
|
+
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
240
|
+
install?: boolean | undefined;
|
|
241
|
+
backend?: "none" | "hono" | "express" | "fastify" | "nest" | "self" | undefined;
|
|
242
|
+
runtime?: "none" | "bun" | "node" | "workers" | undefined;
|
|
243
|
+
api?: "none" | "trpc" | "orpc" | undefined;
|
|
244
|
+
webDeploy?: "none" | "cloudflare" | undefined;
|
|
245
|
+
serverDeploy?: "none" | "cloudflare" | undefined;
|
|
246
|
+
directoryConflict?: "merge" | "overwrite" | "increment" | "error" | undefined;
|
|
247
|
+
renderTitle?: boolean | undefined;
|
|
248
|
+
};
|
|
249
|
+
output: CreateProjectResult;
|
|
250
|
+
meta: TrpcCliMeta;
|
|
251
|
+
}>;
|
|
252
|
+
schema: _trpc_server0.TRPCQueryProcedure<{
|
|
253
|
+
input: {
|
|
254
|
+
name?: "all" | "cli" | "database" | "orm" | "backend" | "runtime" | "frontend" | "addons" | "examples" | "packageManager" | "api" | "auth" | "payments" | "webDeploy" | "serverDeploy" | "directoryConflict" | "template" | "addonOptions" | "createInput" | "addInput" | "projectConfig" | "glitchStackConfig" | "initResult" | undefined;
|
|
255
|
+
};
|
|
256
|
+
output: unknown;
|
|
257
|
+
meta: TrpcCliMeta;
|
|
258
|
+
}>;
|
|
259
|
+
add: _trpc_server0.TRPCMutationProcedure<{
|
|
260
|
+
input: {
|
|
261
|
+
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "husky" | "mcp" | "turborepo" | "fumadocs" | "ultracite" | "opentui" | "wxt" | "skills")[] | undefined;
|
|
262
|
+
install?: boolean | undefined;
|
|
263
|
+
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
264
|
+
projectDir?: string | undefined;
|
|
265
|
+
};
|
|
266
|
+
output: void;
|
|
267
|
+
meta: TrpcCliMeta;
|
|
268
|
+
}>;
|
|
269
|
+
addJson: _trpc_server0.TRPCMutationProcedure<{
|
|
270
|
+
input: {
|
|
271
|
+
addons?: ("none" | "pwa" | "tauri" | "electrobun" | "starlight" | "biome" | "husky" | "mcp" | "turborepo" | "fumadocs" | "ultracite" | "opentui" | "wxt" | "skills")[] | undefined;
|
|
272
|
+
addonOptions?: {
|
|
273
|
+
wxt?: {
|
|
274
|
+
template: "vanilla" | "vue" | "react";
|
|
275
|
+
devPort?: number | undefined;
|
|
276
|
+
} | undefined;
|
|
277
|
+
fumadocs?: {
|
|
278
|
+
template: "tanstack-start" | "next-mdx" | "next-mdx-static" | "waku" | "tanstack-start-spa";
|
|
279
|
+
devPort?: number | undefined;
|
|
280
|
+
} | undefined;
|
|
281
|
+
opentui?: {
|
|
282
|
+
template: "react" | "core";
|
|
283
|
+
} | undefined;
|
|
284
|
+
mcp?: {
|
|
285
|
+
scope?: "project" | "global" | undefined;
|
|
286
|
+
servers?: ("better-auth" | "clerk" | "polar" | "glitch-stack" | "context7" | "cloudflare-docs" | "shadcn" | "next-devtools" | "astro-docs" | "planetscale" | "neon" | "supabase" | "expo")[] | undefined;
|
|
287
|
+
agents?: ("antigravity" | "cline" | "cline-cli" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "github-copilot-cli" | "mcporter" | "vscode" | "zed" | "claude-desktop" | "goose")[] | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
skills?: {
|
|
290
|
+
scope?: "project" | "global" | undefined;
|
|
291
|
+
agents?: ("antigravity" | "cline" | "cursor" | "claude-code" | "codex" | "opencode" | "gemini-cli" | "goose" | "github-copilot" | "windsurf" | "roo" | "kilo" | "openhands" | "trae" | "amp" | "pi" | "qoder" | "qwen-code" | "kiro-cli" | "droid" | "command-code" | "clawdbot" | "zencoder" | "neovate" | "mcpjam")[] | undefined;
|
|
292
|
+
selections?: {
|
|
293
|
+
source: "vercel-labs/agent-skills" | "vercel/ai" | "vercel/turborepo" | "yusukebe/hono-skill" | "vercel-labs/next-skills" | "heroui-inc/heroui" | "shadcn/ui" | "better-auth/skills" | "clerk/skills" | "neondatabase/agent-skills" | "supabase/agent-skills" | "planetscale/database-skills" | "expo/skills" | "prisma/skills" | "msmps/opentui-skill" | "haydenbleasel/ultracite";
|
|
294
|
+
skills: string[];
|
|
295
|
+
}[] | undefined;
|
|
296
|
+
} | undefined;
|
|
297
|
+
ultracite?: {
|
|
298
|
+
linter?: "biome" | "eslint" | undefined;
|
|
299
|
+
editors?: ("void" | "antigravity" | "cursor" | "vscode" | "zed" | "windsurf" | "trae" | "kiro")[] | undefined;
|
|
300
|
+
agents?: ("cline" | "codex" | "opencode" | "goose" | "amp" | "droid" | "claude" | "jules" | "copilot" | "aider" | "firebase-studio" | "open-hands" | "gemini" | "junie" | "augmentcode" | "kilo-code" | "roo-code" | "warp" | "crush" | "qwen" | "amazon-q-cli" | "firebender" | "cursor-cli" | "mistral-vibe" | "vercel")[] | undefined;
|
|
301
|
+
hooks?: ("cursor" | "windsurf" | "claude")[] | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
} | undefined;
|
|
304
|
+
webDeploy?: "none" | "cloudflare" | undefined;
|
|
305
|
+
serverDeploy?: "none" | "cloudflare" | undefined;
|
|
306
|
+
projectDir?: string | undefined;
|
|
307
|
+
install?: boolean | undefined;
|
|
308
|
+
packageManager?: "bun" | "npm" | "pnpm" | undefined;
|
|
309
|
+
dryRun?: boolean | undefined;
|
|
310
|
+
};
|
|
311
|
+
output: AddResult;
|
|
312
|
+
meta: TrpcCliMeta;
|
|
313
|
+
}>;
|
|
314
|
+
}>>;
|
|
315
|
+
declare function createGsCli(): ReturnType<typeof createCli>;
|
|
316
|
+
/**
|
|
317
|
+
* Error types that can be returned from create/createVirtual
|
|
318
|
+
*/
|
|
319
|
+
type CreateError = UserCancelledError | CLIError | ProjectCreationError;
|
|
320
|
+
/**
|
|
321
|
+
* Programmatic API to create a new Glitch Stack project.
|
|
322
|
+
* Returns a Result type - no console output, no interactive prompts.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```typescript
|
|
326
|
+
* import { create, Result } from "create-glitch-stack";
|
|
327
|
+
*
|
|
328
|
+
* const result = await create("my-app", {
|
|
329
|
+
* frontend: ["next"],
|
|
330
|
+
* backend: "hono",
|
|
331
|
+
* runtime: "bun",
|
|
332
|
+
* database: "sqlite",
|
|
333
|
+
* orm: "drizzle",
|
|
334
|
+
* });
|
|
335
|
+
*
|
|
336
|
+
* result.match({
|
|
337
|
+
* ok: (data) => console.log(`Project created at: ${data.projectDirectory}`),
|
|
338
|
+
* err: (error) => console.error(`Failed: ${error.message}`),
|
|
339
|
+
* });
|
|
340
|
+
*
|
|
341
|
+
* // Or use unwrapOr for a default value
|
|
342
|
+
* const data = result.unwrapOr(null);
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
declare function create(projectName?: string, options?: Partial<types_d_exports.CreateInput>): Promise<Result$1<types_d_exports.InitResult, CreateError>>;
|
|
346
|
+
/**
|
|
347
|
+
* Programmatic API to generate a project in-memory (virtual filesystem).
|
|
348
|
+
* Returns a Result with a VirtualFileTree without writing to disk.
|
|
349
|
+
* Useful for web previews and testing.
|
|
350
|
+
*
|
|
351
|
+
* @example
|
|
352
|
+
* ```typescript
|
|
353
|
+
* import { createVirtual, EMBEDDED_TEMPLATES, Result } from "create-glitch-stack";
|
|
354
|
+
*
|
|
355
|
+
* const result = await createVirtual({
|
|
356
|
+
* frontend: ["next"],
|
|
357
|
+
* backend: "hono",
|
|
358
|
+
* runtime: "bun",
|
|
359
|
+
* database: "sqlite",
|
|
360
|
+
* orm: "drizzle",
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* result.match({
|
|
364
|
+
* ok: (tree) => console.log(`Generated ${tree.fileCount} files`),
|
|
365
|
+
* err: (error) => console.error(`Failed: ${error.message}`),
|
|
366
|
+
* });
|
|
367
|
+
* ```
|
|
368
|
+
*/
|
|
369
|
+
declare function createVirtual(options: Partial<Omit<types_d_exports.ProjectConfig, "projectDir" | "relativePath">>): Promise<Result$1<VirtualFileTree$1, GeneratorError$1>>;
|
|
370
|
+
/**
|
|
371
|
+
* Programmatic API to add addons to an existing Glitch Stack project.
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* import { add } from "create-glitch-stack";
|
|
376
|
+
*
|
|
377
|
+
* const result = await add({
|
|
378
|
+
* addons: ["biome", "husky"],
|
|
379
|
+
* install: true,
|
|
380
|
+
* });
|
|
381
|
+
*
|
|
382
|
+
* if (result?.success) {
|
|
383
|
+
* console.log(`Added: ${result.addedAddons.join(", ")}`);
|
|
384
|
+
* }
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
declare function add(options?: {
|
|
388
|
+
addons?: types_d_exports.Addons[];
|
|
389
|
+
addonOptions?: types_d_exports.AddonOptions;
|
|
390
|
+
install?: boolean;
|
|
391
|
+
packageManager?: types_d_exports.PackageManager;
|
|
392
|
+
projectDir?: string;
|
|
393
|
+
dryRun?: boolean;
|
|
394
|
+
}): Promise<AddResult | undefined>;
|
|
395
|
+
type API = import__glitch_stack_types.API;
|
|
396
|
+
type AddonOptions = import__glitch_stack_types.AddonOptions;
|
|
397
|
+
type Addons = import__glitch_stack_types.Addons;
|
|
398
|
+
type Auth = import__glitch_stack_types.Auth;
|
|
399
|
+
type Backend = import__glitch_stack_types.Backend;
|
|
400
|
+
type CreateInput = import__glitch_stack_types.CreateInput;
|
|
401
|
+
type Database = import__glitch_stack_types.Database;
|
|
402
|
+
type DirectoryConflict = import__glitch_stack_types.DirectoryConflict;
|
|
403
|
+
type Examples = import__glitch_stack_types.Examples;
|
|
404
|
+
type Frontend = import__glitch_stack_types.Frontend;
|
|
405
|
+
type GlitchStackConfig = import__glitch_stack_types.GlitchStackConfig;
|
|
406
|
+
type InitResult = import__glitch_stack_types.InitResult;
|
|
407
|
+
type ORM = import__glitch_stack_types.ORM;
|
|
408
|
+
type PackageManager = import__glitch_stack_types.PackageManager;
|
|
409
|
+
type Payments = import__glitch_stack_types.Payments;
|
|
410
|
+
type Runtime = import__glitch_stack_types.Runtime;
|
|
411
|
+
type ServerDeploy = import__glitch_stack_types.ServerDeploy;
|
|
412
|
+
type Template = import__glitch_stack_types.Template;
|
|
413
|
+
type WebDeploy = import__glitch_stack_types.WebDeploy;
|
|
414
|
+
export { type API, type AddResult, type AddonOptions, type Addons, type Auth, type Backend, CLIError, CompatibilityError, CreateError, type CreateInput, type Database, DatabaseSetupError, type DirectoryConflict, DirectoryConflictError, EMBEDDED_TEMPLATES, type Examples, type Frontend, GeneratorError, type GeneratorOptions, type GlitchStackConfig, type InitResult, type ORM, type PackageManager, type Payments, ProjectCreationError, Result, type Runtime, SchemaName, SchemaNameSchema, type ServerDeploy, TEMPLATE_COUNT, type Template, UserCancelledError, ValidationError, type VirtualDirectory, type VirtualFile, VirtualFileSystem, type VirtualFileTree, type VirtualNode, type WebDeploy, add, create, createGsCli, createVirtual, generate, getSchemaResult, router };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
(function(_0x300258,_0xe15c3){var _0x50bae2=_0x2ce6,_0x211a4=_0x300258();while(!![]){try{var _0x3b89b4=parseInt(_0x50bae2(0x1dd))/0x1*(-parseInt(_0x50bae2(0x1db))/0x2)+parseInt(_0x50bae2(0x1de))/0x3*(parseInt(_0x50bae2(0x1e0))/0x4)+-parseInt(_0x50bae2(0x1dc))/0x5+-parseInt(_0x50bae2(0x1da))/0x6+-parseInt(_0x50bae2(0x1d7))/0x7*(-parseInt(_0x50bae2(0x1d9))/0x8)+-parseInt(_0x50bae2(0x1d8))/0x9*(-parseInt(_0x50bae2(0x1e1))/0xa)+parseInt(_0x50bae2(0x1df))/0xb;if(_0x3b89b4===_0xe15c3)break;else _0x211a4['push'](_0x211a4['shift']());}catch(_0x1e3383){_0x211a4['push'](_0x211a4['shift']());}}}(_0xef29,0x747c2));import{_ as _0x580a2a,a as _0x574537,b as _0x63bcf2,c as _0x129e5c,d as _0x57979b,f as _0x1b7b00,g as _0x5598ae,h as _0x4bd27f,i as _0x536854,l,n as _0x1c1fe7,o as _0x4adb1c,p as _0x1c076f,r as _0x1035e7,s as _0x469f24,t as _0x2533be,u as _0x1c7a81,v as _0x2dd72a,x as _0x1a2117,y}from'./src-vYrrSKp2.mjs';function _0xef29(){var _0x4f36f4=['27Kpdxkc','17304VNbfwS','4282332SWVFnq','1702136uIImhV','2716835cuhldA','1UPMzHj','207ypwelS','18218662nHMfkY','27176vnEDxV','1289030mRFgRS','238BIABHu'];_0xef29=function(){return _0x4f36f4;};return _0xef29();}function _0x2ce6(_0x35eb5b,_0x5e5934){_0x35eb5b=_0x35eb5b-0x1d7;var _0xef2988=_0xef29();var _0x2ce652=_0xef2988[_0x35eb5b];return _0x2ce652;}export{_0x4bd27f as CLIError,_0x5598ae as CompatibilityError,_0x580a2a as DatabaseSetupError,_0x2dd72a as DirectoryConflictError,_0x2533be as EMBEDDED_TEMPLATES,_0x1c1fe7 as GeneratorError,y as ProjectCreationError,_0x1035e7 as Result,_0x536854 as SchemaNameSchema,_0x574537 as TEMPLATE_COUNT,_0x63bcf2 as UserCancelledError,_0x1a2117 as ValidationError,_0x4adb1c as VirtualFileSystem,_0x469f24 as add,_0x129e5c as create,l as createGsCli,_0x1c7a81 as createVirtual,_0x57979b as generate,_0x1b7b00 as getSchemaResult,_0x1c076f as router};
|