diff --git a/.eslintrc.js b/.eslintrc.js index 4a2bddf..f7c101d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { root: true, parserOptions: { - ecmaVersion: 2017, + ecmaVersion: 2018, sourceType: 'module', }, plugins: ['ember'], diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5a8b32..2d0b07e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Set Node.js uses: actions/setup-node@master with: - node-version: 10.24.1 + node-version: 12.22.8 - name: Get yarn cache id: yarn-cache diff --git a/.tool-versions b/.tool-versions index a61cf12..4f50dcb 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -nodejs 10.24.1 +nodejs 12.22.8 diff --git a/.travis.yml b/.travis.yml index c02e3b3..544b700 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ 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 - - '6' + - '8' sudo: false dist: trusty diff --git a/README.md b/README.md index d034ff0..b115129 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A textbox that will guess the date you want and assign it to your model or query - Ember.js v2.18 or above - Ember CLI v2.13 or above +- Node.js v8 or above ## Installation diff --git a/package.json b/package.json index 63b25ba..cd8fd02 100644 --- a/package.json +++ b/package.json @@ -52,25 +52,25 @@ "update-browserslist": "npx browserslist@latest --update-db" }, "dependencies": { - "ember-cli-babel": "^7.1.2", + "ember-cli-babel": "^7.7.3", "ember-cli-node-assets": "^0.2.2" }, "devDependencies": { - "@ember/jquery": "^1", + "@ember/jquery": "^2.0.0", "@ember/optional-features": "^2.0.0", "bootstrap": "~3.4.1", "bootstrap-sass": "~3.4.3", "bootswatch": "~3.4.1", - "broccoli-asset-rev": "^2.7.0", + "broccoli-asset-rev": "^3.0.0", "ember-auto-import": "~1.11", - "ember-cli": "~3.9.0", + "ember-cli": "~3.10.1", "ember-cli-dependency-checker": "^3.1.0", "ember-cli-deploy": "^1.0.2", "ember-cli-deploy-build": "^1.1.1", "ember-cli-deploy-gzip": "^1.0.1", "ember-cli-deploy-s3": "^3.1.0", - "ember-cli-eslint": "^4.2.3", - "ember-cli-htmlbars": "^3.0.0", + "ember-cli-eslint": "^5.1.0", + "ember-cli-htmlbars": "^3.0.1", "ember-cli-htmlbars-inline-precompile": "^3.0.2", "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-moment-shim": "^3.7.1", @@ -79,32 +79,30 @@ "ember-cli-template-lint": "^1.0.0-beta.1", "ember-cli-text-support-mixins": "~3.9.0", "ember-cli-uglify": "^3.0.0", - "ember-cli-update": "0.56", + "ember-cli-update": "^1.0.1", "ember-disable-prototype-extensions": "^1.1.3", "ember-export-application-global": "^2.0.0", "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^0.1.6", "ember-moment": "^7.8.0", - "ember-qunit": "^3.4.1", + "ember-qunit": "^4.4.1", "ember-resolver": "^8.0.3", - "ember-route-action-helper": "^2.0.6", - "ember-source": "~3.9.0", + "ember-source": "~3.10.0", "ember-source-channel-url": "^3.0.0", "ember-try": "^1.0.0", - "ember-welcome-page": "^3.0.0", - "eslint-plugin-ember": "^5.2.0", + "eslint-plugin-ember": "^6.2.0", "eslint-plugin-node": "^11.1.0", "font-awesome": "4.7", "keyevent": "^1.1.0", "loader.js": "^4.7.0", "mockdate": "^3.0.5", "prettier": "^2.6.2", - "qunit-dom": "^0.8.0", - "sass": "~1.48", + "qunit-dom": "^0.8.4", + "sass": "^1.50.0", "sugar-date": "^2.0.4" }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": "8.* || >= 10.*" }, "ember-addon": { "configPath": "tests/dummy/config", diff --git a/tests/dummy/app/controllers/index.js b/tests/dummy/app/controllers/index.js index 8f59ccc..fd69207 100644 --- a/tests/dummy/app/controllers/index.js +++ b/tests/dummy/app/controllers/index.js @@ -1,8 +1,20 @@ -import { isPresent } from '@ember/utils'; -import { computed } from '@ember/object'; import Controller from '@ember/controller'; +import { computed } from '@ember/object'; +import { isPresent } from '@ember/utils'; export default Controller.extend({ + actions: { + submitDate() { + const dateString = isPresent(this.submittedDate) ? this.submittedDate.toString() : null; + window.alert(`Form was submitted and this is the String value: ${dateString}`); + return false; + }, + submitIso8601() { + window.alert(`Form was submitted and this is the String value: ${this.submittedIso8601}`); + return false; + }, + }, + ambiguousFuture: null, ambiguousFutureISOString: computed('ambiguousFuture', function () { diff --git a/tests/dummy/app/routes/index.js b/tests/dummy/app/routes/index.js index 66d8773..8677e5d 100644 --- a/tests/dummy/app/routes/index.js +++ b/tests/dummy/app/routes/index.js @@ -1,22 +1,8 @@ import { hash } from 'rsvp'; -import { isPresent } from '@ember/utils'; + import Route from '@ember/routing/route'; export default Route.extend({ - actions: { - submitDate() { - const dateString = isPresent(this.get('controller.submittedDate')) - ? this.get('controller.submittedDate').toString() - : null; - window.alert(`Form was submitted and this is the String value: ${dateString}`); - return false; - }, - submitIso8601() { - window.alert(`Form was submitted and this is the String value: ${this.get('controller.submittedIso8601')}`); - return false; - }, - }, - model() { return hash({ naftaSigned: new Date(1987, 9, 3), diff --git a/tests/dummy/app/templates/index.hbs b/tests/dummy/app/templates/index.hbs index da47cdd..3e9b02f 100644 --- a/tests/dummy/app/templates/index.hbs +++ b/tests/dummy/app/templates/index.hbs @@ -33,6 +33,7 @@ date=demoDate classNames="form-control" displayFormat="LLLL" + enterSubmitsForm?=false placeholder="Try typing a date and then press enter." aria-describedby="demo-date-addon" }} @@ -54,6 +55,7 @@ date=ambiguousFuture classNames="form-control" displayFormat="LLLL" + enterSubmitsForm?=false future?=true placeholder="Try an ambiguous date like `jan` or `wed`" aria-describedby="demo-date-addon" @@ -79,6 +81,7 @@ {{input-date classNames="form-control" date=model.naftaSigned + enterSubmitsForm?=false placeholder="You cleared the date. Now we don't know when NAFTA was signed." }} @@ -107,6 +110,7 @@ classNames="form-control" date=dateWithTimezone displayFormat="llll z" + enterSubmitsForm?=false timezone="Europe/Rome" placeholder="Try typing a date and then press enter." aria-describedby="date-addon" @@ -144,6 +148,7 @@