Skip to content

Commit

Permalink
updated some packages: using electron 26
Browse files Browse the repository at this point in the history
  • Loading branch information
qlrd committed Aug 20, 2023
1 parent 63d4ab9 commit a02f916
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"author": "qlrd <[email protected]>",
"license": "MIT",
"private": true,
"engines": {
"node": "18"
},
"keywords": [
"electron",
"vite",
Expand Down Expand Up @@ -52,24 +55,23 @@
"@wdio/mocha-framework": "^8.12.1",
"@wdio/spec-reporter": "^8.12.2",
"chai": "^4.3.7",
"chromedriver": "^114.0.3",
"electron": "^25.3.1",
"electron": "^26.0.0",
"electron-builder": "^24.4.0",
"glob": "^10.3.3",
"mocha": "^10.2.0",
"rimraf": "^5.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"vite": "^4.4.6",
"vite-plugin-electron": "^0.12.0",
"vite-plugin-electron": "^0.13.0-beta.1",
"vite-plugin-electron-renderer": "^0.14.1",
"vue": "^3.2.47",
"vue-tsc": "^1.8.6",
"wdio-electron-service": "^4.3.0"
},
"dependencies": {
"@o/electron-sudo": "^2.8.23",
"ansi_up": "^5.2.1",
"ansi_up": "^6.0.0",
"axios": "^1.4.0",
"command-exists": "^1.2.9",
"debug": "^4.3.4",
Expand Down
6 changes: 5 additions & 1 deletion src/utils/onKruxFlashData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Ref } from "vue";
import AnsiUp from "ansi_up";

// If you have no problems simply ignoring all type-checking features for this library, you have two options:
// Add @ts-ignore above all imports or Create a declaration file with any type, so all imports are automatically considered to be of any type.
// see https://stackoverflow.com/questions/56688893/how-to-use-a-module-when-it-could-not-find-a-declaration-file#answer-56690386
// @ts-ignore
import * as AnsiUp from 'ansi_up'
/**
* Stream shell output to web frontend
* @see https://www.appsloveworld.com/vuejs/100/8/stream-shell-output-to-web-front-end
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true,
"types": ["node"]
"types": ["node"],
},
"include": ["src"],
"references": [
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'
import electron from 'vite-plugin-electron'

//import renderer from 'vite-plugin-electron-renderer'
import pkg from './package.json'

Expand All @@ -15,6 +16,7 @@ export default defineConfig(({ command }) => {
const sourcemap = isServe || !!process.env.VSCODE_DEBUG

return {
open: true,
plugins: [
vue(),
vuetify({ autoImport: true }),
Expand Down Expand Up @@ -63,7 +65,6 @@ export default defineConfig(({ command }) => {
},
}
}

])
],
server: process.env.VSCODE_DEBUG && (() => {
Expand Down
37 changes: 10 additions & 27 deletions wdio.conf.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,27 @@ import { tmpdir } from 'os'
import { createRequire } from 'module'
import createDebug from 'debug'

process.env.TEST = true

const { devDependencies, version } = createRequire(import.meta.url)('./package.json')
const debug = createDebug('krux:wdio:e2e')
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

// force TEST to be true
if (!process.env.TEST || process.env.TEST !== 'true') {
debug('Force TEST=true')
process.env.TEST = 'true'
}

// force WDIO_ELECTRON to be true
if (!process.env.WDIO_ELECTRON || process.env.WDIO_ELECTRON !== 'true') {
debug('Force WDIO_ELECTRON=true')
process.env.WDIO_ELECTRON = 'true'
}

// Electron service and `onWorkerStart`
// will need the full path of builded application
// the first will be using during the tests and
// the second to start application for initial setup
let APP_PATH = ''
let CHROMEDRIVER_PATH = ''
const RELEASE_PATH = join(__dirname, 'release', version)

if (process.platform === 'linux') {
APP_PATH = join(RELEASE_PATH, 'linux-unpacked', 'krux-installer')
CHROMEDRIVER_PATH = createRequire(import.meta.url).resolve(
join('chromedriver', 'bin', 'chromedriver')
)
} else if (process.platform === 'win32') {
APP_PATH = join(RELEASE_PATH, 'win-unpacked', 'krux-installer.exe')
CHROMEDRIVER_PATH = createRequire(import.meta.url).resolve(
join('chromedriver', 'bin', 'chromedriver.exe')
)
} else if (process.platform === 'darwin') {
APP_PATH = join(RELEASE_PATH, 'mac', 'krux-installer.app', 'Contents', 'MacOS', 'krux-installer')
CHROMEDRIVER_PATH = createRequire(import.meta.url).resolve(
join('chromedriver', 'bin', 'chromedriver')
)
} else {
throw new Error(`Platform '${process.platform}' not suported`)
// force VITE_COVERAGE to be true
if (!process.env.VITE_COVERAGE || process.env.VITE_COVERAGE !== 'true') {
debug('Force VITE_COVERAGE=true')
process.env.VITE_COVERAGE = 'true'
}

export const config = {
Expand Down

0 comments on commit a02f916

Please sign in to comment.