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

Doesn't work with yarn workspaces #1076

Closed
PaulRBerg opened this issue Jul 8, 2019 · 1 comment · Fixed by #1110
Closed

Doesn't work with yarn workspaces #1076

PaulRBerg opened this issue Jul 8, 2019 · 1 comment · Fixed by #1110
Assignees
Labels

Comments

@PaulRBerg
Copy link
Contributor

PaulRBerg commented Jul 8, 2019

I cannot use zos within a monorepo maintained with yarn workspaces. I'm getting the following error:

Could not find a zos.json file for 'openzeppelin-eth'. Make sure it is provided by the npm package.

Workspaces is a feature from yarn that aggregates all common node modules at the root of your repo, but I presume zos is only looking for the relative folder, never above.

I also asked about an alternative solution on StackOverflow, but no one answered: https://stackoverflow.com/questions/56910467/when-using-yarn-workspaces-how-to-force-a-package-to-be-installed-in-the-relati

@jbcarpanelli
Copy link
Contributor

Hey @PaulRBerg! Thanks for raising this. Indeed, zos only looks for EVM packages inside the project's node_modules folder, so this is probably causing the issue. We'll check it out 👍

@spalladino spalladino self-assigned this Jul 16, 2019
spalladino added a commit that referenced this issue Jul 16, 2019
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
jbcarpanelli pushed a commit that referenced this issue 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 issue 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 issue 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 issue 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 issue 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 issue 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants