From 2ebf219aa74c99cd0adeccf08c68ae66e5240f7e Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Mon, 17 Jun 2019 12:24:13 -0700 Subject: [PATCH 1/4] Update README & add usage docs --- packages/truffle-box/README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/truffle-box/README.md b/packages/truffle-box/README.md index 4c3d9a4da84..b27f6b7b406 100644 --- a/packages/truffle-box/README.md +++ b/packages/truffle-box/README.md @@ -3,13 +3,31 @@ truffle-box Truffle Box management functionality. -Provides behavior for unboxing a new project from a predefined Truffle Box. +Handles behavior for unboxing a new project from a predefined Truffle Box. + +### Usage + +```javascript +const TruffleBox = require("truffle-box"); + +// `truffle-box` prompts when unboxing into non-empty directories & before potential overwrites +// a `force` option can be passed to force unboxing. default is false +const unboxOptions = { force: false }; + +// .unbox() validates & unboxes truffle box repos +// pass the current working directory as directory to unbox into +TruffleBox.unbox("https://github.com/trufflesuite/truffle-init-default", process.cwd(), unboxOptions); + +// or specify relative path to unbox into (path must already exist) +TruffleBox.unbox("https://github.com/trufflesuite/truffle-init-default", "some/relativePath", unboxOptions); + +``` Box Configuration ----------------- -Truffle Boxes are configured via an optional `truffle-box.json` file in the +Truffle Boxes are configured via a required `truffle-box.json` file in the box repo's root directory. This box configuration file specifies an object containing the following @@ -60,7 +78,6 @@ properties: } ``` - Available Unbox Hooks --------------------- From 6981091e665281d7c5149e0aacb4167c679dcaa5 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Mon, 17 Jun 2019 12:28:04 -0700 Subject: [PATCH 2/4] yarn remove eslint (old unused dep) --- packages/truffle-box/package.json | 1 - yarn.lock | 51 +------------------------------ 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/packages/truffle-box/package.json b/packages/truffle-box/package.json index 4289ced6e6d..fb159b9c0c9 100644 --- a/packages/truffle-box/package.json +++ b/packages/truffle-box/package.json @@ -17,7 +17,6 @@ "author": "g. nicholas d'andrea ", "license": "MIT", "devDependencies": { - "eslint": "^4.0.0", "mocha": "5.2.0", "sinon": "^6.3.4", "truffle-config": "^1.1.13" diff --git a/yarn.lock b/yarn.lock index 403ed9e2aab..054f81ffa9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5230,50 +5230,6 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^4.0.0: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" - eslint@^5.5.0, eslint@^5.7.0: version "5.16.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" @@ -5359,7 +5315,7 @@ eslint@~4.18.0: table "4.0.2" text-table "~0.2.0" -espree@^3.5.2, espree@^3.5.4: +espree@^3.5.2: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== @@ -12329,11 +12285,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" From 7d2821f6c0dcf8508d404e0922535b6cb2d81cc9 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Mon, 17 Jun 2019 12:28:32 -0700 Subject: [PATCH 3/4] rm old lint script (package.json) --- packages/truffle-box/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/truffle-box/package.json b/packages/truffle-box/package.json index fb159b9c0c9..66ea46ac728 100644 --- a/packages/truffle-box/package.json +++ b/packages/truffle-box/package.json @@ -4,7 +4,6 @@ "description": "Truffle project boilerplate utility", "main": "box.js", "scripts": { - "lint": "eslint ./index.js ./lib || true", "test": "mocha --timeout 10000" }, "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/truffle-box", From a71d92c57c521959e36433e3b57bf80646bcbf30 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Mon, 17 Jun 2019 12:31:06 -0700 Subject: [PATCH 4/4] set truffle-config as dep (package.json) --- packages/truffle-box/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/truffle-box/package.json b/packages/truffle-box/package.json index 66ea46ac728..52446fb8966 100644 --- a/packages/truffle-box/package.json +++ b/packages/truffle-box/package.json @@ -17,8 +17,7 @@ "license": "MIT", "devDependencies": { "mocha": "5.2.0", - "sinon": "^6.3.4", - "truffle-config": "^1.1.13" + "sinon": "^6.3.4" }, "dependencies": { "fs-extra": "6.0.1", @@ -26,6 +25,7 @@ "ora": "^3.0.0", "request": "^2.85.0", "tmp": "0.0.33", + "truffle-config": "^1.1.13", "vcsurl": "^0.1.1" }, "publishConfig": {