@vite-hub/schedule 0.1.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +114 -96
  2. package/dist/console-wEhr0LWn.d.ts +330 -0
  3. package/dist/definition.d.ts +6 -2
  4. package/dist/definition.js +47 -1
  5. package/dist/due-BVMRQ93v.js +144 -0
  6. package/dist/durability.d.ts +14 -0
  7. package/dist/durability.js +23 -0
  8. package/dist/error-diagnostics-DSkCJC_L.js +266 -0
  9. package/dist/error-diagnostics-Mpeks7J0.js +166 -0
  10. package/dist/index.d.ts +59 -5
  11. package/dist/index.js +27 -2
  12. package/dist/invariant-DolT9EEx.js +22 -0
  13. package/dist/{kv-storage-Bv9ocZT-.d.ts → kv-storage-C0KZZB6v.d.ts} +2 -2
  14. package/dist/{kv-storage-DWinmLLy.js → kv-storage-iJChCS5A.js} +2 -2
  15. package/dist/object-Da1zyPCR.js +11 -0
  16. package/dist/{operations-tNUdj3G4.d.ts → operation-definition-8gOe-ubD.d.ts} +37 -15
  17. package/dist/{operations-gk2qzhYV.js → operations-DwZWFIUX.js} +75 -22
  18. package/dist/operations.d.ts +27 -4
  19. package/dist/operations.js +127 -730
  20. package/dist/os.d.ts +167 -0
  21. package/dist/os.js +1659 -0
  22. package/dist/runtime/console.d.ts +12 -0
  23. package/dist/runtime/console.js +85 -0
  24. package/dist/runtime/kv.d.ts +1 -1
  25. package/dist/runtime/kv.js +1 -1
  26. package/dist/runtime/process.d.ts +32 -5
  27. package/dist/runtime/process.js +401 -413
  28. package/dist/runtime/state.d.ts +2 -9
  29. package/dist/runtime/state.js +2 -2
  30. package/dist/runtime/static.d.ts +28 -2
  31. package/dist/runtime/static.js +2 -2
  32. package/dist/runtime.d.ts +34 -32
  33. package/dist/runtime.js +6 -5
  34. package/dist/started-BuGmnus4.js +201 -0
  35. package/dist/started-Bx7MDbrl.js +146 -0
  36. package/dist/{execute-BJrgNgQ0.js → started-errors-p7cu_rI7.js} +69 -20
  37. package/dist/{state-DSxmHPn3.js → state-B-Fuyfb4.js} +42 -22
  38. package/dist/state-Do2wV4Tx.d.ts +49 -0
  39. package/dist/{static-6g82xguw.js → static-DQwzzvPg.js} +63 -42
  40. package/dist/store-Df0-fzCl.d.ts +53 -0
  41. package/dist/time-zone-SBldrUgt.js +59 -0
  42. package/dist/{types-CHdV9FQU.d.ts → types-Cw5LjPuc.d.ts} +62 -8
  43. package/dist/vite.d.ts +255 -2
  44. package/dist/vite.js +5876 -2
  45. package/dist/{wait-until-BmIqRo4x.js → wait-until-Dy4Bn3ZN.js} +26 -1
  46. package/package.json +19 -24
  47. package/dist/definition-CMiOg1lg.js +0 -111
  48. package/dist/error-diagnostics-A_8Kp-48.js +0 -116
  49. package/dist/error-diagnostics-in7mif5s.js +0 -45
  50. package/dist/nuxt.d.ts +0 -17
  51. package/dist/nuxt.js +0 -27
  52. package/dist/store-QAOd8bxm.d.ts +0 -11
  53. package/dist/vite-BAVyZ8hZ.d.ts +0 -474
  54. package/dist/vite-BJwZkMrn.js +0 -5193
@@ -34,6 +34,10 @@ function createScheduleError(code, options = {}) {
34
34
  }
35
35
  //#endregion
36
36
  //#region src/runtime/date.ts
