Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ Licensed under **GPL-3.0-or-later**. See the [LICENSE](./LICENSE) file for detai
> You should have received a copy of the GNU General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>.

# Building for Production Vs Development:
At time we might need both Production and Development build to run in parallel, unless we segregate their data, else we might break one another. Therefore for production it create `Privitty` data directory where as for development it creates `Privitty-test`, this can be achieved using runtime option.

## For Production:
```
pnpm -w dev:electron
```

## For Development
```
pnpm -w build:electron && pnpm --filter=@deltachat-desktop/target-electron exec electron . --disable-http-cache
```

# Build DMG for macOS

```sh
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"lodash": ">=4.17.23",
"js-yaml": ">=4.1.1",
"minimatch@>=9.0.0 <10.2.1": "10.2.1",
"@privitty/privitty-core-darwin-arm64": "0.3.5",
"@privitty/privitty-core-darwin-x64": "0.3.5",
"@privitty/privitty-core-linux-x64": "0.3.5",
"@privitty/privitty-core-win32-x64": "0.3.5"
"@privitty/privitty-core-darwin-arm64": "0.3.8",
"@privitty/privitty-core-darwin-x64": "0.3.8",
"@privitty/privitty-core-linux-x64": "0.3.8",
"@privitty/privitty-core-win32-x64": "0.3.8"
}
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/target-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"dependencies": {
"@deltachat/jsonrpc-client": "catalog:",
"@privitty/deltachat-rpc-server": "1.160.0",
"@privitty/privitty-core": "0.3.5",
"@privitty/privitty-core": "0.3.8",
"mime-types": "catalog:",
"sass": "catalog:",
"ws": "7.5.10"
Expand Down
4 changes: 3 additions & 1 deletion packages/target-electron/src/application-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ if (process.env.NODE_ENV !== 'production') {
}
}

const appConfig = applicationConfig('Privitty')
// Use separate data dir for dev builds so production and development can coexist
const appName = process.argv.includes('--devmode') ? 'Privitty-test' : 'Privitty'
const appConfig = applicationConfig(appName)

import { join } from 'path'

Expand Down
16 changes: 10 additions & 6 deletions packages/target-electron/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ protocol.registerSchemesAsPrivileged([
const app = rawApp as ExtendedAppMainProcess
app.rc = rc

// Use our config path for userData so dev (Privitty-test) and production (Privitty)
// have separate single-instance locks and can run side by side
import {
getConfigPath,
getLogsPath,
getAccountsPath,
getCustomThemesPath,
} from './application-constants.js'
app.setPath('userData', getConfigPath())

// requestSingleInstanceLock always returns false on mas (mac app store) builds
// due to electron issue https://github.com/electron/electron/issues/35540
// dc-desktop issue: https://github.com/deltachat/deltachat-desktop/issues/3938
Expand All @@ -87,12 +97,6 @@ if (
}

// Setup folders
import {
getConfigPath,
getLogsPath,
getAccountsPath,
getCustomThemesPath,
} from './application-constants.js'
mkdirSync(getConfigPath(), { recursive: true })
mkdirSync(getLogsPath(), { recursive: true })
mkdirSync(getCustomThemesPath(), { recursive: true })
Expand Down
59 changes: 34 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading