@vite-hub/workspace 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/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-dtcU5LkD.js → operations-CtRDU3cA.js} +14 -24
- package/dist/{operations-Cib30_dt.js → operations-DfbqHWAe.js} +7 -8
- 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 +2 -20
- package/dist/vite.js +559 -399
- 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,10 +1,10 @@
|
|
|
1
|
-
import { s as workspaceError } from "./path-
|
|
2
|
-
import { l as normalizeWorkspacePath, r as contentToBytes } from "./path-
|
|
3
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
-
import { n as cascadingRuleKeys, t as assertWorkspaceRules } from "./rule-keys-
|
|
1
|
+
import { s as workspaceError } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { l as normalizeWorkspacePath, r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
3
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
4
|
+
import { n as cascadingRuleKeys, t as assertWorkspaceRules } from "./rule-keys-BLEbi1h5.js";
|
|
5
5
|
import { lookup } from "mrmime";
|
|
6
6
|
import { minimatch } from "minimatch";
|
|
7
|
-
|
|
7
|
+
// src/core/plugins.ts
|
|
8
8
|
const contributedPluginsKey = Symbol.for("vitehub.workspace.contributedPlugins");
|
|
9
9
|
function contributedPluginState() {
|
|
10
10
|
const scope = globalThis;
|
|
@@ -47,8 +47,7 @@ function workspaceDefinitionPlugins(definition) {
|
|
|
47
47
|
const ids = new Set(own.map((plugin) => plugin?.id));
|
|
48
48
|
return [...own, ...[...contributed.values()].filter((plugin) => !ids.has(plugin.id))];
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
//#region src/core/rules.ts
|
|
50
|
+
// src/core/rules.ts
|
|
52
51
|
function normalizeMaxBytes(value) {
|
|
53
52
|
if (value === void 0) return void 0;
|
|
54
53
|
if (typeof value === "number") return value;
|
|
@@ -265,5 +264,4 @@ function resolveWorkspaceAutoCommit(definition, diff) {
|
|
|
265
264
|
paths
|
|
266
265
|
};
|
|
267
266
|
}
|
|
268
|
-
//#endregion
|
|
269
267
|
export { workspaceDefinitionPlugins as i, resolveWorkspaceAutoCommit as n, registerWorkspacePlugin as r, createWorkspaceWritePolicy as t };
|
package/dist/runtime/assets.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { O as WorkspaceAssets, P as WorkspaceContent } from "../types-
|
|
2
|
-
//#region src/runtime/assets.d.ts
|
|
1
|
+
import { O as WorkspaceAssets, P as WorkspaceContent } from "../types-Bel5IDmF.js";
|
|
3
2
|
interface WorkspaceAssetFile {
|
|
4
3
|
load: () => Promise<WorkspaceContent>;
|
|
5
4
|
mediaType?: string;
|
|
@@ -7,4 +6,4 @@ interface WorkspaceAssetFile {
|
|
|
7
6
|
}
|
|
8
7
|
type WorkspaceAssetFiles<TKey extends string = string> = Record<TKey, WorkspaceAssetFile>;
|
|
9
8
|
export declare function createWorkspaceAssets<TKey extends string = string>(files: WorkspaceAssetFiles<TKey>): WorkspaceAssets<TKey>;
|
|
10
|
-
|
|
9
|
+
export {};
|
package/dist/runtime/assets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as isWorkspaceError, s as workspaceError, t as normalizeSafeWorkspacePath } from "../path-
|
|
2
|
-
import { a as isExcludedWorkspacePath, d as sha256, i as decodeFile, l as normalizeWorkspacePath } from "../path-
|
|
3
|
-
import { t as createWorkspaceGlobMatcher } from "../glob-
|
|
4
|
-
import { t as searchText } from "../search-
|
|
5
|
-
|
|
1
|
+
import { i as isWorkspaceError, s as workspaceError, t as normalizeSafeWorkspacePath } from "../path-CuYE8-X6.js";
|
|
2
|
+
import { a as isExcludedWorkspacePath, d as sha256, i as decodeFile, l as normalizeWorkspacePath } from "../path-Bb9OIc_F.js";
|
|
3
|
+
import { t as createWorkspaceGlobMatcher } from "../glob-BreFjNAV.js";
|
|
4
|
+
import { t as searchText } from "../search-C_nVorq7.js";
|
|
5
|
+
// src/runtime/assets.ts
|
|
6
6
|
function createMissingPathError(path) {
|
|
7
7
|
return workspaceError(`[vitehub] Workspace file does not exist: ${path}.`);
|
|
8
8
|
}
|
|
@@ -137,5 +137,4 @@ function createWorkspaceAssets(files) {
|
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
//#endregion
|
|
141
140
|
export { createWorkspaceAssets };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { k as WorkspaceAssetsRegistry } from "../types-
|
|
2
|
-
//#region src/runtime/empty-assets-registry.d.ts
|
|
1
|
+
import { k as WorkspaceAssetsRegistry } from "../types-Bel5IDmF.js";
|
|
3
2
|
declare const registry: WorkspaceAssetsRegistry;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { registry as default };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { t as WorkspaceRegistry } from "../registry-
|
|
2
|
-
import "../registry-
|
|
3
|
-
//#region src/runtime/empty-registry.d.ts
|
|
1
|
+
import { t as WorkspaceRegistry } from "../registry-B0g19sdy.js";
|
|
2
|
+
import "../registry-s2Ob9PeX.js";
|
|
4
3
|
declare const registry: WorkspaceRegistry;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { registry as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as setWorkspaceRuntimeRegistry, c as setWorkspaceRuntimeConfig, i as resetWorkspaceRuntimeRegistry, n as WorkspaceRegistryLoader, o as workspaceRuntimeRegistryState, r as WorkspaceRegistryModule, t as WorkspaceRegistry } from "../registry-
|
|
1
|
+
import { a as setWorkspaceRuntimeRegistry, c as setWorkspaceRuntimeConfig, i as resetWorkspaceRuntimeRegistry, n as WorkspaceRegistryLoader, o as workspaceRuntimeRegistryState, r as WorkspaceRegistryModule, t as WorkspaceRegistry } from "../registry-B0g19sdy.js";
|
|
2
2
|
export { WorkspaceRegistry, WorkspaceRegistryLoader, WorkspaceRegistryModule, resetWorkspaceRuntimeRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeRegistry, workspaceRuntimeRegistryState };
|
package/dist/runtime/registry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as setWorkspaceRuntimeConfig } from "../config-
|
|
1
|
+
import { n as setWorkspaceRuntimeConfig } from "../config-CsgNNVAI.js";
|
|
2
2
|
import runtimeRegistry from "#vitehub-workspace-registry";
|
|
3
|
-
|
|
3
|
+
// src/runtime/registry.ts
|
|
4
4
|
const workspaceRuntimeRegistryKey = Symbol.for("vitehub.workspace.runtimeRegistry");
|
|
5
5
|
function workspaceRuntimeRegistryState() {
|
|
6
6
|
const scope = globalThis;
|
|
@@ -19,5 +19,4 @@ function setWorkspaceRuntimeRegistry(registry) {
|
|
|
19
19
|
function resetWorkspaceRuntimeRegistry() {
|
|
20
20
|
setWorkspaceRuntimeRegistry(runtimeRegistry);
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { resetWorkspaceRuntimeRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeRegistry, workspaceRuntimeRegistryState };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
//#region src/runtime/request.d.ts
|
|
2
1
|
/** Nitro middleware: runs the rest of the request in its own Workspace request scope. */
|
|
3
|
-
export default function workspaceRequestMiddleware(_event: unknown, next: () => unknown): Promise<unknown>;
|
|
4
|
-
//#endregion
|
|
2
|
+
export default function workspaceRequestMiddleware(_event: unknown, next: () => unknown): Promise<unknown>;
|
package/dist/runtime/request.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as runWorkspaceRequest } from "../request-scope-
|
|
2
|
-
|
|
1
|
+
import { t as runWorkspaceRequest } from "../request-scope-CXCI_wCb.js";
|
|
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) {
|
|
5
5
|
return runWorkspaceRequest(next);
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { workspaceRequestMiddleware as default };
|
package/dist/runtime/state.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, s as UseWorkspaceOptions, x as useWorkspaceFiles } from "../use-
|
|
2
|
-
import { c as setWorkspaceRuntimeConfig, s as getWorkspaceRuntimeConfig } from "../registry-
|
|
3
|
-
import { i as setWorkspaceRuntimeDefinitions, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-
|
|
4
|
-
import { t as useWorkspace } from "../use-tools-
|
|
5
|
-
import { a as setActiveCloudflareEnv, c as getWorkspaceHostedStoreLoader, i as resetWorkspaceStoreCache, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, r as setWorkspaceRuntimeRegistry, t as invalidateWorkspaceStore } from "../state-
|
|
1
|
+
import { _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, s as UseWorkspaceOptions, x as useWorkspaceFiles } from "../use-CpphIBof.js";
|
|
2
|
+
import { c as setWorkspaceRuntimeConfig, s as getWorkspaceRuntimeConfig } from "../registry-B0g19sdy.js";
|
|
3
|
+
import { i as setWorkspaceRuntimeDefinitions, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-s2Ob9PeX.js";
|
|
4
|
+
import { t as useWorkspace } from "../use-tools-CAK10LTc.js";
|
|
5
|
+
import { a as setActiveCloudflareEnv, c as getWorkspaceHostedStoreLoader, i as resetWorkspaceStoreCache, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, r as setWorkspaceRuntimeRegistry, t as invalidateWorkspaceStore } from "../state-BdDfBtOR.js";
|
|
6
6
|
export { type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFiles, type UseWorkspaceOptions, type WritableWorkspaceFacade, type WritableWorkspaceFiles, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, invalidateWorkspaceStore, registerWorkspace, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, setActiveCloudflareEnv, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeDefinitions, setWorkspaceRuntimeRegistry, useWorkspace, useWorkspaceFiles };
|
package/dist/runtime/state.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
|
|
1
|
+
import { a as setWorkspaceRegistry, i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "../registry-BbUg9vJB.js";
|
|
2
|
+
import { t as setWorkspaceAssetsRegistry } from "../asset-registry-0CdRAjIV.js";
|
|
3
|
+
import { n as invalidateCachedWorkspaceStore, r as resetWorkspaceStoreCache } from "../workspace-CLuPkyZR.js";
|
|
4
|
+
import { A as setActiveCloudflareEnv } from "../shared-C20Wh1mp.js";
|
|
5
|
+
import { t as useWorkspace } from "../use-tools-CHduR5k6.js";
|
|
6
|
+
import { r as useWorkspaceFiles } from "../use-D0DyTMxM.js";
|
|
7
|
+
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "../provider-CN14ewvx.js";
|
|
8
|
+
import { n as setWorkspaceRuntimeConfig, t as getWorkspaceRuntimeConfig } from "../config-CsgNNVAI.js";
|
|
9
|
+
// src/runtime/state.ts
|
|
10
10
|
async function invalidateWorkspaceStore(name) {
|
|
11
11
|
invalidateCachedWorkspaceStore(await resolveRegisteredWorkspaceDefinition(name));
|
|
12
12
|
}
|
|
@@ -16,5 +16,4 @@ function setWorkspaceRuntimeRegistry(registry) {
|
|
|
16
16
|
function setWorkspaceRuntimeAssetsRegistry(registry) {
|
|
17
17
|
setWorkspaceAssetsRegistry(registry);
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, invalidateWorkspaceStore, registerWorkspace, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, setActiveCloudflareEnv, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeDefinitions, setWorkspaceRuntimeRegistry, useWorkspace, useWorkspaceFiles };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createWorkspace } from "../workspace-
|
|
1
|
+
import { t as createWorkspace } from "../workspace-BOuxrZrP.js";
|
|
2
2
|
export { createWorkspace };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createWorkspace };
|
|
1
|
+
export { t as createWorkspace } from "../workspace-CLuPkyZR.js";
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as setWorkspaceRuntimeDefinitions, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-
|
|
5
|
-
import {
|
|
6
|
-
import { t as useWorkspace } from "./use-tools-
|
|
7
|
-
import {
|
|
8
|
-
import { a as getWorkspaceSourceRequestDescriptor, i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, o as isWorkspaceSourceRequestOnly, r as normalizeWorkspaceSourcesMetadata, s as workspaceSourceRequestDescriptorPath, t as WorkspaceSourceMetadata } from "./config-
|
|
9
|
-
//#region src/runtime/dependency-loaders.d.ts
|
|
1
|
+
import { c as setWorkspaceRuntimeConfig, s as getWorkspaceRuntimeConfig } from "./registry-B0g19sdy.js";
|
|
2
|
+
import { c as getWorkspaceHostedStoreLoader, i as resetWorkspaceStoreCache, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, o as HostedWorkspaceStoreOptions, r as setWorkspaceRuntimeRegistry, s as WorkspaceHostedStoreLoader, t as invalidateWorkspaceStore } from "./state-BdDfBtOR.js";
|
|
3
|
+
import { _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, o as ReadonlyWorkspaceFs, s as UseWorkspaceOptions, v as WritableWorkspaceFs, x as useWorkspaceFiles } from "./use-CpphIBof.js";
|
|
4
|
+
import { i as setWorkspaceRuntimeDefinitions, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-s2Ob9PeX.js";
|
|
5
|
+
import { Dt as WorkspaceName, E as Workspace, Ft as WorkspaceRetainedHistory, L as WorkspaceDefinition, Ut as WorkspaceSelectedScope, V as WorkspaceEntry, Zt as WorkspaceSource, bt as WorkspaceMaterializeSourcesResult, cn as WorkspaceSourceRequestExecutionInput, hn as WorkspaceSourceResolutionInvocation, ln as WorkspaceSourceRequestExecutionResult, ot as WorkspaceHistoryReader, sn as WorkspaceSourceRequestDescriptor } from "./types-Bel5IDmF.js";
|
|
6
|
+
import { t as useWorkspace } from "./use-tools-CAK10LTc.js";
|
|
7
|
+
import { t as registerWorkspacePlugin } from "./plugins-CLc32jvL.js";
|
|
8
|
+
import { a as getWorkspaceSourceRequestDescriptor, i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, o as isWorkspaceSourceRequestOnly, r as normalizeWorkspaceSourcesMetadata, s as workspaceSourceRequestDescriptorPath, t as WorkspaceSourceMetadata } from "./config-DeA287c0.js";
|
|
10
9
|
interface WorkspaceDependencyRuntimeLoaders {
|
|
11
10
|
shellWorkspace: () => Promise<unknown>;
|
|
12
11
|
}
|
|
13
12
|
export declare function setWorkspaceDependencyRuntimeLoaders(loaders: Partial<WorkspaceDependencyRuntimeLoaders> | undefined): void;
|
|
14
13
|
export declare function getWorkspaceDependencyRuntimeLoaders(): WorkspaceDependencyRuntimeLoaders;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/sources/resolution.d.ts
|
|
17
14
|
interface WorkspaceSourceResolutionOptions {
|
|
18
15
|
invocation: WorkspaceSourceResolutionInvocation<object>;
|
|
19
16
|
overlay?: boolean;
|
|
@@ -28,15 +25,9 @@ export declare function hasWorkspaceSourceResolvers(definition: Pick<WorkspaceDe
|
|
|
28
25
|
export declare function forwardWorkspaceFacade(source: WritableWorkspaceFacade, target: WritableWorkspaceFacade): void;
|
|
29
26
|
export declare function resolveWorkspaceSources(definition: WorkspaceDefinition, options: WorkspaceSourceResolutionOptions): Promise<WorkspaceDefinition>;
|
|
30
27
|
export declare function createWorkspaceSourceResolutionFacade<Name extends WorkspaceName = WorkspaceName>(workspace: ReadonlyWorkspaceFacade<Name>, definition: WorkspaceDefinition, options: WorkspaceSourceResolutionOptions): Promise<WorkspaceSourceResolutionFacade<Name>>;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/core/history.d.ts
|
|
33
28
|
/** Forward history only when the caller can inspect the complete folder. */
|
|
34
29
|
export declare function createWorkspaceHistoryReader(history: WorkspaceHistoryReader | undefined, complete: boolean): WorkspaceHistoryReader & Pick<WorkspaceRetainedHistory, "diff">;
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/sources/live.d.ts
|
|
37
30
|
export declare function markLiveWorkspaceSource(source: WorkspaceSource, paths: Record<string, string>): WorkspaceSource;
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/storage/metadata-target.d.ts
|
|
40
31
|
/** An object that can carry a metadata target: a Workspace, a Workspace facade, or the `fs` of a facade. */
|
|
41
32
|
type WorkspaceMetadataCarrier = Workspace | ReadonlyWorkspaceFiles | WritableWorkspaceFiles | ReadonlyWorkspaceFs | WritableWorkspaceFs;
|
|
42
33
|
/**
|
|
@@ -46,16 +37,12 @@ type WorkspaceMetadataCarrier = Workspace | ReadonlyWorkspaceFiles | WritableWor
|
|
|
46
37
|
* Internal: `@vite-hub/agent` uses this for its Workspace facades.
|
|
47
38
|
*/
|
|
48
39
|
export declare function forwardWorkspaceMetadataView(source: unknown, target: WorkspaceMetadataCarrier, filterEntries?: (entries: WorkspaceEntry[]) => WorkspaceEntry[]): void;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/sources/request-execution.d.ts
|
|
51
40
|
interface WorkspaceSourceRequestExecutionTarget {
|
|
52
41
|
executeSourceRequest(input: WorkspaceSourceRequestExecutionInput): Promise<WorkspaceSourceRequestExecutionResult>;
|
|
53
42
|
}
|
|
54
43
|
export declare function attachWorkspaceSourceRequestExecution<T extends object>(target: T, executor: WorkspaceSourceRequestExecutionTarget | undefined): T;
|
|
55
44
|
export declare function getWorkspaceSourceRequestExecution(input: unknown): WorkspaceSourceRequestExecutionTarget | undefined;
|
|
56
45
|
export declare function workspaceSourceRequestMatches(descriptor: WorkspaceSourceRequestDescriptor, input: WorkspaceSourceRequestExecutionInput): boolean;
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/runtime/preparation.d.ts
|
|
59
46
|
type WorkspacePreparationState = {
|
|
60
47
|
status: "stopped";
|
|
61
48
|
stoppedAt: string;
|
|
@@ -91,8 +78,6 @@ interface WorkspacePreparation {
|
|
|
91
78
|
stop(): Promise<void>;
|
|
92
79
|
}
|
|
93
80
|
export declare function createWorkspacePreparation<Name extends WorkspaceName = WorkspaceName>(options: WorkspacePreparationOptions<Name>): WorkspacePreparation;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/storage/recover-local-locks.d.ts
|
|
96
81
|
/**
|
|
97
82
|
* Remove abandoned markers from a trusted, exclusively owned local store.
|
|
98
83
|
* Stop all store users and prevent changes to the store and its ancestor directories
|
|
@@ -105,5 +90,4 @@ export declare function recoverLocalWorkspaceLocks(options: {
|
|
|
105
90
|
}): Promise<{
|
|
106
91
|
removed: number;
|
|
107
92
|
}>;
|
|
108
|
-
//#endregion
|
|
109
93
|
export { type HostedWorkspaceStoreOptions, type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFiles, type UseWorkspaceOptions, type WorkspaceDependencyRuntimeLoaders, type WorkspaceHostedStoreLoader, type WorkspacePreparation, type WorkspacePreparationOptions, type WorkspacePreparationState, type WorkspaceSourceMetadata, type WorkspaceSourceResolutionFacade, type WorkspaceSourceResolutionOptions, type WritableWorkspaceFacade, type WritableWorkspaceFiles, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, getWorkspaceSourceRequestDescriptor, invalidateWorkspaceStore, isWorkspaceSourceRequestOnly, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, registerWorkspace, registerWorkspacePlugin, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeDefinitions, setWorkspaceRuntimeRegistry, useWorkspace, useWorkspaceFiles, workspaceSourceGrantPaths, workspaceSourceRequestDescriptorPath };
|
package/dist/runtime.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Cth97txN.js";
|
|
5
|
-
import { r as registerWorkspacePlugin, t as createWorkspaceWritePolicy } from "./rules-OHaPFopX.js";
|
|
6
|
-
import { a as createWorkspaceHistoryReader, c as forwardWorkspaceHistoryFiles, i as createWorkspaceHistory, l as forwardWorkspaceHistoryMerge } from "./utils-C0Au2R16.js";
|
|
7
|
-
import { a as provideWorkspaceStoreTarget, i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-C8IAl5-M.js";
|
|
8
|
-
import { t as isRecord } from "./object-Da1zyPCR.js";
|
|
9
|
-
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "./provider-Fc3M6bEx.js";
|
|
10
|
-
import { n as setWorkspaceRuntimeConfig, t as getWorkspaceRuntimeConfig } from "./config-B-863EgC.js";
|
|
11
|
-
import { _ as workspaceSourceRequestMatches, a as isInternalWorkspaceMetaKey, c as isWorkspaceSourceSyncMetaKey, g as getWorkspaceSourceRequestExecution, h as createWorkspaceSourceRequestExecution, m as attachWorkspaceSourceRequestExecution, o as createWorkspaceSourceView, p as resolveWorkspacePath, r as resetWorkspaceStoreCache, v as createBasicWorkspaceSession } from "./workspace-CFrwWhEm.js";
|
|
12
|
-
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-DiyPi3Ff.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-CR0aDtvS.js";
|
|
14
|
-
import { i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "./registry-CedQvQxW.js";
|
|
15
|
-
import { a as copyWorkspacePath, i as appendWorkspaceFile, r as useWorkspaceFiles } from "./use-Dm2tbI5F.js";
|
|
16
|
-
import { i as setWorkspaceDependencyRuntimeLoaders, n as createWorkspaceTools, r as getWorkspaceDependencyRuntimeLoaders, t as useWorkspace } from "./use-tools-C1qvhzme.js";
|
|
1
|
+
import { n as setWorkspaceRuntimeConfig, t as getWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
2
|
+
import { d as setWorkspaceHostedStoreLoader, u as getWorkspaceHostedStoreLoader } from "./provider-CN14ewvx.js";
|
|
3
|
+
import { i as setWorkspaceDependencyRuntimeLoaders, n as createWorkspaceTools, r as getWorkspaceDependencyRuntimeLoaders, t as useWorkspace } from "./use-tools-CHduR5k6.js";
|
|
17
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-jo5QgE1w.js";
|
|
6
|
+
import { s as workspaceError } from "./path-CuYE8-X6.js";
|
|
7
|
+
import { l as normalizeWorkspacePath } from "./path-Bb9OIc_F.js";
|
|
8
|
+
import { a as createWorkspaceHistoryReader, c as forwardWorkspaceHistoryFiles, i as createWorkspaceHistory, l as forwardWorkspaceHistoryMerge } from "./utils-DXP9xfXo.js";
|
|
9
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
10
|
+
import { r as registerWorkspacePlugin, t as createWorkspaceWritePolicy } from "./rules-BPDXypZV.js";
|
|
11
|
+
import { a as copyWorkspacePath, i as appendWorkspaceFile, r as useWorkspaceFiles } from "./use-D0DyTMxM.js";
|
|
12
|
+
import { _ as workspaceSourceRequestMatches, a as isInternalWorkspaceMetaKey, c as isWorkspaceSourceSyncMetaKey, g as getWorkspaceSourceRequestExecution, h as createWorkspaceSourceRequestExecution, m as attachWorkspaceSourceRequestExecution, o as createWorkspaceSourceView, p as resolveWorkspacePath, r as resetWorkspaceStoreCache, v as createBasicWorkspaceSession } from "./workspace-CLuPkyZR.js";
|
|
13
|
+
import { t as createMemoryWorkspaceStore } from "./memory-BlSRrBH1.js";
|
|
14
|
+
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-CaGLY4ay.js";
|
|
15
|
+
import { a as provideWorkspaceStoreTarget, i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
16
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
17
|
+
import { i as resolveRegisteredWorkspaceDefinition, o as setWorkspaceRuntimeDefinitions, r as registerWorkspace } from "./registry-BbUg9vJB.js";
|
|
18
18
|
import { join, resolve } from "node:path";
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
20
20
|
import { lstat, readdir, rename, rm } from "node:fs/promises";
|
|
21
|
-
|
|
21
|
+
// src/sources/resolution.ts
|
|
22
22
|
function hasWorkspaceSourceResolvers(definition) {
|
|
23
23
|
return normalizeWorkspaceSources(definition?.sources).some((source) => typeof source.source.resolve === "function");
|
|
24
24
|
}
|
|
@@ -287,7 +287,7 @@ function createWritableFacadeStore(workspace, sourceSync) {
|
|
|
287
287
|
async function startOverlayWorkspaceSession(_definition, workspace, options) {
|
|
288
288
|
const host = options?.host;
|
|
289
289
|
if (host) {
|
|
290
|
-
const { createHostedWorkspaceSession } = await import("./host-
|
|
290
|
+
const { createHostedWorkspaceSession } = await import("./host-C8yZizfk.js").then((n) => n.n);
|
|
291
291
|
return await createHostedWorkspaceSession(workspace, {
|
|
292
292
|
...options,
|
|
293
293
|
host
|
|
@@ -552,7 +552,7 @@ async function createWorkspaceSourceResolutionFacade(workspace, definition, opti
|
|
|
552
552
|
},
|
|
553
553
|
stat: writeFs.stat,
|
|
554
554
|
sync: async (options) => {
|
|
555
|
-
const { syncWorkspaceSources } = await import("./sync-
|
|
555
|
+
const { syncWorkspaceSources } = await import("./sync-BBfR4g5y.js");
|
|
556
556
|
return await syncWorkspaceSources(resolvedDefinition, syncStore, options);
|
|
557
557
|
},
|
|
558
558
|
writeFile: writeFs.writeFile
|
|
@@ -867,8 +867,7 @@ function pathContains(container, path) {
|
|
|
867
867
|
function pathIntersects(left, right) {
|
|
868
868
|
return pathContains(left, right) || pathContains(right, left);
|
|
869
869
|
}
|
|
870
|
-
|
|
871
|
-
//#region src/runtime/preparation.ts
|
|
870
|
+
// src/runtime/preparation.ts
|
|
872
871
|
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
873
872
|
async function waitForAbortable(operation, signal) {
|
|
874
873
|
let removeAbortListener = () => {};
|
|
@@ -1038,8 +1037,7 @@ function createWorkspacePreparation(options) {
|
|
|
1038
1037
|
}
|
|
1039
1038
|
});
|
|
1040
1039
|
}
|
|
1041
|
-
|
|
1042
|
-
//#region src/storage/recover-local-locks.ts
|
|
1040
|
+
// src/storage/recover-local-locks.ts
|
|
1043
1041
|
/**
|
|
1044
1042
|
* Remove abandoned markers from a trusted, exclusively owned local store.
|
|
1045
1043
|
* Stop all store users and prevent changes to the store and its ancestor directories
|
|
@@ -1079,5 +1077,4 @@ async function recoverLocalWorkspaceLocks(options) {
|
|
|
1079
1077
|
}
|
|
1080
1078
|
return { removed };
|
|
1081
1079
|
}
|
|
1082
|
-
//#endregion
|
|
1083
1080
|
export { attachWorkspaceSourceRequestExecution, createWorkspaceHistoryReader, createWorkspacePreparation, createWorkspaceSourceResolutionFacade, forwardWorkspaceFacade, forwardWorkspaceMetadataView, getWorkspaceDependencyRuntimeLoaders, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, getWorkspaceSourceRequestDescriptor, getWorkspaceSourceRequestExecution, hasWorkspaceSourceResolvers, invalidateWorkspaceStore, isWorkspaceSourceRequestOnly, markLiveWorkspaceSource, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, recoverLocalWorkspaceLocks, registerWorkspace, registerWorkspacePlugin, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, resolveWorkspaceSources, setWorkspaceDependencyRuntimeLoaders, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeDefinitions, setWorkspaceRuntimeRegistry, useWorkspace, useWorkspaceFiles, workspaceSourceGrantPaths, workspaceSourceRequestDescriptorPath, workspaceSourceRequestMatches };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { l as normalizeWorkspacePath } from "./path-
|
|
3
|
-
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-DnNXxpGL.js";
|
|
2
|
+
import { l as normalizeWorkspacePath } from "./path-Bb9OIc_F.js";
|
|
3
|
+
// src/core/search.ts
|
|
4
4
|
var search_exports = /* @__PURE__ */ __exportAll({ searchText: () => searchText });
|
|
5
5
|
function toSearchRegExp(query) {
|
|
6
6
|
const source = query.regex ? query.pattern : escapeRegExp(query.pattern);
|
|
@@ -36,5 +36,4 @@ function searchText(path, content, query) {
|
|
|
36
36
|
function escapeRegExp(input) {
|
|
37
37
|
return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { search_exports as n, searchText as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as normalizeSafeWorkspacePath } from "./path-
|
|
2
|
-
import { s as matchesAny } from "./path-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
1
|
+
import { t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { s as matchesAny } from "./path-Bb9OIc_F.js";
|
|
3
|
+
import { i as workspaceDefinitionPlugins, n as resolveWorkspaceAutoCommit } from "./rules-BPDXypZV.js";
|
|
4
|
+
import { r as useWorkspaceFiles } from "./use-D0DyTMxM.js";
|
|
5
|
+
import { r as withWorkspaceProgress } from "./host-C8yZizfk.js";
|
|
6
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
7
7
|
import { getViteHubErrorShape } from "@vite-hub/runtime";
|
|
8
8
|
import { lookup } from "mrmime";
|
|
9
|
-
|
|
9
|
+
// ../internal/src/secret.ts
|
|
10
10
|
const secretEncoder = new TextEncoder();
|
|
11
11
|
/**
|
|
12
12
|
* Compares a request value with an expected secret in constant time for the length of `expected`. Returns `false`
|
|
@@ -21,8 +21,7 @@ function isViteHubSecretEqual(actual, expected) {
|
|
|
21
21
|
return difference === 0;
|
|
22
22
|
}
|
|
23
23
|
Object.freeze({ prefix: "sha256=" });
|
|
24
|
-
|
|
25
|
-
//#region src/server.ts
|
|
24
|
+
// src/server.ts
|
|
26
25
|
const workspaceDevRoute = "/__vitehub/workspace/dev";
|
|
27
26
|
const workspaceDevHeader = "x-vitehub-workspace-dev";
|
|
28
27
|
const workspaceDevHeaderValue = "1";
|
|
@@ -299,5 +298,4 @@ async function runWorkspaceDevCommand(input) {
|
|
|
299
298
|
await session.close();
|
|
300
299
|
return result;
|
|
301
300
|
}
|
|
302
|
-
//#endregion
|
|
303
301
|
export { refreshWorkspaceDevToken as a, workspaceDevHeader as c, workspaceDevTokenHeader as d, workspaceDevTokenServerId as f, readWorkspaceFileResponse as i, workspaceDevHeaderValue as l, ensureWorkspaceDevToken as n, runWorkspaceDevCommand as o, isViteHubSecretEqual as p, readWorkspaceDevToken as r, validateWorkspaceDevToken as s, defineWorkspaceFileHandler as t, workspaceDevRoute as u };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/server.d.ts
|
|
1
|
+
import { _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles } from "./use-CpphIBof.js";
|
|
2
|
+
import { Dt as WorkspaceName, Gt as WorkspaceSessionHost, Jt as WorkspaceSessionOptions, L as WorkspaceDefinition, Mt as WorkspacePrepareSessionProgressEvent, Wt as WorkspaceSession, i as ExecResult } from "./types-Bel5IDmF.js";
|
|
4
3
|
export declare const workspaceDevRoute = "/__vitehub/workspace/dev";
|
|
5
4
|
export declare const workspaceDevHeader = "x-vitehub-workspace-dev";
|
|
6
5
|
export declare const workspaceDevHeaderValue = "1";
|
|
@@ -59,4 +58,4 @@ export declare function defineWorkspaceFileHandler<Name extends WorkspaceName>(o
|
|
|
59
58
|
fetch(request: Request): Promise<Response>;
|
|
60
59
|
};
|
|
61
60
|
export declare function runWorkspaceDevCommand<Name extends WorkspaceName>(input: WorkspaceDevCommandInput<Name>): Promise<ExecResult>;
|
|
62
|
-
|
|
61
|
+
export {};
|
package/dist/server.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { defineWorkspaceFileHandler, ensureWorkspaceDevToken, readWorkspaceDevToken, readWorkspaceFileResponse, refreshWorkspaceDevToken, runWorkspaceDevCommand, validateWorkspaceDevToken, workspaceDevHeader, workspaceDevHeaderValue, workspaceDevRoute, workspaceDevTokenHeader, workspaceDevTokenServerId };
|
|
1
|
+
export { t as defineWorkspaceFileHandler, n as ensureWorkspaceDevToken, r as readWorkspaceDevToken, i as readWorkspaceFileResponse, a as refreshWorkspaceDevToken, o as runWorkspaceDevCommand, s as validateWorkspaceDevToken, c as workspaceDevHeader, l as workspaceDevHeaderValue, u as workspaceDevRoute, d as workspaceDevTokenHeader, f as workspaceDevTokenServerId } from "./server-aa1a4rkV.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
1
|
+
import { t as abortable } from "./abort-CQGxJBqa.js";
|
|
2
|
+
import { t as internalErrorDiagnostics } from "./error-diagnostics-kKXseq8d.js";
|
|
3
|
+
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
5
|
+
import { l as normalizeWorkspacePath } from "./path-Bb9OIc_F.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { gunzipSync } from "node:zlib";
|
|
8
|
-
|
|
8
|
+
// ../internal/src/forge.ts
|
|
9
9
|
/**
|
|
10
10
|
* Server Env of each Forge, keyed by the `env.server.<forge>.<field>` path.
|
|
11
11
|
* Channels, Capabilities, Workspaces and Sources read the same names.
|
|
@@ -101,8 +101,7 @@ function forgeImportError(error, feature) {
|
|
|
101
101
|
function isMissingForge(error) {
|
|
102
102
|
return error instanceof Error && /(?:cannot find (?:package|module)|no such module|could not resolve) ['"]@vite-hub\/forge['"]/i.test(error.message);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
//#region ../internal/src/runtime/cloudflare-env-lookup.ts
|
|
104
|
+
// ../internal/src/runtime/cloudflare-env-lookup.ts
|
|
106
105
|
/** The key of the AsyncLocalStorage store on `globalThis`. Every bundled copy of this module shares the store. */
|
|
107
106
|
const activeEnvStorageKey = Symbol.for("vitehub.cloudflare.env-storage");
|
|
108
107
|
let activeEnv;
|
|
@@ -119,8 +118,7 @@ function getActiveCloudflareEnv() {
|
|
|
119
118
|
const host = globalThis;
|
|
120
119
|
return Object.hasOwn(host, "__env__") && host.__env__ !== void 0 ? host.__env__ : activeEnv;
|
|
121
120
|
}
|
|
122
|
-
|
|
123
|
-
//#region ../internal/src/runtime/cloudflare-env.ts
|
|
121
|
+
// ../internal/src/runtime/cloudflare-env.ts
|
|
124
122
|
const runtimeGlobal = globalThis;
|
|
125
123
|
const activeEnvStorage = runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
|
|
126
124
|
const globalEnvProbe = Symbol("vitehub.cloudflare.global-env-probe");
|
|
@@ -153,8 +151,7 @@ function getActiveCloudflareBinding(name) {
|
|
|
153
151
|
const env = getActiveCloudflareEnv();
|
|
154
152
|
return env && Object.hasOwn(env, name) ? env[name] : void 0;
|
|
155
153
|
}
|
|
156
|
-
|
|
157
|
-
//#region src/providers/github/bounded-map.ts
|
|
154
|
+
// src/providers/github/bounded-map.ts
|
|
158
155
|
/** A Map that keeps the `limit` most recently used entries. */
|
|
159
156
|
var BoundedMap = class extends Map {
|
|
160
157
|
limit;
|
|
@@ -179,8 +176,7 @@ var BoundedMap = class extends Map {
|
|
|
179
176
|
return this;
|
|
180
177
|
}
|
|
181
178
|
};
|
|
182
|
-
|
|
183
|
-
//#region src/providers/github/cache.ts
|
|
179
|
+
// src/providers/github/cache.ts
|
|
184
180
|
/** How long a kept answer stays in KV, in seconds. A commit that nobody reads for a week leaves KV. */
|
|
185
181
|
const kvTTL = 604800;
|
|
186
182
|
const stats = {
|
|
@@ -357,8 +353,7 @@ function fromBase64(text) {
|
|
|
357
353
|
for (let index = 0; index < binary.length; index++) bytes[index] = binary.charCodeAt(index);
|
|
358
354
|
return bytes;
|
|
359
355
|
}
|
|
360
|
-
|
|
361
|
-
//#region src/providers/github/tar.ts
|
|
356
|
+
// src/providers/github/tar.ts
|
|
362
357
|
const decoder = new TextDecoder();
|
|
363
358
|
function text(bytes) {
|
|
364
359
|
const end = bytes.indexOf(0);
|
|
@@ -410,8 +405,7 @@ function readTarGz(archive) {
|
|
|
410
405
|
}
|
|
411
406
|
return files;
|
|
412
407
|
}
|
|
413
|
-
|
|
414
|
-
//#region src/providers/github/shared.ts
|
|
408
|
+
// src/providers/github/shared.ts
|
|
415
409
|
const githubReadAttempts = 3;
|
|
416
410
|
function retryDelay(response, attempt) {
|
|
417
411
|
const retryAfter = response.headers.get("retry-after");
|
|
@@ -859,5 +853,4 @@ async function commitGitHubChanges(input) {
|
|
|
859
853
|
throw error;
|
|
860
854
|
}
|
|
861
855
|
}
|
|
862
|
-
//#endregion
|
|
863
856
|
export { setActiveCloudflareEnv as A, githubKVKey as C, writeWorkspaceKV as D, registerWorkspaceKV as E, readForgeEnv as M, BoundedMap as O, resolveGitHubRootOption as S, readWorkspaceKV as T, requireGitHubOption as _, gitFileMode as a, resolveGitHubRefsOption as b, githubRequestStatus as c, preloadGitHubFiles as d, readCurrentHead as f, readGitHubFile as g, readGitHubEnvToken as h, gitBlobSha as i, forgeEnv as j, getActiveCloudflareBinding as k, joinGitPath as l, readGitHubBranchState as m, commitGitHubChanges as n, githubBranchMovedConflict as o, readGitHubArchive as p, connectGitHubRepository as r, githubRequest as s, assertNoGitHubRepositoryKey as t, loadForge as u, resolveGitHubBranchOption as v, readGitHubReadStats as w, resolveGitHubRepositoryOption as x, resolveGitHubCredential as y };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { V as WorkspaceEntry, in as WorkspaceSourceMaterializationStatus, zt as WorkspaceRules } from "./types-
|
|
2
|
-
import { i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, r as normalizeWorkspaceSourcesMetadata, t as WorkspaceSourceMetadata } from "./config-
|
|
3
|
-
//#region src/core/rule-keys.d.ts
|
|
1
|
+
import { V as WorkspaceEntry, in as WorkspaceSourceMaterializationStatus, zt as WorkspaceRules } from "./types-Bel5IDmF.js";
|
|
2
|
+
import { i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, r as normalizeWorkspaceSourcesMetadata, t as WorkspaceSourceMetadata } from "./config-DeA287c0.js";
|
|
4
3
|
/** Rejects rule keys that ViteHub does not enforce, such as `read`, so that a rule never looks like a protection it is not. */
|
|
5
4
|
export declare function assertWorkspaceRules(rules: WorkspaceRules | undefined): void;
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/source-metadata.d.ts
|
|
8
5
|
export declare function listMaterializedWorkspaceEntries(workspace: unknown): Promise<WorkspaceEntry[] | undefined>;
|
|
9
6
|
export declare function listMaterializedWorkspaceSourceEntries(workspace: unknown, source: WorkspaceSourceMetadata): Promise<WorkspaceEntry[] | undefined>;
|
|
10
7
|
export declare function readWorkspaceSourceMaterializationStatus(workspace: unknown, source: WorkspaceSourceMetadata): Promise<WorkspaceSourceMaterializationStatus | undefined>;
|
|
11
|
-
//#endregion
|
|
12
8
|
export { type WorkspaceSourceMetadata, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, workspaceSourceGrantPaths };
|
package/dist/source-metadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { m as readCurrentSourceSnapshot, o as resolveWorkspaceMetadataTarget } from "./metadata-target-CaGLY4ay.js";
|
|
2
|
+
import { t as assertWorkspaceRules } from "./rule-keys-BLEbi1h5.js";
|
|
3
|
+
import { i as normalizeWorkspaceSourceMetadata, l as workspaceSourceGrantPaths, o as normalizeWorkspaceSourcesMetadata } from "./config-jo5QgE1w.js";
|
|
4
|
+
// src/source-metadata.ts
|
|
5
5
|
async function listMaterializedWorkspaceEntries(workspace) {
|
|
6
6
|
return await (await resolveWorkspaceMetadataTarget(workspace))?.list?.("", { recursive: true });
|
|
7
7
|
}
|
|
@@ -30,5 +30,4 @@ async function readWorkspaceSourceMaterializationStatus(workspace, source) {
|
|
|
30
30
|
status
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { assertWorkspaceRules, listMaterializedWorkspaceEntries, listMaterializedWorkspaceSourceEntries, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, readWorkspaceSourceMaterializationStatus, workspaceSourceGrantPaths };
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
//#region src/runtime/hosted-store-loader.d.ts
|
|
1
|
+
import "./registry-s2Ob9PeX.js";
|
|
2
|
+
import { En as WorkspaceStore, T as VercelBlobWorkspaceStoreOptions, k as WorkspaceAssetsRegistry, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions } from "./types-Bel5IDmF.js";
|
|
3
|
+
import "./use-tools-CAK10LTc.js";
|
|
4
|
+
import "./use-CpphIBof.js";
|
|
5
|
+
import { t as WorkspaceRegistry } from "./registry-B0g19sdy.js";
|
|
7
6
|
type HostedWorkspaceStoreOptions = CloudflareArtifactsWorkspaceStoreOptions | GitHubWorkspaceStoreOptions | VercelBlobWorkspaceStoreOptions;
|
|
8
7
|
/** Returns `undefined` when no installed hosted store handles `options.provider`. */
|
|
9
8
|
type WorkspaceHostedStoreLoader = (options: HostedWorkspaceStoreOptions, workspaceName: string) => WorkspaceStore | undefined;
|
|
10
9
|
declare function setWorkspaceHostedStoreLoader(loader: WorkspaceHostedStoreLoader | undefined): void;
|
|
11
10
|
declare function getWorkspaceHostedStoreLoader(): WorkspaceHostedStoreLoader | undefined;
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region ../internal/src/runtime/cloudflare-env-lookup.d.ts
|
|
14
11
|
type CloudflareWorkerEnv = Record<string, unknown>;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../internal/src/runtime/cloudflare-env.d.ts
|
|
17
12
|
declare function setActiveCloudflareEnv(env: CloudflareWorkerEnv | undefined): void;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/core/workspace-cache.d.ts
|
|
20
13
|
declare function resetWorkspaceStoreCache(): void;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/runtime/state.d.ts
|
|
23
14
|
declare function invalidateWorkspaceStore(name: string): Promise<void>;
|
|
24
15
|
declare function setWorkspaceRuntimeRegistry(registry: WorkspaceRegistry): void;
|
|
25
16
|
declare function setWorkspaceRuntimeAssetsRegistry(registry: WorkspaceAssetsRegistry): void;
|
|
26
|
-
//#endregion
|
|
27
17
|
export { setActiveCloudflareEnv as a, getWorkspaceHostedStoreLoader as c, resetWorkspaceStoreCache as i, setWorkspaceHostedStoreLoader as l, setWorkspaceRuntimeAssetsRegistry as n, HostedWorkspaceStoreOptions as o, setWorkspaceRuntimeRegistry as r, WorkspaceHostedStoreLoader as s, invalidateWorkspaceStore as t };
|