Commit Graph

63 Commits

Author SHA1 Message Date
Mark Yen
130c2cdece Add support for running TypeScript tests
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-04-21 16:07:47 -07:00
Mark Yen
d64617ef96 Package.json: bump semver
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-04-21 16:07:39 -07:00
Mark Yen
64d58a2bac Packages: explicitly install @types/node >=12 <12.17
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>
2021-04-09 15:45:30 -07:00
Mark Yen
208dfc77c7 Package.json: Drop explicit follow-redirects
We no longer use it.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-04-09 15:45:28 -07:00
Mark Yen
3836c1d434 Create setup script for Windows
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>
2021-04-09 15:45:27 -07:00
Mark Yen
cc6d5c016e Package.json: Add node-fetch
Needed to download the K3s distro packages.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-04-09 15:45:25 -07:00
Mark Yen
d2eab44bb2 Merge pull request #160 from mook-as/win
Make it possible to prepare development environment on Windows
2021-04-09 15:39:20 -07:00
Eric Promislow
cda342ca6b eslint prefers this formatting
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-04-08 10:48:03 -07:00
Eric Promislow
3d3fea3edd Add a checkbox to control filtering out of system services.
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-04-05 16:00:27 -07:00
Mark Yen
0ab9140c30 Packages: force nan 2.14.0
nan 2.14.1 does not appear to be compatible with the version of electron
we're using:

https://github.com/nodejs/nan/issues/892

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-03-31 15:27:09 -07:00
Mark Yen
c44f879df1 Drop deepmerge
The functionality is available as part of lodash.  It's actually still
used by dependencies, though.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-03-30 11:34:09 -07:00
Mark Yen
097a4558b2 ESLint changes for TypeScript
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>
2021-03-12 15:09:42 -08:00
Mark Yen
c7818729ee build: Support TypeScript
This adds TypeScript support in the build; none of the code actually
uses it yet.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-03-12 15:09:39 -08:00
Matt Farina
2469806fcb Merge pull request #141 from mook-as/node-sass-downgrade
package.json: Downgrade node-sass to 4.x
2021-03-04 15:47:09 -05:00
Mark Yen
cb051c0bdb packages: remove nuxtron
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>
2021-02-26 14:21:23 -08:00
Mark Yen
e6c11fe85a scripts/build: use shared build helpers
Hopefully this makes things easier to read.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-02-26 14:17:57 -08:00
Mark Yen
27b800ac04 package.json: Downgrade node-sass to 4.x
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>
2021-02-25 16:43:19 -08:00
Mark Yen
58fce2f564 build: Fix loading translations
We neeed to use a loader that parses YAML files, not save it as a blob.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-02-23 17:27:29 -08:00
Mark Yen
458a7ff5bc package.json: remove @vue/cli-plugin-eslint
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>
2021-02-22 09:26:15 -08:00
Mark Yen
a74576f76a package.json: remove pinned eslint-template-visitor
Version 2.3.2 that was recently published resolves the issues, we no
longer need to pin it to 2.2.2.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-02-18 14:08:53 -08:00
Mark Yen
5fa7aa92e3 package.json: force eslint-template-visitor 2.2.2
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>
2021-02-17 15:51:12 -08:00
Mark Yen
e43e6f1372 Merge pull request #112 from mook-as/dev-auto-exit
Make `npm run dev` exit on quit
2021-02-17 13:24:14 -08:00
Mark Yen
03a2d50e9d package.json: Pull in dependencies of SortableTable
We will be pulling in dashboard's SortableTable shortly; this is the
first step, to add its dependencies.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-02-16 13:08:23 -08:00
Mark Yen
1538af46fb ESLint: fix errors in build script
Also change the linter to look into modules too.
2021-02-11 11:43:34 -08:00
Mark Yen
32d0b4c58e Add dev script
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.
2021-02-11 11:28:21 -08:00
Eric Promislow
13ab092e8e Convert console.error writes to exceptions
* Verify minimum and specified values are sane wrt max

