├── public ├── tile.png ├── favicon.ico ├── tile-wide.png ├── apple-touch-icon.png ├── robots.txt ├── humans.txt ├── browserconfig.xml └── crossdomain.xml ├── .flowconfig ├── tools ├── .eslintrc ├── lib │ ├── cp.js │ ├── markdown-loader.js │ └── fs.js ├── clean.js ├── bundle.js ├── build.js ├── run.js ├── README.md ├── runServer.js ├── copy.js ├── render.js ├── deploy.js ├── postcss.config.js └── start.js ├── src ├── components │ ├── App │ │ ├── package.json │ │ ├── index.js │ │ ├── App.prod.js │ │ └── App.dev.js │ ├── Register │ │ ├── NavStep │ │ │ ├── arrow.png │ │ │ ├── package.json │ │ │ ├── NavStep.js │ │ │ └── NavStep.css │ │ ├── package.json │ │ ├── StepDone │ │ │ ├── package.json │ │ │ └── StepDone.js │ │ ├── StepOne │ │ │ ├── package.json │ │ │ └── StepOne.js │ │ ├── StepTwo │ │ │ ├── package.json │ │ │ └── StepTwo.js │ │ ├── StepThree │ │ │ ├── package.json │ │ │ └── StepThree.js │ │ ├── Register.css │ │ └── Register.js │ ├── Home │ │ ├── package.json │ │ ├── Home.css │ │ └── Home.js │ ├── Link │ │ ├── package.json │ │ └── Link.js │ ├── Page │ │ ├── package.json │ │ ├── Page.css │ │ └── Page.js │ ├── Footer │ │ ├── package.json │ │ ├── Footer.js │ │ └── Footer.css │ ├── Header │ │ ├── package.json │ │ ├── Header.css │ │ └── Header.js │ ├── Layout │ │ ├── package.json │ │ ├── Layout.js │ │ ├── Layout.test.js │ │ └── Layout.css │ ├── Login │ │ ├── package.json │ │ └── Login.js │ ├── DevTools │ │ ├── package.json │ │ └── index.js │ ├── MyEditor │ │ ├── package.json │ │ └── MyEditor.js │ ├── Product │ │ ├── package.json │ │ ├── Product.css │ │ └── Product.js │ ├── Countdown │ │ ├── package.json │ │ └── Countdown.js │ ├── MsgStack │ │ ├── package.json │ │ └── MsgStack.js │ ├── PopAddApp │ │ ├── package.json │ │ └── PopAddApp.js │ ├── AccessKeys │ │ ├── package.json │ │ ├── PopShowKey │ │ │ ├── package.json │ │ │ └── PopShowKey.js │ │ ├── AccessKeys.css │ │ └── AccessKeys.js │ ├── Deployment │ │ ├── package.json │ │ ├── Deployment.css │ │ └── Deployment.js │ ├── Navigation │ │ ├── package.json │ │ └── Navigation.js │ ├── ProductList │ │ ├── package.json │ │ ├── ProductList.css │ │ └── ProductList.js │ ├── ChangePassword │ │ ├── package.json │ │ ├── ChangePassword.css │ │ └── ChangePassword.js │ ├── variables.css │ └── Html.js ├── core │ ├── fetch │ │ ├── package.json │ │ ├── fetch.client.js │ │ └── fetch.server.js │ ├── history.js │ ├── devUtils.js │ └── DOMUtils.js ├── store │ ├── logger │ │ ├── package.json │ │ ├── logger.client.js │ │ └── logger.server.js │ ├── configureStore.js │ ├── configureStore.prod.js │ ├── createHelpers.js │ └── configureStore.dev.js ├── actions │ ├── msgStackActions.js │ ├── routesActions.js │ ├── productsActions.js │ ├── usersActions.js │ ├── actionTypes.js │ ├── authActions.js │ └── registersActions.js ├── routes │ ├── register │ │ └── index.js │ ├── notFound │ │ ├── NotFound.css │ │ ├── index.js │ │ └── NotFound.js │ ├── error │ │ ├── index.js │ │ ├── ErrorPage.css │ │ └── ErrorPage.js │ ├── accessKeys │ │ └── index.js │ ├── login │ │ └── index.js │ ├── users │ │ └── index.js │ ├── home │ │ └── index.js │ ├── index.js │ └── apps │ │ └── index.js ├── config.js ├── reducers │ ├── routes.js │ ├── index.js │ ├── msgStack.js │ ├── users.js │ ├── registers.js │ ├── products.js │ └── auth.js ├── containers │ ├── HomeContainer.js │ ├── LayoutContainer.js │ ├── LogoutContainer.js │ ├── MsgStackContainer.js │ ├── ProductContainer.js │ ├── DeploymentContainer.js │ ├── ProductListContainer.js │ ├── AccessKeysContainer.js │ ├── LoginContainer.js │ ├── ChangePasswordContainer.js │ ├── PopAddAppContainer.js │ └── RegisterContainer.js ├── server.js └── client.js ├── test ├── .eslintrc └── setup.js ├── .travis.yml ├── .gitignore ├── Dockerfile ├── .editorconfig ├── .gitattributes ├── README.md └── LICENSE.txt /public/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisong/code-push-web/HEAD/public/tile.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisong/code-push-web/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/tile-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisong/code-push-web/HEAD/public/tile-wide.png -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/build 3 | .*/config 4 | .*/node_modules 5 | .*/gulpfile.js 6 | 7 | [include] 8 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisong/code-push-web/HEAD/public/apple-touch-icon.png -------------------------------------------------------------------------------- /tools/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-console": "off", 4 | "global-require": "off" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | 3 | # Allow crawling of all content 4 | User-agent: * 5 | Disallow: 6 | -------------------------------------------------------------------------------- /src/components/App/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./App.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/NavStep/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisong/code-push-web/HEAD/src/components/Register/NavStep/arrow.png -------------------------------------------------------------------------------- /src/components/Home/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Home", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Home.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Link/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Link", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Link.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Page/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Page", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Page.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Footer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Footer", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Footer.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Header/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Header", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Header.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Layout/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Layout", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Layout.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Login/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Login", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Login.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/DevTools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DevTools", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./index.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/MyEditor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MyEditor", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./MyEditor.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Product/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Product", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Product.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Register", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Register.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Countdown/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Countdown", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Countdown.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/MsgStack/package.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "name": "MsgStack", 4 | "version": "0.0.0", 5 | "private": true, 6 | "main": "./MsgStack.js" 7 | } 8 | -------------------------------------------------------------------------------- /src/components/PopAddApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PopAddApp", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./PopAddApp.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/core/fetch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "fetch", 4 | "main": "./fetch.server.js", 5 | "browser": "./fetch.client.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/AccessKeys/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AccessKeys", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./AccessKeys.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Deployment/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Deployment", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Deployment.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Navigation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Navigation", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Navigation.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/ProductList/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ProductList", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./ProductList.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/NavStep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NavStep", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./NavStep.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/StepDone/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StepDone", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./StepDone.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/StepOne/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StepOne", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./StepOne.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/StepTwo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StepTwo", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./StepTwo.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Register/StepThree/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StepThree", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./StepThree.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/AccessKeys/PopShowKey/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PopShowKey", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./PopShowKey.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/ChangePassword/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ChangePassword", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./ChangePassword.js" 6 | } 7 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "rules": { 6 | "no-unused-expressions": 0, 7 | "padded-blocks": 0 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/App/index.js: -------------------------------------------------------------------------------- 1 | if (__DEV__ && process.env.BROWSER) { 2 | module.exports = require('./App.dev'); 3 | } else { 4 | module.exports = require('./App.prod'); 5 | } 6 | -------------------------------------------------------------------------------- /src/store/logger/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "redux-logger-middleware", 4 | "main": "./logger.server.js", 5 | "browser": "./logger.client.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Header/Header.css: -------------------------------------------------------------------------------- 1 | 2 | @import '../variables.css'; 3 | 4 | .brand { 5 | color: lightness(+10%)); 6 | text-decoration: none; 7 | font-size: 1.75em; /* ~28px */ 8 | } 9 | -------------------------------------------------------------------------------- /src/store/logger/logger.client.js: -------------------------------------------------------------------------------- 1 | import reduxLogger from 'redux-logger'; 2 | 3 | export default function createLogger() { 4 | return reduxLogger({ 5 | collapsed: true, 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /src/store/configureStore.js: -------------------------------------------------------------------------------- 1 | if (__DEV__ && process.env.BROWSER) { 2 | module.exports = require('./configureStore.dev'); 3 | } else { 4 | module.exports = require('./configureStore.prod'); 5 | } 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '7' 4 | - '6' 5 | env: 6 | - CXX=g++-4.8 7 | addons: 8 | apt: 9 | sources: 10 | - ubuntu-toolchain-r-test 11 | packages: 12 | - g++-4.8 13 | script: 14 | - yarn lint 15 | - yarn test 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Include your project-specific ignores in this file 2 | # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files 3 | 4 | build 5 | node_modules 6 | ncp-debug.log 7 | npm-debug.log 8 | stats.json 9 | report.html 10 | .DS_Store 11 | -------------------------------------------------------------------------------- /src/components/Home/Home.css: -------------------------------------------------------------------------------- 1 | 2 | @import '../../components/variables.css'; 3 | 4 | .root { 5 | padding-left: 20px; 6 | padding-right: 20px; 7 | } 8 | 9 | .container { 10 | margin: 0 auto; 11 | padding: 0 0 40px; 12 | max-width: var(--max-content-width); 13 | } 14 | -------------------------------------------------------------------------------- /public/humans.txt: -------------------------------------------------------------------------------- 1 | # humanstxt.org/ 2 | # The humans responsible & technology colophon 3 | 4 | # TEAM 5 | 6 | -- -- 7 | 8 | # THANKS 9 | 10 | 11 | 12 | # TECHNOLOGY COLOPHON 13 | 14 | CSS3, HTML5, JavaScript 15 | React, Flux, SuperAgent 16 | -------------------------------------------------------------------------------- /src/components/Register/Register.css: -------------------------------------------------------------------------------- 1 | @import '../../components/variables.css'; 2 | 3 | .root { 4 | padding-left: 20px; 5 | padding-right: 20px; 6 | } 7 | 8 | .container { 9 | margin: 0 auto; 10 | padding: 0 0 40px; 11 | max-width: 700px; 12 | min-height: 480px; 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Deployment/Deployment.css: -------------------------------------------------------------------------------- 1 | @import '../../components/variables.css'; 2 | 3 | .root { 4 | padding-left: 20px; 5 | padding-right: 20px; 6 | } 7 | 8 | .container { 9 | margin: 0 auto; 10 | padding: 0 0 40px; 11 | min-height: 480px; 12 | max-width: var(--max-content-width); 13 | } 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:6.9.5-alpine 2 | 3 | # Copy application files 4 | COPY ./build /usr/src/app 5 | WORKDIR /usr/src/app 6 | 7 | # Install Yarn and Node.js dependencies 8 | RUN npm install yarn --global --no-progress --silent --depth 0 && \ 9 | yarn install --production --no-progress 10 | 11 | CMD [ "node", "server.js" ] 12 | -------------------------------------------------------------------------------- /src/components/AccessKeys/AccessKeys.css: -------------------------------------------------------------------------------- 1 | 2 | @import '../../components/variables.css'; 3 | 4 | .root { 5 | padding-left: 20px; 6 | padding-right: 20px; 7 | } 8 | 9 | .container { 10 | margin: 0 auto; 11 | padding: 0 0 40px; 12 | min-height: 480px; 13 | max-width: var(--max-content-width); 14 | } 15 | 16 | table{ 17 | font-size: 1.2em; 18 | width: 100%; 19 | text-align: center; 20 | } 21 | -------------------------------------------------------------------------------- /public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/actions/msgStackActions.js: -------------------------------------------------------------------------------- 1 | import { 2 | MSG_STACK_SHOW_MSG, 3 | MSG_STACK_CLOSE_MSG, 4 | } from './actionTypes'; 5 | import _ from 'lodash'; 6 | 7 | export function addShowMsg(text, type="info", showTime=10) { 8 | return { 9 | type: MSG_STACK_SHOW_MSG, 10 | payload: {text,type,showTime}, 11 | } 12 | } 13 | 14 | export function closeMsg(id) { 15 | return { 16 | type: MSG_STACK_CLOSE_MSG, 17 | payload: id, 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/store/configureStore.prod.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware } from 'redux'; 2 | import thunk from 'redux-thunk'; 3 | import rootReducer from '../reducers'; 4 | 5 | export default function configureStore(initialState) { 6 | const middleware = [thunk]; 7 | const enhancer = applyMiddleware(...middleware); 8 | // See https://github.com/rackt/redux/releases/tag/v3.1.0 9 | const store = createStore(rootReducer, initialState, enhancer); 10 | return store; 11 | } 12 | -------------------------------------------------------------------------------- /src/store/logger/logger.server.js: -------------------------------------------------------------------------------- 1 | import { inspect } from 'util'; 2 | 3 | // Server side redux action logger 4 | export default function createLogger() { 5 | // eslint-disable-next-line no-unused-vars 6 | return store => next => (action) => { 7 | const formattedPayload = inspect(action.payload, { 8 | colors: true, 9 | }); 10 | console.log(` * ${action.type}: ${formattedPayload}`); // eslint-disable-line no-console 11 | return next(action); 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /src/components/Product/Product.css: -------------------------------------------------------------------------------- 1 | @import '../../components/variables.css'; 2 | 3 | .root { 4 | padding-left: 20px; 5 | padding-right: 20px; 6 | } 7 | 8 | .container { 9 | margin: 0 auto; 10 | padding: 0 0 40px; 11 | min-height: 480px; 12 | max-width: var(--max-content-width); 13 | } 14 | 15 | table{ 16 | font-size: 1.2em; 17 | width: 100%; 18 | text-align: center; 19 | } 20 | 21 | li { 22 | list-style: none; 23 | } 24 | 25 | li a { 26 | text-decoration: none; 27 | color: inherit; 28 | } 29 | -------------------------------------------------------------------------------- /src/components/Home/Home.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { PropTypes, Component } from 'react'; 3 | import withStyles from 'isomorphic-style-loader/lib/withStyles'; 4 | import s from './Home.css'; 5 | 6 | class Home extends Component { 7 | render() { 8 | return ( 9 |
10 |
11 |
12 |
13 |
14 | ); 15 | } 16 | } 17 | export default withStyles(s)(Home); 18 | -------------------------------------------------------------------------------- /src/core/fetch/fetch.client.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import 'whatwg-fetch'; 11 | 12 | export default self.fetch.bind(self); 13 | export const Headers = self.Headers; 14 | export const Request = self.Request; 15 | export const Response = self.Response; 16 | -------------------------------------------------------------------------------- /src/actions/routesActions.js: -------------------------------------------------------------------------------- 1 | import { 2 | SET_BACK_HISTORY, 3 | GO_BACK_HISTORY, 4 | SHOW_HOME, 5 | SHOW_LOGIN, 6 | } from './actionTypes'; 7 | 8 | export function setBackHistory(history="/") { 9 | return { 10 | type: SET_BACK_HISTORY, 11 | payload: history 12 | }; 13 | } 14 | 15 | export function goBackHistory() { 16 | return {type: GO_BACK_HISTORY}; 17 | } 18 | 19 | export function showHome() { 20 | return {type: SHOW_HOME}; 21 | } 22 | 23 | export function showLogin() { 24 | return {type: SHOW_LOGIN}; 25 | } 26 | -------------------------------------------------------------------------------- /src/core/history.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import createBrowserHistory from 'history/createBrowserHistory'; 11 | 12 | // Navigation manager, e.g. history.push('/home') 13 | // https://github.com/mjackson/history 14 | export default process.env.BROWSER && createBrowserHistory(); 15 | -------------------------------------------------------------------------------- /src/components/Page/Page.css: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | @import '../variables.css'; 11 | 12 | .root { 13 | padding-left: 20px; 14 | padding-right: 20px; 15 | } 16 | 17 | .container { 18 | margin: 0 auto; 19 | padding: 0 0 40px; 20 | max-width: var(--max-content-width); 21 | } 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # http://editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | # Change these settings to your own preference 10 | indent_style = space 11 | indent_size = 2 12 | 13 | # We recommend you to keep these unchanged 14 | end_of_line = lf 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | # editorconfig-tools is unable to ignore longs strings or urls 20 | max_line_length = null 21 | -------------------------------------------------------------------------------- /src/routes/register/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Layout from '../../components/Layout'; 3 | 4 | export default { 5 | 6 | path: '/register', 7 | 8 | async action({store}) { 9 | 10 | if (process.env.BROWSER) { 11 | 12 | } 13 | 14 | const RegisterContainer = await require.ensure([], require => require('../../containers/RegisterContainer').default, 'register'); 15 | return { 16 | title: '注册', 17 | chunk: 'register', 18 | component: , 19 | }; 20 | }, 21 | 22 | }; 23 | -------------------------------------------------------------------------------- /src/routes/notFound/NotFound.css: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | @import '../../components/variables.css'; 11 | 12 | .root { 13 | padding-left: 20px; 14 | padding-right: 20px; 15 | } 16 | 17 | .container { 18 | margin: 0 auto; 19 | padding: 0 0 40px; 20 | max-width: var(--max-content-width); 21 | } 22 | -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable max-len */ 2 | 3 | export const port = process.env.PORT || 3001; 4 | export const host = process.env.WEBSITE_HOSTNAME || `localhost:${port}`; 5 | 6 | export const analytics = { 7 | 8 | // https://analytics.google.com/ 9 | google: { 10 | trackingId: process.env.GOOGLE_TRACKING_ID, // UA-XXXXX-X 11 | }, 12 | 13 | }; 14 | 15 | export const common = { 16 | api: { 17 | URL: 'http://localhost:3000', // production code-push-server address 18 | devURL: 'http://localhost:3000', // development code-push-server address 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/Register/StepDone/StepDone.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | ControlLabel, 4 | Form, 5 | FormGroup, 6 | FormControl, 7 | Button, 8 | } from 'react-bootstrap'; 9 | import Link from '../../Link'; 10 | 11 | 12 | function StepDone() { 13 | return ( 14 |
15 | 16 |
17 | 恭喜!您已经注册成功,快去 18 | 登录 19 | 20 |
21 |
22 |
23 | ); 24 | } 25 | export default StepDone; 26 | -------------------------------------------------------------------------------- /src/components/DevTools/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createDevTools } from 'redux-devtools'; 3 | import DockMonitor from 'redux-devtools-dock-monitor'; 4 | import MultipleMonitors from 'redux-devtools-multiple-monitors'; 5 | import LogMonitor from 'redux-devtools-inspector'; 6 | import Dispatcher from 'redux-devtools-dispatch'; 7 | 8 | 9 | export default createDevTools( 10 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /src/routes/error/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import React from 'react'; 11 | import ErrorPage from './ErrorPage'; 12 | 13 | export default { 14 | 15 | path: '/error', 16 | 17 | action({ error }) { 18 | return { 19 | title: error.name, 20 | description: error.message, 21 | component: , 22 | status: error.status || 500, 23 | }; 24 | }, 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /tools/lib/cp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import cp from 'child_process'; 11 | 12 | export const spawn = (command, args, options) => new Promise((resolve, reject) => { 13 | cp.spawn(command, args, options).on('close', (code) => { 14 | if (code === 0) { 15 | resolve(); 16 | } else { 17 | reject(new Error(`${command} ${args.join(' ')} => ${code} (error)`)); 18 | } 19 | }); 20 | }); 21 | 22 | export default { spawn }; 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on 6 | # checkin and prevent conversion to CRLF when they are checked out 7 | # (this is required in order to prevent newline related issues like, 8 | # for example, after the build script is run) 9 | .* text eol=lf 10 | *.html text eol=lf 11 | *.css text eol=lf 12 | *.less text eol=lf 13 | *.scss text eol=lf 14 | *.sss text eol=lf 15 | *.js text eol=lf 16 | *.json text eol=lf 17 | *.md text eol=lf 18 | *.sh text eol=lf 19 | *.txt text eol=lf 20 | *.xml text eol=lf 21 | -------------------------------------------------------------------------------- /src/routes/notFound/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import React from 'react'; 11 | import Layout from '../../components/Layout'; 12 | import NotFound from './NotFound'; 13 | 14 | const title = 'Page Not Found'; 15 | 16 | export default { 17 | 18 | path: '*', 19 | 20 | action() { 21 | return { 22 | title, 23 | component: , 24 | status: 404, 25 | }; 26 | }, 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /src/routes/accessKeys/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import LayoutContainer from '../../containers/LayoutContainer'; 3 | import { fetchAccessKeys } from '../../actions/authActions'; 4 | 5 | export default { 6 | 7 | path: '/accessKeys', 8 | 9 | async action({ store }) { 10 | if (process.env.BROWSER) { 11 | setTimeout(() => { 12 | store.dispatch(fetchAccessKeys()); 13 | }, 100); 14 | } 15 | const AccessKeysContainer = await require.ensure([], require => require('../../containers/AccessKeysContainer').default, 'accessKeys'); 16 | return { 17 | title: '我的密钥', 18 | chunk: 'accessKeys', 19 | component: , 20 | }; 21 | }, 22 | 23 | }; 24 | -------------------------------------------------------------------------------- /tools/lib/markdown-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | const MarkdownIt = require('markdown-it'); 11 | const fm = require('front-matter'); 12 | 13 | module.exports = function markdownLoader(source) { 14 | const md = new MarkdownIt({ 15 | html: true, 16 | linkify: true, 17 | }); 18 | 19 | const frontmatter = fm(source); 20 | frontmatter.attributes.html = md.render(frontmatter.body); 21 | 22 | return `module.exports = ${JSON.stringify(frontmatter.attributes)};`; 23 | }; 24 | -------------------------------------------------------------------------------- /src/components/Footer/Footer.js: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | import withStyles from 'isomorphic-style-loader/lib/withStyles'; 4 | import s from './Footer.css'; 5 | import Link from '../Link'; 6 | 7 | function Footer() { 8 | return ( 9 |
10 |
11 | © CodePush Server 12 | · 13 | Home 14 | · 15 | Report an issue 16 |
17 |
18 | ); 19 | } 20 | 21 | export default withStyles(s)(Footer); 22 | -------------------------------------------------------------------------------- /src/components/Layout/Layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import React, { PropTypes } from 'react'; 11 | import withStyles from 'isomorphic-style-loader/lib/withStyles'; 12 | import s from './Layout.css'; 13 | 14 | class Layout extends React.Component { 15 | static propTypes = { 16 | children: PropTypes.node.isRequired, 17 | }; 18 | 19 | render() { 20 | return ( 21 |
22 | {this.props.children} 23 |
24 | ); 25 | } 26 | } 27 | 28 | export default withStyles(s)(Layout); 29 | -------------------------------------------------------------------------------- /test/setup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | /* Configure Mocha test runner, see package.json/scripts/test */ 11 | 12 | process.env.NODE_ENV = 'test'; 13 | 14 | function noop() { 15 | return null; 16 | } 17 | 18 | require.extensions['.css'] = noop; 19 | require.extensions['.scss'] = noop; 20 | require.extensions['.md'] = noop; 21 | require.extensions['.png'] = noop; 22 | require.extensions['.svg'] = noop; 23 | require.extensions['.jpg'] = noop; 24 | require.extensions['.jpeg'] = noop; 25 | require.extensions['.gif'] = noop; 26 | -------------------------------------------------------------------------------- /tools/clean.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import { cleanDir } from './lib/fs'; 11 | 12 | /** 13 | * Cleans up the output (build) directory. 14 | */ 15 | function clean() { 16 | return Promise.all([ 17 | cleanDir('build/*', { 18 | nosort: true, 19 | dot: true, 20 | ignore: ['build/.git', 'build/public'], 21 | }), 22 | 23 | cleanDir('build/public/*', { 24 | nosort: true, 25 | dot: true, 26 | ignore: ['build/public/.git'], 27 | }), 28 | ]); 29 | } 30 | 31 | export default clean; 32 | -------------------------------------------------------------------------------- /src/core/devUtils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | /* eslint-disable global-require */ 11 | 12 | if (module.hot || __DEV__) { 13 | module.exports = { 14 | // The red box (aka red screen of death) component to display your errors 15 | // https://github.com/commissure/redbox-react 16 | ErrorReporter: require('redbox-react').default, 17 | 18 | // Force-updates React component tree recursively 19 | // https://github.com/gaearon/react-deep-force-update 20 | deepForceUpdate: require('react-deep-force-update'), 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /tools/bundle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import webpack from 'webpack'; 11 | import webpackConfig from './webpack.config'; 12 | 13 | /** 14 | * Creates application bundles from the source files. 15 | */ 16 | function bundle() { 17 | return new Promise((resolve, reject) => { 18 | webpack(webpackConfig).run((err, stats) => { 19 | if (err) { 20 | return reject(err); 21 | } 22 | 23 | console.log(stats.toString(webpackConfig[0].stats)); 24 | return resolve(); 25 | }); 26 | }); 27 | } 28 | 29 | export default bundle; 30 | -------------------------------------------------------------------------------- /src/components/Footer/Footer.css: -------------------------------------------------------------------------------- 1 | @import '../variables.css'; 2 | 3 | .root { 4 | /*position: absolute;*/ 5 | /*bottom: 0;*/ 6 | width: 100%; 7 | /* Set the fixed height of the footer here */ 8 | height: 60px; 9 | background-color: #222; 10 | border-color: #080808; 11 | } 12 | 13 | .container { 14 | margin: 0 auto; 15 | padding: 20px 15px; 16 | max-width: var(--max-content-width); 17 | text-align: center; 18 | } 19 | 20 | .text { 21 | color: rgba(255, 255, 255, 0.5); 22 | } 23 | 24 | .spacer { 25 | color: rgba(255, 255, 255, 0.3); 26 | } 27 | 28 | .text, 29 | .link { 30 | padding: 2px 5px; 31 | font-size: 1em; 32 | } 33 | 34 | .link, 35 | .link:active, 36 | .link:visited { 37 | color: rgba(255, 255, 255, 0.6); 38 | text-decoration: none; 39 | } 40 | 41 | .link:hover { 42 | color: rgba(255, 255, 255, 1); 43 | } 44 | -------------------------------------------------------------------------------- /src/reducers/routes.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | import { 3 | SET_BACK_HISTORY, 4 | GO_BACK_HISTORY, 5 | SHOW_HOME, 6 | SHOW_LOGIN 7 | } from '../actions/actionTypes'; 8 | import history from '../core/history'; 9 | 10 | export function routes(state = {}, action) { 11 | switch (action.type) { 12 | case GO_BACK_HISTORY: 13 | var historyUri = _.get(state, 'history', '/'); 14 | history.replace(historyUri); 15 | return Object.assign({}, state, {history: '/'}) 16 | 17 | case SET_BACK_HISTORY: 18 | return Object.assign({}, state, {history: _.get(action, 'payload')}); 19 | 20 | case SHOW_HOME: 21 | history.replace('/'); 22 | return state; 23 | 24 | case SHOW_LOGIN: 25 | history.replace('/login'); 26 | return state; 27 | 28 | default: 29 | return state 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/routes/login/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Layout from '../../components/Layout'; 3 | import LogoutContainer from '../../containers/LogoutContainer'; 4 | 5 | const login = { 6 | path: '/login', 7 | 8 | async action({ store }) { 9 | if (process.env.BROWSER) { 10 | 11 | } 12 | const LoginContainer = await require.ensure([], require => require('../../containers/LoginContainer').default, 'login'); 13 | return { 14 | title: '登录', 15 | chunk: 'login', 16 | component: , 17 | }; 18 | }, 19 | 20 | }; 21 | 22 | const logout = { 23 | 24 | path: '/logout', 25 | 26 | async action() { 27 | return { 28 | title: '退出', 29 | component: , 30 | }; 31 | }, 32 | }; 33 | 34 | export { login as default, logout }; 35 | -------------------------------------------------------------------------------- /src/containers/HomeContainer.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | import { connect } from 'react-redux'; 4 | import { bindActionCreators } from 'redux'; 5 | import _ from 'lodash'; 6 | import * as usersActions from '../actions/usersActions'; 7 | import * as routesActions from '../actions/routesActions'; 8 | import Home from '../components/Home'; 9 | 10 | class HomeContainer extends Component { 11 | render() { 12 | const {html, actions } = this.props; 13 | return ; 14 | } 15 | } 16 | 17 | function mapStateToProps(state, ownProps) { 18 | return {}; 19 | } 20 | 21 | function mapDispatchToProps(dispatch, ownProps) { 22 | return { 23 | actions: bindActionCreators(Object.assign({}, usersActions, routesActions), dispatch) 24 | } 25 | } 26 | 27 | export default connect( 28 | mapStateToProps, 29 | mapDispatchToProps 30 | )(HomeContainer) 31 | -------------------------------------------------------------------------------- /src/core/fetch/fetch.server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (https://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE.txt file in the root directory of this source tree. 8 | */ 9 | 10 | import Promise from 'bluebird'; 11 | import fetch, { Request, Headers, Response } from 'node-fetch'; 12 | import { host } from '../../config'; 13 | 14 | fetch.Promise = Promise; 15 | Response.Promise = Promise; 16 | 17 | function localUrl(url) { 18 | if (url.startsWith('//')) { 19 | return `https:${url}`; 20 | } 21 | 22 | if (url.startsWith('http')) { 23 | return url; 24 | } 25 | 26 | return `http://${host}${url}`; 27 | } 28 | 29 | function localFetch(url, options) { 30 | return fetch(localUrl(url), options); 31 | } 32 | 33 | export { localFetch as default, Request, Headers, Response }; 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # @deprecated 2 | 3 | # CodePush Web [source](https://github.com/lisong/code-push-web) 4 | 5 | CodePush Web is a [CodePush Server](https://github.com/lisong/code-push-server)'s web client. it's will more friendly then [code-push-cli](https://github.com/Microsoft/code-push) 6 | 7 | ## INSTALL 8 | 9 | ```shell 10 | $ cd /path/to/code-push-web 11 | $ npm install 12 | ``` 13 | 14 | ## CONFIGURE 15 | 16 | ``` shell 17 | $ vim ./src/config #change URL to production 18 | ``` 19 | 20 | ## RUN DEV 21 | 22 | ```shell 23 | $ npm start 24 | ``` 25 | 26 | ## BUILD AND RUN IN PRODUCTION 27 | 28 | ```shell 29 | $ cd /path/to/code-push-web 30 | $ npm run build -- --release 31 | $ cd ./build 32 | $ npm install 33 | $ node ./server.js 34 | ``` 35 | 36 | ## BASE ON [React Starter Kit](https://github.com/kriasoft/react-starter-kit) 37 | 38 | ## License 39 | MIT License [read](https://github.com/lisong/code-push-web/blob/master/LICENSE.txt) 40 | -------------------------------------------------------------------------------- /src/containers/LayoutContainer.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | 3 | import { connect } from 'react-redux'; 4 | import { bindActionCreators } from 'redux'; 5 | import _ from 'lodash'; 6 | import Header from '../components/Header'; 7 | import Footer from '../components/Footer'; 8 | import Layout from '../components/Layout'; 9 | import MsgStackContainer from './MsgStackContainer'; 10 | 11 | class LayoutContainer extends Component { 12 | render() { 13 | const {auth, actions } = this.props; 14 | return ( 15 | 16 |
19 | {this.props.children} 20 |