-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
4,598 additions
and
12,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
PRISMA_CONNECTION_LIMIT=5 | ||
PRISMA_CONNECTION_LIMIT=15 | ||
CREATE_AURORA_DATABASE=true | ||
|
||
# for local dev environments which use docker-compose, you can disable running migrations in AWS by setting this to false | ||
# if you want to automatically run DB migrations on deployed environments | ||
# (does not apply to local dev) | ||
RUN_DB_MIGRATIONS=true | ||
|
||
# set this for non-local-dev stages to your web URL | ||
# WEB_DOMAIN= | ||
# e.g. WEB_DOMAIN=d3s9sdc942lbai.cloudfront.net | ||
|
||
# set this to enable a bastion EC2 host you can tunnel through to connect to the database | ||
# create a keypair in your desired account and region and add the name here | ||
# SSH_KEYPAIR_NAME= | ||
|
||
# set this for non-local-dev stages to your web URL | ||
# WEB_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
IS_PRODUCTION=true | ||
|
||
# WEB_URL=https://mysite.com | ||
# assumes you have a hosted zone set up in Route53 | ||
# HOSTED_ZONE=mysite.com | ||
# WEB_DOMAIN=mysite.com |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Generate release for tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
generateReleaseNotes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build on push | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
# don't run if a tag was pushed | ||
tags-ignore: | ||
- "v*" | ||
|
||
# don't run if only package.json (version) was updated | ||
paths-ignore: | ||
- "package.json" | ||
|
||
# This will cancel the workflow https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-test: | ||
uses: ./.github/workflows/build-and-test.yml | ||
|
||
# enable if PAT is provided | ||
# update-version: | ||
# # if on production branch, bump version | ||
# if: github.ref == 'refs/heads/prod' | ||
# needs: build-and-test | ||
# uses: ./.github/workflows/update-version.yml | ||
# secrets: | ||
# # personal token is required to trigger other workflows | ||
# RELEASE_PAT: ${{ secrets.RELEASE_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Bump version and tag | ||
|
||
name: Update version and tag | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
RELEASE_PAT: | ||
# personal token is required to trigger other workflows | ||
required: true | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-version: | ||
name: Update version and tag | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.RELEASE_PAT }} | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9 | ||
- name: Generate new version | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "github-bot" | ||
pnpm version patch | ||
- name: Push new version | ||
run: git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} | ||
- name: Push new tag | ||
run: git push --tags | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,7 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
!jest.config.js | ||
|
||
# TSC build output | ||
/dist | ||
|
||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
tabWidth: 2 | ||
semi: true | ||
semi: false | ||
printWidth: 120 | ||
trailingComma: es5 | ||
trailingComma: all | ||
singleQuote: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import { testCallResolver } from '../../util/testResolver'; | ||
import { GREETING } from './greeting'; | ||
|
||
const { getGreeting, greetInner } = await import('./greeting'); | ||
import { testCallResolver } from '../../util/testResolver' | ||
import { getGreeting, GREETING, greetInner } from './greeting' | ||
|
||
describe('Greeting resolvers', () => { | ||
it('gets current greeting', async () => { | ||
const greeting = await testCallResolver({ | ||
args: {}, | ||
resolverFunc: getGreeting, | ||
}); | ||
expect(greeting.currentGreeting).toBe(GREETING); | ||
}); | ||
const greeting = getGreeting() | ||
expect(greeting.currentGreeting).toBe(GREETING) | ||
}) | ||
|
||
it('greets user by name', async () => { | ||
const greeting = await testCallResolver({ | ||
userName: 'cognitoUsername', | ||
args: { name: 'Lebowski' }, | ||
resolverFunc: greetInner, | ||
}); | ||
expect(greeting.greeting).toBe(`${GREETING}, Lebowski!`); | ||
}); | ||
}); | ||
}) | ||
expect(greeting.greeting).toBe(`${GREETING}, Lebowski!`) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { defaultAppSyncMiddleware } from '@backend/middleware/lambda'; | ||
import { logger } from '@backend/util/logger'; | ||
import { incrementMetric } from '@backend/util/metrics'; | ||
import { AppSyncResolverEvent } from 'aws-lambda'; | ||
import { GQL } from '@common/index'; | ||
import { defaultAppSyncMiddleware } from '@backend/middleware/lambda' | ||
import { logger } from '@backend/util/logger' | ||
import { incrementMetric } from '@backend/util/metrics' | ||
import { AppSyncResolverEvent } from 'aws-lambda' | ||
import { GreetingResponse, GreetingState, MutationGreetArgs } from '@common/generated/graphql/graphql' | ||
|
||
export const GREETING = 'Yo yo'; | ||
export const GREETING = 'Yo yo' | ||
|
||
// sample query | ||
export const getGreeting = (): GQL.GreetingState => ({ | ||
export const getGreeting = (): GreetingState => ({ | ||
currentGreeting: GREETING, | ||
}); | ||
}) | ||
|
||
// sample mutation | ||
export const greetInner = async ({ | ||
arguments: { name }, | ||
}: AppSyncResolverEvent<GQL.MutationGreetArgs>): Promise<GQL.GreetingResponse> => { | ||
incrementMetric('SaidHello'); | ||
logger.debug('Saying greeting to', { name }); | ||
}: AppSyncResolverEvent<MutationGreetArgs>): Promise<GreetingResponse> => { | ||
incrementMetric('SaidHello') | ||
logger.debug('Saying greeting to', { name }) | ||
|
||
return { | ||
greeting: `${GREETING}, ${name}!`, | ||
}; | ||
}; | ||
export const greet = defaultAppSyncMiddleware()(greetInner); | ||
} | ||
} | ||
export const greet = defaultAppSyncMiddleware()(greetInner) |
Oops, something went wrong.