mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
Keep Git status and diffs current across platforms (#2775)
* fix(server): make Git observation cross-platform Platform-specific watchers and forced full refreshes amplified Git processes and could miss nested changes. Share checkout and repository observation internally, scope final-state refreshes, and bound degraded polling so streamed summaries and diffs stay correct under bursts. * fix(server): refresh Git worktree state on metadata changes * fix(server): keep Git watcher runtime inputs current * fix(server): normalize watcher runtime boundaries * fix(server): reconcile Git observer topology * test(server): report Git watcher event batches * fix(server): close Git observation gaps * chore(ci): remove temporary Git observation jobs
This commit is contained in:
@@ -14,11 +14,30 @@
|
||||
|
||||
import { nodeFileTrace } from "@vercel/nft";
|
||||
import { glob } from "node:fs/promises";
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
const REPO_ROOT = path.resolve(import.meta.dirname, "..");
|
||||
|
||||
function toTracePath(absolutePath) {
|
||||
return path.relative(REPO_ROOT, absolutePath).split(path.sep).join("/");
|
||||
}
|
||||
|
||||
function parcelWatcherNativePackagePath() {
|
||||
const requireFromRepo = createRequire(path.join(REPO_ROOT, "package.json"));
|
||||
requireFromRepo("@parcel/watcher");
|
||||
|
||||
const nativeAddonPath = Object.keys(requireFromRepo.cache)
|
||||
.map(toTracePath)
|
||||
.find((file) => /^node_modules\/@parcel\/watcher-[^/]+\/watcher\.node$/.test(file));
|
||||
if (!nativeAddonPath) {
|
||||
throw new Error("@parcel/watcher loaded without a platform native addon");
|
||||
}
|
||||
|
||||
return path.posix.dirname(nativeAddonPath);
|
||||
}
|
||||
|
||||
const { sherpaPlatformPackageName } = await import(
|
||||
pathToFileURL(
|
||||
path.join(
|
||||
@@ -65,6 +84,10 @@ const additionalInputs = [
|
||||
// the Nix derivation builds for one platform at a time and ships only
|
||||
// its own binaries.
|
||||
`node_modules/node-pty/prebuilds/${process.platform}-${process.arch}/**`,
|
||||
// @parcel/watcher dynamically resolves its optional platform package. npm's
|
||||
// build closure can contain multiple libc variants, so copy the package the
|
||||
// wrapper actually loaded rather than every installed optional package.
|
||||
`${parcelWatcherNativePackagePath()}/**`,
|
||||
// sherpa-onnx-node dynamically resolves a platform-specific native package.
|
||||
// Copy the wrapper plus the host platform package explicitly.
|
||||
"node_modules/sherpa-onnx-node/**",
|
||||
|
||||
Reference in New Issue
Block a user