diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7efa7edc..e982dbee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,17 +75,13 @@ jobs: strategy: matrix: ember-try-scenario: - - ember-lts-2.12 - - ember-lts-2.16 - - ember-lts-2.18 - - ember-lts-3.4 - ember-lts-3.8 - ember-lts-3.12 + - ember-lts-3.16 - ember-release - ember-octane - ember-beta - ember-canary - - ember-default - ember-default-with-jquery - with-ember-cli-htmlbars-inline-precompile diff --git a/README.md b/README.md index c11dd950..bf7393fd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ Build Status -### Registering a Plugin +## Compatibility + +* Ember.js v3.8 or above +* Ember CLI v3.8 or above +* Node.js v10 or above + +## Registering a Plugin ```javascript var SomeTransform = require('./some-path/transform'); @@ -22,7 +28,7 @@ module.exports = { }; ``` -#### Options for registering a `htmlbars-ast-plugin` +### Options for registering a `htmlbars-ast-plugin` * `name` - String. The name of the AST transform for debugging purposes. * `plugin` - A function of type [`ASTPluginBuilder`](https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L329-L341). @@ -30,7 +36,7 @@ module.exports = { * `cacheKey` - function that returns any JSON-compatible value - The value returned is used to invalidate the persistent cache across restarts, usually in the case of a dependency or configuration change. * `baseDir` - `() => string`. A function that returns the directory on disk of the npm module for the plugin. If provided, a basic cache invalidation is performed if any of the dependencies change (e.g. due to a npm install/upgrade). -#### Implementing Dependency Invalidation in an AST Plugin +### Implementing Dependency Invalidation in an AST Plugin Plugins that set the `dependencyInvalidation` option to `true` can provide function for the `plugin` of type `ASTDependencyPlugin` as given below. @@ -71,7 +77,7 @@ export interface ASTPluginWithDeps extends ASTPlugin { } ``` -### Precompile HTMLBars template strings within other addons +## Precompile HTMLBars template strings within other addons ```javascript module.exports = { @@ -93,7 +99,7 @@ module.exports = { }; ``` -### Tagged Template Usage / Migrating from `htmlbars-inline-precompile` +## Tagged Template Usage / Migrating from `htmlbars-inline-precompile` Starting with version 4.0, this addon now includes the testing helper from [ember-cli-htmlbars-inline-precompile](https://github.com/ember-cli/ember-cli-htmlbars-inline-precompile) @@ -142,12 +148,7 @@ module.exports = function(defaults) { }; ``` -### 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 -to use ember-cli-htmlbars@0.6.x. - -### Using as a Broccoli Plugin +## Using as a Broccoli Plugin ```javascript var HtmlbarsCompiler = require('ember-cli-htmlbars'); diff --git a/config/ember-try.js b/config/ember-try.js index 0acef061..6b1d5737 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -12,62 +12,26 @@ module.exports = function () { useYarn: true, scenarios: [ { - name: 'ember-lts-2.12', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), - }, - npm: { - devDependencies: { - '@ember/jquery': '^0.5.1', - 'ember-source': '~2.12.0', - }, - }, - }, - { - name: 'ember-lts-2.16', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), - }, - npm: { - devDependencies: { - '@ember/jquery': '^0.5.1', - 'ember-source': '~2.16.0', - }, - }, - }, - { - name: 'ember-lts-2.18', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }), - }, - npm: { - devDependencies: { - '@ember/jquery': '^0.5.1', - 'ember-source': '~2.18.0', - }, - }, - }, - { - name: 'ember-lts-3.4', + name: 'ember-lts-3.8', npm: { devDependencies: { - 'ember-source': '~3.4.0', + 'ember-source': '~3.8.0', }, }, }, { - name: 'ember-lts-3.8', + name: 'ember-lts-3.12', npm: { devDependencies: { - 'ember-source': '~3.8.0', + 'ember-source': '~3.12.0', }, }, }, { - name: 'ember-lts-3.12', + name: 'ember-lts-3.16', npm: { devDependencies: { - 'ember-source': '~3.12.0', + 'ember-source': '~3.16.0', }, }, }, diff --git a/tests/dummy/lib/module-name-inliner/index.js b/tests/dummy/lib/module-name-inliner/index.js index 31f9d316..d78de522 100644 --- a/tests/dummy/lib/module-name-inliner/index.js +++ b/tests/dummy/lib/module-name-inliner/index.js @@ -1,7 +1,5 @@ 'use strict'; -let VersionChecker = require('ember-cli-version-checker'); - module.exports = { name: require('./package').name, @@ -11,11 +9,7 @@ module.exports = { setupPreprocessorRegistry(type, registry) { // can only add the plugin with this style on newer Ember versions - let checker = new VersionChecker(this.project); - if (checker.for('ember-source').gte('3.1.0')) { - registry.add('htmlbars-ast-plugin', this.buildPlugin()); - } - + registry.add('htmlbars-ast-plugin', this.buildPlugin()); registry.add('htmlbars-ast-plugin', this.buildLegacyPlugin()); }, diff --git a/tests/dummy/lib/module-name-inliner/package.json b/tests/dummy/lib/module-name-inliner/package.json index 45096a13..39409727 100644 --- a/tests/dummy/lib/module-name-inliner/package.json +++ b/tests/dummy/lib/module-name-inliner/package.json @@ -4,7 +4,5 @@ "keywords": [ "ember-addon" ], - "dependencies": { - "ember-cli-version-checker": "*" - } + "dependencies": {} } diff --git a/tests/integration/components/ast-plugins-test.js b/tests/integration/components/ast-plugins-test.js index f37cbffa..667483c4 100644 --- a/tests/integration/components/ast-plugins-test.js +++ b/tests/integration/components/ast-plugins-test.js @@ -2,7 +2,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; -import hasEmberVersion from '@ember/test-helpers/has-ember-version'; module('tests/integration/components/ast-plugins-test', function (hooks) { setupRenderingTest(hooks); @@ -16,14 +15,12 @@ module('tests/integration/components/ast-plugins-test', function (hooks) { ); }); - if (hasEmberVersion(3, 1)) { - test('stand alone templates have AST plugins ran', async function (assert) { - await render(hbs`{{x-module-name-inlined-component}}`); + test('stand alone templates have AST plugins ran', async function (assert) { + await render(hbs`{{x-module-name-inlined-component}}`); - assert.equal( - this.element.textContent.trim(), - 'dummy/templates/components/x-module-name-inlined-component.hbs' - ); - }); - } + assert.equal( + this.element.textContent.trim(), + 'dummy/templates/components/x-module-name-inlined-component.hbs' + ); + }); }); diff --git a/tests/integration/components/test-inline-precompile-test.js b/tests/integration/components/test-inline-precompile-test.js index b4a74e5b..999186d2 100644 --- a/tests/integration/components/test-inline-precompile-test.js +++ b/tests/integration/components/test-inline-precompile-test.js @@ -4,7 +4,6 @@ import { render } from '@ember/test-helpers'; import hbsOne from 'htmlbars-inline-precompile'; import hbsTwo from 'ember-cli-htmlbars-inline-precompile'; import { hbs as hbsThree } from 'ember-cli-htmlbars'; -import hasEmberVersion from '@ember/test-helpers/has-ember-version'; module('tests/integration/components/test-inline-precompile', function (hooks) { setupRenderingTest(hooks); @@ -33,11 +32,9 @@ module('tests/integration/components/test-inline-precompile', function (hooks) { assert.equal(this.element.textContent.trim(), 'sbh.etalpmet-olleh'); }); - if (hasEmberVersion(3, 1)) { - test('inline templates have AST plugins ran', async function (assert) { - await render(hbsThree('{{module-name-inliner}}', { moduleName: 'hello-template.hbs' })); + test('inline templates have AST plugins ran', async function (assert) { + await render(hbsThree('{{module-name-inliner}}', { moduleName: 'hello-template.hbs' })); - assert.equal(this.element.textContent.trim(), 'hello-template.hbs'); - }); - } + assert.equal(this.element.textContent.trim(), 'hello-template.hbs'); + }); }); diff --git a/yarn.lock b/yarn.lock index a6fc21fb..af20349e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4028,15 +4028,6 @@ ember-cli-typescript@^2.0.2: stagehand "^1.0.0" walk-sync "^1.0.0" -ember-cli-version-checker@*, ember-cli-version-checker@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-5.0.2.tgz#7e96157be4b13b083a68078b188820193275d8c4" - integrity sha512-cqFrIg9++GKdpMv2DP8pryAhTcmCYUL2hzHatLwkcJe23s+ioZ0JQWte0avxZ5lJnwn5e3kzUKkLkDfHDFBMUw== - dependencies: - resolve-package-path "^2.0.0" - semver "^7.1.3" - silent-error "^1.1.1" - ember-cli-version-checker@^2.0.0, ember-cli-version-checker@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-2.2.0.tgz#47771b731fe0962705e27c8199a9e3825709f3b3" @@ -4062,6 +4053,15 @@ ember-cli-version-checker@^4.1.0: semver "^6.3.0" silent-error "^1.1.1" +ember-cli-version-checker@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-5.0.2.tgz#7e96157be4b13b083a68078b188820193275d8c4" + integrity sha512-cqFrIg9++GKdpMv2DP8pryAhTcmCYUL2hzHatLwkcJe23s+ioZ0JQWte0avxZ5lJnwn5e3kzUKkLkDfHDFBMUw== + dependencies: + resolve-package-path "^2.0.0" + semver "^7.1.3" + silent-error "^1.1.1" + ember-cli@~3.16.1: version "3.16.1" resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.16.1.tgz#9c7333b5c939488b41820c4b59e6e00dc3e25a7b"