@vite-hub/workspace 0.0.4 → 0.3.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/README.md +339 -115
- package/dist/abort-BCwpdrN0.js +32 -0
- package/dist/{asset-registry-8QI3ML3K.js → asset-registry-DfBV5kmw.js} +3 -2
- package/dist/blob-database.d.ts +474 -0
- package/dist/blob-database.js +608 -0
- package/dist/checkout.d.ts +128 -0
- package/dist/checkout.js +849 -0
- package/dist/cloudflare.d.ts +6 -7
- package/dist/cloudflare.js +1 -1
- package/dist/config-B-863EgC.js +15 -0
- package/dist/config-BAgL2dtB.js +1076 -0
- package/dist/{config-DE9xlaIw.d.ts → config-BQKcPawI.d.ts} +1 -2
- package/dist/discard-CNNtCozM.js +8 -0
- package/dist/durability.d.ts +22 -0
- package/dist/durability.js +70 -0
- package/dist/error-diagnostics-CtKjGtGb.js +188 -0
- package/dist/error-diagnostics-DSkCJC_L.js +266 -0
- package/dist/file-2pFYNtsU.js +22 -0
- package/dist/{files-Q6xZjDHA.js → files-BOo4SbwE.js} +3 -3
- package/dist/files.d.ts +38 -0
- package/dist/files.js +6 -0
- package/dist/{github-DHnjxQIX.js → github-CrYp4v8k.js} +44 -24
- package/dist/glob-B8YGvTrZ.js +21 -0
- package/dist/glob-Cjxms1t7.js +30 -0
- package/dist/{host-DJH8cuoU.js → host-BFBpXn0N.js} +144 -77
- package/dist/{hosted-RPeJOCFz.js → hosted-KcUR_jPv.js} +303 -97
- package/dist/hosted-vercel-blob-B3-wRdUm.js +410 -0
- package/dist/hosted-vercel-blob.d.ts +6 -7
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +10 -9
- package/dist/hosted.js +2 -2
- package/dist/index.d.ts +26 -47
- package/dist/index.js +30 -100
- package/dist/internal/path.d.ts +2 -0
- package/dist/internal/path.js +2 -0
- package/dist/lifecycle-B-enk_4A.js +596 -0
- package/dist/lineage.d.ts +26 -0
- package/dist/lineage.js +76 -0
- package/dist/loader.d.ts +5 -6
- package/dist/loader.js +3 -2
- package/dist/mcp-resources-DF0F5rcL.js +39 -0
- package/dist/memory-BOexthyW.js +247 -0
- package/dist/metadata-target-CWz6KHKq.js +1589 -0
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/operation-definition-8gOe-ubD.d.ts +234 -0
- package/dist/operations-C6FpR8Rr.js +389 -0
- package/dist/operations-CE2drFih.js +1234 -0
- package/dist/operations.d.ts +90 -0
- package/dist/operations.js +3 -0
- package/dist/path--wrT_Azm.js +113 -0
- package/dist/path-AxMho1wo.d.ts +7 -0
- package/dist/path-DrSIenjj.js +59 -0
- package/dist/path-zHxQUbqa.d.ts +9 -0
- package/dist/plugins-C8C0auoW.d.ts +10 -0
- package/dist/provider-9s4Ufkm5.js +1479 -0
- package/dist/providers/github/store.d.ts +3 -5
- package/dist/providers/github/store.js +1 -1
- package/dist/registry-B3BBm4Ts.d.ts +19 -0
- package/dist/{registry-D3yzt8HQ.js → registry-CNphafBx.js} +60 -23
- package/dist/registry-CYNN623b.d.ts +9 -0
- package/dist/request-scope-Dw5n8bMC.js +83 -0
- package/dist/results-DgkZUmTL.js +8 -0
- package/dist/{chunk-2rV9d50f.js → rolldown-runtime-rQ84J-ij.js} +3 -4
- package/dist/runtime/assets.d.ts +3 -5
- package/dist/runtime/assets.js +7 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -2
- package/dist/runtime/empty-registry.d.ts +2 -2
- package/dist/runtime/registry.d.ts +2 -0
- package/dist/runtime/registry.js +23 -0
- package/dist/runtime/request.d.ts +4 -0
- package/dist/runtime/request.js +8 -0
- package/dist/runtime/state.d.ts +5 -4
- package/dist/runtime/state.js +8 -18
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +52 -17
- package/dist/runtime.js +324 -67
- package/dist/{search-BpiCF2Tw.js → search-C_RfoM2j.js} +10 -9
- package/dist/server-8tGltlGz.js +303 -0
- package/dist/server.d.ts +36 -39
- package/dist/server.js +2 -328
- package/dist/shared-B3_EUk89.js +848 -0
- package/dist/source-metadata.d.ts +10 -7
- package/dist/source-metadata.js +12 -12
- package/dist/state-BISnUf1s.d.ts +35 -0
- package/dist/{ai-BqCC8BpY.js → state-DbrW-njQ.js} +237 -114
- package/dist/store-ybhyD38Z.js +1873 -0
- package/dist/{sync-DnTQwt8r.js → sync-CCD_VYC8.js} +61 -41
- package/dist/target-jWhTdIuF.js +89 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-CYuwjJ4V.d.ts → types-BbtwmBZ5.d.ts} +321 -35
- package/dist/use-C6lV3-wC.d.ts +321 -0
- package/dist/{use-BTNDR5Rd.js → use-CSpT5W87.js} +141 -107
- package/dist/utils-CgMZCHsX.js +616 -0
- package/dist/vite.d.ts +585 -2
- package/dist/vite.js +21369 -2
- package/dist/workspace-CYB2xZ1T.d.ts +7 -0
- package/dist/{workspace-Dq08Yn72.js → workspace-sPWn2Jxj.js} +441 -225
- package/package.json +97 -72
- package/dist/ai-CjxvGqM0.d.ts +0 -162
- package/dist/ai.d.ts +0 -3
- package/dist/ai.js +0 -2
- package/dist/collections/client.d.ts +0 -39
- package/dist/collections/client.js +0 -137
- package/dist/collections.d.ts +0 -59
- package/dist/collections.js +0 -159
- package/dist/config-Bc3c4Su1.js +0 -7904
- package/dist/config-CHLLWklZ.js +0 -36
- package/dist/file-Bc1X7pco.js +0 -23
- package/dist/glob-CEZKeZFC.js +0 -18
- package/dist/hosted-vercel-blob-d6C8ND5j.js +0 -23580
- package/dist/lifecycle-LrL3sA4n.js +0 -316
- package/dist/metadata-target-B0tOmVW7.js +0 -717
- package/dist/mountx.d.ts +0 -10
- package/dist/mountx.js +0 -143
- package/dist/nitro.d.ts +0 -2
- package/dist/nitro.js +0 -2
- package/dist/nuxt.d.ts +0 -26
- package/dist/nuxt.js +0 -42
- package/dist/path-Cp59koVz.js +0 -139
- package/dist/provider-B1yLjCJJ.js +0 -746
- package/dist/publish.d.ts +0 -35
- package/dist/publish.js +0 -112
- package/dist/registry-Uj6IVxes.d.ts +0 -11
- package/dist/request-execution-B-dSFlGB.js +0 -84
- package/dist/runtime-options-BsPSv5O7.js +0 -13
- package/dist/runtime-type-iEE6BjQJ.js +0 -34
- package/dist/shared-DTR1Hhma.js +0 -331
- package/dist/state-tYcRWEh2.d.ts +0 -26
- package/dist/store-Dt_Jyys3.js +0 -608
- package/dist/target-D4Bqb1eH.js +0 -11
- package/dist/token-CVzURBxC.js +0 -61
- package/dist/use-BiHzt0xA.d.ts +0 -103
- package/dist/vite-BptCrpv2.js +0 -4526
- package/dist/vite-CtA9guIM.d.ts +0 -66
- package/dist/workspace-Xddf4G1B.d.ts +0 -6
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { WorkspaceStaleFile } from "./lineage.js";
|
|
2
|
+
//#region src/checkout.d.ts
|
|
3
|
+
/** The lock file at the project root. Commit it: it records the remote revision that each checkout folder matches. */
|
|
4
|
+
export declare const workspaceLockFile = "vitehub.lock";
|
|
5
|
+
/** Calls one operation of the app, as `callOperationFromCli()` does. Tests pass a direct call. */
|
|
6
|
+
export type WorkspaceCheckoutCall = (operation: string, input: unknown, remote: string | undefined) => Promise<{
|
|
7
|
+
ok: true;
|
|
8
|
+
value: unknown;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
code?: string;
|
|
12
|
+
message: string;
|
|
13
|
+
fix?: string;
|
|
14
|
+
status?: number;
|
|
15
|
+
}>;
|
|
16
|
+
/** The code, message, and fix that the checkout commands print for a failure. */
|
|
17
|
+
export declare function checkoutFailure(error: unknown): {
|
|
18
|
+
code: string;
|
|
19
|
+
fix?: string;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
/** Line patterns shared by working-tree scans and Git index searches. */
|
|
23
|
+
export declare const conflictMarkerPatterns: string[];
|
|
24
|
+
/** True for a file or folder name that a checkout skips, such as `node_modules`, `.GIT`, or a leftover temporary file. */
|
|
25
|
+
export declare function ignoredName(name: string): boolean;
|
|
26
|
+
interface WorkspaceMergeResult {
|
|
27
|
+
text: string;
|
|
28
|
+
conflicts: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A three-way merge by line, as `git merge-file` does. A region that only one side changed takes that side. In a region
|
|
32
|
+
* that both sides changed, lines that each side replaced one for one merge line by line. Other lines that both sides
|
|
33
|
+
* changed in different ways get Git conflict markers, with the local lines first.
|
|
34
|
+
*/
|
|
35
|
+
export declare function mergeText(base: string, local: string, remote: string, labels?: {
|
|
36
|
+
local: string;
|
|
37
|
+
remote: string;
|
|
38
|
+
}): WorkspaceMergeResult;
|
|
39
|
+
/** The absolute checkout folder of a lock `dir`. Fails unless it is a folder inside the project. */
|
|
40
|
+
export declare function folderOf(rootDir: string, dir: string): string;
|
|
41
|
+
/** Checks every existing path component inside the project before a checkout reads or writes it. */
|
|
42
|
+
export declare function assertNoSymlinks(rootDir: string, target: string): Promise<void>;
|
|
43
|
+
interface WorkspaceLocalChanges {
|
|
44
|
+
added: string[];
|
|
45
|
+
modified: string[];
|
|
46
|
+
deleted: string[];
|
|
47
|
+
/** Text files with conflict markers, and paths in `conflicts` of the lock. */
|
|
48
|
+
conflicted: string[];
|
|
49
|
+
}
|
|
50
|
+
/** What happened to one path in a pull. */
|
|
51
|
+
interface WorkspacePullFile {
|
|
52
|
+
path: string;
|
|
53
|
+
action: "added" | "updated" | "deleted" | "merged" | "conflict" | "kept";
|
|
54
|
+
/** Why a path was kept or conflicts, for the person who resolves it. */
|
|
55
|
+
note?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface WorkspacePullResult {
|
|
58
|
+
workspace: string;
|
|
59
|
+
ref: string;
|
|
60
|
+
from: string | null;
|
|
61
|
+
head: string | null;
|
|
62
|
+
files: WorkspacePullFile[];
|
|
63
|
+
}
|
|
64
|
+
export interface WorkspacePushResult {
|
|
65
|
+
workspace: string;
|
|
66
|
+
ref: string;
|
|
67
|
+
/** The new head. Undefined when nothing changed locally. */
|
|
68
|
+
revision?: string;
|
|
69
|
+
pushed: string[];
|
|
70
|
+
pull: WorkspacePullResult;
|
|
71
|
+
/** The pull after the first push to a new ref that the remote started with the files of another ref. */
|
|
72
|
+
after?: WorkspacePullResult;
|
|
73
|
+
}
|
|
74
|
+
export interface WorkspaceStatus {
|
|
75
|
+
workspace: string;
|
|
76
|
+
dir: string;
|
|
77
|
+
ref: string;
|
|
78
|
+
remote?: string;
|
|
79
|
+
head: string | null;
|
|
80
|
+
local: WorkspaceLocalChanges;
|
|
81
|
+
/** Local derived files, such as translations, whose `derivedFrom` source changed or is gone. */
|
|
82
|
+
stale: WorkspaceStaleFile[];
|
|
83
|
+
/** Paths that changed on the remote ref since `head`. Set when the status asked the remote. */
|
|
84
|
+
remoteChanges?: Array<{
|
|
85
|
+
path: string;
|
|
86
|
+
change: "added" | "changed" | "deleted";
|
|
87
|
+
}>;
|
|
88
|
+
remoteHead?: string | null;
|
|
89
|
+
}
|
|
90
|
+
interface WorkspaceCheckoutContext {
|
|
91
|
+
call: WorkspaceCheckoutCall;
|
|
92
|
+
rootDir: string;
|
|
93
|
+
}
|
|
94
|
+
interface WorkspacePullOptions {
|
|
95
|
+
workspace?: string;
|
|
96
|
+
dir?: string;
|
|
97
|
+
ref?: string;
|
|
98
|
+
remote?: string;
|
|
99
|
+
/** Paths that take the remote version, also when you changed them. */
|
|
100
|
+
theirs?: string[];
|
|
101
|
+
}
|
|
102
|
+
/** Merges the remote changes into each checkout folder and updates the lock file. */
|
|
103
|
+
export declare function pullWorkspaces(context: WorkspaceCheckoutContext, options?: WorkspacePullOptions): Promise<WorkspacePullResult[]>;
|
|
104
|
+
interface WorkspacePushOptions {
|
|
105
|
+
workspace?: string;
|
|
106
|
+
message?: string;
|
|
107
|
+
/** Write files that someone else holds an edit lease on, such as a Content document open in the Console. */
|
|
108
|
+
overrideLease?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** Pulls, then commits the local changes of each checkout folder to its ref. Refuses while a conflict is open. */
|
|
111
|
+
export declare function pushWorkspaces(context: WorkspaceCheckoutContext, options?: WorkspacePushOptions): Promise<WorkspacePushResult[]>;
|
|
112
|
+
interface WorkspaceStatusOptions {
|
|
113
|
+
workspace?: string;
|
|
114
|
+
/** Also ask the remote which files changed since the last pull. */
|
|
115
|
+
remote?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** The local changes of each checkout folder, and with `remote`, the remote changes since the last pull. */
|
|
118
|
+
export declare function workspaceStatus(context: WorkspaceCheckoutContext, options?: WorkspaceStatusOptions): Promise<WorkspaceStatus[]>;
|
|
119
|
+
/** The state of one checkout as text: its ref and head, local changes and conflicts, and remote changes when read. */
|
|
120
|
+
export declare function formatWorkspaceStatus(status: WorkspaceStatus): string;
|
|
121
|
+
/**
|
|
122
|
+
* The local state of every checkout of `vitehub.lock`, without asking the remote, or undefined when the project has no
|
|
123
|
+
* lock file. `vitehub status` shows it.
|
|
124
|
+
*/
|
|
125
|
+
export declare function localCheckoutStatus(rootDir: string): Promise<WorkspaceStatus[] | undefined>;
|
|
126
|
+
/** Marks conflicts without markers, such as binary files, as resolved: the local file is what the next push sends. */
|
|
127
|
+
export declare function resolveWorkspaceConflicts(rootDir: string, workspace: string, paths: readonly string[]): Promise<string[]>;
|
|
128
|
+
//#endregion
|