Skip to content

Commit

Permalink
Merge pull request #492 from ember-cli/remove-bower-components-support
Browse files Browse the repository at this point in the history
Remove Bower support.
  • Loading branch information
rwjblue authored Apr 9, 2020
2 parents b601f81 + 87c8886 commit 8766979
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ await render(hbs`

There is a [codemod](https://github.com/ember-codemods/ember-cli-htmlbars-inline-precompile-codemod) available to automate this change.

### Custom Template Compiler

You can still provide a custom path to the template compiler (e.g. to test
custom template compiler tweaks in an application) by:

```js
// ember-cli-build.js

module.exports = function(defaults) {
let app = new EmberApp(defaults, {
'ember-cli-htmlbars': {
templateCompilerPath: `some_path/to/ember-template-compiler.js`,
}
});
};
```

### Handlebars 2.0 Support (Ember < 1.10)

Handlebars 2.0 support has been removed. If you are using ember-cli-htmlbars with a 1.9.x project please continue
Expand Down
20 changes: 9 additions & 11 deletions lib/ember-addon-main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const path = require('path');
const SilentError = require('silent-error');
const utils = require('./utils');

let registryInvocationCounter = 0;
Expand Down Expand Up @@ -191,20 +191,18 @@ module.exports = {
let templateCompilerPath =
config['ember-cli-htmlbars'] && config['ember-cli-htmlbars'].templateCompilerPath;

let ember = this.project.findAddonByName('ember-source');
if (ember) {
return ember.absolutePaths.templateCompiler;
} else if (!templateCompilerPath) {
templateCompilerPath = this.project.bowerDirectory + '/ember/ember-template-compiler';
if (templateCompilerPath) {
return templateCompilerPath;
}

let absolutePath = path.resolve(this.project.root, templateCompilerPath);

if (path.extname(absolutePath) === '') {
absolutePath += '.js';
let ember = this.project.findAddonByName('ember-source');
if (!ember) {
throw new SilentError(
`ember-cli-htmlbars: Cannot find the ember-source addon as part of the project, please ensure that 'ember-source' is in your projects dependencies or devDependencies`
);
}

return absolutePath;
return ember.absolutePaths.templateCompiler;
},

htmlbarsOptions() {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"heimdalljs-logger": "^0.1.10",
"json-stable-stringify": "^1.0.1",
"semver": "^6.3.0",
"silent-error": "^1.1.1",
"strip-bom": "^4.0.0",
"walk-sync": "^2.0.2"
},
Expand Down
12 changes: 9 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7098,9 +7098,8 @@ mocha@^7.1.1:
yargs-unparser "1.6.0"

"module-name-inliner@link:./tests/dummy/lib/module-name-inliner":
version "0.1.0"
dependencies:
ember-cli-version-checker "*"
version "0.0.0"
uid ""

morgan@^1.9.1:
version "1.9.1"
Expand Down Expand Up @@ -8428,6 +8427,13 @@ resolve@^1.1.3, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.
dependencies:
path-parse "^1.0.6"

resolve@^1.13.1:
version "1.15.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8"
integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==
dependencies:
path-parse "^1.0.6"

responselike@1.0.2, responselike@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
Expand Down

0 comments on commit 8766979

Please sign in to comment.