Skip to content

Commit 3c1bb1c

Browse files
chore: 0.2.1 (#53)
* chore: Lint * chore: 0.2.1
1 parent ac2df7c commit 3c1bb1c

3 files changed

Lines changed: 3 additions & 57 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@anthropic-ai/dxt",
33
"description": "Tools for building Desktop Extensions",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.js",
@@ -77,4 +77,4 @@
7777
"@babel/helpers": "7.27.1",
7878
"@babel/parser": "7.27.3"
7979
}
80-
}
80+
}

src/node/files.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -62,60 +62,6 @@ export function readDxtIgnorePatterns(baseDir: string): string[] {
6262
}
6363
}
6464

65-
/**
66-
* Tests if a file path matches a given pattern
67-
*/
68-
function matchesPattern(
69-
pattern: string,
70-
filePath: string,
71-
fileName: string,
72-
): boolean {
73-
if (pattern.includes("*")) {
74-
// Enhanced glob matching to handle directory paths like "temp/*"
75-
let patternToMatch = pattern;
76-
77-
// Handle patterns like "dir/" by converting to "dir/**"
78-
if (pattern.endsWith("/")) {
79-
patternToMatch = pattern + "**";
80-
}
81-
82-
// Convert glob pattern to regex, with case sensitivity
83-
const regexPattern =
84-
"^" +
85-
patternToMatch
86-
.replace(/\./g, "\\.") // Escape dots
87-
.replace(/\*\*/g, ".*") // ** matches anything including /
88-
.replace(/\*/g, "[^/]*") + // * matches anything except /
89-
"$";
90-
91-
const regex = new RegExp(regexPattern);
92-
93-
// Test full path
94-
if (regex.test(filePath)) return true;
95-
96-
// Test filename
97-
if (regex.test(fileName)) return true;
98-
99-
// Check if any part of the path matches for patterns like "node_modules"
100-
const pathParts = filePath.split(sep);
101-
for (const part of pathParts) {
102-
if (regex.test(part)) return true;
103-
}
104-
} else {
105-
// Exact match
106-
if (fileName === pattern) return true;
107-
108-
// Check if any part of the path matches
109-
if (filePath.includes(pattern)) return true;
110-
111-
// Handle directory patterns like "tests/"
112-
if (pattern.endsWith("/") && filePath.startsWith(pattern)) {
113-
return true;
114-
}
115-
}
116-
return false;
117-
}
118-
11965
function buildIgnoreChecker(additionalPatterns: string[]) {
12066
return ignore().add(EXCLUDE_PATTERNS).add(additionalPatterns);
12167
}

src/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const DxtUserConfigurationOptionSchema = z.object({
7373

7474
export const DxtUserConfigValuesSchema = z.record(
7575
z.string(),
76-
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])
76+
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
7777
);
7878

7979
export const DxtManifestSchema = z.object({

0 commit comments

Comments
 (0)