Skip to content

Commit

Permalink
Merge pull request #401 from adamwdraper/develop
Browse files Browse the repository at this point in the history
v 2.0.0
  • Loading branch information
adamwdraper authored Dec 6, 2016
2 parents b598d6e + ef3f916 commit c53250b
Show file tree
Hide file tree
Showing 162 changed files with 5,407 additions and 2,772 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "6"
- "node"
- "4"
before_script:
- npm install -g grunt-cli
Expand Down
52 changes: 36 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,40 @@ module.exports = function(grunt) {
'min/numeral.min.js' : [
'numeral.js'
],
'min/languages.min.js': [
'languages.js'
'min/locales.min.js': [
'locales.js'
],
'min/numeral-with-locales.min.js': [
'numeral-with-locales.js'
]
};

// all the lang files need to be added manually
fs.readdirSync('./languages').forEach(function (path) {
fs.readdirSync('./src/locales').forEach(function (path) {
var file = path.slice(0, -3),
destination = 'min/languages/' + file + '.min.js',
src = ['languages/' + path];
destination = 'min/locales/' + file + '.min.js',
src = ['src/locales/' + path];

minifiedFiles[destination] = src;
});

grunt.initConfig({
mochaTest : {
all: [
'tests/numeral/*.js',
'tests/languages/*.js'
'tests/numeral.js',
'tests/formats/*.js',
'tests/locales/*.js'
]
},
karma: {
options: {
files: [
'numeral.js',
'languages/*.js',
'tests/numeral/*.js',
'tests/languages/*.js'
'src/numeral.js',
'src/formats/*.js',
'src/locales/*.js',
'tests/numeral.js',
'tests/formats/*.js',
'tests/locales/*.js'
],
frameworks: [
'mocha',
Expand Down Expand Up @@ -61,18 +67,32 @@ module.exports = function(grunt) {
}
},
concat: {
languages: {
numeral: {
src: [
'src/numeral.js',
'src/formats/*.js'
],
dest: 'numeral.js'
},
locales: {
src: [
'src/locales/*.js'
],
dest: 'locales.js'
},
numeralWithLocales: {
src: [
'languages/*.js'
'src/numeral.js',
'src/formats/*.js',
'src/locales/*.js'
],
dest: 'languages.js'
dest: 'numeral-with-locales.js'
}
},
jshint: {
all: [
'Gruntfile.js',
'numeral.js',
'languages/*.js'
'src/**/*.js'
],
options: {
'node': true,
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Adam Draper
Copyright (c) 2016 Adam Draper

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand All @@ -19,4 +19,4 @@ 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.
OTHER DEALINGS IN THE SOFTWARE.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ See [the english unit tests](https://github.com/adamwdraper/Numeral-js/blob/mast

# Changelog

### 2.0.0

2.0.0 brings a lot of breaking changes and a reorganization of the repo, but also simplifies the api as well as the creating of custom formats.

Breaking change / Feature: All formats are now separate files. This makes it easy to create custom formats, and will also allow for custom builds with only certain formats. (Note: The built numeral.js still contains all formats in the repo).

Breaking change / Feature: All formats and locales are now loaded using `numeral.register(type, name, {})`

Breaking change: All `language` now renamed to `locale` and standardized to all lowercase filenames

Breaking change: The `locale` function no longer loads locales, it only sets the current locale

Breaking change: The `unformat` function has been removed `numeral().unformat(string)` and now happens on numeral init `numeral(string)`

Breaking change / Feature: Bytes are now formatted as: `b` (base 1000) and `ib` (base 1024)

Breaking change: `numeral(NaN)` is now treated the same as `numeral(null)` and no longer throws an error

Feature: Exponential format using `e+` or `e-`

Bug fix: Update to floating point helpers (Note: Numeral does not fix JS floating point errors, but look to our tests to see that it covers quite a few cases.)

### 1.5.6

Bug fix: numeral converts strings to numbers
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
"version": "1.5.6",
"version": "2.0.0",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
"version": "1.5.6",
"version": "2.0.0",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
Expand Down
34 changes: 0 additions & 34 deletions languages/de.js

This file was deleted.

38 changes: 0 additions & 38 deletions languages/no.js

This file was deleted.

67 changes: 0 additions & 67 deletions languages/tr.js

This file was deleted.

Loading

0 comments on commit c53250b

Please sign in to comment.