Comparing version 5.1.2 to 5.2.0
# typechain | ||
## 5.2.0 | ||
### Minor Changes | ||
- c7c2913: Escaped reserved words in argument names | ||
## 5.1.2 | ||
@@ -4,0 +10,0 @@ |
@@ -33,2 +33,6 @@ #!/usr/bin/env node | ||
const cwd = process.cwd(); | ||
const files = getFilesToProcess(cwd, cliConfig.files); | ||
if (files.length === 0) { | ||
throw new Error('No files passed.' + '\n' + `\`${cliConfig.files}\` didn't match any input files in ${cwd}`); | ||
} | ||
const config = { | ||
@@ -38,4 +42,4 @@ cwd, | ||
outDir: cliConfig.outDir, | ||
allFiles: glob_1.glob(cwd, cliConfig.files), | ||
filesToProcess: glob_1.glob(cwd, cliConfig.files), | ||
allFiles: files, | ||
filesToProcess: files, | ||
prettier, | ||
@@ -61,2 +65,13 @@ flags: { | ||
}); | ||
function getFilesToProcess(cwd, filesOrPattern) { | ||
var _a; | ||
let res = glob_1.glob(cwd, filesOrPattern); | ||
if (res.length === 0) { | ||
// If there are no files found, but first parameter is surrounded with single quotes, we try again without quotes | ||
const match = (_a = filesOrPattern[0].match(/'([\s\S]*)'/)) === null || _a === void 0 ? void 0 : _a[1]; | ||
if (match) | ||
res = glob_1.glob(cwd, [match]); | ||
} | ||
return res; | ||
} | ||
//# sourceMappingURL=cli.js.map |
@@ -0,1 +1,2 @@ | ||
export * from './codegen/syntax'; | ||
export * from './parser/abiParser'; | ||
@@ -6,5 +7,4 @@ export { normalizeName } from './parser/normalizeName'; | ||
export * from './typechain/types'; | ||
export * from './typechain/types'; | ||
export * from './utils/files'; | ||
export * from './utils/glob'; | ||
export * from './utils/signatures'; |
@@ -14,2 +14,3 @@ "use strict"; | ||
exports.normalizeName = void 0; | ||
__exportStar(require("./codegen/syntax"), exports); | ||
__exportStar(require("./parser/abiParser"), exports); | ||
@@ -21,3 +22,2 @@ var normalizeName_1 = require("./parser/normalizeName"); | ||
__exportStar(require("./typechain/types"), exports); | ||
__exportStar(require("./typechain/types"), exports); | ||
__exportStar(require("./utils/files"), exports); | ||
@@ -24,0 +24,0 @@ __exportStar(require("./utils/glob"), exports); |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "5.1.2", | ||
"version": "5.2.0", | ||
"license": "MIT", | ||
@@ -30,3 +30,3 @@ "repository": "https://github.com/ethereum-ts/Typechain", | ||
"clean": "rm -rf dist && rm -f tsconfig.build.tsbuildinfo", | ||
"post-build": "chmod +x ./dist/cli/cli.js && cp ../../README.md .", | ||
"post-build": "ts-node scripts/post-build", | ||
"test": "mocha --config ../../.mocharc.js", | ||
@@ -48,3 +48,2 @@ "test:fix": "yarn lint:fix && yarn format:fix && yarn test && yarn typecheck" | ||
"devDependencies": { | ||
"@types/bignumber.js": "^5.0.0", | ||
"@types/bluebird": "^3.5.18", | ||
@@ -59,7 +58,8 @@ "@types/command-line-args": "^4.0.2", | ||
"@types/prettier": "^1.13.2", | ||
"bignumber.js": "^5.0.0", | ||
"bluebird": "^3.5.1", | ||
"coveralls": "^3.0.2", | ||
"glob": "^7.1.2" | ||
"coveralls": "^3.0.2" | ||
}, | ||
"peerDependencies": { | ||
"typescript": ">=4.1.0" | ||
} | ||
} |
@@ -10,2 +10,3 @@ <p align="center"> | ||
<a href="/package.json"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square"></a> | ||
<a href="https://discord.gg/cpbj5BDq"><img alt="Join our discord!" src="https://img.shields.io/discord/895381864922091630.svg?color=7289da&label=deth&logo=discord&style=flat-square"></a> | ||
</p> | ||
@@ -44,11 +45,11 @@ | ||
| Package | Version | Description | Examples | | ||
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------- | | ||
| [`typechain`](/packages/typechain) | [![npm](https://img.shields.io/npm/v/typechain.svg)](https://www.npmjs.com/package/typechain) | Core package | - | | ||
| [`@typechain/ethers-v5`](/packages/target-ethers-v5) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v5.svg)](https://www.npmjs.com/package/@typechain/ethers-v5) | Ethers ver 5 support (⚠️ requires TS 4.0 >=) | [example](./examples/ethers-v5) | | ||
| [`@typechain/ethers-v4`](/packages/target-ethers-v4) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v4.svg)](https://www.npmjs.com/package/@typechain/ethers-v4) | Ethers ver 4 support | [example](./examples/ethers-v4) | | ||
| [`@typechain/truffle-v5`](/packages/target-truffle-v5) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v5.svg)](https://www.npmjs.com/package/@typechain/truffle-v5) | Truffle ver 5 support | [example](./examples/truffle-v5) | | ||
| [`@typechain/truffle-v4`](/packages/target-truffle-v4) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v4.svg)](https://www.npmjs.com/package/@typechain/truffle-v4) | Truffle ver 4 support | [example](./examples/truffle-v4) | | ||
| [`@typechain/web3-v1`](/packages/target-web3-v1) | [![npm](https://img.shields.io/npm/v/@typechain/web3-v1.svg)](https://www.npmjs.com/package/@typechain/web3-v1) | Web3 ver 1 support | [example](./examples/web3-v1) | | ||
| [`@typechain/hardhat`](/packages/hardhat) | [![npm](https://img.shields.io/npm/v/@typechain/hardhat.svg)](https://www.npmjs.com/package/@typechain/hardhat) | Hardhat plugin | [example-ethers](./examples/hardhat) [example-truffle](./examples/hardhat-truffle) | | ||
| Package | Version | Description | Examples | | ||
| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | ||
| [`typechain`](/packages/typechain) | [![npm](https://img.shields.io/npm/v/typechain.svg)](https://www.npmjs.com/package/typechain) | Core package | - | | ||
| [`@typechain/ethers-v5`](/packages/target-ethers-v5) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v5.svg)](https://www.npmjs.com/package/@typechain/ethers-v5) | Ethers ver 5 support (⚠️ requires TS 4.0 >=) | [example](./examples/ethers-v5) | | ||
| [`@typechain/ethers-v4`](/packages/target-ethers-v4) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v4.svg)](https://www.npmjs.com/package/@typechain/ethers-v4) | Ethers ver 4 support | [example](./examples/ethers-v4) | | ||
| [`@typechain/truffle-v5`](/packages/target-truffle-v5) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v5.svg)](https://www.npmjs.com/package/@typechain/truffle-v5) | Truffle ver 5 support | [example](./examples/truffle-v5) | | ||
| [`@typechain/web3-v1`](/packages/target-web3-v1) | [![npm](https://img.shields.io/npm/v/@typechain/web3-v1.svg)](https://www.npmjs.com/package/@typechain/web3-v1) | Web3 ver 1 support | [example](./examples/web3-v1) | | ||
| [`@typechain/hardhat`](/packages/hardhat) | [![npm](https://img.shields.io/npm/v/@typechain/hardhat.svg)](https://www.npmjs.com/package/@typechain/hardhat) | Hardhat plugin | [example-ethers](./examples/hardhat) [example-truffle](./examples/hardhat-truffle) | | ||
| [`@typechain/truffle-v4`](https://github.com/dethcrypto/TypeChain/tree/fb96e1cf06c8c4c17cd79a1743362bd3d34eab76/packages/target-truffle-v4) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v4.svg)](https://www.npmjs.com/package/@typechain/truffle-v4) | Truffle ver 4 support (deprecated) | [example](https://github.com/dethcrypto/TypeChain/tree/fb96e1cf06c8c4c17cd79a1743362bd3d34eab76/examples/truffle-v4) | | ||
@@ -68,4 +69,4 @@ ## Usage | ||
`./abis/**/*.abi`, `./abis/?(Oasis.abi|OasisHelper.abi)`. | ||
- `--target` - ethers-v4, ethers-v5, truffle-v4, truffle-v5, web3-v1 or path to your custom target. Typechain will try to load | ||
package named: `@typechain/${target}`, so make sure that desired package is installed. | ||
- `--target` - ethers-v4, ethers-v5, truffle-v4, truffle-v5, web3-v1 or path to your custom target. Typechain will try | ||
to load package named: `@typechain/${target}`, so make sure that desired package is installed. | ||
- `--out-dir` (optional) - put all generated files to a specific dir. | ||
@@ -72,0 +73,0 @@ - `--always-generate-overloads` (optional) - some targets won't generate unnecessary types for overloaded functions by |
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
83536
11
67
1097
200
11