Skip to content

Commit 8d2d9a8

Browse files
committed
undo internal hook
1 parent 7e2f1e8 commit 8d2d9a8

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

src/index.ts

+1-32
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,13 @@ type Hooks = {
110110
[key: string]: () => Promise<void>;
111111
};
112112

113-
type Commands = {
114-
[key: string]:
115-
| Commands
116-
| {
117-
lifecycleEvents?: string[];
118-
type?: string;
119-
};
120-
};
121-
122113
class ServerlessMake {
123114
log: Log;
124115

125116
serverless: Serverless;
126117
serverlessConfig: ServerlessConfig;
127118
pluginConfig: PluginConfig;
128119

129-
commands: Commands;
130120
hooks?: Hooks;
131121

132122
constructor(serverless: Serverless, protected options: Options) {
@@ -139,15 +129,6 @@ class ServerlessMake {
139129

140130
this.log = new Log(options);
141131

142-
this.commands = {
143-
[PLUGIN_NAME]: {
144-
made: {
145-
lifecycleEvents: [this.target || "_PHONY"],
146-
type: "entrypoint",
147-
},
148-
},
149-
};
150-
151132
this.hooks = this.setupHooks();
152133
}
153134

@@ -166,9 +147,6 @@ class ServerlessMake {
166147
setupHooks = () => {
167148
const hooks: Hooks = {
168149
initialize: async () => {},
169-
[`${PLUGIN_NAME}:made:${this.target || "_PHONY"}`]: async () => {
170-
this.log.verbose(`!!! ${PLUGIN_NAME}:made:${this.target || "_PHONY"}`);
171-
},
172150
"before:offline:start": async () => {
173151
this.log.verbose("before:offline:start");
174152
let errored = false;
@@ -207,7 +185,7 @@ class ServerlessMake {
207185
const pluginHooks = this.pluginConfig.hooks || {};
208186

209187
Object.entries(pluginHooks).forEach(([hook, target]) => {
210-
if (hooks[hook] && hook !== `${PLUGIN_NAME}:made`) {
188+
if (hooks[hook]) {
211189
this.log.warning(
212190
`Unable to override registered internal hook "${hook}"!`
213191
);
@@ -274,15 +252,6 @@ class ServerlessMake {
274252
}
275253
});
276254
}
277-
278-
const spawn = `${PLUGIN_NAME}:made`;
279-
try {
280-
await this.serverless.pluginManager.spawn(`${PLUGIN_NAME}:made`);
281-
} catch (e) {
282-
if (e instanceof Error) {
283-
this.log.warning(`Unable to spawn ${spawn}`);
284-
}
285-
}
286255
};
287256
}
288257

0 commit comments

Comments
 (0)