Skip to content

Commit

Permalink
Merge pull request #179 from empress/update-ember
Browse files Browse the repository at this point in the history
update to v4.12 with ember-cli-update
  • Loading branch information
mansona committed Aug 17, 2023
2 parents f098d5a + 3d4f608 commit e3e486c
Show file tree
Hide file tree
Showing 20 changed files with 9,102 additions and 9,326 deletions.
4 changes: 2 additions & 2 deletions .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
18 changes: 10 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand All @@ -27,6 +30,7 @@ module.exports = {
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
Expand All @@ -43,8 +47,7 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
extends: ['plugin:n/recommended'],
},
{
// test files
Expand All @@ -63,8 +66,7 @@ module.exports = {
node: true,
mocha: true
},
plugins: ['node'],
extends: ['plugin:node/recommended']
extends: ['plugin:n/recommended']
}
],
};
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ jobs:
- ember-lts-3.24
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-release
- ember-data-latest
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized
- no-deprecations
Expand Down
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
/.gitignore
/.prettierignore
/.prettierrc.js
/.stylelintignore
/.stylelintrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
Expand Down
9 changes: 8 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

module.exports = {
singleQuote: true,
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

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

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
3 changes: 2 additions & 1 deletion addon/models/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export default class AuthorModel extends Model {
@attr() location;
@attr() meta;

@hasMany('content') posts;
@hasMany('content', { polymorphic: true, async: true, inverse: 'authors' })
posts;
}
6 changes: 3 additions & 3 deletions addon/models/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export default class ContentModel extends Model {

@attr() _primaryTagId;

@hasMany('tag') tags;
@hasMany('author') authors;
@hasMany('tag', { async: false }) tags;
@hasMany('author', { async: true, inverse: 'posts' }) authors;

get primaryTag() {
return this.tags.findBy('id', this._primaryTagId);
return this.tags.find((t) => t.id === this._primaryTagId);
}

get author () {
Expand Down
3 changes: 2 additions & 1 deletion addon/models/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export default class TagModel extends Model {
// see: https://discuss.emberjs.com/t/manual-pagination-in-ember-data-relationships/18087
@attr() _postIds;

@hasMany('content') posts;
@hasMany('content', { polymorphic: true, async: true, inverse: 'tags' })
posts;
}
2 changes: 1 addition & 1 deletion addon/services/head-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class HeadDataService extends HeadData {

@computed('currentRouteMeta.tags')
get categories() {
return this.currentRouteMeta?.tags?.mapBy('name');
return this.currentRouteMeta?.tags?.map(item => item.name);
}

@computed('currentRouteMeta.image')
Expand Down
5 changes: 0 additions & 5 deletions config/environment.js

This file was deleted.

Loading

0 comments on commit e3e486c

Please sign in to comment.