@wagmi/cli
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -1,2 +0,1 @@ | ||
import dedent from 'dedent'; | ||
import { execa } from 'execa'; | ||
@@ -8,3 +7,3 @@ import { default as fse } from 'fs-extra'; | ||
import * as logger from '../logger.js'; | ||
import { getInstallCommand, getIsPackageInstalled, getPackageManager, } from '../utils/packages.js'; | ||
import { getIsPackageInstalled, getPackageManager } from '../utils/packages.js'; | ||
const defaultExcludes = ['build-info/**', '*.dbg.json']; | ||
@@ -74,7 +73,3 @@ /** Resolves ABIs from [Hardhat](https://github.com/NomicFoundation/hardhat) project. */ | ||
return; | ||
const [packageManager, command] = await getInstallCommand(packageName); | ||
throw new Error(dedent ` | ||
${packageName} must be installed to use Hardhat plugin. | ||
To install, run: ${packageManager} ${command.join(' ')} | ||
`); | ||
throw new Error(`${packageName} must be installed to use Hardhat plugin.`); | ||
}, | ||
@@ -81,0 +76,0 @@ watch: { |
@@ -18,15 +18,2 @@ import { promises as fs } from 'fs'; | ||
} | ||
export async function getInstallCommand(packageName) { | ||
const packageManager = await getPackageManager(false); | ||
switch (packageManager) { | ||
case 'yarn': | ||
return [packageManager, ['add', packageName]]; | ||
case 'npm': | ||
return [packageManager, ['install', '--save', packageName]]; | ||
case 'pnpm': | ||
return [packageManager, ['add', packageName]]; | ||
default: | ||
throw new Error(`Unknown package manager: ${packageManager}`); | ||
} | ||
} | ||
export async function getPackageManager(executable) { | ||
@@ -33,0 +20,0 @@ const userAgent = process.env.npm_config_user_agent; |
@@ -1,2 +0,2 @@ | ||
export const version = '2.0.0-alpha.3'; | ||
export const version = '2.0.0-alpha.4'; | ||
//# sourceMappingURL=version.js.map |
@@ -5,3 +5,2 @@ export declare function getIsPackageInstalled(parameters: { | ||
}): Promise<boolean>; | ||
export declare function getInstallCommand(packageName: string): Promise<readonly ["yarn", readonly ["add", string]] | readonly ["npm", readonly ["install", "--save", string]] | readonly ["pnpm", readonly ["add", string]]>; | ||
export declare function getPackageManager(executable?: boolean | undefined): Promise<"npx" | PackageManager>; | ||
@@ -8,0 +7,0 @@ type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'; |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.0.0-alpha.3"; | ||
export declare const version = "2.0.0-alpha.4"; | ||
//# sourceMappingURL=version.d.ts.map |
{ | ||
"name": "@wagmi/cli", | ||
"description": "Manage and generate code from Ethereum ABIs", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -1,2 +0,1 @@ | ||
import dedent from 'dedent' | ||
import { execa } from 'execa' | ||
@@ -12,7 +11,3 @@ import { default as fse } from 'fs-extra' | ||
import { | ||
getInstallCommand, | ||
getIsPackageInstalled, | ||
getPackageManager, | ||
} from '../utils/packages.js' | ||
import { getIsPackageInstalled, getPackageManager } from '../utils/packages.js' | ||
@@ -157,7 +152,3 @@ const defaultExcludes = ['build-info/**', '*.dbg.json'] | ||
if (isPackageInstalled) return | ||
const [packageManager, command] = await getInstallCommand(packageName) | ||
throw new Error(dedent` | ||
${packageName} must be installed to use Hardhat plugin. | ||
To install, run: ${packageManager} ${command.join(' ')} | ||
`) | ||
throw new Error(`${packageName} must be installed to use Hardhat plugin.`) | ||
}, | ||
@@ -164,0 +155,0 @@ watch: { |
@@ -22,16 +22,2 @@ import { promises as fs } from 'fs' | ||
export async function getInstallCommand(packageName: string) { | ||
const packageManager = await getPackageManager(false) | ||
switch (packageManager) { | ||
case 'yarn': | ||
return [packageManager, ['add', packageName]] as const | ||
case 'npm': | ||
return [packageManager, ['install', '--save', packageName]] as const | ||
case 'pnpm': | ||
return [packageManager, ['add', packageName]] as const | ||
default: | ||
throw new Error(`Unknown package manager: ${packageManager}`) | ||
} | ||
} | ||
export async function getPackageManager(executable?: boolean | undefined) { | ||
@@ -45,2 +31,3 @@ const userAgent = process.env.npm_config_user_agent | ||
} | ||
const packageManager = await detect() | ||
@@ -47,0 +34,0 @@ if (packageManager === 'npm' && executable) return 'npx' |
@@ -1,1 +0,1 @@ | ||
export const version = '2.0.0-alpha.3' | ||
export const version = '2.0.0-alpha.4' |
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
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
350041
3818