This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3247 from njgheorghita/ethpm-v3
ethpmV3 support
- Loading branch information
Showing
39 changed files
with
2,401 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const { callbackify } = require("util"); | ||
|
||
const command = { | ||
command: "packages", | ||
description: "List available packages on connected EthPM Registry", | ||
builder: {}, | ||
help: { | ||
usage: "truffle packages", | ||
options: [] | ||
}, | ||
run: function (options, done) { | ||
const Config = require("@truffle/config"); | ||
const PackageV1 = require("@truffle/ethpm-v1"); | ||
const PackageV3 = require("@truffle/ethpm-v3"); | ||
|
||
const config = Config.detect(options); | ||
let listPackages; | ||
|
||
if (config.ethpm.version == "1") { | ||
listPackages = callbackify(PackageV1.packages); | ||
} else if (config.ethpm.version == "3") { | ||
listPackages = callbackify(PackageV3.packages); | ||
} else { | ||
done(new Error(`Unsupported ethpm version: ${config.ethpm.version}.`)); | ||
} | ||
listPackages(config, done); | ||
} | ||
}; | ||
|
||
module.exports = command; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# `ethpm-v1` | ||
|
||
## Usage | ||
|
||
``` | ||
const ethpmV1 = require('ethpm-v1'); | ||
``` | ||
|
||
This package contains support for the deprecated v1 version of the ethpm specification for backwards compatibility purposes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.