Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
add project api notes (#9219)
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored Nov 7, 2023
1 parent 9d83517 commit d265853
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/projects/ProjectConfigInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/server-core/src/projects/project/project.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export class ProjectService<T = ProjectType, ServiceParams extends Params = Proj
} catch (e) {
logger.error(e)
}
} else {
/**@todo call onUpdate for project */
}

const { commitSHA, commitDate } = await getCommitSHADate(projectName)
Expand Down

0 comments on commit d265853

Please sign in to comment.