From f197aaac9937fc22bf6bbb7fb020e85bf31bf142 Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Mon, 13 Feb 2017 21:27:00 -0200 Subject: [PATCH 1/4] fix webpack prod config --- .../donation/components/__donation__/index.scss | 4 ++-- tools/webpack.client.prod.js | 8 +++++++- tools/webpack.server.prod.js | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/client/mobilizations/widgets/__plugins__/donation/components/__donation__/index.scss b/client/mobilizations/widgets/__plugins__/donation/components/__donation__/index.scss index e544fa9d2d..48e0461bae 100644 --- a/client/mobilizations/widgets/__plugins__/donation/components/__donation__/index.scss +++ b/client/mobilizations/widgets/__plugins__/donation/components/__donation__/index.scss @@ -8,7 +8,7 @@ .icon-payment-recurring, .icon-payment-unique { - background: 50% 50% url('../../images/donation-recurring.png') transparent no-repeat; + background: 50% 50% url('./../../images/donation-recurring.png') transparent no-repeat; background-size: contain; width: 2.2rem; height: 2.2rem; @@ -20,7 +20,7 @@ } .icon-payment-unique { - background-image: url('../../images/donation-unique.png'); + background-image: url('./../../images/donation-unique.png'); } diff --git a/tools/webpack.client.prod.js b/tools/webpack.client.prod.js index 8f7a048aeb..d071eb82b6 100644 --- a/tools/webpack.client.prod.js +++ b/tools/webpack.client.prod.js @@ -76,7 +76,13 @@ module.exports = { { test: /\.(scss|sass)$/, loader: ExtractTextPlugin.extract('style-loader', ['css-loader?sourceMap', 'postcss-loader?parser=postcss-scss', 'sass-loader?sourceMap']) - } + }, + { + test: /\.(png|otf.*|eot.*|ttf.*|woff.*|woff2.*)$/, + loader: 'file?name=[path][sha512:hash:base64:7].[ext]' + }, + { test: /\.svg/, loader: 'svg-url' } + ] } } diff --git a/tools/webpack.server.prod.js b/tools/webpack.server.prod.js index ea2db42928..dbc1b89355 100644 --- a/tools/webpack.server.prod.js +++ b/tools/webpack.server.prod.js @@ -47,7 +47,12 @@ module.exports = { { test: /\.(scss|sass)$/, loader: ExtractTextPlugin.extract('style-loader', ['css-loader?sourceMap', 'postcss-loader?parser=postcss-scss', 'sass-loader?sourceMap']) - } + }, + { + test: /\.(png|otf.*|eot.*|ttf.*|woff.*|woff2.*)$/, + loader: 'file?name=[path][sha512:hash:base64:7].[ext]' + }, + { test: /\.svg/, loader: 'svg-url' } ] }, postcss: function() { From 4228a719a2de0769cdb4a9944658366a6db047ab Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Mon, 13 Feb 2017 21:27:25 -0200 Subject: [PATCH 2/4] update docker config --- Dockerfile.dev | 2 +- docker-compose.yml | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index bb2376f997..ffdc4d0c4b 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -12,6 +12,6 @@ RUN npm install COPY . /code RUN npm run build -CMD ["node", "./bin/server"] +CMD ["node", "-r", "babel-register", "./server"] EXPOSE 5001 3030 diff --git a/docker-compose.yml b/docker-compose.yml index e1c1a72352..9ccbbbf7b1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,8 @@ volumes: # development image build process: app-gems: driver: local + node-modules: + driver: local services: # Our PostgreSQL service: @@ -21,14 +23,7 @@ services: # our database IDEs with it: - 5432:5432 volumes: - # Mount the DB dumps folder into the container, to be able to create & access database dumps: - - ./db/dumps:/db/dumps:Z - # Mount out tmp folder, we might want to have access to something there during development: - - ./tmp:/tmp:Z - # Mount our 'restoredb' script: - - ./bin/restoredb:/bin/restoredb:ro - # Mount our 'dumpdb' script: - - ./bin/dumpdb:/bin/dumpdb:ro + - ./bin/init.sql:/docker-entrypoint-initdb.d/init.sql # We'll mount the 'postgres-data' volume into the location Postgres stores it's data: - postgres-data:/var/lib/postgresql/data environment: @@ -111,7 +106,8 @@ services: # command: rails server -p 3000 -b 0.0.0.0 ports: - "3000:3000" # Bind our host's port 3000 to the app port 3000: - + env_file: + - ../bonde-server/.env # App Guard: Keeps running tests on a separate process: test: # We'll copy from &app_base, and override: @@ -128,12 +124,15 @@ services: client: depends_on: - api - command: ./node_modules/.bin/nodemon -r 'babel-register' ./server --watch ./server --watch ./tests/server volumes: - ./:/code:Z + - node-modules:/code/node_modules ports: - "3001:3001" - build: . + - "3002:3002" + build: + context: . + dockerfile: Dockerfile.dev restart: always links: - api:api.bonde.devel From b93a022ca31826d24b7de91365f75bd492736c6c Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Tue, 14 Feb 2017 11:11:08 -0200 Subject: [PATCH 3/4] Change how limit memory usage in tests --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 37193d8948..d916092401 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "description": "Universal JS app", "scripts": { - "test": "BABEL_DISABLE_CACHE=1 ./node_modules/.bin/jest --config ./tools/jest.config.json --runInBand", + "test": "BABEL_DISABLE_CACHE=1 ./node_modules/.bin/jest --config ./tools/jest.config.json -w=1", "test:a": "BABEL_DISABLE_CACHE=1 ./node_modules/.bin/jest --config ./tools/jest.config.json", "test:w": "yarn test:a -- --watch", "coverage": "nyc npm test", From aa6efd11b59e2efab4d8461b304161ef13f1de8a Mon Sep 17 00:00:00 2001 From: Lucas Pirola Date: Tue, 14 Feb 2017 11:50:35 -0200 Subject: [PATCH 4/4] limit node memory --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb6e6ae945..8d42f9cf81 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "description": "Universal JS app", "scripts": { - "test": "BABEL_DISABLE_CACHE=1 ./node_modules/.bin/jest --config ./tools/jest.config.json -w=1", + "test": "BABEL_DISABLE_CACHE=1 node --max_old_space_size=2048 ./node_modules/.bin/jest --config ./tools/jest.config.json --maxWorkers=2", "test:a": "BABEL_DISABLE_CACHE=1 ./node_modules/.bin/jest --config ./tools/jest.config.json", "test:w": "yarn test:a -- --watch", "coverage": "nyc npm test",