@vite-hub/comments 0.3.1 → 0.5.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/README.md +37 -15
- package/dist/anchor.d.ts +2 -2
- package/dist/{client-diagnostics-CcFpkbAk.js → client-diagnostics-Bubm7Shd.js} +20 -5
- package/dist/client-files-CJZl5Kc4.js +53 -0
- package/dist/client.d.ts +567 -13
- package/dist/client.js +1209 -34
- package/dist/{console-h4KlhIik.d.ts → console-D1lwNMZn.d.ts} +2 -0
- package/dist/{migrate-BDQ8xqUs.js → database-6hXRnqDE.js} +47 -2
- package/dist/database-CTo7mx6t.d.ts +575 -0
- package/dist/database.d.ts +2 -1
- package/dist/database.js +2 -2
- package/dist/{define-43mMR39K.js → define-BMBSVbD9.js} +1 -1
- package/dist/{define-B3TF9zzn.d.ts → define-CmIFU96x.d.ts} +8 -4
- package/dist/{errors-4gelGVmK.js → errors-BJTZ9iyv.js} +24 -0
- package/dist/{errors-C6qptPoG.js → errors-Dq4AHjza.js} +23 -3
- package/dist/index-RiHzmV16.d.ts +194 -0
- package/dist/index.d.ts +6 -7
- package/dist/index.js +57 -9
- package/dist/{install-W9ghhGoh.d.ts → install-BGGQKbQ4.d.ts} +9 -3
- package/dist/{install-BcMPgPk_.js → install-DrAse1Fa.js} +912 -60
- package/dist/{installed-B-PfERBU.js → installed-C3EoqJEY.js} +7 -6
- package/dist/{operations-GLeOqgMt.d.ts → operations-BKhUWYkb.d.ts} +10 -5
- package/dist/{operations-D4A1Fcgf.d.ts → operations-VyyNZusz.d.ts} +13 -2
- package/dist/{operations-DMMIfYPW.js → operations-lsVKE0GH.js} +312 -219
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +2 -2
- package/dist/overlay/client-DBmJ4C1M.js +4 -0
- package/dist/overlay/overlay.js +41 -65
- package/dist/page/loader.js +39 -47
- package/dist/{page-DtbMOEMd.d.ts → page-Bzj0CszG.d.ts} +1 -10
- package/dist/{page-B41ozN63.js → page-DRz_sDY4.js} +1 -1
- package/dist/{page-tools-shared-NHUjKI8E.js → page-tools-shared-BNnuPK93.js} +6 -3
- package/dist/{plugin-PS8PMYus.js → plugin-DRsNaJaK.js} +34 -8
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +2 -2
- package/dist/reply-id-P_bSuEng.js +12 -0
- package/dist/request-log-Dj9Vw7qG.js +105 -0
- package/dist/request-origin-CFU0TQ7E.js +49 -0
- package/dist/{rpc-RKPAusHp.js → rpc-BQqYx8kb.js} +23 -7
- package/dist/{rpc-HBcWtg0T.d.ts → rpc-CuJ5GLIz.d.ts} +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/runtime/auth.d.ts +2 -2
- package/dist/runtime/auth.js +2 -2
- package/dist/runtime/console.d.ts +1 -1
- package/dist/runtime/console.js +3 -3
- package/dist/runtime/index.d.ts +42 -13
- package/dist/runtime/index.js +224 -22
- package/dist/{server-D8k-0GXe.js → server-Yk610niJ.js} +1 -1
- package/dist/server.d.ts +6 -5
- package/dist/server.js +6 -6
- package/dist/service-Bj-Mg63c.d.ts +73 -0
- package/dist/{service-GHhhyQj4.js → service-DA5BwfPQ.js} +71 -14
- package/dist/{session-DVx-1Tym.d.ts → session-DUcEor2W.d.ts} +3 -3
- package/dist/{session-EkudzUmm.js → session-X_g9dnU5.js} +27 -30
- package/dist/{service-CFVm23k7.d.ts → store-CsUNfC1w.d.ts} +11 -72
- package/dist/table-names-B9LlRC0B.js +16 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +38 -5
- package/dist/{types-CZujrMFd.d.ts → types-BLaYh0_f.d.ts} +48 -4
- package/dist/{types-BIS0hCEl.d.ts → types-C35INXIs.d.ts} +88 -4
- package/dist/vite.d.ts +24 -7
- package/dist/vite.js +322 -173
- package/package.json +9 -9
- package/dist/errors-CyQyKAvy.d.ts +0 -185
- package/dist/index-DNhy69Wt.d.ts +0 -83
- package/dist/overlay/client-DmsSMOzi.js +0 -4
package/dist/vite.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as CommentBuild } from "./types-
|
|
2
|
-
import "./types-
|
|
3
|
-
import {
|
|
4
|
-
import { n as OperationContributions } from "./operations-
|
|
5
|
-
import { i as ViteHubInspectionPluginMetadata, r as ViteHubConsoleRuntimeRecordTableSection, t as ViteHubConsoleOperationSection } from "./console-
|
|
1
|
+
import { a as CommentBuild } from "./types-BLaYh0_f.js";
|
|
2
|
+
import "./types-C35INXIs.js";
|
|
3
|
+
import { n as mountedCommentsRoute } from "./page-Bzj0CszG.js";
|
|
4
|
+
import { n as OperationContributions } from "./operations-VyyNZusz.js";
|
|
5
|
+
import { i as ViteHubInspectionPluginMetadata, r as ViteHubConsoleRuntimeRecordTableSection, t as ViteHubConsoleOperationSection } from "./console-D1lwNMZn.js";
|
|
6
6
|
import { Plugin, PluginOption } from "vite";
|
|
7
7
|
import { githubRepository } from "@vite-hub/forge/build/node";
|
|
8
8
|
import { DatabaseContributionContext, DatabaseContributionEntry } from "@vite-hub/database/vite";
|
|
@@ -74,6 +74,8 @@ interface CommentsImports {
|
|
|
74
74
|
blob: string;
|
|
75
75
|
/** Exports `checkRateLimit`, which counts guest writes when Rate Limit counts in a shared KV store. */
|
|
76
76
|
rateLimit: string;
|
|
77
|
+
/** `@vite-hub/webhooks`: the member endpoints that `defineComments({ send })` delivers to. */
|
|
78
|
+
webhooks: string;
|
|
77
79
|
}
|
|
78
80
|
/** Options of `comments()`, for apps that use Comments without `vite-hub`. */
|
|
79
81
|
interface CommentsOptions {
|
|
@@ -161,6 +163,15 @@ type CommentsVitePlugin$1 = Plugin & {
|
|
|
161
163
|
};
|
|
162
164
|
vitehub: ViteHubInspectionPluginMetadata & {
|
|
163
165
|
databases: (context: DatabaseContributionContext) => Promise<DatabaseContributionEntry[]>;
|
|
166
|
+
/** Turns on the member endpoints of Webhooks while `defineComments({ send })` is on. */
|
|
167
|
+
webhooks: (context: {
|
|
168
|
+
root?: string;
|
|
169
|
+
projectRoot?: string;
|
|
170
|
+
serverDirs?: readonly string[];
|
|
171
|
+
}) => Promise<{
|
|
172
|
+
memberEndpoints: true;
|
|
173
|
+
reason: string;
|
|
174
|
+
} | undefined>;
|
|
164
175
|
};
|
|
165
176
|
};
|
|
166
177
|
/**
|
|
@@ -168,6 +179,11 @@ type CommentsVitePlugin$1 = Plugin & {
|
|
|
168
179
|
* default or only Database.
|
|
169
180
|
*/
|
|
170
181
|
export declare function readCommentsDatabase(file: string): Promise<string | undefined>;
|
|
182
|
+
/**
|
|
183
|
+
* Whether `defineComments({ send })` turns Send on, read without running the file: Send is on unless `send` is missing
|
|
184
|
+
* or `false`. A value known only at runtime counts as on, so the build adds the tables and the member endpoints.
|
|
185
|
+
*/
|
|
186
|
+
export declare function readCommentsSend(file: string): Promise<boolean>;
|
|
171
187
|
/** The directory of the prebuilt overlay script in this package. */
|
|
172
188
|
export declare function commentsOverlayDirectory(): string;
|
|
173
189
|
/**
|
|
@@ -204,6 +220,7 @@ export declare function renderCommentsPlugin(input: {
|
|
|
204
220
|
development?: boolean;
|
|
205
221
|
build?: CommentBuild;
|
|
206
222
|
base?: string;
|
|
223
|
+
send?: boolean;
|
|
207
224
|
}): string;
|
|
208
225
|
/**
|
|
209
226
|
* Comments for any Vite app, without `vite-hub`: the comment overlay on every page with `?vitehub`, threads in a
|
|
@@ -237,8 +254,8 @@ interface CommentsOverlayAssets {
|
|
|
237
254
|
/** File name of the overlay, such as `overlay.5e6f7a8b.js`. */
|
|
238
255
|
overlay: string;
|
|
239
256
|
}
|
|
240
|
-
/** Where the loader and overlay are served, below the app mount. */
|
|
241
|
-
export declare const overlayRoute = "/_vitehub/comments";
|
|
257
|
+
/** Where the loader and overlay are served, below the app mount: the assets folder of the Comments API route. */
|
|
258
|
+
export declare const overlayRoute = "/_vitehub/comments/assets";
|
|
242
259
|
/** The path the app is mounted at: `""` for the root, `"/portal"` below it. A relative or empty Vite base is the root. */
|
|
243
260
|
export declare function mountPath(base: string | undefined): string;
|
|
244
261
|
/** The URL of the loader. Its query names the overlay file, says whether the app can edit pages, and carries the page filter and when to ask. */
|