summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README.md8
-rw-r--r--app.js3
-rwxr-xr-xbin/heroku4
-rwxr-xr-xbin/setup10
-rw-r--r--bower.json40
-rw-r--r--package.json8
7 files changed, 11 insertions, 63 deletions
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 80efdf76..8806b06c 100644
--- a/README.md
+++ b/README.md
@@ -44,16 +44,16 @@ 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` (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
@@ -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 12f9cc17..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
@@ -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/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 c3b71f1c..5203e54b 100644
--- a/package.json
+++ b/package.json
@@ -5,9 +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",
- "assets:install": "bower install",
+ "build:dev": "webpack --config webpack.config.js --progress --colors --watch",
+ "build:prod": "webpack --config webpack.production.js --progress --colors",
"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",
@@ -156,7 +153,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",