Skip to content

Commit 2d32f2f

Browse files
authored
Merge branch 'v1' into patch-1
2 parents 4f24f4f + f6dbc6b commit 2d32f2f

File tree

12 files changed

+621
-58
lines changed

12 files changed

+621
-58
lines changed

.github/ISSUE_TEMPLATE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Actual Behaviour**
2+
3+
Please state here what is currently happening.
4+
5+
**Expected Behaviour**
6+
7+
State here what the feature should enable the user to do.
8+
9+
**Steps to reproduce it**
10+
11+
Add steps to reproduce bugs or add information on the place where the feature should be implemented. Add links to a sample deployment or code.
12+
13+
**LogCat for the issue**
14+
15+
Provide logs for the crash here
16+
17+
**Screenshots of the issue**
18+
19+
Where-ever possible attach a screenshot of the issue.
20+
21+
**Would you like to work on the issue?**
22+
23+
Please let us know if you can work on it or the issue should be assigned to someone else.

.github/PULL_REQUEST_TEMPLATE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fixes issue #[Add issue number here. If you do not solve the issue entirely, please change the message e.g. "First steps for issues #IssueNumber]
2+
3+
Changes: [Add here what changes were made in this issue and if possible provide links.]
4+
5+
Demo Link: [Add here the link where your changes can be seen]
6+
7+
Screenshots for the change:

.travis.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,44 @@ node_js:
44

55
sudo: false
66

7+
before_install:
8+
- cd test
9+
- mkdir sample-template
10+
- cd sample-template
11+
- npm init --yes
12+
713
install:
14+
- npm install --save-dev serverless-offline
15+
- npm install -g [email protected]
16+
- npm install aws-sdk
17+
- npm install --save dynamodb-doc-client-wrapper
18+
- serverless create --template aws-nodejs
19+
- cd ..
20+
- cd ..
21+
- npm link
22+
- cd test/sample-template/node_modules
23+
- npm link serverless-dynamodb-local
24+
- cd ..
25+
- sed -i '18 a plugins:' serverless.yml
26+
- sed -i '19 a - serverless-offline' serverless.yml
27+
- sed -i '20 a - serverless-dynamodb-local' serverless.yml
28+
- cd ..
29+
- cd ..
30+
- npm install --save-dev mocha
31+
- npm install --save-dev should
32+
- npm install --save expect
33+
- npm install --save request
34+
- npm install --save chai
835
- travis_retry npm install
36+
- cd test/sample-template
937

38+
before_script:
39+
- sls dynamodb install
40+
- sls offline start &
41+
- sleep 15
42+
- cd ..
43+
- cd ..
44+
- npm run test
45+
1046
script:
11-
- npm test
47+
- npm test

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ serverless-dynamodb-local
33

44
[![Join the chat at https://gitter.im/99xt/serverless-dynamodb-local](https://badges.gitter.im/99xt/serverless-dynamodb-local.svg)](https://gitter.im/99xt/serverless-dynamodb-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55
[![npm version](https://badge.fury.io/js/serverless-dynamodb-local.svg)](https://badge.fury.io/js/serverless-dynamodb-local)
6-
[![license](https://img.shields.io/npm/l/serverless-dynamodb-local.svg)](https://www.npmjs.com/package/serverless-dynamodb-local)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

88
## This Plugin Requires
99
@@ -51,20 +51,32 @@ All CLI options are optional:
5151
--sharedDb -h DynamoDB will use a single database file, instead of using separate files for each credential and region. If you specify -sharedDb, all DynamoDB clients will interact with the same set of tables regardless of their region and credential configuration.
5252
--delayTransientStatuses -t Causes DynamoDB to introduce delays for certain operations. DynamoDB can perform some tasks almost instantaneously, such as create/update/delete operations on tables and indexes; however, the actual DynamoDB service requires more time for these tasks. Setting this parameter helps DynamoDB simulate the behavior of the Amazon DynamoDB web service more closely. (Currently, this parameter introduces delays only for global secondary indexes that are in either CREATING or DELETING status.)
5353
--optimizeDbBeforeStartup -o Optimizes the underlying database tables before starting up DynamoDB on your computer. You must also specify -dbPath when you use this parameter.
54+
--migration -m After starting dynamodb local, run dynamodb migrations.
55+
--heapInitial The initial heap size
56+
--heapMax The maximum heap size
5457
--migrate -m After starting DynamoDB local, create DynamoDB tables from the Serverless configuration.
5558
--seed -s After starting and migrating dynamodb local, injects seed data into your tables. The --seed option determines which data categories to onload.
59+
--convertEmptyValues -e Set to true if you would like the document client to convert empty values (0-length strings, binary buffers, and sets) to be converted to NULL types when persisting to DynamoDB.
5660
```
5761

5862
All the above options can be added to serverless.yml to set default configuration: e.g.
5963

6064
```yml
6165
custom:
6266
dynamodb:
67+
# If you only want to use DynamoDB Local in some stages, declare them here
68+
stages:
69+
- dev
6370
start:
6471
port: 8000
6572
inMemory: true
73+
heapInitial: 200m
74+
heapMax: 1g
6675
migrate: true
6776
seed: true
77+
convertEmptyValues: true
78+
# Uncomment only if you already have a DynamoDB running locally
79+
# noStart: true
6880
```
6981

7082
## Migrations: sls dynamodb migrate
@@ -95,13 +107,18 @@ resources:
95107
WriteCapacityUnits: 1
96108
```
97109

110+
**Note:**
111+
DynamoDB local doesn't support TTL specification, therefore plugin will simply ignore ttl configuration from Cloudformation template.
112+
98113
## Seeding: sls dynamodb seed
99114
### Configuration
100115

101116
In `serverless.yml` seeding categories are defined under `dynamodb.seed`.
102117

103118
If `dynamodb.start.seed` is true, then seeding is performed after table migrations.
104119

120+
If you wish to use raw AWS AttributeValues to specify your seed data instead of Javascript types then simply change the variable of any such json files from `sources:` to `rawsources:`.
121+
105122
```yml
106123
dynamodb:
107124
start:
@@ -117,7 +134,7 @@ dynamodb:
117134
test:
118135
sources:
119136
- table: users
120-
sources: [./fake-test-users.json]
137+
rawsources: [./fake-test-users.json]
121138
- table: subscriptions
122139
sources: [./fake-test-subscriptions.json]
123140
```
@@ -181,6 +198,17 @@ Make sure that `serverless-dynamodb-local` is above `serverless-offline` so it w
181198

182199
Now your local DynamoDB database will be automatically started before running `serverless offline`.
183200

201+
### Using with serverless-offline and serverless-webpack plugin
202+
Run `serverless offline start`. In comparison with `serverless offline`, the `start` command will fire an `init` and a `end` lifecycle hook which is needed for serverless-offline and serverless-dynamodb-local to switch off both ressources.
203+
204+
Add plugins to your `serverless.yml` file:
205+
```yaml
206+
plugins:
207+
- serverless-webpack
208+
- serverless-dynamodb-local
209+
- serverless-offline #serverless-offline needs to be last in the list
210+
```
211+
184212
## Reference Project
185213
* [serverless-react-boilerplate](https://github.com/99xt/serverless-react-boilerplate)
186214

0 commit comments

Comments
 (0)