Skip to content

Commit

Permalink
Merge 42c87ff into 0de42c8
Browse files Browse the repository at this point in the history
  • Loading branch information
kobanyan committed Mar 2, 2021
2 parents 0de42c8 + 42c87ff commit 813700e
Show file tree
Hide file tree
Showing 13 changed files with 2,572 additions and 2,523 deletions.
25 changes: 16 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
"sourceType": "module",
"ecmaVersion": 2021
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
"extends": ["eslint:recommended", "prettier"],
"overrides": [
{
"files": ["**/*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
]
}
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
6 changes: 2 additions & 4 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"**/*.{ts,tsx}": [
"eslint",
"prettier --parser typescript --write",
"git add"
"eslint"
],
"**/*.{js,jsx}": [
"eslint",
"prettier --write",
"git add"
"eslint"
]
}
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 12.20.1
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
- docker

node_js:
- 8
- 10
- 12

install:
- travis_retry yarn
Expand Down
2 changes: 1 addition & 1 deletion example/package.json → example/v1/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "serverless-plugin-dynamodb-pitr-example",
"name": "serverless-plugin-dynamodb-pitr-example-v1",
"version": "0.0.1",
"main": "index.js",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions example/serverless.yml → example/v1/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
service: serverless-plugin-dynamodb-pitr-example
service: serverless-plugin-dynamodb-pitr-example-v1

plugins:
localPath: '../../'
localPath: '../../../'
modules:
- serverless-plugin-dynamodb-pitr

Expand All @@ -25,7 +25,7 @@ resources:
KeySchema:
- AttributeName: id
KeyType: HASH
TableName: Example
TableName: IncludedTable
ExcludedTable:
Type: AWS::DynamoDB::Table
Properties:
Expand All @@ -35,7 +35,7 @@ resources:
KeySchema:
- AttributeName: id
KeyType: HASH
TableName: Example
TableName: ExcludedTable
WithoutPropertiesTable:
Type: AWS::DynamoDB::Table
SQSQueue:
Expand Down
15 changes: 15 additions & 0 deletions example/v2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "serverless-plugin-dynamodb-pitr-example-v2",
"version": "0.0.1",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "sls package"
},
"devDependencies": {
"@serverless/typescript": "^2.28.0",
"serverless": "^2.11.1",
"ts-node": "^9.1.1",
"typescript": "^4.2.2"
}
}
75 changes: 75 additions & 0 deletions example/v2/serverless.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import type { AWS } from '@serverless/typescript';

const serverlessConfiguration: AWS = {
service: 'serverless-plugin-dynamodb-pitr-example-v1',
frameworkVersion: '2',
custom: {
dynamodbPitr: {
ignore: ['ExcludedTable'],
},
},
plugins: {
localPath: '../../../',
modules: ['serverless-plugin-dynamodb-pitr'],
},
provider: {
name: 'aws',
runtime: 'nodejs12.x',
apiGateway: {
minimumCompressionSize: 1024,
shouldStartNameWithService: true,
},
environment: {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
},
lambdaHashingVersion: '20201221',
},
resources: {
Resources: {
IncludedTable: {
Type: 'AWS::DynamoDB::Table',
Properties: {
AttributeDefinitions: [
{
AttributeName: 'id',
AttributeType: 'S',
},
],
KeySchema: [
{
AttributeName: 'id',
KeyType: 'HASH',
},
],
TableName: 'IncludedTable',
},
},
ExcludedTable: {
Type: 'AWS::DynamoDB::Table',
Properties: {
AttributeDefinitions: [
{
AttributeName: 'id',
AttributeType: 'S',
},
],
KeySchema: [
{
AttributeName: 'id',
KeyType: 'HASH',
},
],
TableName: 'IncludedTable',
},
},
WithoutPropertiesTable: {
Type: 'AWS::DynamoDB::Table',
},
SQSQueue: {
Type: 'AWS::SQS::Queue',
},
},
},
};

module.exports = serverlessConfiguration;
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-plugin-dynamodb-pitr",
"version": "0.0.0-develop",
"version": "1.0.0",
"description": "Serverless DynamoDB PITR plugin",
"keywords": [
"serverless",
Expand All @@ -17,7 +17,7 @@
"bugs": {
"url": "https://github.com/kobanyan/serverless-plugin-dynamodb-pitr/issues"
},
"homepage": "https://github.com/kobanyan/serverless-plugin-dynamodb-pitr/tree/master/packages/serverless-plugin-dynamodb-pitr#readme",
"homepage": "https://github.com/kobanyan/serverless-plugin-dynamodb-pitr",
"main": "lib/index.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
Expand All @@ -35,29 +35,30 @@
"lint": "eslint 'src/**/*.ts' '*.js'",
"pretest": "run-p lint build",
"test": "jest",
"prepublishOnly": "run-s build"
"prepublishOnly": "run-s build",
"prepare": "husky install"
},
"devDependencies": {
"@types/jest": "^24.0.15",
"@types/serverless": "^1.18.2",
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^5.0.0",
"husky": "^2.4.1",
"jest": "^24.8.0",
"lint-staged": "^8.2.1",
"@types/jest": "^26.0.20",
"@types/serverless": "^1.78.20",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"husky": "^5.1.2",
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"rollup": "^1.16.2",
"rollup-plugin-sourcemaps": "^0.4.2",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.40.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.21.2",
"semantic-release": "^17.2.3",
"ts-jest": "^24.0.2",
"typescript": "^3.5.2"
"ts-jest": "^26.5.2",
"typescript": "^4.2.2"
},
"peerDependencies": {
"serverless": "^1.36.3"
"serverless": ">=1.36.3 <3.0.0"
}
}
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
file: 'lib/index.js',
format: 'cjs',
sourcemap: true,
exports: 'default',
},
{
file: 'lib/index.mjs',
Expand All @@ -18,6 +19,7 @@ export default {
plugins: [
typescript({
typescript: require('typescript'),
objectHashIgnoreUnknownHack: true,
}),
sourceMaps(),
],
Expand Down

0 comments on commit 813700e

Please sign in to comment.