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

Add events to file-queue helper, set up TypeScript, drop ember-cli-addon-docs, drop support for Ember < 3.28 #620

Merged
merged 14 commits into from
Jan 18, 2022
Merged
29 changes: 28 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@ module.exports = {
},
rules: {},
overrides: [
// ts files
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
],
env: {
browser: true,
},
globals: {
// Mirage server
server: true,
},
},
// node files
{
files: [
Expand All @@ -38,6 +64,7 @@ module.exports = {
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parser: 'babel-eslint',
parserOptions: {
sourceType: 'script',
},
Expand All @@ -46,7 +73,7 @@ module.exports = {
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
extends: ['eslint:recommended'],
},
{
// Test files:
Expand Down
278 changes: 137 additions & 141 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,38 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Lint
run: yarn lint

- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Lint
run: yarn lint

test:
name: Tests
Expand All @@ -89,39 +88,38 @@ jobs:
browser: [chrome]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

floating-dependencies:
name: Floating Dependencies
Expand All @@ -134,35 +132,34 @@ jobs:
browser: [chrome]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

try-scenarios:
name: Tests - ${{ matrix.ember-try-scenario }}
Expand All @@ -173,51 +170,50 @@ jobs:
strategy:
fail-fast: true
matrix:
ember-try-scenario: [
ember-lts-3.16,
ember-lts-3.20,
ember-lts-3.24,
ember-release,
ember-beta,
ember-canary,
ember-default-with-jquery,
ember-classic,
embroider-safe,
embroider-optimized
]
ember-try-scenario:
[
ember-lts-3.28,
ember-release,
ember-beta,
ember-canary,
ember-default-with-jquery,
ember-classic,
embroider-safe,
embroider-optimized,
]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
10 changes: 2 additions & 8 deletions addon/components/file-upload.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
for={{this.for}}
class="file-upload"
...attributes
{{update-queue
this.queue
multiple=@multiple
disabled=@disabled
onFileAdd=@onFileAdd
}}
{{did-insert this.attachListeners}}
gossi marked this conversation as resolved.
Show resolved Hide resolved
>
<input
id={{this.for}}
Expand All @@ -16,9 +11,8 @@
capture={{@capture}}
multiple={{@multiple}}
disabled={{@disabled}}
value={{this._value}}
hidden
{{on 'change' this.change}}
{{this.queue.selectFile filter=@filter filesSelected=@filesSelected}}
/>

{{yield this.queue}}
Expand Down
Loading