cat .env.schema
# @defaultSensitive=false
# @generateTypes(lang=ts, path=env.d.ts)
# @import(
# ../../../,
# AWS_ACCOUNT,
# AWS_PROFILE,
# AWS_REGION,
# DEPLOY_ENV,
# IS_LOCAL,
# NAMESPACE,
# SHARED_INFRA_NAMESPACE,
# )
# @import(
# ../shared-infra/.env.export.schema,
# OS_DOMAIN_ENDPOINT,
# OS_READ_ROLE_ARN,
# PGUSER,
# PGDATABASE,
# PGHOST,
# PGHOST_RO,
# )
rm env.d.ts
rm: env.d.ts: No such file or directory
pnpm varlock typegen
✅ Types generated successfully
cat env.d.ts
// 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑
// 🛑 THIS IS AN AUTOGENERATED FILE - DO NOT EDIT DIRECTLY 🛑
// 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑
// @ts-nocheck
/* eslint-disable */
export type CoercedEnvSchema = {
/**
* **AWS_ACCOUNT**
* AWS Account ID
* 
*/
AWS_ACCOUNT: string;
/**
* **AWS_PROFILE**
* name of `[profile ...]` in ~/.aws/config
* 
*/
AWS_PROFILE: string;
/**
* **AWS_REGION**
* AWS Region
* 
*/
AWS_REGION: string;
/**
* **DEPLOY_ENV**
* Defines environment which the application will be deployed
* Included in CloudFormation Stack Names
* 
*/
DEPLOY_ENV: "dev" | "test" | "prod";
/**
* **IS_LOCAL**
* Flag for if code is running locally on developer's laptjop. Useful to know
* whether we need to use local port forwarding or not for DB.
* 
*/
IS_LOCAL: boolean;
/**
* **NAMESPACE**
* Namespace prefixed in all CloudFormation stacks and resources. Derived from
* the current git branch so each branch gets isolated infrastructure.
* Sanitized to DNS-safe label: non-alphanumeric → hyphens.
* 
*/
NAMESPACE: string;
/**
* **SHARED_INFRA_NAMESPACE**
* Namespace for shared infrastructure (apps/data/shared-infra) that needs to be
* known by other apps for importing infrastructure. Using namespace for shared-infra
* allows for blue/green deployment in future if needed.
* 
*/
SHARED_INFRA_NAMESPACE: string;
/**
* **OS_DOMAIN_ENDPOINT**
* 
*/
OS_DOMAIN_ENDPOINT: string;
/**
* **OS_READ_ROLE_ARN**
* 
*/
OS_READ_ROLE_ARN: string;
/**
* **PGUSER**
* 
*/
PGUSER: string;
/**
* **PGDATABASE**
* 
*/
PGDATABASE: string;
/**
* **PGHOST**
* 
*/
PGHOST: string;
/**
* **PGHOST_RO**
* 
*/
PGHOST_RO: string;
};
declare module 'varlock/env' {
export interface TypedEnvSchema extends Readonly<CoercedEnvSchema> {}
export interface PublicTypedEnvSchema extends Readonly<Pick<CoercedEnvSchema, 'AWS_ACCOUNT' | 'AWS_PROFILE' | 'AWS_REGION' | 'DEPLOY_ENV' | 'IS_LOCAL' | 'NAMESPACE' | 'SHARED_INFRA_NAMESPACE' | 'OS_DOMAIN_ENDPOINT' | 'OS_READ_ROLE_ARN' | 'PGUSER' | 'PGDATABASE' | 'PGHOST' | 'PGHOST_RO'>> {}
}
export type EnvSchemaAsStrings = {
[Property in keyof CoercedEnvSchema]:
CoercedEnvSchema[Property] extends string ? CoercedEnvSchema[Property]
: (CoercedEnvSchema[Property] extends boolean ? ('true' | 'false') : string)
};
declare global {
// add types for global import.meta.env
interface ImportMetaEnv extends EnvSchemaAsStrings {}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
// add types for global process.env
namespace NodeJS {
interface ProcessEnv extends EnvSchemaAsStrings {}
}
}%
varlock version
0.7.0
Steps to reproduce
BUT, then no path:
What is expected?
cating the infra/env.d.ts would show TEST_A_B and TEST_A_C variablesWhat is actually happening?
generated .d.ts file is empty for .env.infra.schema for works for .env.schema
System Info
npx envinfo --system --npmPackages System: OS: macOS 26.4 CPU: (12) arm64 Apple M3 Pro Memory: 824.23 MB / 36.00 GB Shell: 5.9 - /bin/zsh npmPackages: @census/shared-core: workspace:^ => 0.1.0 @census/shared-infra: workspace:^ => 0.1.0 @types/aws-lambda: catalog: => 8.10.161 aws-cdk: catalog: => 2.1115.1 aws-cdk-lib: catalog: => 2.246.0 cdk-nag: catalog: => 2.37.55 constructs: catalog: => 10.6.0Any additional comments?
No response