cleanup(angular): migrate to picomatch (#30081)
This commit is contained in:
parent
013da9ea1c
commit
8575fa1495
@ -262,6 +262,7 @@
|
|||||||
"parse-markdown-links": "^1.0.4",
|
"parse-markdown-links": "^1.0.4",
|
||||||
"parse5": "4.0.0",
|
"parse5": "4.0.0",
|
||||||
"picocolors": "^1.1.0",
|
"picocolors": "^1.1.0",
|
||||||
|
"picomatch": "4.0.2",
|
||||||
"piscina": "^4.4.0",
|
"piscina": "^4.4.0",
|
||||||
"postcss": "8.4.38",
|
"postcss": "8.4.38",
|
||||||
"postcss-import": "~14.1.0",
|
"postcss-import": "~14.1.0",
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
"@typescript-eslint/",
|
"@typescript-eslint/",
|
||||||
"picocolors",
|
"picocolors",
|
||||||
"ignore",
|
"ignore",
|
||||||
"minimatch",
|
"picomatch",
|
||||||
"rxjs-for-await",
|
"rxjs-for-await",
|
||||||
"webpack-merge",
|
"webpack-merge",
|
||||||
"ts-node",
|
"ts-node",
|
||||||
|
|||||||
@ -52,8 +52,8 @@
|
|||||||
"@typescript-eslint/type-utils": "^8.0.0",
|
"@typescript-eslint/type-utils": "^8.0.0",
|
||||||
"enquirer": "~2.3.6",
|
"enquirer": "~2.3.6",
|
||||||
"picocolors": "^1.1.0",
|
"picocolors": "^1.1.0",
|
||||||
|
"picomatch": "4.0.2",
|
||||||
"magic-string": "~0.30.2",
|
"magic-string": "~0.30.2",
|
||||||
"minimatch": "9.0.3",
|
|
||||||
"semver": "^7.5.3",
|
"semver": "^7.5.3",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"webpack-merge": "^5.8.0",
|
"webpack-merge": "^5.8.0",
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import {
|
|||||||
import { getProjectEntryPoints } from '../utils/storybook-ast/entry-point';
|
import { getProjectEntryPoints } from '../utils/storybook-ast/entry-point';
|
||||||
import { getModuleFilePaths } from '../utils/storybook-ast/module-info';
|
import { getModuleFilePaths } from '../utils/storybook-ast/module-info';
|
||||||
import type { StoriesGeneratorOptions } from './schema';
|
import type { StoriesGeneratorOptions } from './schema';
|
||||||
import { minimatch } from 'minimatch';
|
import picomatch = require('picomatch');
|
||||||
import { nxVersion } from '../../utils/versions';
|
import { nxVersion } from '../../utils/versions';
|
||||||
|
|
||||||
export async function angularStoriesGenerator(
|
export async function angularStoriesGenerator(
|
||||||
@ -37,13 +37,12 @@ export async function angularStoriesGenerator(
|
|||||||
const componentInfos = componentsInfo.filter(
|
const componentInfos = componentsInfo.filter(
|
||||||
(f) =>
|
(f) =>
|
||||||
!options.ignorePaths?.some((pattern) => {
|
!options.ignorePaths?.some((pattern) => {
|
||||||
const shouldIgnorePath = minimatch(
|
const shouldIgnorePath = picomatch(pattern)(
|
||||||
joinPathFragments(
|
joinPathFragments(
|
||||||
f.moduleFolderPath,
|
f.moduleFolderPath,
|
||||||
f.path,
|
f.path,
|
||||||
`${f.componentFileName}.ts`
|
`${f.componentFileName}.ts`
|
||||||
),
|
)
|
||||||
pattern
|
|
||||||
);
|
);
|
||||||
return shouldIgnorePath;
|
return shouldIgnorePath;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { type Tree, formatFiles, visitNotIgnoredFiles } from '@nx/devkit';
|
import { type Tree, formatFiles, visitNotIgnoredFiles } from '@nx/devkit';
|
||||||
import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils';
|
import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils';
|
||||||
import { minimatch } from 'minimatch';
|
import picomatch = require('picomatch');
|
||||||
import { tsquery } from '@phenomnomnominal/tsquery';
|
import { tsquery } from '@phenomnomnominal/tsquery';
|
||||||
|
|
||||||
export default async function (tree: Tree) {
|
export default async function (tree: Tree) {
|
||||||
visitNotIgnoredFiles(tree, '', (path) => {
|
visitNotIgnoredFiles(tree, '', (path) => {
|
||||||
const webpackConfigGlob = '**/webpack*.config*.{js,ts,mjs,cjs}';
|
const webpackConfigGlob = '**/webpack*.config*.{js,ts,mjs,cjs}';
|
||||||
const result = minimatch(path, webpackConfigGlob);
|
const result = picomatch(webpackConfigGlob)(path);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -871,6 +871,9 @@ importers:
|
|||||||
picocolors:
|
picocolors:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0
|
version: 1.1.0
|
||||||
|
picomatch:
|
||||||
|
specifier: 4.0.2
|
||||||
|
version: 4.0.2
|
||||||
piscina:
|
piscina:
|
||||||
specifier: ^4.4.0
|
specifier: ^4.4.0
|
||||||
version: 4.7.0
|
version: 4.7.0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user