Skip to content

Commit

Permalink
chore: update to support Ember 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tzellman committed Sep 14, 2023
1 parent 4f3bd37 commit 0283390
Show file tree
Hide file tree
Showing 24 changed files with 38,534 additions and 22,498 deletions.
12 changes: 0 additions & 12 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# 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
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
10 changes: 6 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

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', 'prettier'],
Expand All @@ -24,6 +25,7 @@ module.exports = {
{
files: [
'./.eslintrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
Expand All @@ -57,12 +57,10 @@ jobs:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-release
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized

Expand All @@ -71,9 +69,10 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}

4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: 16

- name: Cache dependencies
uses: actions/cache@v3
Expand All @@ -26,7 +26,7 @@ jobs:
- run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.8.0
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
/declarations/

# dependencies
/bower_components/
/node_modules/

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

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
Expand Down
8 changes: 2 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
Expand All @@ -18,10 +14,11 @@
/.gitignore
/.prettierignore
/.prettierrc
/.stylelintignore
/.stylelintrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
Expand All @@ -33,7 +30,6 @@

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
Expand Down
14 changes: 1 addition & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/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
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/
13 changes: 13 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind']
}
]
}
};
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 18.15.0
nodejs 18.17.1
2 changes: 1 addition & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
"ignore_dirs": ["dist"]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 0.4.0

- updated to support Ember 5.x

### 0.3.0

- Updated dependencies
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ module.exports = function (environment) {

## Compatibility

- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v14 or above
- Ember.js v4.8.3 or above
- Ember CLI v4.8 or above
- Node.js v16 or above

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion addon/components/hero-icon.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<svg {{did-insert this.setAttributes}} ...attributes>
<svg {{set-attributes this.attributes}} ...attributes>
{{this.inner}}
</svg>
10 changes: 2 additions & 8 deletions addon/components/hero-icon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { action } from '@ember/object';
import { htmlSafe } from '@ember/template';
import Component from '@glimmer/component';
import appConfig from 'ember-get-config';
Expand All @@ -25,12 +24,7 @@ export default class HeroIconComponent extends Component {
return svg?.inner ? htmlSafe(svg.inner) : undefined;
}

@action
setAttributes(element) {
const svg = this.icon?.data;
const atts = svg?.attributes ?? {};
Object.entries(atts)
.filter(([k]) => !element.hasAttribute(k))
.forEach(([k, v]) => element.setAttribute(k, v));
get attributes() {
return this.icon?.data?.attributes ?? {};
}
}
7 changes: 7 additions & 0 deletions addon/modifiers/set-attributes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { modifier } from 'ember-modifier';

export default modifier((element, [atts]) => {
Object.entries(atts ?? {})
.filter(([k]) => !element.hasAttribute(k))
.forEach(([k, v]) => element.setAttribute(k, v));
});
1 change: 1 addition & 0 deletions app/modifiers/set-attributes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-heroicons/modifiers/set-attributes';
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const { globSync } = require('glob');
const writeFile = require('broccoli-file-creator');
const mergeTrees = require('broccoli-merge-trees');
const renderHTML = require('dom-serializer').default;
Expand Down Expand Up @@ -47,8 +47,7 @@ module.exports = {
const omit = (this._options.omit ?? []).map((o) => toMatcher(o));
const include = (this._options.include ?? []).map((o) => toMatcher(o));
const types = (this._options.types ?? []).map((o) => toMatcher(o));
const icons = glob
.sync(path.join(heroIconsPath, '**', '*.svg'))
const icons = globSync(path.join(heroIconsPath, '**', '*.svg'))
.map((f) =>
f
.replace(heroIconsPath, '')
Expand Down
Loading

0 comments on commit 0283390

Please sign in to comment.