This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.js
86 lines (77 loc) · 2 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* eslint-disable @typescript-eslint/no-var-requires */
const deepMerge = require('deepmerge');
const network = process.env.STX_NETWORK;
console.log('----------------------------------------------------');
console.log(network);
console.log('----------------------------------------------------');
if (!network) throw new Error('Must define STX_NETWORK environment var');
if (!['mainnet', 'testnet'].includes(network))
throw new Error(`Unknown STX_NETWORK type of: ${String(network)}`);
const baseConfig = {
artifactName: 'stacks-wallet.${ext}',
files: ['dist/', 'node_modules/', 'app.html', 'main.prod.js', 'main.prod.js.map', 'package.json'],
dmg: {
contents: [
{
x: 130,
y: 220,
},
{
x: 410,
y: 220,
type: 'link',
path: '/Applications',
},
],
},
win: {
target: ['nsis', 'msi'],
},
mac: {
hardenedRuntime: false,
icon: './resources/icon.icns',
category: 'public.app-category.finance',
},
linux: {
target: ['deb', 'rpm', 'AppImage'],
icon: 'icon-512x512.png',
category: 'Development',
},
directories: {
buildResources: 'resources',
output: 'release',
},
publish: {
provider: 'github',
owner: 'blockstack',
repo: 'blockstack',
private: false,
},
protocols: {
name: 'stacks-wallet',
schemes: ['stacks-wallet'],
},
};
const networkConfigs = {
testnet: {
productName: 'Stacks Wallet Testnet',
appId: 'org.stacks.wallet-testnet',
icon: './resources/icon-512x512-testnet.png',
artifactName: 'stacks-wallet.${ext}',
linux: {
icon: 'icon-512x512-testnet.png',
},
},
mainnet: {
productName: 'Stacks Wallet',
appId: 'org.stacks.wallet',
icon: './resources/icon-512x512.png',
artifactName: 'stacks-wallet.${ext}',
linux: {
icon: 'icon-512x512.png',
},
},
};
const mergedConfig = deepMerge(baseConfig, networkConfigs[network]);
console.log(JSON.stringify(mergedConfig, null, 2));
module.exports = mergedConfig;