@vite-hub/workspace 0.8.0 → 0.9.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/blob-database.js +2 -2
- package/dist/checkout.d.ts +0 -6
- package/dist/checkout.js +1 -30
- package/dist/{config-Bze7OyvB.js → config-B-S_Z4G0.js} +5 -14
- package/dist/durability.js +2 -2
- package/dist/{error-diagnostics-CHgE8TQM.js → error-diagnostics-Dn4sQcKL.js} +3 -4
- package/dist/{file-DIBPXqbk.js → file-B3KxJyxb.js} +1 -1
- package/dist/{files-DAJyo7TU.js → files-DSOjTK36.js} +1 -1
- package/dist/files.d.ts +0 -6
- package/dist/files.js +4 -4
- package/dist/{github-DcrnEGNN.js → github-DDUrrKt8.js} +3 -3
- package/dist/{glob-YVshR7WP.js → glob-BfZVRPCk.js} +1 -1
- package/dist/{host-BT7EnmZf.js → host-CcCDXyJI.js} +3 -3
- package/dist/hosted-vercel-blob.js +3 -3
- package/dist/hosted.js +4 -19
- package/dist/index.js +12 -12
- package/dist/internal/path.js +1 -1
- package/dist/internal/workspace.js +2 -2
- package/dist/{lifecycle-B0ucHUum.js → lifecycle-CXiS7Dks.js} +4 -4
- package/dist/loader.js +1 -1
- package/dist/{mcp-resources-BDL0llKW.js → mcp-resources-B2J0YCD2.js} +1 -1
- package/dist/{metadata-target-mlHAv1p4.js → metadata-target-oc00D8g2.js} +2 -8
- package/dist/{operations-D3mZArDi.js → operations-DWPC8nrk.js} +3 -11
- package/dist/operations.js +1 -9
- package/dist/{provider-DZY1cLP5.js → provider-DBJeUNFI.js} +2 -11
- package/dist/providers/github/store.js +3 -35
- package/dist/{registry-OonxXCbd.js → registry-CqDWpDe9.js} +2 -2
- package/dist/{request-scope-jH4H0Sbm.js → request-scope-DZJbe-tP.js} +0 -2
- package/dist/{rule-keys-xMpiTLq1.js → rule-keys-DQYcSewo.js} +1 -1
- package/dist/{rules-DYQCKYdt.js → rules-sItt6TP-.js} +2 -10
- package/dist/runtime/request.js +1 -1
- package/dist/runtime/state.js +6 -6
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.js +12 -12
- package/dist/server.js +4 -4
- package/dist/{shared-DCAyMX8U.js → shared-CaAKcBBr.js} +1 -14
- package/dist/source-metadata.js +3 -3
- package/dist/{sync-DkpTCr9u.js → sync-ztyvA0Va.js} +3 -3
- package/dist/test.js +1 -1
- package/dist/{use-hLouCwGz.js → use-BskfWVjx.js} +6 -6
- package/dist/{use-tools-NXEQt099.js → use-tools-D_eorKu1.js} +3 -3
- package/dist/{utils-Bv1NBg8r.js → utils-BoFJcaT1.js} +2 -3
- package/dist/vite.js +6 -62
- package/dist/{workspace-Cz-5Ne1c.js → workspace-Dbo5iYIc.js} +10 -10
- package/dist/{workspace-inspection-scanner-BlJ8bCAB.js → workspace-inspection-scanner-6QrvwVJG.js} +0 -5
- package/package.json +12 -12
package/dist/operations.js
CHANGED
|
@@ -434,12 +434,6 @@ function createNativePackageLoading(ssrPackageEntries = []) {
|
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
const nativePackageDistFile = /\/node_modules\/@vite-hub\/(?:agent|connections|runtime|workspace)\/dist\/.+\.js$/;
|
|
437
|
-
/**
|
|
438
|
-
* Generated code imports the runtime files of its owner by path. Vite gives Node only bare package names, so in the
|
|
439
|
-
* Nitro environment of `vite dev` it would inline a second copy of a package that Node already loaded, with its own
|
|
440
|
-
* registries. This returns a module that lets Node load the file instead, so the app and the generated code share one
|
|
441
|
-
* instance. Use it as the `load` hook result for the file. It returns nothing for other files and environments.
|
|
442
|
-
*/
|
|
443
437
|
function loadNativePackageModule(id) {
|
|
444
438
|
const file = id.startsWith("file:") ? fileURLToPath(id) : id;
|
|
445
439
|
if (!nativePackageDistFile.test(file.replace(/\\/g, "/"))) return;
|
|
@@ -706,7 +700,6 @@ function base64url(bytes) {
|
|
|
706
700
|
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
707
701
|
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
708
702
|
}
|
|
709
|
-
/** The bytes of a base64url value, or `undefined` when it is not canonical base64url without padding. */
|
|
710
703
|
function fromBase64url(value) {
|
|
711
704
|
if (!/^[\w-]*$/.test(value) || value.length % 4 === 1) return void 0;
|
|
712
705
|
const bytes = Uint8Array.from(atob(value.replace(/-/g, "+").replace(/_/g, "/")), (character) => character.charCodeAt(0));
|
|
@@ -733,7 +726,6 @@ function consoleSignedText(fields) {
|
|
|
733
726
|
fields.caller
|
|
734
727
|
].join("\n");
|
|
735
728
|
}
|
|
736
|
-
/** The path and query of a URL, the part of the request target that the signature covers. */
|
|
737
729
|
function requestTarget(url) {
|
|
738
730
|
return `${url.pathname}${url.search}`;
|
|
739
731
|
}
|
|
@@ -1118,7 +1110,7 @@ function table(rows) {
|
|
|
1118
1110
|
return rows.map((row) => row.map((cell, column) => column === row.length - 1 ? cell : cell.padEnd(widths[column])).join(" ")).join("\n");
|
|
1119
1111
|
}
|
|
1120
1112
|
// src/operations.ts
|
|
1121
|
-
const runtime = () => import("./operations-
|
|
1113
|
+
const runtime = () => import("./operations-DWPC8nrk.js");
|
|
1122
1114
|
const name = v.pipe(v.string(), v.check((value) => value.trim() !== "", "Name a Workspace."));
|
|
1123
1115
|
const nonEmpty = (message) => v.pipe(v.string(), v.check((value) => value !== "", message));
|
|
1124
1116
|
function defineWorkspaceOperation(definition, kind = "read") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as readForgeEnv, j as forgeEnv, t as assertNoGitHubRepositoryKey } from "./shared-
|
|
1
|
+
import { M as readForgeEnv, j as forgeEnv, t as assertNoGitHubRepositoryKey } from "./shared-CaAKcBBr.js";
|
|
2
2
|
import { a as workspaceConflictError, o as workspaceError, t as assertWorkspaceDigest } from "./internal/path.js";
|
|
3
3
|
import { createGitHubWorkspaceStore } from "./providers/github/store.js";
|
|
4
4
|
import { t as getWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
@@ -8,7 +8,7 @@ import { a as isExcludedWorkspacePath, d as resolveInside, f as sha256, l as nor
|
|
|
8
8
|
import { a as provideWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
9
9
|
import { a as replacementRecoveryError, i as replaceStorePath } from "./replacement-CVZVsflC.js";
|
|
10
10
|
import { r as vitehubOwnedPrefix, t as createMemoryWorkspaceStore } from "./memory-BCZl_ZsJ.js";
|
|
11
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
11
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
12
12
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
13
13
|
import { createHash, randomUUID } from "node:crypto";
|
|
14
14
|
import { constants, createReadStream, createWriteStream, readFileSync, readlinkSync } from "node:fs";
|
|
@@ -574,7 +574,6 @@ async function withWorkspacePathLock(root, path, operation, readOnly = false, he
|
|
|
574
574
|
function isGitMetadataName(name) {
|
|
575
575
|
return name === ".git" || process.platform === "win32" && name.toLowerCase() === ".git";
|
|
576
576
|
}
|
|
577
|
-
/** Check whether a path belongs to a Git worktree before classifying Git errors. */
|
|
578
577
|
async function hasGitMetadata(root) {
|
|
579
578
|
let current = resolve(root);
|
|
580
579
|
while (true) {
|
|
@@ -587,7 +586,6 @@ async function hasGitMetadata(root) {
|
|
|
587
586
|
current = parent;
|
|
588
587
|
}
|
|
589
588
|
}
|
|
590
|
-
/** Paths that Git ignores under a checkout root. Ignored directories are listed once, not descended. */
|
|
591
589
|
async function gitIgnoredWorkspacePaths(root) {
|
|
592
590
|
const { execFile } = await import("node:child_process");
|
|
593
591
|
const gitMetadata = await hasGitMetadata(root);
|
|
@@ -622,7 +620,6 @@ async function gitIgnoredWorkspacePaths(root) {
|
|
|
622
620
|
resolveOutput(stdout);
|
|
623
621
|
}))).split("\0").filter(Boolean).map((path) => path.replace(/\/$/, ""))];
|
|
624
622
|
}
|
|
625
|
-
/** Include ignore rules from Git roots that contain a non-root listing prefix. */
|
|
626
623
|
async function gitIgnoredWorkspacePathsForPrefix(root, current, excluded) {
|
|
627
624
|
const { relative, sep } = await import("node:path");
|
|
628
625
|
const relativePrefix = relative(root, current);
|
|
@@ -692,11 +689,6 @@ async function prepareProcessMetadataRoot(root) {
|
|
|
692
689
|
}
|
|
693
690
|
await prepared;
|
|
694
691
|
}
|
|
695
|
-
/**
|
|
696
|
-
* Keeps the lock order of withWorkspacePathLock in memory: shared reads on
|
|
697
|
-
* each parent path and an exclusive lock on the target path for a write. Use
|
|
698
|
-
* it only for a store root that one process owns.
|
|
699
|
-
*/
|
|
700
692
|
async function withProcessPathLock(root, path, operation, readOnly = false) {
|
|
701
693
|
const parts = normalizeWorkspacePath(path).split("/").filter(Boolean);
|
|
702
694
|
const paths = parts.map((_, index) => parts.slice(0, index + 1).join("/"));
|
|
@@ -1602,7 +1594,6 @@ const workspaceStoreDrivers = /* @__PURE__ */ new Set([
|
|
|
1602
1594
|
"memory",
|
|
1603
1595
|
"vercel"
|
|
1604
1596
|
]);
|
|
1605
|
-
/** Driver names that ViteHub renamed to the host name. `npx @vite-hub/codemods driver-key` moves them. */
|
|
1606
1597
|
const renamedWorkspaceStoreDrivers = /* @__PURE__ */ new Map([["cloudflare-artifacts", "cloudflare"], ["vercel-blob", "vercel"]]);
|
|
1607
1598
|
function normalizeWorkspaceStoreOptions(store, input = {}) {
|
|
1608
1599
|
if (isWorkspaceStore(store)) return;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as workspaceConflict, n as isWorkspaceConflict, normalizeSafeWorkspacePath, o as workspaceError, t as assertWorkspaceDigest } from "../../internal/path.js";
|
|
2
2
|
import { t as createWorkspaceGlobMatcher } from "../../glob-BIg9O4yY.js";
|
|
3
3
|
import { a as isExcludedWorkspacePath, c as normalizeSafeWorkspacePattern, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, r as contentToBytes } from "../../path-DYHw5KNk.js";
|
|
4
|
-
import { d as normalizeHistoryPath, f as normalizeHistoryRef, m as rejectHistoryHead, n as createSnapshotFromEntries, p as readHistoryDeleteRef, r as diffSnapshots, u as historyConflict } from "../../utils-
|
|
4
|
+
import { d as normalizeHistoryPath, f as normalizeHistoryRef, m as rejectHistoryHead, n as createSnapshotFromEntries, p as readHistoryDeleteRef, r as diffSnapshots, u as historyConflict } from "../../utils-BoFJcaT1.js";
|
|
5
5
|
import { t as workspaceStoreDiscard } from "../../discard-BkoLmmmN.js";
|
|
6
6
|
import { a as provideWorkspaceStoreTarget, n as provideWorkspaceRevisionMaterializer } from "../../vitehub-grants-Co713QTg.js";
|
|
7
7
|
import { i as replaceStorePath } from "../../replacement-CVZVsflC.js";
|
|
8
|
-
import { C as githubKVKey, D as writeWorkspaceKV, O as BoundedMap, S as resolveGitHubRootOption, T as readWorkspaceKV, _ as requireGitHubOption, a as gitFileMode, b as resolveGitHubRefsOption, c as githubRequestStatus, d as preloadGitHubFiles, f as readCurrentHead, g as readGitHubFile, i as gitBlobSha, l as joinGitPath, m as readGitHubBranchState, n as commitGitHubChanges, o as githubBranchMovedConflict, p as readGitHubArchive, r as connectGitHubRepository, s as githubRequest, t as assertNoGitHubRepositoryKey, u as loadForge, v as resolveGitHubBranchOption, x as resolveGitHubRepositoryOption, y as resolveGitHubCredential } from "../../shared-
|
|
9
|
-
import { t as workspaceErrorDiagnostics } from "../../error-diagnostics-
|
|
8
|
+
import { C as githubKVKey, D as writeWorkspaceKV, O as BoundedMap, S as resolveGitHubRootOption, T as readWorkspaceKV, _ as requireGitHubOption, a as gitFileMode, b as resolveGitHubRefsOption, c as githubRequestStatus, d as preloadGitHubFiles, f as readCurrentHead, g as readGitHubFile, i as gitBlobSha, l as joinGitPath, m as readGitHubBranchState, n as commitGitHubChanges, o as githubBranchMovedConflict, p as readGitHubArchive, r as connectGitHubRepository, s as githubRequest, t as assertNoGitHubRepositoryKey, u as loadForge, v as resolveGitHubBranchOption, x as resolveGitHubRepositoryOption, y as resolveGitHubCredential } from "../../shared-CaAKcBBr.js";
|
|
9
|
+
import { t as workspaceErrorDiagnostics } from "../../error-diagnostics-Dn4sQcKL.js";
|
|
10
10
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
11
11
|
import { lookup } from "mrmime";
|
|
12
12
|
import { posix } from "node:path";
|
|
@@ -153,7 +153,6 @@ const reservedTrailerPattern = /^Vitehub-Metadata:/m;
|
|
|
153
153
|
/** The most bytes of commit metadata as JSON, and of a commit message, that the Store writes. */
|
|
154
154
|
const githubMaxMetadataBytes = 65536;
|
|
155
155
|
const githubMaxMessageBytes = 16384;
|
|
156
|
-
/** Paths per GitHub file history request. */
|
|
157
156
|
const lastChangedBatch = 100;
|
|
158
157
|
const lastChangedHistoryLimit = 100;
|
|
159
158
|
const pathHistory = v.object({ nodes: v.array(v.object({
|
|
@@ -177,10 +176,6 @@ function isNoHistoryError(error) {
|
|
|
177
176
|
const status = githubRequestStatus(error);
|
|
178
177
|
return status === 404 || status === 409;
|
|
179
178
|
}
|
|
180
|
-
/**
|
|
181
|
-
* GitHub answers a compare of two commits without a merge base with 404 "No common ancestor between <base> and <head>."
|
|
182
|
-
* Any other failure, such as a 422 "Validation failed, or the endpoint has been spammed", proves nothing.
|
|
183
|
-
*/
|
|
184
179
|
function isUnrelatedHistoryError(error) {
|
|
185
180
|
for (let current = error; current instanceof Error; current = current.cause) {
|
|
186
181
|
const body = Reflect.get(current, "body");
|
|
@@ -188,10 +183,6 @@ function isUnrelatedHistoryError(error) {
|
|
|
188
183
|
}
|
|
189
184
|
return false;
|
|
190
185
|
}
|
|
191
|
-
/**
|
|
192
|
-
* GitHub answers a lookup of a commit that the repository does not have with 422 "No commit found for SHA: <sha>." Any
|
|
193
|
-
* other failure, such as a 422 "Validation failed, or the endpoint has been spammed", proves nothing.
|
|
194
|
-
*/
|
|
195
186
|
function isMissingCommitError(error) {
|
|
196
187
|
const status = githubRequestStatus(error);
|
|
197
188
|
if (status !== 404 && status !== 422) return false;
|
|
@@ -212,7 +203,6 @@ function pageFromCursor(ref, cursor) {
|
|
|
212
203
|
if (cursorRef !== ref || !Number.isSafeInteger(page) || page < 1) throw workspaceErrorDiagnostics.WORKSPACE_R0070({ message: `[vitehub] History cursor does not belong to ref "${ref}".` });
|
|
213
204
|
return page;
|
|
214
205
|
}
|
|
215
|
-
/** The page number of the next GitHub page, from the Forge cursor. */
|
|
216
206
|
function nextPage(nextUrl) {
|
|
217
207
|
if (!nextUrl) return void 0;
|
|
218
208
|
const page = Number(new URL(nextUrl).searchParams.get("page"));
|
|
@@ -228,7 +218,6 @@ function entryMetadata(entry) {
|
|
|
228
218
|
function mediaType(path) {
|
|
229
219
|
return lookup(path) || "application/octet-stream";
|
|
230
220
|
}
|
|
231
|
-
/** The message of a commit without its metadata trailer, and the metadata that the trailer holds. */
|
|
232
221
|
function readCommitMessage(message) {
|
|
233
222
|
if (!message) return {};
|
|
234
223
|
const match = metadataTrailerPattern.exec(message);
|
|
@@ -248,10 +237,6 @@ function readCommitMessage(message) {
|
|
|
248
237
|
metadata
|
|
249
238
|
};
|
|
250
239
|
}
|
|
251
|
-
/**
|
|
252
|
-
* The Git author of a history commit: `metadata.author` with a `name` and an `email`, as Content and the
|
|
253
|
-
* `workspace.commit` operation record the signed-in user. Without both, the account of the token is the author.
|
|
254
|
-
*/
|
|
255
240
|
function commitAuthor(metadata) {
|
|
256
241
|
const author = metadata?.author;
|
|
257
242
|
if (!author || typeof author !== "object") return void 0;
|
|
@@ -273,7 +258,6 @@ function messageWithMetadata(message, metadata) {
|
|
|
273
258
|
limit("metadata", new TextEncoder().encode(json).byteLength, githubMaxMetadataBytes);
|
|
274
259
|
return `${message}\n\n${metadataTrailer}${json}`;
|
|
275
260
|
}
|
|
276
|
-
/** A revision from its commit. Without `entries`, the revision leaves out `files` and `bytes`. */
|
|
277
261
|
function publicRevision(commit, ref, entries, url, suppliedMetadata) {
|
|
278
262
|
const stored = readCommitMessage(commit.message);
|
|
279
263
|
suppliedMetadata ??= stored.metadata;
|
|
@@ -1393,10 +1377,6 @@ var GitHubWorkspaceStore = class {
|
|
|
1393
1377
|
provideWorkspaceStoreTarget(this, () => this.#storeTarget());
|
|
1394
1378
|
provideWorkspaceRevisionMaterializer(this, this.#revisionMaterializer);
|
|
1395
1379
|
}
|
|
1396
|
-
/**
|
|
1397
|
-
* The repository, branch, root, and token resolve on first use. The Store is created when the Workspace Definition
|
|
1398
|
-
* loads, even in a build that has no token, and a missing option fails at the first request.
|
|
1399
|
-
*/
|
|
1400
1380
|
get #connection() {
|
|
1401
1381
|
return this.#resolved ||= (() => {
|
|
1402
1382
|
const repository = requireGitHubOption("a repository", resolveGitHubRepositoryOption(this.options));
|
|
@@ -1429,7 +1409,6 @@ var GitHubWorkspaceStore = class {
|
|
|
1429
1409
|
root: this.#root
|
|
1430
1410
|
}));
|
|
1431
1411
|
}
|
|
1432
|
-
/** Drops the staged writes. The next call loads the branch again, as the first call does. */
|
|
1433
1412
|
async [workspaceStoreDiscard]() {
|
|
1434
1413
|
await this.#mutate(async () => {
|
|
1435
1414
|
this.#dirty = false;
|
|
@@ -1628,7 +1607,6 @@ var GitHubWorkspaceStore = class {
|
|
|
1628
1607
|
await this.#rebase(options);
|
|
1629
1608
|
});
|
|
1630
1609
|
}
|
|
1631
|
-
/** Move the staged writes onto the current branch head. A path that changed on both sides fails with its name in `details.paths`. */
|
|
1632
1610
|
async #rebase(options, loaded) {
|
|
1633
1611
|
const remote = loaded ?? await readGitHubBranchState({
|
|
1634
1612
|
branch: this.#branch,
|
|
@@ -1692,11 +1670,6 @@ var GitHubWorkspaceStore = class {
|
|
|
1692
1670
|
}
|
|
1693
1671
|
this.#dirty = await this.#hasRemoteChanges();
|
|
1694
1672
|
}
|
|
1695
|
-
/**
|
|
1696
|
-
* Commit the staged writes. When the branch moved since the Store loaded, for example because another isolate
|
|
1697
|
-
* committed, the Store moves the staged writes onto the new head and commits once more. A path that changed on
|
|
1698
|
-
* both sides, or a second move, fails with `WORKSPACE_CONFLICT`.
|
|
1699
|
-
*/
|
|
1700
1673
|
async #snapshot(options, retry = true) {
|
|
1701
1674
|
await this.#ensure({ refresh: "expired" });
|
|
1702
1675
|
const snapshot = await createSnapshotFromEntries(await this.#listEntries("", { recursive: true }), options.name);
|
|
@@ -1825,11 +1798,6 @@ var GitHubWorkspaceStore = class {
|
|
|
1825
1798
|
this.#dirty = true;
|
|
1826
1799
|
});
|
|
1827
1800
|
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Load the branch once. Without staged writes, `refresh: true` reads the head again, and `"expired"` reads it again
|
|
1830
|
-
* when the Store loaded it more than `githubHeadCacheMs` ago. A Store that one isolate keeps for many requests so
|
|
1831
|
-
* sees commits from other writers before it stages new writes.
|
|
1832
|
-
*/
|
|
1833
1801
|
async #ensure(options) {
|
|
1834
1802
|
const wasReady = !!this.#ready;
|
|
1835
1803
|
this.#ready ||= this.#load().catch((error) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as workspaceNotFoundError } from "./internal/path.js";
|
|
2
|
-
import { t as createWorkspace } from "./workspace-
|
|
2
|
+
import { t as createWorkspace } from "./workspace-Dbo5iYIc.js";
|
|
3
3
|
import { setWorkspaceRuntimeRegistry, workspaceRuntimeRegistryState } from "./runtime/registry.js";
|
|
4
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.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");
|
|
@@ -5,7 +5,6 @@ import { registerRunScope } from "@vite-hub/runtime/internal/run-scope";
|
|
|
5
5
|
const runtimeGlobal = globalThis;
|
|
6
6
|
const storageKey = Symbol.for("vitehub.workspace.request");
|
|
7
7
|
const writersKey = Symbol.for("vitehub.workspace.writers");
|
|
8
|
-
/** Writes made outside a request and a run, such as at startup, which no request may drop. */
|
|
9
8
|
const outsideRequest = { staged: /* @__PURE__ */ new Set() };
|
|
10
9
|
function requestStorage() {
|
|
11
10
|
const existing = runtimeGlobal[storageKey];
|
|
@@ -16,7 +15,6 @@ function requestStorage() {
|
|
|
16
15
|
runtimeGlobal[storageKey] = storage;
|
|
17
16
|
return storage;
|
|
18
17
|
}
|
|
19
|
-
/** The requests that staged writes in each Store since its last snapshot. */
|
|
20
18
|
function writers() {
|
|
21
19
|
return runtimeGlobal[writersKey] ??= /* @__PURE__ */ new WeakMap();
|
|
22
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
2
2
|
// src/core/rule-keys.ts
|
|
3
3
|
/** The rule fields that a more specific rule replaces only when it sets them. */
|
|
4
4
|
const cascadingRuleKeys = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as workspaceError } from "./internal/path.js";
|
|
2
2
|
import { l as normalizeWorkspacePath, r as contentToBytes } from "./path-DYHw5KNk.js";
|
|
3
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
-
import { n as cascadingRuleKeys, t as assertWorkspaceRules } from "./rule-keys-
|
|
3
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
4
|
+
import { n as cascadingRuleKeys, t as assertWorkspaceRules } from "./rule-keys-DQYcSewo.js";
|
|
5
5
|
import { lookup } from "mrmime";
|
|
6
6
|
import { minimatch } from "minimatch";
|
|
7
7
|
// src/core/plugins.ts
|
|
@@ -68,7 +68,6 @@ function mergeHooks(left = {}, right = {}) {
|
|
|
68
68
|
"write:validate": [...toArray(left["write:validate"]), ...toArray(right["write:validate"])]
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
/** Merges rules on the same pattern field by field. A later rule replaces only the fields it sets, and validators add up. */
|
|
72
71
|
function mergeRules(left, right = {}) {
|
|
73
72
|
assertWorkspaceRules(right);
|
|
74
73
|
const merged = { ...left };
|
|
@@ -117,11 +116,6 @@ function normalizePolicy(definition) {
|
|
|
117
116
|
rules: normalizeRules(rules)
|
|
118
117
|
};
|
|
119
118
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Resolves every rule that matches the path, from the least to the most specific. A more specific rule replaces a
|
|
122
|
-
* field only when it sets that field, so `"docs/**": { maxBytes }` keeps a broader `write: false`. Validators of every
|
|
123
|
-
* matching rule run, the least specific first.
|
|
124
|
-
*/
|
|
125
119
|
function matchRule(policy, path) {
|
|
126
120
|
const normalized = normalizeWorkspacePath(path);
|
|
127
121
|
let matched;
|
|
@@ -156,7 +150,6 @@ function writeAllowed(write, operation, exists) {
|
|
|
156
150
|
function sizeOf(content) {
|
|
157
151
|
return content === void 0 ? 0 : contentToBytes(content).byteLength;
|
|
158
152
|
}
|
|
159
|
-
/** The media type that a file write stores: the one the caller passed, else the one its path implies. */
|
|
160
153
|
function writeMediaType(input) {
|
|
161
154
|
return input.mediaType || lookup(input.path) || "application/octet-stream";
|
|
162
155
|
}
|
|
@@ -172,7 +165,6 @@ function assertRuleAllows(input, matched) {
|
|
|
172
165
|
if (!allowed.includes(mediaType)) throw workspaceError(`[vitehub] Workspace rule "${origins.mediaType}" does not allow media type ${mediaType}: ${input.path}.`);
|
|
173
166
|
}
|
|
174
167
|
}
|
|
175
|
-
/** Stores the media type that the rule checked, so the stored file cannot get another type from the Store. */
|
|
176
168
|
function withCheckedMediaType(input, matched) {
|
|
177
169
|
if (!matched?.rule.mediaType || input.operation !== "writeFile" || input.mediaType) return input;
|
|
178
170
|
return {
|
package/dist/runtime/request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runWorkspaceRequest } from "../request-scope-
|
|
1
|
+
import { t as runWorkspaceRequest } from "../request-scope-DZJbe-tP.js";
|
|
2
2
|
// src/runtime/request.ts
|
|
3
3
|
/** Nitro middleware: runs the rest of the request in its own Workspace request scope. */
|
|
4
4
|
function workspaceRequestMiddleware(_event, next) {
|
package/dist/runtime/state.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as setWorkspaceRegistry, i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "../registry-
|
|
1
|
+
import { a as setWorkspaceRegistry, i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "../registry-CqDWpDe9.js";
|
|
2
2
|
import { t as setWorkspaceAssetsRegistry } from "../asset-registry-DJyE42kr.js";
|
|
3
|
-
import { n as invalidateCachedWorkspaceStore, r as resetWorkspaceStoreCache } from "../workspace-
|
|
4
|
-
import { A as setActiveCloudflareEnv } from "../shared-
|
|
5
|
-
import { t as useWorkspace } from "../use-tools-
|
|
6
|
-
import { r as useWorkspaceFiles } from "../use-
|
|
7
|
-
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "../provider-
|
|
3
|
+
import { n as invalidateCachedWorkspaceStore, r as resetWorkspaceStoreCache } from "../workspace-Dbo5iYIc.js";
|
|
4
|
+
import { A as setActiveCloudflareEnv } from "../shared-CaAKcBBr.js";
|
|
5
|
+
import { t as useWorkspace } from "../use-tools-D_eorKu1.js";
|
|
6
|
+
import { r as useWorkspaceFiles } from "../use-BskfWVjx.js";
|
|
7
|
+
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "../provider-DBJeUNFI.js";
|
|
8
8
|
import { n as setWorkspaceRuntimeConfig, t as getWorkspaceRuntimeConfig } from "../config-CsgNNVAI.js";
|
|
9
9
|
// src/runtime/state.ts
|
|
10
10
|
async function invalidateWorkspaceStore(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createWorkspace } from "../workspace-
|
|
1
|
+
export { t as createWorkspace } from "../workspace-Dbo5iYIc.js";
|
package/dist/runtime.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { n as setWorkspaceRuntimeConfig, t as getWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
2
|
-
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "./provider-
|
|
3
|
-
import { i as setWorkspaceDependencyRuntimeLoaders, n as createWorkspaceTools, r as getWorkspaceDependencyRuntimeLoaders, t as useWorkspace } from "./use-tools-
|
|
2
|
+
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "./provider-DBJeUNFI.js";
|
|
3
|
+
import { i as setWorkspaceDependencyRuntimeLoaders, n as createWorkspaceTools, r as getWorkspaceDependencyRuntimeLoaders, t as useWorkspace } from "./use-tools-D_eorKu1.js";
|
|
4
4
|
import { invalidateWorkspaceStore, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeRegistry } from "./runtime/state.js";
|
|
5
|
-
import { _ as isWorkspaceSourceRequestOnly, a as normalizeWorkspaceSources, b as markLiveWorkspaceSource, f as prepareWorkspaceSource, h as getWorkspaceSourceRequestDescriptor, i as normalizeWorkspaceSourceMetadata, l as workspaceSourceGrantPaths, o as normalizeWorkspaceSourcesMetadata, r as normalizeWorkspaceSource, t as copyWorkspaceSourceMetadata, u as ownSourceOption, v as workspaceSourceRequestDescriptorPath } from "./config-
|
|
5
|
+
import { _ as isWorkspaceSourceRequestOnly, a as normalizeWorkspaceSources, b as markLiveWorkspaceSource, f as prepareWorkspaceSource, h as getWorkspaceSourceRequestDescriptor, i as normalizeWorkspaceSourceMetadata, l as workspaceSourceGrantPaths, o as normalizeWorkspaceSourcesMetadata, r as normalizeWorkspaceSource, t as copyWorkspaceSourceMetadata, u as ownSourceOption, v as workspaceSourceRequestDescriptorPath } from "./config-B-S_Z4G0.js";
|
|
6
6
|
import { o as workspaceError } from "./internal/path.js";
|
|
7
7
|
import { l as normalizeWorkspacePath, u as readStoredFile } from "./path-DYHw5KNk.js";
|
|
8
|
-
import { a as createWorkspaceHistoryReader, c as forwardWorkspaceHistoryFiles, i as createWorkspaceHistory, l as forwardWorkspaceHistoryMerge } from "./utils-
|
|
9
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
10
|
-
import { r as registerWorkspacePlugin, t as createWorkspaceWritePolicy } from "./rules-
|
|
11
|
-
import { _ as attachWorkspaceSourceRequestExecution, a as isInternalWorkspaceMetaKey, b as workspaceSourceRequestMatches, c as isWorkspaceSourceSyncMetaKey, g as copyWorkspacePath, h as appendWorkspaceFile, m as appendCondition, o as createWorkspaceSourceView, p as resolveWorkspacePath, r as resetWorkspaceStoreCache, v as createWorkspaceSourceRequestExecution, x as createBasicWorkspaceSession, y as getWorkspaceSourceRequestExecution } from "./workspace-
|
|
8
|
+
import { a as createWorkspaceHistoryReader, c as forwardWorkspaceHistoryFiles, i as createWorkspaceHistory, l as forwardWorkspaceHistoryMerge } from "./utils-BoFJcaT1.js";
|
|
9
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
10
|
+
import { r as registerWorkspacePlugin, t as createWorkspaceWritePolicy } from "./rules-sItt6TP-.js";
|
|
11
|
+
import { _ as attachWorkspaceSourceRequestExecution, a as isInternalWorkspaceMetaKey, b as workspaceSourceRequestMatches, c as isWorkspaceSourceSyncMetaKey, g as copyWorkspacePath, h as appendWorkspaceFile, m as appendCondition, o as createWorkspaceSourceView, p as resolveWorkspacePath, r as resetWorkspaceStoreCache, v as createWorkspaceSourceRequestExecution, x as createBasicWorkspaceSession, y as getWorkspaceSourceRequestExecution } from "./workspace-Dbo5iYIc.js";
|
|
12
12
|
import { t as createMemoryWorkspaceStore } from "./memory-BCZl_ZsJ.js";
|
|
13
|
-
import { M as registerWorkspaceStoreAlias, a as resolveWorkspaceMetadataMutationTarget, i as forwardWorkspaceMetadataView, n as createWorkspaceMetadataTarget, o as resolveWorkspaceMetadataTarget, r as forwardWorkspaceMetadataTarget, s as setWorkspaceMetadata, t as attachWorkspaceMetadataTarget } from "./metadata-target-
|
|
13
|
+
import { M as registerWorkspaceStoreAlias, a as resolveWorkspaceMetadataMutationTarget, i as forwardWorkspaceMetadataView, n as createWorkspaceMetadataTarget, o as resolveWorkspaceMetadataTarget, r as forwardWorkspaceMetadataTarget, s as setWorkspaceMetadata, t as attachWorkspaceMetadataTarget } from "./metadata-target-oc00D8g2.js";
|
|
14
14
|
import { a as provideWorkspaceStoreTarget, i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
15
15
|
import { n as getWorkspaceReplacement, r as prepareWorkspaceReplacement, t as attachWorkspaceReplacement } from "./replacement-CVZVsflC.js";
|
|
16
16
|
import { n as isRecord } from "./object-DNOrQSl5.js";
|
|
17
|
-
import { i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "./registry-
|
|
18
|
-
import { r as useWorkspaceFiles } from "./use-
|
|
17
|
+
import { i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "./registry-CqDWpDe9.js";
|
|
18
|
+
import { r as useWorkspaceFiles } from "./use-BskfWVjx.js";
|
|
19
19
|
import { join, resolve } from "node:path";
|
|
20
20
|
import { randomUUID } from "node:crypto";
|
|
21
21
|
import { lstat, readdir, rename, rm } from "node:fs/promises";
|
|
@@ -288,7 +288,7 @@ function createWritableFacadeStore(workspace, sourceSync) {
|
|
|
288
288
|
async function startOverlayWorkspaceSession(_definition, workspace, options) {
|
|
289
289
|
const host = options?.host;
|
|
290
290
|
if (host) {
|
|
291
|
-
const { createHostedWorkspaceSession } = await import("./host-
|
|
291
|
+
const { createHostedWorkspaceSession } = await import("./host-CcCDXyJI.js").then((n) => n.n);
|
|
292
292
|
return await createHostedWorkspaceSession(workspace, {
|
|
293
293
|
...options,
|
|
294
294
|
host
|
|
@@ -554,7 +554,7 @@ async function createWorkspaceSourceResolutionFacade(workspace, definition, opti
|
|
|
554
554
|
},
|
|
555
555
|
stat: writeFs.stat,
|
|
556
556
|
sync: async (options) => {
|
|
557
|
-
const { syncWorkspaceSources } = await import("./sync-
|
|
557
|
+
const { syncWorkspaceSources } = await import("./sync-ztyvA0Va.js");
|
|
558
558
|
return await syncWorkspaceSources(resolvedDefinition, syncStore, options);
|
|
559
559
|
},
|
|
560
560
|
writeFile: writeFs.writeFile
|
package/dist/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as matchesAny } from "./path-DYHw5KNk.js";
|
|
2
2
|
import { normalizeSafeWorkspacePath } from "./internal/path.js";
|
|
3
|
-
import { i as workspaceDefinitionPlugins, n as resolveWorkspaceAutoCommit } from "./rules-
|
|
4
|
-
import { r as useWorkspaceFiles } from "./use-
|
|
5
|
-
import { r as withWorkspaceProgress } from "./host-
|
|
6
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
3
|
+
import { i as workspaceDefinitionPlugins, n as resolveWorkspaceAutoCommit } from "./rules-sItt6TP-.js";
|
|
4
|
+
import { r as useWorkspaceFiles } from "./use-BskfWVjx.js";
|
|
5
|
+
import { r as withWorkspaceProgress } from "./host-CcCDXyJI.js";
|
|
6
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
7
7
|
import { getViteHubErrorShape } from "@vite-hub/runtime";
|
|
8
8
|
import { lookup } from "mrmime";
|
|
9
9
|
// ../internal/src/secret.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as abortable } from "./abort-CQGxJBqa.js";
|
|
2
2
|
import { t as internalErrorDiagnostics } from "./error-diagnostics-CsiNo_oI.js";
|
|
3
3
|
import { i as workspaceConflict, normalizeSafeWorkspacePath, o as workspaceError } from "./internal/path.js";
|
|
4
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
5
5
|
import { l as normalizeWorkspacePath } from "./path-DYHw5KNk.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { gunzipSync } from "node:zlib";
|
|
@@ -168,10 +168,6 @@ function getActiveCloudflareEnv() {
|
|
|
168
168
|
const runtimeGlobal = globalThis;
|
|
169
169
|
const activeEnvStorage = runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
|
|
170
170
|
const globalEnvProbe = Symbol("vitehub.cloudflare.global-env-probe");
|
|
171
|
-
/**
|
|
172
|
-
* Under the Nitro Cloudflare dev server, `cloudflare:workers` exports unenv's env proxy, which reads every key from
|
|
173
|
-
* `globalThis.__env__`. Storing that proxy in `__env__` makes it read itself, and the next read overflows the stack.
|
|
174
|
-
*/
|
|
175
171
|
function readsGlobalEnv(env) {
|
|
176
172
|
const scope = globalThis;
|
|
177
173
|
const owned = Object.hasOwn(scope, "__env__");
|
|
@@ -223,7 +219,6 @@ var BoundedMap = class extends Map {
|
|
|
223
219
|
}
|
|
224
220
|
};
|
|
225
221
|
// src/providers/github/cache.ts
|
|
226
|
-
/** How long a kept answer stays in KV, in seconds. A commit that nobody reads for a week leaves KV. */
|
|
227
222
|
const kvTTL = 604800;
|
|
228
223
|
const stats = {
|
|
229
224
|
requests: 0,
|
|
@@ -245,7 +240,6 @@ const keptHeaders = [
|
|
|
245
240
|
"etag",
|
|
246
241
|
"link"
|
|
247
242
|
];
|
|
248
|
-
/** The largest answer that goes to KV. Cloudflare KV takes up to 25 MiB a value. */
|
|
249
243
|
const maxStoredBytes = 16777216;
|
|
250
244
|
const sha = "[0-9a-f]{40}";
|
|
251
245
|
const immutablePaths = [
|
|
@@ -373,7 +367,6 @@ async function fetchGitHubRead(memory, input, init, send) {
|
|
|
373
367
|
}
|
|
374
368
|
return response;
|
|
375
369
|
}
|
|
376
|
-
/** Keep an immutable answer in memory, the least recently used out first. */
|
|
377
370
|
function remember(memory, id, stored) {
|
|
378
371
|
if (stored.body.length > maxMemoryBytes / 4 || memory.immutable.has(id)) return;
|
|
379
372
|
memory.immutable.set(id, stored);
|
|
@@ -405,7 +398,6 @@ function text(bytes) {
|
|
|
405
398
|
const end = bytes.indexOf(0);
|
|
406
399
|
return decoder.decode(end === -1 ? bytes : bytes.subarray(0, end));
|
|
407
400
|
}
|
|
408
|
-
/** The `path` record of a PAX header, which GitHub writes for paths longer than the ustar fields. */
|
|
409
401
|
function paxPath(content) {
|
|
410
402
|
let index = 0;
|
|
411
403
|
while (index < content.length) {
|
|
@@ -598,7 +590,6 @@ function resolveGitHubOption(value) {
|
|
|
598
590
|
function isMaskedGitHubTokenOption(value) {
|
|
599
591
|
return value === "********" || value === "<redacted>" || value === "[redacted]";
|
|
600
592
|
}
|
|
601
|
-
/** The first location value that is set, from the active Cloudflare bindings and then from `env`. */
|
|
602
593
|
function readLocationEnv(name, env) {
|
|
603
594
|
const binding = getActiveCloudflareBinding(name);
|
|
604
595
|
if (typeof binding === "string" && binding.trim()) return binding.trim();
|
|
@@ -712,7 +703,6 @@ const githubBlobReads = /* @__PURE__ */ new Map();
|
|
|
712
703
|
const githubBlobByteLimit = 33554432;
|
|
713
704
|
const githubBlobFileLimit = 4194304;
|
|
714
705
|
let githubBlobBytes = 0;
|
|
715
|
-
/** Keep the bytes of a blob, the oldest out first. Different request scopes can finish the same blob; it counts once. */
|
|
716
706
|
function rememberGitHubBlob(sha, bytes) {
|
|
717
707
|
if (bytes.byteLength > githubBlobFileLimit || githubBlobs.has(sha)) return;
|
|
718
708
|
for (const [oldestSha, oldest] of githubBlobs) {
|
|
@@ -745,7 +735,6 @@ async function readGitHubFile(repository, entry, ref, signal) {
|
|
|
745
735
|
}
|
|
746
736
|
return (await abortable(signal, "The GitHub read was aborted.", () => read)).slice();
|
|
747
737
|
}
|
|
748
|
-
/** The last archive that each repository connection read, by commit. */
|
|
749
738
|
const lastArchives = /* @__PURE__ */ new WeakMap();
|
|
750
739
|
/**
|
|
751
740
|
* The gzipped tarball of `ref`. The archive of a commit sha never changes, so the last one stays in memory and goes to
|
|
@@ -782,9 +771,7 @@ async function readGitHubArchive(repository, ref, signal) {
|
|
|
782
771
|
}
|
|
783
772
|
return (await abortable(signal, "The GitHub read was aborted.", () => read)).slice();
|
|
784
773
|
}
|
|
785
|
-
/** The largest archive that goes to KV, before base64. */
|
|
786
774
|
const maxArchiveKVBytes = 8388608;
|
|
787
|
-
/** Above this many blobs that are not in memory, one archive costs less than a request per blob. */
|
|
788
775
|
const archiveReadThreshold = 8;
|
|
789
776
|
/**
|
|
790
777
|
* Keep the bytes of many files of one commit in memory, so the next `readGitHubFile()` of each needs no request. Few
|
package/dist/source-metadata.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as readCurrentSourceSnapshot, o as resolveWorkspaceMetadataTarget } from "./metadata-target-
|
|
2
|
-
import { t as assertWorkspaceRules } from "./rule-keys-
|
|
3
|
-
import { i as normalizeWorkspaceSourceMetadata, l as workspaceSourceGrantPaths, o as normalizeWorkspaceSourcesMetadata } from "./config-
|
|
1
|
+
import { m as readCurrentSourceSnapshot, o as resolveWorkspaceMetadataTarget } from "./metadata-target-oc00D8g2.js";
|
|
2
|
+
import { t as assertWorkspaceRules } from "./rule-keys-DQYcSewo.js";
|
|
3
|
+
import { i as normalizeWorkspaceSourceMetadata, l as workspaceSourceGrantPaths, o as normalizeWorkspaceSourcesMetadata } from "./config-B-S_Z4G0.js";
|
|
4
4
|
// src/source-metadata.ts
|
|
5
5
|
async function listMaterializedWorkspaceEntries(workspace) {
|
|
6
6
|
return await (await resolveWorkspaceMetadataTarget(workspace))?.list?.("", { recursive: true });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as workspaceError } from "./internal/path.js";
|
|
2
2
|
import { f as sha256, n as contentStreamToBytes } from "./path-DYHw5KNk.js";
|
|
3
|
-
import { a as normalizeWorkspaceSources, f as prepareWorkspaceSource, n as createSourceContext, s as sourceMountContainsPath } from "./config-
|
|
4
|
-
import { C as withWorkspaceStoreMutation, E as normalizeSourceFileMetadata, S as sourceMountOwnsPath, T as normalizeMetadataValue, w as normalizeSourceItemPath, x as createWorkspaceSourceMountAuthority } from "./metadata-target-
|
|
5
|
-
import { d as sourceSyncPathClaims, f as workspaceSourceSyncStateEquals, l as readWorkspaceSourceSyncState, u as sourceSyncMetaKey } from "./workspace-
|
|
3
|
+
import { a as normalizeWorkspaceSources, f as prepareWorkspaceSource, n as createSourceContext, s as sourceMountContainsPath } from "./config-B-S_Z4G0.js";
|
|
4
|
+
import { C as withWorkspaceStoreMutation, E as normalizeSourceFileMetadata, S as sourceMountOwnsPath, T as normalizeMetadataValue, w as normalizeSourceItemPath, x as createWorkspaceSourceMountAuthority } from "./metadata-target-oc00D8g2.js";
|
|
5
|
+
import { d as sourceSyncPathClaims, f as workspaceSourceSyncStateEquals, l as readWorkspaceSourceSyncState, u as sourceSyncMetaKey } from "./workspace-Dbo5iYIc.js";
|
|
6
6
|
// src/sources/sync.ts
|
|
7
7
|
const sourceSyncLocks = /* @__PURE__ */ new Map();
|
|
8
8
|
const sourceSyncGrants = createWorkspaceSourceMountAuthority("Source Sync");
|
package/dist/test.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as registerWorkspace } from "./registry-
|
|
1
|
+
export { r as registerWorkspace } from "./registry-CqDWpDe9.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as useWorkspaceAssets } from "./asset-registry-DJyE42kr.js";
|
|
2
2
|
import { normalizeSafeWorkspacePath, o as workspaceError } from "./internal/path.js";
|
|
3
|
-
import { f as normalizeHistoryRef, g as validateHistoryMessage, h as requireWorkspaceHistory, m as rejectHistoryHead, s as deleteWorkspaceHistoryRef, u as historyConflict } from "./utils-
|
|
4
|
-
import { _ as attachWorkspaceSourceRequestExecution, g as copyWorkspacePath, h as appendWorkspaceFile, i as assertPublicWorkspaceMetaKey, t as createWorkspace, y as getWorkspaceSourceRequestExecution } from "./workspace-
|
|
3
|
+
import { f as normalizeHistoryRef, g as validateHistoryMessage, h as requireWorkspaceHistory, m as rejectHistoryHead, s as deleteWorkspaceHistoryRef, u as historyConflict } from "./utils-BoFJcaT1.js";
|
|
4
|
+
import { _ as attachWorkspaceSourceRequestExecution, g as copyWorkspacePath, h as appendWorkspaceFile, i as assertPublicWorkspaceMetaKey, t as createWorkspace, y as getWorkspaceSourceRequestExecution } from "./workspace-Dbo5iYIc.js";
|
|
5
5
|
import { c as normalizeSafeWorkspacePattern, f as sha256 } from "./path-DYHw5KNk.js";
|
|
6
|
-
import { s as useRegisteredWorkspace } from "./registry-
|
|
6
|
+
import { s as useRegisteredWorkspace } from "./registry-CqDWpDe9.js";
|
|
7
7
|
import { a as provideWorkspaceStoreTarget, i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
8
8
|
import { o as requireWorkspaceReplacement, t as attachWorkspaceReplacement } from "./replacement-CVZVsflC.js";
|
|
9
|
-
import { c as workspaceInternalMetadataCapability, o as resolveWorkspaceMetadataTarget, r as forwardWorkspaceMetadataTarget, t as attachWorkspaceMetadataTarget } from "./metadata-target-
|
|
10
|
-
import { t as createHostedWorkspaceSession } from "./host-
|
|
11
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
9
|
+
import { c as workspaceInternalMetadataCapability, o as resolveWorkspaceMetadataTarget, r as forwardWorkspaceMetadataTarget, t as attachWorkspaceMetadataTarget } from "./metadata-target-oc00D8g2.js";
|
|
10
|
+
import { t as createHostedWorkspaceSession } from "./host-CcCDXyJI.js";
|
|
11
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
12
12
|
import { getViteHubErrorShape } from "@vite-hub/runtime";
|
|
13
13
|
// src/core/use.ts
|
|
14
14
|
const workspaceDefinitionSyncStates = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeSafeWorkspacePath, o as workspaceError } from "./internal/path.js";
|
|
2
|
-
import { g as copyWorkspacePath, h as appendWorkspaceFile, y as getWorkspaceSourceRequestExecution } from "./workspace-
|
|
3
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
-
import { n as createWorkspaceFileRuntime, t as createReadonlyFs } from "./use-
|
|
2
|
+
import { g as copyWorkspacePath, h as appendWorkspaceFile, y as getWorkspaceSourceRequestExecution } from "./workspace-Dbo5iYIc.js";
|
|
3
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
4
|
+
import { n as createWorkspaceFileRuntime, t as createReadonlyFs } from "./use-BskfWVjx.js";
|
|
5
5
|
import { executionBudgetCharged, executionBudgetOverride, markExecutionBudgetHandled } from "@vite-hub/runtime/internal/execution-budget";
|
|
6
6
|
// src/runtime/dependency-loaders.ts
|
|
7
7
|
const shellWorkspaceSpecifier = "@vite-hub/shell/workspace";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
|
|
2
2
|
import { n as copyJsonFileMetadata, r as copyJsonWorkspaceMetadata } from "./file-metadata-Dqpldj0h.js";
|
|
3
3
|
import { i as workspaceConflict, normalizeSafeWorkspacePath, o as workspaceError } from "./internal/path.js";
|
|
4
4
|
import { f as sha256, o as isWorkspaceBytes, r as contentToBytes } from "./path-DYHw5KNk.js";
|
|
5
|
-
import { t as createWorkspaceWritePolicy } from "./rules-
|
|
5
|
+
import { t as createWorkspaceWritePolicy } from "./rules-sItt6TP-.js";
|
|
6
6
|
import { lookup } from "mrmime";
|
|
7
7
|
import { isRuntimeObject } from "@vite-hub/runtime/internal/runtime-type";
|
|
8
8
|
// src/core/history.ts
|
|
@@ -76,7 +76,6 @@ function createWorkspaceHistoryReader(history, complete) {
|
|
|
76
76
|
diff: async (options) => await diffWorkspaceRevisions(requireHistory(), options)
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
/** The files whose bytes or retained attributes changed from one revision to another. */
|
|
80
79
|
async function diffWorkspaceRevisions(history, options) {
|
|
81
80
|
const open = async (id) => {
|
|
82
81
|
const view = await history.open(id);
|