Socket
Socket
Sign inDemoInstall

@lerna/create

Package Overview
Dependencies
Maintainers
2
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lerna/create - npm Package Compare versions

Comparing version 6.3.1-beta.8 to 6.4.0

37

index.js

@@ -55,9 +55,15 @@ "use strict";

if (!name && pkgName.includes("/")) {
throw new ValidationError(
"ENOPKGNAME",
"Invalid package name. Use the <loc> positional to specify package directory.\nSee https://github.com/lerna/lerna/tree/main/commands/create#usage for details."
);
}
// optional scope is _not_ included in the directory name
this.dirName = scope ? name.split("/").pop() : name;
this.pkgName = name;
this.pkgsDir =
this.project.packageParentDirs.find((pd) => pd.indexOf(pkgLocation) > -1) ||
this.project.packageParentDirs[0];
this.pkgsDir = this._getPackagesDir(pkgLocation);
this.camelName = camelCase(this.dirName);

@@ -148,2 +154,27 @@

_getPackagesDir(pkgLocation) {
const packageParentDirs = this.project.packageParentDirs;
if (!pkgLocation) {
return packageParentDirs[0];
}
const normalizedPkgLocation = path
.resolve(this.project.rootPath, path.normalize(pkgLocation))
.toLowerCase();
const packageParentDirsLower = packageParentDirs.map((p) => p.toLowerCase());
// using indexOf over includes due to platform differences (/private/tmp should match /tmp on macOS)
const matchingPathIndex = packageParentDirsLower.findIndex((p) => p.indexOf(normalizedPkgLocation) > -1);
if (matchingPathIndex > -1) {
return packageParentDirs[matchingPathIndex];
}
throw new ValidationError(
"ENOPKGDIR",
`Location "${pkgLocation}" is not configured as a workspace directory.`
);
}
execute() {

@@ -150,0 +181,0 @@ let chain = Promise.resolve();

12

package.json
{
"name": "@lerna/create",
"version": "6.3.1-beta.8",
"version": "6.4.0",
"description": "Create a new lerna-managed package",

@@ -36,6 +36,6 @@ "keywords": [

"dependencies": {
"@lerna/child-process": "6.3.1-beta.8",
"@lerna/command": "6.3.1-beta.8",
"@lerna/npm-conf": "6.3.1-beta.8",
"@lerna/validation-error": "6.3.1-beta.8",
"@lerna/child-process": "6.4.0",
"@lerna/command": "6.4.0",
"@lerna/npm-conf": "6.4.0",
"@lerna/validation-error": "6.4.0",
"dedent": "^0.7.0",

@@ -54,3 +54,3 @@ "fs-extra": "^9.1.0",

},
"gitHead": "329eb99e3080cc4d5de53960a7d0421091b08782"
"gitHead": "1053de382bac5c7a5ec1a54d493935eda75e0796"
}

@@ -18,4 +18,9 @@ # `@lerna/create`

loc A custom package location, defaulting to the first configured package
location [string]
location. The location must match a configured packages directory.
[string]
```
**Note**: For more info on how Lerna package directories are configured, see https://lerna.js.org/docs/faq#how-does-lerna-detect-packages.
```
Command Options:

@@ -22,0 +27,0 @@ --access When using a scope, set publishConfig.access value

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