cleanup(angular): migrate to picomatch (#30081)

This commit is contained in:
James Garbutt 2025-03-22 11:48:22 +00:00 committed by GitHub
parent 013da9ea1c
commit 8575fa1495
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 11 additions and 8 deletions

View File

@ -262,6 +262,7 @@
"parse-markdown-links": "^1.0.4",
"parse5": "4.0.0",
"picocolors": "^1.1.0",
"picomatch": "4.0.2",
"piscina": "^4.4.0",
"postcss": "8.4.38",
"postcss-import": "~14.1.0",

View File

@ -15,7 +15,7 @@
"@typescript-eslint/",
"picocolors",
"ignore",
"minimatch",
"picomatch",
"rxjs-for-await",
"webpack-merge",
"ts-node",

View File

@ -52,8 +52,8 @@
"@typescript-eslint/type-utils": "^8.0.0",
"enquirer": "~2.3.6",
"picocolors": "^1.1.0",
"picomatch": "4.0.2",
"magic-string": "~0.30.2",
"minimatch": "9.0.3",
"semver": "^7.5.3",
"tslib": "^2.3.0",
"webpack-merge": "^5.8.0",

View File

@ -17,7 +17,7 @@ import {
import { getProjectEntryPoints } from '../utils/storybook-ast/entry-point';
import { getModuleFilePaths } from '../utils/storybook-ast/module-info';
import type { StoriesGeneratorOptions } from './schema';
import { minimatch } from 'minimatch';
import picomatch = require('picomatch');
import { nxVersion } from '../../utils/versions';
export async function angularStoriesGenerator(
@ -37,13 +37,12 @@ export async function angularStoriesGenerator(
const componentInfos = componentsInfo.filter(
(f) =>
!options.ignorePaths?.some((pattern) => {
const shouldIgnorePath = minimatch(
const shouldIgnorePath = picomatch(pattern)(
joinPathFragments(
f.moduleFolderPath,
f.path,
`${f.componentFileName}.ts`
),
pattern
)
);
return shouldIgnorePath;
})

View File

@ -1,12 +1,12 @@
import { type Tree, formatFiles, visitNotIgnoredFiles } from '@nx/devkit';
import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils';
import { minimatch } from 'minimatch';
import picomatch = require('picomatch');
import { tsquery } from '@phenomnomnominal/tsquery';
export default async function (tree: Tree) {
visitNotIgnoredFiles(tree, '', (path) => {
const webpackConfigGlob = '**/webpack*.config*.{js,ts,mjs,cjs}';
const result = minimatch(path, webpackConfigGlob);
const result = picomatch(webpackConfigGlob)(path);
if (!result) {
return;
}

3
pnpm-lock.yaml generated
View File

@ -871,6 +871,9 @@ importers:
picocolors:
specifier: ^1.1.0
version: 1.1.0
picomatch:
specifier: 4.0.2
version: 4.0.2
piscina:
specifier: ^4.4.0
version: 4.7.0