diff --git a/packages/projects/ProjectConfigInterface.ts b/packages/projects/ProjectConfigInterface.ts index aba060b507..5c7ce8d748 100644 --- a/packages/projects/ProjectConfigInterface.ts +++ b/packages/projects/ProjectConfigInterface.ts @@ -90,9 +90,17 @@ type OEmbedFunctionType = (app: Application, url: URL, currentOEmbed: OembedType * */ export interface ProjectEventHooks { + /** + * Runs when a project is installed. + * In local, the next time `npm run dev` is run. + * In k8s, the next time the builder is run, OR immediately after the project is updated. + */ onInstall?: InstallFunctionType + /** Runs any time a server instance spins up */ onLoad?: InstallFunctionType + /** Runs every time a project is updated in a deployment OR when the builder runs */ onUpdate?: InstallFunctionType + /** Runs when a project is uninstalled */ onUninstall?: InstallFunctionType /** * get oEmbed for active routes that match URL diff --git a/packages/server-core/src/projects/project/project.class.ts b/packages/server-core/src/projects/project/project.class.ts index dcf8d8abf5..92aba121b2 100644 --- a/packages/server-core/src/projects/project/project.class.ts +++ b/packages/server-core/src/projects/project/project.class.ts @@ -153,6 +153,8 @@ export class ProjectService