37
+ /** The idempotency key of one Schedule occurrence. Two runs of the same Schedule for the same time share it. */
38
+ function scheduleIdempotencyKey(name, scheduledAt) {
39
+ return `schedule:${name}:${scheduledAt.toISOString()}`;
40
+ }
37
41
  function isScheduleDate(value) {
38
42
  try {
39
43
  return !Number.isNaN(Date.prototype.getTime.call(value));
@@ -41,11 +45,32 @@ function isScheduleDate(value) {
41
45
  return false;
42
46
  }
43
47
  }
48
+ const scheduledAtText = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2})$/i;
49
+ function parseScheduledAtText(value) {
50
+ const match = scheduledAtText.exec(value);
51
+ if (!match) return;
52
+ const [, year, month, day, hour] = match.map(Number);
53
+ const calendarDay = /* @__PURE__ */ new Date(0);
54
+ calendarDay.setUTCFullYear(year, month - 1, day);
55
+ if (hour > 23 || calendarDay.getUTCMonth() !== month - 1 || calendarDay.getUTCDate() !== day) return;
56
+ const date = new Date(value);
57
+ return Number.isNaN(date.getTime()) ? void 0 : date;
58
+ }
44
59
  function validateScheduledAt(scheduledAt) {
45
60
  const value = scheduledAt ?? /* @__PURE__ */ new Date();
46
61
  if (!isScheduleDate(value)) throw createScheduleError("SCHEDULE_INVALID_SCHEDULED_AT", { details: invalidScheduleValueDetails("scheduledAt", value) });
47
62
  return new Date(Date.prototype.getTime.call(value));
48
63
  }
64
+ /**
65
+ * Returns the time a manual run treats as its fire time. A string must be an ISO 8601 date-time with a time zone, such
66
+ * as `2026-01-31T23:59:00Z`. Anything else fails with `SCHEDULE_INVALID_SCHEDULED_AT`. Absent means now.
67
+ */
68
+ function parseScheduledAt(scheduledAt) {
69
+ if (typeof scheduledAt !== "string") return validateScheduledAt(scheduledAt);
70
+ const parsed = parseScheduledAtText(scheduledAt);
71
+ if (parsed) return parsed;
72
+ throw createScheduleError("SCHEDULE_INVALID_SCHEDULED_AT", { details: invalidScheduleValueDetails("scheduledAt", scheduledAt) });
73
+ }
49
74
  //#endregion
50
75
  //#region src/runtime/wait-until.ts
51
76
  function createLocalWaitUntil() {
@@ -84,4 +109,4 @@ async function runWithScheduleWaitUntil(run, hostWaitUntil) {
84
109
  }
85
110
  }
86
111
  //#endregion
87
- export { invalidScheduleValueDetails as a, createScheduleError as i, isScheduleDate as n, validateScheduledAt as r, runWithScheduleWaitUntil as t };
112
+ export { validateScheduledAt as a, scheduleIdempotencyKey as i, isScheduleDate as n, createScheduleError as o, parseScheduledAt as r, invalidScheduleValueDetails as s, runWithScheduleWaitUntil as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/schedule",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Schedule primitives and definition discovery for ViteHub.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -8,7 +8,6 @@
8
8
  "cron-jobs",
9
9
  "netlify",
10
10
  "nuxt",
11
- "nuxt-module",
12
11
  "schedule",
13
12
  "typescript",
14
13
  "vercel",
@@ -37,15 +36,15 @@
37
36
  "import": "./dist/index.js",
38
37
  "default": "./dist/index.js"
39
38
  },
