@vite-hub/workspace 0.5.0 → 0.6.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/{abort-BCwpdrN0.js → abort-CQGxJBqa.js} +1 -2
- package/dist/{asset-registry-DfBV5kmw.js → asset-registry-0CdRAjIV.js} +2 -3
- package/dist/blob-database/postgres.d.ts +2 -3
- package/dist/blob-database/postgres.js +1 -2
- package/dist/{blob-database-sources-DDZ1wV9w.js → blob-database-sources-CQPAyCz3.js} +1 -2
- package/dist/blob-database.d.ts +2 -8
- package/dist/blob-database.js +12 -15
- package/dist/checkout.d.ts +1 -2
- package/dist/checkout.js +3 -4
- package/dist/cloudflare.d.ts +1 -5
- package/dist/cloudflare.js +1 -2
- package/dist/{config-B-863EgC.js → config-CsgNNVAI.js} +1 -2
- package/dist/{config-hxABr_Gg.d.ts → config-DeA287c0.d.ts} +1 -5
- package/dist/{config-DiyPi3Ff.js → config-jo5QgE1w.js} +18 -27
- package/dist/{discard-CNNtCozM.js → discard-BkoLmmmN.js} +1 -2
- package/dist/durability.d.ts +2 -5
- package/dist/durability.js +4 -5
- package/dist/{error-diagnostics-Cth97txN.js → error-diagnostics-B4me-ouV.js} +1 -2
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/{errors-DXCZjdUU.d.ts → errors-CnFDXxeJ.d.ts} +0 -2
- package/dist/{file-C1DYoGz3.js → file-BrNAXQgY.js} +4 -8
- package/dist/{file-metadata-Dv2JZwal.js → file-metadata-Bpsvjw_X.js} +2 -3
- package/dist/{files-iHyik8jj.js → files--z2dLC5z.js} +3 -4
- package/dist/files.d.ts +6 -10
- package/dist/files.js +6 -6
- package/dist/{github-CFHl6RI0.js → github-k--_LCrX.js} +7 -9
- package/dist/{glob-BitxqDhb.js → glob-BEutagp1.js} +3 -4
- package/dist/{glob-Buxfvmyy.js → glob-BreFjNAV.js} +3 -4
- package/dist/{history-schema-BBWbpDk4.d.ts → history-schema-BR4UDPHL.d.ts} +0 -2
- package/dist/{history-schema-postgres-U_ueRvmO.js → history-schema-postgres-DZepCSBq.js} +0 -1
- package/dist/{host-Dmr2Ctem.js → host-C8yZizfk.js} +11 -14
- package/dist/{hosted-BktlvkF2.js → hosted-8BTKAtMX.js} +15 -18
- package/dist/{hosted-vercel-blob-D0IPAjb1.js → hosted-vercel-blob-B6kygYqn.js} +10 -12
- package/dist/hosted-vercel-blob.d.ts +1 -3
- package/dist/hosted-vercel-blob.js +1 -2
- package/dist/hosted.d.ts +1 -3
- package/dist/hosted.js +1 -2
- package/dist/index.d.ts +7 -25
- package/dist/index.js +18 -22
- package/dist/internal/path.d.ts +1 -1
- package/dist/internal/path.js +1 -2
- package/dist/internal/workspace.d.ts +1 -5
- package/dist/internal/workspace.js +2 -3
- package/dist/{lifecycle-D6WN2dd_.js → lifecycle-IReZfi0b.js} +9 -10
- package/dist/lineage.d.ts +1 -3
- package/dist/lineage.js +1 -2
- package/dist/loader.d.ts +1 -7
- package/dist/loader.js +4 -6
- package/dist/{mcp-resources-TtxLNSL6.js → mcp-resources-DeJnbOaw.js} +4 -5
- package/dist/{memory-DjzwSng2.js → memory-BlSRrBH1.js} +7 -9
- package/dist/{metadata-target-CR0aDtvS.js → metadata-target-CaGLY4ay.js} +15 -23
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
- package/dist/{operations-Cib30_dt.js → operations-BIaK_uYG.js} +7 -8
- package/dist/{operations-dtcU5LkD.js → operations-DS1C4uXd.js} +22 -29
- package/dist/operations.d.ts +2 -6
- package/dist/operations.js +2 -2
- package/dist/{path-BlIBpI7U.js → path-Bb9OIc_F.js} +2 -3
- package/dist/{path-zHxQUbqa.d.ts → path-C0uZxDdW.d.ts} +0 -2
- package/dist/{path-DrSIenjj.js → path-CuYE8-X6.js} +2 -4
- package/dist/{plugins-DKCBrH31.d.ts → plugins-CLc32jvL.d.ts} +1 -3
- package/dist/{provider-Fc3M6bEx.js → provider-CN14ewvx.js} +15 -20
- package/dist/providers/github/store.d.ts +2 -4
- package/dist/providers/github/store.js +1 -2
- package/dist/{registry-DpB5PBA4.d.ts → registry-B0g19sdy.d.ts} +1 -5
- package/dist/{registry-CedQvQxW.js → registry-BbUg9vJB.js} +4 -5
- package/dist/{registry-CLL0TY0L.d.ts → registry-s2Ob9PeX.d.ts} +2 -4
- package/dist/{request-scope-Bcv2kD8h.js → request-scope-CXCI_wCb.js} +2 -3
- package/dist/{results-DgkZUmTL.js → results-z-HpV9EP.js} +1 -2
- package/dist/{rolldown-runtime-rQ84J-ij.js → rolldown-runtime-DnNXxpGL.js} +2 -3
- package/dist/{rule-keys-Bsz6jTTF.js → rule-keys-BLEbi1h5.js} +2 -3
- package/dist/{rules-OHaPFopX.js → rules-BPDXypZV.js} +6 -8
- package/dist/runtime/assets.d.ts +2 -3
- package/dist/runtime/assets.js +5 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -3
- package/dist/runtime/empty-assets-registry.js +1 -2
- package/dist/runtime/empty-registry.d.ts +2 -4
- package/dist/runtime/empty-registry.js +1 -2
- package/dist/runtime/registry.d.ts +1 -1
- package/dist/runtime/registry.js +2 -3
- package/dist/runtime/request.d.ts +1 -3
- package/dist/runtime/request.js +2 -3
- package/dist/runtime/state.d.ts +5 -5
- package/dist/runtime/state.js +9 -10
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -2
- package/dist/runtime.d.ts +8 -24
- package/dist/runtime.js +21 -24
- package/dist/{search-BqNV9LnO.js → search-C_nVorq7.js} +3 -4
- package/dist/{server-CFtrOPk6.js → server-aa1a4rkV.js} +8 -10
- package/dist/server.d.ts +3 -4
- package/dist/server.js +1 -2
- package/dist/{shared-BgDjxY3J.js → shared-C20Wh1mp.js} +12 -19
- package/dist/source-metadata.d.ts +2 -6
- package/dist/source-metadata.js +4 -5
- package/dist/{state-DBV6VHS6.d.ts → state-BdDfBtOR.d.ts} +5 -15
- package/dist/{store-BRMdD8Ft.js → store-cx3OqNTi.js} +11 -14
- package/dist/{sync-BezGVzrW.js → sync-BBfR4g5y.js} +6 -7
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -2
- package/dist/{types-9DMtFjaa.d.ts → types-Bel5IDmF.d.ts} +0 -2
- package/dist/{use-Dv973swc.d.ts → use-CpphIBof.d.ts} +1 -5
- package/dist/{use-Dm2tbI5F.js → use-D0DyTMxM.js} +12 -14
- package/dist/{use-tools-CMUthOdy.d.ts → use-tools-CAK10LTc.d.ts} +2 -4
- package/dist/{use-tools-C1qvhzme.js → use-tools-CHduR5k6.js} +7 -10
- package/dist/{utils-C0Au2R16.js → utils-DXP9xfXo.js} +7 -9
- package/dist/vite.d.ts +3 -21
- package/dist/vite.js +574 -409
- package/dist/{vitehub-grants-C8IAl5-M.js → vitehub-grants-Co713QTg.js} +2 -4
- package/dist/{workspace-Cw4ycIW-.d.ts → workspace-BOuxrZrP.d.ts} +1 -3
- package/dist/{workspace-CFrwWhEm.js → workspace-CLuPkyZR.js} +26 -35
- package/package.json +24 -24
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { n as assertWorkspaceDigest, o as workspaceConflictError, s as workspaceError } from "./path-
|
|
2
|
-
import { t as copyJsonFileMetadata } from "./file-metadata-
|
|
3
|
-
import { a as isExcludedWorkspacePath, d as sha256, l as normalizeWorkspacePath, o as isWorkspaceBytes } from "./path-
|
|
4
|
-
import { t as createWorkspaceGlobMatcher } from "./glob-
|
|
5
|
-
import { a as provideWorkspaceStoreTarget } from "./vitehub-grants-
|
|
6
|
-
|
|
1
|
+
import { n as assertWorkspaceDigest, o as workspaceConflictError, s as workspaceError } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
|
|
3
|
+
import { a as isExcludedWorkspacePath, d as sha256, l as normalizeWorkspacePath, o as isWorkspaceBytes } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
|
|
5
|
+
import { a as provideWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
6
|
+
// ../internal/src/owned-paths.ts
|
|
7
7
|
/** Every Blob path that ViteHub writes for itself starts with this prefix. */
|
|
8
8
|
const vitehubOwnedPrefix = "_vitehub/";
|
|
9
|
-
|
|
10
|
-
//#region src/storage/memory.ts
|
|
9
|
+
// src/storage/memory.ts
|
|
11
10
|
function now() {
|
|
12
11
|
return Date.now();
|
|
13
12
|
}
|
|
@@ -251,5 +250,4 @@ function forkMemoryWorkspaceStore(store) {
|
|
|
251
250
|
if (!(store instanceof MemoryWorkspaceStore)) throw workspaceError("[vitehub] Only memory Workspace Stores can be forked.");
|
|
252
251
|
return store.fork();
|
|
253
252
|
}
|
|
254
|
-
//#endregion
|
|
255
253
|
export { forkMemoryWorkspaceStore as n, vitehubOwnedPrefix as r, createMemoryWorkspaceStore as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-
|
|
2
|
-
import { t as copyJsonFileMetadata } from "./file-metadata-
|
|
3
|
-
import { d as sha256, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, o as isWorkspaceBytes, t as contentStreamChunks } from "./path-
|
|
4
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
5
|
-
import { i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-
|
|
6
|
-
import { t as searchText } from "./search-
|
|
7
|
-
import { a as normalizeWorkspaceSources, c as sourceMountIntersectsPath, f as prepareWorkspaceSource, n as createSourceContext, s as sourceMountContainsPath } from "./config-
|
|
1
|
+
import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
|
|
3
|
+
import { d as sha256, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, o as isWorkspaceBytes, t as contentStreamChunks } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
5
|
+
import { i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
6
|
+
import { t as searchText } from "./search-C_nVorq7.js";
|
|
7
|
+
import { a as normalizeWorkspaceSources, c as sourceMountIntersectsPath, f as prepareWorkspaceSource, n as createSourceContext, s as sourceMountContainsPath } from "./config-jo5QgE1w.js";
|
|
8
8
|
import { posix } from "node:path";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
|
-
|
|
10
|
+
// src/storage/identity.ts
|
|
11
11
|
const aliases = /* @__PURE__ */ new WeakMap();
|
|
12
12
|
const stableIdentities = /* @__PURE__ */ new WeakSet();
|
|
13
13
|
function workspaceStoreIdentity(store) {
|
|
@@ -30,8 +30,7 @@ function registerWorkspaceStoreAlias(alias, store) {
|
|
|
30
30
|
stableIdentities.add(storeIdentity);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
//#region src/sources/file-ownership.ts
|
|
33
|
+
// src/sources/file-ownership.ts
|
|
35
34
|
const activeCheckpoints = /* @__PURE__ */ new WeakMap();
|
|
36
35
|
const checkpointMetaKey = (path) => `workspace-file-checkpoint:${encodeURIComponent(normalizeWorkspacePath(path))}`;
|
|
37
36
|
const volatileOwners = /* @__PURE__ */ new WeakMap();
|
|
@@ -205,8 +204,7 @@ async function withWorkspaceFileCheckpoint(store, path, write, checkpoint, rollb
|
|
|
205
204
|
endWorkspaceFileCheckpoint(store, path);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
|
-
|
|
209
|
-
//#region src/sources/file-metadata.ts
|
|
207
|
+
// src/sources/file-metadata.ts
|
|
210
208
|
function normalizeMetadataValue(value) {
|
|
211
209
|
if (Array.isArray(value)) return value.map(normalizeMetadataValue);
|
|
212
210
|
if (!value || Object.getPrototypeOf(value) !== Object.prototype) return value;
|
|
@@ -215,8 +213,7 @@ function normalizeMetadataValue(value) {
|
|
|
215
213
|
function normalizeSourceFileMetadata(metadata) {
|
|
216
214
|
return copyJsonFileMetadata("Source", metadata, true);
|
|
217
215
|
}
|
|
218
|
-
|
|
219
|
-
//#region src/sources/source-items.ts
|
|
216
|
+
// src/sources/source-items.ts
|
|
220
217
|
function normalizeWorkspaceSourceItemPath(source, rawSourcePath, options = {}) {
|
|
221
218
|
const sourcePath = normalizeSafeWorkspacePath(rawSourcePath, {
|
|
222
219
|
allowEmpty: false,
|
|
@@ -235,8 +232,7 @@ function normalizeWorkspaceSourceItemPath(source, rawSourcePath, options = {}) {
|
|
|
235
232
|
function normalizeSourceItemPath(source, item, options = {}) {
|
|
236
233
|
return normalizeWorkspaceSourceItemPath(source, item.path || item.key, options);
|
|
237
234
|
}
|
|
238
|
-
|
|
239
|
-
//#region src/storage/mutation.ts
|
|
235
|
+
// src/storage/mutation.ts
|
|
240
236
|
const workspaceStoreMutations = /* @__PURE__ */ new WeakMap();
|
|
241
237
|
async function withWorkspaceStoreMutation(store, operation) {
|
|
242
238
|
const identity = workspaceStoreIdentity(store);
|
|
@@ -249,8 +245,7 @@ async function withWorkspaceStoreMutation(store, operation) {
|
|
|
249
245
|
if (workspaceStoreMutations.get(identity) === settled) workspaceStoreMutations.delete(identity);
|
|
250
246
|
}
|
|
251
247
|
}
|
|
252
|
-
|
|
253
|
-
//#region src/sources/mount-grants.ts
|
|
248
|
+
// src/sources/mount-grants.ts
|
|
254
249
|
/**
|
|
255
250
|
* Proof that one Source owner may change Workspace files inside one Source mount.
|
|
256
251
|
* Only the authority of the owner creates a grant. A grant is request-scoped. Do not persist it.
|
|
@@ -333,8 +328,7 @@ function createWorkspaceSourceMountAuthority(owner) {
|
|
|
333
328
|
}
|
|
334
329
|
};
|
|
335
330
|
}
|
|
336
|
-
|
|
337
|
-
//#region src/sources/materialization.ts
|
|
331
|
+
// src/sources/materialization.ts
|
|
338
332
|
const startupSourcesMetaKey = (workspace) => `workspace:${workspace}:startup-sources`;
|
|
339
333
|
const startupWorkspacesMetaKey = "workspace:startup-source-workspaces";
|
|
340
334
|
const volatileSnapshots = /* @__PURE__ */ new WeakMap();
|
|
@@ -1643,8 +1637,7 @@ function readStringMeta(meta, key) {
|
|
|
1643
1637
|
function readDigest(meta) {
|
|
1644
1638
|
return readStringMeta(meta, "digest") || readStringMeta(meta, "sha");
|
|
1645
1639
|
}
|
|
1646
|
-
|
|
1647
|
-
//#region src/storage/metadata-target.ts
|
|
1640
|
+
// src/storage/metadata-target.ts
|
|
1648
1641
|
/** Internal capability used only by Source Sync through wrapped writable facades. */
|
|
1649
1642
|
const workspaceInternalMetadataCapability = Symbol("vitehub.workspace.internalMetadata");
|
|
1650
1643
|
const metadataTargetResolvers = /* @__PURE__ */ new WeakMap();
|
|
@@ -1730,5 +1723,4 @@ function metadataTargetResolver(source) {
|
|
|
1730
1723
|
function resolveWorkspaceMetadataMutationTarget(target) {
|
|
1731
1724
|
return privateMetadataTargets.get(target) ?? target;
|
|
1732
1725
|
}
|
|
1733
|
-
//#endregion
|
|
1734
1726
|
export { removeWorkspaceOwnedFile as A, withWorkspaceStoreMutation as C, readWorkspaceFileOwner as D, normalizeSourceFileMetadata as E, registerWorkspaceStoreAlias as M, workspaceStoreIdentity as N, recordWorkspaceFileOwner as O, sourceMountOwnsPath as S, normalizeMetadataValue as T, reconcileRemovedStartupSources as _, resolveWorkspaceMetadataMutationTarget as a, statVirtualSourcePath as b, workspaceInternalMetadataCapability as c, invalidateSourceSnapshot as d, materializeWorkspaceSources as f, readSourceSnapshotPaths as g, readResolvedSourceFile as h, forwardWorkspaceMetadataView as i, withWorkspaceFileCheckpoint as j, removeWorkspaceFileOwner as k, hasCurrentSourceSnapshot as l, readCurrentSourceSnapshot as m, createWorkspaceMetadataTarget as n, resolveWorkspaceMetadataTarget as o, materializesCompleteSource as p, forwardWorkspaceMetadataTarget as r, setWorkspaceMetadata as s, attachWorkspaceMetadataTarget as t, hasFreshSourceSnapshot as u, searchMaterializedStore as v, normalizeSourceItemPath as w, createWorkspaceSourceMountAuthority as x, sourceSnapshotOwnsAnyPath as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/object.ts
|
|
2
2
|
/** A non-null object that is not an array. Functions do not pass. */
|
|
3
3
|
function isRecord(value) {
|
|
4
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -7,5 +7,4 @@ function isRecord(value) {
|
|
|
7
7
|
function isRecordOrFunction(value) {
|
|
8
8
|
return Object(value) === value && !Array.isArray(value);
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { isRecordOrFunction as n, isRecord as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
2
1
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
2
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
3
|
/** The Standard properties. */
|
|
@@ -74,8 +73,6 @@ declare namespace StandardSchemaV1 {
|
|
|
74
73
|
/** Infers the output type of a Standard. */
|
|
75
74
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
75
|
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region ../internal/src/operation-definition.d.ts
|
|
79
76
|
/** `read` never changes state. `write` changes state. `destructive` deletes or publishes. */
|
|
80
77
|
type OperationKind = "read" | "write" | "destructive";
|
|
81
78
|
/** The signed-in user of a call. */
|
|
@@ -241,5 +238,4 @@ interface OperationContributionEntry {
|
|
|
241
238
|
/** `false`: the app already has these operations at runtime. Only tools such as the CLI and `vitehub inspect` read the entry. */
|
|
242
239
|
runtime?: false;
|
|
243
240
|
}
|
|
244
|
-
//#endregion
|
|
245
241
|
export { OperationContributionEntry as n, AnyOperation as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
-
import { d as normalizeHistoryPath } from "./utils-
|
|
1
|
+
import { _ as redactInspectionText } from "./operations-DS1C4uXd.js";
|
|
2
|
+
import { a as workspaceConflict } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
4
|
+
import { d as normalizeHistoryPath } from "./utils-DXP9xfXo.js";
|
|
5
|
+
import { r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
6
|
+
import { r as useWorkspaceFiles } from "./use-D0DyTMxM.js";
|
|
5
7
|
import { readDerivedFrom, staleDerivedFiles } from "./lineage.js";
|
|
6
|
-
|
|
7
|
-
import { _ as redactInspectionText } from "./operations-dtcU5LkD.js";
|
|
8
|
-
//#region src/runtime/operations.ts
|
|
8
|
+
// src/runtime/operations.ts
|
|
9
9
|
const invalidRequestCodes = /* @__PURE__ */ new Set([
|
|
10
10
|
"WORKSPACE_HISTORY_INVALID",
|
|
11
11
|
"WORKSPACE_PATH_INVALID",
|
|
@@ -385,5 +385,4 @@ function describeFailure(workspace, error) {
|
|
|
385
385
|
if (typeof own === "number" && own >= 400 && own < 500) return withStatus(error, own);
|
|
386
386
|
return withStatus(error, operationStatus[code] ?? (invalidRequestCodes.has(code) ? 400 : 500));
|
|
387
387
|
}
|
|
388
|
-
//#endregion
|
|
389
388
|
export { runWorkspaceChanges, runWorkspaceCommit, runWorkspaceOperation, runWorkspaceStale };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as workspaceCommitRequestBytes } from "./results-
|
|
2
|
-
import { n as isRecordOrFunction, t as isRecord } from "./object-
|
|
3
|
-
import { t as internalErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as workspaceCommitRequestBytes } from "./results-z-HpV9EP.js";
|
|
2
|
+
import { n as isRecordOrFunction, t as isRecord } from "./object-CAK6UYR5.js";
|
|
3
|
+
import { t as internalErrorDiagnostics } from "./error-diagnostics-kKXseq8d.js";
|
|
4
4
|
import { basename, dirname, join, parse, resolve } from "node:path";
|
|
5
5
|
import { mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import "node:fs/promises";
|
|
@@ -9,7 +9,7 @@ import { tmpdir } from "node:os";
|
|
|
9
9
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
10
10
|
import { createBirpc } from "birpc";
|
|
11
11
|
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
12
|
-
|
|
12
|
+
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
13
13
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
14
14
|
function normalizeWindowsPath(input = "") {
|
|
15
15
|
if (!input) return input;
|
|
@@ -106,8 +106,7 @@ const dirname$1 = function(p) {
|
|
|
106
106
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
107
107
|
return segments.join("/") || (isAbsolute$1(p) ? "/" : ".");
|
|
108
108
|
};
|
|
109
|
-
|
|
110
|
-
//#region ../internal/src/inspect.ts
|
|
109
|
+
// ../internal/src/inspect.ts
|
|
111
110
|
function relativeDefinitionFile(projectRoot, file) {
|
|
112
111
|
return relative$1(projectRoot, file).replaceAll("\\", "/");
|
|
113
112
|
}
|
|
@@ -371,8 +370,7 @@ function requireViteHubDevServerUrl(roots, env, command) {
|
|
|
371
370
|
if (!url) throw internalErrorDiagnostics.INTERNAL_DEV_SERVER_NOT_FOUND({ command });
|
|
372
371
|
return url;
|
|
373
372
|
}
|
|
374
|
-
|
|
375
|
-
//#region ../internal/src/build/vite.ts
|
|
373
|
+
// ../internal/src/build/vite.ts
|
|
376
374
|
const generatedViteHubFilesPattern = "**/.vitehub/**";
|
|
377
375
|
const projectRootDirectoryMarkers = [
|
|
378
376
|
["server", "agents"],
|
|
@@ -448,7 +446,7 @@ function loadNativePackageModule(id) {
|
|
|
448
446
|
}
|
|
449
447
|
function reexportNativeModule(file) {
|
|
450
448
|
const url = JSON.stringify(pathToFileURL(realpathSync(file)).href);
|
|
451
|
-
const hasDefault =
|
|
449
|
+
const hasDefault = /^export\s+default\b|^export\s*\{[^}]*\bdefault\s*[,}]/m.test(readFileSync(file, "utf8"));
|
|
452
450
|
const native = JSON.stringify(`data:text/javascript,${encodeURIComponent(`export * from ${url}${hasDefault ? `\nexport { default } from ${url}` : ""}`)}`);
|
|
453
451
|
return `export * from ${native}\n${hasDefault ? `export { default } from ${native}\n` : ""}`;
|
|
454
452
|
}
|
|
@@ -566,8 +564,7 @@ function publishViteHubDevServer(server) {
|
|
|
566
564
|
else http.once("listening", write);
|
|
567
565
|
http.once("close", remove);
|
|
568
566
|
}
|
|
569
|
-
|
|
570
|
-
//#region ../internal/src/operation-rpc.ts
|
|
567
|
+
// ../internal/src/operation-rpc.ts
|
|
571
568
|
/** Path of the operation RPC under the app. Dev servers and deployed apps serve it the same way, one birpc call per POST. */
|
|
572
569
|
const operationRpcPath = "/_vitehub/rpc";
|
|
573
570
|
function text(value) {
|
|
@@ -652,8 +649,7 @@ async function callOperationRpc(name, input, send) {
|
|
|
652
649
|
};
|
|
653
650
|
}
|
|
654
651
|
}
|
|
655
|
-
|
|
656
|
-
//#region ../internal/src/console-signature.ts
|
|
652
|
+
// ../internal/src/console-signature.ts
|
|
657
653
|
/**
|
|
658
654
|
* Signed requests to the Console endpoint of an app, `POST /_vitehub/rpc`. Each caller, such as one Console link or one
|
|
659
655
|
* CI job, has an Ed25519 key pair. The app keeps only the public keys, in `VITEHUB_CONSOLE_KEY_<NAME>`, so a copy of
|
|
@@ -782,8 +778,7 @@ function readConsoleSigningKey(env) {
|
|
|
782
778
|
privateKey
|
|
783
779
|
};
|
|
784
780
|
}
|
|
785
|
-
|
|
786
|
-
//#region ../internal/src/standard-schema.ts
|
|
781
|
+
// ../internal/src/standard-schema.ts
|
|
787
782
|
function readOwn(value, key) {
|
|
788
783
|
if (value === null || Object(value) !== value) return;
|
|
789
784
|
try {
|
|
@@ -812,8 +807,7 @@ function standardJsonSchema(schema, direction, target = "draft-2020-12", library
|
|
|
812
807
|
return;
|
|
813
808
|
}
|
|
814
809
|
}
|
|
815
|
-
|
|
816
|
-
//#region ../internal/src/valibot.ts
|
|
810
|
+
// ../internal/src/valibot.ts
|
|
817
811
|
const valibotTargets = /* @__PURE__ */ new Set([
|
|
818
812
|
"draft-07",
|
|
819
813
|
"draft-2020-12",
|
|
@@ -854,8 +848,7 @@ function withValibotJsonSchema(schema, options = {}) {
|
|
|
854
848
|
}
|
|
855
849
|
};
|
|
856
850
|
}
|
|
857
|
-
|
|
858
|
-
//#region ../internal/src/operation-definition.ts
|
|
851
|
+
// ../internal/src/operation-definition.ts
|
|
859
852
|
const nameFormat = /^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$/;
|
|
860
853
|
const kinds = /* @__PURE__ */ new Set([
|
|
861
854
|
"read",
|
|
@@ -915,8 +908,7 @@ function isSectionId(section) {
|
|
|
915
908
|
function operationInputJsonSchema(operation) {
|
|
916
909
|
return standardJsonSchema(operation.input, "input") ?? { type: "object" };
|
|
917
910
|
}
|
|
918
|
-
|
|
919
|
-
//#region ../internal/src/operations.ts
|
|
911
|
+
// ../internal/src/operations.ts
|
|
920
912
|
/** Header that proves the caller is not a browser page. A foreign page cannot send it without a CORS preflight. */
|
|
921
913
|
const operationRpcHeader = "x-vitehub-console";
|
|
922
914
|
/** Response header of the local dev RPC. Its value is {@link projectRootHash} of the project that the server runs. */
|
|
@@ -992,7 +984,7 @@ async function callOperation(target, name, input) {
|
|
|
992
984
|
const url = new URL(operationRpcPath.slice(1), base);
|
|
993
985
|
origin = url.origin;
|
|
994
986
|
const env = target.roots?.length ? {} : target.env;
|
|
995
|
-
try {
|
|
987
|
+
if (!target.authorization) try {
|
|
996
988
|
readConsoleSigningKey(env);
|
|
997
989
|
} catch (error) {
|
|
998
990
|
return {
|
|
@@ -1004,15 +996,18 @@ async function callOperation(target, name, input) {
|
|
|
1004
996
|
};
|
|
1005
997
|
}
|
|
1006
998
|
const outcome = await callOperationRpc(name, input ?? {}, async (body) => {
|
|
1007
|
-
const
|
|
999
|
+
const signal = target.signal ?? AbortSignal.timeout(target.timeout ?? 3e4);
|
|
1000
|
+
const headers = target.authorization ? operationHeaders() : await signedOperationHeaders(env, url, body);
|
|
1001
|
+
if (target.authorization) headers.set("authorization", target.authorization);
|
|
1008
1002
|
if (target.confirmed !== void 0) headers.set(operationConfirmationHeader, target.confirmed ? "confirmed" : "required");
|
|
1009
1003
|
if (target.roots?.length) headers.set(operationExpectedRootsHeader, target.roots.map(projectRootHash).join(","));
|
|
1004
|
+
signal.throwIfAborted();
|
|
1010
1005
|
const response = await (target.fetch ?? fetch)(url.href, {
|
|
1011
1006
|
body,
|
|
1012
1007
|
headers,
|
|
1013
1008
|
method: "POST",
|
|
1014
1009
|
redirect: "manual",
|
|
1015
|
-
signal
|
|
1010
|
+
signal
|
|
1016
1011
|
});
|
|
1017
1012
|
const text = await response.text();
|
|
1018
1013
|
let json;
|
|
@@ -1049,7 +1044,7 @@ async function callOperation(target, name, input) {
|
|
|
1049
1044
|
} : void 0);
|
|
1050
1045
|
if (failure) {
|
|
1051
1046
|
if (target.roots?.length && failure.status === 401) failure.fix = `Pass --url ${base.href.slice(0, -1)} to send credentials. A command sends none to the dev server that it finds. ${failure.fix ?? "Set VITEHUB_CONSOLE_PRIVATE_KEY_<NAME> to a private key that `vitehub secret console-key` printed, and its public key in VITEHUB_CONSOLE_KEY_<NAME> on the app."}`;
|
|
1052
|
-
if ((failure.status === 401 || failure.status === 403) && !hasCredentials(env) && !failure.fix) failure.fix = target.roots?.length ? `Pass --url <origin> to send deployment credentials. ${operationCredentialHint}` : operationCredentialHint;
|
|
1047
|
+
if ((failure.status === 401 || failure.status === 403) && !target.authorization && !hasCredentials(env) && !failure.fix) failure.fix = target.roots?.length ? `Pass --url <origin> to send deployment credentials. ${operationCredentialHint}` : operationCredentialHint;
|
|
1053
1048
|
return {
|
|
1054
1049
|
ok: false,
|
|
1055
1050
|
...failure
|
|
@@ -1088,9 +1083,8 @@ function table(rows) {
|
|
|
1088
1083
|
const widths = rows[0].map((_, column) => Math.max(...rows.map((row) => row[column].length)));
|
|
1089
1084
|
return rows.map((row) => row.map((cell, column) => column === row.length - 1 ? cell : cell.padEnd(widths[column])).join(" ")).join("\n");
|
|
1090
1085
|
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
const runtime = () => import("./operations-Cib30_dt.js");
|
|
1086
|
+
// src/operations.ts
|
|
1087
|
+
const runtime = () => import("./operations-BIaK_uYG.js");
|
|
1094
1088
|
const name = v.pipe(v.string(), v.check((value) => value.trim() !== "", "Name a Workspace."));
|
|
1095
1089
|
const nonEmpty = (message) => v.pipe(v.string(), v.check((value) => value !== "", message));
|
|
1096
1090
|
function defineWorkspaceOperation(definition, kind = "read") {
|
|
@@ -1311,5 +1305,4 @@ const workspaceOperations = [
|
|
|
1311
1305
|
run: async (input) => await (await runtime()).runWorkspaceStale(input)
|
|
1312
1306
|
})
|
|
1313
1307
|
];
|
|
1314
|
-
//#endregion
|
|
1315
1308
|
export { resolve$1 as S, redactInspectionText as _, createNoExternalAddition as a, isAbsolute$1 as b, isProductionBuild as c, resolveViteHubProjectRoot as d, shouldSkipViteProviderBuild as f, requireViteHubDevServerUrl as g, readViteHubDevTargetOption as h, createNativePackageLoading as i, isServerEnvironment as l, fetchViteHubDevEndpoint as m, callOperationFromCli as n, createViteHubEnvImportAliases as o, discoverViteHubDevServer as p, VITEHUB_SERVER_DIRS as r, generatedViteHubWatchIgnoredAddition as s, workspaceOperations as t, publishViteHubDevServer as u, relativeDefinitionFile as v, relative$1 as x, dirname$1 as y };
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as AnyOperation } from "./operation-definition-CqZkx1Rm.js";
|
|
2
|
+
import { It as WorkspaceRevision } from "./types-Bel5IDmF.js";
|
|
2
3
|
import { WorkspaceStaleFile } from "./lineage.js";
|
|
3
|
-
import { t as AnyOperation } from "./operation-definition-CI2PJGqu.js";
|
|
4
|
-
//#region src/results.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The largest `workspace.commit` request body: 4 MiB of JSON, with base64 for binary files. Vercel Functions accept
|
|
7
6
|
* request bodies up to 4.5 MB and Cloudflare Workers up to 100 MB, so one push works on every host.
|
|
@@ -82,9 +81,6 @@ interface WorkspaceCommitResult {
|
|
|
82
81
|
/** Committed bytes of puts whose content changed during write validation or hooks, keyed by request path. */
|
|
83
82
|
normalized?: Record<string, Pick<WorkspaceHistoryContent, "content" | "encoding">>;
|
|
84
83
|
}
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/operations.d.ts
|
|
87
84
|
/** The `workspace.*` operations: history, refs, show, changes, commit, and stale. The Console, `vitehub workspace`, and agents run them. */
|
|
88
85
|
export declare const workspaceOperations: readonly AnyOperation[];
|
|
89
|
-
//#endregion
|
|
90
86
|
export type { WorkspaceChangedFile, WorkspaceChanges, WorkspaceCommitResult, WorkspaceHistoryContent, WorkspaceHistoryDetails, WorkspaceHistoryFile, WorkspaceHistoryList, WorkspaceHistoryRefs, WorkspaceHistoryRevision, WorkspaceStaleFile, WorkspaceStaleList };
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as workspaceCommitRequestBytes } from "./results-
|
|
2
|
-
import { t as workspaceOperations } from "./operations-
|
|
1
|
+
import { t as workspaceCommitRequestBytes } from "./results-z-HpV9EP.js";
|
|
2
|
+
import { t as workspaceOperations } from "./operations-DS1C4uXd.js";
|
|
3
3
|
export { workspaceCommitRequestBytes, workspaceOperations };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as workspacePathError, t as normalizeSafeWorkspacePath } from "./path-
|
|
1
|
+
import { l as workspacePathError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
2
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { minimatch } from "minimatch";
|
|
5
|
-
|
|
5
|
+
// src/core/path.ts
|
|
6
6
|
function normalizeWorkspacePath(path = "") {
|
|
7
7
|
return path.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
8
8
|
}
|
|
@@ -94,5 +94,4 @@ async function sha256(input) {
|
|
|
94
94
|
const bytes = contentToBytes(typeof input === "string" || isWorkspaceBytes(input) ? input : JSON.stringify(input));
|
|
95
95
|
return createHash("sha256").update(bytes).digest("hex");
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { isExcludedWorkspacePath as a, normalizeSafeWorkspacePattern as c, sha256 as d, decodeFile as i, normalizeWorkspacePath as l, contentStreamToBytes as n, isWorkspaceBytes as o, contentToBytes as r, matchesAny as s, contentStreamChunks as t, resolveInside as u };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
//#region src/internal/path.d.ts
|
|
2
1
|
interface SafeWorkspacePathOptions {
|
|
3
2
|
allowEmpty?: boolean;
|
|
4
3
|
allowReserved?: boolean;
|
|
5
4
|
pattern?: boolean;
|
|
6
5
|
}
|
|
7
6
|
declare function normalizeSafeWorkspacePath(path?: string, options?: SafeWorkspacePathOptions): string;
|
|
8
|
-
//#endregion
|
|
9
7
|
export { normalizeSafeWorkspacePath as n, SafeWorkspacePathOptions as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ViteHubError, getViteHubErrorShape } from "@vite-hub/runtime";
|
|
2
|
-
|
|
2
|
+
// src/core/errors.ts
|
|
3
3
|
function workspaceError(message, options) {
|
|
4
4
|
const code = message.startsWith("[vitehub] Workspace file does not exist:") || message.startsWith("[vitehub] Workspace path does not exist:") || message.startsWith("[vitehub] Custom Workspace Source file does not exist:") ? "WORKSPACE_NOT_FOUND" : "WORKSPACE_FAILED";
|
|
5
5
|
return new ViteHubError(code, message, options);
|
|
@@ -31,8 +31,7 @@ function isWorkspaceError(value) {
|
|
|
31
31
|
function isWorkspaceConflict(value) {
|
|
32
32
|
return getViteHubErrorShape(value)?.code === "WORKSPACE_CONFLICT";
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
//#region src/internal/path.ts
|
|
34
|
+
// src/internal/path.ts
|
|
36
35
|
function classifyWindowsComponent(part) {
|
|
37
36
|
const withoutStream = part.toLowerCase().split(":", 1)[0];
|
|
38
37
|
return {
|
|
@@ -55,5 +54,4 @@ function normalizeSafeWorkspacePath(path = "", options = {}) {
|
|
|
55
54
|
})) throw workspacePathError(path);
|
|
56
55
|
return normalized;
|
|
57
56
|
}
|
|
58
|
-
//#endregion
|
|
59
57
|
export { workspaceConflict as a, workspaceNotFoundError as c, isWorkspaceError as i, workspacePathError as l, assertWorkspaceDigest as n, workspaceConflictError as o, isWorkspaceConflict as r, workspaceError as s, normalizeSafeWorkspacePath as t };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { jt as WorkspacePlugin } from "./types-
|
|
2
|
-
//#region src/core/plugins.d.ts
|
|
1
|
+
import { jt as WorkspacePlugin } from "./types-Bel5IDmF.js";
|
|
3
2
|
/**
|
|
4
3
|
* Add a plugin's rules and hooks to a Workspace by name, including discovered Workspaces the caller does not define.
|
|
5
4
|
* Registering the same plugin id again replaces the earlier registration. A plugin declared by the Workspace Definition
|
|
6
5
|
* with the same id wins. The returned function removes this registration.
|
|
7
6
|
*/
|
|
8
7
|
declare function registerWorkspacePlugin(workspace: string, plugin: WorkspacePlugin): () => void;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { registerWorkspacePlugin as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as assertWorkspaceDigest, o as workspaceConflictError, s as workspaceError } from "./path-
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as createWorkspaceGlobMatcher } from "./glob-
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
1
|
+
import { M as readForgeEnv, j as forgeEnv, t as assertNoGitHubRepositoryKey } from "./shared-C20Wh1mp.js";
|
|
2
|
+
import { n as assertWorkspaceDigest, o as workspaceConflictError, s as workspaceError } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { t as createGitHubWorkspaceStore } from "./store-cx3OqNTi.js";
|
|
4
|
+
import { t as getWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
5
|
+
import { t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
|
|
6
|
+
import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
|
|
7
|
+
import { a as isExcludedWorkspacePath, d as sha256, l as normalizeWorkspacePath, r as contentToBytes, t as contentStreamChunks, u as resolveInside } from "./path-Bb9OIc_F.js";
|
|
8
|
+
import { a as provideWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
9
|
+
import { r as vitehubOwnedPrefix, t as createMemoryWorkspaceStore } from "./memory-BlSRrBH1.js";
|
|
10
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
11
11
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
import { constants, createReadStream, createWriteStream } from "node:fs";
|
|
@@ -17,7 +17,7 @@ import { check, fallback, literal, object, optional, pipe, record, safeParse, st
|
|
|
17
17
|
import { Readable, Transform } from "node:stream";
|
|
18
18
|
import { pipeline } from "node:stream/promises";
|
|
19
19
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
20
|
-
|
|
20
|
+
// ../internal/src/env.ts
|
|
21
21
|
function trimmed(value) {
|
|
22
22
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
23
23
|
}
|
|
@@ -27,8 +27,7 @@ function readEnv(env, ...names) {
|
|
|
27
27
|
if (value) return value;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
//#region src/runtime/hosted-store-loader.ts
|
|
30
|
+
// src/runtime/hosted-store-loader.ts
|
|
32
31
|
const workspaceHostedStoreLoaderKey = Symbol.for("vitehub.workspace.hostedStoreLoader");
|
|
33
32
|
function workspaceHostedStoreLoaderGlobal() {
|
|
34
33
|
return globalThis;
|
|
@@ -39,8 +38,7 @@ function setWorkspaceHostedStoreLoader(loader) {
|
|
|
39
38
|
function getWorkspaceHostedStoreLoader() {
|
|
40
39
|
return workspaceHostedStoreLoaderGlobal()[workspaceHostedStoreLoaderKey];
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
//#region src/storage/local.ts
|
|
41
|
+
// src/storage/local.ts
|
|
44
42
|
const fileMetadataSchema = optional(pipe(unknown(), check((value) => !Array.isArray(value)), record(string(), unknown()), check((value) => {
|
|
45
43
|
return safeParse(optional(string()), value.source).success;
|
|
46
44
|
})));
|
|
@@ -1333,8 +1331,7 @@ function createLocalWorkspaceStore(root, options = {}) {
|
|
|
1333
1331
|
if (options.ignore !== void 0 && options.ignore !== "git") throw workspaceError("[vitehub] Local workspace store ignore must be \"git\".");
|
|
1334
1332
|
return new LocalWorkspaceStore(root, options);
|
|
1335
1333
|
}
|
|
1336
|
-
|
|
1337
|
-
//#region src/storage/owned-blob-prefix.ts
|
|
1334
|
+
// src/storage/owned-blob-prefix.ts
|
|
1338
1335
|
/**
|
|
1339
1336
|
* Returns `_vitehub/<root>`, or `_vitehub/<root>/<prefix>` for a custom prefix.
|
|
1340
1337
|
* ViteHub owns every Workspace Blob object, so a custom prefix only nests below the owned root.
|
|
@@ -1344,8 +1341,7 @@ function ownedBlobPrefix(root, prefix, label) {
|
|
|
1344
1341
|
const owned = `${vitehubOwnedPrefix}${root}`;
|
|
1345
1342
|
return prefix === void 0 ? owned : `${owned}/${prefix}`;
|
|
1346
1343
|
}
|
|
1347
|
-
|
|
1348
|
-
//#region src/storage/provider.ts
|
|
1344
|
+
// src/storage/provider.ts
|
|
1349
1345
|
const MASKED_WORKSPACE_RUNTIME_VALUE = "********";
|
|
1350
1346
|
function workspaceRepoName(name) {
|
|
1351
1347
|
return name ? name.replace(/[^a-zA-Z0-9_.-]/g, "-") : void 0;
|
|
@@ -1489,5 +1485,4 @@ function resolveRuntimeVercelBlobWorkspaceStore(config, env) {
|
|
|
1489
1485
|
token
|
|
1490
1486
|
};
|
|
1491
1487
|
}
|
|
1492
|
-
//#endregion
|
|
1493
1488
|
export { resolveGitHubWorkspaceStore as a, resolveWorkspaceDefinitionStore as c, setWorkspaceHostedStoreLoader as d, resolveCloudflareArtifactsStore as i, ownedBlobPrefix as l, isWorkspaceStore as n, resolveRuntimeVercelBlobWorkspaceStore as o, normalizeWorkspaceStoreOptions as r, resolveVercelBlobWorkspaceStore as s, createWorkspaceStoreFromProvider as t, getWorkspaceHostedStoreLoader as u };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { En as WorkspaceStore, s as GitHubWorkspaceStoreOptions } from "../../types-
|
|
2
|
-
|
|
3
|
-
export declare function createGitHubWorkspaceStore(options: GitHubWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
|
|
4
|
-
//#endregion
|
|
1
|
+
import { En as WorkspaceStore, s as GitHubWorkspaceStoreOptions } from "../../types-Bel5IDmF.js";
|
|
2
|
+
export declare function createGitHubWorkspaceStore(options: GitHubWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createGitHubWorkspaceStore };
|
|
1
|
+
export { t as createGitHubWorkspaceStore } from "../../store-cx3OqNTi.js";
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { R as WorkspaceDefinitionInput, v as ResolvedWorkspaceModuleOptions } from "./types-
|
|
2
|
-
//#region src/runtime/config.d.ts
|
|
1
|
+
import { R as WorkspaceDefinitionInput, v as ResolvedWorkspaceModuleOptions } from "./types-Bel5IDmF.js";
|
|
3
2
|
declare function setWorkspaceRuntimeConfig(config: false | ResolvedWorkspaceModuleOptions): void;
|
|
4
3
|
declare function getWorkspaceRuntimeConfig(): false | ResolvedWorkspaceModuleOptions;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/runtime/registry.d.ts
|
|
7
4
|
type WorkspaceRegistryModule = {
|
|
8
5
|
default?: WorkspaceDefinitionInput;
|
|
9
6
|
};
|
|
@@ -16,5 +13,4 @@ interface WorkspaceRuntimeRegistryState {
|
|
|
16
13
|
declare function workspaceRuntimeRegistryState(): Readonly<WorkspaceRuntimeRegistryState>;
|
|
17
14
|
declare function setWorkspaceRuntimeRegistry(registry: WorkspaceRuntimeRegistryState["loaders"]): void;
|
|
18
15
|
declare function resetWorkspaceRuntimeRegistry(): void;
|
|
19
|
-
//#endregion
|
|
20
16
|
export { setWorkspaceRuntimeRegistry as a, setWorkspaceRuntimeConfig as c, resetWorkspaceRuntimeRegistry as i, WorkspaceRegistryLoader as n, workspaceRuntimeRegistryState as o, WorkspaceRegistryModule as r, getWorkspaceRuntimeConfig as s, WorkspaceRegistry as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as workspaceNotFoundError } from "./path-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as createWorkspace } from "./workspace-CFrwWhEm.js";
|
|
1
|
+
import { c as workspaceNotFoundError } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { t as createWorkspace } from "./workspace-CLuPkyZR.js";
|
|
4
3
|
import { setWorkspaceRuntimeRegistry, workspaceRuntimeRegistryState } from "./runtime/registry.js";
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
5
5
|
import { getViteHubErrorShape, isRuntimeDiagnostic } from "@vite-hub/runtime";
|
|
6
|
-
|
|
6
|
+
// src/core/registry.ts
|
|
7
7
|
const workspaceRegistryStateKey = Symbol.for("vitehub.workspace.registryState");
|
|
8
8
|
function workspaceRegistryState() {
|
|
9
9
|
const scope = globalThis;
|
|
@@ -165,5 +165,4 @@ async function useRegisteredWorkspace(name, options = {}) {
|
|
|
165
165
|
const definition = await resolveWorkspaceDefinition(name);
|
|
166
166
|
return createWorkspace(definition, options);
|
|
167
167
|
}
|
|
168
|
-
//#endregion
|
|
169
168
|
export { setWorkspaceRegistry as a, workspaceRegistryLoadError as c, resolveRegisteredWorkspaceDefinition as i, normalizeWorkspaceDefinition as n, setWorkspaceRuntimeDefinitions as o, registerWorkspace as r, useRegisteredWorkspace as s, isWorkspaceName as t };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { L as WorkspaceDefinition, R as WorkspaceDefinitionInput, w as ValidatedWorkspaceName } from "./types-
|
|
2
|
-
import "./registry-
|
|
3
|
-
//#region src/core/registry.d.ts
|
|
1
|
+
import { L as WorkspaceDefinition, R as WorkspaceDefinitionInput, w as ValidatedWorkspaceName } from "./types-Bel5IDmF.js";
|
|
2
|
+
import "./registry-B0g19sdy.js";
|
|
4
3
|
declare function registerWorkspace(name: string, definition: WorkspaceDefinitionInput): WorkspaceDefinition;
|
|
5
4
|
/** Replace one generated catalog's definitions without replacing application registrations. */
|
|
6
5
|
declare function setWorkspaceRuntimeDefinitions(scope: string, definitions: Record<string, WorkspaceDefinitionInput>): void;
|
|
7
6
|
/** Whether a Workspace Definition has this name. Use it to check a name that comes from a request or a database. */
|
|
8
7
|
declare function isWorkspaceName(name: string): name is ValidatedWorkspaceName;
|
|
9
8
|
declare function resolveRegisteredWorkspaceDefinition(name: string, abortSignal?: AbortSignal): Promise<WorkspaceDefinition>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { setWorkspaceRuntimeDefinitions as i, registerWorkspace as n, resolveRegisteredWorkspaceDefinition as r, isWorkspaceName as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as workspaceStoreDiscard } from "./discard-
|
|
1
|
+
import { t as workspaceStoreDiscard } from "./discard-BkoLmmmN.js";
|
|
2
2
|
import { registerRunScope } from "@vite-hub/runtime/internal/run-scope";
|
|
3
|
-
|
|
3
|
+
// src/core/request-scope.ts
|
|
4
4
|
const runtimeGlobal = globalThis;
|
|
5
5
|
const storageKey = Symbol.for("vitehub.workspace.request");
|
|
6
6
|
const writersKey = Symbol.for("vitehub.workspace.writers");
|
|
@@ -80,5 +80,4 @@ async function runWorkspaceRequest(next) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
registerRunScope(runWorkspaceRequest);
|
|
83
|
-
//#endregion
|
|
84
83
|
export { trackStagedWrites as n, runWorkspaceRequest as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/results.ts
|
|
2
2
|
/**
|
|
3
3
|
* The largest `workspace.commit` request body: 4 MiB of JSON, with base64 for binary files. Vercel Functions accept
|
|
4
4
|
* request bodies up to 4.5 MB and Cloudflare Workers up to 100 MB, so one push works on every host.
|
|
5
5
|
*/
|
|
6
6
|
const workspaceCommitRequestBytes = 4194304;
|
|
7
|
-
//#endregion
|
|
8
7
|
export { workspaceCommitRequestBytes as t };
|