@vite-hub/workspace 0.0.2 → 0.0.4
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/LICENSE +201 -0
- package/README.md +48 -2
- package/dist/{ai-Cztw4eLk.js → ai-BqCC8BpY.js} +15 -4
- package/dist/{ai-hFdsvDHC.d.ts → ai-CjxvGqM0.d.ts} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/{asset-registry-CaG9b7tf.js → asset-registry-8QI3ML3K.js} +1 -1
- package/dist/chunk-2rV9d50f.js +35 -0
- package/dist/cloudflare.d.ts +4 -2
- package/dist/cloudflare.js +1 -2
- package/dist/collections.d.ts +2 -2
- package/dist/collections.js +1 -1
- package/dist/{config--r5unwPc.js → config-Bc3c4Su1.js} +213 -120
- package/dist/{config-DCQ6y30R.js → config-CHLLWklZ.js} +9 -3
- package/dist/{config-Ca5DM8fF.d.ts → config-DE9xlaIw.d.ts} +1 -1
- package/dist/{file-B2q9NE18.js → file-Bc1X7pco.js} +9 -10
- package/dist/{files-xy0le-_U.js → files-Q6xZjDHA.js} +20 -9
- package/dist/{github-lIO6-2sH.js → github-DHnjxQIX.js} +27 -23
- package/dist/glob-CEZKeZFC.js +18 -0
- package/dist/host-DJH8cuoU.js +1030 -0
- package/dist/{artifacts-store-BAV9jZpd.js → hosted-RPeJOCFz.js} +146 -30
- package/dist/hosted-vercel-blob-d6C8ND5j.js +23580 -0
- package/dist/hosted-vercel-blob.d.ts +1 -1
- package/dist/hosted-vercel-blob.js +1 -25
- package/dist/hosted.d.ts +1 -1
- package/dist/hosted.js +1 -29
- package/dist/index.d.ts +61 -78
- package/dist/index.js +133 -435
- package/dist/lifecycle-LrL3sA4n.js +316 -0
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/metadata-target-B0tOmVW7.js +717 -0
- package/dist/mountx.d.ts +10 -0
- package/dist/mountx.js +143 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +8 -2
- package/dist/{path-CNI6wKIU.js → path-Cp59koVz.js} +28 -4
- package/dist/{provider-CeQciesl.js → provider-B1yLjCJJ.js} +194 -47
- package/dist/providers/github/store.d.ts +1 -1
- package/dist/providers/github/store.js +1 -361
- package/dist/publish.d.ts +1 -1
- package/dist/publish.js +2 -2
- package/dist/registry-D3yzt8HQ.js +127 -0
- package/dist/{registry-CoC9JxVt.d.ts → registry-Uj6IVxes.d.ts} +3 -3
- package/dist/{request-execution-C8qRcReq.js → request-execution-B-dSFlGB.js} +8 -4
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/assets.js +4 -2
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +1 -1
- package/dist/runtime/state.d.ts +4 -4
- package/dist/runtime/state.js +10 -7
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime-options-BsPSv5O7.js +13 -0
- package/dist/runtime-type-iEE6BjQJ.js +34 -0
- package/dist/runtime.d.ts +42 -7
- package/dist/runtime.js +276 -100
- package/dist/{search-C4REyHj9.js → search-BpiCF2Tw.js} +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +24 -51
- package/dist/{shared-BRycRSbo.js → shared-DTR1Hhma.js} +115 -39
- package/dist/source-metadata.d.ts +9 -2
- package/dist/source-metadata.js +34 -2
- package/dist/{state-DSAHEsq6.d.ts → state-tYcRWEh2.d.ts} +13 -12
- package/dist/store-Dt_Jyys3.js +608 -0
- package/dist/{sync-DO42ypji.js → sync-DnTQwt8r.js} +6 -5
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/token-CVzURBxC.js +61 -0
- package/dist/{types-DHkae7Cb.d.ts → types-CYuwjJ4V.d.ts} +94 -43
- package/dist/{use-d_PlAdOu.js → use-BTNDR5Rd.js} +147 -50
- package/dist/{use-D16tf8Ph.d.ts → use-BiHzt0xA.d.ts} +21 -4
- package/dist/vite-BptCrpv2.js +4526 -0
- package/dist/vite-CtA9guIM.d.ts +66 -0
- package/dist/vite.d.ts +2 -50
- package/dist/vite.js +2 -2
- package/dist/{workspace-n4wBmdaM.js → workspace-Dq08Yn72.js} +224 -545
- package/dist/{workspace-f2DBLmPZ.d.ts → workspace-Xddf4G1B.d.ts} +1 -1
- package/package.json +20 -38
- package/dist/chunk-8H4AJuhK.js +0 -14
- package/dist/cli.d.ts +0 -31
- package/dist/cli.js +0 -303
- package/dist/cloudflare-env-CKxUs2fa.js +0 -20
- package/dist/glob-DeH0dzZX.js +0 -23
- package/dist/host-I-_vDs05.js +0 -370
- package/dist/lifecycle-Lhk3dAMt.js +0 -176
- package/dist/providers/cloudflare/artifacts-store.d.ts +0 -6
- package/dist/providers/cloudflare/artifacts-store.js +0 -2
- package/dist/providers/vercel/blob-store.d.ts +0 -6
- package/dist/providers/vercel/blob-store.js +0 -235
- package/dist/registry-C7DMdBXN.js +0 -74
- package/dist/utils-BPdaCyI6.js +0 -55
- package/dist/vite-NWC9mFjI.js +0 -1882
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/internal/runtime-type.ts
|
|
2
|
+
function isCallableRepresentation(value) {
|
|
3
|
+
if (value === null || value === void 0 || Object(value) !== value) return false;
|
|
4
|
+
try {
|
|
5
|
+
Function.prototype.toString.call(value);
|
|
6
|
+
return true;
|
|
7
|
+
} catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/** Parses JavaScript runtime representation categories at Workspace boundaries. */
|
|
12
|
+
function hasRuntimeType(value, expected) {
|
|
13
|
+
if (expected === "undefined") return value === void 0;
|
|
14
|
+
if (expected === "object" && value === null) return true;
|
|
15
|
+
if (value === null || value === void 0) return false;
|
|
16
|
+
const isPrimitive = Object(value) !== value;
|
|
17
|
+
if (!isPrimitive) {
|
|
18
|
+
if (expected === "function") return isCallableRepresentation(value);
|
|
19
|
+
return expected === "object" && !isCallableRepresentation(value);
|
|
20
|
+
}
|
|
21
|
+
const tag = Object.prototype.toString.call(value);
|
|
22
|
+
switch (expected) {
|
|
23
|
+
case "bigint": return isPrimitive && tag === "[object BigInt]";
|
|
24
|
+
case "boolean": return isPrimitive && tag === "[object Boolean]";
|
|
25
|
+
case "function": return false;
|
|
26
|
+
case "number": return isPrimitive && tag === "[object Number]";
|
|
27
|
+
case "object": return false;
|
|
28
|
+
case "string": return isPrimitive && tag === "[object String]";
|
|
29
|
+
case "symbol": return isPrimitive && tag === "[object Symbol]";
|
|
30
|
+
}
|
|
31
|
+
throw new TypeError(`Unsupported runtime type: ${expected}`);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { hasRuntimeType as t };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as getWorkspaceSourceRequestDescriptor, i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, o as isWorkspaceSourceRequestOnly, r as normalizeWorkspaceSourcesMetadata, s as workspaceSourceRequestDescriptorPath, t as WorkspaceSourceMetadata } from "./config-
|
|
1
|
+
import { F as WorkspaceDefinition, Ft as WorkspaceSourceRequestExecutionInput, Ht as WorkspaceSourceResolutionInvocation, It as WorkspaceSourceRequestExecutionResult, gt as WorkspaceSelectedScope, it as WorkspaceName, tt as WorkspaceMaterializeSourcesResult, wt as WorkspaceSource } from "./types-CYuwjJ4V.js";
|
|
2
|
+
import { _ as useWorkspace, i as ReadonlyWorkspaceFacade, m as WritableWorkspaceFacade, o as UseWorkspaceOptions } from "./use-BiHzt0xA.js";
|
|
3
|
+
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-Uj6IVxes.js";
|
|
4
|
+
import { a as setWorkspaceRuntimeConfig, c as getWorkspaceHostedStoreLoader, i as getWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, o as HostedWorkspaceStoreOptions, r as setWorkspaceRuntimeRegistry, s as WorkspaceHostedStoreLoader, t as invalidateWorkspaceStore, u as resetWorkspaceStoreCache } from "./state-tYcRWEh2.js";
|
|
5
|
+
import { a as getWorkspaceSourceRequestDescriptor, i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, o as isWorkspaceSourceRequestOnly, r as normalizeWorkspaceSourcesMetadata, s as workspaceSourceRequestDescriptorPath, t as WorkspaceSourceMetadata } from "./config-DE9xlaIw.js";
|
|
6
6
|
|
|
7
7
|
//#region src/runtime/dependency-loaders.d.ts
|
|
8
8
|
interface WorkspaceDependencyRuntimeLoaders {
|
|
@@ -33,6 +33,41 @@ interface WorkspaceSourceRequestExecutionTarget {
|
|
|
33
33
|
executeSourceRequest(input: WorkspaceSourceRequestExecutionInput): Promise<WorkspaceSourceRequestExecutionResult>;
|
|
34
34
|
}
|
|
35
35
|
declare function attachWorkspaceSourceRequestExecution<T extends object>(target: T, executor: WorkspaceSourceRequestExecutionTarget | undefined): T;
|
|
36
|
-
declare function getWorkspaceSourceRequestExecution(input:
|
|
36
|
+
declare function getWorkspaceSourceRequestExecution(input: unknown): WorkspaceSourceRequestExecutionTarget | undefined;
|
|
37
37
|
//#endregion
|
|
38
|
-
|
|
38
|
+
//#region src/runtime/preparation.d.ts
|
|
39
|
+
type WorkspacePreparationState = {
|
|
40
|
+
status: "stopped";
|
|
41
|
+
stoppedAt: string;
|
|
42
|
+
} | {
|
|
43
|
+
startedAt: string;
|
|
44
|
+
status: "preparing";
|
|
45
|
+
} | {
|
|
46
|
+
durationMs: number;
|
|
47
|
+
finishedAt: string;
|
|
48
|
+
result: WorkspaceMaterializeSourcesResult;
|
|
49
|
+
startedAt: string;
|
|
50
|
+
status: "ready";
|
|
51
|
+
} | {
|
|
52
|
+
durationMs: number;
|
|
53
|
+
error: string;
|
|
54
|
+
finishedAt: string;
|
|
55
|
+
startedAt: string;
|
|
56
|
+
status: "error";
|
|
57
|
+
};
|
|
58
|
+
interface WorkspacePreparationOptions<Name extends WorkspaceName = WorkspaceName> {
|
|
59
|
+
onStateChange?: (state: WorkspacePreparationState) => void;
|
|
60
|
+
retryDelayMs?: number;
|
|
61
|
+
sources?: readonly string[];
|
|
62
|
+
validate?: (result: WorkspaceMaterializeSourcesResult) => void | Promise<void>;
|
|
63
|
+
workspace: Name;
|
|
64
|
+
}
|
|
65
|
+
interface WorkspacePreparation {
|
|
66
|
+
getState(): WorkspacePreparationState;
|
|
67
|
+
response(): Response;
|
|
68
|
+
start(): Promise<WorkspacePreparationState>;
|
|
69
|
+
stop(): Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
declare function createWorkspacePreparation<Name extends WorkspaceName = WorkspaceName>(options: WorkspacePreparationOptions<Name>): WorkspacePreparation;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { type HostedWorkspaceStoreOptions, type ReadonlyWorkspaceFacade, type UseWorkspaceOptions, type WorkspaceDependencyRuntimeLoaders, type WorkspaceHostedStoreLoader, type WorkspacePreparation, type WorkspacePreparationOptions, type WorkspacePreparationState, type WorkspaceSourceMetadata, type WorkspaceSourceResolutionFacade, type WorkspaceSourceResolutionOptions, type WritableWorkspaceFacade, attachWorkspaceSourceRequestExecution, createWorkspacePreparation, createWorkspaceSourceResolutionFacade, getWorkspaceDependencyRuntimeLoaders, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, getWorkspaceSourceRequestDescriptor, getWorkspaceSourceRequestExecution, hasWorkspaceSourceResolvers, invalidateWorkspaceStore, isWorkspaceSourceRequestOnly, markLiveWorkspaceSource, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, registerWorkspace, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, resolveWorkspaceSources, setWorkspaceDependencyRuntimeLoaders, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeRegistry, useWorkspace, workspaceSourceGrantPaths, workspaceSourceRequestDescriptorPath };
|