ember-cli-numeral
Advanced tools
Comparing version 0.1.2 to 0.2.0
58
index.js
'use strict'; | ||
var path = require('path'); | ||
module.exports = { | ||
name: 'ember-cli-numeral', | ||
blueprintsPath: function() { | ||
return path.join(__dirname, 'blueprints'); | ||
options: { | ||
nodeAssets: { | ||
numeral: function() { | ||
var numeralImport = 'numeral.js'; | ||
if (this.hasShimAMDSupport) { | ||
numeralImport = { | ||
path: 'numeral.js', | ||
using: [{ transformation: 'amd', as: 'numeral' }] | ||
}; | ||
} | ||
var filesToImport = [numeralImport]; | ||
if (this.includeLanguages) { | ||
filesToImport.push('languages.js'); | ||
} | ||
return { import: filesToImport }; | ||
} | ||
} | ||
}, | ||
included: function(app) { | ||
this._super.included(app); | ||
this.app.import(app.bowerDirectory + '/numeral/numeral.js'); | ||
this.app.import('vendor/shims/amd.js', { | ||
exports: { | ||
numeral: [ | ||
'default' | ||
] | ||
} | ||
}); | ||
included: function(app, parentAddon) { | ||
var target = (parentAddon || app); | ||
this.hasShimAMDSupport = ('amdModuleNames' in target); | ||
target.options = target.options || { }; | ||
target.options.numeral = target.options.numeral || { includeLanguages: false }; | ||
this.includeLanguages = target.options.numeral.includeLanguages; | ||
this._super.included.call(this, target); | ||
if (!this.hasShimAMDSupport) { | ||
target.import('vendor/shims/numeral-amd.js', { | ||
exports: { | ||
type: 'vendor', | ||
numeral: [ | ||
'default' | ||
] | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
}; |
{ | ||
"name": "ember-cli-numeral", | ||
"version": "0.1.2", | ||
"description": "ember-cli addon support for Numeral.js", | ||
"version": "0.2.0", | ||
"description": "ES6 accessible module for Numeral.js within your Ember applications.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "ember build", | ||
"start": "ember server", | ||
"test": "ember try:each" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jayphelps/ember-cli-numeral.git" | ||
}, | ||
"repository": "http://github.com/josemarluedke/ember-cli-numeral", | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"author": "Jay Phelps <hello@jayphelps.com>", | ||
"author": "Jay Phelps <hello@jayphelps.com>; Josemar Luedke <josemarluedke@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jayphelps/ember-cli-numeral/issues" | ||
"homepage": "https://github.com/josemarluedke/ember-cli-numeral", | ||
"dependencies": { | ||
"ember-cli-node-assets": "^0.1.4", | ||
"numeral": "^1.5.3" | ||
}, | ||
"homepage": "https://github.com/jayphelps/ember-cli-numeral" | ||
"devDependencies": { | ||
"ember-cli-babel": "^5.1.7", | ||
"ember-cli": "2.10.0-beta.2", | ||
"ember-cli-dependency-checker": "^1.3.0", | ||
"ember-cli-htmlbars": "^1.0.10", | ||
"ember-cli-jshint": "^2.0.1", | ||
"ember-cli-qunit": "^3.0.1", | ||
"ember-cli-test-loader": "^1.1.0", | ||
"ember-disable-prototype-extensions": "^1.1.0", | ||
"ember-load-initializers": "^0.5.1", | ||
"ember-resolver": "^2.0.3", | ||
"loader.js": "^4.0.10" | ||
}, | ||
"engines": { | ||
"node": ">= 0.12.0" | ||
}, | ||
"ember-addon": { | ||
"configPath": "tests/dummy/config" | ||
} | ||
} |
@@ -1,15 +0,16 @@ | ||
ember-cli-numeral | ||
================= | ||
# ember-cli-numeral | ||
[![Build Status](https://travis-ci.org/josemarluedke/ember-cli-numeral.svg?branch=master)](https://travis-ci.org/josemarluedke/ember-cli-numeral) | ||
[![Ember Observer Score](https://emberobserver.com/badges/ember-cli-numeral.svg)](https://emberobserver.com/addons/ember-cli-numeral) | ||
[![NPM Version](https://img.shields.io/npm/v/ember-cli-numeral.svg?style=flat-square)](https://www.npmjs.com/package/ember-cli-numeral) | ||
[![Ember badge](https://embadge.io/v1/badge.svg?start=1.13.0)](https://embadge.io/) | ||
ember-cli addon support for Numeral.js | ||
ES6 accessible module for Numeral.js within your Ember applications. | ||
## Install | ||
# Install | ||
```bash | ||
npm install --save-dev ember-cli-numeral; | ||
bower install --save numeral | ||
ember install ember-cli-numeral | ||
``` | ||
# Usage | ||
## Usage | ||
@@ -19,6 +20,29 @@ ```javascript | ||
var string = numeral(1000).format('0,0'); | ||
let string = numeral(1000).format('0,0'); | ||
// '1,000' | ||
``` | ||
See the [Numeral.js docs](http://numeraljs.com/) for general usage. | ||
See the [Numeral.js docs](http://numeraljs.com/) for general usage. | ||
## Including Numeral.js languages | ||
To include all the Numeral.js language definitions, you need to add the | ||
following configuration to your `ember-cli-build.js`. | ||
```javascript | ||
var app = new EmberApp(defaults, { | ||
numeral: { | ||
includeLanguages: true | ||
} | ||
}); | ||
``` | ||
The default configuration is `false`. So languages will not be loaded by default. | ||
## Fastboot compatibility | ||
This addon is compatible with [fastboot](http://ember-fastboot.com/) out of the box. | ||
## License | ||
`ember-cli-numeral` shims is MIT Licensed. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
176537
41
285
1
48
2
11
2
1
2
+ Addedember-cli-node-assets@^0.1.4
+ Addednumeral@^1.5.3
+ Addedarray-equal@1.0.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedblank-object@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbroccoli-funnel@1.2.0(transitive)
+ Addedbroccoli-merge-trees@1.2.4(transitive)
+ Addedbroccoli-plugin@1.3.1(transitive)
+ Addedbroccoli-source@1.1.0(transitive)
+ Addedbroccoli-unwatched-tree@0.1.3(transitive)
+ Addedcan-symlink@1.0.0(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addedember-cli-node-assets@0.1.6(transitive)
+ Addedensure-posix-path@1.1.1(transitive)
+ Addedexists-sync@0.0.4(transitive)
+ Addedfast-ordered-set@1.0.3(transitive)
+ Addedfs-tree-diff@0.5.9(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedheimdalljs@0.2.6(transitive)
+ Addedheimdalljs-logger@0.1.10(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmatcher-collection@1.1.2(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmktemp@0.4.0(transitive)
+ Addedms@2.0.0(transitive)
+ Addednumeral@1.5.6(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-posix@1.0.0(transitive)
+ Addedpromise-map-series@0.2.3(transitive)
+ Addedquick-temp@0.1.8(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedrsvp@3.2.1(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedsymlink-or-copy@1.3.1(transitive)
+ Addedtmp@0.0.28(transitive)
+ Addedunderscore.string@3.3.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwalk-sync@0.3.4(transitive)
+ Addedwrappy@1.0.2(transitive)