-
Notifications
You must be signed in to change notification settings - Fork 9
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
Trying to support non cli #22
Conversation
…f github.com:phyzical/npm-add-dependencies into Trying-To-Support-non-cli # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
* added eslintrc * added packagejson changes to support linting * QOL changes :)
* added the clie index again now that package json isnt borked
…omething * one slight change to AddDeps to support promise trickle down
* its getting there!
* refactored cli to see if it can use run too
* argv mocked * figured out how to mock things like process.exit correctly
various fixes to reduce false positives tried testing cli failed started the class level tests
hey @arfeo ! finally got some time today to have another crack at the tests. When you get time please give it a review :) the only set of tests i couldn't seem to get working were the top level cli-index tests, i think this was due to when i try to trigger it with a "require('cli-index')" there's no way for me to tell jest "Okay its done check for expects now please". But this shouldn't be a big deal anyway as im testing the functions themselves also. so a quick summary
|
Hey! I'd really like to see this feature added, I also need it. By the way, multiple files don't have a trailing newline, and you should add ESModules exports Anyway is there still a chance for this to be merged? 😄 |
ill split them out over the weekend. i agree the pr is fairly large. as for the tests they are all working i just couldn't figure out how to test it as a cli module ill look into resolving point too "By the way, multiple files don't have a trailing newline, and you should add ESModules exports" 👍 |
Hey! I would just like to clarify: when I suggested using ESModule exports, I was talking about allowing people using native Nodejs' modules (with To export the library as a native ESModule (in addition to CommonJS and/or babel), you would need to create an Btw, it might be a bit hard if you've never done TS but I think you should add an Otherwise, I'm really looking forward to these changes to be merged 😄 |
@noftaly thanks for the input. im a bit of a scrub when it comes to ESModules (as you can tell haha). i got the tests passing by applying the babel then only just got around to testing it with node just now and yeah it didnt play ball. im going to roll back what i did and just make a .mjs file as your link suggests to give people the option 👍 the one thing im a bit vague on at this moment is how here can call import when they just do module exports in the original index.js, is it magic when ive done a bit of TS (not much) but it is something ive wanted to learn more (code completion is king imo) so if you don't beat me to it ill add that too :) |
…f github.com:phyzical/npm-add-dependencies into Trying-To-Support-non-cli # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
@noftaly Hey again, i confirmed that the revert + .tsm file works for import with the ive also added a script entry for typescript generation for auto .d.ts files ill look into the best way to make the .ts files hopefully tomorrow unless you do it/ find a way :) |
Great job! |
Hey guys. How're you doing? |
Hey @arfeo, Hope you have been well! This Pr is ready for review when you get a chance 👍 The only item left to cross off is how to test the cli context of npm-add. i will have one more try at this later today before throwing in the towel on this |
…ic to fix test package.json file names
one final followup: finished the cli context tests so it should be fully ready now 👍 |
@arfeo 👀 |
Actually, I would propose to split this huuuuuge PR to a few smaller ones. The current PR is overloaded with new features which have little to nothing to do with its title. |
Let's start with the main idea of this PR... No jest, no eslint, whatever. Not this time. |
Fixes #18
Fixes #20
Proposed Changes