diff --git a/test-packages/test-scenarios/classic-app-template/.editorconfig b/test-packages/test-scenarios/classic-app-template/.editorconfig new file mode 100644 index 000000000..c35a00240 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.editorconfig @@ -0,0 +1,19 @@ +# 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/test-scenarios/classic-app-template/.ember-cli b/test-packages/test-scenarios/classic-app-template/.ember-cli new file mode 100644 index 000000000..ee64cfed2 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + 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/test-scenarios/classic-app-template/.eslintignore b/test-packages/test-scenarios/classic-app-template/.eslintignore new file mode 100644 index 000000000..701947ed3 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.eslintignore @@ -0,0 +1,22 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/test-packages/test-scenarios/classic-app-template/.eslintrc.js b/test-packages/test-scenarios/classic-app-template/.eslintrc.js new file mode 100644 index 000000000..41a1a43d8 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.eslintrc.js @@ -0,0 +1,58 @@ +'use strict'; + +module.exports = { + root: true, + parser: 'babel-eslint', + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + ecmaFeatures: { + legacyDecorators: true, + }, + }, + plugins: ['ember'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + env: { + browser: true, + }, + rules: {}, + overrides: [ + // node files + { + files: [ + './.eslintrc.js', + './.prettierrc.js', + './.template-lintrc.js', + './ember-cli-build.js', + './testem.js', + './blueprints/*/index.js', + './config/**/*.js', + './lib/*/index.js', + './server/**/*.js', + ], + parserOptions: { + sourceType: 'script', + }, + env: { + browser: false, + node: true, + }, + plugins: ['node'], + extends: ['plugin:node/recommended'], + rules: { + // this can be removed once the following is fixed + // https://github.com/mysticatea/eslint-plugin-node/issues/77 + 'node/no-unpublished-require': 'off', + }, + }, + { + // Test files: + files: ['tests/**/*-test.{js,ts}'], + extends: ['plugin:qunit/recommended'], + }, + ], +}; diff --git a/test-packages/test-scenarios/classic-app-template/.gitignore b/test-packages/test-scenarios/classic-app-template/.gitignore new file mode 100644 index 000000000..7e0f7ddce --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.gitignore @@ -0,0 +1,26 @@ +# 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 +/.eslintcache +/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/test-scenarios/classic-app-template/.prettierignore b/test-packages/test-scenarios/classic-app-template/.prettierignore new file mode 100644 index 000000000..922165552 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.prettierignore @@ -0,0 +1,21 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/test-packages/test-scenarios/classic-app-template/.prettierrc.js b/test-packages/test-scenarios/classic-app-template/.prettierrc.js new file mode 100644 index 000000000..534e6d35a --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.prettierrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + singleQuote: true, +}; diff --git a/test-packages/test-scenarios/classic-app-template/.template-lintrc.js b/test-packages/test-scenarios/classic-app-template/.template-lintrc.js new file mode 100644 index 000000000..f35f61c7b --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.template-lintrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + extends: 'recommended', +}; diff --git a/test-packages/test-scenarios/classic-app-template/.travis.yml b/test-packages/test-scenarios/classic-app-template/.travis.yml new file mode 100644 index 000000000..bf02ddcad --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.travis.yml @@ -0,0 +1,25 @@ +--- +language: node_js +node_js: + - "12" + +dist: xenial + +addons: + chrome: stable + +cache: + directories: + - $HOME/.npm + +env: + global: + # See https://git.io/vdao3 for details. + - JOBS=1 + +branches: + only: + - master + +script: + - npm test diff --git a/test-packages/test-scenarios/classic-app-template/.watchmanconfig b/test-packages/test-scenarios/classic-app-template/.watchmanconfig new file mode 100644 index 000000000..e7834e3e4 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp", "dist"] +} diff --git a/test-packages/test-scenarios/classic-app-template/README.md b/test-packages/test-scenarios/classic-app-template/README.md new file mode 100644 index 000000000..2baf47512 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/README.md @@ -0,0 +1,56 @@ +# classic-app-template + +This README outlines the details of collaborating on this Ember application. +A short introduction of this app could easily go here. + +## Prerequisites + +You will need the following things properly installed on your computer. + +* [Git](https://git-scm.com/) +* [Node.js](https://nodejs.org/) (with npm) +* [Ember CLI](https://ember-cli.com/) +* [Google Chrome](https://google.com/chrome/) + +## Installation + +* `git clone ` this repository +* `cd classic-app-template` +* `npm install` + +## Running / Development + +* `ember serve` +* Visit your app at [http://localhost:4200](http://localhost:4200). +* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). + +### Code Generators + +Make use of the many generators for code, try `ember help generate` for more details + +### Running Tests + +* `ember test` +* `ember test --server` + +### Linting + +* `npm run lint` +* `npm run lint:fix` + +### Building + +* `ember build` (development) +* `ember build --environment production` (production) + +### Deploying + +Specify what it takes to deploy your app. + +## Further Reading / Useful Links + +* [ember.js](https://emberjs.com/) +* [ember-cli](https://ember-cli.com/) +* Development Browser Extensions + * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) + * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/test-packages/test-scenarios/classic-app-template/app/app.js b/test-packages/test-scenarios/classic-app-template/app/app.js new file mode 100644 index 000000000..712d658f2 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/app/app.js @@ -0,0 +1,12 @@ +import Application from '@ember/application'; +import Resolver from 'ember-resolver'; +import loadInitializers from 'ember-load-initializers'; +import config from 'classic-app-template/config/environment'; + +export default class App extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; +} + +loadInitializers(App, config.modulePrefix); diff --git a/test-packages/test-scenarios/classic-app-template/app/components/.gitkeep b/test-packages/test-scenarios/classic-app-template/app/components/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/controllers/.gitkeep b/test-packages/test-scenarios/classic-app-template/app/controllers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/helpers/.gitkeep b/test-packages/test-scenarios/classic-app-template/app/helpers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/index.html b/test-packages/test-scenarios/classic-app-template/app/index.html new file mode 100644 index 000000000..637f1948f --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/app/index.html @@ -0,0 +1,25 @@ + + + + + + ClassicAppTemplate + + + + {{content-for "head"}} + + + + + {{content-for "head-footer"}} + + + {{content-for "body"}} + + + + + {{content-for "body-footer"}} + + diff --git a/test-packages/test-scenarios/classic-app-template/app/models/.gitkeep b/test-packages/test-scenarios/classic-app-template/app/models/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/router.js b/test-packages/test-scenarios/classic-app-template/app/router.js new file mode 100644 index 000000000..174d0ffb7 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/app/router.js @@ -0,0 +1,9 @@ +import EmberRouter from '@ember/routing/router'; +import config from 'classic-app-template/config/environment'; + +export default class Router extends EmberRouter { + location = config.locationType; + rootURL = config.rootURL; +} + +Router.map(function () {}); diff --git a/test-packages/test-scenarios/classic-app-template/app/routes/.gitkeep b/test-packages/test-scenarios/classic-app-template/app/routes/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/styles/app.css b/test-packages/test-scenarios/classic-app-template/app/styles/app.css new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/app/templates/application.hbs b/test-packages/test-scenarios/classic-app-template/app/templates/application.hbs new file mode 100644 index 000000000..30c0cc27c --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/app/templates/application.hbs @@ -0,0 +1,7 @@ +{{page-title "ClassicAppTemplate"}} + +{{!-- 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/test-scenarios/classic-app-template/config/ember-cli-update.json b/test-packages/test-scenarios/classic-app-template/config/ember-cli-update.json new file mode 100644 index 000000000..380486f0b --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/config/ember-cli-update.json @@ -0,0 +1,18 @@ +{ + "schemaVersion": "1.0.0", + "packages": [ + { + "name": "ember-cli", + "version": "3.28.5", + "blueprints": [ + { + "name": "app", + "outputRepo": "https://github.com/ember-cli/ember-new-output", + "codemodsSource": "ember-app-codemods-manifest@1", + "isBaseBlueprint": true, + "options": [] + } + ] + } + ] +} diff --git a/test-packages/test-scenarios/classic-app-template/config/environment.js b/test-packages/test-scenarios/classic-app-template/config/environment.js new file mode 100644 index 000000000..7a8c43e5f --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/config/environment.js @@ -0,0 +1,51 @@ +'use strict'; + +module.exports = function (environment) { + let ENV = { + modulePrefix: 'classic-app-template', + 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/test-scenarios/classic-app-template/config/optional-features.json b/test-packages/test-scenarios/classic-app-template/config/optional-features.json new file mode 100644 index 000000000..b26286e2e --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/config/optional-features.json @@ -0,0 +1,6 @@ +{ + "application-template-wrapper": false, + "default-async-observers": true, + "jquery-integration": false, + "template-only-glimmer-components": true +} diff --git a/test-packages/test-scenarios/classic-app-template/config/targets.js b/test-packages/test-scenarios/classic-app-template/config/targets.js new file mode 100644 index 000000000..3cd797ab4 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/config/targets.js @@ -0,0 +1,26 @@ +'use strict'; + +const browsers = [ + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions', +]; + +// Ember's browser support policy is changing, and IE11 support will end in +// v4.0 onwards. +// +// See https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy +// +// If you need IE11 support on a version of Ember that still offers support +// for it, uncomment the code block below. +// +// const isCI = Boolean(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/test-scenarios/classic-app-template/ember-cli-build.js b/test-packages/test-scenarios/classic-app-template/ember-cli-build.js new file mode 100644 index 000000000..48e94e9e4 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/ember-cli-build.js @@ -0,0 +1,24 @@ +'use strict'; + +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +module.exports = function (defaults) { + let app = new EmberApp(defaults, { + // Add options here + }); + + // Use `app.import` to add additional libraries to the generated + // output files. + // + // If you need to use different assets in different + // environments, specify an object as the first parameter. That + // object's keys should be the environment name and the values + // should be the asset to use in that environment. + // + // If the library that you are including contains AMD or ES6 + // modules that you would like to import into your application + // please specify an object with the list of modules as keys + // along with the exports of each module as its value. + + return app.toTree(); +}; diff --git a/test-packages/test-scenarios/classic-app-template/package.json b/test-packages/test-scenarios/classic-app-template/package.json new file mode 100644 index 000000000..014c10241 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/package.json @@ -0,0 +1,70 @@ +{ + "name": "classic-app-template", + "version": "0.0.0", + "private": true, + "description": "Small description for classic-app-template goes here", + "repository": "", + "license": "MIT", + "author": "", + "directories": { + "doc": "doc", + "test": "tests" + }, + "scripts": { + "build": "ember build --environment=production", + "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", + "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", + "lint:hbs": "ember-template-lint .", + "lint:hbs:fix": "ember-template-lint . --fix", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "start": "ember serve", + "test": "npm-run-all lint test:*", + "test:ember": "ember test" + }, + "devDependencies": { + "@ember/optional-features": "^2.0.0", + "@ember/test-helpers": "^2.6.0", + "@glimmer/component": "^1.0.4", + "@glimmer/tracking": "^1.0.4", + "babel-eslint": "^10.1.0", + "broccoli-asset-rev": "^3.0.0", + "ember-auto-import": "^1.12.0", + "ember-cli": "~3.28.5", + "ember-cli-app-version": "^5.0.0", + "ember-cli-babel": "^7.26.10", + "ember-cli-dependency-checker": "^3.2.0", + "ember-cli-htmlbars": "^5.7.2", + "ember-cli-inject-live-reload": "^2.1.0", + "ember-cli-sri": "^2.1.1", + "ember-cli-terser": "^4.0.2", + "ember-data": "~3.28.6", + "ember-export-application-global": "^2.0.1", + "ember-fetch": "^8.1.1", + "ember-load-initializers": "^2.1.2", + "ember-maybe-import-regenerator": "^0.1.6", + "ember-page-title": "^6.2.2", + "ember-qunit": "^5.1.5", + "ember-resolver": "^8.0.3", + "ember-source": "~3.28.8", + "ember-template-lint": "^3.15.0", + "ember-welcome-page": "^4.1.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-ember": "^10.5.8", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.4.1", + "eslint-plugin-qunit": "^6.2.0", + "loader.js": "^4.7.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.5.1", + "qunit": "^2.17.2", + "qunit-dom": "^1.6.0" + }, + "engines": { + "node": "12.* || 14.* || >= 16" + }, + "ember": { + "edition": "octane" + } +} diff --git a/test-packages/test-scenarios/classic-app-template/public/robots.txt b/test-packages/test-scenarios/classic-app-template/public/robots.txt new file mode 100644 index 000000000..f5916452e --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/public/robots.txt @@ -0,0 +1,3 @@ +# http://www.robotstxt.org +User-agent: * +Disallow: diff --git a/test-packages/test-scenarios/classic-app-template/testem.js b/test-packages/test-scenarios/classic-app-template/testem.js new file mode 100644 index 000000000..ed2f37124 --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/testem.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = { + test_page: 'tests/index.html?hidepassed', + disable_watching: true, + launch_in_ci: ['Chrome'], + launch_in_dev: ['Chrome'], + browser_start_timeout: 120, + browser_args: { + Chrome: { + ci: [ + // --no-sandbox is needed when running Chrome inside a container + process.env.CI ? '--no-sandbox' : null, + '--headless', + '--disable-dev-shm-usage', + '--disable-software-rasterizer', + '--mute-audio', + '--remote-debugging-port=0', + '--window-size=1440,900', + ].filter(Boolean), + }, + }, +}; diff --git a/test-packages/test-scenarios/classic-app-template/tests/helpers/.gitkeep b/test-packages/test-scenarios/classic-app-template/tests/helpers/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/tests/index.html b/test-packages/test-scenarios/classic-app-template/tests/index.html new file mode 100644 index 000000000..ff750802d --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/tests/index.html @@ -0,0 +1,40 @@ + + + + + + ClassicAppTemplate 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/test-scenarios/classic-app-template/tests/integration/.gitkeep b/test-packages/test-scenarios/classic-app-template/tests/integration/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/tests/test-helper.js b/test-packages/test-scenarios/classic-app-template/tests/test-helper.js new file mode 100644 index 000000000..8878c223b --- /dev/null +++ b/test-packages/test-scenarios/classic-app-template/tests/test-helper.js @@ -0,0 +1,12 @@ +import Application from 'classic-app-template/app'; +import config from 'classic-app-template/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/test-scenarios/classic-app-template/tests/unit/.gitkeep b/test-packages/test-scenarios/classic-app-template/tests/unit/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test-packages/test-scenarios/classic-app-template/vendor/.gitkeep b/test-packages/test-scenarios/classic-app-template/vendor/.gitkeep new file mode 100644 index 000000000..e69de29bb