Skip to content

Commit

Permalink
WIP: moving files out of lib and into requisite package directories -…
Browse files Browse the repository at this point in the history
… renaming file path references where neccessary
  • Loading branch information
patrick-fs committed Oct 1, 2020
1 parent 0ce3648 commit d7074a1
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 41 deletions.
2 changes: 1 addition & 1 deletion cdk.json
@@ -1,5 +1,5 @@
{
"app": "npx ts-node bin/reactshoppe-api.ts",
"app": "npx ts-node packages/stack/bin/reactshoppe-api.ts",
"context": {
"@aws-cdk/core:enableStackNameDuplicates": "true",
"aws-cdk:enableDiffNoFail": "true"
Expand Down
18 changes: 0 additions & 18 deletions lib/functions/package-lock.json

This file was deleted.

15 changes: 0 additions & 15 deletions lib/functions/package.json

This file was deleted.

@@ -1,7 +1,7 @@
import { APIGatewayProxyEvent } from 'aws-lambda';
import * as AWS from 'aws-sdk';
import { v4 as uuidv4 } from 'uuid';
import { TableNames } from '../reactshoppe-database';
import { TableNames } from '../reactshoppe-database/reactshoppe-database';
import { success, failure } from './response';

export default async (event: APIGatewayProxyEvent) => {
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion packages/functions/package.json
Expand Up @@ -6,5 +6,9 @@
"author": "Patrick Brandt <patrick@fullstory.com>",
"homepage": "https://github.com/patrick-fs/reactshoppe-api#readme",
"license": "ISC",
"main": "lib/functions.js"
"main": "functions.js",
"dependencies": {
"@types/uuid": "^8.0.0",
"uuid": "^8.1.0"
}
}
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,7 +9,7 @@ export class ReactshoppeApi extends core.Construct {

this.handler = new lambda.Function(this, 'ApiHandler', {
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.fromAsset('./lib/functions'), // this path is relative to the project root
code: lambda.Code.fromAsset('./packages/functions'), // this path is relative to the project root
handler: 'index.main',
});

Expand Down
File renamed without changes.
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import { ReactshoppeApiStack } from '../lib/reactshoppe-api-stack';
import { ReactshoppeApiStack } from '../reactshoppe-api-stack';

const app = new cdk.App();
new ReactshoppeApiStack(app, 'ReactshoppeApiStack', { description: 'Simple sample ecommerce service with New Relic' });
@@ -1,6 +1,6 @@
import * as cdk from '@aws-cdk/core';
import { ReactshoppeDatabase } from './reactshoppe-database';
import { ReactshoppeApi } from './reactshoppe-api';
import { ReactshoppeDatabase } from '../reactshoppe-database/reactshoppe-database';
import { ReactshoppeApi } from '../reactshoppe-api/reactshoppe-api';

export class ReactshoppeApiStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
Expand Down
2 changes: 1 addition & 1 deletion test/reactshoppe-api.test.ts
@@ -1,6 +1,6 @@
import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert';
import * as cdk from '@aws-cdk/core';
import * as ReactshoppeApi from '../lib/reactshoppe-api-stack';
import * as ReactshoppeApi from '../packages/stack/reactshoppe-api-stack';

test('Empty Stack', () => {
const app = new cdk.App();
Expand Down

0 comments on commit d7074a1

Please sign in to comment.