Unverified Commit 036dd9bd by Francisco Giordano Committed by GitHub

Change prepack npm script to prepare (take 2) (#1755)

* update truffle to include bugfix

* change prepack script to prepare

* add npx in compile script

* fix for older node

* rename script file to prepare
parent 2ccc12b3
...@@ -12996,9 +12996,9 @@ ...@@ -12996,9 +12996,9 @@
"dev": true "dev": true
}, },
"truffle": { "truffle": {
"version": "5.0.14", "version": "5.0.18",
"resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.14.tgz", "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.18.tgz",
"integrity": "sha512-Mlf4S58NMyR8YZFvQLAzA+7eCaDZw6ZSa92NWXDQjy1RbUfpl08/VPa06KLT+LosQuOPZr/NSH9f0u2qxfo/Qw==", "integrity": "sha512-aQPbWSskotSmylj4kiq73Di5X+tHl5ChlvlBAo5brHmsCzvMGIH29UA+t/rK8TRo7i7Kut0HxAgVR5i+bJteAQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"app-module-path": "^2.2.0", "app-module-path": "^2.2.0",
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"lint:js": "eslint .", "lint:js": "eslint .",
"lint:js:fix": "eslint . --fix", "lint:js:fix": "eslint . --fix",
"lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"", "lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"",
"prepack": "node scripts/prepack.js", "prepare": "node scripts/prepare.js",
"release": "scripts/release/release.sh", "release": "scripts/release/release.sh",
"version": "scripts/release/update-changelog-release-date.js && scripts/release/update-ethpm-version.js", "version": "scripts/release/update-changelog-release-date.js && scripts/release/update-ethpm-version.js",
"test": "scripts/test.sh" "test": "scripts/test.sh"
...@@ -62,6 +62,6 @@ ...@@ -62,6 +62,6 @@
"solhint": "^1.5.0", "solhint": "^1.5.0",
"solidity-coverage": "github:rotcivegaf/solidity-coverage#5875f5b7bc74d447f3312c9c0e9fc7814b482477", "solidity-coverage": "github:rotcivegaf/solidity-coverage#5875f5b7bc74d447f3312c9c0e9fc7814b482477",
"solidity-docgen": "^0.2.0-alpha.0", "solidity-docgen": "^0.2.0-alpha.0",
"truffle": "^5.0.14" "truffle": "^5.0.18"
} }
} }
...@@ -4,7 +4,4 @@ if [ "$SOLC_NIGHTLY" = true ]; then ...@@ -4,7 +4,4 @@ if [ "$SOLC_NIGHTLY" = true ]; then
docker pull ethereum/solc:nightly docker pull ethereum/solc:nightly
fi fi
# Necessary to avoid an error in Truffle npx truffle compile
rm -rf build/contracts
truffle compile
...@@ -22,11 +22,13 @@ const pkgFiles = readJSON('package.json').files; ...@@ -22,11 +22,13 @@ const pkgFiles = readJSON('package.json').files;
// Get only negated patterns. // Get only negated patterns.
const ignorePatterns = pkgFiles const ignorePatterns = pkgFiles
.filter(pat => pat.startsWith('!')) .filter(pat => pat.startsWith('!'))
// Add **/* to ignore all files contained in the directories.
.flatMap(pat => [pat, path.join(pat, '**/*')])
// Remove the negation part. Makes micromatch usage more intuitive. // Remove the negation part. Makes micromatch usage more intuitive.
.map(pat => pat.slice(1)); .map(pat => pat.slice(1));
const ignorePatternsSubtrees = ignorePatterns
// Add **/* to ignore all files contained in the directories.
.concat(ignorePatterns.map(pat => path.join(pat, '**/*')));
const artifactsDir = 'build/contracts'; const artifactsDir = 'build/contracts';
let n = 0; let n = 0;
...@@ -36,7 +38,7 @@ for (const artifact of fs.readdirSync(artifactsDir)) { ...@@ -36,7 +38,7 @@ for (const artifact of fs.readdirSync(artifactsDir)) {
const { sourcePath: fullSourcePath } = readJSON(fullArtifactPath); const { sourcePath: fullSourcePath } = readJSON(fullArtifactPath);
const sourcePath = path.relative('.', fullSourcePath); const sourcePath = path.relative('.', fullSourcePath);
const ignore = match.any(sourcePath, ignorePatterns); const ignore = match.any(sourcePath, ignorePatternsSubtrees);
if (ignore) { if (ignore) {
fs.unlinkSync(fullArtifactPath); fs.unlinkSync(fullArtifactPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment