Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platformatic 2 support and electron 30 [DON'T MERGE] #872

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
execa upgrade and ESM
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
  • Loading branch information
marcopiraccini committed Oct 4, 2024
commit 7e763de7ce4ade0456b408f27e01bd5a988217c2
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
@@ -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",
@@ -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",
@@ -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",
2 changes: 1 addition & 1 deletion src/main/index.mjs
Original file line number Diff line number Diff line change
@@ -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}`]
}
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'
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'
2 changes: 1 addition & 1 deletion src/main/lib/utils.mjs
Original file line number Diff line number Diff line change
@@ -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'
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'
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
@@ -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')

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'
2 changes: 1 addition & 1 deletion test/main/upgrade-plt.test.mjs
Original file line number Diff line number Diff line change
@@ -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'))
2 changes: 1 addition & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { defineConfig } from 'vite'
export default defineConfig({
test: {
globals: true,
environment: 'happy-dom',
environment: 'node',
exclude: ['node_modules']
}
})