Skip to content

Commit

Permalink
chore: minor nits
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed May 3, 2024
1 parent be9c205 commit 057bc64
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .codebuild/e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ batch:
variables:
TEST_SUITE: src/__tests__/graphql-generator-gen2.test.ts
CLI_REGION: us-west-2
debug-session: true
depend-on:
- publish_to_local_registry
- identifier: w_graphql_generator_gen2
Expand All @@ -96,7 +95,7 @@ batch:
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: src/__tests__/graphql-generator-gen2.test.ts
CLI_REGION: us-west-2
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
Expand Down
3 changes: 1 addition & 2 deletions .codebuild/e2e_workflow_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ batch:
variables:
TEST_SUITE: src/__tests__/graphql-generator-gen2.test.ts
CLI_REGION: us-west-2
debug-session: true
depend-on:
- publish_to_local_registry
- identifier: w_graphql_generator_gen2
Expand All @@ -96,7 +95,7 @@ batch:
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: src/__tests__/graphql-generator-gen2.test.ts
CLI_REGION: us-west-2
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
3 changes: 1 addition & 2 deletions .codebuild/run_gen2_e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ phases:
build:
commands:
- source ./shared-scripts.sh && _setupGen2E2ETestsLinux
- codebuild-breakpoint
- source ./shared-scripts.sh && _runGen2E2ETestsLinux
post_build:
commands:
Expand All @@ -21,4 +20,4 @@ phases:
artifacts:
files:
- '**/*'
base-directory: $CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
base-directory: $CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/amplify-e2e-reports
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const handler: Schema["echoMutation"]["functionHandler"] = async (event,
createdAt: performance.now().toString(),
updatedAt: performance.now().toString(),
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const handler: Schema["echoQuery"]["functionHandler"] = async (event, con
content: `Echoing content: ${event.arguments.content}`,
executionDuration: performance.now() - start
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type CodegenPackage = 'GraphqlGenerator' | 'TypeGen';
const codegenPackageDirectoryMap: Record<CodegenPackage, string> = {
GraphqlGenerator: path.join(__dirname, '..', '..', '..', 'graphql-generator'),
TypeGen: path.join(__dirname, '..', '..', '..', 'graphql-types-generator'),
}
};

/**
* Copy the backend data snapshot into the generated app location.
Expand Down Expand Up @@ -81,7 +81,7 @@ const overrideWithLocalCodegenPackages = (cwd: string): void => {
'@aws-amplify/graphql-types-generator': codegenPackageDirectoryMap['TypeGen'],
};
writeFileSync(path.join(cwd, 'package.json'), JSON.stringify(packageJsonObj));
}
};

export const sandboxDeploy = async (cwd: string, props: Gen2DeployProps = {}): Promise<void> => {
const noOutputTimeout = props?.timeoutMs ?? 10 * 60 * 1000;
Expand All @@ -106,15 +106,15 @@ export const sandboxDeploy = async (cwd: string, props: Gen2DeployProps = {}): P
.wait('Would you like to delete all the resources in your sandbox environment')
.sendLine('N')
.runAsync();
}
};

export const deleteSandbox = async (cwd: string): Promise<void> => {
await
spawn(getNpxPath(), ['ampx', 'sandbox', 'delete'], { cwd, stripColors: true })
.wait('Are you sure you want to delete all the resources in your sandbox environment')
.sendLine('Y')
.runAsync();
}
};

/**
* Commands for ampx generate
Expand Down Expand Up @@ -149,7 +149,7 @@ const getClientCodegenParams = (props: ClientCodegenConfig): string[] => {
default:
return params;
}
}
};

export const generateGraphqlClientCode = async (cwd: string, props: ClientCodegenConfig): Promise<void> => {
await
Expand All @@ -158,7 +158,7 @@ export const generateGraphqlClientCode = async (cwd: string, props: ClientCodege
['ampx', 'generate', 'graphql-client-code', ...getClientCodegenParams(props)],
{ cwd, stripColors: true },
).runAsync();
}
};

export const generateForms = async (cwd: string, props: any = {}): Promise<void> => {
await
Expand All @@ -167,7 +167,7 @@ export const generateForms = async (cwd: string, props: any = {}): Promise<void>
['ampx', 'generate', 'forms'],
{ cwd, stripColors: true },
).runAsync();
}
};

export const generateOutputs = async (cwd: string, props: any = {}): Promise<void> => {
await
Expand All @@ -176,4 +176,4 @@ export const generateOutputs = async (cwd: string, props: any = {}): Promise<voi
['ampx', 'generate', 'outputs'],
{ cwd, stripColors: true },
).runAsync();
}
};
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './commands';
export * from './test-graphql-client-codegen';
export * from './test-graphql-client-codegen';
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const testGraphqlClientCodegen = async (projectRoot: string, config: Clie
await expect(generateGraphqlClientCode(projectRoot, config)).resolves.not.toThrow();

expect(isNotEmptyDir(outputPath)).toBe(true);
}
};

0 comments on commit 057bc64

Please sign in to comment.