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

Asyncify without topmost interface #95

Merged
merged 64 commits into from
Nov 12, 2023

Commits on Oct 1, 2023

  1. Beautification of apm-cli

    No functional changes so far.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8b03d4c View commit details
    Browse the repository at this point in the history
  2. Wrap printVersions

    No tests broke. This is a functional change but very much a simple and
    basic transformation.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8095925 View commit details
    Browse the repository at this point in the history
  3. Promisify getPythonVersion

    All tests succeed. This is a wrapper implementation, like for printVersions.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    aa6b2e9 View commit details
    Browse the repository at this point in the history
  4. Promisify getPythonVersion

    Under similar terms as the previous ones. Tests passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    debca29 View commit details
    Browse the repository at this point in the history
  5. 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
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    6058e8c View commit details
    Browse the repository at this point in the history
  6. Better sort broken testfiles

    It seems that install-spec was the one that didn't close the server, causing the remaining
    tests using a server to break.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    fe3bf87 View commit details
    Browse the repository at this point in the history
  7. 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
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    b092ca5 View commit details
    Browse the repository at this point in the history
  8. auth.js getToken asyncified

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    1baaa60 View commit details
    Browse the repository at this point in the history
  9. Promisify ci.js

    Tests still pass. It's a really thin Promise wrapper on the existing code.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    cf85347 View commit details
    Browse the repository at this point in the history
  10. Promisification of clean.js

    Tiny file, tiny wrapper, tests pass.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    ccb5d3e View commit details
    Browse the repository at this point in the history
  11. Promisification of config.js

    Tests pass, tiny wrapper of tiny command
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    34d78f7 View commit details
    Browse the repository at this point in the history
  12. Promisification of disable.js

    A bit fatter wrapping for a bit fatter command. Tests are passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    689e8e6 View commit details
    Browse the repository at this point in the history
  13. Promisification of docs.js

    Tests passing, trivial wrapper used.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    2e25bb0 View commit details
    Browse the repository at this point in the history
  14. Promisification of enable.js

    Tests passing. Trivial wrapper added.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    11b6f14 View commit details
    Browse the repository at this point in the history
  15. Promisification of featured.js

    Tests passing. Two of the three methods could immediately be turned into async 🎉
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    9823c21 View commit details
    Browse the repository at this point in the history
  16. Promisification of fs.js

    It was so small that it was easier to do than not do.
    Only install.js was modified which is currently not tested.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    a4e6d70 View commit details
    Browse the repository at this point in the history
  17. Promisify git.js

    Tests still passing. The main change is that printVersions in apm-cli could be promisified
    as a result.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    1093f4a View commit details
    Browse the repository at this point in the history
  18. Promisification of init.js pt.1

    Tests passing. run could be asyncified right away. I still want to tackle
    generateFromTemplate which is ugly.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    df0adba View commit details
    Browse the repository at this point in the history
  19. init.js pt2: make generateFromTemplate look a bit more sensible

    Tests still passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    47f7dba View commit details
    Browse the repository at this point in the history
  20. Asyncification of link.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    6da61f5 View commit details
    Browse the repository at this point in the history
  21. Asyncification of links.js

    This one has no tests but the code is banal.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    34b00e9 View commit details
    Browse the repository at this point in the history
  22. Promisification of list.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8aea62a View commit details
    Browse the repository at this point in the history
  23. Asyncification and polishment of package-converter.js

    Tests passing. init.js could also see some refinement.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    17a9ace View commit details
    Browse the repository at this point in the history
  24. Tiny refinement of packages.js

    All tests passing, this one was banal.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    1cb698b View commit details
    Browse the repository at this point in the history
  25. Promisification of publish.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8082018 View commit details
    Browse the repository at this point in the history
  26. Promisification of search.js

    Tests passing. It's a rather small change but the run method could
    be asyncified at least.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    63ba42c View commit details
    Browse the repository at this point in the history
  27. Fix with auth.js

    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
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    aee88bb View commit details
    Browse the repository at this point in the history
  28. Make saveToken more synchronized

    It really wraps a Promise that has async operations in it; it probably shouldn't
    throw a synchronous error either.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    1f3eced View commit details
    Browse the repository at this point in the history
  29. Promisify star.js

    There were no tests for this and currently I couldn't get keytar working in
    my environment so I'm relying on common sense.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    a6a5410 View commit details
    Browse the repository at this point in the history
  30. Asyncification of stars.js

    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). :)
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    02d399c View commit details
    Browse the repository at this point in the history
  31. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    356b6ef View commit details
    Browse the repository at this point in the history
  32. Asyncification of TextMate theme conversion

    All tests passing. Some synchronization has been fixed and converTheme got
    nicer and better in init.js.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    c6de74f View commit details
    Browse the repository at this point in the history
  33. Prettifying tree.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    f2306f7 View commit details
    Browse the repository at this point in the history
  34. Promisification of uninstall.js

    Tests are still passing. This async.eachSeries is quite bothering, it would be
    great to eliminate it eventually.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    325bf0a View commit details
    Browse the repository at this point in the history
  35. Asyncification of unlink.js

    All tests passing.
    This could be plain sequential code as well but it's more convenient to stick
    to the async interface.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    dba0396 View commit details
    Browse the repository at this point in the history
  36. Asyncification of unpublish.js

    Test passes after the sufficient modification. The code is basically what
    we can expect as final state overall.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    c016e26 View commit details
    Browse the repository at this point in the history
  37. Promisification of unstar.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    0ef6662 View commit details
    Browse the repository at this point in the history
  38. Asyncification of view.js

    Tests still passing. This means that docs.js could be completely asyncified.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8fc1243 View commit details
    Browse the repository at this point in the history
  39. Promisification of rebuild.js

    All tests passing. This one is interweaved with config.js and the Command
    base class so it's still mostly a trivial Promise wrapper.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    9139db1 View commit details
    Browse the repository at this point in the history
  40. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    34c73ba View commit details
    Browse the repository at this point in the history
  41. Prettifying git.js

    No interface modifications, just some looks. All tests passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    2cb92e5 View commit details
    Browse the repository at this point in the history
  42. Promisification of apm.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    f598740 View commit details
    Browse the repository at this point in the history
  43. Asyncify and fix upgrade.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    ae43a46 View commit details
    Browse the repository at this point in the history
  44. Rewrite use of async module to more Promise-based interface

    I 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    f16576b View commit details
    Browse the repository at this point in the history
  45. Promisification of install.js

    The situation is desperate but I needed to save my work.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    9d75fed View commit details
    Browse the repository at this point in the history
  46. install.js reimagination of installGitPackage

    With this modification, the test can be run partially, without breaking
    anything else...
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    e8dd06f View commit details
    Browse the repository at this point in the history
  47. FIxing installation tests.

    At last, ALL tests are passing, with slight undefined vs null modifications! 🥳
    That could be reclaimed later on if it really matters.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    ede3fe9 View commit details
    Browse the repository at this point in the history
  48. asyncification of dedupe.js

    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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    4f3f7e3 View commit details
    Browse the repository at this point in the history
  49. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    92f7ae7 View commit details
    Browse the repository at this point in the history
  50. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    0aaac88 View commit details
    Browse the repository at this point in the history
  51. Eliminating all callbacks from develop.js

    Similar to the last commit. All tests passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    cfac2bf View commit details
    Browse the repository at this point in the history
  52. 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...
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    0a3e5c2 View commit details
    Browse the repository at this point in the history
  53. Eliminating all callbacks from unstar.js

    Similar to the previous cosmetic changes. All tests still passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8ba5e83 View commit details
    Browse the repository at this point in the history
  54. Eliminating all callbacks from upgrade.js

    Similar to the previous ones. All tests passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    316d9fe View commit details
    Browse the repository at this point in the history
  55. Promisification of request.js

    *without the main user-facing interface because that's deliberately not a Node-style
    callback. All tests are passing.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    ae90d47 View commit details
    Browse the repository at this point in the history
  56. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    8576053 View commit details
    Browse the repository at this point in the history
  57. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    5e8d109 View commit details
    Browse the repository at this point in the history
  58. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    ba12df8 View commit details
    Browse the repository at this point in the history
  59. Fix --version flag

    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...
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    71278ea View commit details
    Browse the repository at this point in the history
  60. 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.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    2ba286b View commit details
    Browse the repository at this point in the history
  61. Eliminating unnecessary Promise contructors in favor of async

    All tests still passing. Some unused code and leftover wrapping removed.
    Polgár Márton authored and DeeDeeG committed Oct 1, 2023
    Configuration menu
    Copy the full SHA
    0e865d2 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. s/Atom/Pulsar/ on the go

    Co-authored-by: confused_techie <dev@lhbasics.com>
    2colours and confused-Techie authored Oct 18, 2023
    Configuration menu
    Copy the full SHA
    72f929d View commit details
    Browse the repository at this point in the history
  2. s/Atom/Pulsar/ in install

    Co-authored-by: confused_techie <dev@lhbasics.com>
    2colours and confused-Techie authored Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e35010a View commit details
    Browse the repository at this point in the history
  3. s/Atom/Pulsar/ in enable

    Co-authored-by: confused_techie <dev@lhbasics.com>
    2colours and confused-Techie authored Oct 18, 2023
    Configuration menu
    Copy the full SHA
    4d0b679 View commit details
    Browse the repository at this point in the history