Skip to content

Commit d8e9d13

Browse files
authored
Revert "Vendor dependencies in vendored branch" (#150)
1 parent 78a1238 commit d8e9d13

File tree

3 files changed

+13
-54
lines changed

3 files changed

+13
-54
lines changed

.github/workflows/vendor.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

hardhat/remappings.js

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,18 @@ const fs = require('fs');
22
const { task } = require('hardhat/config');
33
const { TASK_COMPILE_GET_REMAPPINGS } = require('hardhat/builtin-tasks/task-names');
44

5-
const UPDATED_VENDORED_REMAPPINGS = 'vendor';
6-
7-
const remappings = Object.fromEntries(
8-
fs
9-
.readFileSync('remappings.txt', 'utf-8')
10-
.split('\n')
11-
.filter(Boolean)
12-
.filter(line => !line.startsWith('#'))
13-
.map(line => line.trim().split('=')),
14-
);
15-
165
task(TASK_COMPILE_GET_REMAPPINGS).setAction((taskArgs, env, runSuper) =>
17-
runSuper().then(r => Object.assign(r, remappings)),
6+
runSuper().then(remappings =>
7+
Object.assign(
8+
remappings,
9+
Object.fromEntries(
10+
fs
11+
.readFileSync('remappings.txt', 'utf-8')
12+
.split('\n')
13+
.filter(Boolean)
14+
.filter(line => !line.startsWith('#'))
15+
.map(line => line.trim().split('=')),
16+
),
17+
),
18+
),
1819
);
19-
20-
task(UPDATED_VENDORED_REMAPPINGS).setAction(() => {
21-
const NODE_MODULES_PATH = 'node_modules/';
22-
const LIB_PATH = 'lib/';
23-
24-
for (const [, src] of Object.entries(remappings).filter(r => r[1].includes(NODE_MODULES_PATH))) {
25-
const dir = src.replace(NODE_MODULES_PATH, LIB_PATH);
26-
fs.rmSync(dir, { recursive: true, force: true });
27-
fs.cpSync(src, dir, { recursive: true });
28-
}
29-
30-
const vendoredRemappings = Object.entries(remappings)
31-
.map(r => [r[0], r[1].replace(NODE_MODULES_PATH, LIB_PATH)])
32-
.map(r => `${r[0]}=${r[1]}`)
33-
.join('\n');
34-
35-
fs.writeFileSync('remappings.txt', vendoredRemappings);
36-
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"scripts": {
1212
"compile": "hardhat compile",
13-
"vendor": "hardhat vendor",
1413
"clean": "hardhat clean && rimraf build contracts/build",
1514
"docs": "npm run prepare-docs && oz-docs",
1615
"docs:watch": "oz-docs watch contracts docs/templates docs/config.js",

0 commit comments

Comments
 (0)