-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7744 from kidroca/kidroca/feature/new-desktop-config
- Loading branch information
Showing
25 changed files
with
582 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const {version} = require('../../package.json'); | ||
|
||
const isStaging = process.env.ELECTRON_ENV === 'staging'; | ||
const isPublishing = process.argv.includes('--publish'); | ||
|
||
/** | ||
* The configuration for the production and staging Electron builds. | ||
* It can be used to create local builds of the same, by omitting the `--publish` flag | ||
*/ | ||
module.exports = { | ||
appId: 'com.expensifyreactnative.chat', | ||
productName: 'New Expensify', | ||
extraMetadata: { | ||
version, | ||
}, | ||
mac: { | ||
category: 'public.app-category.finance', | ||
target: [ | ||
{target: 'dmg', arch: ['x64', 'arm64', 'universal']}, | ||
], | ||
icon: isStaging ? './desktop/icon-stg.png' : './desktop/icon.png', | ||
hardenedRuntime: true, | ||
entitlements: 'desktop/entitlements.mac.plist', | ||
entitlementsInherit: 'desktop/entitlements.mac.plist', | ||
type: 'distribution', | ||
}, | ||
dmg: { | ||
internetEnabled: true, | ||
}, | ||
publish: [{ | ||
provider: 's3', | ||
bucket: isStaging ? 'staging-expensify-cash' : 'expensify-cash', | ||
channel: 'latest', | ||
}], | ||
afterSign: isPublishing ? './desktop/notarize.js' : undefined, | ||
files: [ | ||
'dist', | ||
'!dist/www/{.well-known,favicon*}', | ||
], | ||
directories: { | ||
app: 'desktop', | ||
output: 'desktop-build', | ||
}, | ||
}; |
11 changes: 0 additions & 11 deletions
11
config/electronBuilder/electronBuilder.ghactions.config.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const _ = require('underscore'); | ||
|
||
const desktopDependencies = require('../../desktop/package.json').dependencies; | ||
const getCommonConfig = require('./webpack.common'); | ||
|
||
/** | ||
* Desktop creates 2 configurations in parallel | ||
* 1. electron-main - the core that serves the app content | ||
* 2. web - the app content that would be rendered in electron | ||
* Everything is placed in desktop/dist and ready for packaging | ||
* @param {Object} env | ||
* @returns {webpack.Configuration[]} | ||
*/ | ||
module.exports = (env) => { | ||
const rendererConfig = getCommonConfig({...env, platform: 'desktop'}); | ||
const outputPath = path.resolve(__dirname, '../../desktop/dist'); | ||
|
||
rendererConfig.name = 'renderer'; | ||
rendererConfig.output.path = path.join(outputPath, 'www'); | ||
|
||
// Expose react-native-config to desktop-main | ||
const definePlugin = _.find(rendererConfig.plugins, plugin => plugin.constructor === webpack.DefinePlugin); | ||
|
||
const mainProcessConfig = { | ||
mode: 'production', | ||
name: 'desktop-main', | ||
target: 'electron-main', | ||
entry: { | ||
main: './desktop/main.js', | ||
contextBridge: './desktop/contextBridge.js', | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
path: outputPath, | ||
libraryTarget: 'commonjs2', | ||
}, | ||
resolve: rendererConfig.resolve, | ||
plugins: [definePlugin], | ||
externals: [ | ||
..._.keys(desktopDependencies), | ||
'fsevents', | ||
], | ||
node: { | ||
/** | ||
* Disables webpack processing of __dirname and __filename, so it works like in node | ||
* https://github.com/webpack/webpack/issues/2010 | ||
*/ | ||
__dirname: false, | ||
__filename: false, | ||
}, | ||
}; | ||
|
||
return [mainProcessConfig, rendererConfig]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.