@vite-hub/comments 0.5.0 → 0.5.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.
- package/README.md +4 -0
- package/dist/anchor.d.ts +3 -5
- package/dist/anchor.js +1 -2
- package/dist/{client-diagnostics-Bubm7Shd.js → client-diagnostics-CvfTW5d4.js} +1 -2
- package/dist/{client-files-CJZl5Kc4.js → client-files-lC6X7XyS.js} +1 -2
- package/dist/client.d.ts +15 -22
- package/dist/client.js +14 -21
- package/dist/{console-D1lwNMZn.d.ts → console-CK2F53QP.d.ts} +0 -4
- package/dist/{context-BqIsmYP1.js → context-DbkBjITZ.js} +1 -2
- package/dist/database/postgres.d.ts +1 -3
- package/dist/database/postgres.js +1 -2
- package/dist/{database-6hXRnqDE.js → database-BkPoOdZr.js} +73 -61
- package/dist/{database-CTo7mx6t.d.ts → database-CPua6Q6_.d.ts} +0 -2
- package/dist/{database-CA1aHKN7.d.ts → database-DUs3c2al.d.ts} +625 -73
- package/dist/database.d.ts +4 -6
- package/dist/database.js +1 -2
- package/dist/{define-BMBSVbD9.js → define-9uMM3Ewc.js} +2 -3
- package/dist/{define-CmIFU96x.d.ts → define-B1jLSPe9.d.ts} +1 -3
- package/dist/{errors-BJTZ9iyv.js → errors-C0VwRHiy.js} +1 -2
- package/dist/{errors-Dq4AHjza.js → errors-DFNiJg67.js} +10 -3
- package/dist/{fold-name-B7Zb3-MF.js → fold-name-g-xg0mQk.js} +1 -2
- package/dist/hosted/hosted-comments/client-B3dlmmQd.js +4 -0
- package/dist/{overlay/dist-BoHMOFax.js → hosted/hosted-comments/dist-DyVmH21U.js} +1 -1
- package/dist/hosted/hosted-comments/frame.js +1 -0
- package/dist/hosted/hosted-comments/overlay-4-mWX4Uz.js +170 -0
- package/dist/hosted/hosted-comments/protocol-BHvtQKte.js +1 -0
- package/dist/hosted/hosted-comments/rest-transport-D-9_pNqZ.js +1 -0
- package/dist/hosted/hosted-comments/tools-CdwnUCOr.js +126 -0
- package/dist/hosted/hosted-comments.js +9 -0
- package/dist/{identity-CBOzgxSf.js → identity-CT7-UGmS.js} +1 -2
- package/dist/{index-RiHzmV16.d.ts → index-BEnHTj2Z.d.ts} +5 -13
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -9
- package/dist/{install-BGGQKbQ4.d.ts → install-B-FQpi47.d.ts} +19 -8
- package/dist/{install-DrAse1Fa.js → install-BUXxryut.js} +119 -30
- package/dist/{installed-C3EoqJEY.js → installed-C9SkldMi.js} +2 -3
- package/dist/{invariant-D8_xBqmZ.js → invariant-CmdvZ3vp.js} +1 -2
- package/dist/{migrate-B0k_0swk.d.ts → migrate-XjFeQppf.d.ts} +2 -2
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{operations-VyyNZusz.d.ts → operations-8hqTi0DH.d.ts} +0 -2
- package/dist/{operations-lsVKE0GH.js → operations-CKC_lMG_.js} +18 -20
- package/dist/{operations-BKhUWYkb.d.ts → operations-Cic9A9e_.d.ts} +4 -6
- package/dist/operations.d.ts +2 -2
- package/dist/operations.js +2 -2
- package/dist/overlay/{client-DBmJ4C1M.js → client-CerbVjTz.js} +3 -3
- package/dist/overlay/dist-DyVmH21U.js +14 -0
- package/dist/overlay/overlay.js +15 -15
- package/dist/page/loader.js +22 -21
- package/dist/{page-Bzj0CszG.d.ts → page-DE71P_gQ.d.ts} +0 -2
- package/dist/{page-tools-shared-BNnuPK93.js → page-tools-shared-fvmJQCrP.js} +2 -2
- package/dist/{page-DRz_sDY4.js → page-xzgZ6DGm.js} +2 -3
- package/dist/{path--zk6PEMz.js → path-8yqMd8zR.js} +0 -1
- package/dist/{plugin-DRsNaJaK.js → plugin-B2hETRii.js} +9 -11
- package/dist/realtime.d.ts +3 -5
- package/dist/realtime.js +4 -5
- package/dist/{reply-id-P_bSuEng.js → reply-id-Cm9FGOBs.js} +1 -2
- package/dist/{request-log-Dj9Vw7qG.js → request-log-DllKQXj7.js} +1 -2
- package/dist/{request-origin-CFU0TQ7E.js → request-origin-YPzfE2eh.js} +1 -2
- package/dist/{rpc-BQqYx8kb.js → rpc-BKY7XRlR.js} +5 -7
- package/dist/{rpc-CuJ5GLIz.d.ts → rpc-D-eqtyfh.d.ts} +1 -3
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -2
- package/dist/runtime/auth.d.ts +3 -5
- package/dist/runtime/auth.js +2 -3
- package/dist/runtime/console.d.ts +2 -4
- package/dist/runtime/console.js +4 -5
- package/dist/runtime/index.d.ts +8 -25
- package/dist/runtime/index.js +21 -26
- package/dist/{server-Yk610niJ.js → server-BGbD7H5s.js} +2 -3
- package/dist/server.d.ts +6 -8
- package/dist/server.js +6 -6
- package/dist/{service-Bj-Mg63c.d.ts → service-CPiWPoiY.d.ts} +3 -7
- package/dist/{service-DA5BwfPQ.js → service-DDD4Ubxd.js} +9 -11
- package/dist/{session-X_g9dnU5.js → session-BGN6Vlm6.js} +7 -10
- package/dist/{session-DUcEor2W.d.ts → session-CTh9nisq.d.ts} +3 -5
- package/dist/{store-CsUNfC1w.d.ts → store-DvNTDNgn.d.ts} +2 -4
- package/dist/{table-names-B9LlRC0B.js → table-names-BIHjuEFK.js} +1 -2
- package/dist/testing.d.ts +2 -4
- package/dist/testing.js +3 -4
- package/dist/{tokens-DSbwkVSy.js → tokens-Bx4lZ0yt.js} +3 -6
- package/dist/{types-BLaYh0_f.d.ts → types-BX3vH18p.d.ts} +0 -2
- package/dist/{types-C35INXIs.d.ts → types-l6GOb_yc.d.ts} +2 -4
- package/dist/vite.d.ts +5 -21
- package/dist/vite.js +25 -43
- package/package.json +19 -19
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { g as CommentsUser, l as CommentsDefinition } from "./define-B1jLSPe9.js";
|
|
2
|
+
import { D as CommentUser, S as CommentStatus, T as CommentThread, _ as CommentListCursor, b as CommentMetadata, n as CommentActor, r as CommentAnchor, s as CommentContext, w as CommentSubject } from "./types-BX3vH18p.js";
|
|
3
3
|
import { ViteHubContext } from "@vite-hub/runtime";
|
|
4
|
-
//#region src/types.d.ts
|
|
5
4
|
interface CommentsForgeTarget {
|
|
6
5
|
repository: string;
|
|
7
6
|
pullRequest: number;
|
|
@@ -204,5 +203,4 @@ interface ReplyOptions {
|
|
|
204
203
|
}
|
|
205
204
|
/** Codes of the errors that Comments methods return in the `[error, data]` tuple. */
|
|
206
205
|
type CommentsErrorCode = "COMMENTS_NOT_INSTALLED" | "COMMENTS_NOT_FOUND" | "COMMENTS_INVALID_INPUT" | "COMMENTS_FORBIDDEN" | "COMMENTS_POLICY_MISSING" | "COMMENTS_RESOLVED" | "COMMENTS_CONTENT_MISSING" | "COMMENTS_FIELD_INVALID" | "COMMENTS_FIELD_NOT_EDITABLE" | "COMMENTS_FIELD_FORBIDDEN" | "COMMENTS_FIELD_CONFLICT" | "COMMENTS_FIELD_LOCKED" | "COMMENTS_SEND_OFF";
|
|
207
|
-
//#endregion
|
|
208
206
|
export { ListCommentThreadsOptions as _, CommentSendPromptContext as a, CommentsForgeTarget as c, CommentsPageSubject as d, CommentsRequestEvent as f, FindCommentThreadInput as g, EditCommentInput as h, CommentSendPayloadContext as i, CommentsIdentifyContext as l, DefineCommentsOptions as m, CommentSendData as n, CommentsErrorCode as o, CreateCommentThreadInput as p, CommentSendOptions as r, CommentsForgeOptions as s, CommentSendAddressContext as t, CommentsPageContext as u, ReplyInput as v, ReplyOptions as y };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { a as CommentBuild } from "./types-
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { a as CommentBuild } from "./types-BX3vH18p.js";
|
|
2
|
+
import { n as OperationContributions } from "./operations-8hqTi0DH.js";
|
|
3
|
+
import { i as ViteHubInspectionPluginMetadata, r as ViteHubConsoleRuntimeRecordTableSection, t as ViteHubConsoleOperationSection } from "./console-CK2F53QP.js";
|
|
4
|
+
import "./types-l6GOb_yc.js";
|
|
5
|
+
import { n as mountedCommentsRoute } from "./page-DE71P_gQ.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";
|
|
9
9
|
import { NitroModule } from "nitro/types";
|
|
10
|
-
//#region src/console.d.ts
|
|
11
10
|
/**
|
|
12
11
|
* Console section for Comments: every thread with its first comment, page, author, replies, and status, open threads
|
|
13
12
|
* first. People reply and resolve on the page itself, where the context is; each record links there. The
|
|
@@ -17,12 +16,8 @@ export declare const commentsConsoleSection: ViteHubConsoleRuntimeRecordTableSec
|
|
|
17
16
|
projectRoot: string;
|
|
18
17
|
serverDirs?: string[];
|
|
19
18
|
}>;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region ../internal/src/deployment.d.ts
|
|
22
19
|
/** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
|
|
23
20
|
type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ../internal/src/build/deployment-plan-output.d.ts
|
|
26
21
|
/**
|
|
27
22
|
* One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
|
|
28
23
|
* a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
|
|
@@ -52,8 +47,6 @@ interface DeploymentEnvContext {
|
|
|
52
47
|
* Return names only, never values.
|
|
53
48
|
*/
|
|
54
49
|
type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/live-vite.d.ts
|
|
57
50
|
/** Module paths that generated files import. The `vite-hub` distribution passes its own subpaths. */
|
|
58
51
|
interface CommentsImports {
|
|
59
52
|
/** Exports `defineCommentsPlugin`, `createCommentsHandler`, and `viteHubPageSessionHandler`. */
|
|
@@ -228,8 +221,6 @@ export declare function renderCommentsPlugin(input: {
|
|
|
228
221
|
* with `COMMENTS_B0003`, because `vitehub({ comments })` and `server/comments.ts` turn Comments on there.
|
|
229
222
|
*/
|
|
230
223
|
export declare function comments(options?: CommentsOptions): PluginOption[];
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/overlay.d.ts
|
|
233
224
|
/** Which pages get the overlay. Globs are relative to the app base: `*` is one path segment and `**` any depth. */
|
|
234
225
|
interface CommentsOverlayOptions {
|
|
235
226
|
/** Pages that get the overlay. Default: every page. */
|
|
@@ -282,23 +273,17 @@ export declare function injectLoader(html: string, tag: string, found?: {
|
|
|
282
273
|
* A stream is piped through a transform that holds back a short tail, so a tag split across chunks is still found.
|
|
283
274
|
*/
|
|
284
275
|
export declare function renderOverlayMiddleware(url: string): string;
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/operations-core/console.d.ts
|
|
287
276
|
/**
|
|
288
277
|
* Console section for the comment inbox. It lists the result of `comments.list`, called with the Console user, so
|
|
289
278
|
* `authorize` applies to each thread. A page thread links to `<page>?comment=<n>`.
|
|
290
279
|
*/
|
|
291
280
|
declare const commentsConsoleSection$1: ViteHubConsoleOperationSection;
|
|
292
|
-
//#endregion
|
|
293
|
-
//#region src/operations-core/vite.d.ts
|
|
294
281
|
export declare const COMMENTS_VITE_PLUGIN_NAME = "@vite-hub/comments/vite";
|
|
295
282
|
/** Whether the project has a `server/comments.ts`. `vitehub()` reads it while Vite filters plugins. */
|
|
296
283
|
export declare function usesComments(options: {
|
|
297
284
|
projectRoot: string;
|
|
298
285
|
serverDirs?: readonly string[];
|
|
299
286
|
}): boolean;
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region src/vite.d.ts
|
|
302
287
|
export type HubCommentsOptions = CommentsVitePluginOptions & {
|
|
303
288
|
/** Import paths of the comment operations. `vite-hub` passes its own subpaths. */
|
|
304
289
|
operationsImports?: {
|
|
@@ -321,5 +306,4 @@ export declare function findCommentsEntry(options: {
|
|
|
321
306
|
* or as its default export; both run every surface on the same tables.
|
|
322
307
|
*/
|
|
323
308
|
export declare function hubComments(options?: HubCommentsOptions): CommentsVitePlugin;
|
|
324
|
-
//#endregion
|
|
325
309
|
export { type CommentsComponent, type CommentsImports, type CommentsOptions, type CommentsOverlayAssets, type CommentsOverlayOptions, type CommentsRealtimeContributionContext, type CommentsVitePluginOptions, type StandaloneDatabase, comments as default, commentsConsoleSection$1 as commentsOperationsConsoleSection, githubRepository, mountedCommentsRoute };
|
package/dist/vite.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { n as commentsTableNames, t as commentSendsTableNames } from "./table-names-
|
|
1
|
+
import { t as invariant } from "./invariant-CmdvZ3vp.js";
|
|
2
|
+
import { c as validateCommentsDefinition } from "./define-9uMM3Ewc.js";
|
|
3
|
+
import { t as commentsErrorDiagnostics } from "./errors-DFNiJg67.js";
|
|
4
|
+
import { a as viteHubPageToolsCookie, d as viteHubPageToolsQuery, i as viteHubPageToolsAssets, n as viteHubBasePath, r as viteHubPageSessionPath, s as viteHubPageToolsInlineScript } from "./page-tools-shared-fvmJQCrP.js";
|
|
5
|
+
import { n as isRecordOrFunction } from "./object-CAK6UYR5.js";
|
|
6
|
+
import { a as mountedCommentsRoute, i as commentsRoute, r as commentsRealtimeDefinition } from "./page-xzgZ6DGm.js";
|
|
7
|
+
import { n as commentsTableNames, t as commentSendsTableNames } from "./table-names-BIHjuEFK.js";
|
|
8
8
|
import { formatDiagnostic } from "nostics";
|
|
9
9
|
import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { tmpdir } from "node:os";
|
|
@@ -16,7 +16,7 @@ import { nitro } from "nitro/vite";
|
|
|
16
16
|
import { parseDatabaseLocation } from "@vite-hub/database/config";
|
|
17
17
|
import { githubRepository, readForgeBuild } from "@vite-hub/forge/build/node";
|
|
18
18
|
import { parseJSONC, parseTOML } from "confbox";
|
|
19
|
-
|
|
19
|
+
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
20
20
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
21
21
|
function normalizeWindowsPath(input = "") {
|
|
22
22
|
if (!input) return input;
|
|
@@ -113,16 +113,14 @@ const dirname$1 = function(p) {
|
|
|
113
113
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
114
114
|
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
//#region ../internal/src/inspect.ts
|
|
116
|
+
// ../internal/src/inspect.ts
|
|
118
117
|
function relativeDefinitionFile(projectRoot, file) {
|
|
119
118
|
return relative$1(projectRoot, file).replaceAll("\\", "/");
|
|
120
119
|
}
|
|
121
120
|
const secretKeyPattern = /secret|token|passw(?:or)?d|credential|api[-_\s]?key|private[-_\s]?key|authorization|cookie|signature|dsn|connection[-_\s]?string/i;
|
|
122
121
|
new RegExp(String.raw`\b([\w-]*authorization[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\r\n]+?(?=\s*(?:[,;])?\s*(?:${secretKeyPattern.source})[\w-]*\s*[:=]|\s+rejected\b|$))`, "gi");
|
|
123
122
|
new RegExp(String.raw`\b([\w-]*(?:${secretKeyPattern.source})[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\s,;&#&]+)`, "gi");
|
|
124
|
-
|
|
125
|
-
//#region ../internal/src/build/vite.ts
|
|
123
|
+
// ../internal/src/build/vite.ts
|
|
126
124
|
const projectRootDirectoryMarkers = [
|
|
127
125
|
["server", "agents"],
|
|
128
126
|
["server", "channels"],
|
|
@@ -207,8 +205,7 @@ function isMissingProjectMarker(error) {
|
|
|
207
205
|
const code = error.code;
|
|
208
206
|
return code === "ENOENT" || code === "ENOTDIR";
|
|
209
207
|
}
|
|
210
|
-
|
|
211
|
-
//#region ../internal/src/build/paths.ts
|
|
208
|
+
// ../internal/src/build/paths.ts
|
|
212
209
|
function resolveRuntimeModule(packageDir, modulePath) {
|
|
213
210
|
const distFile = resolve$1(packageDir, "dist", `${modulePath}.js`);
|
|
214
211
|
return existsSync(distFile) ? distFile : resolve$1(packageDir, "src", `${modulePath}.ts`);
|
|
@@ -235,8 +232,7 @@ function findPackageDir(file) {
|
|
|
235
232
|
function ownModule(importMetaUrl, modulePath) {
|
|
236
233
|
return resolveRuntimeModule(findPackageDir(fileURLToPath(importMetaUrl)), modulePath);
|
|
237
234
|
}
|
|
238
|
-
|
|
239
|
-
//#region src/entry.ts
|
|
235
|
+
// src/entry.ts
|
|
240
236
|
const extensions = [
|
|
241
237
|
".ts",
|
|
242
238
|
".mts",
|
|
@@ -293,8 +289,7 @@ function createNitroServerKit(value = {}) {
|
|
|
293
289
|
}
|
|
294
290
|
};
|
|
295
291
|
}
|
|
296
|
-
|
|
297
|
-
//#region ../internal/src/build/page-tools.ts
|
|
292
|
+
// ../internal/src/build/page-tools.ts
|
|
298
293
|
/**
|
|
299
294
|
* Adds the session route `GET <mount>/_vitehub/page/tools` and the loader script at
|
|
300
295
|
* `<mount>/_vitehub/page/assets/loader.js` to a Nitro configuration. Each owner package of a page tool calls it from its
|
|
@@ -357,8 +352,7 @@ function viteHubPageToolsIndexHtml(html, base) {
|
|
|
357
352
|
const index = html.search(/<\/body\s*>/i);
|
|
358
353
|
return index === -1 ? `${html}${script}` : `${html.slice(0, index)}${script}${html.slice(index)}`;
|
|
359
354
|
}
|
|
360
|
-
|
|
361
|
-
//#region ../internal/src/build/ast-walk.ts
|
|
355
|
+
// ../internal/src/build/ast-walk.ts
|
|
362
356
|
/** The oxc parser grammar for a file, from its extension. Defaults to TypeScript. */
|
|
363
357
|
function moduleLanguage(file) {
|
|
364
358
|
if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
|
|
@@ -366,8 +360,7 @@ function moduleLanguage(file) {
|
|
|
366
360
|
if (/\.(?:c|m)?js$/i.test(file)) return "js";
|
|
367
361
|
return "ts";
|
|
368
362
|
}
|
|
369
|
-
|
|
370
|
-
//#region ../internal/src/build/scan-module.ts
|
|
363
|
+
// ../internal/src/build/scan-module.ts
|
|
371
364
|
/**
|
|
372
365
|
* Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
|
|
373
366
|
* the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
|
|
@@ -487,8 +480,7 @@ function staticValue(node) {
|
|
|
487
480
|
default: return dynamic;
|
|
488
481
|
}
|
|
489
482
|
}
|
|
490
|
-
|
|
491
|
-
//#region ../internal/src/hints.ts
|
|
483
|
+
// ../internal/src/hints.ts
|
|
492
484
|
/**
|
|
493
485
|
* The file that lists the hints of the last build or dev server, relative to the project root. A hint is a warning
|
|
494
486
|
* about something that works now and fails later, such as counts that stay in one server's memory. Agents and CI read
|
|
@@ -566,8 +558,7 @@ function startViteHubHints(config, owner = config) {
|
|
|
566
558
|
started.add(owner);
|
|
567
559
|
write(startRun(config));
|
|
568
560
|
}
|
|
569
|
-
|
|
570
|
-
//#region ../internal/src/build/included-nitro-registry.ts
|
|
561
|
+
// ../internal/src/build/included-nitro-registry.ts
|
|
571
562
|
const includedKey = Symbol.for("vitehub.included-nitro");
|
|
572
563
|
const scope = globalThis;
|
|
573
564
|
const includedNitroPlugins = scope[includedKey] ??= /* @__PURE__ */ new WeakSet();
|
|
@@ -582,8 +573,7 @@ function markIncludedNitroPlugin(plugin) {
|
|
|
582
573
|
function isIncludedNitroPlugin(plugin) {
|
|
583
574
|
return includedNitroPlugins.has(plugin);
|
|
584
575
|
}
|
|
585
|
-
|
|
586
|
-
//#region ../internal/src/build/included-nitro.ts
|
|
576
|
+
// ../internal/src/build/included-nitro.ts
|
|
587
577
|
function flattenPlugins(option) {
|
|
588
578
|
if (Array.isArray(option)) return option.flatMap(flattenPlugins);
|
|
589
579
|
return option && typeof option === "object" && "name" in option ? [option] : [];
|
|
@@ -610,8 +600,7 @@ function includedNitro(options = {}) {
|
|
|
610
600
|
}
|
|
611
601
|
return plugins;
|
|
612
602
|
}
|
|
613
|
-
|
|
614
|
-
//#region src/deployment-env.ts
|
|
603
|
+
// src/deployment-env.ts
|
|
615
604
|
const owners = ["comments"];
|
|
616
605
|
const githubLoginNames = {
|
|
617
606
|
clientId: "VITEHUB_GITHUB_CLIENT_ID",
|
|
@@ -686,8 +675,7 @@ function commentsDeploymentEnv(options, context) {
|
|
|
686
675
|
...options.standalone ? standaloneDatabaseEntries(options.standalone.database || void 0, context.host) : []
|
|
687
676
|
];
|
|
688
677
|
}
|
|
689
|
-
|
|
690
|
-
//#region src/console.ts
|
|
678
|
+
// src/console.ts
|
|
691
679
|
/**
|
|
692
680
|
* Console section for Comments: every thread with its first comment, page, author, replies, and status, open threads
|
|
693
681
|
* first. People reply and resolve on the page itself, where the context is; each record links there. The
|
|
@@ -735,8 +723,7 @@ const commentsConsoleSection = {
|
|
|
735
723
|
notice: "People comment, reply, and resolve on the site's pages. Open threads come first. Server code reads the same threads with `comments.list()`."
|
|
736
724
|
}
|
|
737
725
|
};
|
|
738
|
-
|
|
739
|
-
//#region src/live-vite.ts
|
|
726
|
+
// src/live-vite.ts
|
|
740
727
|
const defaultImports = {
|
|
741
728
|
runtime: "@vite-hub/comments/runtime",
|
|
742
729
|
realtime: "@vite-hub/comments/realtime",
|
|
@@ -1369,8 +1356,7 @@ function hubComments$1(options = {}) {
|
|
|
1369
1356
|
} };
|
|
1370
1357
|
return integration;
|
|
1371
1358
|
}
|
|
1372
|
-
|
|
1373
|
-
//#region src/operations-core/console.ts
|
|
1359
|
+
// src/operations-core/console.ts
|
|
1374
1360
|
/**
|
|
1375
1361
|
* Console section for the comment inbox. It lists the result of `comments.list`, called with the Console user, so
|
|
1376
1362
|
* `authorize` applies to each thread. A page thread links to `<page>?comment=<n>`.
|
|
@@ -1462,8 +1448,7 @@ const commentsConsoleSection$1 = {
|
|
|
1462
1448
|
}
|
|
1463
1449
|
}
|
|
1464
1450
|
};
|
|
1465
|
-
|
|
1466
|
-
//#region src/operations-core/vite.ts
|
|
1451
|
+
// src/operations-core/vite.ts
|
|
1467
1452
|
const COMMENTS_VITE_PLUGIN_NAME = "@vite-hub/comments/vite";
|
|
1468
1453
|
function candidates(projectRoot, serverDirs) {
|
|
1469
1454
|
return (serverDirs === void 0 ? [resolve(projectRoot, "server")] : serverDirs.map((directory) => resolve(projectRoot, directory))).flatMap((directory) => [
|
|
@@ -1481,8 +1466,7 @@ function findCommentsEntry$1(options) {
|
|
|
1481
1466
|
function usesComments(options) {
|
|
1482
1467
|
return findCommentsEntry$1(options) !== void 0;
|
|
1483
1468
|
}
|
|
1484
|
-
|
|
1485
|
-
//#region src/overlay.ts
|
|
1469
|
+
// src/overlay.ts
|
|
1486
1470
|
/** Where the loader and overlay are served, below the app mount: the assets folder of the Comments API route. */
|
|
1487
1471
|
const overlayRoute = "/_vitehub/comments/assets";
|
|
1488
1472
|
/** The path the app is mounted at: `""` for the root, `"/portal"` below it. A relative or empty Vite base is the root. */
|
|
@@ -1738,8 +1722,7 @@ function renderOverlayMiddleware(url) {
|
|
|
1738
1722
|
""
|
|
1739
1723
|
].join("\n");
|
|
1740
1724
|
}
|
|
1741
|
-
|
|
1742
|
-
//#region src/vite.ts
|
|
1725
|
+
// src/vite.ts
|
|
1743
1726
|
function findCommentsEntry(options, serverDirs) {
|
|
1744
1727
|
return typeof options === "string" ? findCommentsEntry$2(options, serverDirs) : findCommentsEntry$1(options);
|
|
1745
1728
|
}
|
|
@@ -1805,5 +1788,4 @@ function hubComments(options = {}) {
|
|
|
1805
1788
|
}
|
|
1806
1789
|
};
|
|
1807
1790
|
}
|
|
1808
|
-
//#endregion
|
|
1809
1791
|
export { COMMENTS_VITE_PLUGIN_NAME, comments, comments as default, commentsConsoleSection, commentsConsoleSection$1 as commentsOperationsConsoleSection, commentsOverlayDirectory, componentNames, findCommentsEntry, githubRepository, hubComments, injectLoader, loaderTag, loaderUrl, mountPath, mountedCommentsRoute, overlayRoute, readCommentsBuild, readCommentsComponents, readCommentsDatabase, readCommentsSend, renderCommentsHandler, renderCommentsPlugin, renderOverlayMiddleware, scriptNonce, usesComments };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/comments",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Comments and in-place edits on live ViteHub sites, with presence and Content drafts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -106,37 +106,37 @@
|
|
|
106
106
|
"@valibot/to-json-schema": "^1.8.0",
|
|
107
107
|
"nostics": "1.4.0",
|
|
108
108
|
"valibot": "^1.5.0",
|
|
109
|
-
"@vite-hub/auth": "0.5.
|
|
110
|
-
"@vite-hub/forge": "0.5.
|
|
111
|
-
"@vite-hub/realtime": "0.5.
|
|
112
|
-
"@vite-hub/runtime": "0.5.
|
|
109
|
+
"@vite-hub/auth": "0.5.1",
|
|
110
|
+
"@vite-hub/forge": "0.5.1",
|
|
111
|
+
"@vite-hub/realtime": "0.5.1",
|
|
112
|
+
"@vite-hub/runtime": "0.5.1",
|
|
113
113
|
"birpc": "^4.2.0",
|
|
114
|
-
"confbox": "^0.3.
|
|
114
|
+
"confbox": "^0.3.2",
|
|
115
115
|
"h3": "^2.0.8"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
|
-
"@types/node": "^24.19.
|
|
118
|
+
"@types/node": "^24.19.2",
|
|
119
119
|
"@vite-hub/internal": "0.0.1",
|
|
120
|
-
"happy-dom": "21.0.
|
|
120
|
+
"happy-dom": "21.0.4",
|
|
121
121
|
"marked": "17.0.6",
|
|
122
122
|
"modern-screenshot": "4.7.0",
|
|
123
123
|
"nitro": "^3.0.261103-rc",
|
|
124
|
-
"playwright-core": "^1.
|
|
124
|
+
"playwright-core": "^1.65.1",
|
|
125
125
|
"publint": "^0.3.25",
|
|
126
126
|
"typescript": "^6.0.3",
|
|
127
|
-
"vite-plus": "^
|
|
128
|
-
"vitest": "
|
|
129
|
-
"vue": "3.5.
|
|
127
|
+
"vite-plus": "^1.7.0",
|
|
128
|
+
"vitest": "5.1.0",
|
|
129
|
+
"vue": "3.5.46",
|
|
130
130
|
"@libsql/client": "^0.18.0",
|
|
131
|
-
"@vite-hub/database": "0.5.
|
|
132
|
-
"vite": "^8.
|
|
133
|
-
"drizzle-orm": "1.0.0-rc.
|
|
131
|
+
"@vite-hub/database": "0.5.1",
|
|
132
|
+
"vite": "^8.3.8",
|
|
133
|
+
"drizzle-orm": "1.0.0-rc.6"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@vite-hub/database": "0.5.
|
|
136
|
+
"@vite-hub/database": "0.5.1",
|
|
137
137
|
"nitro": "3.0.261102-rc || ^3.0.261103-rc",
|
|
138
138
|
"vite": ">=8.0.0",
|
|
139
|
-
"drizzle-orm": "1.0.0-rc.5 || ^1.0.0"
|
|
139
|
+
"drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0"
|
|
140
140
|
},
|
|
141
141
|
"peerDependenciesMeta": {
|
|
142
142
|
"vite": {
|
|
@@ -147,10 +147,10 @@
|
|
|
147
147
|
"node": ">=24.15.0"
|
|
148
148
|
},
|
|
149
149
|
"scripts": {
|
|
150
|
-
"build": "vp pack && vp build --config overlay.vite.config.ts",
|
|
150
|
+
"build": "vp pack && vp build --config overlay.vite.config.ts && vp build --config hosted.vite.config.ts",
|
|
151
151
|
"dev": "vp pack && vp build --config overlay.vite.config.ts && vp pack --watch --no-clean",
|
|
152
152
|
"typecheck": "vp run --cache -t @vite-hub/comments#build && node ../../test/package-typecheck.mjs --noEmit -p ./tsconfig.json",
|
|
153
153
|
"test": "vp run --cache -t @vite-hub/comments#build && vp test",
|
|
154
|
-
"test:browser": "vp run --cache -t @vite-hub/comments#build && node --test test/browser/overlay.browser.mjs test/browser/presence.browser.mjs test/browser/outbox.browser.mjs test/browser/send.browser.mjs"
|
|
154
|
+
"test:browser": "vp run --cache -t @vite-hub/comments#build && node --test test/browser/overlay.browser.mjs test/browser/hosted.browser.mjs test/browser/presence.browser.mjs test/browser/outbox.browser.mjs test/browser/send.browser.mjs"
|
|
155
155
|
}
|
|
156
156
|
}
|