As recently several people have been asking for things
that are described in `RUNNING-LOCALLY.md`, but couldn't be
found in the `CONTRIBUTING.md`, this consilidates the two into
one single resource to look for on how to get started developing.
Change-Type: patch
electron-builder seems to ship with an older AppImages version that
doesn't play very well with the custom AppImages elevation system we
created.
More particularly, we can't execute custom binaries inside the mounted
AppImage given that the mount point seems to lose permissions, owner,
and group file information.
This commit goes back to our old custom build system just for AppImages,
until we properly solve the problem, which will likely involve updating
the AppImages version in electron-builder.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This version contains a fix to a set of very recurrent "Unmount failed"
macOS errors.
See: https://github.com/resin-io-modules/mountutils/pull/44
Change-Type: patch
Changelog-Entry: Fix most "Unmount failed" errors on macOS.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Its very unlikely that we will ever support cross platform builds. For
that reason, let's simplify the whole Makefile by removing the concept
of target and host platforms.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Simply running `_.merge` on an Error object results in an empty plain
object `{}` being sent to Mixpanel/Sentry.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Etcher has local native code that gets built to `build/`, but that's not
being included inside the final asar.
The fix is to manually add the `*.node` files inside `build/Release` by
adding the appropriate wilcard to the `files` section of
`electron-builder.yml`.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Now that the Redux store is no longer front-end dependent, we can move
most of the models to lib/shared. Currently, lib/shared is a mess, and
contains all sorts of functionality, however moving things out of the
GUI is the first step. Once we have everything decoupled, we can
organise all the code we have there.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit fixes a subtle issue where we are calling a non-existing
function of an error object, instead of using the exception reporter
module.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This is a small refactoring commit that extracts the MIME related
function from utils.js into a new file called mime.js, and stores the
default image MIME type there as a constant, to avoid duplicating it in
multiple parts of the code.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
The image stream tests that extract images all have a 20s timeout, which
is manually set in all the suites related to extraction.
This commit extracts that number as a constant called DEFAULT_TIMEOUT.
See: https://github.com/resin-io/etcher/pull/1595
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Looks like pkg downloads node binaries from GitHub Releases, and GitHub
may impose a rate limiting if we download too many things from them in a
short period of time (likely to happen when there are many concurrent
PRs).
In order to mitigate this issue, this commit adds `$HOME/.pkg-cache`,
the directory where pkg stores node binaries, to the CI services cache.
See: https://github.com/resin-io/etcher/pull/1594
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
I caught an sporadic issue a couple of times, where the DMG tests would
exceed the default 2000ms mocha timeout. All the other image
decompression tests have a much higher timeout already, so this commit
adds the same timeout to the DMG tests file.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Our current Travis CI configuration caches temporary files created by
electron-builder, but only for GNU/Linux builds. In macOS, electron and
electron-builder store their cache at ~/Library/Caches, so we must cache
that as well.
This commit was motivated by the fact that most macOS builds are failing
for Electron package download timeouts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit adds a `packageType` property to package.json, which is set
according to the package type of the Etcher target (e.g: dmg, nsis, deb,
etc).
This information is then sent to Mixpanel as the `packageType` property
of the "Application start" event.
Change-Type: patch
Changelog-Entry: Send anonymous analytics about package types.
Fixes: https://github.com/resin-io/etcher/issues/1328
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This is a small initial step towards decoupling the image stream
handlers from the concept of a "file."
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This plugin helps us detect some things the built-in jsdoc rules can't,
like whether there is an example or not.
As expected, the addition of this plugin helped detect some minor JSDoc
issues.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We remove the Angular dependency from `lib/gui/os/dialog` and
`lib/gui/modules/error` which is also now renamed to
`lib/gui/modules/exception`.
Changelog-Entry: Deangular the os-dialog and error modules
- Homebrew now auto-updates before performing any installation, which
can take quite some time. We can disable this by enabling
HOMEBREW_NO_AUTO_UPDATE
- We can pass the --force-bottle option to `brew install` to force it to
download pre-compiled binaries, and don't attempt any compilations
See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit replaces our home-grown CLI packaging mechanism based on
browserify + node-static-entry-point with pkg, an open source tool to
package Node.js applications for distribution.
Some highlights:
- Removing browserify got rid of a lot of dependencies from
npm-shrinkwrap.json
- pkg currently has an issue where macOS binaries can't be code-signed
(https://github.com/zeit/pkg/issues/128), therefore this commit
comments-out the binary signing section for that operating system
- pkg currently has an issue where Windows binaries can't be branded
(https://github.com/zeit/pkg/issues/149), therefore this commit
comments-out the branding section for that operating system
See: https://github.com/zeit/pkg
Fixes: https://github.com/resin-io/etcher/issues/1531
Fixes: https://github.com/resin-io/etcher/issues/1450
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This dependency comes bundled with electron-builder, so there is no
reason to install it separately.
See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
The lib/gui/etcher.js file contained a workaround to an Electron issue
that have since then been solved. In summary:
- Replace the `did-finish-load` event of `webContents` with
`ready-to-show`, which is only emitted when the whole webview has
finished loading
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
These directories contain files downloaded by electron-builder (like
electron itself), that we can cache in Travis CI and Appveyor CI to
speed up builds.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We've been hitting some weird npm-shrinkwrap.json issues in our
shrinkwrap staged sanity checks, where Appveyor would complain that the
shrinkwrap is not up to date, while that wasn't the case either locally
or in Travis CI.
The issue is related to caching. If a commit changes a `from` entry of a
npm-shrinkwrap.json dependency, but the CI servers kept the cached
node_modules, then there will be a discrepancy between the `_from` field
from the `package.json` of a dependency in `node_modules` and what the
npm-shrinkwrap.json says. npm will obey `node_modules` over
`npm-shrinkwrap`, causing the invalid diff.
The fix is to make the Appveyor node_modules cached directory dependent
on any change to the npm-shrinkwrap.json file.
Change-Type: patch
See: https://github.com/resin-io/etcher/pull/1547
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
After https://github.com/resin-io/etcher/pull/1569, the redux store can
run outside of a browser context. This commit moves it to `lib/shared`,
where we will likely move all the other models as well. As an extra, I
renamed `Store` to `store`, since there was no reason for that variable
to be capitalized.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We're currently persisting the user settings in localSettings by using a
redux plugin called redux-localstorage. As a way to decouple the redux
store from a technology that is browser specific, this commit makes the
following changes:
- Create local-settings.js, which is concerned with managing settings in
a persisting location
- Decouple the redux store from the persisting storage method
- Extend the settings model to persist settings, cache reads, etc
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
- Exclude *.dll/*.exe files from the asar in non-Windows operating
systems (from 19.8.0)
- Correctly parse boolean flags in `--extraMetadata` (in v19.9.0)
See: https://github.com/electron-userland/electron-builder/releases/tag/v19.9.1
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Switching the Windows language to a language encoded using UTF-16 (like
Japanese) revealed that our native elevator module garbles language
specific strings, making the child writer process unable to find an
image inside a language specific directory, and thus resulting in a
"File is not accessible" error.
As a solution, we make use of `std::wstring` and wide character Windows
API functions in the elevator module.
Change-Type: patch
Changelog-Entry: Fix "file is not accessible" error when flashing an image that lives inside a directory whose name is UTF-16 encoded on Windows.
Fixes: https://github.com/resin-io/etcher/issues/1459
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
One-click installers are a "modern" version of usual wizard installers,
and somewhat resemble the Squirrel.Windows installers you can see in
apps like Atom.
As the name implies, the user needs to agree the license, and that's
all, the remaining installer is non-interactive, leading to a very
smooth user experience.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
As part of our CI sanity checks, we run `npm ls`, to ensure we don't
have any extraneous dependencies (the command fails if so), however by
its own definition, `npm ls` prints the whole dependency tree, which
spams the builds.
This commit redirects stdout to /dev/null, which contains the dependency
tree, but still prints and extraneous dependency warning, which is
printed to stderr instead.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
If we include a platform specific optional dependency in the shrinkwrap
file, then npm will insist in installing it even if the platform doesn't
match. As a solution, we figured out we can avoid putting this platform
specific optional dependencies in the npm-shrinkwrap.json file.
In order to do this, we currently have a script called
`clean-shrinkwrap.js` that runs *before* any `npm shrinkwrap` file (its
a `preshrinkwrap` npm script) that deletes all the platform specific
modules we know about using `npm rm`.
The problem with this approach is that `npm rm` will remove the module's
code from `node_modules`, which means that if we run `npm shrinkwrap`,
we will lose certain optional dependencies, that may be needed at a
later stage.
The solution is to modify the `clean-shrinkwrap.js` script to parse
`npm-shrinkwrap.json`, and manually delete the entries that we want to
omit. Also, the script needs to be run *after* `npm shrinkwrap`, so we
change the npm script name to `postshrinkwrap`.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>