Skip to content

Instantly share code, notes, and snippets.

@babie
Created May 27, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save babie/feb8a506daaa253fd8018f72e2c932dc to your computer and use it in GitHub Desktop.
Save babie/feb8a506daaa253fd8018f72e2c932dc to your computer and use it in GitHub Desktop.
{
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
"testPathIgnorePatterns": [
"<rootDir>/src/",
"<rootDir>/build/",
"<rootDir>/dist/",
"<rootDir>/node_modules/"
]
}
{
"name": "example",
"version": "0.1.0",
"private": true,
"homepage": "https://example.com",
"proxy": "http://localhost:3001",
"dependencies": {
"aws-serverless-express": "^3.2.0",
"express": "^4.16.3",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-scripts-ts": "2.16.0"
},
"scripts": {
"start": "run-p start:aws start:cra",
"start:aws": "sam local start-api -p 3001 --static-dir dist",
"start:cra": "react-scripts-ts start",
"build": "run-p build:aws build:cra",
"build:aws": "run-s clear:aws compile:aws",
"build:cra": "run-s clear:cra compile:cra",
"compile": "run-p compile:aws compile:cra",
"compile:aws": "tsc --project tsconfig.aws.json && cp -r node_modules dist",
"compile:cra": "react-scripts-ts build",
"clear": "run-p clear:aws clear:cra",
"clear:aws": "rm -rf dist",
"clear:cra": "rm -rf build",
"test": "run-p test:aws test:cra",
"test:aws": "jest --config=jestconfig.aws.json",
"test:cra": "react-scripts-ts test --env=jsdom",
"lint": "run-p lint:aws lint:cra",
"lint:aws": "tslint --project tsconfig.aws.json",
"lint:cra": "tslint --project tsconfig.json",
"format": "run-p format:aws format:cra",
"format:aws": "tslint --project tsconfig.aws.json --fix",
"format:cra": "tslint --project tsconfig.json --fix",
"eject": "react-scripts-ts eject"
},
"devDependencies": {
"@types/aws-serverless-express": "^3.0.1",
"@types/express": "^4.11.1",
"@types/jest": "^22.2.3",
"@types/node": "^10.1.2",
"@types/react": "^16.3.14",
"@types/react-dom": "^16.0.5",
"@types/supertest": "^2.0.4",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-standard": "^3.1.0",
"npm-run-all": "^4.1.3",
"prettier": "^1.12.1",
"supertest": "^3.1.0",
"tslint": "^5.10.0",
"tslint-config-airbnb": "^5.9.2",
"tslint-config-prettier": "^1.13.0",
"tslint-config-standard": "^7.0.0",
"tslint-language-service": "^0.9.9",
"tslint-plugin-prettier": "^1.3.0",
"tslint-react": "^3.6.0",
"typescript": "^2.8.3"
}
}
AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::Serverless-2016-10-31
- AWS::CodeStar
Parameters:
ProjectId:
Type: String
Description: AWS CodeStar projectID used to associate new resources to team members
# Enable blue/green deployments using this Globals section. For instructions, see the AWS CodeStar User Guide:
# https://docs.aws.amazon.com/codestar/latest/userguide/how-to-modify-serverless-project.html?icmpid=docs_acs_rm_tr
#
# Globals:
# Function:
# AutoPublishAlias: live
# DeploymentPreference:
# Enabled: true
# Type: Canary10Percent5Minutes
Resources:
HelloWorld:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist
Handler: index.handler
Runtime: nodejs8.10
Environment:
Variables:
NODE_ENV: production
Role:
Fn::ImportValue:
!Join ['-', [!Ref 'ProjectId', !Ref 'AWS::Region', 'LambdaTrustRole']]
Events:
GetEvent:
Type: Api
Properties:
Path: /
Method: get
PostEvent:
Type: Api
Properties:
Path: /
Method: post
{
"extends": "./tsconfig.prod.json",
"compilerOptions": {
"outDir": "dist",
"sourceMap": false,
"rootDir": "."
},
"exclude": [
"src",
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment