Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic function implementation #87

Merged
merged 9 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/backend-function/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ import { AmplifyFunctionProps } from '@aws-amplify/function-construct';
import { ConstructFactory } from '@aws-amplify/plugin-types';
import { ConstructFactoryGetInstanceProps } from '@aws-amplify/plugin-types';

// @public
export class AmplifyFunctionFactory implements ConstructFactory<AmplifyFunction> {
static build(props: AmplifyFunctionFactoryBuildProps): Promise<AmplifyFunctionFactory>;
static fromDir(props: AmplifyFunctionFactoryFromDirProps): AmplifyFunctionFactory;
getInstance({ constructContainer, }: ConstructFactoryGetInstanceProps): AmplifyFunction;
Comment on lines +14 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

factory method to produce factory that produces something :-)

}

// @public (undocumented)
export type AmplifyFunctionBaseProps = {
export type AmplifyFunctionFactoryBaseProps = {
name: string;
};

// @public (undocumented)
export type AmplifyFunctionBuildProps = AmplifyFunctionBaseProps & Omit<AmplifyFunctionProps, 'absoluteCodePath'> & {
export type AmplifyFunctionFactoryBuildProps = AmplifyFunctionFactoryBaseProps & Omit<AmplifyFunctionProps, 'absoluteCodePath'> & {
buildCommand: string;
outDir: string;
};

// @public
export class AmplifyFunctionFactory implements ConstructFactory<AmplifyFunction> {
static build(props: AmplifyFunctionBuildProps): Promise<AmplifyFunctionFactory>;
static fromDir(props: AmplifyFunctionFromDirProps): AmplifyFunctionFactory;
getInstance({ constructContainer, }: ConstructFactoryGetInstanceProps): AmplifyFunction;
}

// @public (undocumented)
export type AmplifyFunctionFromDirProps = AmplifyFunctionBaseProps & Omit<AmplifyFunctionProps, 'absoluteCodePath'> & {
export type AmplifyFunctionFactoryFromDirProps = AmplifyFunctionFactoryBaseProps & Omit<AmplifyFunctionProps, 'absoluteCodePath'> & {
codePath: string;
};

Expand Down
2 changes: 2 additions & 0 deletions packages/backend-function/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class AmplifyFunctionFactory

/**
* Create a function by executing a build command that places build artifacts at a specified location
*
* TODO: Investigate long-term function building strategy: https://github.com/aws-amplify/samsara-cli/issues/92
*/
static async build(
props: AmplifyFunctionFactoryBuildProps
Expand Down