40
- "./nuxt": {
41
- "types": "./dist/nuxt.d.ts",
42
- "import": "./dist/nuxt.js",
43
- "default": "./dist/nuxt.js"
39
+ "./durability": {
40
+ "types": "./dist/durability.d.ts",
41
+ "import": "./dist/durability.js",
42
+ "default": "./dist/durability.js"
44
43
  },
45
- "./operations": {
46
- "types": "./dist/operations.d.ts",
47
- "import": "./dist/operations.js",
48
- "default": "./dist/operations.js"
44
+ "./os": {
45
+ "types": "./dist/os.d.ts",
46
+ "import": "./dist/os.js",
47
+ "default": "./dist/os.js"
49
48
  },
50
49
  "./runtime": {
51
50
  "types": "./dist/runtime.d.ts",
@@ -62,11 +61,6 @@
62
61
  "import": "./dist/runtime/process.js",
63
62
  "default": "./dist/runtime/process.js"
64
63
  },
65
- "./runtime/state": {
66
- "types": "./dist/runtime/state.d.ts",
67
- "import": "./dist/runtime/state.js",
68
- "default": "./dist/runtime/state.js"
69
- },
70
64
  "./runtime/static": {
71
65
  "types": "./dist/runtime/static.d.ts",
72
66
  "import": "./dist/runtime/static.js",
@@ -80,25 +74,26 @@
80
74
  "./package.json": "./package.json"
81
75
  },
82
76
  "dependencies": {
83
- "@vite-hub/runtime": "0.1.0",
77
+ "@valibot/to-json-schema": "^1.8.0",
78
+ "@vite-hub/runtime": "0.3.1",
84
79
  "cron-schedule": "^6.0.0",
85
- "effect": "4.0.0-rc.112",
86
80
  "esbuild": "^0.28.2",
87
- "nostics": "1.3.0",
81
+ "nostics": "1.4.0",
88
82
  "valibot": "^1.5.0"
89
83
  },
90
84
  "devDependencies": {
91
85
  "@types/node": "^24.19.1",
92
- "@vite-hub/kv": "0.1.0",
86
+ "@vite-hub/internal": "0.0.1",
87
+ "@vite-hub/kv": "0.3.1",
88
+ "postgres": "^3.4.9",
93
89
  "publint": "^0.3.25",
94
90
  "typescript": "^6.0.3",
95
91
  "vite": "^8.2.2",
96
92
  "vite-plus": "^0.3.3",
97
- "vitest": "^4.1.11",
98
- "@vite-hub/internal": "0.0.1"
93
+ "vitest": "^4.1.11"
99
94
  },
100
95
  "peerDependencies": {
101
- "@vite-hub/kv": "0.1.0",
96
+ "@vite-hub/kv": "0.3.1",
102
97
  "vite": ">=8.0.0"
103
98
  },
104
99
  "peerDependenciesMeta": {
@@ -110,12 +105,12 @@
110
105
  }
111
106
  },
112
107
  "engines": {
113
- "node": ">=24.15.0"
108
+ "node": ">=22.18.0"
114
109
  },
115
110
  "scripts": {
116
111
  "build": "vp pack",
117
112
  "dev": "vp pack --watch",
118
113
  "typecheck": "vp run --cache -t @vite-hub/schedule#build && node ../../test/package-typecheck.mjs --noEmit -p ./tsconfig.json",
119
- "test": "vp run -t @vite-hub/schedule#build && vp test"
114
+ "test": "vp run --cache -t @vite-hub/schedule#build && vp test"
120
115
  }
121
116
  }