* Redefine console.error to spy on and verify errors.
2021-02-10 10:50:53 -08:00
Eric Promislow
425b344b6d move remaining eslint configs into .eslintrc.yaml 2021-02-09 13:57:18 -08:00
Eric Promislow
124875411f yet another rebase commit 2021-02-09 13:41:22 -08:00
Eric Promislow
1785093515 rebase and apply reviewer suggestions 2021-02-09 13:23:01 -08:00
Eric Promislow
a6d193f65c Rebase against main and fix parseFloat calls 2021-02-09 13:23:00 -08:00
Eric Promislow
f0a434ef08 Use a more generic pattern for ignoring CSS modules when linting 2021-02-09 13:23:00 -08:00
Eric Promislow
ab7f1c9f91 move babel-plugin-module-resolver to dev, remove babel-plugin-root-import 2021-02-09 13:22:59 -08:00
Eric Promislow
9b60c2596d Add fields to control kubernetes settings
- Amount of memory to allocate (in GB)
- # of CPUs to allocate

Also introduce unit-testing, do TDD against
the settings component.
2021-02-09 13:22:58 -08:00
Eric Promislow
fe69906557 Update package.json to support vue v2 2021-02-09 11:19:57 -08:00
Mark Yen
fc8b68178e package.json: add lint:nofix target
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.
2021-02-08 11:37:52 -08:00
Mark Yen
8e7ff5145b ESLint: also lint *.vue
Also move the eslint configuration to a separate file, because it will
get more complex before we tackle the errors.
2021-02-03 14:49:39 -08:00
Mark Yen
b94d098195 Add custom build script
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`.
2021-02-03 14:49:39 -08:00
Mark Yen
e1c0aab8d9 package.json: Remove unneeded dependencies
We are no longer using the Vue CLI for anything.
2021-02-03 14:49:12 -08:00
Mark Yen
82ef27007e package.json: Update dev workflow
We're now fully using nuxt.
2021-02-03 14:49:11 -08:00
Mark Yen
a9e88ac5ac Nuxt: packaging changes
Update various packaging / path related code for nuxt/nuxtron.
2021-02-03 14:48:35 -08:00
Mark Yen
75d56a491d Package.json: Add nuxt & nuxtron
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.
2021-02-03 14:48:34 -08:00
Eric Promislow
396e75ecf4 fixing the webpack resource bug (again)
Ref: https://github.com/vuejs/vue-cli/issues/5986
2021-01-29 14:59:17 -08:00
Mark Yen
e9ac82d6e5 package.json: Use Vue 2 eslint
Adjust the linter for Vue 2 rather than Vue 3; this was missed in #67.
2021-01-29 09:56:48 -08:00
Eric Promislow
b60b201f93 Use lodash instead of deepequal
- 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.
2021-01-26 11:31:56 -08:00
Mark Yen
1eded433e3 package.json: reinstall follow-redirects
This is still needed for the setupmac script.
2021-01-21 14:20:09 -08:00
Mark Yen
2790f7421e package.json: explicitly install eslint
For some reason, `npm run lint` (running `vue-cli-service lint`) works
on mac, but not linux, unless we manually install eslint.
2021-01-20 14:42:04 -08:00
Mark Yen
9759bc661d packge.json: rebuild
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.
2021-01-20 14:16:17 -08:00
Mark Yen
8b4495f0b5 Downgrade to Vue 2
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.
2021-01-19 14:05:38 -08:00
Matt Farina
221b3e8dfe Adding hyperkit to RD
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>
2021-01-11 13:08:22 -05:00
Mark Yen
928e7671a4 package.json: use vue-clie-service electron:serve for dev
That does everything needed; running electron manually leads to errors
loading files.

Also drops the "concurrently" package, since we no longer use it.
2021-01-06 13:36:48 -08:00