Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Use require.resolve to lookup contracts in deps #1110

Merged
merged 3 commits into from
Jul 17, 2019

Conversation

spalladino
Copy link
Contributor

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076
@spalladino
Copy link
Contributor Author

And here as well! :-)

Copy link
Contributor

@jbcarpanelli jbcarpanelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💪 Loved that you removed that assertErrorMessage function that wasn't testing the fn call sent as parameter in a proper way.

@@ -27,6 +28,10 @@ export default class Contracts {
return path.resolve(Contracts.contractsDir || Contracts.DEFAULT_CONTRACTS_DIR);
}

public static getProjectRoot(): string {
return path.resolve(this.projectRoot || process.cwd());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice one!

@jbcarpanelli jbcarpanelli merged commit dae67b8 into master Jul 17, 2019
@mergify mergify bot deleted the fix/support-yarn-workspaces-#1076 branch July 17, 2019 17:49
spalladino added a commit that referenced this pull request Jul 17, 2019
* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests
spalladino added a commit that referenced this pull request Jul 18, 2019
* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests
spalladino added a commit that referenced this pull request Jul 18, 2019
* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests
spalladino added a commit that referenced this pull request Jul 18, 2019
* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests
jbcarpanelli pushed a commit that referenced this pull request Jul 18, 2019
* Do not fail if contracts folder is missing (#1107)

Fixes #1068

* Handle incorrect keys to loggy (#1112)

* Handle incorrect keys to loggy

When calling Loggy.success with a non-existing key, the reference would not be found, and the call to path.basename in Loggy._log would fail (since its parameter was null). This commit:

- Catches any exceptions in _log, and displays an error (allowing to continue)
- Adds a testing mode to the logger, which is silent but executes logic, and throws an exception upon issues (only to be used in the CLI and lib tests)
- Fixes incorrect or missing keys in calls to the logger

* Remove failing test

* Use require.resolve to lookup contracts in deps (#1110)

* Use chai expect throw syntax in Dependency tests

* Use require.resolve to lookup contracts in deps

Change lookup in both Dependency and Contracts classes. Instead of looking for just node_modules in the current folder, it uses require.resolve (relative to the current workdir) to look for the dependency.

Fixes #1076

* Fix tests

* Add changelogs

* Reset circle cache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work with yarn workspaces
2 participants