@@ -1,111 +0,0 @@
1
- import { t as scheduleErrorDiagnostics } from "./error-diagnostics-in7mif5s.js";
2
- //#region ../internal/src/runtime/time-zone.ts
3
- const slashlessIanaTimeZones = /* @__PURE__ */ new Set([
4
- "CET",
5
- "CST6CDT",
6
- "Cuba",
7
- "EET",
8
- "EST",
9
- "EST5EDT",
10
- "Egypt",
11
- "Eire",
12
- "Factory",
13
- "GB",
14
- "GB-Eire",
15
- "GMT",
16
- "GMT+0",
17
- "GMT-0",
18
- "GMT0",
19
- "Greenwich",
20
- "HST",
21
- "Hongkong",
22
- "Iceland",
23
- "Iran",
24
- "Israel",
25
- "Jamaica",
26
- "Japan",
27
- "Kwajalein",
28
- "Libya",
29
- "MET",
30
- "MST",
31
- "MST7MDT",
32
- "NZ",
33
- "NZ-CHAT",
34
- "Navajo",
35
- "PRC",
36
- "PST8PDT",
37
- "Poland",
38
- "Portugal",
39
- "ROC",
40
- "ROK",
41
- "Singapore",
42
- "Turkey",
43
- "UCT",
44
- "UTC",
45
- "Universal",
46
- "W-SU",
47
- "WET",
48
- "Zulu"
49
- ]);
50
- function isIanaTimeZone(timeZone) {
51
- if (typeof timeZone !== "string" || !timeZone.includes("/") && !slashlessIanaTimeZones.has(timeZone)) return false;
52
- try {
53
- new Intl.DateTimeFormat("en-US", { timeZone });
54
- return true;
55
- } catch {
56
- return false;
57
- }
58
- }
59
- //#endregion
60
- //#region src/definition.ts
61
- const cronFieldPattern = /^[^\s]+$/;
62
- const scheduleDefinitionKeys = /* @__PURE__ */ new Set([
63
- "manual",
64
- "cron",
65
- "handler",
66
- "timeZone"
67
- ]);
68
- const scheduleOptionsKeys = /* @__PURE__ */ new Set(["manual", "timeZone"]);
69
- function isPlainObject(value) {
70
- return !!value && typeof value === "object" && !Array.isArray(value);
71
- }
72
- function isCronString(value) {
73
- return value !== null && value !== void 0 && String(value) === value;
74
- }
75
- function assertOwnDefinitionFields(input, keys, message, diagnostic) {
76
- const inheritedKey = [...keys].find((key) => key in input && !Object.hasOwn(input, key));
77
- if (inheritedKey) throw diagnostic({ message: `${message} The "${inheritedKey}" option must be an own property.` });
78
- }
79
- function validateCron(cron) {
80
- if (typeof cron !== "string" || cron.trim() !== cron || cron.length === 0) throw scheduleErrorDiagnostics.SCHEDULE_C0001({ message: "`defineSchedule()` requires a cron string." });
81
- const fields = cron.split(/\s+/);
82
- if (fields.length !== 5 || !fields.every((field) => cronFieldPattern.test(field))) throw scheduleErrorDiagnostics.SCHEDULE_C0002({ message: "`defineSchedule()` cron must be a five-field cron expression." });
83
- }
84
- function defineSchedule(cronOrInput, handler, options = {}) {
85
- if (!isPlainObject(options)) throw scheduleErrorDiagnostics.SCHEDULE_C0003({ message: "`defineSchedule()` options must be an object." });
86
- assertOwnDefinitionFields(options, scheduleOptionsKeys, "`defineSchedule()` does not accept inherited options.", scheduleErrorDiagnostics.SCHEDULE_C0004);
87
- if (!isCronString(cronOrInput) && !isPlainObject(cronOrInput)) throw scheduleErrorDiagnostics.SCHEDULE_C0003({ message: "`defineSchedule()` expects an object with `cron` and `handler`." });
88
- const input = isPlainObject(cronOrInput) ? cronOrInput : {
89
- ...options,
90
- cron: cronOrInput,
91
- handler
92
- };
93
- if (!isPlainObject(input)) throw scheduleErrorDiagnostics.SCHEDULE_C0003({ message: "`defineSchedule()` expects an object with `cron` and `handler`." });
94
- if (!Object.hasOwn(input, "cron") || !Object.hasOwn(input, "handler")) throw scheduleErrorDiagnostics.SCHEDULE_C0003({ message: "`defineSchedule()` expects an object with `cron` and `handler`." });
95
- assertOwnDefinitionFields(input, scheduleDefinitionKeys, "`defineSchedule()` does not accept inherited options.", scheduleErrorDiagnostics.SCHEDULE_C0004);
96
- const unknownKey = Object.keys(input).find((key) => !scheduleDefinitionKeys.has(key));
97
- if (unknownKey) throw scheduleErrorDiagnostics.SCHEDULE_C0004({ message: `\`defineSchedule()\` does not support the "${unknownKey}" option.` });
98
- validateCron(input.cron);
99
- if (typeof input.handler !== "function") throw scheduleErrorDiagnostics.SCHEDULE_C0005({ message: "`defineSchedule()` requires a schedule handler." });
100
- if (input.manual !== void 0 && input.manual !== true && input.manual !== false) throw scheduleErrorDiagnostics.SCHEDULE_C0006({ message: "`defineSchedule()` manual must be a boolean." });
101
- if (input.timeZone !== void 0 && !isIanaTimeZone(input.timeZone)) throw scheduleErrorDiagnostics.SCHEDULE_C0006({ message: "`defineSchedule()` timeZone must be an IANA time zone, such as \"Europe/Madrid\"." });
102
- const definition = {
103
- cron: input.cron,
104
- handler: input.handler
105
- };
106
- if (input.timeZone !== void 0) definition.timeZone = input.timeZone;
107
- if (input.manual !== void 0) definition.options = { manual: input.manual };
108
- return definition;
109
- }
110
- //#endregion
111
- export { defineSchedule as t };
@@ -1,116 +0,0 @@
1
- import { defineDiagnostics } from "nostics";
2
- //#region ../internal/src/error-diagnostics.ts
3
- const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
4
- const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
5
- docsBase: () => "https://vitehub.dev/docs/reference/diagnostics",
6
- codes: {
7
- INTERNAL_R0012: dynamicError,
8
- INTERNAL_R0013: dynamicError,
9
- INTERNAL_R0014: {
10
- why: ({ path }) => `Cannot read Provision State from "${path}".`,
11
- fix: "Check file access and restore valid JSON while preserving existing resource IDs."
12
- },
13
- INTERNAL_R0020: {
14
- fix: "Give the operation a name like `content.publish`, a description, a section, a kind, an input schema, and a run function.",
15
- why: ({ message }) => message === void 0 ? "" : String(message)
16
- },
17
- INTERNAL_R0021: {
18
- fix: "Run `vitehub inspect definitions --kind operation` to list the operations of this app.",
19
- why: ({ message }) => message === void 0 ? "" : String(message)
20
- },
21
- INTERNAL_R0022: {
22
- fix: "Send input that matches the schema of the operation. `vitehub <namespace> <command> --help` shows the fields.",
23
- why: ({ message }) => message === void 0 ? "" : String(message)
24
- },
25
- INTERNAL_R0024: {
26
- fix: "Start the dev server with `vite dev`, or pass `--url <origin>` of a deployed app with credentials in VITEHUB_CONSOLE_AUTHORIZATION, VITEHUB_CONSOLE_COOKIE, or CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET.",
27
- why: ({ message }) => message === void 0 ? "" : String(message)
28
- },
29
- INTERNAL_R0023: {
30
- fix: "Ask for access to the section of this operation.",
31
- why: ({ message }) => message === void 0 ? "" : String(message)
32
- },
33
- INTERNAL_B0001: dynamicError,
34
- INTERNAL_B0002: dynamicError,
35
- INTERNAL_B0003: dynamicError,
36
- INTERNAL_B0004: dynamicError,
37
- INTERNAL_B0005: dynamicError,
38
- INTERNAL_B0006: dynamicError,
39
- INTERNAL_B0007: dynamicError,
40
- INTERNAL_B0008: dynamicError,
41
- INTERNAL_B0009: dynamicError,
42
- INTERNAL_B0010: dynamicError,
43
- INTERNAL_B0011: dynamicError,
44
- INTERNAL_B0012: dynamicError,
45
- INTERNAL_B0013: dynamicError,
46
- INTERNAL_B0014: dynamicError,
47
- INTERNAL_B0015: dynamicError,
48
- INTERNAL_B0016: dynamicError,
49
- INTERNAL_B0017: dynamicError,
50
- INTERNAL_B0018: dynamicError,
51
- INTERNAL_B0019: dynamicError,
52
- INTERNAL_B0020: dynamicError,
53
- INTERNAL_B0021: dynamicError,
54
- INTERNAL_B0022: dynamicError,
55
- INTERNAL_B0023: dynamicError,
56
- INTERNAL_B0024: dynamicError,
57
- INTERNAL_B0025: dynamicError,
58
- INTERNAL_B0026: dynamicError,
59
- INTERNAL_B0027: dynamicError,
60
- INTERNAL_B0028: dynamicError,
61
- INTERNAL_B0029: dynamicError,
62
- INTERNAL_B0030: dynamicError,
63
- INTERNAL_B0031: dynamicError,
64
- INTERNAL_B0032: dynamicError,
65
- INTERNAL_B0033: dynamicError,
66
- INTERNAL_B0034: dynamicError,
67
- INTERNAL_B0035: dynamicError,
68
- INTERNAL_B0036: dynamicError,
69
- INTERNAL_B0037: dynamicError,
70
- INTERNAL_B0038: dynamicError,
71
- INTERNAL_B0039: dynamicError,
72
- INTERNAL_B0040: dynamicError,
73
- INTERNAL_B0041: dynamicError,
74
- INTERNAL_B0042: dynamicError,
75
- INTERNAL_B0043: dynamicError,
76
- INTERNAL_B0044: dynamicError,
77
- INTERNAL_B0045: dynamicError,
78
- INTERNAL_B0046: dynamicError,
79
- INTERNAL_B0047: dynamicError,
80
- INTERNAL_B0048: {
81
- fix: "Rename one of the two operations. A name is `<section>.<verb>` and is unique in the app.",
82
- why: ({ message }) => message === void 0 ? "" : String(message)
83
- },
84
- INTERNAL_B0049: {
85
- fix: "Set `cli: { namespace, command }` on one of the two operations.",
86
- why: ({ message }) => message === void 0 ? "" : String(message)
87
- },
88
- INTERNAL_B0050: {
89
- fix: "Rename one of the two operations, or set `mcp: false` on it. MCP tool names replace every character outside letters, digits, `_`, and `-` with `_`.",
90
- why: ({ message }) => message === void 0 ? "" : String(message)
91
- },
92
- INTERNAL_R0025: {
93
- fix: "Start `vite dev` in the project that you run the command from, or pass `--url` of that server.",
94
- why: ({ message }) => message === void 0 ? "" : String(message)
95
- },
96
- INTERNAL_R0026: {
97
- why: "The server parsed a destructive operation that the CLI did not confirm.",
98
- fix: "Review the operation, then run it again with --yes to confirm the change."
99
- },
100
- INTERNAL_C0001: dynamicError,
101
- INTERNAL_C0002: dynamicError,
102
- INTERNAL_R0001: dynamicError,
103
- INTERNAL_R0002: dynamicError,
104
- INTERNAL_R0003: dynamicError,
105
- INTERNAL_R0004: dynamicError,
106
- INTERNAL_R0005: dynamicError,
107
- INTERNAL_R0006: dynamicError,
108
- INTERNAL_R0007: dynamicError,
109
- INTERNAL_R0008: dynamicError,
110
- INTERNAL_R0009: dynamicError,
111
- INTERNAL_R0010: dynamicError,
112
- INTERNAL_R0011: dynamicError
113
- }
114
- });
115
- //#endregion
116
- export { internalErrorDiagnostics as t };
@@ -1,45 +0,0 @@
1
- import { defineDiagnostics } from "nostics";
2
- //#region src/error-diagnostics.ts
3
- const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
4
- const scheduleErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
5
- docsBase: () => "https://vitehub.dev/docs/reference/diagnostics",
6
- codes: {
7
- SCHEDULE_C0001: dynamicError,
8
- SCHEDULE_C0002: dynamicError,
9
- SCHEDULE_C0003: dynamicError,
10
- SCHEDULE_C0004: dynamicError,
11
- SCHEDULE_C0005: dynamicError,
12
- SCHEDULE_C0006: dynamicError,
13
- SCHEDULE_R0001: dynamicError,
14
- SCHEDULE_R0002: dynamicError,
15
- SCHEDULE_R0003: dynamicError,
16
- SCHEDULE_R0004: dynamicError,
17
- SCHEDULE_R0005: dynamicError,
18
- SCHEDULE_R0006: dynamicError,
19
- SCHEDULE_R0022: dynamicError,
20
- SCHEDULE_R0023: dynamicError,
21
- SCHEDULE_R0024: dynamicError,
22
- SCHEDULE_R0025: dynamicError,
23
- SCHEDULE_R0026: dynamicError,
24
- SCHEDULE_R0027: dynamicError,
25
- SCHEDULE_R0028: dynamicError,
26
- SCHEDULE_R0030: dynamicError,
27
- SCHEDULE_R0031: dynamicError,
28
- SCHEDULE_R0032: dynamicError,
29
- SCHEDULE_R0033: dynamicError,
30
- SCHEDULE_R0034: dynamicError,
31
- SCHEDULE_R0035: dynamicError,
32
- SCHEDULE_R0036: dynamicError,
33
- SCHEDULE_R0037: dynamicError,
34
- SCHEDULE_R0038: dynamicError,
35
- SCHEDULE_B0001: dynamicError,
36
- SCHEDULE_B0002: dynamicError,
37
- SCHEDULE_B0003: dynamicError,
38
- SCHEDULE_B0004: dynamicError,
39
- SCHEDULE_B0005: dynamicError,
40
- SCHEDULE_B0006: dynamicError,
41
- SCHEDULE_B0007: dynamicError
42
- }
43
- });
44
- //#endregion
45
- export { scheduleErrorDiagnostics as t };
package/dist/nuxt.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { i as ScheduleVitePluginOptions } from "./vite-BAVyZ8hZ.js";
2
- //#region src/nuxt.d.ts
3
- export interface ScheduleNuxtModuleOptions extends ScheduleVitePluginOptions {}
4
- type NuxtLike = {
5
- hook?: (name: "nitro:config", handler: (nitroConfig: Record<string, unknown>) => void | Promise<void>) => void;
6
- options: {
7
- dev?: boolean;
8
- nitro?: Record<string, unknown>;
9
- rootDir?: string;
10
- srcDir?: string;
11
- vite?: {
12
- plugins?: unknown[];
13
- };
14
- };
15
- };
16
- export default function viteHubScheduleNuxtModule(options?: ScheduleNuxtModuleOptions, nuxt?: NuxtLike): void;
17
- //#endregion
package/dist/nuxt.js DELETED
@@ -1,27 +0,0 @@
1
- import { n as hubSchedule, t as createScheduleNitroConfig } from "./vite-BJwZkMrn.js";
2
- //#region src/nuxt.ts
3
- function isScheduleVitePlugin(value) {
4
- return Boolean(value && typeof value === "object" && value.name === "@vite-hub/schedule/vite");
5
- }
6
- function viteHubScheduleNuxtModule(options = {}, nuxt) {
7
- if (!nuxt) return;
8
- nuxt.options.vite ??= {};
9
- const plugins = Array.isArray(nuxt.options.vite.plugins) ? nuxt.options.vite.plugins : [];
10
- if (!plugins.some(isScheduleVitePlugin)) plugins.push(hubSchedule(options));
11
- nuxt.options.vite.plugins = plugins;
12
- nuxt.hook?.("nitro:config", async (nitroConfig) => {
13
- const rootDir = nuxt.options.rootDir || process.cwd();
14
- const nitro = await createScheduleNitroConfig({
15
- ...options,
16
- command: nuxt.options.dev ? "serve" : "build",
17
- nitroOwnsPaths: true,
18
- nitro: nitroConfig,
19
- plugins: nuxt.options.vite?.plugins,
20
- projectRoot: options.projectRoot || rootDir,
21
- root: nuxt.options.srcDir || rootDir
22
- });
23
- if (nitro) Object.assign(nitroConfig, nitro);
24
- });
25
- }
26
- //#endregion
27
- export { viteHubScheduleNuxtModule as default };
@@ -1,11 +0,0 @@
1
- import { g as ScheduleRunStore } from "./types-CHdV9FQU.js";
2
- import { t as ScheduleKVStorage } from "./kv-storage-Bv9ocZT-.js";
3
- //#region src/runtime/store.d.ts
4
- interface KVScheduleStoreOptions {
5
- kvStore: ScheduleKVStorage;
6
- prefix?: string;
7
- }
8
- declare function createMemoryScheduleRunStore(): ScheduleRunStore;
9
- declare function createKVScheduleRunStore(options: KVScheduleStoreOptions): ScheduleRunStore;
10
- //#endregion
11
- export { createKVScheduleRunStore as n, createMemoryScheduleRunStore as r, KVScheduleStoreOptions as t };