Skip to content

Commit 8b89ef2

Browse files
author
Benjamin Weigel
committed
Adds .npmignore
Fixes some spelling Extends package.json
1 parent 051cd14 commit 8b89ef2

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/patches/
2+
*.log
3+
*.iml
4+
*.patch
5+
/.idea/
6+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This plugin was originally built to allow deployment of arbitrarily nested pytho
1111

1212
### The Problem
1313

14-
Vanilla serverless packages your source-code, but retains the folder structure inside the zip-file. However, AWS Lambda can only find the entry-point to your function if it is packaged in a zip-files at root level (see [the AWW-Lambda docs](http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html)).
14+
Vanilla serverless packages your source-code, but retains the folder structure inside the zip-file. However, AWS Lambda can only find the entry-point to your function if it is packaged in a zip-files at root level (see [the AWS-Lambda docs](http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html)).
1515

1616
### How it was solved
1717

@@ -28,7 +28,7 @@ You define a `path` that you want to package inside of serverless's `package` pr
2828
```yaml
2929
...
3030
functions:
31-
myFunctin:
31+
myFunction:
3232
...
3333
package:
3434
path: path/to/my/code

lib/test/index.test.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
//TODO: To fix tests find out how to mock serverless
2+
13
const scpp = require('../../lib/index.js');
24
const chai = require('chai');
35
const serverless = require('serverless');
46
const expect = chai.expect;
57

6-
const sls = {
8+
const config = {
79
service: {
810
functions: {
911
test_function: {
@@ -17,13 +19,14 @@ const sls = {
1719
}
1820
}
1921
};
20-
//const instance = new scpp(sls, {});
21-
const instance = new serverless(sls, {});
22+
23+
const serverless_ = new serverless(config, {});
24+
const instance = new scpp(serverless_, {});
2225

2326
console.log(instance);
2427

2528
describe('custom packaging', function () {
26-
const functions = sls.service.functions;
29+
const functions = instance.service.functions;
2730
describe('#getFnSourceDir(functionObject)', function () {
2831
it('should return the right value', async () => {
2932
const result = await instance.getFnSourceDir(functions.test_function);

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "serverless-custom-python-packaging-plugin",
2+
"name": "serverless-custom-packaging-plugin",
33
"version": "0.1.0",
44
"description": "Plugin for the Serverless Framework - Packages your sourcecode using a custom target path inside the zip. Related to https://github.com/serverless/serverless/issues/3366",
5-
"main": "index.js",
5+
"main": "lib/index.js",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/...."
8+
"url": "https://github.com/hypoport/serverless-custom-packaging-plugin"
99
},
1010
"scripts": {
1111
"test": "find . -name '*.test.js' | xargs mocha -R spec --require ./lib/index.js"
@@ -19,14 +19,14 @@
1919
"README.md"
2020
],
2121
"dependencies": {
22-
"archiver": "^1.1.0",
23-
"bluebird": "^3.5.0"
22+
"archiver": "^1.1.0"
2423
},
2524
"devDependencies": {
2625
"chai": "^4.1.0",
2726
"mocha": "^3.4.2",
27+
"serverless": "1.17.0",
2828
"should": "^11.2.1",
29-
"serverless": "1.17.0"
29+
"sinon": "^3.2.0"
3030
},
3131
"author": "benjamin.weigel@europace.de",
3232
"license": "MIT"

0 commit comments

Comments
 (0)