Skip to content

Commit a31d51b

Browse files
committed
init
1 parent 31c3891 commit a31d51b

65 files changed

Lines changed: 3993 additions & 202 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# production
1212
/build
13+
/dist
1314

1415
# misc
1516
.DS_Store

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 4,
4+
"semi": true,
5+
"trailingComma": "none",
6+
"printWidth": 120
7+
}

electron.js

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
const { Menu, BrowserWindow, app } = require('electron');
2+
const url = require('url');
3+
const path = require('path');
4+
let windows = new Set();
5+
6+
function isDev() {
7+
const isEnvSet = 'ELECTRON_IS_DEV' in process.env;
8+
const fromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 1;
9+
return isEnvSet ? fromEnv : !app.isPackaged;
10+
}
11+
12+
function createWindow() {
13+
const win = new BrowserWindow({
14+
width: 1024,
15+
height: 700,
16+
minWidth: 750,
17+
minHeight: 550,
18+
show: false,
19+
title: 'App',
20+
autoHideMenuBar: true,
21+
darkTheme: true,
22+
vibrancy: 'appearance-based',
23+
titleBarStyle: 'hidden',
24+
webPreferences: {
25+
nodeIntegration: true
26+
}
27+
});
28+
29+
30+
const startUrl =
31+
process.env.ELECTRON_START_URL ||
32+
url.format({
33+
pathname: path.join(__dirname, '/build/index.html'),
34+
protocol: 'file:',
35+
slashes: true
36+
});
37+
38+
win.loadURL(startUrl);
39+
40+
win.once('ready-to-show', () => {
41+
win.show();
42+
});
43+
win.on('closed', () => {
44+
windows.delete(win);
45+
});
46+
47+
windows.add(win);
48+
}
49+
50+
app.on('window-all-closed', () => {
51+
// app.quit();
52+
});
53+
54+
app.on('ready', createWindow);
55+
56+
app.on('activate', () => {
57+
if (windows.size === 0) {
58+
createWindow();
59+
}
60+
});
61+
62+
const template = [
63+
{
64+
label: 'Edit',
65+
submenu: [
66+
{ role: 'undo' },
67+
{ role: 'redo' },
68+
{ type: 'separator' },
69+
{ role: 'cut' },
70+
{ role: 'copy' },
71+
{ role: 'paste' },
72+
{ role: 'pasteandmatchstyle' },
73+
{ role: 'delete' },
74+
{ role: 'selectall' }
75+
]
76+
},
77+
{
78+
label: 'View',
79+
submenu: [
80+
{ role: 'resetzoom' },
81+
{ role: 'zoomin' },
82+
{ role: 'zoomout' },
83+
{ type: 'separator' },
84+
{ role: 'togglefullscreen' }
85+
]
86+
},
87+
{
88+
role: 'window',
89+
submenu: [{ role: 'minimize' }, { role: 'close' }]
90+
},
91+
{
92+
role: 'help',
93+
submenu: [
94+
{
95+
label: 'Learn More',
96+
click() {
97+
require('electron').shell.openExternal('https://electronjs.org');
98+
}
99+
}
100+
]
101+
}
102+
];
103+
104+
if (isDev()) {
105+
template[1].submenu.push(
106+
...[{ type: 'separator' }, { role: 'reload' }, { role: 'forcereload' }, { role: 'toggledevtools' }]
107+
);
108+
}
109+
110+
if (process.platform === 'darwin') {
111+
template.unshift({
112+
label: app.getName(),
113+
submenu: [
114+
{ role: 'about' },
115+
{ type: 'separator' },
116+
{ role: 'services' },
117+
{ type: 'separator' },
118+
{ role: 'hide' },
119+
{ role: 'hideothers' },
120+
{ role: 'unhide' },
121+
{ type: 'separator' },
122+
{ role: 'quit' }
123+
]
124+
});
125+
126+
// Edit menu
127+
template[1].submenu.push(
128+
{ type: 'separator' },
129+
{
130+
label: 'Speech',
131+
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }]
132+
}
133+
);
134+
135+
// Window menu
136+
template[3].submenu = [
137+
{ role: 'close' },
138+
{ role: 'minimize' },
139+
{ role: 'zoom' },
140+
{ type: 'separator' },
141+
{ role: 'front' }
142+
];
143+
}
144+
145+
Menu.setApplicationMenu(Menu.buildFromTemplate(template));

electron.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"appId": "com.popcode.simples3",
3+
"mac": {
4+
"category": "tools"
5+
},
6+
"files": ["build/**/*", "node_modules/**/*", "electron.js"],
7+
"directories": {
8+
"buildResources": "assets"
9+
},
10+
"extraMetadata": {
11+
"main": "electron.js"
12+
}
13+
}

