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 00000000..c857abd9 Binary files /dev/null and b/build/icon.ico differ 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: {