Skip to content

Commit

Permalink
feat(app-vite/app-webpack): drop support for legacy "electron-package…
Browse files Browse the repository at this point in the history
…r" (only support the newer @electron/packager)
  • Loading branch information
rstoenescu committed Aug 5, 2024
1 parent 6d056c5 commit bb844ac
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
13 changes: 4 additions & 9 deletions app-vite/lib/cache/module.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ export async function createInstance ({
const nodePackager = await cacheProxy.getModule('nodePackager')

function bundlerIsInstalled (bundlerName) {
return bundlerName === 'packager'
? (hasPackage('@electron/packager', appPkg) || hasPackage('electron-packager', appPkg))
: hasPackage('electron-builder', appPkg)
const bundler = bundlerMap[ bundlerName ]
return hasPackage(bundler.pkg, appPkg)
}

function ensureInstall (bundlerName) {
Expand All @@ -70,12 +69,8 @@ export async function createInstance ({

// May return "{ default }" (@electron/packager) or directly the package (electron-builder);
async function getBundler (bundlerName) {
if (bundlerName === 'packager') {
const newPkg = await getPackage('@electron/packager', appPaths.appDir)
return newPkg || getPackage('electron-packager', appPaths.appDir)
}

return getPackage('electron-builder', appPaths.appDir)
const bundler = bundlerMap[ bundlerName ]
return getPackage(bundler.pkg, appPaths.appDir)
}

return {
Expand Down
1 change: 0 additions & 1 deletion app-vite/lib/cmd/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ print({ key: 'Important local packages', section: true })
'workbox-build',
'register-service-worker',
'electron',
'electron-packager',
'@electron/packager',
'electron-builder'
].forEach(pkg => print(safePkgInfo(pkg, appPaths.appDir)))
Expand Down
4 changes: 0 additions & 4 deletions app-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
"peerDependencies": {
"@electron/packager": ">= 18",
"electron-builder": ">= 22",
"electron-packager": ">= 15",
"pinia": "^2.0.0",
"quasar": "^2.16.0",
"vue": "^3.2.29",
Expand All @@ -112,9 +111,6 @@
"electron-builder": {
"optional": true
},
"electron-packager": {
"optional": true
},
"@electron/packager": {
"optional": true
},
Expand Down
13 changes: 4 additions & 9 deletions app-webpack/lib/cache/module.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ module.exports.createInstance = function createInstance ({
const nodePackager = cacheProxy.getModule('nodePackager')

function bundlerIsInstalled (bundlerName) {
return bundlerName === 'packager'
? (hasPackage('@electron/packager', appPkg) || hasPackage('electron-packager', appPkg))
: hasPackage('electron-builder', appPkg)
const bundler = bundlerMap[ bundlerName ]
return hasPackage(bundler.pkg, appPkg)
}

function ensureInstall (bundlerName) {
Expand All @@ -70,13 +69,9 @@ module.exports.createInstance = function createInstance ({

function getBundler (bundlerName) {
const { appDir } = appPaths
const bundler = bundlerMap[ bundlerName ]

return bundlerName === 'packager'
? (
getPackage('@electron/packager', appDir)
|| getPackage('electron-packager', appDir)
)
: getPackage('electron-builder', appDir)
return getPackage(bundler.pkg, appDir)
}

return {
Expand Down
1 change: 0 additions & 1 deletion app-webpack/lib/cmd/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ print({ key: 'Important local packages', section: true })
'workbox-webpack-plugin',
'register-service-worker',
'electron',
'electron-packager',
'@electron/packager',
'electron-builder'
].forEach(pkg => print(safePkgInfo(pkg, appPaths.appDir)))
Expand Down
4 changes: 0 additions & 4 deletions app-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"peerDependencies": {
"@electron/packager": ">= 18",
"electron-builder": ">= 22",
"electron-packager": ">= 15",
"eslint": "^8.57.0",
"pinia": "^2.0.0",
"quasar": "^2.16.0",
Expand All @@ -143,9 +142,6 @@
"electron-builder": {
"optional": true
},
"electron-packager": {
"optional": true
},
"@electron/packager": {
"optional": true
},
Expand Down

0 comments on commit bb844ac

Please sign in to comment.