package.json

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,79 @@
11
{
2-
"name": "s3-client",
3-
"version": "0.1.0",
4-
"private": true,
5-
"dependencies": {
6-
"react": "^16.8.1",
7-
"react-dom": "^16.8.1",
8-
"react-scripts": "2.1.3"
9-
},
10-
"scripts": {
11-
"start": "react-scripts start",
12-
"build": "react-scripts build",
13-
"test": "react-scripts test",
14-
"eject": "react-scripts eject"
15-
},
16-
"eslintConfig": {
17-
"extends": "react-app"
18-
},
19-
"browserslist": [
20-
">0.2%",
21-
"not dead",
22-
"not ie <= 11",
23-
"not op_mini all"
24-
]
2+
"name": "SimpleS3",
3+
"version": "0.1.0",
4+
"description": "A simple Amazon s3 browser",
5+
"author": "Alex Hermann <alex.hermann@pop-code.com>",
6+
"private": true,
7+
"dependencies": {
8+
"@babel/core": "^7.2.2",
9+
"@babel/plugin-proposal-decorators": "^7.3.0",
10+
"@material-ui/core": "^3.9.2",
11+
"@material-ui/icons": "^3.0.2",
12+
"@types/app-root-path": "^1.2.4",
13+
"@types/file-saver": "^2.0.0",
14+
"@types/hoist-non-react-statics": "^3.0.1",
15+
"@types/jest": "^24.0.0",
16+
"@types/joi": "^14.3.1",
17+
"@types/lodash": "^4.14.120",
18+
"@types/node": "^10.12.24",
19+
"@types/pretty-bytes": "^5.1.0",
20+
"@types/react": "^16.8.2",
21+
"@types/react-dom": "^16.8.0",
22+
"@types/react-dropzone": "^4.2.2",
23+
"@types/react-redux": "^7.0.1",
24+
"@types/react-router-dom": "^4.3.1",
25+
"@types/redux-actions": "^2.3.1",
26+
"@types/redux-form": "^7.5.0",
27+
"@types/redux-immutable": "^4.0.1",
28+
"app-root-path": "^2.1.0",
29+
"aws-sdk": "^2.399.0",
30+
"connected-react-router": "^6.2.2",
31+
"file-saver": "^2.0.0",
32+
"history": "^4.7.2",
33+
"hoist-non-react-statics": "^3.3.0",
34+
"immutable": "^4.0.0-rc.12",
35+
"joi": "^14.3.1",
36+
"lodash": "^4.17.11",
37+
"moment": "^2.24.0",
38+
"pretty-bytes": "^5.1.0",
39+
"react": "^16.8.1",
40+
"react-dom": "^16.8.1",
41+
"react-dropzone": "^8.1.0",
42+
"react-redux": "^6.0.0",
43+
"react-router": "^4.3.1",
44+
"react-router-dom": "^4.3.1",
45+
"react-scripts": "2.1.3",
46+
"redux": "^4.0.1",
47+
"redux-actions": "^2.6.4",
48+
"redux-form": "^8.1.0",
49+
"redux-immutable": "^4.0.0",
50+
"redux-saga": "^1.0.1",
51+
"typescript": "^3.3.3",
52+
"with-immutable-props-to-js": "^1.1.0"
53+
},
54+
"homepage": ".",
55+
"main": "electron.js",
56+
"scripts": {
57+
"start": "react-scripts start",
58+
"build": "react-scripts build",
59+
"build:electron": "electron-builder -c electron.json",
60+
"start:electron": "ELECTRON_START_URL=http://localhost:3000 electron electron.js",
61+
"postinstall": "electron-builder install-app-deps",
62+
"format": "prettier --write \"src/**/*.ts\"",
63+
"test": "react-scripts test",
64+
"eject": "react-scripts eject"
65+
},
66+
"eslintConfig": {
67+
"extends": "react-app"
68+
},
69+
"browserslist": [
70+
">0.2%",
71+
"not dead",
72+
"not ie <= 11",
73+
"not op_mini all"
74+
],
75+
"devDependencies": {
76+
"electron": "^4.0.4",
77+
"electron-builder": "^20.38.5"
78+
}
2579
}

public/index.html

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta
7-
name="viewport"
8-
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9-
/>
10-
<meta name="theme-color" content="#000000" />
11-
<!--
12-
manifest.json provides metadata used when your web app is added to the
13-
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
14-
-->
15-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16-
<!--
17-
Notice the use of %PUBLIC_URL% in the tags above.
18-
It will be replaced with the URL of the `public` folder during the build.
19-
Only files inside the `public` folder can be referenced from the HTML.
20-
21-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22-
work correctly both with client-side routing and a non-root public URL.
23-
Learn how to configure a non-root public URL by running `npm run build`.
24-
-->
25-
<title>React App</title>
26-
</head>
27-
<body>
28-
<noscript>You need to enable JavaScript to run this app.</noscript>
29-
<div id="root"></div>
30-
<!--
31-
This HTML file is a template.
32-
If you open it directly in the browser, you will see an empty page.
33-
34-
You can add webfonts, meta tags, or analytics to this file.
35-
The build step will place the bundled scripts into the <body> tag.
36-
37-
To begin the development, run `npm start` or `yarn start`.
38-
To create a production bundle, use `npm run build` or `yarn build`.
39-
-->
40-
</body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta
7+
name="viewport"
8+
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
9+
/>
10+
<meta name="theme-color" content="#000000" />
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
12+
<title>SimpleS3</title>
13+
</head>
14+
<body>
15+
<noscript>You need to enable JavaScript to run this app.</noscript>
16+
<div id="root"></div>
17+
</body>
4118
</html>

public/manifest.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"short_name": "React App",
3-
"name": "Create React App Sample",
4-
"icons": [
5-
{
6-
"src": "favicon.ico",
7-
"sizes": "64x64 32x32 24x24 16x16",
8-
"type": "image/x-icon"
9-
}
10-
],
11-
"start_url": ".",
12-
"display": "standalone",
13-
"theme_color": "#000000",
14-
"background_color": "#ffffff"
2+
"short_name": "SimpleS3",
3+
"name": "SimpleS3",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
1515
}

src/App.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)