From d6de81b9441e01d0b6d3409b9efc3ad4918a8ecd Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Wed, 29 Jun 2022 11:11:00 +0200 Subject: [PATCH] Resolve missing addon warning --- .eslintrc.js | 1 - .npmignore | 1 - lib/baz/config/environment.js | 7 ------- lib/baz/index.js | 9 -------- lib/baz/package.json | 6 ------ package-lock.json | 24 ++++++++++++++++++++++ package.json | 6 ++---- tests/acceptance/ember-get-config-test.js | 2 +- tests/dummy/app/controllers/application.js | 2 +- tests/dummy/app/templates/application.hbs | 2 +- tests/fastboot/basic-test.js | 2 +- 11 files changed, 30 insertions(+), 32 deletions(-) delete mode 100644 lib/baz/config/environment.js delete mode 100644 lib/baz/index.js delete mode 100644 lib/baz/package.json diff --git a/.eslintrc.js b/.eslintrc.js index 6138736..ab627f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,7 +32,6 @@ module.exports = { './testem.js', './blueprints/*/index.js', './config/**/*.js', - './lib/**/*.js', './tests/dummy/config/**/*.js', ], parserOptions: { diff --git a/.npmignore b/.npmignore index 402abbf..399ddfe 100644 --- a/.npmignore +++ b/.npmignore @@ -26,7 +26,6 @@ /CONTRIBUTING.md /ember-cli-build.js /testem.js -/lib/baz/ /tests/ /yarn-error.log /yarn.lock diff --git a/lib/baz/config/environment.js b/lib/baz/config/environment.js deleted file mode 100644 index 3e6848f..0000000 --- a/lib/baz/config/environment.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = function (/* environment, appConfig */) { - return { - baz: 'qux', - }; -}; diff --git a/lib/baz/index.js b/lib/baz/index.js deleted file mode 100644 index 702881b..0000000 --- a/lib/baz/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -module.exports = { - name: require('./package').name, - - isDevelopingAddon() { - return true; - }, -}; diff --git a/lib/baz/package.json b/lib/baz/package.json deleted file mode 100644 index 9a00405..0000000 --- a/lib/baz/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "baz", - "keywords": [ - "ember-addon" - ] -} diff --git a/package-lock.json b/package-lock.json index d8b370e..81fa43b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "^2.3.0", "ember-cli": "~3.28.2", + "ember-cli-app-version": "^5.0.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-fastboot": "^3.3.0", "ember-cli-fastboot-testing": "^0.6.0", @@ -9353,6 +9354,19 @@ "node": ">= 12" } }, + "node_modules/ember-cli-app-version": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ember-cli-app-version/-/ember-cli-app-version-5.0.0.tgz", + "integrity": "sha512-afhx/CXDOMNXzoe4NDPy5WUfxWmYYHUzMCiTyvPBxCDBXYcMrtxNWxvgaSaeqcoHVEmqzeyBj8V82tzmT1dcyw==", + "dev": true, + "dependencies": { + "ember-cli-babel": "^7.23.1", + "git-repo-info": "^2.1.1" + }, + "engines": { + "node": "10.* || >= 12" + } + }, "node_modules/ember-cli-babel": { "version": "7.26.6", "resolved": "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.6.tgz", @@ -32470,6 +32484,16 @@ } } }, + "ember-cli-app-version": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ember-cli-app-version/-/ember-cli-app-version-5.0.0.tgz", + "integrity": "sha512-afhx/CXDOMNXzoe4NDPy5WUfxWmYYHUzMCiTyvPBxCDBXYcMrtxNWxvgaSaeqcoHVEmqzeyBj8V82tzmT1dcyw==", + "dev": true, + "requires": { + "ember-cli-babel": "^7.23.1", + "git-repo-info": "^2.1.1" + } + }, "ember-cli-babel": { "version": "7.26.6", "resolved": "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.6.tgz", diff --git a/package.json b/package.json index c523c4e..99dd664 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "^2.3.0", "ember-cli": "~3.28.2", + "ember-cli-app-version": "^5.0.0", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-fastboot": "^3.3.0", "ember-cli-fastboot-testing": "^0.6.0", @@ -79,9 +80,6 @@ "edition": "octane" }, "ember-addon": { - "configPath": "tests/dummy/config", - "paths": [ - "lib/baz" - ] + "configPath": "tests/dummy/config" } } diff --git a/tests/acceptance/ember-get-config-test.js b/tests/acceptance/ember-get-config-test.js index e16de03..245e43d 100644 --- a/tests/acceptance/ember-get-config-test.js +++ b/tests/acceptance/ember-get-config-test.js @@ -14,6 +14,6 @@ module('Acceptance | ember get config', function (hooks) { test('it includes config from addons', async function (assert) { await visit('/'); - assert.dom('#baz').hasText('qux'); + assert.dom('#app-name').hasText('ember-get-config'); }); }); diff --git a/tests/dummy/app/controllers/application.js b/tests/dummy/app/controllers/application.js index 07deb0d..dbae2b9 100644 --- a/tests/dummy/app/controllers/application.js +++ b/tests/dummy/app/controllers/application.js @@ -3,6 +3,6 @@ import Controller from '@ember/controller'; import config from 'ember-get-config'; export default Controller.extend({ - baz: config.baz, + appName: config.APP.name, foo: config.foo, }); diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index 7a76c59..169946f 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -1,2 +1,2 @@ -
{{this.baz}}
+
{{this.appName}}
{{this.foo}}
\ No newline at end of file diff --git a/tests/fastboot/basic-test.js b/tests/fastboot/basic-test.js index a17e835..73bc865 100644 --- a/tests/fastboot/basic-test.js +++ b/tests/fastboot/basic-test.js @@ -7,6 +7,6 @@ module('FastBoot | basic', function (hooks) { test('it renders a page...', async function (assert) { let { htmlDocument } = await visit('/'); - assert.dom('body', htmlDocument).hasText('qux bar'); + assert.dom('body', htmlDocument).hasText('ember-get-config bar'); }); });