diff --git a/package.json b/package.json index 3771938..b145785 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@anthropic-ai/dxt", "description": "Tools for building Desktop Extensions", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "main": "dist/index.js", "module": "dist/index.js", @@ -77,4 +77,4 @@ "@babel/helpers": "7.27.1", "@babel/parser": "7.27.3" } -} +} \ No newline at end of file diff --git a/src/node/files.ts b/src/node/files.ts index eeb0e20..2adbafe 100644 --- a/src/node/files.ts +++ b/src/node/files.ts @@ -62,60 +62,6 @@ export function readDxtIgnorePatterns(baseDir: string): string[] { } } -/** - * Tests if a file path matches a given pattern - */ -function matchesPattern( - pattern: string, - filePath: string, - fileName: string, -): boolean { - if (pattern.includes("*")) { - // Enhanced glob matching to handle directory paths like "temp/*" - let patternToMatch = pattern; - - // Handle patterns like "dir/" by converting to "dir/**" - if (pattern.endsWith("/")) { - patternToMatch = pattern + "**"; - } - - // Convert glob pattern to regex, with case sensitivity - const regexPattern = - "^" + - patternToMatch - .replace(/\./g, "\\.") // Escape dots - .replace(/\*\*/g, ".*") // ** matches anything including / - .replace(/\*/g, "[^/]*") + // * matches anything except / - "$"; - - const regex = new RegExp(regexPattern); - - // Test full path - if (regex.test(filePath)) return true; - - // Test filename - if (regex.test(fileName)) return true; - - // Check if any part of the path matches for patterns like "node_modules" - const pathParts = filePath.split(sep); - for (const part of pathParts) { - if (regex.test(part)) return true; - } - } else { - // Exact match - if (fileName === pattern) return true; - - // Check if any part of the path matches - if (filePath.includes(pattern)) return true; - - // Handle directory patterns like "tests/" - if (pattern.endsWith("/") && filePath.startsWith(pattern)) { - return true; - } - } - return false; -} - function buildIgnoreChecker(additionalPatterns: string[]) { return ignore().add(EXCLUDE_PATTERNS).add(additionalPatterns); } diff --git a/src/schemas.ts b/src/schemas.ts index 266ad97..eebb4c2 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -73,7 +73,7 @@ export const DxtUserConfigurationOptionSchema = z.object({ export const DxtUserConfigValuesSchema = z.record( z.string(), - z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]) + z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]), ); export const DxtManifestSchema = z.object({