diff --git a/packages/router/package.json b/packages/router/package.json index b9555dfc0..016586733 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -47,7 +47,6 @@ "ember-auto-import": "^1.11.2", "ember-cli": "~3.27.0", "ember-cli-dependency-checker": "^3.1.0", - "ember-cli-eslint": "^5.1.0", "ember-cli-htmlbars": "^4.3.1", "ember-cli-htmlbars-inline-precompile": "^2.1.0", "ember-cli-inject-live-reload": "^1.8.2", diff --git a/test-packages/macro-sample-addon/.editorconfig b/test-packages/macro-sample-addon/.editorconfig deleted file mode 100644 index 219985c22..000000000 --- a/test-packages/macro-sample-addon/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/test-packages/macro-sample-addon/.ember-cli b/test-packages/macro-sample-addon/.ember-cli deleted file mode 100644 index ee64cfed2..000000000 --- a/test-packages/macro-sample-addon/.ember-cli +++ /dev/null @@ -1,9 +0,0 @@ -{ - /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. - - Setting `disableAnalytics` to true will prevent any data from being sent. - */ - "disableAnalytics": false -} diff --git a/test-packages/macro-sample-addon/.eslintignore b/test-packages/macro-sample-addon/.eslintignore deleted file mode 100644 index 72df37307..000000000 --- a/test-packages/macro-sample-addon/.eslintignore +++ /dev/null @@ -1,20 +0,0 @@ -# unconventional js -/blueprints/*/files/ -/vendor/ - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/coverage/ -!.* - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/test-packages/macro-sample-addon/.eslintrc.js b/test-packages/macro-sample-addon/.eslintrc.js deleted file mode 100644 index 41e015f85..000000000 --- a/test-packages/macro-sample-addon/.eslintrc.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - ecmaVersion: 2018, - sourceType: 'module' - }, - plugins: [ - 'ember' - ], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended' - ], - env: { - browser: true - }, - rules: { - }, - overrides: [ - // node files - { - files: [ - '.eslintrc.js', - '.template-lintrc.js', - 'ember-cli-build.js', - 'index.js', - 'testem.js', - 'blueprints/*/index.js', - 'config/**/*.js', - 'tests/dummy/config/**/*.js' - ], - excludedFiles: [ - 'addon/**', - 'addon-test-support/**', - 'app/**', - 'tests/dummy/app/**' - ], - parserOptions: { - sourceType: 'script', - ecmaVersion: 2015 - }, - env: { - browser: false, - node: true - }, - plugins: ['node'], - rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { - // add your custom rules and overrides for node files here - }) - } - ] -}; diff --git a/test-packages/macro-sample-addon/.gitignore b/test-packages/macro-sample-addon/.gitignore deleted file mode 100644 index c40a1b2ab..000000000 --- a/test-packages/macro-sample-addon/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/test-packages/macro-sample-addon/.npmignore b/test-packages/macro-sample-addon/.npmignore deleted file mode 100644 index fba915456..000000000 --- a/test-packages/macro-sample-addon/.npmignore +++ /dev/null @@ -1,31 +0,0 @@ -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ - -# misc -/.bowerrc -/.editorconfig -/.ember-cli -/.env* -/.eslintignore -/.eslintrc.js -/.gitignore -/.template-lintrc.js -/.travis.yml -/.watchmanconfig -/bower.json -/config/ember-try.js -/CONTRIBUTING.md -/ember-cli-build.js -/testem.js -/tests/ -/yarn.lock -.gitkeep - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/test-packages/macro-sample-addon/.template-lintrc.js b/test-packages/macro-sample-addon/.template-lintrc.js deleted file mode 100644 index b45e96ffd..000000000 --- a/test-packages/macro-sample-addon/.template-lintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'recommended' -}; diff --git a/test-packages/macro-sample-addon/.travis.yml b/test-packages/macro-sample-addon/.travis.yml deleted file mode 100644 index 94540c75d..000000000 --- a/test-packages/macro-sample-addon/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -language: node_js -node_js: - # we recommend testing addons with the same minimum supported node version as Ember CLI - # so that your addon works for all apps - - "8" - -sudo: false -dist: trusty - -addons: - chrome: stable - -cache: - yarn: true - -env: - global: - # See https://git.io/vdao3 for details. - - JOBS=1 - -branches: - only: - - master - # npm version tags - - /^v\d+\.\d+\.\d+/ - -jobs: - fail_fast: true - allow_failures: - - env: EMBER_TRY_SCENARIO=ember-canary - - include: - # runs linting and tests with current locked deps - - - stage: "Tests" - name: "Tests" - install: - - yarn install --non-interactive - script: - - yarn lint:hbs - - yarn lint:js - - yarn test - - - name: "Floating Dependencies" - script: - - yarn test - - # we recommend new addons test the current and previous LTS - # as well as latest stable release (bonus points to beta/canary) - - stage: "Additional Tests" - env: EMBER_TRY_SCENARIO=ember-lts-2.18 - - env: EMBER_TRY_SCENARIO=ember-lts-3.4 - - env: EMBER_TRY_SCENARIO=ember-release - - env: EMBER_TRY_SCENARIO=ember-beta - - env: EMBER_TRY_SCENARIO=ember-canary - - env: EMBER_TRY_SCENARIO=ember-default-with-jquery - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH=$HOME/.yarn/bin:$PATH - -install: - - yarn install --no-lockfile --non-interactive - -script: - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/test-packages/macro-sample-addon/.watchmanconfig b/test-packages/macro-sample-addon/.watchmanconfig deleted file mode 100644 index e7834e3e4..000000000 --- a/test-packages/macro-sample-addon/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/test-packages/macro-sample-addon/CONTRIBUTING.md b/test-packages/macro-sample-addon/CONTRIBUTING.md deleted file mode 100644 index 03b72c3b7..000000000 --- a/test-packages/macro-sample-addon/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# How To Contribute - -## Installation - -* `git clone ` -* `cd macro-sample-addon` -* `yarn install` - -## Linting - -* `yarn lint:hbs` -* `yarn lint:js` -* `yarn lint:js --fix` - -## Running tests - -* `ember test` – Runs the test suite on the current Ember version -* `ember test --server` – Runs the test suite in "watch mode" -* `ember try:each` – Runs the test suite against multiple Ember versions - -## Running the dummy application - -* `ember serve` -* Visit the dummy application at [http://localhost:4200](http://localhost:4200). - -For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). \ No newline at end of file diff --git a/test-packages/macro-sample-addon/LICENSE.md b/test-packages/macro-sample-addon/LICENSE.md deleted file mode 100644 index f8d1edb3b..000000000 --- a/test-packages/macro-sample-addon/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019 - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test-packages/macro-sample-addon/README.md b/test-packages/macro-sample-addon/README.md deleted file mode 100644 index f9c651657..000000000 --- a/test-packages/macro-sample-addon/README.md +++ /dev/null @@ -1,38 +0,0 @@ -macro-sample-addon -============================================================================== - -[Short description of the addon.] - - -Compatibility ------------------------------------------------------------------------------- - -* Ember.js v2.18 or above -* Ember CLI v2.13 or above -* Node.js v8 or above - - -Installation ------------------------------------------------------------------------------- - -``` -ember install macro-sample-addon -``` - - -Usage ------------------------------------------------------------------------------- - -[Longer description of how to use the addon in apps.] - - -Contributing ------------------------------------------------------------------------------- - -See the [Contributing](CONTRIBUTING.md) guide for details. - - -License ------------------------------------------------------------------------------- - -This project is licensed under the [MIT License](LICENSE.md). diff --git a/test-packages/macro-sample-addon/addon/.gitkeep b/test-packages/macro-sample-addon/addon/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/addon/components/reflect-hbs-config.js b/test-packages/macro-sample-addon/addon/components/reflect-hbs-config.js deleted file mode 100644 index 66e7d8462..000000000 --- a/test-packages/macro-sample-addon/addon/components/reflect-hbs-config.js +++ /dev/null @@ -1,6 +0,0 @@ -import Component from '@ember/component'; -import layout from '../templates/components/reflect-hbs-config'; - -export default Component.extend({ - layout -}); diff --git a/test-packages/macro-sample-addon/addon/helpers/reflect-config.js b/test-packages/macro-sample-addon/addon/helpers/reflect-config.js deleted file mode 100644 index 61b1c0797..000000000 --- a/test-packages/macro-sample-addon/addon/helpers/reflect-config.js +++ /dev/null @@ -1,8 +0,0 @@ -import { helper } from '@ember/component/helper'; -import { getOwnConfig } from '@embroider/macros'; - -export function reflectConfig(/*params, hash*/) { - return getOwnConfig(); -} - -export default helper(reflectConfig); diff --git a/test-packages/macro-sample-addon/addon/helpers/reflect-updated-config.js b/test-packages/macro-sample-addon/addon/helpers/reflect-updated-config.js deleted file mode 100644 index 170dd01d9..000000000 --- a/test-packages/macro-sample-addon/addon/helpers/reflect-updated-config.js +++ /dev/null @@ -1,8 +0,0 @@ -import { helper } from '@ember/component/helper'; -import ENV from 'dummy/config/environment'; - -export function reflectUpdatedConfig(/*params, hash*/) { - return ENV.APP.fromConfigModule; -} - -export default helper(reflectUpdatedConfig); diff --git a/test-packages/macro-sample-addon/addon/index.js b/test-packages/macro-sample-addon/addon/index.js deleted file mode 100644 index ae7dee4ee..000000000 --- a/test-packages/macro-sample-addon/addon/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export function exampleAddonFunction() { - return 'example-addon-function-output'; -} diff --git a/test-packages/macro-sample-addon/addon/styles/addon.css b/test-packages/macro-sample-addon/addon/styles/addon.css deleted file mode 100644 index e1afe0aca..000000000 --- a/test-packages/macro-sample-addon/addon/styles/addon.css +++ /dev/null @@ -1,6 +0,0 @@ -.shared-style-target { - border-top-width: 2px; - border-top-style: solid; - border-top-color: green; - content: 'macro-sample-addon/addon/styles/addon.css'; -} diff --git a/test-packages/macro-sample-addon/addon/templates/components/reflect-hbs-config.hbs b/test-packages/macro-sample-addon/addon/templates/components/reflect-hbs-config.hbs deleted file mode 100644 index b1f10dc1a..000000000 --- a/test-packages/macro-sample-addon/addon/templates/components/reflect-hbs-config.hbs +++ /dev/null @@ -1 +0,0 @@ -{{yield (macroGetOwnConfig) }} \ No newline at end of file diff --git a/test-packages/macro-sample-addon/app/.gitkeep b/test-packages/macro-sample-addon/app/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/app/components/reflect-hbs-config.js b/test-packages/macro-sample-addon/app/components/reflect-hbs-config.js deleted file mode 100644 index 48e362a3d..000000000 --- a/test-packages/macro-sample-addon/app/components/reflect-hbs-config.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from 'macro-sample-addon/components/reflect-hbs-config'; \ No newline at end of file diff --git a/test-packages/macro-sample-addon/app/helpers/reflect-config.js b/test-packages/macro-sample-addon/app/helpers/reflect-config.js deleted file mode 100644 index d2af5d68f..000000000 --- a/test-packages/macro-sample-addon/app/helpers/reflect-config.js +++ /dev/null @@ -1 +0,0 @@ -export { default, reflectConfig } from 'macro-sample-addon/helpers/reflect-config'; diff --git a/test-packages/macro-sample-addon/app/helpers/reflect-updated-config.js b/test-packages/macro-sample-addon/app/helpers/reflect-updated-config.js deleted file mode 100644 index 47b48d965..000000000 --- a/test-packages/macro-sample-addon/app/helpers/reflect-updated-config.js +++ /dev/null @@ -1 +0,0 @@ -export { default, reflectUpdatedConfig } from 'macro-sample-addon/helpers/reflect-updated-config'; diff --git a/test-packages/macro-sample-addon/config/ember-try.js b/test-packages/macro-sample-addon/config/ember-try.js deleted file mode 100644 index 04bdd9c6e..000000000 --- a/test-packages/macro-sample-addon/config/ember-try.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const getChannelURL = require('ember-source-channel-url'); - -module.exports = function () { - return Promise.all([getChannelURL('release'), getChannelURL('beta'), getChannelURL('canary')]).then(urls => { - return { - useYarn: true, - scenarios: [ - { - name: 'ember-lts-3.16', - npm: { - devDependencies: { - 'ember-source': '~3.16.0', - }, - }, - }, - { - name: 'ember-lts-3.20', - npm: { - devDependencies: { - 'ember-source': '~3.20.5', - }, - }, - }, - { - name: 'ember-lts-3.24', - npm: { - devDependencies: { - 'ember-source': '~3.24.0', - }, - }, - }, - { - name: 'ember-release', - npm: { - devDependencies: { - 'ember-source': urls[0], - }, - }, - }, - { - name: 'ember-beta', - npm: { - devDependencies: { - 'ember-source': urls[1], - }, - }, - }, - { - name: 'ember-canary', - npm: { - devDependencies: { - 'ember-source': urls[2], - }, - }, - }, - ], - }; - }); -}; diff --git a/test-packages/macro-sample-addon/config/environment.js b/test-packages/macro-sample-addon/config/environment.js deleted file mode 100644 index 0dfaed472..000000000 --- a/test-packages/macro-sample-addon/config/environment.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function(/* environment, appConfig */) { - return { }; -}; diff --git a/test-packages/macro-sample-addon/ember-cli-build.js b/test-packages/macro-sample-addon/ember-cli-build.js deleted file mode 100644 index 1f5e2539d..000000000 --- a/test-packages/macro-sample-addon/ember-cli-build.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); - -module.exports = function(defaults) { - let app = new EmberAddon(defaults, { - // Add options here - }); - - /* - This build file specifies the options for the dummy test app of this - addon, located in `/tests/dummy` - This build file does *not* influence how the addon or the app using it - behave. You most likely want to be modifying `./index.js` or app's build file - */ - - if (process.env.CLASSIC) { - return app.toTree(); - } - const Webpack = require('@embroider/webpack').Webpack; - return require('@embroider/compat').compatBuild(app, Webpack); -}; diff --git a/test-packages/macro-sample-addon/index.js b/test-packages/macro-sample-addon/index.js deleted file mode 100644 index bdd728d6e..000000000 --- a/test-packages/macro-sample-addon/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -module.exports = { - name: require('./package').name, - options: { - '@embroider/macros': { - setOwnConfig: { - hello: 'world', - }, - }, - }, - included(app) { - app.options.autoRun = false; - this._super.included.apply(this, arguments); - }, - contentFor(type, config, contents) { - if (type === 'config-module') { - const originalContents = contents.join(''); - contents.splice(0, contents.length); - contents.push( - 'let config = function() {' + originalContents + '}()', - "config.default.APP.fromConfigModule = 'hello new world';", - 'return config;' - ); - return; - } - - if (type === 'app-boot') { - let appSuffix = 'app'; - let prefix = config.modulePrefix; - let configAppAsString = JSON.stringify(config.APP || {}); - return [ - 'if (!runningTests) {', - " require('{{MODULE_PREFIX}}/" + appSuffix + "')['default'].create({{CONFIG_APP}});", - '}', - 'window.LoadedFromCustomAppBoot = true', - ] - .join('\n') - .replace(/\{\{MODULE_PREFIX\}\}/g, prefix) - .replace(/\{\{CONFIG_APP\}\}/g, configAppAsString); - } - }, -}; diff --git a/test-packages/macro-sample-addon/package.json b/test-packages/macro-sample-addon/package.json deleted file mode 100644 index a75600fdc..000000000 --- a/test-packages/macro-sample-addon/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "macro-sample-addon", - "version": "0.0.0", - "description": "The default blueprint for ember-cli addons.", - "keywords": [ - "ember-addon" - ], - "repository": "", - "license": "MIT", - "author": "", - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "build": "ember build", - "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*", - "lint:hbs": "ember-template-lint .", - "lint:js": "eslint .", - "start": "ember serve", - "test": "npm-run-all lint:* test:*", - "test:all": "ember try:each", - "test:ember": "ember test --test-port=0", - "test:classic:": "cross-env CLASSIC=true ember test --test-port=0" - }, - "dependencies": { - "@embroider/macros": "0.43.5", - "ember-cli-babel": "^7.20.5", - "ember-cli-htmlbars": "^4.3.1" - }, - "devDependencies": { - "@ember/optional-features": "^0.7.0", - "@ember/test-helpers": "^2.4.2", - "@ember/string": "^1.0.0", - "@embroider/compat": "0.43.5", - "@embroider/core": "0.43.5", - "@embroider/test-support": "0.36.0", - "@embroider/webpack": "0.43.5", - "broccoli-asset-rev": "^3.0.0", - "ember-auto-import": "^1.11.2", - "ember-cli-dependency-checker": "^3.1.0", - "ember-cli": "~3.27.0", - "ember-cli-eslint": "^5.1.0", - "ember-cli-inject-live-reload": "^1.8.2", - "ember-cli-sri": "^2.1.1", - "ember-template-lint": "^3.6.0", - "ember-cli-uglify": "^2.1.0", - "ember-disable-prototype-extensions": "^1.1.3", - "ember-export-application-global": "^2.0.0", - "ember-load-initializers": "^2.0.0", - "ember-maybe-import-regenerator": "^0.1.6", - "ember-qunit": "^5.1.4", - "ember-resolver": "^5.0.1", - "ember-source": "~3.22.0", - "ember-source-channel-url": "^1.1.0", - "ember-try": "^1.0.0", - "ember-welcome-page": "^4.0.0", - "eslint-plugin-ember": "^7.0.0", - "eslint-plugin-node": "^9.0.1", - "loader.js": "^4.7.0", - "qunit": "^2.14.1", - "qunit-dom": "^1.6.0" - }, - "engines": { - "node": "8.* || >= 10.*" - }, - "ember-addon": { - "configPath": "tests/dummy/config" - }, - "volta": { - "extends": "../../package.json" - } -} diff --git a/test-packages/macro-sample-addon/testem.js b/test-packages/macro-sample-addon/testem.js deleted file mode 100644 index 442829a1a..000000000 --- a/test-packages/macro-sample-addon/testem.js +++ /dev/null @@ -1,2 +0,0 @@ -const { testemConfig } = require('@embroider/test-support/suite-setup-util'); -module.exports = testemConfig(); diff --git a/test-packages/macro-sample-addon/tests/acceptance/app-boot-test.js b/test-packages/macro-sample-addon/tests/acceptance/app-boot-test.js deleted file mode 100644 index e19b57d15..000000000 --- a/test-packages/macro-sample-addon/tests/acceptance/app-boot-test.js +++ /dev/null @@ -1,7 +0,0 @@ -import { module, test } from 'qunit'; - -module('Acceptance | Custom app boot', function () { - test('ensure app boot up is happening from custom app-boot', function (assert) { - assert.equal(window.LoadedFromCustomAppBoot, true, `expected: 'This addon to inject custom app-boot`); - }); -}); \ No newline at end of file diff --git a/test-packages/macro-sample-addon/tests/acceptance/scripts-test.js b/test-packages/macro-sample-addon/tests/acceptance/scripts-test.js deleted file mode 100644 index ab76dcaad..000000000 --- a/test-packages/macro-sample-addon/tests/acceptance/scripts-test.js +++ /dev/null @@ -1,10 +0,0 @@ -import { module, test } from 'qunit'; - -module('Acceptance | scripts', function() { - test('ensure all scripts in index.html 200', async function(assert) { - for (let { src } of document.scripts) { - let { status } = await fetch(src); - assert.equal(status, 200, `expected: '${src}' to be accessible`); - } - }); -}); diff --git a/test-packages/macro-sample-addon/tests/dummy/app/app.js b/test-packages/macro-sample-addon/tests/dummy/app/app.js deleted file mode 100644 index b3b2bd677..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/app/app.js +++ /dev/null @@ -1,14 +0,0 @@ -import Application from '@ember/application'; -import Resolver from './resolver'; -import loadInitializers from 'ember-load-initializers'; -import config from './config/environment'; - -const App = Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver -}); - -loadInitializers(App, config.modulePrefix); - -export default App; diff --git a/test-packages/macro-sample-addon/tests/dummy/app/components/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/components/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/controllers/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/controllers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/helpers/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/helpers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/index.html b/test-packages/macro-sample-addon/tests/dummy/app/index.html deleted file mode 100644 index 61400b20f..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/app/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Dummy - - - - {{content-for "head"}} - - - - - {{content-for "head-footer"}} - - - {{content-for "body"}} - - - - - {{content-for "body-footer"}} - - diff --git a/test-packages/macro-sample-addon/tests/dummy/app/models/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/models/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/resolver.js b/test-packages/macro-sample-addon/tests/dummy/app/resolver.js deleted file mode 100644 index 2fb563d6c..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/app/resolver.js +++ /dev/null @@ -1,3 +0,0 @@ -import Resolver from 'ember-resolver'; - -export default Resolver; diff --git a/test-packages/macro-sample-addon/tests/dummy/app/router.js b/test-packages/macro-sample-addon/tests/dummy/app/router.js deleted file mode 100644 index d0bb00952..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/app/router.js +++ /dev/null @@ -1,12 +0,0 @@ -import EmberRouter from '@ember/routing/router'; -import config from './config/environment'; - -const Router = EmberRouter.extend({ - location: config.locationType, - rootURL: config.rootURL -}); - -Router.map(function() { -}); - -export default Router; diff --git a/test-packages/macro-sample-addon/tests/dummy/app/routes/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/routes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/styles/app.css b/test-packages/macro-sample-addon/tests/dummy/app/styles/app.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/templates/application.hbs b/test-packages/macro-sample-addon/tests/dummy/app/templates/application.hbs deleted file mode 100644 index 7b1b1040f..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/app/templates/application.hbs +++ /dev/null @@ -1,5 +0,0 @@ -{{!-- The following component displays Ember's default welcome message. --}} - -{{!-- Feel free to remove this! --}} - -{{outlet}} \ No newline at end of file diff --git a/test-packages/macro-sample-addon/tests/dummy/app/templates/components/.gitkeep b/test-packages/macro-sample-addon/tests/dummy/app/templates/components/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/config/environment.js b/test-packages/macro-sample-addon/tests/dummy/config/environment.js deleted file mode 100644 index 9f2393692..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/config/environment.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -module.exports = function(environment) { - let ENV = { - modulePrefix: 'dummy', - environment, - rootURL: '/', - locationType: 'auto', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true - }, - EXTEND_PROTOTYPES: { - // Prevent Ember Data from overriding Date.parse. - Date: false - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - ENV.APP.autoboot = false; - } - - if (environment === 'production') { - // here you can enable a production-specific feature - } - - return ENV; -}; diff --git a/test-packages/macro-sample-addon/tests/dummy/config/optional-features.json b/test-packages/macro-sample-addon/tests/dummy/config/optional-features.json deleted file mode 100644 index b1902623a..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/config/optional-features.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "jquery-integration": false -} diff --git a/test-packages/macro-sample-addon/tests/dummy/config/targets.js b/test-packages/macro-sample-addon/tests/dummy/config/targets.js deleted file mode 100644 index 8ffae3636..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/config/targets.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const browsers = [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions' -]; - -const isCI = !!process.env.CI; -const isProduction = process.env.EMBER_ENV === 'production'; - -if (isCI || isProduction) { - browsers.push('ie 11'); -} - -module.exports = { - browsers -}; diff --git a/test-packages/macro-sample-addon/tests/dummy/public/robots.txt b/test-packages/macro-sample-addon/tests/dummy/public/robots.txt deleted file mode 100644 index f5916452e..000000000 --- a/test-packages/macro-sample-addon/tests/dummy/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# http://www.robotstxt.org -User-agent: * -Disallow: diff --git a/test-packages/macro-sample-addon/tests/helpers/.gitkeep b/test-packages/macro-sample-addon/tests/helpers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/index.html b/test-packages/macro-sample-addon/tests/index.html deleted file mode 100644 index 3eb848dbd..000000000 --- a/test-packages/macro-sample-addon/tests/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Dummy Tests - - - - {{content-for "head"}} - {{content-for "test-head"}} - - - - - - {{content-for "head-footer"}} - {{content-for "test-head-footer"}} - - - {{content-for "body"}} - {{content-for "test-body"}} - -
-
-
-
-
-
- - - - - - - - {{content-for "body-footer"}} - {{content-for "test-body-footer"}} - - diff --git a/test-packages/macro-sample-addon/tests/integration/.gitkeep b/test-packages/macro-sample-addon/tests/integration/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/integration/helpers/reflect-config-test.js b/test-packages/macro-sample-addon/tests/integration/helpers/reflect-config-test.js deleted file mode 100644 index 10025d7a9..000000000 --- a/test-packages/macro-sample-addon/tests/integration/helpers/reflect-config-test.js +++ /dev/null @@ -1,17 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; -import { helper } from '@ember/component/helper'; - -module('Integration | Helper | reflect-config', function (hooks) { - setupRenderingTest(hooks); - - test('it accesses our config', async function (assert) { - assert.expect(1); - this.owner.register('helper:my-assertion', helper(function ([value]) { - assert.deepEqual(value, { hello: 'world' }); - })); - await render(hbs`{{my-assertion (reflect-config) }}`); - }); -}); diff --git a/test-packages/macro-sample-addon/tests/integration/helpers/reflect-updated-config-test.js b/test-packages/macro-sample-addon/tests/integration/helpers/reflect-updated-config-test.js deleted file mode 100644 index dbc4f94f7..000000000 --- a/test-packages/macro-sample-addon/tests/integration/helpers/reflect-updated-config-test.js +++ /dev/null @@ -1,17 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; -import { helper } from '@ember/component/helper'; - -module('Integration | Helper | reflect-updated-config | contentFor | config-module', function (hooks) { - setupRenderingTest(hooks); - - test('it accesses our config', async function (assert) { - assert.expect(1); - this.owner.register('helper:my-assertion', helper(function ([value]) { - assert.equal(value, 'hello new world'); - })); - await render(hbs`{{my-assertion (reflect-updated-config) }}`); - }); -}); diff --git a/test-packages/macro-sample-addon/tests/test-helper.js b/test-packages/macro-sample-addon/tests/test-helper.js deleted file mode 100644 index 4efd6e58a..000000000 --- a/test-packages/macro-sample-addon/tests/test-helper.js +++ /dev/null @@ -1,12 +0,0 @@ -import Application from 'dummy/app'; -import config from 'dummy/config/environment'; -import * as QUnit from 'qunit'; -import { setApplication } from '@ember/test-helpers'; -import { setup } from 'qunit-dom'; -import { start } from 'ember-qunit'; - -setApplication(Application.create(config.APP)); - -setup(QUnit.assert); - -start(); diff --git a/test-packages/macro-sample-addon/tests/unit/.gitkeep b/test-packages/macro-sample-addon/tests/unit/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/unit/dummy-app-test.js b/test-packages/macro-sample-addon/tests/unit/dummy-app-test.js deleted file mode 100644 index bae835b90..000000000 --- a/test-packages/macro-sample-addon/tests/unit/dummy-app-test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { module, test } from 'qunit'; -import { exampleAddonFunction } from 'dummy/example'; - -module('Unit | example-addon-function', function() { - test('our dummy app can resolve a function directly out of our addon', async function(assert) { - assert.equal(exampleAddonFunction(), 'example-addon-function-output'); - }); -}); diff --git a/test-packages/macro-sample-addon/vendor/.gitkeep b/test-packages/macro-sample-addon/vendor/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test-packages/macro-sample-addon/tests/dummy/app/example.js b/tests/fixtures/macro-sample-addon/tests/dummy/app/example.js similarity index 100% rename from test-packages/macro-sample-addon/tests/dummy/app/example.js rename to tests/fixtures/macro-sample-addon/tests/dummy/app/example.js diff --git a/tests/scenarios/macro-test.ts b/tests/scenarios/macro-test.ts index 8f7f539f3..0ddd3864e 100644 --- a/tests/scenarios/macro-test.ts +++ b/tests/scenarios/macro-test.ts @@ -1,4 +1,4 @@ -import { appScenarios, appReleaseScenario } from './scenarios'; +import { appScenarios, appReleaseScenario, addonScenarios } from './scenarios'; import { PreparedApp, Project } from 'scenario-tester'; import QUnit from 'qunit'; import merge from 'lodash/merge'; @@ -112,3 +112,77 @@ appReleaseScenario }); }); }); + +addonScenarios + .map('macro-sample-addon', project => { + let addonFiles = loadFromFixtureData('macro-sample-addon'); + project.name = 'macro-sample-addon'; + project.linkDependency('@embroider/macros', { baseDir: __dirname }); + project.linkDependency('@embroider/webpack', { baseDir: __dirname }); + project.linkDependency('@embroider/compat', { baseDir: __dirname }); + project.linkDependency('@embroider/core', { baseDir: __dirname }); + + addonFiles['index.js'] = ` + module.exports = { + name: require('./package').name, + options: { + '@embroider/macros': { + setOwnConfig: { + hello: 'world', + }, + }, + }, + included(app) { + app.options.autoRun = false; + this._super.included.apply(this, arguments); + }, + contentFor(type, config, contents) { + if (type === 'config-module') { + const originalContents = contents.join(''); + contents.splice(0, contents.length); + contents.push( + 'let config = function() {' + originalContents + '}()', + "config.default.APP.fromConfigModule = 'hello new world';", + 'return config;' + ); + return; + } + + if (type === 'app-boot') { + let appSuffix = 'app'; + let prefix = config.modulePrefix; + let configAppAsString = JSON.stringify(config.APP || {}); + return [ + 'if (!runningTests) {', + " require('{{MODULE_PREFIX}}/" + appSuffix + "')['default'].create({{CONFIG_APP}});", + '}', + 'window.LoadedFromCustomAppBoot = true', + ] + .join('') + .replace(/\{\{MODULE_PREFIX\}\}/g, prefix) + .replace(/\{\{CONFIG_APP\}\}/g, configAppAsString); + } + }, + };`; + + merge(project.files, addonFiles); + }) + .forEachScenario(scenario => { + Qmodule(scenario.name, function (hooks) { + let addon: PreparedApp; + + hooks.before(async () => { + addon = await scenario.prepare(); + }); + + test(`yarn test`, async function (assert) { + let result = await addon.execute('yarn test'); + assert.equal(result.exitCode, 0, result.output); + }); + + test(`yarn test EMBROIDER_TEST_SETUP_FORCE=classic`, async function (assert) { + let result = await addon.execute('cross-env EMBROIDER_TEST_SETUP_FORCE=classic yarn test'); + assert.equal(result.exitCode, 0, result.output); + }); + }); + }); diff --git a/tests/scenarios/scenarios.ts b/tests/scenarios/scenarios.ts index 441185ae7..a9526dbda 100644 --- a/tests/scenarios/scenarios.ts +++ b/tests/scenarios/scenarios.ts @@ -62,7 +62,9 @@ export function onlyRunRelease(scenarios: Scenarios) { } export const appScenarios = supportMatrix(Scenarios.fromDir(dirname(require.resolve('../app-template/package.json')))); - +export const addonScenarios = supportMatrix( + Scenarios.fromDir(dirname(require.resolve('../addon-template/package.json'))) +); export const appReleaseScenario = onlyRunRelease( Scenarios.fromDir(dirname(require.resolve('../app-template/package.json'))) ); diff --git a/yarn.lock b/yarn.lock index 40488d1fa..90ea4092e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7558,7 +7558,7 @@ ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.16.0, ember-cli-babel@^6.6.0: ember-cli-version-checker "^2.1.2" semver "^5.5.0" -ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.3, ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.21.0, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.3, ember-cli-babel@^7.26.4, ember-cli-babel@^7.26.6, ember-cli-babel@^7.4.0, ember-cli-babel@^7.4.1, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3: +ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.3, ember-cli-babel@^7.10.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.21.0, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.3, ember-cli-babel@^7.26.4, ember-cli-babel@^7.26.6, ember-cli-babel@^7.4.0, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3: version "7.26.6" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.26.6.tgz#322fbbd3baad9dd99e3276ff05bc6faef5e54b39" integrity sha512-040svtfj2RC35j/WMwdWJFusZaXmNoytLAMyBDGLMSlRvznudTxZjGlPV6UupmtTBApy58cEF8Fq4a+COWoEmQ== @@ -7744,8 +7744,7 @@ ember-cli-get-component-path-option@^1.0.0: resolved "https://registry.yarnpkg.com/ember-cli-get-component-path-option/-/ember-cli-get-component-path-option-1.0.0.tgz#0d7b595559e2f9050abed804f1d8eff1b08bc771" integrity sha1-DXtZVVni+QUKvtgE8djv8bCLx3E= -"ember-cli-htmlbars-3@npm:ember-cli-htmlbars@3", ember-cli-htmlbars@^3.0.1: - name ember-cli-htmlbars-3 +"ember-cli-htmlbars-3@npm:ember-cli-htmlbars@3": version "3.1.0" resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-3.1.0.tgz#87806c2a0bca2ab52d4fb8af8e2215c1ca718a99" integrity sha512-cgvRJM73IT0aePUG7oQ/afB7vSRBV3N0wu9BrWhHX2zkR7A7cUBI7KC9VPk6tbctCXoM7BRGsCC4aIjF7yrfXA== @@ -9124,16 +9123,6 @@ ember-try@^1.0.0, ember-try@^1.4.0: rsvp "^4.7.0" walk-sync "^1.1.3" -ember-welcome-page@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/ember-welcome-page/-/ember-welcome-page-4.0.0.tgz#14f5ef8b477f9480c39548d3ebd51f5c4ffb0a14" - integrity sha512-2lpElRFDjFVE0LohJn9j7FWYt5rGHZ7TmiPgknsS+9BYFFmaJnBQKAz9KZXxWRmS/mCjVUuUec1YhojtOJJ/Sg== - dependencies: - broccoli-funnel "^2.0.2" - ember-cli-babel "^7.4.1" - ember-cli-htmlbars "^3.0.1" - ember-compatibility-helpers "^1.1.2" - emit-function@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/emit-function/-/emit-function-0.0.2.tgz#e3a50b3d61be1bf8ca88b924bf713157a5bec124"