Skip to content

Commit

Permalink
chore: upgrade to ember 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tzellman committed Jan 6, 2022
1 parent 5eeb245 commit ececbce
Show file tree
Hide file tree
Showing 28 changed files with 8,052 additions and 5,880 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# 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
26 changes: 16 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ module.exports = {
legacyDecorators: true
}
},
plugins: ['ember'],
plugins: ['ember', 'prettier'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
env: {
browser: true
},
rules: {
'ember/no-jquery': 'error',
'prettier/prettier': ['error', { usePrettierrc: true }]
},
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'
'./.eslintrc.js',
'./.template-lintrc.js',
'./commitlint.config.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'
},
Expand All @@ -41,6 +42,11 @@ module.exports = {
},
plugins: ['node'],
extends: ['plugin:node/recommended']
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended']
}
]
};
45 changes: 0 additions & 45 deletions .github/workflows/build.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

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: npm
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run Tests
run: npm run 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: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
- name: Run Tests
run: npm run test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
needs: "test"

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.24
- ember-lts-3.28
- ember-beta
- ember-classic
- ember-default-with-jquery
- embroider-safe
# - embroider-optimized
- ember-release
experimental: [false]
include:
- try-scenario: ember-canary
experimental: true

steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
/npm-debug.log*
/testem.log
/yarn-error.log
.idea

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

.idea
/yarn.lock.ember-try
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep
/.idea
Expand All @@ -34,4 +35,7 @@
# 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
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
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
7 changes: 1 addition & 6 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
'use strict';

module.exports = {
extends: 'octane',
rules: {
'no-implicit-this': {
allow: ['shhh-helper']
}
}
extends: 'recommended'
};
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.0.0

This is the first major release! There are no new features, however the upgrade to
`ember-auto-import` is breaking and warrants a major version bump.

- Upgraded `ember-auto-import` to 2.x
- Upgraded `ember-cli` to 4.x
- Updated tests to leverage `qunit-dom` helpers, which also fixed several lint errors

## 0.8.0

This is a minor release with no new features added, and some deprecations removed.
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ Reactive helpers are helpers that return functions. These functions can be bound
Returns a function for a given helper and curries arguments to it.

```hbs
<Input
@value={{this.value}}
{{on "keyup" (pipe (r "dasherize" this.value) (fn (mut this.value)))}}
/>
<Input @value={{this.value}} {{on "keyup" (pipe (r "dasherize" this.value) (fn (mut this.value)))}} />
```

The `r` helper accepts functions as helpers. For example, let's say you have a method in a Component named `addNumbers`
Expand All @@ -52,16 +49,18 @@ You can use it in the template.
The `(r/get)` helper returns a function. When called, the function will return the value taken from the object that it receives as the first argument at property propName.

```hbs
{{compute (r/get 'animal') (hash animal='cat')}} {{! //=> cat }}
{{compute (r/get "animal") (hash animal="cat")}} {{! //=> cat }}
```

### `(r/param [index])`

`(r/param)` returns a function. When called, this function will return the received argument at the specified index.

```hbs
{{compute (r/param) 'hello' 'world'}} {{! //=> 'hello'}}
{{compute (r/param 1) 'hello' 'world'}} {{! //=> 'world'}}
{{compute (r/param) "hello" "world"}}
{{! //=> 'hello'}}
{{compute (r/param 1) "hello" "world"}}
{{! //=> 'world'}}
```

### `(r/debugger)`
Expand All @@ -78,7 +77,7 @@ It will pass through the value, that's passed into the helper.
The `(r/log)` helper will evaluate to a function. When called, this function will log the passed in message and arguments that it received.

```hbs
<button {{action (pipe (r/log 'before save') (action 'save') (r/log 'after save')) model}}>Save</button>
<button {{action (pipe (r/log "before save") (action "save") (r/log "after save")) model}}>Save</button>
```

### `(r/tap value)`
Expand All @@ -95,7 +94,7 @@ without having its output rendered.
The `(transition-to)` helper has the same argument signature as `link-to` but evaluates to an action that can be called to trigger transition.

```hbs
<button type="button" {{on "click" (transition-to 'index')}}>Go to Index</button>
<button type="button" {{on "click" (transition-to "index")}}>Go to Index</button>
```

## Helpful Links
Expand Down Expand Up @@ -124,8 +123,8 @@ This project is licensed under the [MIT License](LICENSE.md).

[npm-badge-img]: https://badge.fury.io/js/ember-reactive-helpers.svg
[npm-badge-link]: http://badge.fury.io/js/ember-reactive-helpers
[build-status-img]: https://github.com/EmberSherpa/ember-reactive-helpers/workflows/Build/badge.svg?branch=master&event=push
[build-status-link]: https://github.com/EmberSherpa/ember-reactive-helpers/actions?query=workflow%3A%22Build%22
[build-status-img]: https://github.com/EmberSherpa/ember-reactive-helpers/workflows/CI/badge.svg?branch=master&event=push
[build-status-link]: https://github.com/EmberSherpa/ember-reactive-helpers/actions?query=workflow%3A%22CI%22
[npm-downloads-img]: https://img.shields.io/npm/dt/ember-reactive-helpers.svg
[ember-observer-badge]: http://emberobserver.com/badges/ember-reactive-helpers.svg
[ember-observer-url]: http://emberobserver.com/addons/ember-reactive-helpers
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
21 changes: 14 additions & 7 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
scenarios: [
{
name: 'ember-lts-3.16',
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.16.0'
'ember-source': '~3.24.3'
}
}
},
{
name: 'ember-lts-3.20',
name: 'ember-lts-3.28',
npm: {
devDependencies: {
'ember-source': '~3.20.5'
'ember-source': '~3.28.0'
}
}
},
Expand Down Expand Up @@ -49,12 +50,13 @@ module.exports = async function () {
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
'jquery-integration': false
})
},
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0'
'@ember/jquery': '^1.1.0',
'@ember/optional-features': '^2.0.0'
}
}
},
Expand All @@ -68,11 +70,16 @@ module.exports = async function () {
})
},
npm: {
devDependencies: {
'ember-source': '~3.28.0'
},
ember: {
edition: 'classic'
}
}
}
},
embroiderSafe(),
embroiderOptimized()
]
};
};
Loading

0 comments on commit ececbce

Please sign in to comment.