Ugly progress commit

This commit is contained in:
Timothy Warren 2018-06-06 17:01:39 -04:00
parent 9f750721c2
commit fb17d1b3f9
12 changed files with 94 additions and 34 deletions

View File

@ -26,7 +26,4 @@ lint: node_modules
node_modules: node_modules:
yarn --ignore-engines yarn --ignore-engines
react-start: node_modules
yarn inferno-start
.PHONY: all clean electron-start fix lint react-start .PHONY: all clean electron-start fix lint react-start

View File

@ -6,7 +6,7 @@
"private": true, "private": true,
"build": { "build": {
"appId": "net.timshomepage.film-exif", "appId": "net.timshomepage.film-exif",
"asar": false, "asar": true,
"copyright": "Copyright © year ${author}", "copyright": "Copyright © year ${author}",
"files": [ "files": [
"src/**/*", "src/**/*",
@ -20,6 +20,7 @@
} }
}, },
"dependencies": { "dependencies": {
"better-sqlite3": "^4.1.1",
"electron-log": "^2.2.14", "electron-log": "^2.2.14",
"esm": "^3.0.40", "esm": "^3.0.40",
"exiftool-vendored": "^4.25.0", "exiftool-vendored": "^4.25.0",
@ -42,6 +43,7 @@
"bootstrap": "^4", "bootstrap": "^4",
"electron": "^2.0.2", "electron": "^2.0.2",
"electron-builder": "^20.15.1", "electron-builder": "^20.15.1",
"electron-devtools-installer": "^2.2.4",
"eslint": "^4.19.1", "eslint": "^4.19.1",
"eslint-config-happiness": "^10.2.1", "eslint-config-happiness": "^10.2.1",
"eslint-config-inferno-app": "^6.2.0", "eslint-config-inferno-app": "^6.2.0",
@ -53,6 +55,7 @@
"eslint-plugin-promise": "^3.8.0", "eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.0.1", "eslint-plugin-standard": "^3.0.1",
"husky": "^0.14.3", "husky": "^0.14.3",
"inferno-devtools": "^5.0.6",
"jest": "^23.0.1", "jest": "^23.0.1",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"raf": "^3.4.0", "raf": "^3.4.0",
@ -70,18 +73,18 @@
"rollup-plugin-uglify": "^4.0.0", "rollup-plugin-uglify": "^4.0.0",
"rollup-plugin-visualizer": "^0.6.0" "rollup-plugin-visualizer": "^0.6.0"
}, },
"homepage": "/",
"scripts": { "scripts": {
"build": "set NODE_ENV=production && rollup --config rollup.prod.js", "build": "set NODE_ENV=production && rollup --config rollup.prod.js",
"dist": "yarn run build && build", "dist": "yarn run build && build",
"electron-start": "node src/electron/wait-inferno", "electron-start": "set NODE_ENV=development && node src/electron/wait-inferno",
"electron": "electron .", "electron": "electron .",
"fix": "eslint --fix src/**/*.js", "fix": "eslint --fix src/**/*.js",
"inferno-start": "rollup --config rollup.dev.js --watch", "inferno-start": "set NODE_ENV=development && rollup --config rollup.dev.js --watch",
"lint": "eslint src/**/*.js", "lint": "eslint src/**/*.js",
"pack": "build --dir", "pack": "build --dir",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"precommit": "yarn lint", "precommit": "yarn lint",
"react-start": "npm run inferno-start",
"test": "node scripts/test.js --env=jsdom" "test": "node scripts/test.js --env=jsdom"
}, },
"main": "src/electron/index.js", "main": "src/electron/index.js",

View File

