From 8f53274f17e9f0f484aaccdbb01b59810b0132b9 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 15 Jan 2017 10:13:34 +0200 Subject: [PATCH 1/2] Move package.json/webpack.config to top level --- Makefile | 6 +++--- circle.yml | 2 +- client/npm-shrinkwrap.json => npm-shrinkwrap.json | 0 client/package.json => package.json | 5 ++--- client/webpack.config.js => webpack.config.js | 8 ++++---- 5 files changed, 10 insertions(+), 11 deletions(-) rename client/npm-shrinkwrap.json => npm-shrinkwrap.json (100%) rename client/package.json => package.json (93%) rename client/webpack.config.js => webpack.config.js (95%) diff --git a/Makefile b/Makefile index 3396f885af..3ffdcabb40 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,12 @@ BASE_VERSION=$(shell python ./manage.py version | cut -d + -f 1) FILENAME=$(CIRCLE_ARTIFACTS)/$(NAME).$(VERSION).tar.gz deps: - if [ -d "./client/app" ]; then cd client && npm install; fi - if [ -d "./client/app" ]; then cd client && npm run build; fi + if [ -d "./client/app" ]; npm install; fi + if [ -d "./client/app" ]; npm run build; fi pack: sed -ri "s/^__version__ = '([0-9.]*)'/__version__ = '$(FULL_VERSION)'/" redash/__init__.py - tar -zcv -f $(FILENAME) --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="client/node_modules" --exclude="client/app" * + tar -zcv -f $(FILENAME) --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" --exclude="client/app" * upload: python bin/release_manager.py $(CIRCLE_SHA1) $(BASE_VERSION) $(FILENAME) diff --git a/circle.yml b/circle.yml index 195e34167a..62057e47ff 100644 --- a/circle.yml +++ b/circle.yml @@ -15,7 +15,7 @@ dependencies: - pip install pymongo==3.2.1 - make deps cache_directories: - - client/node_modules/ + - node_modules/ test: override: - nosetests --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/junit.xml --with-coverage --cover-package=redash tests/ diff --git a/client/npm-shrinkwrap.json b/npm-shrinkwrap.json similarity index 100% rename from client/npm-shrinkwrap.json rename to npm-shrinkwrap.json diff --git a/client/package.json b/package.json similarity index 93% rename from client/package.json rename to package.json index 40ef8574a4..08ee227b42 100644 --- a/client/package.json +++ b/package.json @@ -1,12 +1,11 @@ { - "name": "redash-frontend", + "name": "redash-client", "version": "1.0.0", "description": "The frontend part of Redash.", "main": "index.js", "scripts": { - "test": "NODE_ENV=test karma start", "start": "webpack-dev-server --content-base app", - "build": "rm -rf dist/ && NODE_ENV=production node node_modules/.bin/webpack", + "build": "rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack", "watch": "webpack --watch --progress --colors -d" }, "repository": { diff --git a/client/webpack.config.js b/webpack.config.js similarity index 95% rename from client/webpack.config.js rename to webpack.config.js index 5796d316f8..33c3807f8e 100644 --- a/client/webpack.config.js +++ b/webpack.config.js @@ -9,11 +9,11 @@ var path = require('path'); var config = { entry: { - app: './app/index.js' + app: './client/app/index.js' }, output: { // path: process.env.NODE_ENV === 'production' ? './dist' : './dev', - path: './dist', + path: './client/dist', filename: '[name].[chunkhash].js', }, @@ -44,7 +44,7 @@ var config = { }), new HtmlWebpackPlugin({ // template: __dirname + '/app/' + 'index.html' - template: './app/index.html' + template: './client/app/index.html' }), new ExtractTextPlugin('styles.[chunkhash].css') ], @@ -102,7 +102,7 @@ var config = { }; if (process.env.NODE_ENV === 'production') { - config.output.path = __dirname + '/dist'; + config.output.path = __dirname + '/client/dist'; config.plugins.push(new webpack.optimize.UglifyJsPlugin()); config.devtool = 'source-map'; } From 09542138cc04f2bb7386930a53db271c514c74b3 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 15 Jan 2017 10:16:04 +0200 Subject: [PATCH 2/2] Add missing then --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3ffdcabb40..a059280b1d 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ BASE_VERSION=$(shell python ./manage.py version | cut -d + -f 1) FILENAME=$(CIRCLE_ARTIFACTS)/$(NAME).$(VERSION).tar.gz deps: - if [ -d "./client/app" ]; npm install; fi - if [ -d "./client/app" ]; npm run build; fi + if [ -d "./client/app" ]; then npm install; fi + if [ -d "./client/app" ]; then npm run build; fi pack: sed -ri "s/^__version__ = '([0-9.]*)'/__version__ = '$(FULL_VERSION)'/" redash/__init__.py