From aaed99abac97a3d6b1766f194522a69e8a994bcb Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sun, 24 Jul 2016 10:59:21 -0700 Subject: [PATCH] Reorg (#386) * Step 1: move electorn into `app/`. This is to comply with the suggested directory format of `electron-builder`: https://github.com/electron-userland/electron-builder#two-packagejson-structure * Step 2: add build directory with icon files for mac / windows * Step 3: move all development (web) assets into main directory * Step 4: add `build` namespace to dev `package.json` * Step 5: move all dev dependencies into dev file and get rid of old electron packagers in favor of `eletorn-builder` * Step 6: target build inside `app/` as everything else is excluded at build time * Step 7: remove old stuff! * Step 8: update README * turn off asar for `child_pty` --- .eslintignore | 3 - .gitignore | 1 - README.md | 25 +++--- app/.eslintignore | 3 + auto-updater.js => app/auto-updater.js | 0 config-default.js => app/config-default.js | 0 config.js => app/config.js | 0 index.js => app/index.js | 3 - menu.js => app/menu.js | 0 notify.html => app/notify.html | 0 notify.js => app/notify.js | 0 app/package.json | 70 ++++------------- plugins.js => app/plugins.js | 0 rpc.js => app/rpc.js | 0 session.js => app/session.js | 0 {static => app/static}/icon.png | Bin {app/assets => assets}/icons.svg | 0 {static => build}/icon.icns | Bin build/icon.ico | Bin 0 -> 32038 bytes {app/lib => lib}/actions/config.js | 0 {app/lib => lib}/actions/header.js | 0 {app/lib => lib}/actions/index.js | 0 {app/lib => lib}/actions/notifications.js | 0 {app/lib => lib}/actions/sessions.js | 0 {app/lib => lib}/actions/ui.js | 0 {app/lib => lib}/actions/updater.js | 0 {app/lib => lib}/component.js | 0 {app/lib => lib}/components/header.js | 0 {app/lib => lib}/components/notification.js | 0 {app/lib => lib}/components/notifications.js | 0 {app/lib => lib}/components/tab.js | 0 {app/lib => lib}/components/tabs.js | 0 {app/lib => lib}/components/term.js | 0 {app/lib => lib}/components/terms.js | 0 {app/lib => lib}/constants/config.js | 0 {app/lib => lib}/constants/index.js | 0 {app/lib => lib}/constants/notifications.js | 0 {app/lib => lib}/constants/sessions.js | 0 {app/lib => lib}/constants/tabs.js | 0 {app/lib => lib}/constants/ui.js | 0 {app/lib => lib}/constants/updater.js | 0 {app/lib => lib}/containers/header.js | 0 {app/lib => lib}/containers/hyperterm.js | 0 {app/lib => lib}/containers/notifications.js | 0 {app/lib => lib}/containers/terms.js | 0 {app/lib => lib}/hterm.js | 0 {app/lib => lib}/index.js | 0 {app/lib => lib}/reducers/index.js | 0 {app/lib => lib}/reducers/sessions.js | 0 {app/lib => lib}/reducers/ui.js | 0 {app/lib => lib}/rpc.js | 0 {app/lib => lib}/utils/array.js | 0 {app/lib => lib}/utils/colors.js | 0 {app/lib => lib}/utils/config.js | 0 {app/lib => lib}/utils/effects.js | 0 {app/lib => lib}/utils/notify.js | 0 {app/lib => lib}/utils/object.js | 0 {app/lib => lib}/utils/plugins.js | 0 {app/lib => lib}/utils/rpc.js | 0 {app/lib => lib}/utils/url-command.js | 0 {app/lib => lib}/utils/url-regex.js | 0 package.json | 78 ++++++++++++++----- scripts/config.json | 31 -------- scripts/install.sh | 13 ---- scripts/package.sh | 31 -------- app/webpack.config.js => webpack.config.js | 2 +- 66 files changed, 87 insertions(+), 173 deletions(-) rename auto-updater.js => app/auto-updater.js (100%) rename config-default.js => app/config-default.js (100%) rename config.js => app/config.js (100%) rename index.js => app/index.js (97%) rename menu.js => app/menu.js (100%) rename notify.html => app/notify.html (100%) rename notify.js => app/notify.js (100%) rename plugins.js => app/plugins.js (100%) rename rpc.js => app/rpc.js (100%) rename session.js => app/session.js (100%) rename {static => app/static}/icon.png (100%) rename {app/assets => assets}/icons.svg (100%) rename {static => build}/icon.icns (100%) create mode 100644 build/icon.ico rename {app/lib => lib}/actions/config.js (100%) rename {app/lib => lib}/actions/header.js (100%) rename {app/lib => lib}/actions/index.js (100%) rename {app/lib => lib}/actions/notifications.js (100%) rename {app/lib => lib}/actions/sessions.js (100%) rename {app/lib => lib}/actions/ui.js (100%) rename {app/lib => lib}/actions/updater.js (100%) rename {app/lib => lib}/component.js (100%) rename {app/lib => lib}/components/header.js (100%) rename {app/lib => lib}/components/notification.js (100%) rename {app/lib => lib}/components/notifications.js (100%) rename {app/lib => lib}/components/tab.js (100%) rename {app/lib => lib}/components/tabs.js (100%) rename {app/lib => lib}/components/term.js (100%) rename {app/lib => lib}/components/terms.js (100%) rename {app/lib => lib}/constants/config.js (100%) rename {app/lib => lib}/constants/index.js (100%) rename {app/lib => lib}/constants/notifications.js (100%) rename {app/lib => lib}/constants/sessions.js (100%) rename {app/lib => lib}/constants/tabs.js (100%) rename {app/lib => lib}/constants/ui.js (100%) rename {app/lib => lib}/constants/updater.js (100%) rename {app/lib => lib}/containers/header.js (100%) rename {app/lib => lib}/containers/hyperterm.js (100%) rename {app/lib => lib}/containers/notifications.js (100%) rename {app/lib => lib}/containers/terms.js (100%) rename {app/lib => lib}/hterm.js (100%) rename {app/lib => lib}/index.js (100%) rename {app/lib => lib}/reducers/index.js (100%) rename {app/lib => lib}/reducers/sessions.js (100%) rename {app/lib => lib}/reducers/ui.js (100%) rename {app/lib => lib}/rpc.js (100%) rename {app/lib => lib}/utils/array.js (100%) rename {app/lib => lib}/utils/colors.js (100%) rename {app/lib => lib}/utils/config.js (100%) rename {app/lib => lib}/utils/effects.js (100%) rename {app/lib => lib}/utils/notify.js (100%) rename {app/lib => lib}/utils/object.js (100%) rename {app/lib => lib}/utils/plugins.js (100%) rename {app/lib => lib}/utils/rpc.js (100%) rename {app/lib => lib}/utils/url-command.js (100%) rename {app/lib => lib}/utils/url-regex.js (100%) delete mode 100644 scripts/config.json delete mode 100755 scripts/install.sh delete mode 100755 scripts/package.sh rename app/webpack.config.js => webpack.config.js (95%) diff --git a/.eslintignore b/.eslintignore index e679c757..1521c8b7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1 @@ -app/dist -app/node_modules -build dist diff --git a/.gitignore b/.gitignore index 15daa358..5affed8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # build output dist -build # dependencies node_modules diff --git a/README.md b/README.md index b00acf23..9e25dabd 100644 --- a/README.md +++ b/README.md @@ -21,27 +21,24 @@ brew cask install hyperterm ## Contribute -To install `package.json` dependencies in a way where the native -modules are built with `electron`, run: +To test a certain git tree, clone and then run: ```bash -./scripts/install.sh +npm install +npm run pack ``` -Then, you want to make sure `app/dist` is populated. I recommend -running `webpack` with `--watch` so that any changes you make -to the app are detected. +then open the `./dist` folder to find the built binaries! -```bash -cd app/ -npm install +If you want to develop, run the above, and then you want to +run webpack in `watch` mode: + +``` npm run dev ``` -Then you can run in the main directory: +and to load the application simply run: -```bash -npm start ``` - -...to launch the app! +electron app/index.js +``` diff --git a/app/.eslintignore b/app/.eslintignore index 1521c8b7..e679c757 100644 --- a/app/.eslintignore +++ b/app/.eslintignore @@ -1 +1,4 @@ +app/dist +app/node_modules +build dist diff --git a/auto-updater.js b/app/auto-updater.js similarity index 100% rename from auto-updater.js rename to app/auto-updater.js diff --git a/config-default.js b/app/config-default.js similarity index 100% rename from config-default.js rename to app/config-default.js diff --git a/config.js b/app/config.js similarity index 100% rename from config.js rename to app/config.js diff --git a/index.js b/app/index.js similarity index 97% rename from index.js rename to app/index.js index 61c2ae54..86c6a386 100644 --- a/index.js +++ b/app/index.js @@ -28,9 +28,6 @@ if (isDev) { const url = 'file://' + resolve( isDev ? __dirname : app.getAppPath(), - // in prod version, we copy over index.html and dist from 'app' - // into one dist folder to avoid unwanted files in package - isDev ? 'app' : 'build', 'index.html' ); diff --git a/menu.js b/app/menu.js similarity index 100% rename from menu.js rename to app/menu.js diff --git a/notify.html b/app/notify.html similarity index 100% rename from notify.html rename to app/notify.html diff --git a/notify.js b/app/notify.js similarity index 100% rename from notify.js rename to app/notify.js diff --git a/app/package.json b/app/package.json index 91ea65ab..4f0955b2 100644 --- a/app/package.json +++ b/app/package.json @@ -1,46 +1,25 @@ { - "name": "hyperterm-web", - "version": "0.0.1", - "description": "Web app that runs in the renderer process", + "name": "hyperterm", + "productName": "HyperTerm", + "version": "0.7.0-beta", "license": "MIT", + "author": "rauchg", "repository": "zeit/hyperterm", + "description": "HTML/JS/CSS Terminal", "dependencies": { - "aphrodite-simple": "0.4.1", - "color": "^0.11.3", - "hterm-umdjs": "1.1.3", - "json-loader": "0.5.4", - "mousetrap": "1.6.0", + "child_pty": "3.0.1", + "convert-css-color-name-to-hex": "0.1.1", + "default-shell": "1.0.1", + "electron-config": "0.2.1", + "electron-is-dev": "0.1.1", + "gaze": "1.1.0", + "mkdirp": "0.5.1", "ms": "0.7.1", - "object-values": "1.0.0", - "react": "15.2.1", - "react-addons-pure-render-mixin": "15.2.1", - "react-deep-force-update": "2.0.1", - "react-dom": "15.2.1", - "react-redux": "4.4.5", - "redux": "3.5.2", - "redux-thunk": "2.1.0", - "reselect": "2.5.3", - "seamless-immutable": "6.1.1" - }, - "devDependencies": { - "babel-cli": "6.10.1", - "babel-core": "6.10.4", - "babel-eslint": "6.1.2", - "babel-loader": "6.2.4", - "babel-preset-es2015-native-modules": "6.9.0", - "babel-preset-react": "6.11.1", - "eslint": "3.1.1", - "eslint-config-standard": "5.3.5", - "eslint-plugin-promise": "2.0.0", - "eslint-plugin-react": "5.2.2", - "eslint-plugin-standard": "2.0.0", - "webpack": "2.1.0-beta.15" + "shell-env": "0.1.2", + "uid2": "0.0.3" }, "eslintConfig": { "extends": "standard", - "plugins": [ - "react" - ], "rules": { "yoda": 0, "semi": [ @@ -55,26 +34,7 @@ "before": false, "after": true } - ], - "react/jsx-uses-react": 1, - "react/jsx-uses-vars": 1 - }, - "parserOptions": { - "ecmaFeatures": { - "jsx": true - } + ] } - }, - "babel": { - "presets": [ - "es2015-native-modules", - "react" - ] - }, - "scripts": { - "dev": "webpack --watch", - "lint": "eslint .", - "build": "NODE_ENV=production webpack", - "test": "npm run lint" } } diff --git a/plugins.js b/app/plugins.js similarity index 100% rename from plugins.js rename to app/plugins.js diff --git a/rpc.js b/app/rpc.js similarity index 100% rename from rpc.js rename to app/rpc.js diff --git a/session.js b/app/session.js similarity index 100% rename from session.js rename to app/session.js diff --git a/static/icon.png b/app/static/icon.png similarity index 100% rename from static/icon.png rename to app/static/icon.png diff --git a/app/assets/icons.svg b/assets/icons.svg similarity index 100% rename from app/assets/icons.svg rename to assets/icons.svg diff --git a/static/icon.icns b/build/icon.icns similarity index 100% rename from static/icon.icns rename to build/icon.icns diff --git a/build/icon.ico b/build/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c857abd995094f8073ad28adefc49f392bc987ae GIT binary patch literal 32038 zcmeI5c~nzZ9>-r6NFeMGlCXn?By0(Ziq@)#iq%1Cv0|<5(Q4~99oKO~kwsC|T3hQl zYCGfDaU81!so7c3$bc#uhWZFt09xG?sa;pd?md7RjL_g~9TqtRg2tXWU&o9Y+9@ld6Fa*pbc2&dS-D+^``=6gf{5x!~ zf^&KmICe(xFLHzPrV5BRR2av8etAE-3}qR^0dY)Ukd) zW}R!}N_-c?cVRJjM)L2wpb!Cb3c<560>97|0dM9b@U?vKg#GWICvYXcuR%HW8u&)? zubg@Xp|MxM7r6C%{o`4?5Z{-f8h;sl>;Cu8w{n4MTpqNe^1!$H)jyBNLs(eYBYENB z;Q@Lbt#4AP^pX8~a-O38HKTG78F>j-5B$^g8#iu5LPA2j>*ev|$K&YHqYv%VPd`Oe zR8-&m^Ib4B@&}9={1dG8{6|JcqPn^oixw?vr=cfoPqMES@gJqVgvk+CAmIPj{@mQ$ zaQ*sqw6?Y)B_#!XKEF?#U1_l<{$tgb@oM;W2p{-YtJTQO&1HR44fE#BBV}V{5dQ+6 zE2f8E#oUlW*gWv>>FJ4+Cr`5e=gysL5Wj8tAte6igydtfvJ|#@`S0T5g6!;UeEs#; z2K8@4{Qp5wghWL-MEv&WU!hQl-Me=qG&Iy;8f*_|IEiG9Dh~Sm1Sz0C;vlL zQ}j_-A^Ot}sj5pdwaqWldsuR>PVdu|{b}SLUt$XP&!m1Cb)wHH=p)nF#2!AUAkR)a zPNtAo0~-4FOxl?F#~dx@aZWVJxhHfxm@n=hXL3y3h(>Ns(@vsU$z)dWxY@cP%vblW zGlw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Utr~A|Ljg5_E&wKao-DB(jci(*n ze}8|otMmH&&H_1RD}Kc93H#EJ8q8Px47X1B+wy>ZNB#Tnzi0Vr>@)q|x&HCYZP|tJ zzb(&Y*;fVM!aH*EF1QQ+wmhKi{mhv&Y+E>X?3h{eyIRY!C@2rBf^TCziSu0^bPeu; z$G`ui^`3s$zNV%IAtCMi3v;RiZq^Dc4ZO^xw~SmiWj zAv}aV8~;Yn4aUBYZ{z9dTtfI$6xXmbtO2`8tn(ISF+6+7-&3Eaw7*oK#3sdcmVG~o z^WG6s3NH)dml6JL!388vyovljfySGA!m8kJJJ>ASa&PLDk5GjVL&`{ud`rV8s=A$r zBbqRSe5*sqwPWMuY0UhyY67kZugH?|548@Ts2dI(R@bYtwf9ba8d2Y}LwO#Xg1&vG z?Oo+r9EqrFCCq0JYZ|nNhSu;hHM+>-ntKONXqziZoI9RnBaAnXYg+#PnMOC_XhgBl_UTF literal 0 HcmV?d00001 diff --git a/app/lib/actions/config.js b/lib/actions/config.js similarity index 100% rename from app/lib/actions/config.js rename to lib/actions/config.js diff --git a/app/lib/actions/header.js b/lib/actions/header.js similarity index 100% rename from app/lib/actions/header.js rename to lib/actions/header.js diff --git a/app/lib/actions/index.js b/lib/actions/index.js similarity index 100% rename from app/lib/actions/index.js rename to lib/actions/index.js diff --git a/app/lib/actions/notifications.js b/lib/actions/notifications.js similarity index 100% rename from app/lib/actions/notifications.js rename to lib/actions/notifications.js diff --git a/app/lib/actions/sessions.js b/lib/actions/sessions.js similarity index 100% rename from app/lib/actions/sessions.js rename to lib/actions/sessions.js diff --git a/app/lib/actions/ui.js b/lib/actions/ui.js similarity index 100% rename from app/lib/actions/ui.js rename to lib/actions/ui.js diff --git a/app/lib/actions/updater.js b/lib/actions/updater.js similarity index 100% rename from app/lib/actions/updater.js rename to lib/actions/updater.js diff --git a/app/lib/component.js b/lib/component.js similarity index 100% rename from app/lib/component.js rename to lib/component.js diff --git a/app/lib/components/header.js b/lib/components/header.js similarity index 100% rename from app/lib/components/header.js rename to lib/components/header.js diff --git a/app/lib/components/notification.js b/lib/components/notification.js similarity index 100% rename from app/lib/components/notification.js rename to lib/components/notification.js diff --git a/app/lib/components/notifications.js b/lib/components/notifications.js similarity index 100% rename from app/lib/components/notifications.js rename to lib/components/notifications.js diff --git a/app/lib/components/tab.js b/lib/components/tab.js similarity index 100% rename from app/lib/components/tab.js rename to lib/components/tab.js diff --git a/app/lib/components/tabs.js b/lib/components/tabs.js similarity index 100% rename from app/lib/components/tabs.js rename to lib/components/tabs.js diff --git a/app/lib/components/term.js b/lib/components/term.js similarity index 100% rename from app/lib/components/term.js rename to lib/components/term.js diff --git a/app/lib/components/terms.js b/lib/components/terms.js similarity index 100% rename from app/lib/components/terms.js rename to lib/components/terms.js diff --git a/app/lib/constants/config.js b/lib/constants/config.js similarity index 100% rename from app/lib/constants/config.js rename to lib/constants/config.js diff --git a/app/lib/constants/index.js b/lib/constants/index.js similarity index 100% rename from app/lib/constants/index.js rename to lib/constants/index.js diff --git a/app/lib/constants/notifications.js b/lib/constants/notifications.js similarity index 100% rename from app/lib/constants/notifications.js rename to lib/constants/notifications.js diff --git a/app/lib/constants/sessions.js b/lib/constants/sessions.js similarity index 100% rename from app/lib/constants/sessions.js rename to lib/constants/sessions.js diff --git a/app/lib/constants/tabs.js b/lib/constants/tabs.js similarity index 100% rename from app/lib/constants/tabs.js rename to lib/constants/tabs.js diff --git a/app/lib/constants/ui.js b/lib/constants/ui.js similarity index 100% rename from app/lib/constants/ui.js rename to lib/constants/ui.js diff --git a/app/lib/constants/updater.js b/lib/constants/updater.js similarity index 100% rename from app/lib/constants/updater.js rename to lib/constants/updater.js diff --git a/app/lib/containers/header.js b/lib/containers/header.js similarity index 100% rename from app/lib/containers/header.js rename to lib/containers/header.js diff --git a/app/lib/containers/hyperterm.js b/lib/containers/hyperterm.js similarity index 100% rename from app/lib/containers/hyperterm.js rename to lib/containers/hyperterm.js diff --git a/app/lib/containers/notifications.js b/lib/containers/notifications.js similarity index 100% rename from app/lib/containers/notifications.js rename to lib/containers/notifications.js diff --git a/app/lib/containers/terms.js b/lib/containers/terms.js similarity index 100% rename from app/lib/containers/terms.js rename to lib/containers/terms.js diff --git a/app/lib/hterm.js b/lib/hterm.js similarity index 100% rename from app/lib/hterm.js rename to lib/hterm.js diff --git a/app/lib/index.js b/lib/index.js similarity index 100% rename from app/lib/index.js rename to lib/index.js diff --git a/app/lib/reducers/index.js b/lib/reducers/index.js similarity index 100% rename from app/lib/reducers/index.js rename to lib/reducers/index.js diff --git a/app/lib/reducers/sessions.js b/lib/reducers/sessions.js similarity index 100% rename from app/lib/reducers/sessions.js rename to lib/reducers/sessions.js diff --git a/app/lib/reducers/ui.js b/lib/reducers/ui.js similarity index 100% rename from app/lib/reducers/ui.js rename to lib/reducers/ui.js diff --git a/app/lib/rpc.js b/lib/rpc.js similarity index 100% rename from app/lib/rpc.js rename to lib/rpc.js diff --git a/app/lib/utils/array.js b/lib/utils/array.js similarity index 100% rename from app/lib/utils/array.js rename to lib/utils/array.js diff --git a/app/lib/utils/colors.js b/lib/utils/colors.js similarity index 100% rename from app/lib/utils/colors.js rename to lib/utils/colors.js diff --git a/app/lib/utils/config.js b/lib/utils/config.js similarity index 100% rename from app/lib/utils/config.js rename to lib/utils/config.js diff --git a/app/lib/utils/effects.js b/lib/utils/effects.js similarity index 100% rename from app/lib/utils/effects.js rename to lib/utils/effects.js diff --git a/app/lib/utils/notify.js b/lib/utils/notify.js similarity index 100% rename from app/lib/utils/notify.js rename to lib/utils/notify.js diff --git a/app/lib/utils/object.js b/lib/utils/object.js similarity index 100% rename from app/lib/utils/object.js rename to lib/utils/object.js diff --git a/app/lib/utils/plugins.js b/lib/utils/plugins.js similarity index 100% rename from app/lib/utils/plugins.js rename to lib/utils/plugins.js diff --git a/app/lib/utils/rpc.js b/lib/utils/rpc.js similarity index 100% rename from app/lib/utils/rpc.js rename to lib/utils/rpc.js diff --git a/app/lib/utils/url-command.js b/lib/utils/url-command.js similarity index 100% rename from app/lib/utils/url-command.js rename to lib/utils/url-command.js diff --git a/app/lib/utils/url-regex.js b/lib/utils/url-regex.js similarity index 100% rename from app/lib/utils/url-regex.js rename to lib/utils/url-regex.js diff --git a/package.json b/package.json index ccf5e672..bff1ac1b 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,48 @@ { - "name": "hyperterm", - "productName": "HyperTerm", - "version": "0.7.0-beta", - "license": "MIT", + "name": "hyperterm-web", + "version": "0.0.1", + "description": "Web app that runs in the renderer process", "repository": "zeit/hyperterm", - "description": "HTML/JS/CSS Terminal", "dependencies": { - "child_pty": "3.0.1", - "convert-css-color-name-to-hex": "0.1.1", - "default-shell": "1.0.1", - "electron-config": "0.2.1", - "electron-is-dev": "0.1.1", - "gaze": "1.1.0", - "mkdirp": "0.5.1", + "aphrodite-simple": "0.4.1", + "color": "^0.11.3", + "hterm-umdjs": "1.1.3", + "json-loader": "0.5.4", + "mousetrap": "1.6.0", "ms": "0.7.1", - "shell-env": "0.1.2", - "uid2": "0.0.3" + "object-values": "1.0.0", + "react": "15.2.1", + "react-addons-pure-render-mixin": "15.2.1", + "react-deep-force-update": "2.0.1", + "react-dom": "15.2.1", + "react-redux": "4.4.5", + "redux": "3.5.2", + "redux-thunk": "2.1.0", + "reselect": "2.5.3", + "seamless-immutable": "6.1.1" }, "devDependencies": { - "electron-installer-debian": "0.3.0", - "electron-packager": "7.3.0", + "babel-cli": "6.10.1", + "babel-core": "6.10.4", + "babel-eslint": "6.1.2", + "babel-loader": "6.2.4", + "babel-preset-es2015-native-modules": "6.9.0", + "babel-preset-react": "6.11.1", + "electron-builder": "5.14.2", "electron-prebuilt": "1.2.8", "eslint": "3.1.1", "eslint-config-standard": "5.3.5", "eslint-plugin-promise": "2.0.0", "eslint-plugin-react": "5.2.2", "eslint-plugin-standard": "2.0.0", - "husky": "0.11.4" + "husky": "0.11.4", + "webpack": "2.1.0-beta.15" }, "eslintConfig": { "extends": "standard", + "plugins": [ + "react" + ], "rules": { "yoda": 0, "semi": [ @@ -44,14 +57,37 @@ "before": false, "after": true } - ] + ], + "react/jsx-uses-react": 1, + "react/jsx-uses-vars": 1 + }, + "parserOptions": { + "ecmaFeatures": { + "jsx": true + } } }, + "babel": { + "presets": [ + "es2015-native-modules", + "react" + ] + }, + "build": { + "appId": "hyperterm", + "app-category-type": "public.app-category.developer-tools", + "asar": false + }, "scripts": { - "start": "electron index", - "lint": "eslint .", + "dev": "webpack --watch", + "lint": "eslint lib/ && eslint app/*.js", + "build": "NODE_ENV=production webpack", + "test": "npm run lint", + "start": "electron app", "prepublish": "npm test", "prepush": "npm test", - "test": "npm run lint" + "postinstall": "install-app-deps", + "pack": "npm run build && build --dir", + "dist": "npm run build && build" } } diff --git a/scripts/config.json b/scripts/config.json deleted file mode 100644 index 1fc3d07e..00000000 --- a/scripts/config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "Hyperterm", - "description":"HTML/JS/CSS Terminal", - "dest": "./dist", - "icon": "./static/icon.png", - "version":"0.6.0", - "maintainer":"Guillermo Rauch", - "categories": [ - "Utility" - ], - "depends": [ - "git", - "gconf2", - "gconf-service", - "gvfs-bin", - "libc6", - "libcap2", - "libgtk2.0-0", - "libudev0 | libudev1", - "libgcrypt11 | libgcrypt20", - "libappindicator1", - "libnotify4", - "libnss3", - "libxtst6", - "python", - "xdg-utils" - ], - "lintianOverrides": [ - "changelog-file-missing-in-native-package" - ] -} \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100755 index 75323c0c..00000000 --- a/scripts/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# Electron's version. -export npm_config_target=1.2.3 -# The architecture of Electron, can be ia32 or x64. -export npm_config_arch=x64 -# Download headers for Electron. -export npm_config_disturl=https://atom.io/download/atom-shell -# Tell node-pre-gyp that we are building for Electron. -export npm_config_runtime=electron -# Tell node-pre-gyp to build module from source code. -export npm_config_build_from_source=true -# Install all dependencies, and store cache to ~/.electron-gyp. -HOME=~/.electron-gyp npm install diff --git a/scripts/package.sh b/scripts/package.sh deleted file mode 100755 index 93c08776..00000000 --- a/scripts/package.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -VERSION=`node -e 'process.stdout.write(require("./package").version)'` - -if [ -z "$HYPERTERM_OSX_SIGNING_IDENTITY" ]; then - echo "ENV var HYPERTERM_OSX_SIGNING_IDENTITY missing. Set it to the Common Name of the downloaded certificate from Apple." - exit 1 -fi - -rm -rf node_modules -rm -rf ./app/node_modules -rm -rf ./dist/* -rm -rf ./build/ -mkdir build -./scripts/install.sh -npm run lint -cd app -npm install -npm run lint -npm run build -cd - -cp -r app/assets build/ -cp app/index.html build/ -cp -r app/dist build/ -mkdir dist -electron-packager ./ --platform=darwin --out=dist --arch=x64 --app-bundle-id="co.zeit.hyperterm" --app-version="$VERSION" --extend-info=static/Info.plist --osx-sign.identity="$HYPERTERM_OSX_SIGNING_IDENTITY" --icon=static/icon.icns --prune --ignore=app/ -electron-packager ./ --platform=linux --arch=all --out=dist --app-version="$VERSION" --icon=static/icon.png --prune --ignore=app/ -electron-installer-debian --src ./dist/HyperTerm-linux-ia32/ --arch i386 --config ./scripts/config.json -electron-installer-debian --src ./dist/HyperTerm-linux-x64/ --arch amd64 --config ./scripts/config.json -cd dist/HyperTerm-darwin-x64/ -zip -r -q -y ../hyperterm-macos-x64-$VERSION.zip . -cd - diff --git a/app/webpack.config.js b/webpack.config.js similarity index 95% rename from app/webpack.config.js rename to webpack.config.js index 70c68b7a..80dc88c5 100644 --- a/app/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,7 @@ module.exports = { devtool: isProd ? 'hidden-source-map' : 'cheap-eval-source-map', entry: './lib/index.js', output: { - path: path.join(__dirname, './dist'), + path: path.join(__dirname, 'app', 'dist'), filename: 'bundle.js' }, module: {