aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-resolver')
-rw-r--r--packages/sol-resolver/CHANGELOG.json14
-rw-r--r--packages/sol-resolver/CHANGELOG.md11
-rw-r--r--packages/sol-resolver/package.json12
-rw-r--r--packages/sol-resolver/src/resolvers/npm_resolver.ts2
-rw-r--r--packages/sol-resolver/src/resolvers/relative_fs_resolver.ts2
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,