Skip to content

Commit 9bd94ce

Browse files
committed
cleaning example and console.logs
1 parent ecc7d2c commit 9bd94ce

File tree

7 files changed

+9
-29
lines changed

7 files changed

+9
-29
lines changed
File renamed without changes.

example/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "@vibou/map-reduce-example",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"main": "index.js",
55
"license": "MIT",
66
"scripts": {
7-
"workflow": "sls step-functions-offline -l --stateMachine=map_reduce --event='./event.json' --lambdaEndpoint http://localhost:3002",
7+
"workflow": "sls step-functions-offline --lambdaEndpoint http://localhost:3002",
8+
"workflow:map_reduce": "yarn workflow --stateMachine=map_reduce --event='./event_map_reduce.json'",
89
"invoke:producer": "sls invoke local --stage=local -f producer --path './event.json'",
910
"start": "sls offline start"
1011
},
@@ -13,4 +14,4 @@
1314
"serverless-offline": "^11.1.3",
1415
"serverless-step-functions": "^3.10.0"
1516
}
16-
}
17+
}

example/serverless.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ custom:
2929
MappingFunction: mapper
3030

3131
functions:
32-
${file(functions.yml)}
32+
${file(sls_functions.yml)}
3333

3434
stepFunctions:
3535
stateMachines:
36-
map_reduce:
36+
map_reduce:
3737
definition:
3838
Comment: 'Export a PDF document for the given dashboard'
3939
StartAt: Producer
40-
States: ${file(states.yml)}
40+
States: ${file(sls_map_reduce.yml)}
4141

File renamed without changes.
File renamed without changes.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vibou/serverless-step-functions-offline",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "Serverlesss plugin to support step function offline",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -65,4 +65,4 @@
6565
"files": [
6666
"dist/**/*"
6767
]
68-
}
68+
}

src/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -304,26 +304,6 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
304304
throw new this.serverless.classes.Error(`stateMachine "${stateMachineName}" doesn't exist in this Service`);
305305
}
306306

307-
// findFunctionsPathAndHandler() {
308-
// for (const functionName in this.variables) {
309-
// const functionHandler = this.variables[functionName];
310-
// const {handler, filePath} = this._findFunctionPathAndHandler(functionHandler);
311-
//
312-
// this.variables[functionName] = {handler, filePath};
313-
// }
314-
// console.log('this.va', this.variables)
315-
// },
316-
//
317-
_findFunctionPathAndHandler(functionHandler: string): { handler: string; filePath: string } {
318-
const dir = path.dirname(functionHandler);
319-
const handler = path.basename(functionHandler);
320-
const splitHandler = handler.split('.');
321-
const filePath = `${dir}/${splitHandler[0]}.js`;
322-
const handlerName = `${splitHandler[1]}`;
323-
324-
return { handler: handlerName, filePath };
325-
}
326-
327307
async _loadStates(states: StateMachine['States'] | string): Promise<StateMachine['States']> {
328308
if (isString(states)) {
329309
const serverlessPath = this.serverless.config.servicePath;
@@ -393,7 +373,6 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
393373
return this._runChoice(data, event);
394374
} else if (!stateIsChoiceConditional(data)) {
395375
const callback = data.f(event);
396-
console.log('callback', callback);
397376
return this._run(callback, event, stateName);
398377
}
399378
}

0 commit comments

Comments
 (0)