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

@contember/cli-common

Package Overview
Dependencies
Maintainers
5
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/cli-common - npm Package Compare versions

Comparing version 1.3.0-beta.3 to 1.3.0-beta.4

2

dist/src/npm/PackageWorkspace.d.ts

@@ -29,5 +29,5 @@ import { PackageManager } from './packageManagers/PackageManager';

constructor(fsManager: FsManager, packageManagers: PackageManager[]);
resolve(dir: string): Promise<PackageWorkspace>;
resolve(dir: string, packageJsonFound?: boolean): Promise<PackageWorkspace>;
private resolvePackageManager;
}
//# sourceMappingURL=PackageWorkspace.d.ts.map

@@ -90,8 +90,22 @@ "use strict";

}
async resolve(dir) {
async resolve(dir, packageJsonFound = false) {
const packageJson = await this.fsManager.tryReadJson((0, node_path_1.join)(dir, 'package.json'));
if (!packageJson) {
throw `package.json not found.`;
if (dir === '/') {
if (packageJsonFound) {
throw `No lockfile found. Please install dependencies using package manager of your choice.`;
}
else {
throw `package.json not found.`;
}
}
return await this.resolve((0, node_path_1.dirname)(dir), packageJsonFound);
}
const pm = await this.resolvePackageManager({ dir, packageJson });
if (!pm) {
if (dir === '/') {
throw `No lockfile found. Please install dependencies using package manager of your choice.`;
}
return await this.resolve((0, node_path_1.dirname)(dir), true);
}
const rootPackage = new Package_1.Package(dir, true, packageJson);

@@ -107,3 +121,3 @@ const workspacePackages = await pm.readWorkspacePackages({ dir, packageJson });

}
throw `No lockfile found. Please install dependencies using package manager of your choice.`;
return null;
}

@@ -110,0 +124,0 @@ }

{
"name": "@contember/cli-common",
"version": "1.3.0-beta.3",
"version": "1.3.0-beta.4",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -106,8 +106,23 @@ import { PackageManager } from './packageManagers/PackageManager'

public async resolve(dir: string): Promise<PackageWorkspace> {
public async resolve(dir: string, packageJsonFound: boolean = false): Promise<PackageWorkspace> {
const packageJson = await this.fsManager.tryReadJson<PackageJson>(join(dir, 'package.json'))
if (!packageJson) {
throw `package.json not found.`
if (dir === '/') {
if (packageJsonFound) {
throw `No lockfile found. Please install dependencies using package manager of your choice.`
} else {
throw `package.json not found.`
}
}
return await this.resolve(dirname(dir), packageJsonFound)
}
const pm = await this.resolvePackageManager({ dir, packageJson })
if (!pm) {
if (dir === '/') {
throw `No lockfile found. Please install dependencies using package manager of your choice.`
}
return await this.resolve(dirname(dir), true)
}
const rootPackage = new Package(dir, true, packageJson)

@@ -119,3 +134,3 @@ const workspacePackages = await pm.readWorkspacePackages({ dir, packageJson })

private async resolvePackageManager(args: { dir: string; packageJson: PackageJson }): Promise<PackageManager> {
private async resolvePackageManager(args: { dir: string; packageJson: PackageJson }): Promise<PackageManager | null> {
for (const pm of this.packageManagers) {

@@ -126,4 +141,4 @@ if (await pm.isActive(args)) {

}
throw `No lockfile found. Please install dependencies using package manager of your choice.`
return null
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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