Merge branch 'main' into async-file-tools

This commit is contained in:
Armin Ronacher
2026-05-20 11:57:19 +02:00
112 changed files with 108 additions and 18469 deletions
@@ -30,7 +30,7 @@ import { minimatch } from "minimatch";
import { CONFIG_DIR_NAME } from "../config.ts";
import { spawnProcess, spawnProcessSync } from "../utils/child-process.ts";
import { type GitSource, parseGitUrl } from "../utils/git.ts";
import { canonicalizePath, isLocalPath } from "../utils/paths.ts";
import { canonicalizePath, isLocalPath, markPathIgnoredByCloudSync } from "../utils/paths.ts";
import { isStdoutTakenOver } from "./output-guard.ts";
import type { PackageSource, SettingsManager } from "./settings-manager.ts";
@@ -1822,6 +1822,7 @@ export class DefaultPackageManager implements PackageManager {
if (!existsSync(installRoot)) {
mkdirSync(installRoot, { recursive: true });
}
markPathIgnoredByCloudSync(installRoot);
this.ensureGitIgnore(installRoot);
const packageJsonPath = join(installRoot, "package.json");
if (!existsSync(packageJsonPath)) {
+1
View File
@@ -349,5 +349,6 @@ export {
// Clipboard utilities
export { copyToClipboard } from "./utils/clipboard.ts";
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.ts";
export { formatDimensionNote, type ResizedImage, resizeImage } from "./utils/image-resize.ts";
// Shell utilities
export { getShellConfig } from "./utils/shell.ts";
@@ -16,7 +16,7 @@ function sanitizeStatusText(text: string): string {
}
/**
* Format token counts (similar to web-ui)
* Format token counts for compact footer display.
*/
function formatTokens(count: number): string {
if (count < 1000) return count.toString();
+18
View File
@@ -1,5 +1,6 @@
import { realpathSync } from "node:fs";
import { isAbsolute, relative, resolve as resolvePath, sep } from "node:path";
import { spawnProcessSync } from "./child-process.ts";
/**
* Resolve a path to its canonical (real) form, following symlinks.
@@ -55,3 +56,20 @@ export function formatPathRelativeToCwdOrAbsolute(filePath: string, cwd: string)
const absolutePath = resolveAgainstCwd(filePath, cwd);
return (getCwdRelativePath(absolutePath, cwd) ?? absolutePath).split(sep).join("/");
}
export function markPathIgnoredByCloudSync(path: string): void {
const attrs =
process.platform === "darwin"
? ["com.dropbox.ignored", "com.apple.fileprovider.ignore#P"]
: process.platform === "linux"
? ["user.com.dropbox.ignored"]
: [];
for (const attr of attrs) {
if (process.platform === "darwin") {
spawnProcessSync("xattr", ["-w", attr, "1", path], { encoding: "utf-8", stdio: "ignore" });
} else {
spawnProcessSync("setfattr", ["-n", attr, "-v", "1", path], { encoding: "utf-8", stdio: "ignore" });
}
}
}