Comparing version 0.9.0-beta.0 to 1.0.0-beta.0
#!/usr/bin/env node | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -14,3 +15,3 @@ }); | ||
const parseArgs_1 = require("./parseArgs"); | ||
const __1 = require(".."); | ||
const TypeChain_1 = require("../TypeChain"); | ||
const logger_1 = require("../utils/logger"); | ||
@@ -22,3 +23,3 @@ function main() { | ||
const cwd = process.cwd(); | ||
yield ts_generator_1.tsGenerator({ cwd, loggingLvl: "info" }, new __1.Typechain({ cwd, rawConfig: options })); | ||
yield ts_generator_1.tsGenerator({ cwd, loggingLvl: "info" }, new TypeChain_1.Typechain({ cwd, rawConfig: options })); | ||
}); | ||
@@ -25,0 +26,0 @@ } |
@@ -1,7 +0,6 @@ | ||
import { TTypechainTarget } from ".."; | ||
export interface IOptions { | ||
files: string; | ||
target: TTypechainTarget; | ||
target: string; | ||
outDir?: string; | ||
} | ||
export declare function parseArgs(): IOptions; |
@@ -1,18 +0,3 @@ | ||
import { TsGeneratorPlugin, TFileDesc, TContext, TOutput } from "ts-generator"; | ||
export declare type TTypechainTarget = "truffle" | "web3-1.0.0" | "legacy" | "ethers"; | ||
export interface ITypechainCfg { | ||
target: TTypechainTarget; | ||
outDir?: string; | ||
} | ||
/** | ||
* Proxies calls to real implementation that is selected based on target parameter. | ||
*/ | ||
export declare class Typechain extends TsGeneratorPlugin { | ||
name: string; | ||
private realImpl; | ||
constructor(ctx: TContext<ITypechainCfg>); | ||
private findRealImpl; | ||
beforeRun(): TOutput | Promise<TOutput>; | ||
transformFile(file: TFileDesc): TOutput | Promise<TOutput>; | ||
afterRun(): TOutput | Promise<TOutput>; | ||
} | ||
export * from "./parser/abiParser"; | ||
export * from "./parser/parseEvmType"; | ||
export * from "./utils/files"; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ts_generator_1 = require("ts-generator"); | ||
const legacy_1 = require("./targets/legacy"); | ||
const truffle_1 = require("./targets/truffle"); | ||
const web3_1 = require("./targets/web3"); | ||
const ethers_1 = require("./targets/ethers"); | ||
/** | ||
* Proxies calls to real implementation that is selected based on target parameter. | ||
*/ | ||
class Typechain extends ts_generator_1.TsGeneratorPlugin { | ||
constructor(ctx) { | ||
super(ctx); | ||
this.name = "Typechain"; | ||
this.realImpl = this.findRealImpl(ctx); | ||
} | ||
findRealImpl(ctx) { | ||
switch (ctx.rawConfig.target) { | ||
case "legacy": | ||
return new legacy_1.TypechainLegacy(ctx); | ||
case "truffle": | ||
return new truffle_1.Truffle(ctx); | ||
case "web3-1.0.0": | ||
return new web3_1.Web3(ctx); | ||
case "ethers": | ||
return new ethers_1.Ethers(ctx); | ||
case undefined: | ||
throw new Error(`Please provide --target parameter!`); | ||
default: | ||
throw new Error(`Unsupported target ${this.ctx.rawConfig.target}!`); | ||
} | ||
} | ||
beforeRun() { | ||
return this.realImpl.beforeRun(); | ||
} | ||
transformFile(file) { | ||
return this.realImpl.transformFile(file); | ||
} | ||
afterRun() { | ||
return this.realImpl.afterRun(); | ||
} | ||
} | ||
exports.Typechain = Typechain; | ||
__export(require("./parser/abiParser")); | ||
__export(require("./parser/parseEvmType")); | ||
__export(require("./utils/files")); |
{ | ||
"name": "typechain", | ||
"description": "🔌 Typescript bindings for Ethereum smartcontracts", | ||
"description": "🔌 TypeScript bindings for Ethereum smartcontracts", | ||
"keywords": [ | ||
@@ -11,3 +11,3 @@ "ethereum", | ||
], | ||
"version": "0.9.0-beta.0", | ||
"version": "1.0.0-beta.0", | ||
"license": "MIT", | ||
@@ -36,19 +36,4 @@ "repository": "https://github.com/ethereum-ts/Typechain", | ||
"glob": "^7.1.2", | ||
"krzkaczor-solc": "^0.4.24", | ||
"mocha": "^4.0.1", | ||
"mocha-prepare": "^0.1.0", | ||
"nyc": "^12.0.2", | ||
"patch-package": "^5.1.1", | ||
"prettier": "^1.14.2", | ||
"snap-shot-it": "^6.1.1", | ||
"source-map-support": "^0.5.8", | ||
"truffle": "^4.1.14", | ||
"truffle-typings": "^1.0.4", | ||
"ts-node": "^3.3.0", | ||
"tslint": "^5.11.0", | ||
"tslint-language-service": "^0.9.7", | ||
"typescript": "^3.0.1", | ||
"typestrict": "^0.0.6", | ||
"web3": "0.20.x", | ||
"web3-typescript-typings": "^0.7.2" | ||
"truffle-typings": "^1.0.4" | ||
}, | ||
@@ -63,21 +48,3 @@ "dependencies": { | ||
"scripts": { | ||
"prepare": "patch-package", | ||
"prepublishOnly": "yarn build", | ||
"build": "rm -rf ./dist && tsc -p ./tsconfig.production.json && cp -R ./lib/targets/legacy/runtime ./dist/targets/legacy/", | ||
"postbuild": "chmod +x ./dist/cli/cli.js", | ||
"lint": "yarn formatting && yarn tslint", | ||
"lint:fix": "yarn tslint:fix && yarn formatting:fix", | ||
"tslint": "tslint -c ./tslint.json --project ./tsconfig.json --format stylish", | ||
"tslint:fix": "tslint -c ./tslint.json --project ./tsconfig.json --format stylish --fix ", | ||
"tsc": "tsc --noEmit", | ||
"tsc:truffle": "tsc --noEmit --project ./test/integration/targets/truffle/tsconfig.json", | ||
"formatting": "prettier --list-different '**/*.ts'", | ||
"formatting:fix": "prettier --write '**/*.ts'", | ||
"test": "yarn lint && ./scripts/test.sh", | ||
"test:coverage": "yarn lint && ./scripts/test.sh COVERAGE", | ||
"test:fix": "yarn lint:fix && ./scripts/test.sh", | ||
"test:mocha": "TS_NODE_IGNORE=\"/test/integration/targets/web3-1.0.0/\" mocha --require ts-node/register.js --require test/setup-chai.ts --require 'test/integration/before.ts' 'test/integration/web3.ts' './**/*.spec.ts'", | ||
"test:mocha:coverage": "NODE_ENV=test nyc mocha --require ts-node/register.js --require source-map-support/register --require test/setup-chai.ts --require 'test/integration/before.ts' 'test/integration/web3.ts' './**/*.spec.ts'", | ||
"test:package-bundle": "cd ./test/package-test && yarn && yarn start", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls" | ||
"build": "rm -rf ./dist && cp -R '../../dist/core/lib' ./dist/ && chmod +x ./dist/cli/cli.js && cp ../../README.md ." | ||
}, | ||
@@ -84,0 +51,0 @@ "main": "./dist/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
22
52537
38
1284
3
1