@remixhq/core 0.1.37 → 0.1.38
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/collab.d.ts +4 -0
- package/dist/collab.js +13 -2
- package/package.json +1 -1
package/dist/collab.d.ts
CHANGED
|
@@ -154,12 +154,15 @@ declare function collabApprove(params: {
|
|
|
154
154
|
allowBranchMismatch?: boolean;
|
|
155
155
|
}): Promise<CollabApproveResult>;
|
|
156
156
|
|
|
157
|
+
type CheckoutPhase = "downloading" | "unpacking" | "finalizing";
|
|
158
|
+
|
|
157
159
|
declare function collabCheckout(params: {
|
|
158
160
|
api: CollabApiClient;
|
|
159
161
|
cwd: string;
|
|
160
162
|
appId?: string | null;
|
|
161
163
|
outputDir?: string | null;
|
|
162
164
|
skipLaneMaterialization?: boolean;
|
|
165
|
+
onPhase?: (phase: CheckoutPhase) => void;
|
|
163
166
|
}): Promise<{
|
|
164
167
|
appId: string;
|
|
165
168
|
dashboardUrl: string;
|
|
@@ -391,6 +394,7 @@ declare function collabRemix(params: {
|
|
|
391
394
|
appId?: string | null;
|
|
392
395
|
name?: string | null;
|
|
393
396
|
outputDir?: string | null;
|
|
397
|
+
onPhase?: (phase: CheckoutPhase) => void;
|
|
394
398
|
}): Promise<{
|
|
395
399
|
appId: string;
|
|
396
400
|
dashboardUrl: string;
|
package/dist/collab.js
CHANGED
|
@@ -4754,10 +4754,19 @@ async function materializeAppCheckout(params) {
|
|
|
4754
4754
|
const repoRoot = destination.explicitOutputDir ? await reserveDirectory(destination.preferredRepoRoot) : await reserveAvailableDirPath(destination.preferredRepoRoot);
|
|
4755
4755
|
const bundleTempDir = await fs7.mkdtemp(path8.join(os4.tmpdir(), "remix-checkout-"));
|
|
4756
4756
|
const bundlePath = path8.join(bundleTempDir, "repository.bundle");
|
|
4757
|
+
const phase = (next) => {
|
|
4758
|
+
try {
|
|
4759
|
+
params.onPhase?.(next);
|
|
4760
|
+
} catch {
|
|
4761
|
+
}
|
|
4762
|
+
};
|
|
4757
4763
|
try {
|
|
4764
|
+
phase("downloading");
|
|
4758
4765
|
const bundle = await params.api.downloadAppBundle(params.appId);
|
|
4766
|
+
phase("unpacking");
|
|
4759
4767
|
await fs7.writeFile(bundlePath, bundle.data);
|
|
4760
4768
|
await cloneGitBundleToDirectory(bundlePath, repoRoot);
|
|
4769
|
+
phase("finalizing");
|
|
4761
4770
|
if (params.expectedBranchName?.trim()) {
|
|
4762
4771
|
await checkoutLocalBranch(repoRoot, params.expectedBranchName.trim());
|
|
4763
4772
|
}
|
|
@@ -4809,7 +4818,8 @@ async function collabCheckout(params) {
|
|
|
4809
4818
|
defaultDirName: sanitizeCheckoutDirName(String(app.name || app.id)),
|
|
4810
4819
|
expectedBranchName: authoritativeBranchName,
|
|
4811
4820
|
expectedRemoteUrl: authoritativeRemoteUrl,
|
|
4812
|
-
expectedDefaultBranch: authoritativeDefaultBranch
|
|
4821
|
+
expectedDefaultBranch: authoritativeDefaultBranch,
|
|
4822
|
+
onPhase: params.onPhase
|
|
4813
4823
|
});
|
|
4814
4824
|
const upstreamAppId = String(app.forkedFromAppId ?? app.id);
|
|
4815
4825
|
const laneId = typeof collab?.laneId === "string" ? collab.laneId : null;
|
|
@@ -6742,7 +6752,8 @@ async function collabRemix(params) {
|
|
|
6742
6752
|
defaultDirName: sanitizeCheckoutDirName(String(params.name?.trim() || app.name || app.id)),
|
|
6743
6753
|
expectedBranchName: authoritativeBranchName,
|
|
6744
6754
|
expectedRemoteUrl: authoritativeRemoteUrl,
|
|
6745
|
-
expectedDefaultBranch: authoritativeDefaultBranch
|
|
6755
|
+
expectedDefaultBranch: authoritativeDefaultBranch,
|
|
6756
|
+
onPhase: params.onPhase
|
|
6746
6757
|
});
|
|
6747
6758
|
const laneId = typeof collab?.laneId === "string" ? collab.laneId : null;
|
|
6748
6759
|
const repoFingerprint = typeof source?.repoFingerprint === "string" ? source.repoFingerprint : checkout.repoFingerprint;
|