melodic-angle-86693
09/20/2023, 9:56 AMtypes/index.d.ts
file, and I added it to tsconfig.json
. Here is the file:
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"include": [
"infra",
"types"
],
"exclude": [
"node_modules",
"vendor",
"dist"
]
}
I have the impression that Pulumi is ignoring my config. Does anybody see what may be wrong on my setup? VSCode’s TS server finds the .d.ts
declaration and doesn’t show the error I get when running pulumi up
.clever-sunset-76585
09/21/2023, 12:15 AMtypes/index.d.ts
?melodic-angle-86693
09/21/2023, 4:32 AMdeclare module "@bref.sh/layers" {
function fpmLayerArn(
region: string,
version: string,
architecture?: string,
): string;
}
compilerOptions.rootDirs
and compilerOptions.typeRoots
and still erroring 😕PULUMI_NODEJS_TYPESCRIPT=true PULUMI_NODEJS_TSCONFIG_PATH=tsconfig.json pulumi up
and it doesn’t workstrict
and noImplicitAny
😕clever-sunset-76585
09/21/2023, 9:28 AMtypes/index.d.ts
and not your TS configuration. Also I see that the original source contains JSDoc for that function which should provide the type hints that your module is trying to provide. Are you simply trying to add type-safety for that function or trying to fix some other problem?melodic-angle-86693
09/21/2023, 9:29 AMimport { fpmLayerArn } from "@bref.sh/layers";
// ...
export const wordpressServer = new aws.lambda.Function(
"wordpress-server",
{
role: wordpressServerRole.arn,
runtime: "provided.al2",
layers: [fpmLayerArn("us-east-1", "8.2")],
s3Bucket: wordpressBucket.bucket,
s3Key: wordpressCode.key,
handler: "lambda-handler.php",
memorySize: 1024,
sourceCodeHash: wordpressCode.sourceHash.toString(),
},
{
dependsOn: [wordpressServerRole, wordpressBucket, wordpressCode],
},
);
noImplicitAny
for now. I’ll try to look into this in the future though. Thanks for helping me out here!clever-sunset-76585
09/21/2023, 10:14 AMtsconfig.json
file. Your module declaration is indeed correct. You might try include: ["***/**.ts"]
in your config.