Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Move NodeJS-related scripts from Makefile to package.json
Browse files Browse the repository at this point in the history
The Makefile then is simply a dumb wrapper that calls commands defined in the
`package.json` or `tox.ini`, depending if it's JavaScript or Python. This
allows us to rely on their respective package manager to run the correct
version of each executable (avoiding having to mess with $PATH).

I also changed the testing NODE_ENV to "test", as it's the most common name.
  • Loading branch information
vitorbaptista committed Jan 4, 2018
1 parent 05d229f commit 6fb7638
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

.DEFAULT_GOAL := help

export PATH := $(PATH):./node_modules/.bin

PACKAGE := $(shell grep '^PACKAGE =' setup.py | cut -d "'" -f2)
REPOSITORY := 'frictionlessdata/goodtables.io'
SHELL := /bin/bash
Expand All @@ -28,23 +26,23 @@ lint-backend: ## Run lint checker on the backend app
tox -e lint

lint-frontend: ## Run lint checker on frontend app
eslint --ext js,vue frontend
npm run lint

lint: lint-backend lint-frontend ## Run all lint checkers

test-unit-backend: ## Run the unit tests for the backend app
tox

test-unit-frontend: ## Run the unit tests for the frontend app
NODE_ENV=testing karma start
npm test

test-unit-frontend-watch: ## Run the unit tests for the frontend app
NODE_ENV=testing karma start --auto-watch --no-single-run
npm run test:watch

test-unit: test-unit-backend test-unit-frontend ## Run all tests

test-e2e: ## Run end to end tests
NODE_ENV=testing node rune2e.js
npm run test:e2e

test: lint test-unit test-e2e ## Run all tests

Expand Down Expand Up @@ -72,13 +70,13 @@ migrate: ## Run database migrations for the app
alembic upgrade head

frontend: ## Compile the frontend assets
NODE_ENV=production webpack --progress --hide-modules
npm run build

frontend-dev: ## Compile the frontend assets for development
webpack --output-pathinfo --progress --hide-modules
npm run build:dev

frontend-watch: ## Compile the frontend assets for development using watch mode
webpack --output-pathinfo --progress --hide-modules --watch
npm run build:watch

app: ## Serve the app with Gunicorn
gunicorn goodtablesio.app:app --config gunicorn_settings.py
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
"version": "0.0.0",
"description": "Continuous data validation, as a service.",
"license": "AGPL-3.0",
"scripts": {
"test": "NODE_ENV=test karma start",
"test:e2e": "NODE_ENV=test node rune2e.js",
"test:watch": "NODE_ENV=test karma start --auto-watch --no-single-run",
"lint": "eslint --ext js,vue frontend",
"build": "NODE_ENV=production webpack --progress --hide-modules",
"build:dev": "webpack --output-pathinfo --progress --hode-modules",
"build:watch": "webpack --output-pathinfo --progress --hide-modules --watch"
},
"dependencies": {
"axios": "^0.15.3",
"goodtables": "^0.7.2",
Expand Down

0 comments on commit 6fb7638

Please sign in to comment.