Skip to content

Commit

Permalink
[update] Pull scripts into makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed May 5, 2015
1 parent 07f2e5d commit 4244c56
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 35 deletions.
5 changes: 3 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"stage": 1,
"loose": ["es6.modules", "es6.classes"],
"sourceMaps" : "inline"
"loose": true,
"sourceMaps": "inline",
"blacklist" : [ "strict" ]
}
57 changes: 57 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
BABEL = $$(npm bin)/babel
SASS = $$(npm bin)/node-sass
WATCH = $$(npm bin)/watch
WEBPACK = $$(npm bin)/webpack

.PHONY: clean test test-coverage build package.json javascript docs release example

build:
make clean
make javascript
make sass
make package.json
make docs

javascript: $(shell find src -name '*.js*' ! -name '*.test.js*') $(shell find addons -name '*.js*' ! -name '*.test.js*')
mkdir -p dist
$(BABEL) -d dist $^

sass:
mkdir -p dist
cp -r style dist/style
$(SASS) ./dist/style/colonel.scss --stdout > dist/colonel-kurtz.css

sass-watch:
$(WATCH) 'make sass' style

package.json:
node -p 'p=require("./package");p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > dist/package.json

docs:
cp README.md dist/README.md
cp LICENSE.md dist/LICENSE.md
cp -r docs dist/docs

release:
make build
make test-once
npm publish dist

example:
open example/index.html
$(WEBPACK) -wd

clean:
rm -rf dist

test:
export NODE_ENV=test
$$(npm bin)/karma start

test-once:
export CONTINUOUS_INTEGRATION=true
make test

test-coverage:
make test-once
coveralls < coverage/report-lcov/lcov.info
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "colonel-kurtz",
"version": "2.15.0",
"version": "2.16.0-alpha",
"description": "A block editor",
"main": "src/Colonel.js",
"scripts": {
"start": "webpack -wd",
"prepublish": "./scripts/prepublish",
"release": "./scripts/release",
"test": "NODE_ENV=test karma start",
"test:once": "CONTINUOUS_INTEGRATION=true npm test",
"coveralls": "npm run test:once && coveralls < coverage/report-lcov/lcov.info",
"sass": "node-sass ./example/example.scss --stdout | autoprefixer > ./example/example.css",
"sass:watch": "watch 'npm run sass' style"
"start": "make example",
"prepublish": "make build",
"release": "make release",
"test": "make test",
"coveralls": "make test-coverage",
"sass": "make sass",
"sass:watch": "make sass-watch"
},
"repository": {
"type": "git",
Expand Down
20 changes: 0 additions & 20 deletions scripts/prepublish

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/release

This file was deleted.

0 comments on commit 4244c56

Please sign in to comment.