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

Decaffeinate #127

Merged
merged 81 commits into from
Apr 9, 2024
Merged

Decaffeinate #127

merged 81 commits into from
Apr 9, 2024

Conversation

4ver
Copy link
Member

@4ver 4ver commented Apr 8, 2024

This removes all CoffeeScript in favor of JavaScript and EM6 module.
Actually add AppX support.
Improve Linux support.
Improve test coverage.

API breakage: to better support extra arguments to be added at launch and to better structure the options, the API is changed. While it should still support the old options, I may have missed some cases.

Using decaffeinate npm module. Clean up has yet to come.
Delete coffee files.
Update .npmignore, .editorconfig and package.json
Add .eslintrc.json

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Some urls and dependencies need to be updated.

Signed-off-by: Alexandre Demers <[email protected]>
Our code will now have to use ES module coding style.

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Introduce an API handler function which returns the right instance of
AutoLaunch API implementation according to the platform it is running on.

The API class and subclasses will be moved under their own folder in a
latter commit, once we are ready to use this function.

Signed-off-by: Alexandre Demers <[email protected]>
An empty string was able to pass through. Catch all falsy values.

Signed-off-by: Alexandre Demers <[email protected]>
…API implementation

Separate the code under a basic AutoLaunchAPI class and implement per
platform child classes. This way, we can have specific code coherent with
each platform, based on prior code.

Since we are now working with classes, an instanciated object can refer to
its own parameters using "this".

Move the modules under library folder and its subfolder.

Fix some more decaffeinated code.

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Fix some anonymous functions using "fat arrow" to access "this".

Signed-off-by: Alexandre Demers <[email protected]>
The "mac" object has been relocated under "options" wirth the new API.

Signed-off-by: Alexandre Demers <[email protected]>
Technically, someone could use the --experimental-modules flag with nodejs
version 12. But since we are going to bump the major version, we can
upgrade our dependency requirements.

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
This needs to be handled by and for Linux and FreeBSD specifically. It
takes care of path when AppImage packages are used. It also escapes the
path properly for its use in the Desktop entry file.

Signed-off-by: Alexandre Demers <[email protected]>
This needs to be handled by and for macOS specifically.

Signed-off-by: Alexandre Demers <[email protected]>
Can't push() without an array.

Signed-off-by: Alexandre Demers <[email protected]>
The instance knows about itself and can refer to its own parameters.

Signed-off-by: Alexandre Demers <[email protected]>
In the decaffeination, it seems I mixed the mkdirp() call usage.
No callback, but a then().

Clarify style because oneliner blocks are a hell to spot and read.
Move anonymous "function" name to using "fat arrow" (leftovers).

Signed-off-by: Alexandre Demers <[email protected]>
Move some anonymous "function" to using "fat arrow" (leftovers).

Better class the tests between platforms. POSIX tests should be run on both
Linux/FreeBSD and macOS platforms since they rely on writting and reading
files on POSIX filesystems.

Signed-off-by: Alexandre Demers <[email protected]>
Eventhough my local testing tells me otherwise when testing, there is no
.opts member anymore.

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
Oxalin and others added 27 commits January 2, 2024 01:59
This will shutoff some warnings.

Signed-off-by: Alexandre Demers <[email protected]>
It still works fine when tested locally, but how will the CI deal will it?

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
If we need to test some specific macOS features, we will add specific
tests. However, for now, we were testing the same thing, but with some
options specific to macOS pushed to AutoLaunch's constructor.

Signed-off-by: Alexandre Demers <[email protected]>
Still working on local Linux machine. Will it work in CI?

Signed-off-by: Alexandre Demers <[email protected]>
Because we are back at the start where done() catches a non-error pointing
at ~/.config/autostart

Signed-off-by: Alexandre Demers <[email protected]>
Maybe this will do the trick.

Signed-off-by: Alexandre Demers <[email protected]>
The problem was not at all where I was looking for it. The error was
arising on CI because the autostart folder must not exists. Thus,
createFile() was wrongly throwing an error after calling mkdirp. Mkdirp
returns a string if a folder is created (the first one created if
recursive) or undefined if the folder already exists. In case of error,
it rejects the Promise.

Since Node fs can manage mkdir recursively itself, let's use the native
call and use the callback to manage the error/rejection if any.

Fix catch(done) to catch failures properly.

Signed-off-by: Alexandre Demers <[email protected]>
Signed-off-by: Alexandre Demers <[email protected]>
… tests

We were leaving garbages behind us when testing. Make sure we clean it up.

To allow proper cleanup, move the failure tests all together so they don't
mix up with the after/afterEach call.

POSIX: add some tests to ensure we properly honor appName with the
Desktop entry file.
Signed-off-by: Alexandre Demers <[email protected]>
To help solve issue 122, improve the information logged about the
app's path and any error message when registring or unregistring the
registry key.
(see #122)

Signed-off-by: Alexandre Demers <[email protected]>
Actually bump major version for RC preparation

Signed-off-by: Alexandre Demers <[email protected]>
…o Oxalin-decaffeinate

Fix remaining issue from decaffeination and other improvements.
Decaffeinate, add new features and possible API breakage
@Oxalin
Copy link
Collaborator

Oxalin commented Apr 9, 2024

Let's bring this in as a release candidat for v6.0.0

Copy link
Collaborator

@Oxalin Oxalin left a comment

Choose a reason for hiding this comment

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

Big move, the code is now formatted. Let's bring this in and see if we missed something along the way.

@Oxalin Oxalin merged commit c332f54 into master Apr 9, 2024
12 checks passed
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