diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-15 05:21:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-15 05:21:47 +0800 |
commit | 2f2582a0da3095d61a99ef09744dc0995677558e (patch) | |
tree | 54989565919038c42d495dafb7426d4148605e84 /packages/sol-resolver | |
parent | 8169155a6547fb0283cd0f5362aad3c0b173b00b (diff) | |
parent | fadd292ecf367e42154856509d0ea0c20b23f2f1 (diff) | |
download | dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.gz dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.tar.zst dexon-sol-tools-2f2582a0da3095d61a99ef09744dc0995677558e.zip |
Merge development
Diffstat (limited to 'packages/sol-resolver')
-rw-r--r-- | packages/sol-resolver/CHANGELOG.json | 14 | ||||
-rw-r--r-- | packages/sol-resolver/CHANGELOG.md | 11 | ||||
-rw-r--r-- | packages/sol-resolver/package.json | 12 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/npm_resolver.ts | 2 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/relative_fs_resolver.ts | 2 |
5 files changed, 30 insertions, 11 deletions
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 114cf2ce6..42d4c7ed1 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,5 +1,19 @@ [ { + "version": "1.0.5", + "changes": [ + { + "note": "Fix a bug where RelativeFSResolver would crash when trying to read a directory", + "pr": 909 + }, + { + "note": "Fix a bug where NpmResolver would crash when trying to read a directory", + "pr": 961 + } + ], + "timestamp": 1534210131 + }, + { "timestamp": 1532619515, "version": "1.0.4", "changes": [ diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md index 5d2ee154a..1427ec3fe 100644 --- a/packages/sol-resolver/CHANGELOG.md +++ b/packages/sol-resolver/CHANGELOG.md @@ -5,6 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.5 - _August 13, 2018_ + + * Fix a bug where RelativeFSResolver would crash when trying to read a directory (#909) + * Fix a bug where NpmResolver would crash when trying to read a directory (#961) + ## v1.0.4 - _July 26, 2018_ * Dependencies updated @@ -21,7 +26,7 @@ CHANGELOG * Dependencies updated -## v1.0.0 - _July 20, 2018_ +## v1.0.0 - _July 19, 2018_ * Fix a bug in FsResolver where it tries to read directories as files (#589) * Fix a bug in NameResolver where it is not ignoring .sol files (#589) @@ -34,7 +39,7 @@ CHANGELOG * Dependencies updated -## v0.0.6 - _June 1, 2018_ +## v0.0.6 - _May 31, 2018_ * Incorrect publish that was unpublished @@ -42,7 +47,7 @@ CHANGELOG * Dependencies updated -## v0.0.4 - _May 5, 2018_ +## v0.0.4 - _May 4, 2018_ * Dependencies updated diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index 908417659..7012772ee 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-resolver", - "version": "1.0.4", + "version": "1.0.5", "engines": { "node": ">=6.12" }, @@ -23,17 +23,17 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.4", + "@0xproject/tslint-config": "^1.0.5", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", "tslint": "5.11.0", - "typescript": "2.7.1" + "typescript": "2.9.2" }, "dependencies": { - "@0xproject/types": "^1.0.1-rc.3", - "@0xproject/typescript-typings": "^1.0.3", - "lodash": "^4.17.4" + "@0xproject/types": "^1.0.1-rc.4", + "@0xproject/typescript-typings": "^1.0.4", + "lodash": "^4.17.5" }, "publishConfig": { "access": "public" diff --git a/packages/sol-resolver/src/resolvers/npm_resolver.ts b/packages/sol-resolver/src/resolvers/npm_resolver.ts index 9f8617145..a2df0dcad 100644 --- a/packages/sol-resolver/src/resolvers/npm_resolver.ts +++ b/packages/sol-resolver/src/resolvers/npm_resolver.ts @@ -19,7 +19,7 @@ export class NPMResolver extends Resolver { const ROOT_PATH = '/'; while (currentPath !== ROOT_PATH) { const lookupPath = path.join(currentPath, 'node_modules', packageName, pathWithinPackage); - if (fs.existsSync(lookupPath)) { + if (fs.existsSync(lookupPath) && fs.lstatSync(lookupPath).isFile()) { const fileContent = fs.readFileSync(lookupPath).toString(); return { source: fileContent, diff --git a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts index 77103b8c1..ed96040d3 100644 --- a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts +++ b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts @@ -14,7 +14,7 @@ export class RelativeFSResolver extends Resolver { // tslint:disable-next-line:prefer-function-over-method public resolveIfExists(importPath: string): ContractSource | undefined { const filePath = path.join(this._contractsDir, importPath); - if (fs.existsSync(filePath)) { + if (fs.existsSync(filePath) && !fs.lstatSync(filePath).isDirectory()) { const fileContent = fs.readFileSync(filePath).toString(); return { source: fileContent, |