Skip to content

Commit

Permalink
chore: Upgrade to ember 3.24
Browse files Browse the repository at this point in the history
- Update docs, tests, examples to use AngleBracket components
  • Loading branch information
lukemelia committed Jan 21, 2021
1 parent 2fe23b5 commit a95eb23
Show file tree
Hide file tree
Showing 130 changed files with 4,313 additions and 3,990 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
55 changes: 31 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,45 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
browser: true,
},
rules: {
'arrow-parens': ['error', 'always'],
'arrow-spacing': ['error', { 'before': true, 'after': true }],
'arrow-spacing': ['error', { before: true, after: true }],
'newline-after-var': 'off',
'newline-before-return': 'off',
'no-magic-numbers': ['off', { 'ignore': [-1, 0, 1] }],
'ember/no-classic-components': 'off',
'ember/no-classic-classes': 'off',
'no-magic-numbers': ['off', { ignore: [-1, 0, 1] }],
'object-curly-spacing': ['error', 'always'],
'prefer-const': 'off',
'prefer-rest-params': 'off',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
}]
},
overrides: [
// 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',
'lib/**'
'lib/**',
],
excludedFiles: [
'addon/**',
Expand All @@ -56,26 +55,34 @@ module.exports = {
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
}
),
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
embertest: true,
},
extends: ['plugin:node/recommended']
}
]
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
},
],
};
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
jsconfig.json

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

# text editors
.vscode/*
49 changes: 30 additions & 19 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.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
yarn.lock
/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
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

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

module.exports = {
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'octane'
extends: 'octane',
};
62 changes: 62 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
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
- "10"

dist: xenial

addons:
chrome: stable

cache:
yarn: true

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
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

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

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- yarn 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.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

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

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ To see Ember Freestyle in action, visit [https://chrislopresto.github.io/ember-f

### Compatibility

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

### Support

Expand Down
5 changes: 5 additions & 0 deletions addon/components/freestyle-annotation/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="FreestyleAnnotation {{if this.showNotes 'is-showing' 'is-hidden'}}">
{{#if this.showNotes}}
{{yield}}
{{/if}}
</div>
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from '../templates/components/freestyle-annotation';

let FreestyleAnnotation = Component.extend({
layout,
classNames: ['FreestyleAnnotation'],
classNameBindings: ['showNotes:is-showing:is-hidden'],
tagName: '',

emberFreestyle: service(),
showNotes: computed('emberFreestyle.{showNotes,focus}', 'slug', function() {
let slug = this.get('slug');
let focus = this.get('emberFreestyle.focus');
showNotes: computed('emberFreestyle.{showNotes,focus}', 'slug', function () {
let slug = this.slug;
let focus = this.emberFreestyle.focus;
if (focus && slug) {
return slug.match(focus);
}
return this.get('emberFreestyle.showNotes');
})
return this.emberFreestyle.showNotes;
}),
});

FreestyleAnnotation.reopenClass({
positionalParams: ['slug']
positionalParams: ['slug'],
});

export default FreestyleAnnotation;
15 changes: 15 additions & 0 deletions addon/components/freestyle-collection/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="FreestyleCollection {{if @inline 'FreestyleCollection--inline'}}">
{{#if this.hasLabels}}
<div class="FreestyleCollection-title">
{{@title}}
</div>
{{/if}}
{{#if this.showVariantList}}
<FreestyleVariantList @variants={{this.variants}} @activeKey={{this.activeKey}} @onClickVariant={{this.setKey}} />
{{/if}}
{{yield
(hash
variant=(component "freestyle-variant" collection=this)
)
}}
</div>
Loading

0 comments on commit a95eb23

Please sign in to comment.