mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add cloudflare workers support for all frontends (#366)
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
type ProjectConfig,
|
||||
ProjectNameSchema,
|
||||
type Runtime,
|
||||
type WebDeploy,
|
||||
} from "./types";
|
||||
|
||||
export function processAndValidateFlags(
|
||||
@@ -82,6 +83,10 @@ export function processAndValidateFlags(
|
||||
config.packageManager = options.packageManager as PackageManager;
|
||||
}
|
||||
|
||||
if (options.webDeploy) {
|
||||
config.webDeploy = options.webDeploy as WebDeploy;
|
||||
}
|
||||
|
||||
if (projectName) {
|
||||
const result = ProjectNameSchema.safeParse(path.basename(projectName));
|
||||
if (!result.success) {
|
||||
@@ -446,6 +451,24 @@ export function processAndValidateFlags(
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (
|
||||
config.webDeploy === "workers" &&
|
||||
config.frontend &&
|
||||
config.frontend.length > 0
|
||||
) {
|
||||
const incompatibleFrontends = config.frontend.filter(
|
||||
(f) => f === "tanstack-start",
|
||||
);
|
||||
if (incompatibleFrontends.length > 0) {
|
||||
consola.fatal(
|
||||
`The following frontends are not compatible with '--web-deploy workers': ${incompatibleFrontends.join(
|
||||
", ",
|
||||
)}. Please choose a different frontend or remove '--web-deploy workers'.`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user