@vite-hub/schedule 0.0.0 → 0.0.2

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/vite.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ //#region src/vite.d.ts
2
+ interface ScheduleProcessRuntimeOptions {
3
+ concurrency?: number;
4
+ driver: "process";
5
+ intervalMs?: number;
6
+ prefix?: string;
7
+ }
8
+ interface ScheduleVitePluginOptions {
9
+ providerOutput?: "auto" | "standalone" | "nitro" | false;
10
+ projectRoot?: string;
11
+ runtime?: ScheduleProcessRuntimeOptions;
12
+ }
13
+ interface ScheduleNitroConfigOptions extends ScheduleVitePluginOptions {
14
+ command?: "build" | "serve";
15
+ nitro?: unknown;
16
+ root?: string;
17
+ }
18
+ interface ScheduleVitePlugin {
19
+ name: string;
20
+ [hook: string]: unknown;
21
+ }
22
+ type NitroConfig = Record<string, unknown> & {
23
+ cloudflare?: {
24
+ wrangler?: {
25
+ triggers?: {
26
+ crons?: string[];
27
+ } & Record<string, unknown>;
28
+ } & Record<string, unknown>;
29
+ } & Record<string, unknown>;
30
+ modules?: unknown[];
31
+ plugins?: unknown[];
32
+ };
33
+ declare function createScheduleNitroConfig(options?: ScheduleNitroConfigOptions): Promise<NitroConfig | null>;
34
+ declare function hubSchedule(options?: ScheduleVitePluginOptions): ScheduleVitePlugin;
35
+ //#endregion
36
+ export { ScheduleNitroConfigOptions, ScheduleProcessRuntimeOptions, ScheduleVitePlugin, ScheduleVitePluginOptions, createScheduleNitroConfig, hubSchedule };
package/dist/vite.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as hubSchedule, t as createScheduleNitroConfig } from "./vite-Dfeg9ZY3.js";
2
+ export { createScheduleNitroConfig, hubSchedule };
@@ -0,0 +1,23 @@
1
+ //#region src/runtime/wait-until.ts
2
+ function createLocalWaitUntil() {
3
+ const pending = /* @__PURE__ */ new Set();
4
+ let error;
5
+ let failed = false;
6
+ return {
7
+ async flush() {
8
+ while (pending.size > 0) await Promise.allSettled([...pending]);
9
+ if (failed) throw error;
10
+ },
11
+ waitUntil(value) {
12
+ const promise = Promise.resolve(value);
13
+ pending.add(promise);
14
+ promise.then(() => pending.delete(promise), (reason) => {
15
+ pending.delete(promise);
16
+ if (!failed) error = reason;
17
+ failed = true;
18
+ });
19
+ }
20
+ };
21
+ }
22
+ //#endregion
23
+ export { createLocalWaitUntil as t };
package/package.json CHANGED
@@ -1,9 +1,71 @@
1
1
  {
2
2
  "name": "@vite-hub/schedule",
3
- "version": "0.0.0",
4
- "description": "Reserved package name for ViteHub.",
3
+ "version": "0.0.2",
4
+ "description": "Schedule primitives and definition discovery for ViteHub.",
5
+ "keywords": [
6
+ "cron",
7
+ "schedule",
8
+ "vite",
9
+ "vitehub"
10
+ ],
11
+ "homepage": "https://github.com/vite-hub/vitehub#readme",
12
+ "bugs": "https://github.com/vite-hub/vitehub/issues",
5
13
  "license": "Apache-2.0",
6
- "publishConfig": {
7
- "access": "public"
14
+ "author": "onmax <maximogarciamtnez@gmail.com>",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/vite-hub/vitehub.git",
18
+ "directory": "packages/schedule"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "package.json"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": false,
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": "./dist/index.js",
29
+ "./nuxt": "./dist/nuxt.js",
30
+ "./runtime": "./dist/runtime.js",
31
+ "./runtime/driver": "./dist/runtime/driver.js",
32
+ "./runtime/process": "./dist/runtime/process.js",
33
+ "./runtime/state": "./dist/runtime/state.js",
34
+ "./runtime/static": "./dist/runtime/static.js",
35
+ "./vite": "./dist/vite.js",
36
+ "./package.json": "./package.json"
37
+ },
38
+ "dependencies": {
39
+ "cron-schedule": "^6.0.0",
40
+ "effect": "4.0.0-beta.99",
41
+ "esbuild": "^0.28.1",
42
+ "@vite-hub/runtime": "0.0.2",
43
+ "@vite-hub/kv": "0.0.2"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^24.13.3",
47
+ "publint": "^0.3.21",
48
+ "typescript": "^6.0.3",
49
+ "vite": "^8.0.8",
50
+ "vite-plus": "^0.1.24",
51
+ "vitest": "^4.1.4",
52
+ "@vite-hub/internal": "0.0.1"
53
+ },
54
+ "peerDependencies": {
55
+ "vite": ">=8.0.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "vite": {
59
+ "optional": true
60
+ }
61
+ },
62
+ "engines": {
63
+ "node": ">=24.15.0"
64
+ },
65
+ "scripts": {
66
+ "build": "vp pack",
67
+ "dev": "vp pack --watch",
68
+ "typecheck": "tsc --noEmit -p ./tsconfig.json",
69
+ "test": "vp run -t @vite-hub/schedule#build && vp test"
8
70
  }
9
- }
71
+ }