@ -1,7 +1,6 @@
import babel from 'rollup-plugin-babel'; import babel from 'rollup-plugin-babel';
import copy from 'rollup-plugin-copy'; import copy from 'rollup-plugin-copy';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve'; import resolve from 'rollup-plugin-node-resolve';
export default { export default {
@ -17,10 +16,6 @@ export default {
'public/favicon.ico': 'build/favicon.ico', 'public/favicon.ico': 'build/favicon.ico',
'public/css/bootstrap.css': 'build/css/bootstrap.css', 'public/css/bootstrap.css': 'build/css/bootstrap.css',
'public/css/app.css': 'build/css/app.css', 'public/css/app.css': 'build/css/app.css',
verbose: true,
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}), }),
resolve({ resolve({
jsnext: true, jsnext: true,

View File

@ -3,18 +3,19 @@ import baseConfig from './rollup.config';
import alias from 'rollup-plugin-alias'; import alias from 'rollup-plugin-alias';
import filesize from 'rollup-plugin-filesize'; import filesize from 'rollup-plugin-filesize';
import livereload from 'rollup-plugin-livereload'; import livereload from 'rollup-plugin-livereload';
import replace from 'rollup-plugin-replace';
import serve from 'rollup-plugin-serve'; import serve from 'rollup-plugin-serve';
import visualizer from 'rollup-plugin-visualizer'; import visualizer from 'rollup-plugin-visualizer';
// Force the appropriate environment
process.env.NODE_ENV = 'development';
export default { export default {
...baseConfig, ...baseConfig,
plugins: [ plugins: [
alias({ alias({
'inferno': `${__dirname}/node_modules/inferno/dist/index.dev.esm.js`, 'inferno': `${__dirname}/node_modules/inferno/dist/index.dev.esm.js`,
}), }),
replace({
'process.env.NODE_ENV': "'development'",
}),
...baseConfig.plugins, ...baseConfig.plugins,
filesize(), filesize(),
serve({ serve({

View File

@ -1,10 +1,14 @@
import baseConfig from './rollup.config'; import baseConfig from './rollup.config';
import filesize from 'rollup-plugin-filesize'; import filesize from 'rollup-plugin-filesize';
import replace from 'rollup-plugin-replace';
import { terser } from 'rollup-plugin-terser'; import { terser } from 'rollup-plugin-terser';
export default { export default {
...baseConfig, ...baseConfig,
plugins: [ plugins: [
replace({
'process.env.NODE_ENV': "'production'",
}),
...baseConfig.plugins, ...baseConfig.plugins,
terser(), terser(),
filesize(), filesize(),

View File

@ -1,4 +1,4 @@
import { Route, Switch } from 'inferno-router'; import { Redirect, Route, Switch } from 'inferno-router';
import { import {
CameraAddView, CameraAddView,
@ -9,7 +9,8 @@ import {
export const Routes = () => ( export const Routes = () => (
<Switch> <Switch>
<Route exact path="/" component={HomeView} /> <Route exact path="/" render={() => <Redirect to="/home" />} />
<Route exact path="/home" component={HomeView} />
<Route path="/camera" component={CameraAddView} /> <Route path="/camera" component={CameraAddView} />
<Route path="/film" component={FilmAddView} /> <Route path="/film" component={FilmAddView} />
<Route component={OopsView} /> <Route component={OopsView} />

4
src/constants/build.js Normal file
View File

@ -0,0 +1,4 @@
const packageJson = require('../../package.json');
export const BUILD_ENV = process.env.NODE_ENV;
export const BUILD_VERSION = packageJson.version;

View File

@ -1 +1 @@
export * from '//constants/redux-actions'; export * from './build';

View File

@ -1,2 +0,0 @@
export const OPEN_FILES = 'OPEN_FILES';
export const OPEN_FOLDER = 'OPEN_FOLDER';

View File

@ -1,4 +1,5 @@
import {app, BrowserWindow} from 'electron'; import {app, BrowserWindow} from 'electron';
import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
import log from 'electron-log'; import log from 'electron-log';
import path from 'path'; import path from 'path';
import url from 'url'; import url from 'url';
@ -6,18 +7,35 @@ import url from 'url';
log.transports.file.level = false; log.transports.file.level = false;
log.transports.console.level = 'info'; log.transports.console.level = 'info';
const DEV_MODE = process.env.NODE_ENV === 'development';
// Keep a global reference of the window object, if you don't, the window will // 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. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow; let mainWindow;
const createWindow = () => { const createWindow = () => {
// Create the browser window. // Create the browser window.
if (DEV_MODE) {
mainWindow = new BrowserWindow();
} else {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
webPreferences: { webPreferences: {
contextIsolation: true, contextIsolation: true,
nodeIntegration: false, nodeIntegration: false,
}, },
}); });
}
// Open the DevTools.
if (DEV_MODE) {
installExtension(REACT_DEVELOPER_TOOLS)
.then((extensionName) => console.log(`Added Extension: ${extensionName}`))
.catch((err) => console.log('An error occurred: ', err));
mainWindow.webContents.openDevTools({
mode: 'bottom',
});
}
// load the index.html of the app. // load the index.html of the app.
const startUrl = process.env.ELECTRON_START_URL || url.format({ const startUrl = process.env.ELECTRON_START_URL || url.format({
@ -27,13 +45,6 @@ const createWindow = () => {
}); });
mainWindow.loadURL(startUrl); mainWindow.loadURL(startUrl);
// Open the DevTools.
if (process.env.NODE_ENV !== 'production') {
mainWindow.webContents.openDevTools({
mode: 'bottom',
});
}
// Emitted when the window is closed. // Emitted when the window is closed.
mainWindow.on('closed', () => { mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows // Dereference the window object, usually you would store windows

View File

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

View File

@ -6,6 +6,10 @@
version "4.0.2" version "4.0.2"
resolved "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.0.2.tgz#6abbdc22f33cab742053777a26db2e25ca527179" resolved "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.0.2.tgz#6abbdc22f33cab742053777a26db2e25ca527179"
"7zip@0.0.6":
version "0.0.6"
resolved "https://registry.npmjs.org/7zip/-/7zip-0.0.6.tgz#9cafb171af82329490353b4816f03347aa150a30"
"@babel/code-frame@7.0.0-beta.44": "@babel/code-frame@7.0.0-beta.44":
version "7.0.0-beta.44" version "7.0.0-beta.44"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
@ -1535,10 +1539,22 @@ bcrypt-pbkdf@^1.0.0:
dependencies: dependencies:
tweetnacl "^0.14.3" tweetnacl "^0.14.3"
better-sqlite3@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-4.1.1.tgz#090a82bcebbd77f003dcf1b07a6ce1b65ec5c2fe"
dependencies:
bindings "^1.3.0"
integer "^1.0.3"
lzz-gyp "^0.4.3"
binary-extensions@^1.0.0: binary-extensions@^1.0.0:
version "1.11.0" version "1.11.0"
resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205"
bindings@^1.3.0:
version "1.3.0"
resolved "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
bluebird-lst@^1.0.5: bluebird-lst@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.5.tgz#bebc83026b7e92a72871a3dc599e219cbfb002a9" resolved "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.5.tgz#bebc83026b7e92a72871a3dc599e219cbfb002a9"
@ -2014,6 +2030,10 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
shebang-command "^1.2.0" shebang-command "^1.2.0"
which "^1.2.9" which "^1.2.9"
cross-unzip@0.0.2:
version "0.0.2"
resolved "https://registry.npmjs.org/cross-unzip/-/cross-unzip-0.0.2.tgz#5183bc47a09559befcf98cc4657964999359372f"
crypto-random-string@^1.0.0: crypto-random-string@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e"
@ -2306,6 +2326,15 @@ electron-builder@^20.15.1:
update-notifier "^2.5.0" update-notifier "^2.5.0"
yargs "^11.0.0" yargs "^11.0.0"
electron-devtools-installer@^2.2.4:
version "2.2.4"
resolved "https://registry.npmjs.org/electron-devtools-installer/-/electron-devtools-installer-2.2.4.tgz#261a50337e37121d338b966f07922eb4939a8763"
dependencies:
"7zip" "0.0.6"
cross-unzip "0.0.2"
rimraf "^2.5.2"
semver "^5.3.0"
electron-download-tf@4.3.4: electron-download-tf@4.3.4:
version "4.3.4" version "4.3.4"
resolved "https://registry.npmjs.org/electron-download-tf/-/electron-download-tf-4.3.4.tgz#b03740b2885aa2ad3f8784fae74df427f66d5165" resolved "https://registry.npmjs.org/electron-download-tf/-/electron-download-tf-4.3.4.tgz#b03740b2885aa2ad3f8784fae74df427f66d5165"
@ -3374,6 +3403,10 @@ inferno-dev-utils@^5.3.0:
strip-ansi "4.0.0" strip-ansi "4.0.0"
text-table "0.2.0" text-table "0.2.0"
inferno-devtools@^5.0.6:
version "5.0.6"
resolved "https://registry.npmjs.org/inferno-devtools/-/inferno-devtools-5.0.6.tgz#4fb856aa01c9eb0889dd39b518c68d3f4e1bb79c"
inferno-error-overlay@^4.3.0: inferno-error-overlay@^4.3.0:
version "4.3.0" version "4.3.0"
resolved "https://registry.npmjs.org/inferno-error-overlay/-/inferno-error-overlay-4.3.0.tgz#11d9fc2603b79aaa10b50c5106d089a5783c5571" resolved "https://registry.npmjs.org/inferno-error-overlay/-/inferno-error-overlay-4.3.0.tgz#11d9fc2603b79aaa10b50c5106d089a5783c5571"
@ -3483,6 +3516,12 @@ inquirer@^3.0.6:
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
through "^2.3.6" through "^2.3.6"
integer@^1.0.3:
version "1.0.3"
resolved "https://registry.npmjs.org/integer/-/integer-1.0.3.tgz#6e6403896de6781c50974c5adf9eea9bb0ce6acb"
dependencies:
bindings "^1.3.0"
invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2: invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2:
version "2.2.4" version "2.2.4"
resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
@ -4397,6 +4436,12 @@ lru-cache@^4.0.1:
pseudomap "^1.0.2" pseudomap "^1.0.2"
yallist "^2.1.2" yallist "^2.1.2"
lzz-gyp@^0.4.3:
version "0.4.3"
resolved "https://registry.npmjs.org/lzz-gyp/-/lzz-gyp-0.4.3.tgz#a7dff682c5be969aaf6c3ba7ae11eb0196ca160b"
dependencies:
which "^1.3.0"
magic-string@^0.22.4: magic-string@^0.22.4:
version "0.22.5" version "0.22.5"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e"
@ -5500,7 +5545,7 @@ right-align@^0.1.1:
dependencies: dependencies:
align-text "^0.1.1" align-text "^0.1.1"
rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1: rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1:
version "2.6.2" version "2.6.2"
resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
dependencies: dependencies: