Move package.json/webpack.config to top level

This commit is contained in:
Arik Fraimovich
2017-01-15 10:13:34 +02:00
parent 8f1750b9f0
commit 8f53274f17
5 changed files with 10 additions and 11 deletions

View File

@@ -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)

View File

@@ -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/

View File

@@ -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": {

View File

@@ -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';
}