Skip to content

Commit

Permalink
execa upgrade and ESM
Browse files Browse the repository at this point in the history
Signed-off-by: marcopiraccini <[email protected]>
  • Loading branch information
marcopiraccini committed Oct 4, 2024
1 parent 991cf3c commit 7e763de
Show file tree
Hide file tree
Showing 12 changed files with 327 additions and 128 deletions.
427 changes: 312 additions & 115 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "1.0.8",
"main": "./out/main/index.js",
"author": "Platformatic.dev",
"type": "module",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,8 +47,8 @@
"d3": "~7.9.0",
"electron-dl": "^4.0.0",
"electron-log": "^5.2.0",
"electron-updater": "^6.3.4",
"execa": "^5.1.1",
"electron-updater": "^6.3.9",
"execa": "^9.4.0",
"mkdirp": "^3.0.1",
"npm-check-updates": "^17.1.3",
"pino": "^9.4.0",
Expand All @@ -70,11 +71,10 @@
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.2",
"electron": "30.5.0",
"electron-builder": "^25.0.5",
"electron-builder": "^25.1.7",
"electron-vite": "^2.3.0",
"fastify": "^5.0.0",
"glob": "^11.0.0",
"happy-dom": "^15.7.4",
"react": "^18.3.1",
"rimraf": "^6.0.1",
"snazzy": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function createWindow () {
autoHideMenuBar: false,
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
preload: join(__dirname, '../preload/index.mjs'),
sandbox: false,
additionalArguments: [`--devMode=${devMode}`]
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/lib/applications.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import execa from 'execa'
import { execa } from 'execa'
import { RuntimeApiClient } from '@platformatic/control'
import { access, rm } from 'node:fs/promises'
import { createRequire } from 'node:module'
Expand Down
2 changes: 1 addition & 1 deletion src/main/lib/run-npm.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import execa from 'execa'
import { execa } from 'execa'
import { app } from 'electron'
import split from 'split2'
import { dirname } from 'node:path'
Expand Down
2 changes: 1 addition & 1 deletion src/main/lib/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { access } from 'node:fs/promises'
import { request } from 'undici'
import { homedir } from 'node:os'
import log from 'electron-log'
import execa from 'execa'
import { execa } from 'execa'
import which from 'which'

const isMac = process.platform === 'darwin'
Expand Down
4 changes: 3 additions & 1 deletion src/main/updater.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { dialog } from 'electron'
import { autoUpdater } from 'electron-updater'
import pkg from 'electron-updater'
import log from 'electron-log'

const { autoUpdater } = pkg

let updater = null
autoUpdater.autoDownload = false
log.transports.console.level = 'info'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/main/applications.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resolve, join } from 'node:path'
import { mkdirp } from 'mkdirp'
import Applications from '../../src/main/lib/applications.mjs'
import { startRuntimeInFolder } from './helper.mjs'
import execa from 'execa'
import { execa } from 'execa'

const { MockAgent, setGlobalDispatcher } = require('undici')

Expand Down
2 changes: 1 addition & 1 deletion test/main/helper.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fastify from 'fastify'
import execa from 'execa'
import { execa } from 'execa'
import { afterEach } from 'vitest'
import { access } from 'node:fs/promises'
import { createRequire } from 'node:module'
Expand Down
2 changes: 1 addition & 1 deletion test/main/upgrade-plt.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { mkdirp } from 'mkdirp'
import Applications from '../../src/main/lib/applications.mjs'
import { upgradePlt } from '../../src/main/lib/upgrade-plt.mjs'
import { cleanNpmVersion } from '../../src/main/lib/utils.mjs'
import execa from 'execa'
import { execa } from 'execa'

// Setup meraki app folder (for migrations) and config folder (for the DB)
const platformaticTestDir = await mkdtemp(join(tmpdir(), 'plat-app-test'))
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from 'vite'
export default defineConfig({
test: {
globals: true,
environment: 'happy-dom',
environment: 'node',
exclude: ['node_modules']
}
})

0 comments on commit 7e763de

Please sign in to comment.