Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ember v4 Support, drop Ember < 3.24 #188

Merged
merged 6 commits into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions .eslintignore
Expand Up @@ -7,7 +7,6 @@
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
Expand All @@ -18,10 +17,12 @@

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# IDE
/.idea/
/.vscode/
/.history/
/.history/
26 changes: 10 additions & 16 deletions .eslintrc.js
Expand Up @@ -24,21 +24,15 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.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/**',
'./.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',
Expand All @@ -51,7 +45,7 @@ module.exports = {
extends: ['plugin:node/recommended'],
},
{
// Test files:
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/ci.yaml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,77 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Run Tests
run: yarn test:ember

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.24
- ember-lts-3.28
- ember-release
- ember-beta
- ember-canary
- ember-classic
- ember-default-with-jquery
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -5,7 +5,6 @@
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
Expand All @@ -22,8 +21,10 @@

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# IDE
/.idea/
Expand Down
10 changes: 4 additions & 6 deletions .npmignore
Expand Up @@ -2,25 +2,21 @@
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/CONTRIBUTING.md
/ember-cli-build.js
Expand All @@ -32,7 +28,9 @@

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

/.idea/
4 changes: 4 additions & 0 deletions .prettierignore
Expand Up @@ -14,8 +14,12 @@
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
50 changes: 22 additions & 28 deletions README.md
@@ -1,30 +1,25 @@
ember-gesture-modifiers
==============================================================================
# ember-gesture-modifiers

Addon that provides gestures as modifiers.

Compatibility
------------------------------------------------------------------------------
## Compatibility

* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v12 or above
- Ember.js v3.24 or above
- Ember CLI v3.24 or above
- Node.js v12 or above


Installation
------------------------------------------------------------------------------
## Installation

```
ember install ember-gesture-modifiers
```


Usage
------------------------------------------------------------------------------
## Usage

Currently only a Pan modifier is provided. More gestures will be added in the future.

## Pan modifier

```handlebars
<div
{{did-pan
Expand All @@ -36,16 +31,18 @@ Currently only a Pan modifier is provided. More gestures will be added in the fu
```

### arguments
- **onPanStart** - hook fired when a pan is started
- **onPan** - hook fired when the pan is updated
- **onPanEnd** - hook fired when a pan has ended
- **threshold** _(default: 10)_ - minimum touch movement needed in px to start a pan
- **axis** _(default: 'horizontal')_ - axis for the pan event to be recognized ('horizontal', 'vertical' or 'both')
- **capture** _(default: false)_ - whether or not to use capture events instead of bubbling
- **preventScroll** _(default: true)_ - whether or not to prevent scroll during panning
- **pointerTypes** _(default: ['touch'])_ - the pointer types to support (one or more of 'touch', 'mouse', 'pen')

- **onPanStart** - hook fired when a pan is started
- **onPan** - hook fired when the pan is updated
- **onPanEnd** - hook fired when a pan has ended
- **threshold** _(default: 10)_ - minimum touch movement needed in px to start a pan
- **axis** _(default: 'horizontal')_ - axis for the pan event to be recognized ('horizontal', 'vertical' or 'both')
- **capture** _(default: false)_ - whether or not to use capture events instead of bubbling
- **preventScroll** _(default: true)_ - whether or not to prevent scroll during panning
- **pointerTypes** _(default: ['touch'])_ - the pointer types to support (one or more of 'touch', 'mouse', 'pen')

The hooks are passed a TouchData object which looks like:

```javascript
{
originalEvent: <TouchEvent>,
Expand Down Expand Up @@ -81,8 +78,8 @@ The hooks are passed a TouchData object which looks like:
}
```

Testing
------------------------------------------------------------------------------
## Testing

A `pan` test helper is exposed by the addon.

```javascript
Expand All @@ -95,13 +92,10 @@ import { pan } from 'ember-gesture-modifiers/test-support';
await pan('.my-css-selector', 'right');
```

Contributing
------------------------------------------------------------------------------
## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.


License
------------------------------------------------------------------------------
## License

This project is licensed under the [MIT License](LICENSE.md).