Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for multiple configurations in package.json #701

Merged
merged 17 commits into from
Mar 5, 2021

Conversation

rogerfitz
Copy link
Member

  • Please check if the PR fulfills these requirements
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    feature

  • What is the current behavior? (You can also link to an open issue here)
    Currently package.json does not support env's and inherits properties following parent vs nested logic introduced in feat: improve configuration from package.json #606

  • What is the new behavior (if this is a feature change)?
    Adds support for package.json idyll to have multiple options. Selectable by API and command line env with functionality as described in Add support for multiple configurations in package.json #640

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

  • Other information:

  • Did I make the test case too big with the node_modules being included? I can work on trimming that if needed
  • Also any thoughts on how best to test the different cases in the test? I did a test where outer-project and inner-project have same environments defined but I wasn't sure how best to have it test the other permutations like we talked about in Add support for multiple configurations in package.json #640. Either parent has env but nested doesn't and throws error or parent doesn't have env but local does so no error.
  • I modified searchParentDirectories to return the file rather than the file.idyll so I could use things more uniformly between parent file vs local

@mathisonian
Copy link
Member

Thanks so much for this @rogerfitz! I'm reviewing now and will leave comments as I go. I believe you should be able to safely exclude the node_modules folder from the tests (assuming that all of the dependencies are already available in the project somewhere, if not we can talk through the best way to handle that).

packages/idyll-cli/package.json Show resolved Hide resolved
@@ -3570,7 +3570,7 @@ command-join@^2.0.0:
dependencies:
"@improved/node" "^1.0.0"

command-line-args@^5.0.0:
command-line-args@^5.0.0, command-line-args@^5.1.1:
Copy link
Member

Choose a reason for hiding this comment

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

If you end up changing the package.json based on my comment above, re-run yarn to regenerate this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I did this right but not 100% sure. Quite a large diff but that could be expected from full regenerate? I copied yarn.lock from idyll master and then ran yarn install

@@ -1,330 +1,397 @@
const fs = require('fs');
Copy link
Member

Choose a reason for hiding this comment

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

Big diff for this file - is this a full re-write or just Git being annoying? If you can point to the parts that changed it will be helpful

Copy link
Member

Choose a reason for hiding this comment

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

Is the change to searchParentDirectories the only existing functionality that changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that and then the new functionality. Will clean up based on your other comment about that one liner

Copy link
Member Author

@rogerfitz rogerfitz Mar 3, 2021

Choose a reason for hiding this comment

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

Just pushed a merged version of this. I think Git was just being funny, I handled the merge by copying idyll master's index.js over and making the edits by copying lines from my fork into that so I didn't miss anything. Should be relatively straightforward to see the line changes but the diff is ugly

@mathisonian
Copy link
Member

There was a small change to idyll-cli/src/index.js recently that I think is giving the merge conflict. I believe its just this one liner: 48b91bf#diff-7992088eddfefcd56354965a72d75010b7c7aad4dabaff28a54b378a479ed3ff

@rogerfitz
Copy link
Member Author

All those comments should be resolved. Let me know if there's anything else that needs changing.

Anything else you think would be a good issue for me to look at? A while ago I thought I saw something about adding a leaflet component that looked interesting (I'm starting to work with leaflet on some other projects right now) but I could be mistaken. Happy to look deeper into that husky error or windows development issues I had too if that sounds good to you

@mathisonian
Copy link
Member

Nice, thanks @rogerfitz! I'll review the new changes and get this merged shortly.

Some type of [Map /] component has been at the top of the list, so a leaflet component would be very welcome. There's also a very basic example using Mapbox.

Another issue that would be helpful is #694. This one should be a relatively quick fix - it seems like there's an issues with the latest node, I believe related to the specific version of react-tooltip that the runtime depends on. The solution likely is either to upgrade that dependency or drop it.

For the husky errors fixes are also welcome. It would also be good to just open an issue on them for visibility if others are running into the same problem

@rogerfitz
Copy link
Member Author

rogerfitz commented Mar 5, 2021

Thanks sounds good. I'll take a stab at #694 first and open a husky issue once I replicate it to see if others have the issues too before looking into [Map /] more

@mathisonian
Copy link
Member

Awesome, thanks @rogerfitz! I have a temporary fix for #649 that I'm going to PR and merge soon because I need it for some user studies that are running tomorrow, but if you figure out a way to solve the problem without nuking the dependency completely that would still be appreciated

@mathisonian mathisonian self-requested a review March 5, 2021 18:22
@mathisonian mathisonian merged commit cc00504 into idyll-lang:master Mar 5, 2021
@mathisonian
Copy link
Member

Just merged, thanks @rogerfitz! Since you've made a substantial contribution I've invited you to join as a member of the Idyll organization on GitHub, per our policy.

In the future you can work off of branches directly on this repo rather than forks, which will make it easier for us to collaborate if we both want to push changes to the same PR.

@rogerfitz
Copy link
Member Author

Oh cool thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants