Skip to content

Commit

Permalink
Merge pull request #190 from recurly/build
Browse files Browse the repository at this point in the history
Reworks build and updates components
  • Loading branch information
Rich Smith committed Mar 18, 2015
2 parents b5ab08d + 7cbcd42 commit a387f51
Show file tree
Hide file tree
Showing 49 changed files with 338 additions and 96 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ npm-debug.log

components/duo.json

build

test/build.js
test/components
test/server/pid.txt

/recurly.js
/recurly.min.js
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
BIN = node_modules/.bin
DUO = $(BIN)/duo
MINIFY = $(BIN)/uglifyjs
WATCH = $(BIN)/wr
DELEGATE = test test-browser test-sauce test-coverage

recurly.js: node_modules
@$(DUO) --global recurly --stdout index.js > recurly.js
@$(MINIFY) recurly.js --output recurly.min.js
BUILD = ./build
WATCH_FILES = lib index.js component.json Makefile

build: node_modules
@mkdir -p $(BUILD)
@$(DUO) --quiet --stdout --global recurly index.js > $(BUILD)/recurly.js
@$(MINIFY) $(BUILD)/recurly.js --output $(BUILD)/recurly.min.js

watch: node_modules
@$(WATCH) make $(WATCH_FILES)

node_modules: package.json
@npm install --silent

$(DELEGATE): recurly.js
$(DELEGATE): build
@cd test && make $@

clean:
@rm -rf node_modules recurly.js recurly.min.js
@rm -rf node_modules components/duo.json $(BUILD)
@cd test && make $@

.PHONY: recurly.js
.PHONY: clean test test-browser
.PHONY: test-sauce test-coverage
.PHONY: clean build test test-browser test-sauce test-coverage
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"webmodules/jsonp": "0.0.4",
"yields/cors-xhr": "1.0.1",
"yields/merge": "1.0.0",
"visionmedia/debug": "2.1.0",
"visionmedia/debug": "2.1.3",
"then/promise": "6.0.0",
"kewah/mixin": "0.1.0",
"pluma/par": "0.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

2.0.6 / 2015-01-29
==================

