ember-compatibility-helpers
Advanced tools
Comparing version 1.2.0 to 1.2.1
26
index.js
@@ -50,9 +50,19 @@ 'use strict'; | ||
parentOptions.babel = parentOptions.babel || {}; | ||
const plugins = parentOptions.babel.plugins = parentOptions.babel.plugins || []; | ||
const plugins = parentOptions.babel.plugins = parentOptions.babel.plugins || []; | ||
const comparisonPlugin = this._getComparisonPlugin(this.emberVersion); | ||
const debugPlugin = this._getDebugPlugin(this.emberVersion, this.parentChecker); | ||
plugins.push(comparisonPlugin, debugPlugin); | ||
if (this._usingBabel7) { | ||
if (!plugins.find(p => Array.isArray(p) && p[2] === comparisonPlugin[2])) { | ||
plugins.push(comparisonPlugin); | ||
} | ||
if (!plugins.find(p => Array.isArray(p) && p[2] === debugPlugin[2])) { | ||
plugins.push(debugPlugin); | ||
} | ||
} else { | ||
plugins.push(comparisonPlugin, debugPlugin); | ||
} | ||
this._registeredWithBabel = true; | ||
@@ -66,6 +76,14 @@ }, | ||
return [require.resolve('./comparision-plugin.js'), { emberVersion: trueEmberVersion, root: this.project.root, name: parentName }]; | ||
let plugin = [require.resolve('./comparision-plugin.js'), { emberVersion: trueEmberVersion, root: this.project.root, name: parentName }, ]; | ||
if (this._usingBabel7) { | ||
plugin.push(`ember-compatibility-helpers:comparison-plugin:${parentName}`); | ||
} | ||
return plugin; | ||
}, | ||
_getDebugPlugin(emberVersion, parentChecker) { | ||
const parentName = typeof this.parent.name === 'function' ? this.parent.name() : this.parent.name; | ||
const options = { | ||
@@ -89,3 +107,3 @@ debugTools: { | ||
if (this._usingBabel7) { | ||
plugin.push('ember-compatibility-helpers:debug-macros'); | ||
plugin.push(`ember-compatibility-helpers:debug-macros:${parentName}`); | ||
} | ||
@@ -92,0 +110,0 @@ |
{ | ||
"name": "ember-compatibility-helpers", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Zero-cost compatibility flags and helpers for Ember.js", | ||
@@ -56,2 +56,5 @@ "keywords": [ | ||
}, | ||
"resolutions": { | ||
"testem": "~2.0.0" | ||
}, | ||
"engines": { | ||
@@ -58,0 +61,0 @@ "node": "^4.5 || 6.* || >= 7.*" |
@@ -46,2 +46,15 @@ [![Build Status](https://travis-ci.org/pzuraq/ember-compatibility-helpers.svg?branch=master)](https://travis-ci.org/pzuraq/ember-compatibility-helpers) [![npm version](https://badge.fury.io/js/ember-compatibility-helpers.svg)](https://badge.fury.io/js/ember-compatibility-helpers) | ||
## Version Identifiers | ||
Version strings passed to version checker functions, such as `gte` or `lte`, must be fully qualified versions. Version ranges or shorthands are not supported. | ||
``` | ||
// Do this: | ||
lte('3.13.0-beta.1') | ||
// Not this: | ||
lte('3.12'); // won't work! | ||
lte('^3.12.0'); // won't work! | ||
``` | ||
## Example Usage | ||
@@ -76,3 +89,3 @@ | ||
boo() { | ||
if (gte('my-addon-name', '3.5')) { | ||
if (gte('my-addon-name', '3.5.0-beta.3')) { | ||
return {}; | ||
@@ -79,0 +92,0 @@ } else { |
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
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
214
143
15269
8