The version of Electron we're using ships with NodeJS 12.16.x; explicitly
pull in the correct version of the TypeScript declarations so that when we
compile TypeScript we can get the correct conversions (i.e. it will not
error out due to different arguments etc.).
Signed-off-by: Mark Yen <mark.yen@suse.com>
This converts setupmac.js into a generic download-resources.mjs and make it
work on Windows. This also drop the follow-redirects dependency in favour
of using node-fetch (which we already need in the app). Additionally,
reduce the callback nesting we have in the same script.
There doesn't seem to be significant reason to convert the script to async
(considering that this is run as a one-off).
Additionally, make all this get called as a postinstall hook, so that it
happens automatically upon `npm install`, and the user no longer needs to
worry about it.
Signed-off-by: Mark Yen <mark.yen@suse.com>
Pull in the default TypeScript lint configuration, but turn off things
we do not obey yet. Note that we make sure to insert it before all the
nuxt changes, so that the dashboard code will not need to comply.
Signed-off-by: Mark Yen <mark.yen@suse.com>
We no longer use nuxtron, since we needed the raw webpack configs to
ensure we quit the dev server when we quit the application.
Signed-off-by: Mark Yen <mark.yen@suse.com>
Stratos doesn't yet work with node-sass 5.x, and for some reason having
it installed in the parent project breaks Stratos builds. Downgrade to
4.x to have things work.
Note that node-sass 4.x is reported to not work with nodejs 15.x; this
means that we will require nodejs 14.x to build.
Signed-off-by: Mark Yen <mark.yen@suse.com>
We don't use this (we run eslint directly), and it pulls in a dependency
(yorkie) that messes with git hooks unnecessarily.
Signed-off-by: Mark Yen <mark.yen@suse.com>
The package (a dependency of eslint-plugin-unicorn) seems to have an
issue that causes things to break. Pin it to the older version so that
linting can succeed.
Also remove unneeded vue-cli-plugin-electron-builder dependency; we no
longer use that.
See https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1105
Signed-off-by: Mark Yen <mark.yen@suse.com>
Nuxtron works more like a dev server, in that it watches for changes in
the main process and restarts everything on change. This does not work
well for us, as that means we keep restarting minikube in the background
(which takes a significant amount of time). Instead, switch to our own
dev script which mostly copies from nuxtron except for not watching in
the background.
Add a `npm run lint:nofix` for CI use, and change `npm run lint` to run
fixes by default, so that developers can use that locally.
Opting to allow warnings on CI for now.
Nuxtron's build script doesn't allow us to add command line arguments to
electron-builder, which causes a problem as electron-builder will by
default attempt to publish when run under GitHub Actions. To work
around this, write a custom script to do the equivalent of `nuxtron
build`.
In order to pull more components from github.com/rancher/dashboard, we
will need to use nuxt. But for that to happen, we need some
compatiblity layer with electron. It appears that nuxtron is a
reasonable option here.
- Other dependencies already use lodash, so we might as well use it
instead of relying on a single-use library
- Also I had to run the following to deal with the fatal startup error
message:
"Rule can only have one resource source"
$ rm -rf node_modules package-lock.json
$ npm install --legacy-peer-deps
I would have preferred separate commits, but the lodash change was
intermixed with the legacy changes.
It appears that the Vue 2 downgrade has caused issues in the
package.json such that removing the lock file leads to a combination
that could not be installed correctly.
This rebuilds package.json after removing packge-lock.json to ensure
that we are back to a consistent state again.
We want to be pulling things in from Rancher Dashboard, but that's still using
Vue 2. In order to encourage code sharing, we'll (temporarily) downgrade to
Vue 2 to match to make pulling in changes easier. We will eventually move
back up to Vue 3, of course, but that will be longer term.
Up to this point RD has used hyperkit provided by docker or installed
via homebrew. This has worked for development but does not work going
forward. We cannot assume that either hyperkit is installed or that
the path the built app has includes hyperkit.
The change adds hyperkit via two steps:
1. hyperkit is downloaded and placed in the resources/darwin directory
alongside of minikube. It does this by checking out the source at
a specific version and building it. This is needed because hyperkit
is not available as a download.
2. The path to hyperkit is added at the start of the path when minikube
processes are spawned. The start of the path is used so that RD
provided hyperkit is used instead of a different version that may
be available on the system.
Signed-off-by: Matt Farina <matt@mattfarina.com>
That does everything needed; running electron manually leads to errors
loading files.
Also drops the "concurrently" package, since we no longer use it.