find-packages
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -16,5 +16,3 @@ "use strict"; | ||
globOpts.ignore = opts.ignore || DEFAULT_IGNORE; | ||
globOpts.patterns = opts.patterns | ||
? normalizePatterns(opts.patterns) | ||
: ['**/package.{json,yaml,json5}']; | ||
globOpts.patterns = normalizePatterns(opts.patterns ? opts.patterns : ['.', '**']); | ||
const paths = await fastGlob(globOpts.patterns, globOpts); | ||
@@ -37,3 +35,11 @@ return pFilter(paths | ||
function normalizePatterns(patterns) { | ||
return patterns.map((pattern) => pattern.replace(/\/?$/, '/package.{json,yaml,json5}')); | ||
const normalizedPatterns = []; | ||
for (const pattern of patterns) { | ||
// We should add separate pattern for each extension | ||
// for some reason, fast-glob is buggy with /package.{json,yaml,json5} pattern | ||
normalizedPatterns.push(pattern.replace(/\/?$/, '/package.json')); | ||
normalizedPatterns.push(pattern.replace(/\/?$/, '/package.json5')); | ||
normalizedPatterns.push(pattern.replace(/\/?$/, '/package.yaml')); | ||
} | ||
return normalizedPatterns; | ||
} | ||
@@ -40,0 +46,0 @@ // for backward compatibility |
{ | ||
"name": "find-packages", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Find all packages inside a directory", | ||
@@ -14,4 +14,3 @@ "main": "lib/index.js", | ||
"tsc": "tsc", | ||
"prepublishOnly": "pnpm run tsc", | ||
"md": "mos" | ||
"prepublishOnly": "pnpm run tsc" | ||
}, | ||
@@ -23,10 +22,2 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/find-packages", | ||
], | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
], | ||
"installation": { | ||
"useShortAlias": true | ||
} | ||
}, | ||
"author": { | ||
@@ -50,4 +41,2 @@ "name": "Zoltan Kochan", | ||
"find-packages": "link:", | ||
"mos": "^2.0.0-alpha.3", | ||
"mos-plugin-readme": "^1.0.4", | ||
"tape": "^4.6.3", | ||
@@ -59,3 +48,3 @@ "ts-node": "^8.0.1", | ||
"dependencies": { | ||
"@pnpm/read-importer-manifest": "1.0.1", | ||
"@pnpm/read-importer-manifest": "1.0.2", | ||
"fast-glob": "^2.0.4", | ||
@@ -62,0 +51,0 @@ "p-filter": "^2.0.0" |
@@ -51,2 +51,2 @@ # find-packages | ||
[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io) | ||
MIT © [Zoltan Kochan](https://www.kochan.io) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7015
8
51
+ Added@pnpm/read-importer-manifest@1.0.2(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedparse-json@4.0.0(transitive)
- Removed@pnpm/read-importer-manifest@1.0.1(transitive)