Skip to content

Commit

Permalink
chore: synchronize package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-ci[bot] committed Dec 26, 2024
1 parent fb2b579 commit 956e395
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
12 changes: 5 additions & 7 deletions cdk/arch/lambda-s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ import {
environment,
lambdaRuntime,
memorySize,
stream,
stream
} from '../external/params'
import {
lambdaModifier
} from '../external/cdk-modifiers'
import { lambdaModifier } from '../external/cdk-modifiers'

export class CDKStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
Expand All @@ -43,10 +41,10 @@ export class CDKStack extends Stack {
memorySize,
timeout: Duration.seconds(30),
environment
});
})

// allow custom modification of CDK lambda function
lambdaModifier(lambdaFunction);
lambdaModifier(lambdaFunction)

const lambdaURL = lambdaFunction.addFunctionUrl({
authType: aws_lambda.FunctionUrlAuthType.NONE,
Expand Down
4 changes: 3 additions & 1 deletion cdk/external/cdk-modifiers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* $$__ADAPTER_IMPORTS__$$ */
import * as cdk from 'aws-cdk-lib'

export const lambdaModifier = (lambdaFunction: cdk.aws_lambda.Function) => {} /* $$__LAMBDA_MODIFIER__$$ */
export const lambdaModifier = (
lambdaFunction: cdk.aws_lambda.Function
) => {} /* $$__LAMBDA_MODIFIER__$$ */
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/jill64/sveltekit-adapter-aws.git",
"image": "https://opengraph.githubassets.com/000accb0cba21a8e7aeb7efe51fb468efe71c43a52fa53f55a0006fa70f840a7/jill64/sveltekit-adapter-aws"
"image": "https://opengraph.githubassets.com/1489952fa61841934c190807d164afd94b9086578affd2d39f61cbbc04d29741/jill64/sveltekit-adapter-aws"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 4 additions & 2 deletions packages/adapter/src/steps/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const setup = async ({ builder, tmp, options }: Context) => {
__DOMAIN_NAME__: options.domain?.fqdn ?? '',
__CERTIFICATE_ARN__: options.domain?.certificateArn ?? '',
__LAMBDA_RUNTIME__: options.runtime ?? 'NODE_LATEST',
'{} /* $$__ENVIRONMENT__$$ */': JSON.stringify(options.env ?? {}),
'{} /* $$__ENVIRONMENT__$$ */': JSON.stringify(options.env ?? {})
}
)

Expand All @@ -80,7 +80,9 @@ export const setup = async ({ builder, tmp, options }: Context) => {
path.join(options.out, 'external', 'cdk-modifiers.ts'),
{
'/* $$__ADAPTER_IMPORTS__$$ */': options.adapterImports?.join('\n') ?? '',
'(lambdaFunction: cdk.aws_lambda.Function) => {} /* $$__LAMBDA_MODIFIER__$$ */': options.lambdaModifier?.toString() ?? '(lambdaFunction: cdk.aws_lambda.Function) => {}'
'(lambdaFunction: cdk.aws_lambda.Function) => {} /* $$__LAMBDA_MODIFIER__$$ */':
options.lambdaModifier?.toString() ??
'(lambdaFunction: cdk.aws_lambda.Function) => {}'
}
)

Expand Down
4 changes: 2 additions & 2 deletions packages/adapter/src/types/AdapterOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type AdapterOptions = {
certificateArn: string
}
/**
* Adds imports to the adapter params.ts to allow things like `lambdaModifier`
* Adds imports to the adapter params.ts to allow things like `lambdaModifier`
* to access types
* @example ["import { Stack } from 'aws-cdk-lib'"]
*/
Expand All @@ -107,5 +107,5 @@ export type AdapterOptions = {
* }
* ```
*/
lambdaModifier?: (lambdaFunction: aws_lambda.Function) => { }
lambdaModifier?: (lambdaFunction: aws_lambda.Function) => {}
}
4 changes: 2 additions & 2 deletions packages/site/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const config = {
KEY3: 'VALUE3'
},
stream: process.env.BUFFERED_RESPONSE !== 'TRUE',
adapterImports: [ "import { Stack } from 'aws-cdk-lib'" ],
adapterImports: ["import { Stack } from 'aws-cdk-lib'"],
lambdaModifier: (fn) => {
const stack = Stack.of(fn)
fn.addEnvironment("abc", "def")
fn.addEnvironment('abc', 'def')
}
})
}
Expand Down

0 comments on commit 956e395

Please sign in to comment.