First commit

This commit is contained in:
Timothy Warren 2018-03-29 16:28:14 -04:00
commit 0a119f4664
18 changed files with 11373 additions and 0 deletions

28
.editorconfig Normal file
View File

@ -0,0 +1,28 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*]
charset = utf-8
# Tab indentation (no size specified)
[*]
indent_style = tab
indent_size = 4
# Indentation override for all JS under lib directory
[*.js]
indent_size = 2
# Matches the exact files either package.json or .travis.yml
[*.yml]
indent_style = space
indent_size = 2

29
.eslintrc Normal file
View File

@ -0,0 +1,29 @@
{
"env": {
"browser": true,
"node": true,
"shared-node-browser": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:inferno/recommended",
"eslint-config-happiness"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"import/extensions": 0,
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": [2, { "ignore": ["electron"] }],
"linebreak-style": 0,
"react/prefer-stateless-function": 0,
"no-console": 0
}
}

275
.gitignore vendored Normal file
View File

@ -0,0 +1,275 @@
# Created by https://www.gitignore.io/api/osx,vim,code,node,linux,emacs,windows,jetbrains+all
### Code ###
# Visual Studio Code - https://code.visualstudio.com/
.settings/
.vscode/
tsconfig.json
jsconfig.json
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
projectile-bookmarks.eld
# directory configuration
.dir-locals.el
# saveplace
places
# url cache
url/cache/
# cedet
ede-projects.el
# smex
smex-items
# company-statistics
company-statistics-cache.el
# anaconda-mode
anaconda-mode/
### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Ruby plugin and RubyMine
/.rakeTasks
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### JetBrains+all Patch ###
# Ignores the whole idea folder
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/
### Linux ###
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
### OSX ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Vim ###
# swap
.sw[a-p]
.*.sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
## Built files
build/
dist/
# End of https://www.gitignore.io/api/osx,vim,code,node,linux,emacs,windows,jetbrains+all

2
Procfile Normal file
View File

@ -0,0 +1,2 @@
react: npm run react-start
electron: npm run electron-start

2434
README.md Normal file

File diff suppressed because it is too large Load Diff

43
package.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "film-exif-electron",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "4",
"dist-exiftool": "^10.53.0",
"inferno": "^5.0.1",
"inferno-bootstrap": "^5.0.0",
"inferno-router": "^5.0.1",
"inferno-scripts": "6.3.0",
"node-exiftool": "^2.3.0"
},
"devDependencies": {
"babel-eslint": "^8.2.2",
"electron": "^1.8.4",
"electron-builder": "^20.8.1",
"eslint": "^4.19.1",
"eslint-config-happiness": "^10.2.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-inferno": "^7.7.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"foreman": "^2.0.0"
},
"scripts": {
"build": "inferno-scripts build",
"dist": "npm run build && build",
"eject": "inferno-scripts eject",
"electron-start": "node src/electron-wait-inferno",
"electron": "electron .",
"fix": "eslint --fix src/**/*.js",
"lint": "eslint src/**/*.js",
"pack": "build --dir",
"postinstall": "eletron-builder install-app-deps",
"react-start": "BROWSER=none inferno-scripts start",
"start": "nf start -p 3000",
"test": "inferno-scripts test --env=jsdom"
},
"homepage": "./",
"main": "src/electron-starter.js"
}

6
public/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

16
public/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="stylesheet" href="%PUBLIC_URL%/bootstrap.min.css" />
<title>Inferno App</title>
</head>
<body>
<div id="app"></div>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
</body>
</html>

23
src/App.js Normal file
View File

@ -0,0 +1,23 @@
import { version, Component } from 'inferno';
import { Container, Row } from './components/Grid'
class App extends Component {
render () {
return (
<Container className="App">
<Row>
<header className="App-header">
<h1>{`Welcome to Inferno ${version}`}</h1>
</header>
</Row>
<Row>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</Row>
</Container>
);
}
}
export default App;

7
src/App.test.js Normal file
View File

@ -0,0 +1,7 @@
import { render } from 'inferno';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
render(<App />, div);
});

9
src/components/Grid.js Normal file
View File

@ -0,0 +1,9 @@
import Container from 'inferno-bootstrap/dist/Container'
import Row from 'inferno-bootstrap/dist/Row'
import Col from 'inferno-bootstrap/dist/Col'
export {
Col,
Container,
Row
}

5
src/components/index.js Normal file
View File

@ -0,0 +1,5 @@
import * as Grid from './Grid'
export {
Grid,
}

58
src/electron-starter.js Normal file
View File

@ -0,0 +1,58 @@
const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
const path = require('path');
const url = require('url');
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600});
// load the index.html of the app.
const startUrl = process.env.ELECTRON_START_URL || url.format({
pathname: path.join(__dirname, '/../build/index.html'),
protocol: 'file:',
slashes: true
});
mainWindow.loadURL(startUrl);
// Open the DevTools.
mainWindow.webContents.openDevTools();
// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow();
}
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@ -0,0 +1,28 @@
const net = require('net');
const port = process.env.PORT ? (process.env.PORT - 100) : 3000;
process.env.ELECTRON_START_URL = `http://localhost:${port}`;
const client = new net.Socket();
let startedElectron = false;
const tryConnection = () => client.connect({port: port}, () => {
client.end();
if (!startedElectron) {
console.log('starting electron');
startedElectron = true;
const exec = require('child_process').exec;
exec('npm run electron');
}
});
tryConnection();
client.on('error', (error) => {
if (error) {
console.error(error);
return;
}
setTimeout(tryConnection, 1000);
});

4
src/index.js Normal file
View File

@ -0,0 +1,4 @@
import { render } from 'inferno';
import App from './App';
render(<App />, document.getElementById('app'));

0
src/views/index.js Normal file
View File

8406
yarn.lock Normal file

File diff suppressed because it is too large Load Diff