Skip to content

fix(output): change CRON to cron/Cron #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
_extends: .github
repository:
name: vercel-cron
description: TODO
private: false
branches:
- name: main
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
[![License](https://img.shields.io/github/license/saiichihashimoto/vercel-cron?style=flat)](LICENSE)

[![GitHub Sponsors](https://img.shields.io/github/sponsors/saiichihashimoto?style=flat)](https://github.com/sponsors/saiichihashimoto)

TODO
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json.schemastore.org/package.json",
"name": "vercel-cron",
"version": "0.0.0-development",
"description": "TODO",
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/saiichihashimoto"
Expand Down
12 changes: 6 additions & 6 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe("main", () => {
time: 1696486441293,
msg: "Watching Config",
},
{ level: 40, time: 1696486441293, msg: "No CRONs Scheduled" },
{ level: 40, time: 1696486441293, msg: "No Crons Scheduled" },
]);
});

Expand Down Expand Up @@ -152,11 +152,11 @@ describe("main", () => {
time: 1696486441293,
msg: "Watching Config",
},
{ level: 40, time: 1696486441293, msg: "No CRONs Scheduled" },
{ level: 40, time: 1696486441293, msg: "No Crons Scheduled" },
]);
});

it("executes CRON when schedule passes", async () => {
it("executes cron when schedule passes", async () => {
const { fs } = memfs(
{
"./vercel.json": JSON.stringify({
Expand Down Expand Up @@ -349,7 +349,7 @@ describe("main", () => {
destination.clear();
});

it("reschedules CRONs on file change", async () => {
it("reschedules crons on file change", async () => {
const { fs, vol } = memfs(
{
"./vercel.json": JSON.stringify({
Expand Down Expand Up @@ -389,7 +389,7 @@ describe("main", () => {
msg: "Config Changed",
time: 1696486441293,
},
{ level: 40, msg: "No CRONs Scheduled", time: 1696486441293 },
{ level: 40, msg: "No Crons Scheduled", time: 1696486441293 },
]);
destination.clear();

Expand Down Expand Up @@ -419,7 +419,7 @@ describe("main", () => {
},
{
level: 60,
msg: "Failed to Schedule CRONs",
msg: "Failed to Schedule Crons",
time: 1696486441293,
error: {
type: "ZodError",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const main = async ({
if (logger.isLevelEnabled("info") && pretty) {
/* eslint-disable no-console -- boxen! */
console.log(
boxen("▲ Vercel CRON ▲", {
boxen("▲ Vercel Cron ▲", {
borderColor: color ? "magenta" : undefined,
borderStyle: "round",
padding: 1,
Expand Down Expand Up @@ -177,7 +177,7 @@ export const main = async ({
});

if (!crons.length) {
logger.warn("No CRONs Scheduled");
logger.warn("No Crons Scheduled");
}

return controller.abort.bind(controller);
Expand All @@ -199,7 +199,7 @@ export const main = async ({
// eslint-disable-next-line require-atomic-updates -- HACK
abortPrevious = await scheduleCrons();
} catch (error) {
logger.fatal({ error }, "Failed to Schedule CRONs");
logger.fatal({ error }, "Failed to Schedule Crons");
abortPrevious = () => {};
}
}) satisfies Parameters<typeof fs.watch>[1]);
Expand Down
6 changes: 3 additions & 3 deletions src/vercel-cron.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Options:
-u --url <url> Base URL (default: "http://localhost:3000")
-p --config <config> Vercel Config (default: "./vercel.json")
-s --secret <secret> Cron Secret (default: \`process.env.CRON_SECRET\`)
--dry Shows scheduled CRONs and quit
--dry Shows scheduled Crons and quit
--color Show terminal colors (default: \`chalk.supportsColor\`)
--no-pretty No pretty printing, just a JSON stream of logs
-l --level <level> Logging Level (choices: "trace", "debug", "info",
Expand Down Expand Up @@ -90,11 +90,11 @@ Options:
expect(stdout).toBe(
`${chalk.magenta("╭─────────────────────────╮")}
${chalk.magenta("│")} ${chalk.magenta("│")}
${chalk.magenta("│")} ▲ Vercel CRON ▲ ${chalk.magenta("│")}
${chalk.magenta("│")} ▲ Vercel Cron ▲ ${chalk.magenta("│")}
${chalk.magenta("│")} ${chalk.magenta("│")}
${chalk.magenta("╰─────────────────────────╯")}

${chalk.yellow("WARN")}: ${chalk.cyan(`No CRONs Scheduled`)}
${chalk.yellow("WARN")}: ${chalk.cyan(`No Crons Scheduled`)}
`
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/vercel-cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import pkg from "../package.json";
"`process.env.CRON_SECRET`"
)
)
.option("--dry", "Shows scheduled CRONs and quit")
.option("--dry", "Shows scheduled Crons and quit")
.addOption(
new Option("--color", "Show terminal colors").default(
Boolean(chalk.supportsColor),
Expand Down