From 3fbe9661edac6be28c8b846a47cc2020191085ca Mon Sep 17 00:00:00 2001 From: nolaneo Date: Wed, 10 Mar 2021 21:41:34 +0000 Subject: [PATCH] update ember --- .eslintignore | 1 + .eslintrc.js | 37 +++++++++++------------ .gitignore | 1 + .prettierignore | 21 +++++++++++++ .prettierrc.js | 5 ++++ .template-lintrc.js | 2 +- .travis.yml | 2 +- app/app.js | 2 +- app/router.js | 5 ++-- app/templates/application.hbs | 2 ++ config/ember-cli-update.json | 17 +++++++++++ config/environment.js | 8 ++--- config/targets.js | 6 ++-- ember-cli-build.js | 2 +- package.json | 55 ++++++++++++++++++++--------------- testem.js | 16 ++++------ tests/index.html | 7 +++++ tests/test-helper.js | 8 +++-- 18 files changed, 128 insertions(+), 69 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.js create mode 100644 config/ember-cli-update.json diff --git a/.eslintignore b/.eslintignore index 72df373..9221655 100644 --- a/.eslintignore +++ b/.eslintignore @@ -13,6 +13,7 @@ # misc /coverage/ !.* +.eslintcache # ember-try /.node_modules.ember-try/ diff --git a/.eslintrc.js b/.eslintrc.js index f3c9d4f..da079e3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,50 +7,47 @@ module.exports = { ecmaVersion: 2018, sourceType: 'module', ecmaFeatures: { - legacyDecorators: true - } + legacyDecorators: true, + }, }, - plugins: [ - 'ember' - ], + plugins: ['ember'], extends: [ 'eslint:recommended', - 'plugin:ember/recommended' + 'plugin:ember/recommended', + 'plugin:prettier/recommended', ], env: { - browser: true - }, - rules: { - 'ember/no-jquery': 'error' + 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' + 'server/**/*.js', ], parserOptions: { - sourceType: 'script' + sourceType: 'script', }, env: { browser: false, - node: true + node: true, }, plugins: ['node'], - rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { - // add your custom rules and overrides for node files here - + 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' - }) - } - ] + 'node/no-unpublished-require': 'off', + }, + }, + ], }; diff --git a/.gitignore b/.gitignore index c40a1b2..7e0f7dd 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /.env* /.pnp* /.sass-cache +/.eslintcache /connect.lock /coverage/ /libpeerconnection.log diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9221655 --- /dev/null +++ b/.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/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..534e6d3 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + singleQuote: true, +}; diff --git a/.template-lintrc.js b/.template-lintrc.js index f387370..3b0b9af 100644 --- a/.template-lintrc.js +++ b/.template-lintrc.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = { - extends: 'octane' + extends: 'octane', }; diff --git a/.travis.yml b/.travis.yml index 45bca26..5b5ce9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: node_js node_js: - "10" -dist: trusty +dist: xenial addons: chrome: stable diff --git a/app/app.js b/app/app.js index d8e2088..6ed7bb0 100644 --- a/app/app.js +++ b/app/app.js @@ -1,7 +1,7 @@ import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -import config from './config/environment'; +import config from 'seconds/config/environment'; export default class App extends Application { modulePrefix = config.modulePrefix; diff --git a/app/router.js b/app/router.js index 224ca42..14cd115 100644 --- a/app/router.js +++ b/app/router.js @@ -1,10 +1,9 @@ import EmberRouter from '@ember/routing/router'; -import config from './config/environment'; +import config from 'seconds/config/environment'; export default class Router extends EmberRouter { location = config.locationType; rootURL = config.rootURL; } -Router.map(function() { -}); +Router.map(function () {}); diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 7b1b104..39590b7 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,3 +1,5 @@ +{{page-title "Seconds"}} + {{!-- The following component displays Ember's default welcome message. --}} {{!-- Feel free to remove this! --}} diff --git a/config/ember-cli-update.json b/config/ember-cli-update.json new file mode 100644 index 0000000..d5716a9 --- /dev/null +++ b/config/ember-cli-update.json @@ -0,0 +1,17 @@ +{ + "schemaVersion": "1.0.0", + "packages": [ + { + "name": "ember-cli", + "version": "3.25.2", + "blueprints": [ + { + "name": "app", + "outputRepo": "https://github.com/ember-cli/ember-new-output", + "codemodsSource": "ember-app-codemods-manifest@1", + "isBaseBlueprint": true + } + ] + } + ] +} diff --git a/config/environment.js b/config/environment.js index fa4fc6e..15afe5f 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,6 +1,6 @@ 'use strict'; -module.exports = function(environment) { +module.exports = function (environment) { let ENV = { modulePrefix: 'seconds', environment, @@ -13,14 +13,14 @@ module.exports = function(environment) { }, EXTEND_PROTOTYPES: { // Prevent Ember Data from overriding Date.parse. - Date: false - } + Date: false, + }, }, APP: { // Here you can pass flags/options to your application instance // when it is created - } + }, }; if (environment === 'development') { diff --git a/config/targets.js b/config/targets.js index 8ffae36..4b33327 100644 --- a/config/targets.js +++ b/config/targets.js @@ -3,10 +3,10 @@ const browsers = [ 'last 1 Chrome versions', 'last 1 Firefox versions', - 'last 1 Safari versions' + 'last 1 Safari versions', ]; -const isCI = !!process.env.CI; +const isCI = Boolean(process.env.CI); const isProduction = process.env.EMBER_ENV === 'production'; if (isCI || isProduction) { @@ -14,5 +14,5 @@ if (isCI || isProduction) { } module.exports = { - browsers + browsers, }; diff --git a/ember-cli-build.js b/ember-cli-build.js index d690a25..48e94e9 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,7 +2,7 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); -module.exports = function(defaults) { +module.exports = function (defaults) { let app = new EmberApp(defaults, { // Add options here }); diff --git a/package.json b/package.json index cc46eb4..c8011fe 100644 --- a/package.json +++ b/package.json @@ -12,44 +12,53 @@ }, "scripts": { "build": "ember build --environment=production", - "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*", + "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:js": "eslint .", + "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": "npm-run-all lint test:*", "test:ember": "ember test" }, "devDependencies": { - "@ember/optional-features": "^1.3.0", - "@glimmer/component": "^1.0.0", - "@glimmer/tracking": "^1.0.0", + "@ember/optional-features": "^2.0.0", + "@ember/test-helpers": "^2.2.0", + "@glimmer/component": "^1.0.3", + "@glimmer/tracking": "^1.0.3", "babel-eslint": "^10.1.0", "broccoli-asset-rev": "^3.0.0", - "ember-auto-import": "^1.5.3", - "ember-cli": "~3.17.0", - "ember-cli-app-version": "^3.2.0", - "ember-cli-babel": "^7.18.0", + "ember-auto-import": "^1.10.1", + "ember-cli": "~3.25.2", + "ember-cli-app-version": "^4.0.0", + "ember-cli-babel": "^7.23.1", "ember-cli-dependency-checker": "^3.2.0", - "ember-cli-htmlbars": "^4.2.3", + "ember-cli-htmlbars": "^5.3.2", "ember-cli-inject-live-reload": "^2.0.2", "ember-cli-sri": "^2.1.1", - "ember-cli-uglify": "^3.0.0", - "ember-data": "~3.17.0", + "ember-cli-terser": "^4.0.1", + "ember-data": "~3.25.0", "ember-export-application-global": "^2.0.1", - "ember-fetch": "^7.0.1", - "ember-load-initializers": "^2.1.1", + "ember-fetch": "^8.0.4", + "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^0.1.6", - "ember-qunit": "^4.6.0", - "ember-resolver": "^7.0.0", - "ember-source": "~3.17.0", - "ember-template-lint": "^2.4.0", + "ember-page-title": "^6.2.1", + "ember-qunit": "^5.1.2", + "ember-resolver": "^8.0.2", + "ember-source": "~3.25.1", + "ember-template-lint": "^2.18.1", "ember-welcome-page": "^4.0.0", - "eslint": "^6.8.0", - "eslint-plugin-ember": "^7.10.1", - "eslint-plugin-node": "^11.0.0", + "eslint": "^7.20.0", + "eslint-config-prettier": "^7.2.0", + "eslint-plugin-ember": "^10.2.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.3.1", "loader.js": "^4.7.0", "npm-run-all": "^4.1.5", - "qunit-dom": "^1.1.0" + "prettier": "^2.2.1", + "qunit": "^2.14.0", + "qunit-dom": "^1.6.0" }, "engines": { "node": "10.* || >= 12" diff --git a/testem.js b/testem.js index 49f53fe..ed2f371 100644 --- a/testem.js +++ b/testem.js @@ -3,12 +3,8 @@ module.exports = { test_page: 'tests/index.html?hidepassed', disable_watching: true, - launch_in_ci: [ - 'Chrome' - ], - launch_in_dev: [ - 'Chrome' - ], + launch_in_ci: ['Chrome'], + launch_in_dev: ['Chrome'], browser_start_timeout: 120, browser_args: { Chrome: { @@ -20,8 +16,8 @@ module.exports = { '--disable-software-rasterizer', '--mute-audio', '--remote-debugging-port=0', - '--window-size=1440,900' - ].filter(Boolean) - } - } + '--window-size=1440,900', + ].filter(Boolean), + }, + }, }; diff --git a/tests/index.html b/tests/index.html index bd2b977..c6f020e 100644 --- a/tests/index.html +++ b/tests/index.html @@ -21,6 +21,13 @@ {{content-for "body"}} {{content-for "test-body"}} +
+
+
+
+
+
+ diff --git a/tests/test-helper.js b/tests/test-helper.js index 0382a84..a56344c 100644 --- a/tests/test-helper.js +++ b/tests/test-helper.js @@ -1,8 +1,12 @@ -import Application from '../app'; -import config from '../config/environment'; +import Application from 'seconds/app'; +import config from 'seconds/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();