-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds create react app project close #1
- Loading branch information
hassan
committed
Nov 22, 2018
1 parent
a56d2d9
commit 4ab0059
Showing
23 changed files
with
11,874 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build | ||
public | ||
coverage | ||
src/registerServiceWorker.js | ||
cypress/integration/examples |
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 @@ | ||
{ | ||
"extends": "airbnb", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"mocha": true, | ||
"jest": true | ||
}, | ||
"globals": { | ||
"localStorage": true, | ||
"document": true, | ||
"window": true, | ||
"cy": true, | ||
"Cypress": true | ||
}, | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"no-underscore-dangle": [ | ||
"error", | ||
{ | ||
"allow": [ | ||
"_id", | ||
"__REDUX_DEVTOOLS_EXTENSION__", | ||
"__coverage__" | ||
] | ||
} | ||
], | ||
"jsx-a11y/anchor-is-valid": [ | ||
"error", | ||
{ | ||
"components": ["Link"], | ||
"specialLink": ["to", "hrefLeft", "hrefRight"], | ||
"aspects": ["noHref", "invalidHref", "preferButton"] | ||
} | ||
], | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
"extensions": [".js", ".jsx"] | ||
} | ||
], | ||
"import/no-named-as-default": 0 | ||
} | ||
} |
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,54 @@ | ||
# package directories | ||
jspm_packages | ||
/node_modules | ||
|
||
# serverless directories | ||
.serverless | ||
|
||
# testing | ||
/coverage | ||
|
||
# misc | ||
.DS_Store | ||
.env.* | ||
env* | ||
|
||
# include encrypted environment variables | ||
!.env*.encrypted | ||
!env*.encrypted | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
/dist/ | ||
|
||
# build | ||
.webpack | ||
|
||
# vim settings | ||
.rootdir | ||
|
||
# exclude logs | ||
*.log | ||
|
||
# exclude webstorm and idea files | ||
.idea | ||
*.iml | ||
|
||
# exclude sublime project files | ||
*.sublime-* | ||
|
||
# exclude unused coverage information | ||
.nyc_output | ||
coverage.lcov | ||
|
||
# cypress generated files | ||
/cypress/screenshots | ||
/cypress/videos | ||
|
||
# production | ||
build/* | ||
!build/favicon.ico | ||
|
||
# exclude keys | ||
*.aes |
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 @@ | ||
save-exact=true |
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.inherit</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.application-identifier</key> | ||
<string>XXXXXXXXXX.com.your-domain</string> | ||
<key>com.apple.security.network.client</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-write</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,96 @@ | ||
{ | ||
"name": "graasp-desktop", | ||
"version": "0.1.0", | ||
"description": "Building and Publishing a React Based Electron App From Scratch", | ||
"private": false, | ||
"author": "Juan Carlos Farah", | ||
"license": "MIT", | ||
"homepage": "./", | ||
"main": "public/electron.js", | ||
"keywords": [ | ||
"Example", | ||
"React", | ||
"Electron" | ||
], | ||
"scripts": { | ||
"dev": "yarn react-scripts start", | ||
"build": "react-scripts build", | ||
"start": "concurrently \"cross-env BROWSER=none yarn react-scripts start\" \"wait-on http://localhost:3000 && electron .\"", | ||
"pack": "electron-builder --dir", | ||
"dist": "npx build --x64 --macos --win --linux --c.extraMetadata.main=build/electron.js -p always" | ||
}, | ||
"dependencies": { | ||
"@material-ui/core": "3.5.1", | ||
"electron-is-dev": "1.0.1", | ||
"electron-publisher-s3": "20.17.2", | ||
"react": "16.6.3", | ||
"react-dev-utils": "6.1.1", | ||
"react-dom": "16.6.3" | ||
}, | ||
"devDependencies": { | ||
"concurrently": "4.1.0", | ||
"cross-env": "5.2.0", | ||
"electron": "3.0.10", | ||
"electron-builder": "20.36.2", | ||
"react-scripts": "2.1.1", | ||
"version-bump-prompt": "4.2.1" | ||
}, | ||
"build": { | ||
"appId": "com.your-domain", | ||
"compression": "normal", | ||
"productName": "Example", | ||
"directories": { | ||
"buildResources": "build", | ||
"output": "dist" | ||
}, | ||
"mac": { | ||
"icon": "assets/icon.icns", | ||
"type": "distribution", | ||
"target": [ | ||
"pkg", | ||
"dmg", | ||
"mas" | ||
], | ||
"publish": { | ||
"provider": "s3", | ||
"bucket": "example-releases", | ||
"path": "releases" | ||
}, | ||
"category": "public.app-category.news" | ||
}, | ||
"mas": { | ||
"entitlements": "assets/entitlements.mas.plist", | ||
"entitlementsInherit": "assets/entitlements.mas.inherit.plist", | ||
"provisioningProfile": "assets/embedded.provisionprofile" | ||
}, | ||
"win": { | ||
"target": "nsis", | ||
"icon": "assets/icon.ico", | ||
"publish": { | ||
"provider": "s3", | ||
"bucket": "example-releases", | ||
"path": "releases" | ||
} | ||
}, | ||
"linux": { | ||
"icon": "assets/icon.png", | ||
"target": [ | ||
"snap", | ||
"AppImage" | ||
], | ||
"description": "Example", | ||
"category": "Network;Feed", | ||
"publish": { | ||
"provider": "s3", | ||
"bucket": "example-releases", | ||
"path": "releases" | ||
} | ||
} | ||
}, | ||
"browserslist": [ | ||
">0.2%", | ||
"not dead", | ||
"not ie <= 11", | ||
"not op_mini all" | ||
] | ||
} |
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,143 @@ | ||
const { app, BrowserWindow, shell, ipcMain, Menu, TouchBar } = require('electron'); | ||
const { TouchBarButton, TouchBarLabel, TouchBarSpacer } = TouchBar; | ||
|
||
const path = require('path'); | ||
const isDev = require('electron-is-dev'); | ||
|
||
let mainWindow; | ||
|
||
createWindow = () => { | ||
mainWindow = new BrowserWindow({ | ||
backgroundColor: '#F7F7F7', | ||
minWidth: 880, | ||
show: false, | ||
titleBarStyle: 'hidden', | ||
webPreferences: { | ||
nodeIntegration: false, | ||
preload: __dirname + '/preload.js', | ||
}, | ||
height: 860, | ||
width: 1280, | ||
}); | ||
|
||
mainWindow.loadURL( | ||
isDev | ||
? 'http://localhost:3000' | ||
: `file://${path.join(__dirname, '../build/index.html')}`, | ||
); | ||
|
||
if (isDev) { | ||
const { | ||
default: installExtension, | ||
REACT_DEVELOPER_TOOLS, | ||
REDUX_DEVTOOLS, | ||
} = require('electron-devtools-installer'); | ||
|
||
installExtension(REACT_DEVELOPER_TOOLS) | ||
.then(name => { | ||
console.log(`Added Extension: ${name}`); | ||
}) | ||
.catch(err => { | ||
console.log('An error occurred: ', err); | ||
}); | ||
|
||
installExtension(REDUX_DEVTOOLS) | ||
.then(name => { | ||
console.log(`Added Extension: ${name}`); | ||
}) | ||
.catch(err => { | ||
console.log('An error occurred: ', err); | ||
}); | ||
} | ||
|
||
mainWindow.once('ready-to-show', () => { | ||
mainWindow.show(); | ||
|
||
ipcMain.on('open-external-window', (event, arg) => { | ||
shell.openExternal(arg); | ||
}); | ||
}); | ||
}; | ||
|
||
generateMenu = () => { | ||
const template = [ | ||
{ | ||
label: 'File', | ||
submenu: [{ role: 'about' }, { role: 'quit' }], | ||
}, | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{ role: 'undo' }, | ||
{ role: 'redo' }, | ||
{ type: 'separator' }, | ||
{ role: 'cut' }, | ||
{ role: 'copy' }, | ||
{ role: 'paste' }, | ||
{ role: 'pasteandmatchstyle' }, | ||
{ role: 'delete' }, | ||
{ role: 'selectall' }, | ||
], | ||
}, | ||
{ | ||
label: 'View', | ||
submenu: [ | ||
{ role: 'reload' }, | ||
{ role: 'forcereload' }, | ||
{ role: 'toggledevtools' }, | ||
{ type: 'separator' }, | ||
{ role: 'resetzoom' }, | ||
{ role: 'zoomin' }, | ||
{ role: 'zoomout' }, | ||
{ type: 'separator' }, | ||
{ role: 'togglefullscreen' }, | ||
], | ||
}, | ||
{ | ||
role: 'window', | ||
submenu: [{ role: 'minimize' }, { role: 'close' }], | ||
}, | ||
{ | ||
role: 'help', | ||
submenu: [ | ||
{ | ||
click() { | ||
require('electron').shell.openExternal( | ||
'https://getstream.io/winds', | ||
); | ||
}, | ||
label: 'Learn More', | ||
}, | ||
{ | ||
click() { | ||
require('electron').shell.openExternal( | ||
'https://github.com/GetStream/Winds/issues', | ||
); | ||
}, | ||
label: 'File Issue on GitHub', | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
Menu.setApplicationMenu(Menu.buildFromTemplate(template)); | ||
}; | ||
|
||
app.on('ready', () => { | ||
createWindow(); | ||
generateMenu(); | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
app.quit(); | ||
}); | ||
|
||
app.on('activate', () => { | ||
if (mainWindow === null) { | ||
createWindow(); | ||
} | ||
}); | ||
|
||
ipcMain.on('load-page', (event, arg) => { | ||
mainWindow.loadURL(arg); | ||
}); |
Binary file not shown.
Oops, something went wrong.