* package: fix "browserify" usage
* Remove unused dependency (#16, @Raynos)

2.0.5 / 2014-05-27
==================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "to-function",
"repo": "component/to-function",
"description": "Convert property access strings into functions",
"version": "2.0.5",
"version": "2.0.6",
"keywords": [
"utility",
"function"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"name": "to-function",
"repo": "component/to-function",
"description": "Convert property access strings into functions",
"version": "2.0.5",
"version": "2.0.6",
"keywords": [
"utility"
],
"dependencies": {
"component-props": "*",
"remove-try-require": "0.0.0"
"component-props": "*"
},
"scripts": {
"test": "make test"
Expand All @@ -18,10 +17,8 @@
"mocha": "*",
"should": "*"
},
"browserify": {
"transform": [
"remove-try-require"
]
"browser": {
"props": "component-props"
},
"component": {
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@

0.7.0 / 2014-11-24
==================

* add time abbreviations, updated tests and readme for the new units
* fix example in the readme.
* add LICENSE file

0.6.2 / 2013-12-05
==================

* Adding repository section to package.json to suppress warning from NPM.

0.6.1 / 2013-05-10
==================

Expand Down
20 changes: 20 additions & 0 deletions components/rauchg-ms.js@0.7.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(The MIT License)

Copyright (c) 2014 Guillermo Rauch <rauchg@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# ms.js: miliseconds conversion utility

```js
ms('2 days') // 172800000
ms('1d') // 86400000
ms('10h') // 36000000
ms('2.5 hrs') // 9000000
ms('2h') // 7200000
ms('1m') // 60000
ms('5s') // 5000
Expand All @@ -18,10 +20,10 @@ ms(ms('10 hours')) // "10h"
```js
ms(60000, { long: true }) // "1 minute"
ms(2 * 60000, { long: true }) // "2 minutes"
ms(ms('10 hours', { long: true })) // "10 hours"
ms(ms('10 hours'), { long: true }) // "10 hours"
```

- Node/Browser compatible. Published as `ms` in NPM.
- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download).
- If a number is supplied to `ms`, a string with a unit is returned.
- If a string that contains the number is supplied, it returns it as
a number (e.g: it returns `100` for `'100'`).
Expand All @@ -30,4 +32,4 @@ equivalent ms is returned.

## License

MIT
MIT
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ module.exports = function(val, options){
*/

function parse(str) {
var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) return;
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
Expand All @@ -53,16 +55,26 @@ function parse(str) {
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "ms",
"version": "0.6.1",
"version": "0.7.0",
"description": "Tiny ms conversion utility",
"repository": {
"type": "git",
"url": "git://github.com/guille/ms.js.git"
},
"main": "./index",
"devDependencies": {
"mocha": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe('ms(string)', function(){
expect(ms('1.5h')).to.be(5400000);
});

it('should work with multiple spaces', function () {
expect(ms('1 s')).to.be(1000);
});

it('should return NaN if invalid', function () {
expect(isNaN(ms('☃'))).to.be(true);
});
Expand All @@ -52,6 +56,38 @@ describe('ms(string)', function(){
});
})

// long strings

describe('ms(long string)', function(){
it('should convert milliseconds to ms', function () {
expect(ms('53 milliseconds')).to.be(53);
});

it('should convert msecs to ms', function () {
expect(ms('17 msecs')).to.be(17);
});

it('should convert sec to ms', function () {
expect(ms('1 sec')).to.be(1000);
});

it('should convert from min to ms', function () {
expect(ms('1 min')).to.be(60000);
});

it('should convert from hr to ms', function () {
expect(ms('1 hr')).to.be(3600000);
});

it('should convert days to ms', function () {
expect(ms('2 days')).to.be(172800000);
});

it('should work with decimals', function () {
expect(ms('1.5 hours')).to.be(5400000);
});
})

// numbers

describe('ms(number, { long: true })', function(){
Expand Down
17 changes: 0 additions & 17 deletions components/visionmedia-debug@2.1.0/example/stderr.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,34 +1,63 @@

2.1.3 / 2015-03-13
==================

* Updated stdout/stderr example (#186)
* Updated example/stdout.js to match debug current behaviour
* Renamed example/stderr.js to stdout.js
* Update Readme.md (#184)
* replace high intensity foreground color for bold (#182, #183)

2.1.2 / 2015-03-01
==================

* dist: recompile
* update "ms" to v0.7.0
* package: update "browserify" to v9.0.3
* component: fix "ms.js" repo location
* changed bower package name
* updated documentation about using debug in a browser
* fix: security error on safari (#167, #168, @yields)

2.1.1 / 2014-12-29
==================

* browser: use `typeof` to check for `console` existence
* browser: check for `console.log` truthiness (fix IE 8/9)
* browser: add support for Chrome apps
* Readme: added Windows usage remarks
* Add `bower.json` to properly support bower install

2.1.0 / 2014-10-15
==================

* node: implement `DEBUG_FD` env variable support
* package: update "browserify" to v6.1.0
* package: add "license" field to package.json (#135, @panuhorsmalahti)
* node: implement `DEBUG_FD` env variable support
* package: update "browserify" to v6.1.0
* package: add "license" field to package.json (#135, @panuhorsmalahti)

2.0.0 / 2014-09-01
==================

* package: update "browserify" to v5.11.0
* node: use stderr rather than stdout for logging (#29, @stephenmathieson)
* package: update "browserify" to v5.11.0
* node: use stderr rather than stdout for logging (#29, @stephenmathieson)

1.0.4 / 2014-07-15
==================

* dist: recompile
* example: remove `console.info()` log usage
* example: add "Content-Type" UTF-8 header to browser example
* browser: place %c marker after the space character
* browser: reset the "content" color via `color: inherit`
* browser: add colors support for Firefox >= v31
* debug: prefer an instance `log()` function over the global one (#119)
* Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
* dist: recompile
* example: remove `console.info()` log usage
* example: add "Content-Type" UTF-8 header to browser example
* browser: place %c marker after the space character
* browser: reset the "content" color via `color: inherit`
* browser: add colors support for Firefox >= v31
* debug: prefer an instance `log()` function over the global one (#119)
* Readme: update documentation about styled console logs for FF v31 (#116, @wryk)

1.0.3 / 2014-07-09
==================

* Add support for multiple wildcards in namespaces (#122, @seegno)
* browser: fix lint
* Add support for multiple wildcards in namespaces (#122, @seegno)
* browser: fix lint

1.0.2 / 2014-06-10
==================
Expand Down
File renamed without changes.
Loading

0 comments on commit a387f51

Please sign in to comment.