@vite-hub/schedule 0.8.0 → 0.9.0
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.
- package/dist/{cron-D0mqg3ql.js → cron-eNXDzpau.js} +1 -1
- package/dist/definition.js +2 -2
- package/dist/{due-DXgXKgzg.js → due-DuZmGuB7.js} +1 -1
- package/dist/{error-diagnostics-KvK9MX6w.js → error-diagnostics-D9ul4bWA.js} +1 -1
- package/dist/{execute-DHApCpbQ.js → execute-DPaz2CIY.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{operations-Bog78pOZ.js → operations-Vmqf3UFQ.js} +5 -5
- package/dist/operations.js +1 -1
- package/dist/os.js +1 -6
- package/dist/runtime/console.js +2 -2
- package/dist/runtime/process.js +7 -7
- package/dist/runtime/state.js +1 -1
- package/dist/runtime/static.js +2 -2
- package/dist/runtime.js +4 -4
- package/dist/{started-adRbWkWd.js → started-BP-J5a0z.js} +4 -4
- package/dist/{started-Ck0Wu5Oc.js → started-Bie-z1Ij.js} +3 -3
- package/dist/{state-BoDrff6R.js → state-ClfTAWZO.js} +1 -1
- package/dist/{static-D4nN8HTx.js → static-0MMhvv-6.js} +2 -2
- package/dist/vite.js +5 -43
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
2
2
|
import { parseCronExpression } from "cron-schedule";
|
|
3
3
|
// src/cron.ts
|
|
4
4
|
const cronFieldPattern = /^[^\s]+$/;
|
package/dist/definition.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as isIanaTimeZone } from "./time-zone-pMp_g8Uu.js";
|
|
2
2
|
import { n as isRecord } from "./object-DNOrQSl5.js";
|
|
3
|
-
import { t as assertScheduleCronFields } from "./cron-
|
|
4
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
3
|
+
import { t as assertScheduleCronFields } from "./cron-eNXDzpau.js";
|
|
4
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
5
5
|
// src/definition.ts
|
|
6
6
|
const scheduleDefinitionKeys = /* @__PURE__ */ new Set([
|
|
7
7
|
"manual",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
2
2
|
import { parseCronExpression } from "cron-schedule";
|
|
3
3
|
// src/runtime/due.ts
|
|
4
4
|
const weekdayIndexes = /* @__PURE__ */ new Map([
|
|
@@ -42,7 +42,7 @@ const scheduleErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
42
42
|
},
|
|
43
43
|
SCHEDULE_C0007: {
|
|
44
44
|
...dynamicError,
|
|
45
|
-
fix: "Write `defineSchedule({ cron, handler })`.
|
|
45
|
+
fix: "Write `defineSchedule({ cron, handler })`."
|
|
46
46
|
},
|
|
47
47
|
SCHEDULE_R0003: {
|
|
48
48
|
...dynamicError,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as createScheduleError, S as validateScheduledAt, _ as emitLogEvent, b as parseScheduledAt, c as markLoggedScheduleError, d as normalizeScheduleRuntimeError, g as logScheduleRun, h as runWithScheduleWaitUntil, v as errorCode, x as scheduleIdempotencyKey } from "./static-
|
|
1
|
+
import { C as createScheduleError, S as validateScheduledAt, _ as emitLogEvent, b as parseScheduledAt, c as markLoggedScheduleError, d as normalizeScheduleRuntimeError, g as logScheduleRun, h as runWithScheduleWaitUntil, v as errorCode, x as scheduleIdempotencyKey } from "./static-0MMhvv-6.js";
|
|
2
2
|
import { r as isRecordOrFunction } from "./object-DNOrQSl5.js";
|
|
3
|
-
import { i as getScheduleRunStore } from "./state-
|
|
3
|
+
import { i as getScheduleRunStore } from "./state-ClfTAWZO.js";
|
|
4
4
|
import { serializeResponse, toResponse } from "@vite-hub/runtime/internal/response";
|
|
5
5
|
import { emitRunFailed, toRunFailedError } from "@vite-hub/runtime/internal/run-failed";
|
|
6
6
|
import { runInRunScopes } from "@vite-hub/runtime/internal/run-scope";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { defineSchedule } from "./definition.js";
|
|
2
|
-
import { i as startSchedule, n as getSchedule, o as runSchedule, r as listSchedules, t as cancelSchedule } from "./started-
|
|
2
|
+
import { i as startSchedule, n as getSchedule, o as runSchedule, r as listSchedules, t as cancelSchedule } from "./started-Bie-z1Ij.js";
|
|
3
3
|
export { cancelSchedule, defineSchedule, getSchedule, listSchedules, runSchedule, startSchedule };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as redactInspectionText } from "./inspect-CW0qwt9p.js";
|
|
2
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
3
|
-
import { C as createScheduleError } from "./static-
|
|
4
|
-
import { a as loadScheduleRegistry, i as startSchedule, r as listSchedules, t as cancelSchedule } from "./started-
|
|
5
|
-
import { a as loadStaticScheduleDefinition, s as runScheduleFrom } from "./execute-
|
|
6
|
-
import { g as waitForProcessScheduleRuntime, i as getScheduleRunStore, n as getProcessScheduleDefinitions, o as getStartedScheduleRuntime, t as getHostScheduleInventory } from "./state-
|
|
2
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
3
|
+
import { C as createScheduleError } from "./static-0MMhvv-6.js";
|
|
4
|
+
import { a as loadScheduleRegistry, i as startSchedule, r as listSchedules, t as cancelSchedule } from "./started-Bie-z1Ij.js";
|
|
5
|
+
import { a as loadStaticScheduleDefinition, s as runScheduleFrom } from "./execute-DPaz2CIY.js";
|
|
6
|
+
import { g as waitForProcessScheduleRuntime, i as getScheduleRunStore, n as getProcessScheduleDefinitions, o as getStartedScheduleRuntime, t as getHostScheduleInventory } from "./state-ClfTAWZO.js";
|
|
7
7
|
// src/runtime/operations.ts
|
|
8
8
|
function isoDate(value) {
|
|
9
9
|
if (value === void 0) return;
|
package/dist/operations.js
CHANGED
|
@@ -139,7 +139,7 @@ function table(rows) {
|
|
|
139
139
|
return rows.map((row) => row.map((cell, column) => column === row.length - 1 ? cell : cell.padEnd(widths[column])).join(" ")).join("\n");
|
|
140
140
|
}
|
|
141
141
|
// src/operations.ts
|
|
142
|
-
const runtime = () => import("./operations-
|
|
142
|
+
const runtime = () => import("./operations-Vmqf3UFQ.js");
|
|
143
143
|
const id = v.pipe(v.string(), v.minLength(1));
|
|
144
144
|
function formatRuns({ runs }) {
|
|
145
145
|
if (runs.length === 0) return "No runs.\n";
|
package/dist/os.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as isRecord } from "./object-DNOrQSl5.js";
|
|
2
2
|
import { t as isIanaTimeZone } from "./time-zone-pMp_g8Uu.js";
|
|
3
3
|
import { a as parseCronFields, c as timesOfDay, i as isWeekdayRestricted, n as isDayRestricted, o as range, r as isMonthRestricted, s as runsEveryDay, t as arithmeticStep, u as invariantError } from "./cron-imqlBgO-.js";
|
|
4
|
-
import { i as timeZoneOffsetMinutes } from "./due-
|
|
4
|
+
import { i as timeZoneOffsetMinutes } from "./due-DuZmGuB7.js";
|
|
5
5
|
import { defineErrors } from "@vite-hub/runtime";
|
|
6
6
|
import { homedir, userInfo } from "node:os";
|
|
7
7
|
import { basename, dirname, join, posix, win32 } from "node:path";
|
|
@@ -1127,11 +1127,6 @@ function renderTaskWrapper(spec, logFile) {
|
|
|
1127
1127
|
function parseTaskWrapperLog(wrapper) {
|
|
1128
1128
|
return wrapper.match(/^\$log = '((?:[^']|'')*)'\r?$/m)?.[1]?.replaceAll("''", "'");
|
|
1129
1129
|
}
|
|
1130
|
-
/**
|
|
1131
|
-
* The base64 PowerShell command that runs the wrapper and exits with its exit code. Task Scheduler expands `%NAME%` in
|
|
1132
|
-
* the arguments of a task and has no escape for `%`, so a wrapper path in the arguments breaks under a folder such as
|
|
1133
|
-
* `C:\Users\pct %PATH%`. Base64 has no `%`.
|
|
1134
|
-
*/
|
|
1135
1130
|
function runWrapperCommand(wrapper) {
|
|
1136
1131
|
const script = `$global:LASTEXITCODE = 1\n& ${powerShellString(wrapper)}\nexit $global:LASTEXITCODE`;
|
|
1137
1132
|
return Buffer.from(script, "utf16le").toString("base64");
|
package/dist/runtime/console.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as waitForProcessScheduleRuntime, n as getProcessScheduleDefinitions, o as getStartedScheduleRuntime } from "../state-
|
|
2
|
-
import { o as resolveManualSchedule } from "../execute-
|
|
1
|
+
import { g as waitForProcessScheduleRuntime, n as getProcessScheduleDefinitions, o as getStartedScheduleRuntime } from "../state-ClfTAWZO.js";
|
|
2
|
+
import { o as resolveManualSchedule } from "../execute-DPaz2CIY.js";
|
|
3
3
|
// src/runtime/console.ts
|
|
4
4
|
const consoleSchedulesKey = Symbol.for("vitehub.console.schedules");
|
|
5
5
|
/** The Cron column of the Console: the cron, with the time zone when it is not UTC. */
|
package/dist/runtime/process.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as isRecordOrFunction } from "../object-DNOrQSl5.js";
|
|
2
|
-
import { C as createScheduleError, _ as emitLogEvent, c as markLoggedScheduleError, x as scheduleIdempotencyKey } from "../static-
|
|
3
|
-
import { n as parseScheduleCronExpression } from "../cron-
|
|
4
|
-
import { n as isScheduleDue } from "../due-
|
|
5
|
-
import { t as scheduleErrorDiagnostics } from "../error-diagnostics-
|
|
6
|
-
import { c as toRunId, i as executeStaticSchedule } from "../execute-
|
|
7
|
-
import { i as runStartedSchedules } from "../started-
|
|
8
|
-
import { a as getScheduleRuntimeRegistry, c as registerProcessScheduleDefinitions, d as setProcessScheduleRuntimeInstallation, f as setScheduleOccurrenceClaims, i as getScheduleRunStore, m as setScheduleRuntimeRegistry, p as setScheduleRunStore, r as getScheduleOccurrenceClaims } from "../state-
|
|
2
|
+
import { C as createScheduleError, _ as emitLogEvent, c as markLoggedScheduleError, x as scheduleIdempotencyKey } from "../static-0MMhvv-6.js";
|
|
3
|
+
import { n as parseScheduleCronExpression } from "../cron-eNXDzpau.js";
|
|
4
|
+
import { n as isScheduleDue } from "../due-DuZmGuB7.js";
|
|
5
|
+
import { t as scheduleErrorDiagnostics } from "../error-diagnostics-D9ul4bWA.js";
|
|
6
|
+
import { c as toRunId, i as executeStaticSchedule } from "../execute-DPaz2CIY.js";
|
|
7
|
+
import { i as runStartedSchedules } from "../started-BP-J5a0z.js";
|
|
8
|
+
import { a as getScheduleRuntimeRegistry, c as registerProcessScheduleDefinitions, d as setProcessScheduleRuntimeInstallation, f as setScheduleOccurrenceClaims, i as getScheduleRunStore, m as setScheduleRuntimeRegistry, p as setScheduleRunStore, r as getScheduleOccurrenceClaims } from "../state-ClfTAWZO.js";
|
|
9
9
|
import { createMemoryLeaseStore, getInstanceId } from "@vite-hub/runtime";
|
|
10
10
|
import { onShutdown } from "@vite-hub/runtime/internal/shutdown";
|
|
11
11
|
// src/internal/process-wake-runtime.ts
|
package/dist/runtime/state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as getHostScheduleInventory, n as getProcessScheduleDefinitions, r as getScheduleOccurrenceClaims, i as getScheduleRunStore, a as getScheduleRuntimeRegistry, o as getStartedScheduleRuntime, s as loadScheduleDefinition, c as registerProcessScheduleDefinitions, l as resetScheduleRuntime, u as setHostScheduleInventory, d as setProcessScheduleRuntimeInstallation, f as setScheduleOccurrenceClaims, p as setScheduleRunStore, m as setScheduleRuntimeRegistry, h as setStartedScheduleRuntime, g as waitForProcessScheduleRuntime } from "../state-
|
|
1
|
+
export { t as getHostScheduleInventory, n as getProcessScheduleDefinitions, r as getScheduleOccurrenceClaims, i as getScheduleRunStore, a as getScheduleRuntimeRegistry, o as getStartedScheduleRuntime, s as loadScheduleDefinition, c as registerProcessScheduleDefinitions, l as resetScheduleRuntime, u as setHostScheduleInventory, d as setProcessScheduleRuntimeInstallation, f as setScheduleOccurrenceClaims, p as setScheduleRunStore, m as setScheduleRuntimeRegistry, h as setStartedScheduleRuntime, g as waitForProcessScheduleRuntime } from "../state-ClfTAWZO.js";
|
package/dist/runtime/static.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isScheduleCronAuthorized, c as markLoggedScheduleError, d as normalizeScheduleRuntimeError, f as scheduledWakeTime, i as executeStaticSchedule, l as missingScheduleDefinitionError, n as executeCloudflareStaticSchedules, o as isTimeZoneWakeDue, p as unwrapScheduleDefinition, r as executeMatchingStaticSchedules, s as logScheduleRuntimeError, t as createStaticScheduleRun, u as normalizeCron } from "../static-
|
|
2
|
-
import { t as cronWithWeekdayNames } from "../due-
|
|
1
|
+
import { a as isScheduleCronAuthorized, c as markLoggedScheduleError, d as normalizeScheduleRuntimeError, f as scheduledWakeTime, i as executeStaticSchedule, l as missingScheduleDefinitionError, n as executeCloudflareStaticSchedules, o as isTimeZoneWakeDue, p as unwrapScheduleDefinition, r as executeMatchingStaticSchedules, s as logScheduleRuntimeError, t as createStaticScheduleRun, u as normalizeCron } from "../static-0MMhvv-6.js";
|
|
2
|
+
import { t as cronWithWeekdayNames } from "../due-DuZmGuB7.js";
|
|
3
3
|
export { createStaticScheduleRun, cronWithWeekdayNames, executeCloudflareStaticSchedules, executeMatchingStaticSchedules, executeStaticSchedule, isScheduleCronAuthorized, isTimeZoneWakeDue, logScheduleRuntimeError, markLoggedScheduleError, missingScheduleDefinitionError, normalizeCron, normalizeScheduleRuntimeError, scheduledWakeTime, unwrapScheduleDefinition };
|
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as executeStaticSchedule, r as executeSchedule, s as runScheduleFrom, t as createScheduleRun } from "./execute-
|
|
2
|
-
import { p as unwrapScheduleDefinition, u as normalizeCron } from "./static-
|
|
1
|
+
import { i as executeStaticSchedule, r as executeSchedule, s as runScheduleFrom, t as createScheduleRun } from "./execute-DPaz2CIY.js";
|
|
2
|
+
import { p as unwrapScheduleDefinition, u as normalizeCron } from "./static-0MMhvv-6.js";
|
|
3
3
|
import { t as createScheduleKVStorage } from "./kv-storage-CszEkof6.js";
|
|
4
|
-
import { i as getScheduleRunStore, l as resetScheduleRuntime, p as setScheduleRunStore, v as createKVScheduleRunStore, y as createMemoryScheduleRunStore } from "./state-
|
|
5
|
-
import { i as runStartedSchedules, n as createMemoryStartedScheduleStore, r as installStartedSchedules, t as createKVStartedScheduleStore } from "./started-
|
|
4
|
+
import { i as getScheduleRunStore, l as resetScheduleRuntime, p as setScheduleRunStore, v as createKVScheduleRunStore, y as createMemoryScheduleRunStore } from "./state-ClfTAWZO.js";
|
|
5
|
+
import { i as runStartedSchedules, n as createMemoryStartedScheduleStore, r as installStartedSchedules, t as createKVStartedScheduleStore } from "./started-BP-J5a0z.js";
|
|
6
6
|
export { createKVScheduleRunStore, createKVStartedScheduleStore, createMemoryScheduleRunStore, createMemoryStartedScheduleStore, createScheduleKVStorage, createScheduleRun, executeSchedule, executeStaticSchedule, getScheduleRunStore, installStartedSchedules, normalizeCron, resetScheduleRuntime, runScheduleFrom, runStartedSchedules, setScheduleRunStore, unwrapScheduleDefinition };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as isScheduleDue } from "./due-
|
|
2
|
-
import { c as toRunId, r as executeSchedule } from "./execute-
|
|
3
|
-
import { b as joinKey, h as setStartedScheduleRuntime, o as getStartedScheduleRuntime, r as getScheduleOccurrenceClaims, x as keySegments } from "./state-
|
|
1
|
+
import { n as isScheduleDue } from "./due-DuZmGuB7.js";
|
|
2
|
+
import { c as toRunId, r as executeSchedule } from "./execute-DPaz2CIY.js";
|
|
3
|
+
import { b as joinKey, h as setStartedScheduleRuntime, o as getStartedScheduleRuntime, r as getScheduleOccurrenceClaims, x as keySegments } from "./state-ClfTAWZO.js";
|
|
4
4
|
import { t as startedScheduleErrors } from "./started-errors-D6CnKMqD.js";
|
|
5
5
|
import { r as isRecordOrFunction } from "./object-DNOrQSl5.js";
|
|
6
|
-
import { v as errorCode, y as logFailure } from "./static-
|
|
6
|
+
import { v as errorCode, y as logFailure } from "./static-0MMhvv-6.js";
|
|
7
7
|
import { normalizeRuntimeDiagnosticError } from "@vite-hub/runtime";
|
|
8
8
|
// src/runtime/started.ts
|
|
9
9
|
const minuteMs = 6e4;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as isIanaTimeZone } from "./time-zone-pMp_g8Uu.js";
|
|
2
2
|
import { r as isRecordOrFunction } from "./object-DNOrQSl5.js";
|
|
3
|
-
import { C as createScheduleError, b as parseScheduledAt } from "./static-
|
|
4
|
-
import { l as randomId, n as executeManualSchedule, o as resolveManualSchedule } from "./execute-
|
|
5
|
-
import { g as waitForProcessScheduleRuntime, o as getStartedScheduleRuntime } from "./state-
|
|
3
|
+
import { C as createScheduleError, b as parseScheduledAt } from "./static-0MMhvv-6.js";
|
|
4
|
+
import { l as randomId, n as executeManualSchedule, o as resolveManualSchedule } from "./execute-DPaz2CIY.js";
|
|
5
|
+
import { g as waitForProcessScheduleRuntime, o as getStartedScheduleRuntime } from "./state-ClfTAWZO.js";
|
|
6
6
|
import { t as startedScheduleErrors } from "./started-errors-D6CnKMqD.js";
|
|
7
7
|
import { parseCronExpression } from "cron-schedule";
|
|
8
8
|
import { defineErrors } from "@vite-hub/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
2
2
|
import { r as isRecordOrFunction } from "./object-DNOrQSl5.js";
|
|
3
3
|
import { parseDuration } from "@vite-hub/runtime";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
2
2
|
import { r as isRecordOrFunction } from "./object-DNOrQSl5.js";
|
|
3
|
-
import { n as isScheduleDue, r as latestCronMinute, t as cronWithWeekdayNames } from "./due-
|
|
3
|
+
import { n as isScheduleDue, r as latestCronMinute, t as cronWithWeekdayNames } from "./due-DuZmGuB7.js";
|
|
4
4
|
import { ViteHubError, normalizeRuntimeDiagnosticError } from "@vite-hub/runtime";
|
|
5
5
|
import { emitRunFailed, toRunFailedError } from "@vite-hub/runtime/internal/run-failed";
|
|
6
6
|
import { runInRunScopes } from "@vite-hub/runtime/internal/run-scope";
|
package/dist/vite.js
CHANGED
|
@@ -3,13 +3,13 @@ import { a as parseCronFields, l as invariant, u as invariantError } from "./cro
|
|
|
3
3
|
import { a as relative$1, i as isAbsolute$1, n as relativeDefinitionFile, o as resolve$1, r as dirname$1 } from "./inspect-CW0qwt9p.js";
|
|
4
4
|
import { t as internalErrorDiagnostics } from "./error-diagnostics-CsiNo_oI.js";
|
|
5
5
|
import { n as isRecord, r as isRecordOrFunction, t as isObject } from "./object-DNOrQSl5.js";
|
|
6
|
-
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-
|
|
7
|
-
import { n as parseScheduleCronExpression, t as assertScheduleCronFields } from "./cron-
|
|
8
|
-
import { m as startedSchedulesTickName } from "./static-
|
|
6
|
+
import { t as scheduleErrorDiagnostics } from "./error-diagnostics-D9ul4bWA.js";
|
|
7
|
+
import { n as parseScheduleCronExpression, t as assertScheduleCronFields } from "./cron-eNXDzpau.js";
|
|
8
|
+
import { m as startedSchedulesTickName } from "./static-0MMhvv-6.js";
|
|
9
9
|
import { t as isIanaTimeZone } from "./time-zone-pMp_g8Uu.js";
|
|
10
|
-
import { i as timeZoneOffsetMinutes, t as cronWithWeekdayNames } from "./due-
|
|
10
|
+
import { i as timeZoneOffsetMinutes, t as cronWithWeekdayNames } from "./due-DuZmGuB7.js";
|
|
11
11
|
import { scheduleConsoleTiming } from "./runtime/console.js";
|
|
12
|
-
import "./state-
|
|
12
|
+
import "./state-ClfTAWZO.js";
|
|
13
13
|
import { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
14
14
|
import { formatDiagnostic } from "nostics";
|
|
15
15
|
import { parseDuration } from "@vite-hub/runtime";
|
|
@@ -521,11 +521,9 @@ function isRelativeSpecifier(path) {
|
|
|
521
521
|
function isBareSpecifier(id) {
|
|
522
522
|
return !/^(?:\.{1,2}(?:[\\/]|$)|[\\/]|[A-Za-z]:[\\/]|\0|#|[a-z][a-z0-9+.-]*:)/i.test(id);
|
|
523
523
|
}
|
|
524
|
-
/** The folder that a relative import of `importer` resolves from, as esbuild's `resolveDir`. */
|
|
525
524
|
function importerDir(importer, workingDir) {
|
|
526
525
|
return importer && isAbsolute(importer) ? dirname(importer) : workingDir;
|
|
527
526
|
}
|
|
528
|
-
/** Rolldown resolves a specifier from an importer file. A bundle entry has none, so use a file in the working folder. */
|
|
529
527
|
function importerFor(importer, workingDir) {
|
|
530
528
|
return importer ?? join(workingDir, "__vitehub_entry__.js");
|
|
531
529
|
}
|
|
@@ -558,11 +556,6 @@ function collectPackageExportCandidates(packageName, exportsValue, packageRelati
|
|
|
558
556
|
}
|
|
559
557
|
return candidates;
|
|
560
558
|
}
|
|
561
|
-
/**
|
|
562
|
-
* Resolves `specifier` from a resolveId hook without running that hook again. `flag` in `custom` also skips the hook in
|
|
563
|
-
* resolutions that other plugins start from this one. `skipSelf` is still needed: when two equal resolutions run at the
|
|
564
|
-
* same time, Rolldown 1.2 can give one of them no `custom`, and the hook would then wait on its own resolution.
|
|
565
|
-
*/
|
|
566
559
|
function resolveFrom(context, specifier, request, workingDir, flag) {
|
|
567
560
|
return context.resolve(specifier, importerFor(request.importer, workingDir), {
|
|
568
561
|
custom: {
|
|
@@ -879,9 +872,6 @@ function createWasmModulePlugin(outdir, workingDir, copy) {
|
|
|
879
872
|
}
|
|
880
873
|
};
|
|
881
874
|
}
|
|
882
|
-
/**
|
|
883
|
-
* Leaves package imports external. Resolve package.json import mappings first, and preserve unmapped host imports.
|
|
884
|
-
*/
|
|
885
875
|
function createExternalPackagesPlugin() {
|
|
886
876
|
return {
|
|
887
877
|
name: "vitehub-external-packages",
|
|
@@ -967,7 +957,6 @@ function createOptionalImportPlugin() {
|
|
|
967
957
|
}
|
|
968
958
|
};
|
|
969
959
|
}
|
|
970
|
-
/** Matches import paths as esbuild's `external` does: `*` is a wildcard, and a package name also matches its subpaths. */
|
|
971
960
|
function createExternalMatcher(patterns) {
|
|
972
961
|
if (!patterns?.length) return;
|
|
973
962
|
const matchers = patterns.map((pattern) => {
|
|
@@ -979,7 +968,6 @@ function createExternalMatcher(patterns) {
|
|
|
979
968
|
});
|
|
980
969
|
return (id) => matchers.some((matches) => matches(id));
|
|
981
970
|
}
|
|
982
|
-
/** Returns the modules of the chunks that no chunk loaded from the entry chunk imports. */
|
|
983
971
|
function findUnusedChunkModules(chunks) {
|
|
984
972
|
const used = new Set(chunks.filter((chunk) => chunk.isEntry));
|
|
985
973
|
for (const chunk of used) for (const other of chunks) if (!used.has(other) && chunk.code.includes(other.fileName)) used.add(other);
|
|
@@ -3332,7 +3320,6 @@ async function copyRetainedSourceTree(source, target, filter) {
|
|
|
3332
3320
|
}
|
|
3333
3321
|
await copyEntry(source, target, false);
|
|
3334
3322
|
}
|
|
3335
|
-
/** Copies a file or folder and follows links. `node_modules` folders and paths that disappear during the copy are skipped. */
|
|
3336
3323
|
async function copyTree(source, target) {
|
|
3337
3324
|
const info = await unlessGone(() => stat(source));
|
|
3338
3325
|
if (!info) return;
|
|
@@ -3624,16 +3611,11 @@ function objectProperties(object) {
|
|
|
3624
3611
|
function findProperty(object, name) {
|
|
3625
3612
|
return objectProperties(object).findLast((property) => property.key === name);
|
|
3626
3613
|
}
|
|
3627
|
-
/** The value of a template literal without substitutions. */
|
|
3628
3614
|
function staticTemplate(node) {
|
|
3629
3615
|
if (node.expressions.length) return dynamic;
|
|
3630
3616
|
return node.quasis[0]?.value.cooked ?? dynamic;
|
|
3631
3617
|
}
|
|
3632
3618
|
const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
|
|
3633
|
-
/**
|
|
3634
|
-
* True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
|
|
3635
|
-
* and accepts legacy octal escapes, so the scanner checks them again.
|
|
3636
|
-
*/
|
|
3637
3619
|
function hasInvalidEscape(raw) {
|
|
3638
3620
|
for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
|
|
3639
3621
|
const code = escape.slice(2, -1);
|
|
@@ -3700,7 +3682,6 @@ function staticString(node) {
|
|
|
3700
3682
|
function isLineTerminator(char) {
|
|
3701
3683
|
return char === "\n" || char === "\r" || char === "\u2028" || char === "\u2029";
|
|
3702
3684
|
}
|
|
3703
|
-
/** Comments, JSX text, and string, template, and regular expression literals, sorted by position. Templates are not split. */
|
|
3704
3685
|
function literalSpans(module) {
|
|
3705
3686
|
const spans = module.comments.map((comment) => ({
|
|
3706
3687
|
end: comment.end,
|
|
@@ -3790,7 +3771,6 @@ async function rebasePublishedProviderSourceLinks(stagedSourcesDir, retainedSour
|
|
|
3790
3771
|
};
|
|
3791
3772
|
await visit(stagedSourcesDir);
|
|
3792
3773
|
}
|
|
3793
|
-
/** Lists the existing published source paths that `contents` names, in every form that the rewrite reads. */
|
|
3794
3774
|
function referencedProviderSourcePaths(contents, publishedSourcesDir) {
|
|
3795
3775
|
const prefixes = [{
|
|
3796
3776
|
decode: (path) => path,
|
|
@@ -3816,9 +3796,7 @@ function referencedProviderSourcePaths(contents, publishedSourcesDir) {
|
|
|
3816
3796
|
}
|
|
3817
3797
|
return [...references].filter((reference) => ![...references].some((parent) => parent !== reference && pathContains$1(parent, reference)));
|
|
3818
3798
|
}
|
|
3819
|
-
/** Dotenv files (`.env*`, Wrangler `.dev.vars*`), registry credentials, and Wrangler state hold local secrets. */
|
|
3820
3799
|
const localSecretFile = /^(?:\.env|\.dev\.vars)(?:\..*)?$|^\.(?:netrc|npmrc|wrangler)$/;
|
|
3821
|
-
/** A retained snapshot and a deployment never receive local secret files, even inside a directory that the code names. */
|
|
3822
3800
|
function isLocalSecretFile(path) {
|
|
3823
3801
|
return localSecretFile.test(basename(path));
|
|
3824
3802
|
}
|
|
@@ -3926,10 +3904,6 @@ function pathContains$1(parent, child) {
|
|
|
3926
3904
|
const nested = relative(parent, child);
|
|
3927
3905
|
return !nested || !nested.startsWith(`..${sep}`) && nested !== ".." && !isAbsolute(nested);
|
|
3928
3906
|
}
|
|
3929
|
-
/**
|
|
3930
|
-
* Creates a check that tells whether a path belongs to a dependency: a named package installed under `node_modules`,
|
|
3931
|
-
* or a named package outside the configured roots, such as a linked workspace package.
|
|
3932
|
-
*/
|
|
3933
3907
|
function createDependencySourceCheck(roots) {
|
|
3934
3908
|
const namedPackages = /* @__PURE__ */ new Map();
|
|
3935
3909
|
const isNamedPackage = (directory) => {
|
|
@@ -4077,7 +4051,6 @@ function resolveComputedModuleSource(file, specifier, resolveFrom = file) {
|
|
|
4077
4051
|
return;
|
|
4078
4052
|
}
|
|
4079
4053
|
}
|
|
4080
|
-
/** The index of the delimiter that closes the one at `open`. `masked` has no literals or comments. */
|
|
4081
4054
|
function matchingDelimiter(masked, open) {
|
|
4082
4055
|
let depth = 0;
|
|
4083
4056
|
for (let index = open; index < masked.length; index++) {
|
|
@@ -4086,7 +4059,6 @@ function matchingDelimiter(masked, open) {
|
|
|
4086
4059
|
else if ((char === ")" || char === "]" || char === "}") && --depth === 0) return index;
|
|
4087
4060
|
}
|
|
4088
4061
|
}
|
|
4089
|
-
/** Splits `source.slice(start, end)` at top-level commas. */
|
|
4090
4062
|
function splitTopLevel(source, masked, start, end) {
|
|
4091
4063
|
const parts = [];
|
|
4092
4064
|
let depth = 0;
|
|
@@ -4490,12 +4462,6 @@ function packageMetadataSourcesForPath(root, path) {
|
|
|
4490
4462
|
}
|
|
4491
4463
|
return sources;
|
|
4492
4464
|
}
|
|
4493
|
-
/**
|
|
4494
|
-
* Generated Provider Output can import a package by the physical pnpm store path
|
|
4495
|
-
* that Vite resolved during the source build. Retained source trees do not copy
|
|
4496
|
-
* `node_modules/.pnpm`, so keep only the store package directories that the
|
|
4497
|
-
* traced source graph actually references.
|
|
4498
|
-
*/
|
|
4499
4465
|
function pnpmStorePackageRoot(root, source) {
|
|
4500
4466
|
const segments = relative(root, source).split(sep);
|
|
4501
4467
|
let nodeModulesIndex = -1;
|
|
@@ -6549,10 +6515,6 @@ const runs = shared[runsKey] ??= /* @__PURE__ */ new Map();
|
|
|
6549
6515
|
const startedKey = Symbol.for("vitehub.hints.started");
|
|
6550
6516
|
const startedShared = globalThis;
|
|
6551
6517
|
const started = startedShared[startedKey] ??= /* @__PURE__ */ new WeakSet();
|
|
6552
|
-
/**
|
|
6553
|
-
* The report of the ViteHub project root, where the other generated files go. A Nuxt app with `srcDir: "app"` has its
|
|
6554
|
-
* Vite root in `app/`, one folder below.
|
|
6555
|
-
*/
|
|
6556
6518
|
function hintsFile(config) {
|
|
6557
6519
|
const projectRoot = Reflect.get(config, VITEHUB_PROJECT_ROOT);
|
|
6558
6520
|
return resolve(typeof projectRoot === "string" ? projectRoot : resolveViteHubProjectRoot(config.root), viteHubHintsFile);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/schedule",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Schedule primitives and definition discovery for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@valibot/to-json-schema": "^1.8.0",
|
|
78
|
-
"@vite-hub/runtime": "0.
|
|
78
|
+
"@vite-hub/runtime": "0.9.0",
|
|
79
79
|
"cron-schedule": "^8.0.1",
|
|
80
80
|
"magic-string": "^1.4.5",
|
|
81
81
|
"nostics": "1.4.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "^24.19.2",
|
|
86
86
|
"@vite-hub/internal": "0.0.1",
|
|
87
|
-
"@vite-hub/kv": "0.
|
|
87
|
+
"@vite-hub/kv": "0.9.0",
|
|
88
88
|
"esbuild": "^0.28.2",
|
|
89
89
|
"fast-check": "^4.11.0",
|
|
90
90
|
"nitro": "^3.0.261103-rc",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"vitest": "5.1.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@vite-hub/kv": "0.
|
|
99
|
+
"@vite-hub/kv": "0.9.0",
|
|
100
100
|
"nitro": "3.0.261102-rc || ^3.0.261103-rc",
|
|
101
101
|
"vite": ">=8.0.0"
|
|
102
102
|
},
|