From 65a1a62cc0791cbf88a626d3cccf6fbe7bd1966e Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Sat, 10 Dec 2016 22:09:50 +0800 Subject: Drop nodemon dependency Sometimes nodemon not reload source code correctly, so simply drop it. --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index c3b71f1c..eab454ad 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "app.js", "license": "MIT", "scripts": { - "dev": "webpack --config webpack.config.js --progress --colors --watch & nodemon --delay 1 app.js", "build": "webpack --config webpack.production.js --progress --colors", + "dev": "webpack --config webpack.config.js --progress --colors --watch", "assets:install": "bower install", "postinstall": "bin/heroku", "start": "node app.js" @@ -156,7 +156,6 @@ "json-loader": "^0.5.4", "less": "^2.7.1", "less-loader": "^2.2.3", - "nodemon": "^1.11.0", "optimize-css-assets-webpack-plugin": "^1.3.0", "script-loader": "^0.7.0", "style-loader": "^0.13.1", -- cgit v1.2.3 From ed83dfc862768572eab0c2aed629b1700ac9e224 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Sat, 10 Dec 2016 22:12:07 +0800 Subject: Rename npm script webpack scripts are meant to “build” assets, so place them under the same namespace * dev => build:dev * build => build:prod --- README.md | 2 +- bin/heroku | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 80efdf76..78ff6381 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Get started 2. Enter the directory and type `bin/setup`, which will install npm/bower dependencies and create configs. The setup script is written in Bash, you would need bash as a prerequisite. 3. Setup the configs, see more below 4. Setup environment variables which will overwrite the configs -5. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development) +5. Build front-end bundle by `npm run build:prod` (use `npm run build:dev` if you are in development) 6. Run the server as you like (node, forever, pm2) Upgrade guide diff --git a/bin/heroku b/bin/heroku index 12f9cc17..9c06c274 100755 --- a/bin/heroku +++ b/bin/heroku @@ -31,5 +31,5 @@ EOF cp public/js/config.js.example public/js/config.js # build app - npm run build + npm run build:prod fi diff --git a/package.json b/package.json index eab454ad..4c7cbb1c 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "app.js", "license": "MIT", "scripts": { - "build": "webpack --config webpack.production.js --progress --colors", - "dev": "webpack --config webpack.config.js --progress --colors --watch", + "build:dev": "webpack --config webpack.config.js --progress --colors --watch", + "build:prod": "webpack --config webpack.production.js --progress --colors", "assets:install": "bower install", "postinstall": "bin/heroku", "start": "node app.js" -- cgit v1.2.3 From 9e6fd505e12c21e60347501132e1f473b61942b3 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Sun, 11 Dec 2016 10:31:51 +0800 Subject: Remove bower occurences --- .gitignore | 1 - README.md | 6 +++--- app.js | 3 +-- bin/heroku | 2 +- bin/setup | 10 ++-------- bower.json | 40 ---------------------------------------- package.json | 3 --- 7 files changed, 7 insertions(+), 58 deletions(-) delete mode 100644 bower.json diff --git a/.gitignore b/.gitignore index 36c1efd8..f48b3c6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules -bower_components composer.phar composer.lock .env.*.php diff --git a/README.md b/README.md index 78ff6381..8806b06c 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,13 @@ Prerequisite - Node.js 4.x or up (test up to 6.7.0) - Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset `utf8` -- npm and bower +- npm Get started --- 1. Download a release and unzip or clone into a directory -2. Enter the directory and type `bin/setup`, which will install npm/bower dependencies and create configs. The setup script is written in Bash, you would need bash as a prerequisite. +2. Enter the directory and type `bin/setup`, which will install npm dependencies and create configs. The setup script is written in Bash, you would need bash as a prerequisite. 3. Setup the configs, see more below 4. Setup environment variables which will overwrite the configs 5. Build front-end bundle by `npm run build:prod` (use `npm run build:dev` if you are in development) @@ -63,7 +63,7 @@ If you are upgrading HackMD from an older version, follow these steps: 1. Fully stop your old server first (important) 2. `git pull` or do whatever that updates the files -3. `npm install && bower install` to update dependencies +3. `npm install` to update dependencies 4. Modify the file named `.sequelizerc`, change the value of the variable `url` with your db connection string For example: `postgres://username:password@localhost:5432/hackmd` 5. Run `node_modules/.bin/sequelize db:migrate`, this step will migrate your db to the latest schema diff --git a/app.js b/app.js index 1b2874a4..776ad8d0 100644 --- a/app.js +++ b/app.js @@ -113,7 +113,6 @@ app.use(i18n.init); // routes without sessions // static files app.use('/', express.static(__dirname + '/public', { maxAge: config.staticcachetime })); -app.use('/vendor/', express.static(__dirname + '/bower_components', { maxAge: config.staticcachetime })); //session app.use(session({ @@ -479,7 +478,7 @@ app.post('/uploadimage', function (req, res) { } else { if (config.debug) logger.info('SERVER received uploadimage: ' + JSON.stringify(files.image)); - + try { switch (config.imageUploadType) { case 'filesystem': diff --git a/bin/heroku b/bin/heroku index 9c06c274..f30b2b23 100755 --- a/bin/heroku +++ b/bin/heroku @@ -3,7 +3,7 @@ set -e if [ "$BUILD_ASSETS" = true ]; then - BUILD_ASSETS=false npm install && npm run assets:install + BUILD_ASSETS=false npm install # setup config files cat << EOF > .sequelizerc diff --git a/bin/setup b/bin/setup index 19edeecf..e24d4de7 100755 --- a/bin/setup +++ b/bin/setup @@ -16,12 +16,6 @@ EOF exit 0 fi -if ! type bower > /dev/null -then - echo "bower is not installed, install via npm" - npm install -g bower -fi - echo "copy config files" if [ ! -f config.json ]; then cp config.json.example config.json @@ -35,8 +29,8 @@ if [ ! -f .sequelizerc ]; then cp .sequelizerc.example .sequelizerc fi -echo "install npm and bower packages" -BUILD_ASSETS=false npm install && bower install +echo "install npm packages" +BUILD_ASSETS=false npm install cat << EOF diff --git a/bower.json b/bower.json deleted file mode 100644 index c0ebef6e..00000000 --- a/bower.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "hackmd", - "description": "Realtime collaborative markdown notes on all platforms.", - "main": "app.js", - "license": "MIT", - "homepage": "https://github.com/hackmdio/hackmd", - "moduleType": [ - "node" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "bootstrap": "~3.3.7", - "font-awesome": "~4.6.3", - "Ionicons": "ionicons#~2.0.1", - "reveal.js": "~3.3.0", - "spin.js": "~2.3.2", - "moment": "~2.15.1", - "handlebars": "~4.0.5", - "js-yaml": "~3.6.1", - "raphael": "~2.2.6", - "mermaid": "^6.0.0", - "MathJax": "^2.7.0", - "octicons": "~3.5.0", - "velocity": "^1.3.1", - "randomcolor": "randomColor#^0.4.4", - "Idle.Js": "idle.js#^1.0.0", - "gist-embed": "*", - "emojify.js": "^1.1.0", - "select2": "3.5.4" - }, - "resolutions": { - "jquery": "~3.1.1" - } -} diff --git a/package.json b/package.json index 4c7cbb1c..5203e54b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "scripts": { "build:dev": "webpack --config webpack.config.js --progress --colors --watch", "build:prod": "webpack --config webpack.production.js --progress --colors", - "assets:install": "bower install", "postinstall": "bin/heroku", "start": "node app.js" }, @@ -142,8 +141,6 @@ "devDependencies": { "babel-core": "^6.17.0", "babel-loader": "^6.2.5", - "bower": "^1.7.9", - "bower-webpack-plugin": "^0.1.9", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.25.0", "ejs-loader": "^0.3.0", -- cgit v1.2.3