diff --git a/.editorconfig b/.editorconfig index bdb5516..4e0d4fd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,6 @@ root = true - [*] end_of_line = lf charset = utf-8 diff --git a/.eslintignore b/.eslintignore index 8711c0a..701947e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,22 @@ -modules/** -node_modules/** -blueprints/*/files/**/*.js +# 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/.eslintrc.js b/.eslintrc.js index 988120d..2b5199f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,16 +1,50 @@ +'use strict'; + module.exports = { + root: true, + parser: 'babel-eslint', parserOptions: { - ecmaVersion: 2017, - sourceType: 'module' + ecmaVersion: 2018, + sourceType: 'module', + ecmaFeatures: { + legacyDecorators: true, + }, }, - extends: ['prettier'], - plugins: ['ember', 'prettier'], - extends: ['eslint:recommended', 'plugin:ember/recommended'], + plugins: ['ember'], + extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'], env: { browser: true, - node: true }, - rules: { - 'prettier/prettier': 'error' - } + rules: {}, + overrides: [ + // node files + { + files: [ + './compile-css.js', + './.eslintrc.js', + './.prettierrc.js', + './.template-lintrc.js', + './ember-cli-build.js', + './index.js', + './testem.js', + './blueprints/*/index.js', + './config/**/*.js', + './tests/dummy/config/**/*.js', + ], + parserOptions: { + sourceType: 'script', + }, + env: { + browser: false, + node: true, + }, + plugins: ['node'], + extends: ['plugin:node/recommended'], + }, + { + // Test files: + files: ['tests/**/*-test.{js,ts}'], + extends: ['plugin:qunit/recommended'], + }, + ], }; diff --git a/.gitignore b/.gitignore index 0bab2e0..22a0c19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,26 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist -/tmp +/dist/ +/tmp/ # dependencies -/node_modules -/bower_components +/bower_components/ +/node_modules/ # misc +/.env* +/.pnp* /.sass-cache +/.eslintcache /connect.lock -/coverage/* +/coverage/ /libpeerconnection.log -npm-debug.log* -yarn-error.log -testem.log +/npm-debug.log* +/testem.log +/yarn-error.log # ember-try -.node_modules.ember-try/ -bower.json.ember-try -package.json.ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/.npmignore b/.npmignore index 99d72e1..f30effe 100644 --- a/.npmignore +++ b/.npmignore @@ -1,22 +1,36 @@ -/bower_components +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ + +# misc +/.bowerrc +/.editorconfig +/.ember-cli +/.env* +/.eslintcache +/.eslintignore +/.eslintrc.js +/.git/ +/.gitignore +/.prettierignore +/.prettierrc.js +/.template-lintrc.js +/.travis.yml +/.watchmanconfig +/bower.json /config/ember-try.js -/dist -/tests -/tmp -**/.gitkeep -.bowerrc -.editorconfig -.ember-cli -.eslintrc.js -.gitignore -.jshintrc -.watchmanconfig -.travis.yml -bower.json -ember-cli-build.js -testem.js +/CONTRIBUTING.md +/ember-cli-build.js +/testem.js +/tests/ +/yarn-error.log +/yarn.lock +.gitkeep # ember-try -.node_modules.ember-try/ -bower.json.ember-try -package.json.ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try 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 new file mode 100644 index 0000000..f35f61c --- /dev/null +++ b/.template-lintrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + extends: 'recommended', +}; diff --git a/.travis.yml b/.travis.yml index 6ced19e..9b3dfab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,9 @@ 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" + - "12" -sudo: false -dist: trusty +dist: xenial addons: chrome: stable @@ -19,29 +18,44 @@ env: global: # See https://git.io/vdao3 for details. - JOBS=1 - matrix: - # we recommend new addons test the current and previous LTS - # as well as latest stable release (bonus points to beta/canary) - - EMBER_TRY_SCENARIO=ember-lts-2.18 - - EMBER_TRY_SCENARIO=ember-lts-3.12 - - EMBER_TRY_SCENARIO=ember-lts-3.16 - - EMBER_TRY_SCENARIO=ember-lts-3.20 - - EMBER_TRY_SCENARIO=ember-release - - EMBER_TRY_SCENARIO=ember-beta - - EMBER_TRY_SCENARIO=ember-canary - - EMBER_TRY_SCENARIO=ember-default-with-jquery - - EMBER_TRY_SCENARIO=ember-classic - -matrix: + +branches: + only: + - master + # npm version tags + - /^v\d+\.\d+\.\d+/ + +jobs: fast_finish: true allow_failures: - env: EMBER_TRY_SCENARIO=ember-canary -before_install: - - npm uninstall -D husky lint-staged + include: + # runs linting and tests with current locked deps + - stage: "Tests" + name: "Tests" + script: + - npm run lint + - npm run test:ember + + - stage: "Additional Tests" + name: "Floating Dependencies" + install: + - npm install --no-package-lock + script: + - npm run test:ember + + # we recommend new addons test the current and previous LTS + # as well as latest stable release (bonus points to beta/canary) + - env: EMBER_TRY_SCENARIO=ember-lts-3.24 + - env: EMBER_TRY_SCENARIO=ember-lts-3.28 + - 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 + - env: EMBER_TRY_SCENARIO=ember-classic + - env: EMBER_TRY_SCENARIO=embroider-safe + - env: EMBER_TRY_SCENARIO=embroider-optimized script: - - npm run lint:js - # Usually, it's ok to finish the test scenario without reverting - # to the addon's original dependency state, skipping "cleanup". - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup + - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0b36c4b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# How To Contribute + +## Installation + +* `git clone ` +* `cd my-addon` +* `npm install` + +## Linting + +* `npm run lint` +* `npm run lint: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/). diff --git a/LICENSE.md b/LICENSE.md index 198f6da..3d90f3a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 +Copyright (c) 2021 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: diff --git a/README.md b/README.md index 731f68d..bc32ba9 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ Mobile friendly Ember menu component using CSS transitions. More effects and SVG ## Demo -Check out the live demo [here][live-demo] +Check out the live demo [here](https://tsubik.com/ember-side-menu) -## Ember Compability +## Compatibility + +* Ember.js v3.24 or above +* Ember CLI v3.24 or above +* Node.js v12 or above -This addon is compatible with and tested against Ember 2.x and higher. ## Installation @@ -28,12 +31,12 @@ Import ember-side-menu styles in your application's `app.scss` file. ### Side Menu -`{{#side-menu}}` component is a main container of your menu. Place it on some top level of your DOM +`` component is a main container of your menu. Place it on some top level of your DOM document for example in `application.hbs` file. ``` handlebars -{{#side-menu}} +