Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@manypkg/get-packages

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@manypkg/get-packages - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

6

CHANGELOG.md
# @manypkg/get-packages
## 1.1.3
### Patch Changes
- [#122](https://github.com/Thinkmill/manypkg/pull/122) [`7bd4f34`](https://github.com/Thinkmill/manypkg/commit/7bd4f344e1024e880a2de6b571d556adf200f0b6) Thanks [@fz6m](https://github.com/fz6m)! - Fixed getting correct packages in pnpm workspaces with exclude rules.
## 1.1.2

@@ -4,0 +10,0 @@

24

dist/get-packages.cjs.dev.js

@@ -47,3 +47,3 @@ 'use strict';

_regeneratorRuntime.mark(function _callee(dir) {
var cwd, pkg, tool, manifest, lernaJson, root, directories, pkgJsonsMissingNameField, results;
var cwd, pkg, tool, manifest, lernaJson, root, relativeDirectories, directories, pkgJsonsMissingNameField, results;
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -190,3 +190,2 @@ while (1) {

onlyDirectories: true,
absolute: true,
expandDirectories: false,

@@ -197,5 +196,8 @@ ignore: ["**/node_modules"]

case 44:
directories = _context.sent;
relativeDirectories = _context.sent;
directories = relativeDirectories.map(function (p) {
return path.resolve(cwd, p);
});
pkgJsonsMissingNameField = [];
_context.next = 48;
_context.next = 49;
return Promise.all(directories.sort().map(function (dir) {

@@ -220,3 +222,3 @@ return fs.readJson(path.join(dir, "package.json")).then(function (packageJson) {

case 48:
case 49:
_context.t2 = function (x) {

@@ -229,3 +231,3 @@ return x;

if (!(pkgJsonsMissingNameField.length !== 0)) {
_context.next = 53;
_context.next = 54;
break;

@@ -237,3 +239,3 @@ }

case 53:
case 54:
return _context.abrupt("return", {

@@ -248,3 +250,3 @@ tool: tool.type,

case 54:
case 55:
case "end":

@@ -332,9 +334,11 @@ return _context.stop();

var directories = globby.sync(tool.packageGlobs, {
var relativeDirectories = globby.sync(tool.packageGlobs, {
cwd: cwd,
onlyDirectories: true,
absolute: true,
expandDirectories: false,
ignore: ["**/node_modules"]
});
var directories = relativeDirectories.map(function (p) {
return path.resolve(cwd, p);
});
var pkgJsonsMissingNameField = [];

@@ -341,0 +345,0 @@ var results = directories.sort().map(function (dir) {

@@ -26,3 +26,3 @@ "use strict";

return (_getPackages = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(dir) {
var cwd, pkg, tool, manifest, lernaJson, root, directories, pkgJsonsMissingNameField, results;
var cwd, pkg, tool, manifest, lernaJson, root, relativeDirectories, directories, pkgJsonsMissingNameField, results;
return _regeneratorRuntime.wrap(function(_context) {

@@ -124,3 +124,2 @@ for (;;) switch (_context.prev = _context.next) {

onlyDirectories: !0,
absolute: !0,
expandDirectories: !1,

@@ -131,4 +130,5 @@ ignore: [ "**/node_modules" ]

case 44:
return directories = _context.sent, pkgJsonsMissingNameField = [], _context.next = 48,
Promise.all(directories.sort().map(function(dir) {
return relativeDirectories = _context.sent, directories = relativeDirectories.map(function(p) {
return path.resolve(cwd, p);
}), pkgJsonsMissingNameField = [], _context.next = 49, Promise.all(directories.sort().map(function(dir) {
return fs.readJson(path.join(dir, "package.json")).then(function(packageJson) {

@@ -146,7 +146,7 @@ return packageJson.name || pkgJsonsMissingNameField.push(path.relative(cwd, path.join(dir, "package.json"))),

case 48:
case 49:
if (_context.t2 = function(x) {
return x;
}, results = _context.sent.filter(_context.t2), 0 === pkgJsonsMissingNameField.length) {
_context.next = 53;
_context.next = 54;
break;

@@ -156,3 +156,3 @@ }

case 53:
case 54:
return _context.abrupt("return", {

@@ -167,3 +167,3 @@ tool: tool.type,

case 54:
case 55:
case "end":

@@ -222,5 +222,6 @@ return _context.stop();

onlyDirectories: !0,
absolute: !0,
expandDirectories: !1,
ignore: [ "**/node_modules" ]
}).map(function(p) {
return path.resolve(cwd, p);
}), pkgJsonsMissingNameField = [], results = directories.sort().map(function(dir) {

@@ -227,0 +228,0 @@ try {

{
"name": "@manypkg/get-packages",
"version": "1.1.2",
"version": "1.1.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "dist/get-packages.cjs.js",

@@ -72,2 +72,15 @@ import fixturez from "fixturez";

it("should resolve workspace for pnpm with exclude rules", async () => {
const allPackages = await getPackages(f.copy("pnpm-exclude-workspace-case"));
expect(allPackages.packages[0].packageJson.name).toEqual(
"pnpm-exclude-workspace-case-pkg-a"
);
expect(allPackages.packages[1].packageJson.name).toEqual(
"pnpm-exclude-workspace-case-pkg-b"
);
expect(allPackages.packages.length).toEqual(2);
expect(allPackages.tool).toEqual("pnpm");
})
it("should resolve workspaces for lerna", async () => {

@@ -74,0 +87,0 @@ const allPackages = await getPackages(f.copy("lerna-workspace-base"));

@@ -113,9 +113,9 @@ // This is a modified version of the package-getting in bolt

const directories = await globby(tool.packageGlobs, {
const relativeDirectories = await globby(tool.packageGlobs, {
cwd,
onlyDirectories: true,
absolute: true,
expandDirectories: false,
ignore: ["**/node_modules"]
});
const directories = relativeDirectories.map(p => path.resolve(cwd, p))

@@ -238,9 +238,9 @@ let pkgJsonsMissingNameField: Array<string> = [];

}
const directories = globbySync(tool.packageGlobs, {
const relativeDirectories = globbySync(tool.packageGlobs, {
cwd,
onlyDirectories: true,
absolute: true,
expandDirectories: false,
ignore: ["**/node_modules"]
});
const directories = relativeDirectories.map(p => path.resolve(cwd, p))

@@ -247,0 +247,0 @@ let pkgJsonsMissingNameField: Array<string> = [];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc