@lunora/vue 0.0.0 → 1.0.0-alpha.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/LICENSE.md +105 -0
- package/README.md +124 -9
- package/__assets__/package-og.svg +14 -0
- package/dist/index.d.mts +348 -0
- package/dist/index.d.ts +348 -0
- package/dist/index.mjs +11 -0
- package/dist/packem_shared/Authenticated-_6-uOycE.mjs +29 -0
- package/dist/packem_shared/LUNORA_INJECTION_KEY-DtFXLDQ_.mjs +22 -0
- package/dist/packem_shared/hydratePreloaded-rVY68iFv.mjs +14 -0
- package/dist/packem_shared/subscribeToQuery-Cv5YL-SI.mjs +51 -0
- package/dist/packem_shared/useAuth-C2aEzXXH.mjs +28 -0
- package/dist/packem_shared/useConnectionStatus-CDgduQYe.mjs +20 -0
- package/dist/packem_shared/useInfiniteQuery-CEfbw7Nw.mjs +199 -0
- package/dist/packem_shared/useMutation-DWubV5pv.mjs +29 -0
- package/dist/packem_shared/usePresence-BeN5xaZM.mjs +59 -0
- package/dist/packem_shared/useRateLimit-DlPWjcX1.mjs +67 -0
- package/dist/packem_shared/useSubscription-Ol0AZFUv.mjs +47 -0
- package/dist/server.d.mts +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.mjs +1 -0
- package/dist/worker.d.mts +1 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.mjs +1 -0
- package/package.json +58 -17
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { shallowRef, watch, toValue, onScopeDispose, computed } from 'vue';
|
|
2
|
+
import { initialPages, derivePaginationStatus, rebalance, applyLoadMore } from '@lunora/client/pagination';
|
|
3
|
+
import { useLunora } from './LUNORA_INJECTION_KEY-DtFXLDQ_.mjs';
|
|
4
|
+
|
|
5
|
+
const buildPageKey = (functionPath, pageArgs) => `${functionPath}::${JSON.stringify(pageArgs)}`;
|
|
6
|
+
const buildPageArgs = (page, baseArgs) => {
|
|
7
|
+
return {
|
|
8
|
+
...baseArgs,
|
|
9
|
+
paginationOpts: { cursor: page.lower, endCursor: page.upper, numItems: page.numItems }
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const usePaginatedCore = (function_, args, options) => {
|
|
13
|
+
const client = useLunora();
|
|
14
|
+
const { initialNumItems, shardKey } = options;
|
|
15
|
+
const pages = shallowRef(initialPages(initialNumItems));
|
|
16
|
+
const pageResults = shallowRef([]);
|
|
17
|
+
const activeSubs = /* @__PURE__ */ new Map();
|
|
18
|
+
const resultsByKey = /* @__PURE__ */ new Map();
|
|
19
|
+
const pendingPageKeys = /* @__PURE__ */ new Set();
|
|
20
|
+
const rebuildPageResults = (currentPages, baseArgs) => {
|
|
21
|
+
pageResults.value = currentPages.map((page) => {
|
|
22
|
+
const key = buildPageKey(function_["__lunoraRef"], buildPageArgs(page, baseArgs));
|
|
23
|
+
return resultsByKey.get(key);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const migrateResultsForRebalance = (oldPages, newPages, baseArgs) => {
|
|
27
|
+
const keyOf = (page) => buildPageKey(function_["__lunoraRef"], buildPageArgs(page, baseArgs));
|
|
28
|
+
for (const newPage of newPages) {
|
|
29
|
+
const newKey = keyOf(newPage);
|
|
30
|
+
if (resultsByKey.has(newKey)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const donor = oldPages.find((op) => op.lower === newPage.lower);
|
|
34
|
+
if (donor) {
|
|
35
|
+
const carried = resultsByKey.get(keyOf(donor));
|
|
36
|
+
if (carried) {
|
|
37
|
+
resultsByKey.set(newKey, carried);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const syncSubscriptions = (currentPages, baseArgs) => {
|
|
43
|
+
const wantedKeys = /* @__PURE__ */ new Set();
|
|
44
|
+
for (const page of currentPages) {
|
|
45
|
+
wantedKeys.add(buildPageKey(function_["__lunoraRef"], buildPageArgs(page, baseArgs)));
|
|
46
|
+
}
|
|
47
|
+
for (const [originalKey, entry] of activeSubs) {
|
|
48
|
+
if (!wantedKeys.has(entry.currentKey)) {
|
|
49
|
+
entry.unsub();
|
|
50
|
+
activeSubs.delete(originalKey);
|
|
51
|
+
resultsByKey.delete(entry.currentKey);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const coveredKeys = new Set([...activeSubs.values()].map((subEntry) => subEntry.currentKey));
|
|
55
|
+
for (const page of currentPages) {
|
|
56
|
+
const pageArgs = buildPageArgs(page, baseArgs);
|
|
57
|
+
const key = buildPageKey(function_["__lunoraRef"], pageArgs);
|
|
58
|
+
if (coveredKeys.has(key)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const entry = {
|
|
62
|
+
currentKey: key,
|
|
63
|
+
unsub: void 0
|
|
64
|
+
};
|
|
65
|
+
pendingPageKeys.add(key);
|
|
66
|
+
const unsub = client.subscribe(
|
|
67
|
+
function_,
|
|
68
|
+
pageArgs,
|
|
69
|
+
(value) => {
|
|
70
|
+
resultsByKey.set(entry.currentKey, value);
|
|
71
|
+
pendingPageKeys.delete(entry.currentKey);
|
|
72
|
+
const currentBaseArgs = toValue(args);
|
|
73
|
+
rebuildPageResults(pages.value, currentBaseArgs);
|
|
74
|
+
if (pendingPageKeys.size === 0) {
|
|
75
|
+
const latestPages = pages.value;
|
|
76
|
+
const next = rebalance(latestPages, pageResults.value);
|
|
77
|
+
if (next) {
|
|
78
|
+
migrateResultsForRebalance(latestPages, next, currentBaseArgs);
|
|
79
|
+
pages.value = next;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{ shardKey }
|
|
84
|
+
);
|
|
85
|
+
entry.unsub = unsub;
|
|
86
|
+
activeSubs.set(key, entry);
|
|
87
|
+
coveredKeys.add(key);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const teardownAll = () => {
|
|
91
|
+
for (const entry of activeSubs.values()) {
|
|
92
|
+
entry.unsub();
|
|
93
|
+
}
|
|
94
|
+
activeSubs.clear();
|
|
95
|
+
resultsByKey.clear();
|
|
96
|
+
};
|
|
97
|
+
watch(
|
|
98
|
+
() => toValue(args),
|
|
99
|
+
(current) => {
|
|
100
|
+
teardownAll();
|
|
101
|
+
pages.value = initialPages(initialNumItems);
|
|
102
|
+
pageResults.value = [];
|
|
103
|
+
if (current !== "skip") {
|
|
104
|
+
syncSubscriptions(pages.value, current);
|
|
105
|
+
rebuildPageResults(pages.value, current);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{ immediate: true }
|
|
109
|
+
);
|
|
110
|
+
watch(
|
|
111
|
+
() => pages.value,
|
|
112
|
+
(currentPages) => {
|
|
113
|
+
const current = toValue(args);
|
|
114
|
+
if (current !== "skip") {
|
|
115
|
+
syncSubscriptions(currentPages, current);
|
|
116
|
+
rebuildPageResults(currentPages, current);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
onScopeDispose(teardownAll);
|
|
121
|
+
const status = shallowRef("LoadingFirstPage");
|
|
122
|
+
watch(
|
|
123
|
+
[() => toValue(args), pageResults],
|
|
124
|
+
([currentArgs, currentResults]) => {
|
|
125
|
+
status.value = derivePaginationStatus(currentArgs === "skip", currentResults).status;
|
|
126
|
+
},
|
|
127
|
+
{ immediate: true }
|
|
128
|
+
);
|
|
129
|
+
const loadMore = (numberItems) => {
|
|
130
|
+
const currentArgs = toValue(args);
|
|
131
|
+
if (currentArgs === "skip") {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const { nextCursor, status: currentStatus } = derivePaginationStatus(false, pageResults.value);
|
|
135
|
+
if (currentStatus !== "CanLoadMore") {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const next = applyLoadMore(pages.value, nextCursor, numberItems);
|
|
139
|
+
if (!next) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const oldTail = pages.value.at(-1);
|
|
143
|
+
const newPinnedPage = next.at(-2);
|
|
144
|
+
if (oldTail && newPinnedPage) {
|
|
145
|
+
const oldKey = buildPageKey(function_["__lunoraRef"], buildPageArgs(oldTail, currentArgs));
|
|
146
|
+
const newKey = buildPageKey(function_["__lunoraRef"], buildPageArgs(newPinnedPage, currentArgs));
|
|
147
|
+
const entry = activeSubs.get(oldKey);
|
|
148
|
+
if (entry && oldKey !== newKey) {
|
|
149
|
+
entry.currentKey = newKey;
|
|
150
|
+
activeSubs.set(newKey, entry);
|
|
151
|
+
activeSubs.delete(oldKey);
|
|
152
|
+
const carried = resultsByKey.get(oldKey);
|
|
153
|
+
if (carried) {
|
|
154
|
+
resultsByKey.set(newKey, carried);
|
|
155
|
+
resultsByKey.delete(oldKey);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
pages.value = next;
|
|
160
|
+
};
|
|
161
|
+
return { loadMore, pageResults, status };
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const usePaginatedQuery = (function_, args, options) => {
|
|
165
|
+
const { loadMore, pageResults, status } = usePaginatedCore(function_, args, options);
|
|
166
|
+
const results = computed(() => {
|
|
167
|
+
const items = [];
|
|
168
|
+
for (const result of pageResults.value) {
|
|
169
|
+
if (result) {
|
|
170
|
+
items.push(...result.page);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return items;
|
|
174
|
+
});
|
|
175
|
+
const isLoading = computed(() => status.value === "LoadingFirstPage" || status.value === "LoadingMore");
|
|
176
|
+
return { isLoading, loadMore, results, status };
|
|
177
|
+
};
|
|
178
|
+
const useInfiniteQuery = (function_, args, options) => {
|
|
179
|
+
const { initialNumItems } = options;
|
|
180
|
+
const { loadMore, pageResults, status } = usePaginatedCore(function_, args, options);
|
|
181
|
+
const pages = computed(() => {
|
|
182
|
+
const result = [];
|
|
183
|
+
for (const page of pageResults.value) {
|
|
184
|
+
if (page) {
|
|
185
|
+
result.push(page.page);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
});
|
|
190
|
+
const isLoading = computed(() => status.value === "LoadingFirstPage");
|
|
191
|
+
const hasNextPage = computed(() => status.value === "CanLoadMore");
|
|
192
|
+
const isFetchingNextPage = computed(() => status.value === "LoadingMore");
|
|
193
|
+
const fetchNextPage = (numberItems) => {
|
|
194
|
+
loadMore(numberItems ?? initialNumItems);
|
|
195
|
+
};
|
|
196
|
+
return { fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, pages, status };
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { useInfiniteQuery, usePaginatedQuery };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createMutationRunner } from '@lunora/client';
|
|
2
|
+
import { shallowRef, ref } from 'vue';
|
|
3
|
+
import { useLunora } from './LUNORA_INJECTION_KEY-DtFXLDQ_.mjs';
|
|
4
|
+
|
|
5
|
+
const useMutation = (function_) => {
|
|
6
|
+
const client = useLunora();
|
|
7
|
+
const data = shallowRef(void 0);
|
|
8
|
+
const error = shallowRef(void 0);
|
|
9
|
+
const pending = ref(false);
|
|
10
|
+
const reset = () => {
|
|
11
|
+
data.value = void 0;
|
|
12
|
+
error.value = void 0;
|
|
13
|
+
};
|
|
14
|
+
const mutate = createMutationRunner(client, function_, {
|
|
15
|
+
setError: (next) => {
|
|
16
|
+
error.value = next;
|
|
17
|
+
},
|
|
18
|
+
setPending: (next) => {
|
|
19
|
+
pending.value = next;
|
|
20
|
+
},
|
|
21
|
+
setResult: (result) => {
|
|
22
|
+
data.value = result;
|
|
23
|
+
error.value = void 0;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return { data, error, mutate, pending, reset };
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { useMutation };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { shallowRef, onScopeDispose } from 'vue';
|
|
2
|
+
import { useLunora } from './LUNORA_INJECTION_KEY-DtFXLDQ_.mjs';
|
|
3
|
+
|
|
4
|
+
const makeSessionId = () => {
|
|
5
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
6
|
+
return crypto.randomUUID();
|
|
7
|
+
}
|
|
8
|
+
return `sess-${Math.random().toString(36).slice(2)}-${String(Date.now())}`;
|
|
9
|
+
};
|
|
10
|
+
const DEFAULT_INTERVAL_MS = 1e4;
|
|
11
|
+
const usePresence = (roomId, options) => {
|
|
12
|
+
const client = useLunora();
|
|
13
|
+
const { heartbeat, intervalMs = DEFAULT_INTERVAL_MS, listPresent, shardKey } = options;
|
|
14
|
+
const sessionId = options.sessionId ?? makeSessionId();
|
|
15
|
+
const present = shallowRef(void 0);
|
|
16
|
+
let latestData = options.data;
|
|
17
|
+
const sendHeartbeat = () => {
|
|
18
|
+
const args = {
|
|
19
|
+
roomId,
|
|
20
|
+
sessionId,
|
|
21
|
+
...latestData === void 0 ? {} : { data: latestData }
|
|
22
|
+
};
|
|
23
|
+
client.mutation(heartbeat, args, { shardKey }).catch(() => void 0);
|
|
24
|
+
};
|
|
25
|
+
const setData = (next) => {
|
|
26
|
+
latestData = next;
|
|
27
|
+
sendHeartbeat();
|
|
28
|
+
};
|
|
29
|
+
sendHeartbeat();
|
|
30
|
+
const intervalHandle = setInterval(sendHeartbeat, intervalMs);
|
|
31
|
+
const onVisible = () => {
|
|
32
|
+
if (typeof document !== "undefined" && document.visibilityState === "visible") {
|
|
33
|
+
sendHeartbeat();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
if (typeof document !== "undefined") {
|
|
37
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
38
|
+
}
|
|
39
|
+
const releaseConnectionContext = client.acquireConnectionContext({ roomId, sessionId }, { shardKey });
|
|
40
|
+
const unsubscribe = client.subscribe(
|
|
41
|
+
listPresent,
|
|
42
|
+
{ roomId },
|
|
43
|
+
(value) => {
|
|
44
|
+
present.value = value;
|
|
45
|
+
},
|
|
46
|
+
{ shardKey }
|
|
47
|
+
);
|
|
48
|
+
onScopeDispose(() => {
|
|
49
|
+
clearInterval(intervalHandle);
|
|
50
|
+
if (typeof document !== "undefined") {
|
|
51
|
+
document.removeEventListener("visibilitychange", onVisible);
|
|
52
|
+
}
|
|
53
|
+
releaseConnectionContext();
|
|
54
|
+
unsubscribe();
|
|
55
|
+
});
|
|
56
|
+
return { present, sessionId, setData };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { usePresence };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { evaluate } from '@lunora/ratelimit';
|
|
2
|
+
import { shallowRef, toValue, watchEffect, onScopeDispose, computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
const useRateLimit = (config, options = {}) => {
|
|
5
|
+
const now = options.now ?? Date.now;
|
|
6
|
+
const tickMs = options.tickMs ?? 1e3;
|
|
7
|
+
let value;
|
|
8
|
+
const epoch = shallowRef(0);
|
|
9
|
+
const bump = () => {
|
|
10
|
+
epoch.value += 1;
|
|
11
|
+
};
|
|
12
|
+
const status = shallowRef(evaluate(toValue(config), value, { consume: false, count: 1, now: now(), reserve: false }).status);
|
|
13
|
+
const stopStatusEffect = watchEffect(
|
|
14
|
+
() => {
|
|
15
|
+
status.value = evaluate(toValue(config), value, { consume: false, count: 1, now: now(), reserve: false }).status;
|
|
16
|
+
},
|
|
17
|
+
{ flush: "sync" }
|
|
18
|
+
);
|
|
19
|
+
let intervalHandle;
|
|
20
|
+
const stopInterval = () => {
|
|
21
|
+
if (intervalHandle !== void 0) {
|
|
22
|
+
clearInterval(intervalHandle);
|
|
23
|
+
intervalHandle = void 0;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const startIntervalIfThrottled = () => {
|
|
27
|
+
if (status.value.ok || intervalHandle !== void 0) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
intervalHandle = setInterval(() => {
|
|
31
|
+
bump();
|
|
32
|
+
if (status.value.ok) {
|
|
33
|
+
stopInterval();
|
|
34
|
+
}
|
|
35
|
+
}, tickMs);
|
|
36
|
+
};
|
|
37
|
+
onScopeDispose(() => {
|
|
38
|
+
stopInterval();
|
|
39
|
+
stopStatusEffect();
|
|
40
|
+
});
|
|
41
|
+
startIntervalIfThrottled();
|
|
42
|
+
const consume = (count = 1) => {
|
|
43
|
+
const result = evaluate(toValue(config), value, { consume: true, count, now: now(), reserve: false });
|
|
44
|
+
if (result.value !== void 0) {
|
|
45
|
+
value = result.value;
|
|
46
|
+
}
|
|
47
|
+
bump();
|
|
48
|
+
startIntervalIfThrottled();
|
|
49
|
+
return result.status;
|
|
50
|
+
};
|
|
51
|
+
const check = (count = 1) => evaluate(toValue(config), value, { consume: false, count, now: now(), reserve: false }).status.ok;
|
|
52
|
+
const reset = () => {
|
|
53
|
+
value = void 0;
|
|
54
|
+
stopInterval();
|
|
55
|
+
bump();
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
check,
|
|
59
|
+
consume,
|
|
60
|
+
disabled: computed(() => !status.value.ok),
|
|
61
|
+
ok: computed(() => status.value.ok),
|
|
62
|
+
reset,
|
|
63
|
+
retryAfter: computed(() => status.value.retryAfter)
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { useRateLimit };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createQuerySubscription } from '@lunora/client/query';
|
|
2
|
+
import { ref, watch, toValue, onScopeDispose } from 'vue';
|
|
3
|
+
import { useLunora } from './LUNORA_INJECTION_KEY-DtFXLDQ_.mjs';
|
|
4
|
+
|
|
5
|
+
const useSubscription = (function_, args, options = {}) => {
|
|
6
|
+
const client = useLunora();
|
|
7
|
+
const data = ref(void 0);
|
|
8
|
+
const error = ref(void 0);
|
|
9
|
+
watch(
|
|
10
|
+
() => toValue(args),
|
|
11
|
+
(currentArgs, _previous, onCleanup) => {
|
|
12
|
+
if (currentArgs === "skip") {
|
|
13
|
+
data.value = void 0;
|
|
14
|
+
error.value = void 0;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const unsubscribe = createQuerySubscription(
|
|
18
|
+
client,
|
|
19
|
+
function_,
|
|
20
|
+
currentArgs,
|
|
21
|
+
{
|
|
22
|
+
onData: (value) => {
|
|
23
|
+
data.value = value;
|
|
24
|
+
error.value = void 0;
|
|
25
|
+
},
|
|
26
|
+
onError: (subscriptionError) => {
|
|
27
|
+
error.value = new Error(subscriptionError.message);
|
|
28
|
+
data.value = void 0;
|
|
29
|
+
},
|
|
30
|
+
onReset: () => {
|
|
31
|
+
data.value = void 0;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{ shardKey: options.shardKey }
|
|
35
|
+
);
|
|
36
|
+
onCleanup(unsubscribe);
|
|
37
|
+
},
|
|
38
|
+
{ immediate: true }
|
|
39
|
+
);
|
|
40
|
+
onScopeDispose(() => {
|
|
41
|
+
data.value = void 0;
|
|
42
|
+
error.value = void 0;
|
|
43
|
+
});
|
|
44
|
+
return { data, error };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { useSubscription };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ArgsOf, type AuthLike, type FunctionReference, type HeadersSource, type Preloaded, type ReturnOf, type ServerClientOptions, type ServerSession, createServerClient, deserializePreloaded, getServerSession, preloadQuery, preloadedQueryResult, serializePreloaded } from '@lunora/client/ssr';
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ArgsOf, type AuthLike, type FunctionReference, type HeadersSource, type Preloaded, type ReturnOf, type ServerClientOptions, type ServerSession, createServerClient, deserializePreloaded, getServerSession, preloadQuery, preloadedQueryResult, serializePreloaded } from '@lunora/client/ssr';
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createServerClient, deserializePreloaded, getServerSession, preloadQuery, preloadedQueryResult, serializePreloaded } from '@lunora/client/ssr';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type LunoraWorker as ComposedWorker, type ExecutionContextLike, type FrameworkWorkerOptionsInput, type FrameworkHostHandler as NitroCloudflareHandler, type ScheduledControllerLike, type FrameworkWorkerOptions as WithLunoraOptions, withFrameworkWorker as withLunora } from '@lunora/runtime';
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type LunoraWorker as ComposedWorker, type ExecutionContextLike, type FrameworkWorkerOptionsInput, type FrameworkHostHandler as NitroCloudflareHandler, type ScheduledControllerLike, type FrameworkWorkerOptions as WithLunoraOptions, withFrameworkWorker as withLunora } from '@lunora/runtime';
|
package/dist/worker.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { withFrameworkWorker as withLunora } from '@lunora/runtime';
|
package/package.json
CHANGED
|
@@ -1,31 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "Vue adapter for Lunora — live composables, optimistic mutations, and reactive loaders",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cloudflare",
|
|
7
|
+
"composables",
|
|
8
|
+
"durable-objects",
|
|
9
|
+
"lunora",
|
|
10
|
+
"optimistic-updates",
|
|
11
|
+
"realtime",
|
|
12
|
+
"vue",
|
|
13
|
+
"workers"
|
|
14
|
+
],
|
|
6
15
|
"homepage": "https://lunora.sh",
|
|
16
|
+
"bugs": "https://github.com/anolilab/lunora/issues",
|
|
17
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Daniel Bannert",
|
|
20
|
+
"email": "d.bannert@anolilab.de"
|
|
21
|
+
},
|
|
7
22
|
"repository": {
|
|
8
23
|
"type": "git",
|
|
9
24
|
"url": "git+https://github.com/anolilab/lunora.git",
|
|
10
25
|
"directory": "packages/vue"
|
|
11
26
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"cloudflare",
|
|
18
|
-
"workers",
|
|
19
|
-
"durable-objects",
|
|
20
|
-
"vue",
|
|
21
|
-
"composables",
|
|
22
|
-
"realtime",
|
|
23
|
-
"optimistic-updates"
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE.md",
|
|
31
|
+
"__assets__"
|
|
24
32
|
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"main": "./dist/index.mjs",
|
|
36
|
+
"module": "./dist/index.mjs",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"import": "./dist/index.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./server": {
|
|
44
|
+
"types": "./dist/server.d.ts",
|
|
45
|
+
"import": "./dist/server.mjs"
|
|
46
|
+
},
|
|
47
|
+
"./worker": {
|
|
48
|
+
"types": "./dist/worker.d.ts",
|
|
49
|
+
"import": "./dist/worker.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./package.json": "./package.json"
|
|
52
|
+
},
|
|
25
53
|
"publishConfig": {
|
|
26
54
|
"access": "public"
|
|
27
55
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@lunora/client": "1.0.0-alpha.1",
|
|
58
|
+
"@lunora/ratelimit": "1.0.0-alpha.2",
|
|
59
|
+
"@lunora/runtime": "1.0.0-alpha.1"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"vue": "^3.5.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"vue": {
|
|
66
|
+
"optional": false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": "^22.15.0 || >=24.11.0"
|
|
71
|
+
}
|
|
31
72
|
}
|