Skip to content

Commit

Permalink
fix(build): fix lambda/function builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Dec 5, 2024
1 parent 9161528 commit 6170d57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/whook-aws-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import type {
import type { OpenAPIV3_1 } from 'openapi-types';
import type { LogService } from 'common-services';
import type { CprOptions } from 'cpr';
import { parseArgs } from '@whook/whook/dist/libs/args.js';

export type {
LambdaConsumerInput,
Expand Down Expand Up @@ -137,12 +138,13 @@ const cprAsync = promisify(cpr) as (
export async function prepareBuildEnvironment<T extends Knifecycle>(
$: T = new Knifecycle() as T,
): Promise<T> {
$.register(
constant('INITIALIZER_PATH_MAP', DEFAULT_BUILD_INITIALIZER_PATH_MAP),
);
$.register(initInitializerBuilder);
$.register(initBuildAutoloader);
$.register(initCompiler);
$.register(
constant('INITIALIZER_PATH_MAP', DEFAULT_BUILD_INITIALIZER_PATH_MAP),
);
$.register(constant('args', parseArgs([])));
$.register(constant('PORT', 1337));
$.register(constant('HOST', 'localhost'));

Expand Down
8 changes: 5 additions & 3 deletions packages/whook-gcp-functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import type {
import type { OpenAPIV3_1 } from 'openapi-types';
import type { LogService } from 'common-services';
import type { CprOptions } from 'cpr';
import { parseArgs } from '@whook/whook/dist/libs/args.js';

export const DEFAULT_BUILD_PARALLELISM = 10;
export const DEFAULT_BUILD_INITIALIZER_PATH_MAP = {
Expand Down Expand Up @@ -58,12 +59,13 @@ const cprAsync = promisify(cpr) as (
export async function prepareBuildEnvironment<T extends Knifecycle>(
$: T = new Knifecycle() as T,
): Promise<T> {
$.register(
constant('INITIALIZER_PATH_MAP', DEFAULT_BUILD_INITIALIZER_PATH_MAP),
);
$.register(initInitializerBuilder);
$.register(initBuildAutoloader);
$.register(initCompiler);
$.register(
constant('INITIALIZER_PATH_MAP', DEFAULT_BUILD_INITIALIZER_PATH_MAP),
);
$.register(constant('args', parseArgs([])));
$.register(constant('PORT', 1337));
$.register(constant('HOST', 'localhost'));

Expand Down

0 comments on commit 6170d57

Please sign in to comment.