Skip to content

Commit 9e7853a

Browse files
committed
add banner to bundle; add bundle upon versioning; use p-s
1 parent a90f9b5 commit 9e7853a

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.banner.ejs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*! <%= pkg.name %> | <%= pkg.version %> | <%= pkg.homepage %> */

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ indent_style = tab
1616

1717
[*.md]
1818
trim_trailing_whitespace = false
19+
20+
[.banner.ejs]
21+
insert_final_newline = false

.package-scripts.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"scripts": {
3+
"build": "make mocha.js",
4+
"add-build": "git add mocha.js"
5+
}
6+
}
7+

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BROWSERIFY := "node_modules/.bin/browserify"
22
ESLINT := "node_modules/.bin/eslint"
33
KARMA := "node_modules/.bin/karma"
4+
BANNERIZE := "node_modules/.bin/bannerize"
45

56
REPORTER ?= spec
67
TM_BUNDLE = JavaScript\ mocha.tmbundle
@@ -17,6 +18,7 @@ mocha.js: $(SRC) $(SUPPORT)
1718
--ignore 'glob' \
1819
--ignore 'path' \
1920
--ignore 'supports-color' > $@
21+
@$(BANNERIZE) -b .banner.ejs mocha.js
2022

2123
clean:
2224
@printf "==> [Clean]\n"

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@
298298
"npm": ">= 1.4.x"
299299
},
300300
"scripts": {
301-
"test": "make test"
301+
"test": "make test",
302+
"start": "package-scripts --config .package-scripts.json",
303+
"preversion": "npm test",
304+
"version": "npm start build,add-build"
302305
},
303306
"dependencies": {
304307
"commander": "2.9.0",
@@ -314,6 +317,7 @@
314317
"to-iso-string": "0.0.2"
315318
},
316319
"devDependencies": {
320+
"bannerize": "^1.0.2",
317321
"browser-stdout": "^1.2.0",
318322
"browserify": "^13.0.0",
319323
"coffee-script": "^1.10.0",
@@ -326,6 +330,7 @@
326330
"karma-phantomjs-launcher": "^0.2.3",
327331
"karma-sauce-launcher": "^1.0.0",
328332
"karma-spec-reporter": "0.0.26",
333+
"p-s": "^1.0.2",
329334
"phantomjs": "1.9.8",
330335
"rimraf": "^2.5.2",
331336
"should": "^9.0.2",
@@ -351,5 +356,6 @@
351356
"glob": false,
352357
"path": false,
353358
"supports-color": false
354-
}
359+
},
360+
"homepage": "https://mochajs.org"
355361
}

0 commit comments

Comments
 (0)