ember-test-selectors
Advanced tools
Comparing version 2.1.0 to 3.0.0-beta.1
# Changelog | ||
## v3.0.0-beta.1 (2019-03-16) | ||
#### :boom: Breaking Change | ||
The main breaking changes in this major release are dropping support for older | ||
Ember.js, Ember CLI and Node.js versions. The v3.x series will have the | ||
following minimum requirements: | ||
- Ember.js 2.16 or above | ||
- Ember CLI 2.14 or above | ||
- Node.js 8 or above | ||
* [#341](https://github.com/simplabs/ember-test-selectors/pull/341) Adjust Ember.js support range to 2.16+ ([@Turbo87](https://github.com/Turbo87)) | ||
* [#338](https://github.com/simplabs/ember-test-selectors/pull/338) Use `setupPreprocessorRegistry()` hook to register HTMLBars AST plugin ([@Turbo87](https://github.com/Turbo87)) | ||
* [#337](https://github.com/simplabs/ember-test-selectors/pull/337) Drop support for Node.js 4 and 6 ([@Turbo87](https://github.com/Turbo87)) | ||
#### :rocket: Enhancement | ||
* [#339](https://github.com/simplabs/ember-test-selectors/pull/339) Enable parallel file processing for `ember-cli-babel` ([@Turbo87](https://github.com/Turbo87)) | ||
#### :memo: Documentation | ||
* [#342](https://github.com/simplabs/ember-test-selectors/pull/342) README: Add Node.js compatibility information ([@Turbo87](https://github.com/Turbo87)) | ||
#### :house: Internal | ||
* [#340](https://github.com/simplabs/ember-test-selectors/pull/340) Adjust `.npmignore` blacklist ([@Turbo87](https://github.com/Turbo87)) | ||
#### Committers: 1 | ||
- Tobias Bieniek ([@Turbo87](https://github.com/Turbo87)) | ||
## v2.1.0 (2019-03-15) | ||
@@ -4,0 +33,0 @@ |
72
index.js
@@ -29,21 +29,16 @@ 'use strict'; | ||
_setupPreprocessorRegistry(registry) { | ||
if (this._stripTestSelectors) { | ||
let StripTestSelectorsTransform = require('./strip-test-selectors'); | ||
setupPreprocessorRegistry(type, registry) { | ||
if (type === 'parent') { | ||
this._assignOptions(this.app); | ||
registry.add('htmlbars-ast-plugin', { | ||
name: 'strip-test-selectors', | ||
plugin: StripTestSelectorsTransform, | ||
baseDir() { return __dirname; }, | ||
cacheKey() { return 'strip-test-selectors'; }, | ||
}); | ||
} else { | ||
let TransformTestSelectorParamsToHashPairs = require('./transform-test-selector-params-to-hash-pairs'); | ||
let pluginFnName = this._stripTestSelectors ? '_buildStripPlugin' : '_buildHashParamPlugin'; | ||
registry.add('htmlbars-ast-plugin', { | ||
name: 'transform-test-selector-params-to-hash-pairs', | ||
plugin: TransformTestSelectorParamsToHashPairs, | ||
baseDir() { return __dirname; }, | ||
cacheKey() { return 'transform-test-selector-params-to-hash-pairs'; }, | ||
}); | ||
let plugin = this[pluginFnName](); | ||
plugin.parallelBabel = { | ||
requireFile: __filename, | ||
buildUsing: pluginFnName, | ||
params: {}, | ||
}; | ||
registry.add('htmlbars-ast-plugin', plugin); | ||
} | ||
@@ -54,11 +49,3 @@ }, | ||
this._super.included.apply(this, arguments); | ||
this._ensureFindHost(); | ||
let host = this._findHost(); | ||
this._assignOptions(host); | ||
// we can't use the setupPreprocessorRegistry() hook as it is called to | ||
// early and we do not have reliable access to `app.tests` there yet | ||
this._setupPreprocessorRegistry(app.registry); | ||
// add the StripDataTestPropertiesPlugin to the list of plugins used by | ||
@@ -78,3 +65,3 @@ // the `ember-cli-babel` addon | ||
app.options.babel6.plugins = app.options.babel6.plugins || []; | ||
app.options.babel6.plugins.push(require('./strip-data-test-properties-plugin6')); | ||
app.options.babel6.plugins.push(require.resolve('./strip-data-test-properties-plugin6')); | ||
} else { | ||
@@ -89,3 +76,3 @@ this.ui.writeWarnLine('ember-test-selectors: You are using an unsupported ember-cli-babel version. data-test ' + | ||
if (!this._stripTestSelectors) { | ||
host.import('vendor/ember-test-selectors/patch-component.js'); | ||
this.app.import('vendor/ember-test-selectors/patch-component.js'); | ||
} | ||
@@ -111,14 +98,23 @@ }, | ||
_ensureFindHost() { | ||
if (!this._findHost) { | ||
this._findHost = function findHostShim() { | ||
let current = this; | ||
let app; | ||
do { | ||
app = current.app || app; | ||
} while (current.parent.parent && (current = current.parent)); | ||
return app; | ||
}; | ||
} | ||
_buildStripPlugin() { | ||
let StripTestSelectorsTransform = require('./strip-test-selectors'); | ||
return { | ||
name: 'strip-test-selectors', | ||
plugin: StripTestSelectorsTransform, | ||
baseDir() { return __dirname; }, | ||
cacheKey() { return 'strip-test-selectors'; }, | ||
}; | ||
}, | ||
_buildHashParamPlugin() { | ||
let TransformTestSelectorParamsToHashPairs = require('./transform-test-selector-params-to-hash-pairs'); | ||
return { | ||
name: 'transform-test-selector-params-to-hash-pairs', | ||
plugin: TransformTestSelectorParamsToHashPairs, | ||
baseDir() { return __dirname; }, | ||
cacheKey() { return 'transform-test-selector-params-to-hash-pairs'; }, | ||
}; | ||
}, | ||
}; |
{ | ||
"name": "ember-test-selectors", | ||
"version": "2.1.0", | ||
"version": "3.0.0-beta.1", | ||
"description": "Enabling better Test selectors in Ember.js applications.", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"engines": { | ||
"node": "^4.5 || 6.* || >= 7.*" | ||
"node": "8.* || >= 10.*" | ||
}, | ||
@@ -74,3 +74,3 @@ "changelog": { | ||
"versionCompatibility": { | ||
"ember": ">=1.11" | ||
"ember": ">=2.12" | ||
} | ||
@@ -77,0 +77,0 @@ }, |
@@ -32,2 +32,11 @@ ember-test-selectors | ||
Compatibility | ||
------------------------------------------------------------------------------ | ||
- Ember 2.16 or above | ||
- Ember CLI 2.14 or above | ||
- Node.js 8 or above | ||
Installation | ||
@@ -34,0 +43,0 @@ ------------------------------------------------------------------------------ |
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
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
49903
206
0
12
260
2