refactor: add cron job core package (#704)

* refactor: add cron job core package

* docs: add comments to cron validation types

* chore(deps): move node-cron dependencies from tasks app to cron-jobs-core package

* fix: runOnInit is not running on start and rather on job creation

* fix: format issues

* fix: build fails when using top level await in cjs

* chore: update turbo gen package json typescript version to 5.5.2

* fix: format issue

* fix: deepsource issues

* chore: update turbo gen package json eslint version to 9.5.0

* chore: fix frozen lockfile and format
This commit is contained in:
Meier Lukas
2024-06-22 20:00:20 +02:00
committed by GitHub
parent ea12da991a
commit 92afd82d22
26 changed files with 397 additions and 128 deletions

View File

@@ -0,0 +1,15 @@
import type { CreateCronJobCreatorOptions } from "./creator";
import { createCronJobCreator } from "./creator";
import { createJobGroupCreator } from "./group";
import { ConsoleLogger } from "./logger";
export const createCronJobFunctions = <TAllowedNames extends string>(
options: CreateCronJobCreatorOptions<TAllowedNames> = { logger: new ConsoleLogger() },
) => {
return {
createCronJob: createCronJobCreator<TAllowedNames>(options),
createCronJobGroup: createJobGroupCreator<TAllowedNames>({
logger: options.logger,
}),
};
};