File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,24 @@ declare namespace Serverless {
46
46
individually ?: boolean
47
47
}
48
48
49
+ type CommandsDefinition = Record <
50
+ string ,
51
+ {
52
+ lifecycleEvents ?: string [ ]
53
+ commands ?: CommandsDefinition
54
+ usage ?: string
55
+ options ?: {
56
+ [ name : string ] : {
57
+ type : string
58
+ usage : string
59
+ required ?: boolean
60
+ shortcut ?: string
61
+ }
62
+ }
63
+ }
64
+ >
65
+
49
66
interface PluginManager {
50
67
spawn ( command : string ) : Promise < void >
51
68
}
52
- }
69
+ }
Original file line number Diff line number Diff line change @@ -16,11 +16,27 @@ export class TypeScriptPlugin {
16
16
serverless : Serverless . Instance
17
17
options : Serverless . Options
18
18
hooks : { [ key : string ] : Function }
19
+ commands : Serverless . CommandsDefinition
19
20
20
21
constructor ( serverless : Serverless . Instance , options : Serverless . Options ) {
21
22
this . serverless = serverless
22
23
this . options = options
23
24
25
+ this . commands = {
26
+ invoke : {
27
+ commands : {
28
+ local : {
29
+ options : {
30
+ watch : {
31
+ type : 'boolean' ,
32
+ usage : 'Watch file changes and re-invoke automatically the function'
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+
24
40
this . hooks = {
25
41
'before:run:run' : async ( ) => {
26
42
await this . compileTs ( )
You can’t perform that action at this time.
0 commit comments