Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
23 changes: 20 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
node_modules/**
bower_components/**
tests/**
# 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
16 changes: 12 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
'use strict';

module.exports = {
globals: {
server: true,
},
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
Expand All @@ -19,11 +25,14 @@ module.exports = {
},
rules: {
'ember/new-module-imports': 0
// 'ember/no-jquery': 'error'
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
Expand All @@ -38,8 +47,7 @@ module.exports = {
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
Expand Down
24 changes: 13 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# 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*
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
47 changes: 29 additions & 18 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,21 +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
.eslintrc.js
.gitignore
.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
/.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'
};
56 changes: 37 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ 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
- "4"
- "10"

sudo: false
dist: trusty

addons:
Expand All @@ -18,31 +17,50 @@ 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.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:

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

jobs:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps
- stage: "Tests"
name: "Tests"
script:
- yarn lint:hbs
- yarn lint:js
- yarn test

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- yarn test

# 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-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

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive
- yarn install --non-interactive

script:
- yarn 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
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-uploader`
* `yarn install`

## Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn 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/).
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
An Ember.js file uploader that works with any browser that supports
[FormData](http://caniuse.com/#search=FormData).

## Getting Started
=======

Ember Uploader is a Ember CLI compatible addon and can be installed as such.
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v10 or above


Installation
------------------------------------------------------------------------------

```
ember install ember-uploader
Expand Down Expand Up @@ -53,7 +62,9 @@ const uploader = Uploader.create({
});
```

#### Change Namespace
* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`

```js
import Uploader from 'ember-uploader/uploaders/uploader';
Expand Down Expand Up @@ -200,31 +211,22 @@ export default FileField.extend({
For learning how to setup the backend, check the
[wiki](https://github.com/benefitcloud/ember-uploader/wiki/S3-Server-Setup)


## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality.

Ember Uploader uses [node.js](http://nodejs.org) and
[Ember CLI](https://ember-cli.com/) for builds and tests. You will need to have
these tools installed if you would like to build Ember Uploader.
See the [Contributing](CONTRIBUTING.md) guide for details.

```sh
$ npm install -g ember-cli
```

To get started with development simply do a `yarn install` inside the cloned
repository to install all dependencies needed for running
[Ember CLI](http://www.ember-cli.com/).
## License

Copyright (c) 2014 Joshua Borton
Licensed under the MIT license.

Lint and test your code using: `ember test`.

## Thank you

The Ember team, its contributors and community for being awesome. Also thank
you to [Erik Bryn](http://twitter.com/ebryn) and the contributors behind
[ember-model](http://github.com/ebryn/ember-model) as well as
[TJ Holowaychuk](http://twitter.com/tjholowaychuk) for
[component/upload](http://github.com/component/upload).

## License
Copyright (c) 2014 Joshua Borton
Licensed under the MIT license.
25 changes: 0 additions & 25 deletions addon/components/file-field.js

This file was deleted.

5 changes: 5 additions & 0 deletions addon/components/file-field/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<input
type='file'
{{on 'change' this.updateFile}}
...attributes
/>
14 changes: 14 additions & 0 deletions addon/components/file-field/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { isEmpty } from '@ember/utils';

export default class FileField extends Component {
@action
updateFile(event) {
const input = event.target;

if (!isEmpty(input.files)) {
this.args.filesDidChange(input.files);
}
}
}
Loading