Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions javascript/packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
},
"dependencies": {
"@herb-tools/core": "0.8.6",
"picomatch": "^4.0.2",
"tinyglobby": "^0.2.15",
"yaml": "^2.8.2"
},
"devDependencies": {
"@types/minimatch": "^6.0.0",
"glob": "^13.0.0",
"minimatch": "^10.1.1",
"@types/picomatch": "^3.0.1",
"zod": "^4.1.13",
"zod-validation-error": "^5.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions javascript/packages/config/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
format: "esm",
sourcemap: true,
},
external: ["yaml", "fs", "path"],
external: ["yaml", "fs", "path", "picomatch", "tinyglobby"],
plugins: [
nodeResolve(),
json(),
Expand All @@ -33,7 +33,7 @@ export default [
format: "cjs",
sourcemap: true,
},
external: ["yaml", "fs", "path"],
external: ["yaml", "fs", "path", "picomatch", "tinyglobby"],
plugins: [
nodeResolve(),
json(),
Expand Down
9 changes: 4 additions & 5 deletions javascript/packages/config/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { promises as fs } from "fs"
import { stringify, parse, parseDocument, isMap } from "yaml"
import { ZodError } from "zod"
import { fromZodError } from "zod-validation-error"
import { minimatch } from "minimatch"
import { glob } from "glob"
import picomatch from "picomatch"
import { glob } from "tinyglobby"

import { DiagnosticSeverity } from "@herb-tools/core"
import { HerbConfigSchema } from "./config-schema.js"
Expand Down Expand Up @@ -226,7 +226,6 @@ export class Config {
return await glob(patterns, {
cwd: searchDir,
absolute: true,
nodir: true,
ignore: filesConfig.exclude || []
})
}
Expand Down Expand Up @@ -260,7 +259,7 @@ export class Config {
return false
}

return excludePatterns.some(pattern => minimatch(filePath, pattern))
return excludePatterns.some(pattern => picomatch.isMatch(filePath, pattern))
}

/**
Expand All @@ -274,7 +273,7 @@ export class Config {
return true
}

return includePatterns.some(pattern => minimatch(filePath, pattern))
return includePatterns.some(pattern => picomatch.isMatch(filePath, pattern))
}

/**
Expand Down
3 changes: 2 additions & 1 deletion javascript/packages/formatter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"@herb-tools/config": "0.8.6",
"@herb-tools/core": "0.8.6",
"@herb-tools/printer": "0.8.6",
"@herb-tools/rewriter": "0.8.6"
"@herb-tools/rewriter": "0.8.6",
"tinyglobby": "^0.2.15"
},
"files": [
"package.json",
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/formatter/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dedent from "dedent"
import { readFileSync, writeFileSync, statSync } from "fs"
import { glob } from "glob"
import { glob } from "tinyglobby"
import { resolve, relative } from "path"

import { Herb } from "@herb-tools/node-wasm"
Expand Down
3 changes: 2 additions & 1 deletion javascript/packages/linter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"@herb-tools/node-wasm": "0.8.6",
"@herb-tools/printer": "0.8.6",
"@herb-tools/rewriter": "0.8.6",
"glob": "^13.0.0"
"picomatch": "^4.0.2",
"tinyglobby": "^0.2.15"
},
"files": [
"package.json",
Expand Down
4 changes: 2 additions & 2 deletions javascript/packages/linter/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default [
format: "esm",
sourcemap: true,
},
external: ["@herb-tools/core", "@herb-tools/node-wasm"],
external: ["@herb-tools/core", "@herb-tools/node-wasm", "picomatch", "tinyglobby"],
plugins: [
nodeResolve(),
json(),
Expand All @@ -70,7 +70,7 @@ export default [
format: "cjs",
sourcemap: true,
},
external: ["@herb-tools/core", "@herb-tools/node-wasm"],
external: ["@herb-tools/core", "@herb-tools/node-wasm", "picomatch", "tinyglobby"],
plugins: [
nodeResolve(),
commonjs(),
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/linter/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { glob } from "glob"
import { glob } from "tinyglobby"
import { Herb } from "@herb-tools/node-wasm"
import { Config, addHerbExtensionRecommendation, getExtensionsJsonRelativePath } from "@herb-tools/config"

Expand Down
4 changes: 2 additions & 2 deletions javascript/packages/linter/src/linter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Location } from "@herb-tools/core"
import { IdentityPrinter } from "@herb-tools/printer"
import { minimatch } from "minimatch"
import picomatch from "picomatch"

import { rules } from "./rules.js"
import { findNodeByLocation } from "./rules/rule-utils.js"
Expand Down Expand Up @@ -191,7 +191,7 @@ export class Linter {
const defaultExclude = rule.defaultConfig?.exclude ?? DEFAULT_RULE_CONFIG.exclude

if (defaultExclude && defaultExclude.length > 0) {
const isExcluded = defaultExclude.some((pattern: string) => minimatch(context.fileName!, pattern))
const isExcluded = defaultExclude.some(pattern => picomatch.isMatch(context.fileName!, pattern))

if (isExcluded) {
return []
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/printer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@herb-tools/core": "0.8.6",
"glob": "^13.0.0"
"tinyglobby": "^0.2.15"
},
"files": [
"package.json",
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/printer/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import dedent from "dedent"

import { readFileSync, writeFileSync, existsSync } from "fs"
import { resolve } from "path"
import { glob } from "glob"
import { glob } from "tinyglobby"

import { Herb } from "@herb-tools/node-wasm"
import { Config } from "@herb-tools/config"
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/rewriter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@herb-tools/core": "0.8.6",
"@herb-tools/tailwind-class-sorter": "0.8.6",
"glob": "^13.0.0"
"tinyglobby": "^0.2.15"
},
"devDependencies": {
"@herb-tools/printer": "0.8.6"
Expand Down
3 changes: 2 additions & 1 deletion javascript/packages/rewriter/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const external = [
"url",
"fs",
"module",
"@herb-tools/tailwind-class-sorter"
"@herb-tools/tailwind-class-sorter",
"tinyglobby"
]

function isExternal(id) {
Expand Down
5 changes: 2 additions & 3 deletions javascript/packages/rewriter/src/custom-rewriter-loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pathToFileURL } from "url"
import { glob } from "glob"
import { glob } from "tinyglobby"
import { isRewriterClass } from "./type-guards.js"

import type { RewriterClass } from "./type-guards.js"
Expand Down Expand Up @@ -61,8 +61,7 @@ export class CustomRewriterLoader {
try {
const files = await glob(pattern, {
cwd: this.baseDir,
absolute: true,
nodir: true
absolute: true
})

allFiles.push(...files)
Expand Down
2 changes: 1 addition & 1 deletion javascript/packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"@herb-tools/linter": "0.8.6",
"@herb-tools/node-wasm": "0.8.6",
"@types/node": "24.x",
"@types/vscode": "^1.43.0",
"@types/vscode": "^1.107.0",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.1",
"@vscode/test-cli": "^0.0.12",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"concurrently": "^9.2.0",
"dedent": "^1.7.0",
"esbuild-plugin-copy": "^2.1.1",
"minimatch": "^10.0.3",
"picomatch": "^4.0.2",
"nx": "22.3.3",
"oxlint": "^1.35.0",
"playwright": "^1.57.0",
Expand Down
Loading
Loading