Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Rename truffle-workflow-compile to @truffle/workflow-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplantzzz committed Aug 27, 2019
1 parent a5b121e commit d867f6f
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 48 deletions.
2 changes: 1 addition & 1 deletion packages/truffle-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
build: require("./lib/build"),
create: require("./lib/create"),
console: require("./lib/repl"),
contracts: require("truffle-workflow-compile"),
contracts: require("@truffle/workflow-compile"),
package: require("./lib/package"),
test: require("./lib/test"),
version: pkg.version,
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const mkdirp = require("mkdirp");
const del = require("del");
const Contracts = require("truffle-workflow-compile");
const Contracts = require("@truffle/workflow-compile");
const BuildError = require("./errors/builderror");
const { spawn } = require("child_process");
const spawnargs = require("spawn-args");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/commands/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const command = {
]
},
run: function(options, done) {
const Contracts = require("truffle-workflow-compile");
const Contracts = require("@truffle/workflow-compile");
const Config = require("truffle-config");
const config = Config.detect(options);

Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/commands/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const command = {
},
run: function(options, done) {
const Config = require("truffle-config");
const Contracts = require("truffle-workflow-compile");
const Contracts = require("@truffle/workflow-compile");
const ConfigurationError = require("../errors/configurationerror");
const Require = require("truffle-require");
const { Environment } = require("truffle-environment");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/commands/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const command = {
const Artifactor = require("truffle-artifactor");
const Resolver = require("truffle-resolver");
const Migrate = require("truffle-migrate");
const Contracts = require("truffle-workflow-compile");
const Contracts = require("@truffle/workflow-compile");
const { Environment } = require("truffle-environment");
const Config = require("truffle-config");
const temp = require("temp").track();
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/commands/opcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var command = {
run: function(options, done) {
var Config = require("truffle-config");
var TruffleError = require("@truffle/error");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");
var CodeUtils = require("@truffle/code-utils");

if (options._.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const chai = require("chai");
const path = require("path");
const Web3 = require("web3");
const Config = require("truffle-config");
const Contracts = require("truffle-workflow-compile/new");
const Contracts = require("@truffle/workflow-compile/new");
const Resolver = require("truffle-resolver");
const TestRunner = require("./testing/testrunner");
const TestResolver = require("./testing/testresolver");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"truffle-provisioner": "^0.1.5",
"truffle-require": "^2.0.19",
"truffle-resolver": "^5.0.15",
"truffle-workflow-compile": "^2.1.3",
"@truffle/workflow-compile": "^2.1.3",
"universal-analytics": "^0.4.17",
"web3": "1.2.1",
"xregexp": "^4.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var assert = require("chai").assert;
var fs = require("fs-extra");
var glob = require("glob");
var Box = require("@truffle/box");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");
var Ganache = require("ganache-core");
var provision = require("truffle-provisioner");
var Resolver = require("truffle-resolver");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/test/ethpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Box = require("@truffle/box");
var fs = require("fs-extra");
var glob = require("glob");
var path = require("path");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");
var Package = require("../lib/package.js");
var Blockchain = require("@truffle/blockchain-utils");
var Ganache = require("ganache-core");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/test/lib/commands/compile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var assert = require("chai").assert;
var Box = require("@truffle/box");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");
var Artifactor = require("truffle-artifactor");
var Resolver = require("truffle-resolver");
var MemoryStream = require("memorystream");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/test/migrate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var assert = require("chai").assert;
var Box = require("@truffle/box");
var Migrate = require("truffle-migrate");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");
var Networks = require("../lib/networks");
var path = require("path");
var fs = require("fs-extra");
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-core/test/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var mkdirp = require("mkdirp");
var async = require("async");
var Resolver = require("truffle-resolver");
var Artifactor = require("truffle-artifactor");
var Contracts = require("truffle-workflow-compile");
var Contracts = require("@truffle/workflow-compile");

describe("NPM integration", function() {
var config;
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"truffle-debug-utils": "^1.0.18",
"truffle-migrate": "^3.0.31",
"truffle-resolver": "^5.0.15",
"truffle-workflow-compile": "^2.1.3",
"@truffle/workflow-compile": "^2.1.3",
"webpack": "^3.8.1",
"webpack-dev-middleware": "^2.0.4",
"webpack-merge": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-debugger/test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const debug = debugModule("test:helpers");

import path from "path";
import fs from "fs-extra";
import Contracts from "truffle-workflow-compile";
import Contracts from "@truffle/workflow-compile";
import Debug from "truffle-debug-utils";
import Artifactor from "truffle-artifactor";
import Web3 from "web3";
Expand Down
2 changes: 1 addition & 1 deletion packages/truffle-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ganache-core": "2.7.0",
"mocha": "5.2.0",
"@truffle/reporters": "^1.0.12",
"truffle-workflow-compile": "^2.1.3",
"@truffle/workflow-compile": "^2.1.3",
"web3": "1.2.1"
},
"keywords": [
Expand Down
52 changes: 27 additions & 25 deletions packages/truffle-deployer/test/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
const TruffleContract = require('truffle-contract');
const workflow = require('truffle-workflow-compile');
const path = require('path');
const fs = require('fs-extra');
const TruffleContract = require("truffle-contract");
const workflow = require("@truffle/workflow-compile");
const path = require("path");
const fs = require("fs-extra");

const utils = {

miningId: null,

// Constants
zeroAddress: '0x0000000000000000000000000000000000000000',
zeroAddress: "0x0000000000000000000000000000000000000000",

// Paths
buildDir: path.join(__dirname, '../build'),
sourcesDir: path.join(__dirname, '../sources'),
buildDir: path.join(__dirname, "../build"),
sourcesDir: path.join(__dirname, "../sources"),

compile: async function(){
const config = {
compile: async function() {
const config = {
contracts_build_directory: utils.buildDir,
contracts_directory: utils.sourcesDir
};

return new Promise((accept, reject) => {
workflow.compile(config, err => err ? reject(err) : accept());
workflow.compile(config, err => (err ? reject(err) : accept()));
});
},

evm_mine: function(web3){
return new Promise(function(accept, reject){
web3.currentProvider.send({
jsonrpc: "2.0",
method: "evm_mine",
id: new Date().getTime()
}, function(err, result){
(err) ? reject(err) : accept(result);
});
evm_mine: function(web3) {
return new Promise(function(accept, reject) {
web3.currentProvider.send(
{
jsonrpc: "2.0",
method: "evm_mine",
id: new Date().getTime()
},
function(err, result) {
err ? reject(err) : accept(result);
}
);
});
},

startAutoMine: function(web3, interval){
utils.miningId = setInterval(async() => {
startAutoMine: function(web3, interval) {
utils.miningId = setInterval(async () => {
await utils.evm_mine(web3);
}, interval);
},

stopAutoMine: () => clearInterval(utils.miningId),

waitMS: async (ms) => new Promise(resolve => setTimeout(() => resolve(), ms)),
waitMS: async ms => new Promise(resolve => setTimeout(() => resolve(), ms)),

cleanUp: () => fs.removeSync(utils.buildDir),

getContract: function(name, provider, networkId, account){
getContract: function(name, provider, networkId, account) {
const json = require(`../build/${name}`);
const contract = TruffleContract(json);
contract.setProvider(provider);
contract.setNetwork(networkId);
contract.defaults({ from: account });
return contract;
},
}
};

module.exports = utils;
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# truffle-workflow-compile
# @truffle/workflow-compile
Core workflow logic for the `truffle compile` command behavior

### install

```
$ npm install truffle-workflow-compile
$ npm install @truffle/workflow-compile
```

### Usage

```javascript
const Contracts = require("truffle-workflow-compile");
const Contracts = require("@truffle/workflow-compile");

// expected config object
const config = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "truffle-workflow-compile",
"name": "@truffle/workflow-compile",
"version": "2.1.3",
"description": "Core workflow behavior for `truffle compile` command",
"dependencies": {
Expand All @@ -17,13 +17,13 @@
"scripts": {
"test": "mocha"
},
"repository": "https://github.com/trufflesuite/truffle/tree/master/packages/truffle-workflow-compile",
"repository": "https://github.com/trufflesuite/truffle/tree/master/packages/workflow-compile",
"author": "Truffle Suite <inquiry@trufflesuite.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/trufflesuite/truffle/issues"
},
"homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/truffle-workflow-compile#readme",
"homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/workflow-compile#readme",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { assert } = require("chai");

const { shimBytecode } = require("truffle-workflow-compile/shims");
const { shimBytecode } = require("@truffle/workflow-compile/shims");

describe("shimBytecode", () => {
it("removes 0x", function() {
Expand Down

0 comments on commit d867f6f

Please sign in to comment.