cleanup(vue): migrate to picomatch (#30483)
This commit is contained in:
parent
0eef86ee20
commit
6d36be0d24
@ -4,7 +4,15 @@
|
|||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
"rules": {}
|
"rules": {
|
||||||
|
"no-restricted-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"name": "minimatch",
|
||||||
|
"message": "Please use `picomatch` instead."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx"],
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
"migrations": "./migrations.json"
|
"migrations": "./migrations.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimatch": "9.0.3",
|
"picomatch": "^4.0.2",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"@nx/devkit": "file:../devkit",
|
"@nx/devkit": "file:../devkit",
|
||||||
"@nx/js": "file:../js",
|
"@nx/js": "file:../js",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import {
|
|||||||
import { basename, join } from 'path';
|
import { basename, join } from 'path';
|
||||||
import { nxVersion } from '../../utils/versions';
|
import { nxVersion } from '../../utils/versions';
|
||||||
import { createComponentStories } from './lib/component-story';
|
import { createComponentStories } from './lib/component-story';
|
||||||
import { minimatch } from 'minimatch';
|
import picomatch = require('picomatch');
|
||||||
|
|
||||||
export interface StorybookStoriesSchema {
|
export interface StorybookStoriesSchema {
|
||||||
project: string;
|
project: string;
|
||||||
@ -43,7 +43,7 @@ export async function createAllStories(
|
|||||||
visitNotIgnoredFiles(tree, p, (path) => {
|
visitNotIgnoredFiles(tree, p, (path) => {
|
||||||
// Ignore private files starting with "_".
|
// Ignore private files starting with "_".
|
||||||
if (basename(path).startsWith('_')) return;
|
if (basename(path).startsWith('_')) return;
|
||||||
if (ignorePaths?.some((pattern) => minimatch(path, pattern))) return;
|
if (ignorePaths?.some((pattern) => picomatch(pattern)(path))) return;
|
||||||
if (path.endsWith('.vue')) {
|
if (path.endsWith('.vue')) {
|
||||||
// Let's see if the .stories.* file exists
|
// Let's see if the .stories.* file exists
|
||||||
const ext = path.slice(path.lastIndexOf('.'));
|
const ext = path.slice(path.lastIndexOf('.'));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user