Skip to content

Commit

Permalink
Merge pull request #27 from tzellman/master
Browse files Browse the repository at this point in the history
Update to Ember 3.20
  • Loading branch information
tzellman authored Sep 17, 2020
2 parents f3f7ba8 + ecdb3d7 commit 96935f8
Show file tree
Hide file tree
Showing 59 changed files with 854 additions and 754 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
20 changes: 20 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
51 changes: 46 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
}
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.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/**'
],
parserOptions: {
sourceType: 'script'
},
env: {
browser: false,
node: true
},
plugins: ['node'],
extends: ['plugin:node/recommended']
}
]
};
25 changes: 18 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
# See https://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
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.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

.idea
package-lock.json
46 changes: 31 additions & 15 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'octane'
};
78 changes: 53 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,60 @@
---
language: node_js
node_js:
- '6'
sudo: required
dist: trusty
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "10"

dist: xenial

addons:
chrome: stable

cache:
directories:
- $HOME/.npm
- $HOME/.cache
matrix:

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1

branches:
only:
- master
# npm version tags
- /^v\d+\.\d+\.\d+/

jobs:
fast_finish: true
before_install:
- 'export DISPLAY=:99.0'
- sh -e /etc/init.d/xvfb start
- npm config set spin false
- npm install -g bower phantomjs-prebuilt
- bower --version
- phantomjs --version
before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "Taras Mankovski"
install:
- npm install
- bower install
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

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.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-lts-3.20
- 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

script:
- 'COVERAGE=true node_modules/.bin/ember try:each --skip-cleanup'
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd ember-reactive-helpers`
* `npm install`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --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/).
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ to process data on the way up in the Data Down Actions Up cycle. The `r` helper
Returns a function for a given helper and curry arguments to it.

```hbs
<input value={{value}} oninput={{action (pipe (r 'dasherize') (action (mut value))) value="target.value"}}
<Input @value={{this.value}}
@input={{fn (pipe (r "dasherize" this.value) (fn (mut this.value)))}}
/>
```

`r` helper accepts functions as helpers. For example, let's say you have a method on the context called `addNumbers`

```js
export default Ember.Component.extend({
export default class extends Component {
addNumbers([a, b]) {
return a + b;
}
});
}
```

You can use it in the template.

```hbs
<button {{action (pipe (r addNumbers 1) (action (mut count))) count}}>+1</button>
<button type="button" {{on "click" (pipe (r this.addNumbers 1) (fn (mut this.count)))}}>+1</button>
<div>{{this.count}}</div>
```

### `(r/get propName)`
Expand Down Expand Up @@ -103,4 +106,13 @@ ember install ember-reactive-helpers
## Looking for help?
If you encounter a bug [please open an issue on GitHub](http://github.com/EmberSherpa/ember-reactive-helpers/issues).

## Usage
Contributing
------------------------------------------------------------------------------

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


License
------------------------------------------------------------------------------

This project is licensed under the [MIT License](LICENSE.md).
16 changes: 7 additions & 9 deletions addon/helpers/debounce.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import Ember from 'ember';
import { helper as buildHelper } from '@ember/component/helper';
import { debounce } from '@ember/runloop';
import { assert } from '@ember/debug';

const {
run: { debounce },
assert
} = Ember;

export function debounceHelper([callback, wait, immediate = false]/*, hash*/) {
export function debounceHelper([callback, wait, immediate = false] /*, hash*/) {
assert(`wait is specified for debounce helper`, wait);

return function(value) {
return function (value) {
return debounce(null, callback, value, wait, immediate);
};
}
export default Ember.Helper.helper(debounceHelper);

export default buildHelper(debounceHelper);
4 changes: 2 additions & 2 deletions addon/helpers/feed.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Ember from 'ember';
import { helper as buildHelper } from '@ember/component/helper';
import { pipe } from 'ember-composable-helpers/helpers/pipe';

export function feed([value, ...actions]) {
return pipe(actions)(value);
}

export default Ember.Helper.helper(feed);
export default buildHelper(feed);
Loading

0 comments on commit 96935f8

Please sign in to comment.