From 0e5799c93b81a58b1aab6f3684a9ca673185ed26 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 26 Apr 2018 12:36:41 -0300 Subject: [PATCH] Clean up npm package (#904) * ignore everything but official contracts for npm * add tests to npm package * remove truffle migrations stuff * remove seemingly unused npm dependency * clean up dependencies --- contracts/.npmignore | 2 ++ contracts/lifecycle/Migrations.sol | 21 --------------------- migrations/.gitkeep | 0 migrations/1_initial_migration.js | 5 ----- migrations/2_deploy_contracts.js | 9 --------- package-lock.json | 9 ++------- package.json | 9 +++++---- 7 files changed, 9 insertions(+), 46 deletions(-) create mode 100644 contracts/.npmignore delete mode 100644 contracts/lifecycle/Migrations.sol create mode 100644 migrations/.gitkeep delete mode 100644 migrations/1_initial_migration.js delete mode 100644 migrations/2_deploy_contracts.js diff --git a/contracts/.npmignore b/contracts/.npmignore new file mode 100644 index 000000000..e792d8bc6 --- /dev/null +++ b/contracts/.npmignore @@ -0,0 +1,2 @@ +mocks +examples diff --git a/contracts/lifecycle/Migrations.sol b/contracts/lifecycle/Migrations.sol deleted file mode 100644 index b12a39b2d..000000000 --- a/contracts/lifecycle/Migrations.sol +++ /dev/null @@ -1,21 +0,0 @@ -pragma solidity ^0.4.21; - -import "../ownership/Ownable.sol"; - - -/** - * @title Migrations - * @dev This is a truffle contract, needed for truffle integration, not meant for use by Zeppelin users. - */ -contract Migrations is Ownable { - uint256 public lastCompletedMigration; - - function setCompleted(uint256 completed) onlyOwner public { - lastCompletedMigration = completed; - } - - function upgrade(address newAddress) onlyOwner public { - Migrations upgraded = Migrations(newAddress); - upgraded.setCompleted(lastCompletedMigration); - } -} diff --git a/migrations/.gitkeep b/migrations/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/migrations/1_initial_migration.js b/migrations/1_initial_migration.js deleted file mode 100644 index fbe302cd4..000000000 --- a/migrations/1_initial_migration.js +++ /dev/null @@ -1,5 +0,0 @@ -var Migrations = artifacts.require('Migrations'); - -module.exports = function (deployer) { - deployer.deploy(Migrations); -}; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js deleted file mode 100644 index a79df71b6..000000000 --- a/migrations/2_deploy_contracts.js +++ /dev/null @@ -1,9 +0,0 @@ -// var Ownable = artifacts.require("Ownable"); - -// NOTE: Use this file to easily deploy the contracts you're writing. -// (but make sure to reset this file before committing -// with `git checkout HEAD -- migrations/2_deploy_contracts.js`) - -module.exports = function (deployer) { - // deployer.deploy(Ownable); -}; diff --git a/package-lock.json b/package-lock.json index 9e56a7db8..5993fe51f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1974,7 +1974,8 @@ "dotenv": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", - "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" + "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=", + "dev": true }, "drbg.js": { "version": "1.0.1", @@ -6205,12 +6206,6 @@ } } }, - "mocha-lcov-reporter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz", - "integrity": "sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=", - "dev": true - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", diff --git a/package.json b/package.json index e69e50410..2df0e14c2 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,10 @@ "name": "zeppelin-solidity", "version": "1.8.0", "description": "Secure Smart Contract library for Solidity", + "files": [ + "contracts", + "test" + ], "scripts": { "test": "scripts/test.sh", "lint": "eslint .", @@ -42,6 +46,7 @@ "chai-as-promised": "^7.0.0", "chai-bignumber": "^2.0.0", "coveralls": "^2.13.1", + "dotenv": "^4.0.0", "eslint": "^4.11.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-import": "^2.8.0", @@ -51,13 +56,9 @@ "ethereumjs-util": "^5.1.2", "ethjs-abi": "^0.2.1", "ganache-cli": "6.1.0", - "mocha-lcov-reporter": "^1.3.0", "solidity-coverage": "^0.4.15", "solium": "^1.1.6", "truffle": "^4.1.5", "truffle-hdwallet-provider": "0.0.3" - }, - "dependencies": { - "dotenv": "^4.0.0" } }