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

Ember 3.26, ember-cli-head 2.0.0, remove ember-get-config #28

Merged
merged 8 commits into from
Jun 21, 2021
Merged
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: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
33 changes: 16 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,51 @@ 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: {
'ember/no-jquery': 'error'
'ember/no-classic-classes': 'off',
'ember/no-computed-properties-in-native-classes': 'off',
},
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'
'tests/dummy/config/**/*.js',
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'tests/dummy/app/**',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
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
})
}
]
extends: ['plugin:node/recommended'],
},
],
};
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
labels:
- dependencies
ignore:
- dependency-name: ember-cli
versions:
- ">= 0"
20 changes: 15 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ jobs:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 10.x
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test:ember

floating-dependencies:
name: "Floating Dependencies"
name: 'Floating Dependencies'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 10.x
node-version: 12.x
- run: yarn install --no-lockfile
- run: yarn test:ember

try-scenarios:
name: "Try: ${{ matrix.ember-try-scenario }}"
name: 'Try: ${{ matrix.ember-try-scenario }}'

runs-on: ubuntu-latest

Expand All @@ -52,6 +52,8 @@ jobs:
- ember-canary
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
Expand All @@ -61,4 +63,12 @@ jobs:
- name: install dependencies
run: yarn install --frozen-lockfile
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

automerge:
needs: [test, floating-dependencies, try-scenarios]
runs-on: ubuntu-latest
steps:
- uses: fastify/github-action-merge-dependabot@v2.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand Down
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,
};
5 changes: 3 additions & 2 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
module.exports = {
extends: 'octane',
rules: {
'no-forbidden-elements': false,
// TODO: maybe enable this again?
'no-invalid-meta': false
}
'no-invalid-meta': false,
},
};
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Setup meta for your Prember/Ember blog to support opengraph, microdata, Facebook
Compatibility
------------------------------------------------------------------------------

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

Expand Down
19 changes: 15 additions & 4 deletions addon/services/head-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import Service, { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { alias, reads } from '@ember/object/computed';
import { getOwner } from '@ember/application';
import config from 'ember-get-config';

export default class HeadDataService extends Service {
@service router;

@alias('router.currentRouteName') routeName;

get config() {
const config = getOwner(this).resolveRegistration('config:environment');
return config['ember-meta'];
}

Expand Down Expand Up @@ -51,7 +51,12 @@ export default class HeadDataService extends Service {
* If you pass a description, it will be used, otherwise it will truncate your content,
* and finally it will use the description from the global config.
*/
@computed('content', 'currentRouteMeta.description', 'routeName', 'config.description')
@computed(
'content',
'currentRouteMeta.description',
'routeName',
'config.description'
)
get description() {
const description = this.currentRouteMeta?.description;
const content = this.content;
Expand Down Expand Up @@ -120,9 +125,15 @@ export default class HeadDataService extends Service {
/**
* Used for twitter:site and twitter:creator
*/
@computed('currentRouteMeta.twitterUsername', 'routeName', 'config.twitterUsername')
@computed(
'currentRouteMeta.twitterUsername',
'routeName',
'config.twitterUsername'
)
get twitterUsername() {
return this.currentRouteMeta?.twitterUsername ?? this.config.twitterUsername;
return (
this.currentRouteMeta?.twitterUsername ?? this.config.twitterUsername
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion blueprints/ember-meta/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
normalizeEntityName() { }
normalizeEntityName() {},
};
Loading