Skip to content

Commit 9dc4244

Browse files
committed
N/A
1 parent c95f6d9 commit 9dc4244

File tree

14 files changed

+176
-40
lines changed

14 files changed

+176
-40
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ node_modules
1717
.env.development.local
1818
.env.test.local
1919
.env.production.local
20+
.env
2021

2122
npm-debug.log*
2223
yarn-debug.log*

build/electron-builder.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ module.exports = {
33
asar: true,
44
productName: 'Repic App',
55
directories: {
6-
output: './dist-apps'
6+
output: './dist-apps',
77
},
88
mac: {
99
category: 'public.app-category.photography',
1010
icon: 'assets/icon.icns',
11-
target: 'dmg'
11+
target: 'dmg',
12+
hardenedRuntime: true,
13+
gatekeeperAssess: false,
14+
entitlements: './entitlements.mac.plist',
15+
entitlementsInherit: './entitlements.mac.plist',
16+
},
17+
dmg: {
18+
sign: false,
1219
},
1320
win: {
1421
icon: 'assets/icon.icns',
15-
target: ['msi']
22+
target: ['msi'],
1623
},
1724
files: [
1825
'**/*',
@@ -27,6 +34,6 @@ module.exports = {
2734
'!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}',
2835
'!**/{appveyor.yml,.travis.yml,circle.yml}',
2936
'!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}',
30-
'!renderer-src'
31-
]
32-
}
37+
'!renderer-src',
38+
],
39+
}

build/entitlements.mac.plist

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
6+
<true/>
7+
</dict>
8+
</plist>

build/sign.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require('dotenv').config()
2+
const { notarize } = require('electron-notarize')
3+
4+
exports.default = async function notarizing(context) {
5+
const { electronPlatformName, appOutDir } = context
6+
if (electronPlatformName !== 'darwin') {
7+
return
8+
}
9+
10+
const appName = context.packager.appInfo.productFilename
11+
12+
return await notarize({
13+
appBundleId: 'app.repic.repicapp',
14+
appPath: `${appOutDir}/${appName}.app`,
15+
appleId: process.env.APPLEID,
16+
appleIdPassword: process.env.APPLEIDPASSWORD,
17+
})
18+
}

index.js

+3
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,7 @@ function makeSingleInstance() {
9090

9191
initialize()
9292

93+
// 处理未捕获的错误
94+
process.on('uncaughtException', (error) => {})
95+
9396
// TODO

package-lock.json

+73-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"pack": "electron-builder --config build/electron-builder.js",
1414
"lint": "node_modules/eslint/bin/eslint.js ."
1515
},
16+
"build": {
17+
"afterSign": "build/sign.js"
18+
},
1619
"dependencies": {
1720
"@mdi/font": "^3.6.95",
1821
"compressorjs": "^1.0.5",
@@ -40,6 +43,7 @@
4043
"css-hot-loader": "^1.4.2",
4144
"css-loader": "^0.28.11",
4245
"electron": "^8.4.0",
46+
"electron-notarize": "^1.0.0",
4347
"eslint": "^5.4.0",
4448
"eslint-config-standard": "^12.0.0",
4549
"eslint-loader": "^2.1.0",

renderer-src/components/modal/index.jsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class Modal extends React.PureComponent {
3737
}
3838

3939
handleMaskClick = () => {
40-
this.props.closeOnBlur &&this.handleClose(this.props.onWillClose && this.props.onWillClose('mask-close'))
40+
this.props.closeOnBlur &&
41+
this.handleClose(this.props.onWillClose && this.props.onWillClose('mask-close'))
4142
}
4243

4344
externalRequestClose = () => {
@@ -147,7 +148,7 @@ export const showModal = ({ onClose, ...props }) => {
147148
const hostNode = document.createElement('div')
148149
document.body.appendChild(hostNode)
149150

150-
const handleClose = source => {
151+
const handleClose = (source) => {
151152
const result = onClose ? onClose(source) : true
152153

153154
if (result !== false) {
@@ -161,7 +162,7 @@ export const showModal = ({ onClose, ...props }) => {
161162
ReactDOM.render(<Modal onClose={handleClose} {...props} active={true} />, hostNode)
162163
}
163164

164-
export const confirm = props => {
165+
export const confirm = (props) => {
165166
return showModal({
166167
width: 400,
167168
showClose: false,
@@ -171,7 +172,7 @@ export const confirm = props => {
171172
})
172173
}
173174

174-
export const alert = props => {
175+
export const alert = (props) => {
175176
return showModal({
176177
width: 400,
177178
showClose: false,

renderer-src/components/modal/styles.scss

+3-8
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,15 @@
105105
overflow: auto;
106106
}
107107
> .footer {
108+
display: flex;
109+
align-items: center;
110+
justify-content: space-between;
108111
box-sizing: border-box;
109112
position: relative;
110113
z-index: 3;
111114
height: 60px;
112115
padding: 15px;
113116
overflow: hidden;
114-
// background-color: rgba(#000, .2);
115-
// box-shadow: inset 0 .5px 0 0 rgba(#000, .6);
116-
.left-content {
117-
float: left;
118-
}
119-
.buttons {
120-
float: right;
121-
}
122117
.button {
123118
min-width: 60px;
124119
margin: 0 0 0 10px;

renderer-src/pages/index/components/filepicker/styles.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@
9090
width: 300px;
9191
height: 50px;
9292
border-radius: 10px;
93-
background-color: $COLOR_PRIMARY;
93+
background-color: darken($COLOR_PRIMARY, 5);
9494
background-image: linear-gradient(to bottom, rgba(#fff, 0.1), rgba(#fff, 0));
9595
border: none;
9696
border-radius: 5px;
9797
outline: none;
98-
box-shadow: inset 0 0 0 0.5px rgba(#000, 0.2); //, 0 5px 10px rgba($COLOR_PRIMARY, 0.3);
98+
box-shadow: inset 0 0 0 0.5px rgba(#000, 0.2);
9999
color: #fff;
100100
font-size: 18px;
101101
font-weight: 500;
102102
cursor: pointer;
103103
transition: background-color 0.3s, transform 0.5s;
104104
&:hover {
105-
background-color: darken($COLOR_PRIMARY, 5);
105+
background-color: $COLOR_PRIMARY;
106106
}
107107
}
108108
}
@@ -144,6 +144,6 @@ body[data-theme='dark'] .component-file-picker {
144144
}
145145
}
146146
.file-pick-entry .button-pick-files {
147-
box-shadow: none;
147+
box-shadow: 0 0 0 0.5px rgba(#000, 0.4);
148148
}
149149
}

0 commit comments

Comments
 (0)