-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Asyncify without topmost interface #95
Commits on Oct 1, 2023
-
No functional changes so far.
Configuration menu - View commit details
-
Copy full SHA for 8b03d4c - Browse repository at this point
Copy the full SHA 8b03d4cView commit details -
No tests broke. This is a functional change but very much a simple and basic transformation.
Configuration menu - View commit details
-
Copy full SHA for 8095925 - Browse repository at this point
Copy the full SHA 8095925View commit details -
All tests succeed. This is a wrapper implementation, like for printVersions.
Configuration menu - View commit details
-
Copy full SHA for aa6b2e9 - Browse repository at this point
Copy the full SHA aa6b2e9View commit details -
Under similar terms as the previous ones. Tests passing.
Configuration menu - View commit details
-
Copy full SHA for debca29 - Browse repository at this point
Copy the full SHA debca29View commit details -
Wrapping all the command executions
There are failing tests that I isolated in a spec2 folder. - develop-spec seems like it "mocks out" the resolution of the Promise, causing some tests to fail - stars-spec explodes with a "trying to reopen HTTP port" error, probably some cleanup section couldn't run - test-spec mocks I/O of processes and for some reason, the tests won't produce the right output - unpublish-spec fails at the unpublishing itself, there is a lot of mocking but the failure looks too legit nevertheless - upgrade-spec first times out and then dies with the "HTTP port" error, like stars-spec
Configuration menu - View commit details
-
Copy full SHA for 6058e8c - Browse repository at this point
Copy the full SHA 6058e8cView commit details -
It seems that install-spec was the one that didn't close the server, causing the remaining tests using a server to break.
Configuration menu - View commit details
-
Copy full SHA for fe3bf87 - Browse repository at this point
Copy the full SHA fe3bf87View commit details -
Cleanup and promisification of the develop command
And the polishment of the corresponding test which passes now. 🎉 getRepositoryUrl has a true resolve-reject interface, the rest always resolves, mostly wrapped by the Promise constructor
Configuration menu - View commit details
-
Copy full SHA for b092ca5 - Browse repository at this point
Copy the full SHA b092ca5View commit details -
All the previous tests pass still. Finally, a function that could be changed to an async flow, rather than just wrapped into a Promise. The calls have been modified appropriately.
Configuration menu - View commit details
-
Copy full SHA for 1baaa60 - Browse repository at this point
Copy the full SHA 1baaa60View commit details -
Tests still pass. It's a really thin Promise wrapper on the existing code.
Configuration menu - View commit details
-
Copy full SHA for cf85347 - Browse repository at this point
Copy the full SHA cf85347View commit details -
Tiny file, tiny wrapper, tests pass.
Configuration menu - View commit details
-
Copy full SHA for ccb5d3e - Browse repository at this point
Copy the full SHA ccb5d3eView commit details -
Tests pass, tiny wrapper of tiny command
Configuration menu - View commit details
-
Copy full SHA for 34d78f7 - Browse repository at this point
Copy the full SHA 34d78f7View commit details -
A bit fatter wrapping for a bit fatter command. Tests are passing.
Configuration menu - View commit details
-
Copy full SHA for 689e8e6 - Browse repository at this point
Copy the full SHA 689e8e6View commit details -
Tests passing, trivial wrapper used.
Configuration menu - View commit details
-
Copy full SHA for 2e25bb0 - Browse repository at this point
Copy the full SHA 2e25bb0View commit details -
Tests passing. Trivial wrapper added.
Configuration menu - View commit details
-
Copy full SHA for 11b6f14 - Browse repository at this point
Copy the full SHA 11b6f14View commit details -
Promisification of featured.js
Tests passing. Two of the three methods could immediately be turned into async 🎉
Configuration menu - View commit details
-
Copy full SHA for 9823c21 - Browse repository at this point
Copy the full SHA 9823c21View commit details -
It was so small that it was easier to do than not do. Only install.js was modified which is currently not tested.
Configuration menu - View commit details
-
Copy full SHA for a4e6d70 - Browse repository at this point
Copy the full SHA a4e6d70View commit details -
Tests still passing. The main change is that printVersions in apm-cli could be promisified as a result.
Configuration menu - View commit details
-
Copy full SHA for 1093f4a - Browse repository at this point
Copy the full SHA 1093f4aView commit details -
Promisification of init.js pt.1
Tests passing. run could be asyncified right away. I still want to tackle generateFromTemplate which is ugly.
Configuration menu - View commit details
-
Copy full SHA for df0adba - Browse repository at this point
Copy the full SHA df0adbaView commit details -
init.js pt2: make generateFromTemplate look a bit more sensible
Tests still passing.
Configuration menu - View commit details
-
Copy full SHA for 47f7dba - Browse repository at this point
Copy the full SHA 47f7dbaView commit details -
Tests still passing. It was so banal that it could be asyncified right away. As a positive side effect, linkPackage in develop.js doesn't have to be wrapped with the Promise constructor anymore.
Configuration menu - View commit details
-
Copy full SHA for 6da61f5 - Browse repository at this point
Copy the full SHA 6da61f5View commit details -
This one has no tests but the code is banal.
Configuration menu - View commit details
-
Copy full SHA for 34b00e9 - Browse repository at this point
Copy the full SHA 34b00e9View commit details -
All tests passing, some code could be asyncified again. It's important to note that some errors might slip through the commands but the API of run is not stable yet either way.
Configuration menu - View commit details
-
Copy full SHA for 8aea62a - Browse repository at this point
Copy the full SHA 8aea62aView commit details -
Asyncification and polishment of package-converter.js
Tests passing. init.js could also see some refinement.
Configuration menu - View commit details
-
Copy full SHA for 17a9ace - Browse repository at this point
Copy the full SHA 17a9aceView commit details -
Tiny refinement of packages.js
All tests passing, this one was banal.
Configuration menu - View commit details
-
Copy full SHA for 1cb698b - Browse repository at this point
Copy the full SHA 1cb698bView commit details -
this was a large one but also rather educational one. Tests still passing, although their amount is worryingly low so probably some further testing will be necessary.
Configuration menu - View commit details
-
Copy full SHA for 8082018 - Browse repository at this point
Copy the full SHA 8082018View commit details -
Tests passing. It's a rather small change but the run method could be asyncified at least.
Configuration menu - View commit details
-
Copy full SHA for 63ba42c - Browse repository at this point
Copy the full SHA 63ba42cView commit details -
There was a mistake in the porting, and perhaps it's good to make it more apparent that auth.saveToken really wraps an async call
Configuration menu - View commit details
-
Copy full SHA for aee88bb - Browse repository at this point
Copy the full SHA aee88bbView commit details -
Make saveToken more synchronized
It really wraps a Promise that has async operations in it; it probably shouldn't throw a synchronous error either.
Configuration menu - View commit details
-
Copy full SHA for 1f3eced - Browse repository at this point
Copy the full SHA 1f3ecedView commit details -
There were no tests for this and currently I couldn't get keytar working in my environment so I'm relying on common sense.
Configuration menu - View commit details
-
Copy full SHA for a6a5410 - Browse repository at this point
Copy the full SHA a6a5410View commit details -
All tests still passing (which actually means not all is lost with Install either, because it uses Install under the hood in some cases). Some of the commands had to be wrapped with the Promise constructor, others could be redone as async (as a result). :)
Configuration menu - View commit details
-
Copy full SHA for 02d399c - Browse repository at this point
Copy the full SHA 02d399cView commit details -
Promisification of test.js, fixing related test
It simply didn't wait for the callback to run... 🤦♂️ The tests are passing, some trivial promisification done in the command.
Configuration menu - View commit details
-
Copy full SHA for 356b6ef - Browse repository at this point
Copy the full SHA 356b6efView commit details -
Asyncification of TextMate theme conversion
All tests passing. Some synchronization has been fixed and converTheme got nicer and better in init.js.
Configuration menu - View commit details
-
Copy full SHA for c6de74f - Browse repository at this point
Copy the full SHA c6de74fView commit details -
All tests passing. This is not strictly an async-related change because this utility is mostly a modified forEach but the code could be improved nevertheless. Maybe it can even be eliminated eventually.
Configuration menu - View commit details
-
Copy full SHA for f2306f7 - Browse repository at this point
Copy the full SHA f2306f7View commit details -
Promisification of uninstall.js
Tests are still passing. This async.eachSeries is quite bothering, it would be great to eliminate it eventually.
Configuration menu - View commit details
-
Copy full SHA for 325bf0a - Browse repository at this point
Copy the full SHA 325bf0aView commit details -
All tests passing. This could be plain sequential code as well but it's more convenient to stick to the async interface.
Configuration menu - View commit details
-
Copy full SHA for dba0396 - Browse repository at this point
Copy the full SHA dba0396View commit details -
Asyncification of unpublish.js
Test passes after the sufficient modification. The code is basically what we can expect as final state overall.
Configuration menu - View commit details
-
Copy full SHA for c016e26 - Browse repository at this point
Copy the full SHA c016e26View commit details -
Tests passing but a properly executed unstar operation throws a weird error (just like now) because the backend sends an unexpected HTTP status code. The code itself is much like star.js.
Configuration menu - View commit details
-
Copy full SHA for 0ef6662 - Browse repository at this point
Copy the full SHA 0ef6662View commit details -
Tests still passing. This means that docs.js could be completely asyncified.
Configuration menu - View commit details
-
Copy full SHA for 8fc1243 - Browse repository at this point
Copy the full SHA 8fc1243View commit details -
All tests passing. This one is interweaved with config.js and the Command base class so it's still mostly a trivial Promise wrapper.
Configuration menu - View commit details
-
Copy full SHA for 9139db1 - Browse repository at this point
Copy the full SHA 9139db1View commit details -
Promise-based rework of command.js
All tests still passing. All the related calls have been modified. There is a reason I didn't hurry to do this... but it will allow for nicer interfaces. Actually, it already let me keep resolve and reject separate for a longer time.
Configuration menu - View commit details
-
Copy full SHA for 34c73ba - Browse repository at this point
Copy the full SHA 34c73baView commit details -
No interface modifications, just some looks. All tests passing.
Configuration menu - View commit details
-
Copy full SHA for 2cb92e5 - Browse repository at this point
Copy the full SHA 2cb92e5View commit details -
All tests still passing. For the modules where this had an effect and which have already been promisified, the benefits can already be seen: without changing their interface, their implementation could be made much more async-like.
Configuration menu - View commit details
-
Copy full SHA for f598740 - Browse repository at this point
Copy the full SHA f598740View commit details -
upgrade-spec.js has been reclaimed with all tests passing. Seems like the 'async' package has a nice async-friendly interface already. I don't quite like how getLatestVersion resolves with no value (undefined) for HTTP 404 and when the package is already the latest or missing... but for now, this is the setting that works.
Configuration menu - View commit details
-
Copy full SHA for ae43a46 - Browse repository at this point
Copy the full SHA ae43a46View commit details -
Rewrite use of
async
module to more Promise-based interfaceI adapted the test in one case; there is no point in sweating too much over undefined and null. Other than that, only refactored files have been modified, and all tests pass.
Configuration menu - View commit details
-
Copy full SHA for f16576b - Browse repository at this point
Copy the full SHA f16576bView commit details -
The situation is desperate but I needed to save my work.
Configuration menu - View commit details
-
Copy full SHA for 9d75fed - Browse repository at this point
Copy the full SHA 9d75fedView commit details -
install.js reimagination of installGitPackage
With this modification, the test can be run partially, without breaking anything else...
Configuration menu - View commit details
-
Copy full SHA for e8dd06f - Browse repository at this point
Copy the full SHA e8dd06fView commit details -
At last, ALL tests are passing, with slight undefined vs null modifications! 🥳 That could be reclaimed later on if it really matters.
Configuration menu - View commit details
-
Copy full SHA for ede3fe9 - Browse repository at this point
Copy the full SHA ede3fe9View commit details -
This command had already been broken on master but hey, if it's part of the code base, why not at least try to keep superficially up-to-date? :) All tests passing.
Configuration menu - View commit details
-
Copy full SHA for 4f3f7e3 - Browse repository at this point
Copy the full SHA 4f3f7e3View commit details -
Asyncification of rebuild-module-cache.js
This command is broken on master as well but install.js calls the rebuild method so I went ahead and asyncified it. It still doesn't work (I think the problem is related to asar and faulty resolution of "resource paths") but the tests are still passing.
Configuration menu - View commit details
-
Copy full SHA for 92f7ae7 - Browse repository at this point
Copy the full SHA 92f7ae7View commit details -
Eliminating all callbacks from ci.js
This is a cosmetic phase of the iterative development. I'm eliminating as much of callbacks as possible to see what work is left. All tests passing.
Configuration menu - View commit details
-
Copy full SHA for 0aaac88 - Browse repository at this point
Copy the full SHA 0aaac88View commit details -
Eliminating all callbacks from develop.js
Similar to the last commit. All tests passing.
Configuration menu - View commit details
-
Copy full SHA for cfac2bf - Browse repository at this point
Copy the full SHA cfac2bfView commit details -
Eliminating all callbacks from star.js
Similar to the previous two commits. All tests passing. It seems to me that probably only request.js and login.js are still the old way...
Configuration menu - View commit details
-
Copy full SHA for 0a3e5c2 - Browse repository at this point
Copy the full SHA 0a3e5c2View commit details -
Eliminating all callbacks from unstar.js
Similar to the previous cosmetic changes. All tests still passing.
Configuration menu - View commit details
-
Copy full SHA for 8ba5e83 - Browse repository at this point
Copy the full SHA 8ba5e83View commit details -
Eliminating all callbacks from upgrade.js
Similar to the previous ones. All tests passing.
Configuration menu - View commit details
-
Copy full SHA for 316d9fe - Browse repository at this point
Copy the full SHA 316d9feView commit details -
*without the main user-facing interface because that's deliberately not a Node-style callback. All tests are passing.
Configuration menu - View commit details
-
Copy full SHA for ae90d47 - Browse repository at this point
Copy the full SHA ae90d47View commit details -
Asyncification of getTokenOrLogin
This is the main reason I didn't want to touch Login before. It wasn't as scary as it first seemed. All tests passing, the only thing left is the Login command itself.
Configuration menu - View commit details
-
Copy full SHA for 8576053 - Browse repository at this point
Copy the full SHA 8576053View commit details -
Elimination of Q and (partial) asyncification of login.js
All tests passing - but tests are too lenient because they don't actually test the prompt path... That seems to work, too. The interface is still unmodified because this was the only command that had separate error and return value.
Configuration menu - View commit details
-
Copy full SHA for 5e8d109 - Browse repository at this point
Copy the full SHA 5e8d109View commit details -
Fully rework login.js into async
Tests (and manual check) passes. Now the command has no special return value, and getTokenOrLogin calls a method that can have one.
Configuration menu - View commit details
-
Copy full SHA for ba12df8 - Browse repository at this point
Copy the full SHA ba12df8View commit details -
The recent PR pulsar-edit#100 made me want to check this command and I noticed I messed up at two places to make this work. Rather obvious fixes for a fortunate catch...
Configuration menu - View commit details
-
Copy full SHA for 71278ea - Browse repository at this point
Copy the full SHA 71278eaView commit details -
Eliminating the promiseBased setting of commands
Now that everything is Promise-based (and anything new should also be), it's pointless to keep an option for classes to avoid wrapping into Promises. Nothing should be wrapped anymore.
Configuration menu - View commit details
-
Copy full SHA for 2ba286b - Browse repository at this point
Copy the full SHA 2ba286bView commit details -
Eliminating unnecessary Promise contructors in favor of async
All tests still passing. Some unused code and leftover wrapping removed.
Configuration menu - View commit details
-
Copy full SHA for 0e865d2 - Browse repository at this point
Copy the full SHA 0e865d2View commit details
Commits on Oct 18, 2023
-
Co-authored-by: confused_techie <dev@lhbasics.com>
Configuration menu - View commit details
-
Copy full SHA for 72f929d - Browse repository at this point
Copy the full SHA 72f929dView commit details -
Co-authored-by: confused_techie <dev@lhbasics.com>
Configuration menu - View commit details
-
Copy full SHA for e35010a - Browse repository at this point
Copy the full SHA e35010aView commit details -
Co-authored-by: confused_techie <dev@lhbasics.com>
Configuration menu - View commit details
-
Copy full SHA for 4d0b679 - Browse repository at this point
Copy the full SHA 4d0b679View commit details