fix: generated Env declaration not extending HonoEnv
This commit is contained in:
@@ -22,13 +22,14 @@ const secretNames = await logStep(
|
||||
|
||||
const project = new Project({});
|
||||
|
||||
const envFile = project.addSourceFileAtPath("src/types/env.d.ts");
|
||||
envFile.insertImportDeclaration(2, {
|
||||
const envSourceFile = project.addSourceFileAtPath("src/types/env.d.ts");
|
||||
envSourceFile.insertImportDeclaration(2, {
|
||||
isTypeOnly: true,
|
||||
moduleSpecifier: "hono",
|
||||
namedImports: ["Env as HonoEnv"],
|
||||
});
|
||||
envFile.getInterfaceOrThrow("Env").addProperties(
|
||||
envSourceFile.getInterfaceOrThrow("Env").addExtends("HonoEnv");
|
||||
envSourceFile.getInterfaceOrThrow("Env").addProperties(
|
||||
secretNames.map((name) => ({
|
||||
name,
|
||||
type: `string`,
|
||||
|
||||
Reference in New Issue
Block a user