Skip to content

Commit 1f76b3b

Browse files
authored
Merge pull request #3 from reapit/migrate/replicate-key
migrate: ReplicatedKey
2 parents 9e30792 + 41515fa commit 1f76b3b

38 files changed

Lines changed: 1259 additions & 40 deletions

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage
2+
node_modules
3+
.yarn
4+
.vscode
5+
.github

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@
77
],
88
"scripts": {
99
"test": "jest",
10-
"check": "yarn workspaces foreach run check",
10+
"check": "tsc packages/**/*.ts --noEmit",
1111
"build": "yarn workspaces foreach run build",
12-
"lint": "yarn workspaces foreach run lint"
12+
"lint": "eslint packages",
13+
"root:lint": "eslint",
14+
"root:test": "jest",
15+
"root:check": "tsc"
1316
},
1417
"devDependencies": {
1518
"@jest/globals": "^29.7.0",
16-
"@types/eslint": "^8.44.2",
1719
"@types/jest": "^29.5.5",
18-
"@typescript-eslint/eslint-plugin": "^6.7.0",
19-
"@typescript-eslint/parser": "^6.7.0",
2020
"aws-sdk-client-mock": "^3.0.0",
2121
"aws-sdk-client-mock-jest": "^3.0.0",
2222
"eslint": "^8.49.0",
23-
"eslint-config-prettier": "^9.0.0",
24-
"eslint-plugin-prettier": "^5.0.0",
2523
"jest": "^29.7.0",
26-
"prettier": "^3.0.3",
2724
"ts-jest": "^29.1.1",
2825
"typescript": "^5.2.2"
2926
}

packages/common/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@reapit-cdk/eslint-config"],
4+
}

packages/common/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@reapit-cdk/common",
3+
"main": "src",
4+
"scripts": {
5+
"lint": "yarn run root:lint $PWD",
6+
"check": "yarn run root:check -p $PWD"
7+
},
8+
"devDependencies": {
9+
"@reapit-cdk/eslint-config": "workspace:^"
10+
}
11+
}

packages/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './regions'

packages/common/src/regions.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export const awsRegions = [
2+
'us-east-1',
3+
'us-east-2',
4+
'us-west-1',
5+
'us-west-2',
6+
'us-gov-west-1',
7+
'us-gov-east-1',
8+
'ca-central-1',
9+
'eu-north-1',
10+
'eu-west-1',
11+
'eu-west-2',
12+
'eu-west-3',
13+
'eu-central-1',
14+
'eu-south-1',
15+
'af-south-1',
16+
'ap-northeast-1',
17+
'ap-northeast-2',
18+
'ap-northeast-3',
19+
'ap-southeast-1',
20+
'ap-southeast-2',
21+
'ap-southeast-3',
22+
'ap-east-1',
23+
'ap-south-1',
24+
'ap-south-2',
25+
'sa-east-1',
26+
'me-south-1',
27+
'cn-north-1',
28+
'cn-northwest-1',
29+
] as const
30+
31+
export type AWSRegion = (typeof awsRegions)[number]
32+
33+
export const stringIsAWSRegion = (str: string): str is AWSRegion => awsRegions.includes(str as AWSRegion)

packages/common/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@reapit-cdk/tsconfig/base.json",
3+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: ["@reapit-cdk/eslint"],
3+
extends: ["@reapit-cdk/eslint-config"],
44
}

packages/custom-resource-wrapper/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
"main": "dist/index.js"
1717
},
1818
"scripts": {
19-
"check": "npx tsc",
20-
"lint": "npx eslint",
21-
"test": "cd ../ && yarn test packages/custom-resource-wrapper",
19+
"check": "yarn run root:check -p $PWD",
20+
"lint": "yarn run root:lint $PWD",
21+
"test": "yarn run root:test $PWD",
2222
"build": "reapit-cdk-tsup",
2323
"prepack": "reapit-version-package && yarn build"
2424
},
2525
"devDependencies": {
26-
"@reapit-cdk/eslint": "workspace:^",
26+
"@reapit-cdk/eslint-config": "workspace:^",
2727
"@reapit-cdk/tsup": "workspace:^",
2828
"@reapit-cdk/version-package": "workspace:^",
2929
"@types/aws-lambda": "^8.10.121",
30-
"aws-lambda": "1.0.7"
30+
"aws-lambda": "^1.0.7"
3131
}
3232
}

packages/eslint/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
parserOptions: {
2020
ecmaVersion: 'ESNext',
2121
sourceType: 'module',
22-
project: 'tsconfig.json',
22+
project: './packages/*/tsconfig.json',
2323
},
2424
plugins: ['@typescript-eslint', 'prettier'],
2525
ignorePatterns: [

0 commit comments

Comments
 (0)