Skip to content

Commit

Permalink
feat: ignore **/fixtures/** by default
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 13, 2024
1 parent 1f1b4e9 commit a7c7c20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ export const LOG_LEVELS = ['debug', 'info', 'warn', 'error', 'silent'] as const

export const MODE_CHOICES = ['default', 'major', 'minor', 'patch', 'latest', 'newest', 'next'] as const

export const DEFAULT_IGNORE_PATHS = [
'**/node_modules/**',
'**/dist/**',
'**/public/**',
'**/fixture/**',
'**/fixtures/**',
]

export const DEFAULT_COMMON_OPTIONS: CommonOptions = {
cwd: '',
loglevel: 'info',
Expand Down
8 changes: 3 additions & 5 deletions src/io/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fg from 'fast-glob'
import detectIndent from 'detect-indent'
import type { CommonOptions, PackageMeta, RawDep } from '../types'
import { createDependenciesFilter } from '../utils/dependenciesFilter'
import { DEFAULT_IGNORE_PATHS } from '../constants'
import { dumpDependencies, getByPath, parseDependencies, parseDependency, setByPath } from './dependencies'

export async function readJSON(filepath: string) {
Expand Down Expand Up @@ -95,13 +96,10 @@ export async function loadPackages(options: CommonOptions) {

if (options.recursive) {
packagesNames = await fg('**/package.json', {
ignore: [
'**/node_modules/**',
'**/dist/**',
'**/public/**',
].concat(options.ignorePaths || []),
ignore: DEFAULT_IGNORE_PATHS.concat(options.ignorePaths || []),
cwd: options.cwd,
onlyFiles: true,
dot: false,
})
}
else {
Expand Down

0 comments on commit a7c7c20

Please sign in to comment.