Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #320 from rwjblue/deprecate-and-noop
Browse files Browse the repository at this point in the history
Deprecate ember-cli-htmlbars-inline-precompiler.
  • Loading branch information
rwjblue committed Oct 1, 2019
2 parents a6f25ed + d3a4f4a commit 2517d5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-htmlbars-inline-precompile.svg)](http://emberobserver.com/addons/ember-cli-htmlbars-inline-precompile)
[![Dependency Status](https://david-dm.org/ember-cli/ember-cli-htmlbars-inline-precompile.svg)](https://david-dm.org/ember-cli/ember-cli-htmlbars-inline-precompile)


## **Deprecated**

Usage of this project is deprecated, its functionality has been migrated into
[ember-cli-htmlbars](https://github.com/ember-cli/ember-cli-htmlbars) directly.
Please upgrade to `ember-cli-htmlbars@4.0.3` or higher.

## Usage

Precompile template strings within the tests of an Ember project via tagged
template strings:

Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const AstPlugins = require('./lib/ast-plugins');
const VersionChecker = require('ember-cli-version-checker');
const SilentError = require('silent-error');
const debugGenerator = require('heimdalljs-logger');
const semver = require('semver');

const _logger = debugGenerator('ember-cli-htmlbars-inline-precompile');

Expand All @@ -31,9 +32,15 @@ module.exports = {
included() {
this._super.included.apply(this, arguments);

let emberCLIHtmlBars = this.project.findAddonByName('ember-cli-htmlbars');
let projectEmberCliHtmlbars = this.project.findAddonByName('ember-cli-htmlbars');
if(projectEmberCliHtmlbars && projectEmberCliHtmlbars.inlinePrecompilerRegistered) {
return;
}

if(emberCLIHtmlBars && emberCLIHtmlBars.inlinePrecompilerRegistered) {
let parentEmberCliHtmlbars = this.parent.addons.find(a => a.name === 'ember-cli-htmlbars');
if (parentEmberCliHtmlbars && semver.gt(parentEmberCliHtmlbars.pkg.version, '4.0.2')) {
// ember-cli-htmlbars will issue a deprecation message, but we need to
// ensure that we don't attempt to add the babel plugin
return;
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"ember-cli-version-checker": "^3.1.3",
"hash-for-dep": "^1.5.1",
"heimdalljs-logger": "^0.1.9",
"semver": "^6.3.0",
"silent-error": "^1.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit 2517d5d

Please sign in to comment.