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 v5.2 blueprint update #426

Merged
merged 5 commits into from
Sep 13, 2023
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
11 changes: 0 additions & 11 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,13 @@

# compiled output
/dist/
/tmp/
/storybook-static/

# 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
12 changes: 8 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,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 @@ -22,6 +25,7 @@ module.exports = {
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ jobs:
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.12
- ember-release
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized

Expand Down
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
/public/appuniversum-symbolset.svg
/storybook-static
/build-storybook.log
/.storybook/preview-head.html
/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
7 changes: 2 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
/tmp/
/storybook-static/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
Expand All @@ -19,10 +15,11 @@
/.gitignore
/.prettierignore
/.prettierrc.js
/.stylelintignore
/.stylelintrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/CONTRIBUTING.md
/ember-cli-build.js
/jsconfig.json
Expand Down
14 changes: 1 addition & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/
/storybook-static/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache
.lint-todo/
.*/

# This is updated by lerna-changelog which doesn't confirm with the prettier formatting. Since we can't easily run prettier during releases we disable the formatting for now.
CHANGELOG.md

# 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/
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'],
};
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"]
}
2 changes: 1 addition & 1 deletion addon/components/au-control-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class AuControlCheckbox extends Component {
since: {
enabled: '2.5.0',
},
}
},
);
}

Expand Down
2 changes: 1 addition & 1 deletion addon/components/au-control-radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class AuControlRadio extends Component {
since: {
enabled: '2.5.0',
},
}
},
);
}

Expand Down
4 changes: 2 additions & 2 deletions addon/components/au-date-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ function ensureIsoDate(argValue) {

assert(
`@value should be a ISO 8601 formatted date string or a Date instance but it is a "${typeof argValue}"`,
typeof argValue === 'string' || argValue instanceof Date
typeof argValue === 'string' || argValue instanceof Date,
);

if (argValue instanceof Date) {
return toIsoDateString(argValue);
} else {
assert(
`@value ("${argValue}") should be a valid ISO 8601 formatted date`,
isIsoDateString(argValue)
isIsoDateString(argValue),
);
return argValue;
}
Expand Down
16 changes: 8 additions & 8 deletions addon/components/au-date-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class AuDatePickerComponent extends Component {
this.registerDuetDatePicker();

let isNewImplementation = macroCondition(
getOwnConfig().dutchDatePickerLocalization
getOwnConfig().dutchDatePickerLocalization,
)
? true
: false;
Expand All @@ -92,7 +92,7 @@ export default class AuDatePickerComponent extends Component {
since: {
enabled: '1.9.0',
},
}
},
);
}

Expand Down Expand Up @@ -161,27 +161,27 @@ export default class AuDatePickerComponent extends Component {
function validateAdapter(adapterArg) {
assert(
`The @adapter argument needs to be an object but it is a "${typeof adapterArg}"`,
Boolean(adapterArg) && typeof adapterArg === 'object'
Boolean(adapterArg) && typeof adapterArg === 'object',
);

Object.keys(adapterArg).map((key) => {
assert(
`"${key}" is not a property of adapter, maybe it is just a typo?`,
key in DEFAULT_ADAPTER
key in DEFAULT_ADAPTER,
);
});
}

function validateLocalization(localizationArg) {
assert(
`The @localization argument needs to be an object but it is a "${typeof localizationArg}"`,
Boolean(localizationArg) && typeof localizationArg === 'object'
Boolean(localizationArg) && typeof localizationArg === 'object',
);

Object.keys(localizationArg).map((key) => {
assert(
`"${key}" is not a property of localization, maybe it is just a typo?`,
key in DEFAULT_LOCALIZATION
key in DEFAULT_LOCALIZATION,
);
});
}
Expand All @@ -197,15 +197,15 @@ function asIsoDate(target, key /*, descriptor */) {

assert(
`@${key} should be a string or a Date instance but it is a "${typeof argValue}"`,
typeof argValue === 'string' || argValue instanceof Date
typeof argValue === 'string' || argValue instanceof Date,
);

if (argValue instanceof Date) {
return toIsoDateString(argValue);
} else {
assert(
`@${key} ("${argValue}") should be a valid ISO 8601 formatted date`,
isIsoDateString(argValue)
isIsoDateString(argValue),
);
return argValue;
}
Expand Down
4 changes: 2 additions & 2 deletions addon/components/au-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export default class AuDropdown extends Component {
(element) => {
this.referenceElement = element;
},
{ eager: false }
{ eager: false },
);

arrow = modifier(
(element) => {
this.arrowElement = element;
},
{ eager: false }
{ eager: false },
);

@action
Expand Down
4 changes: 2 additions & 2 deletions addon/components/au-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class AuInput extends Component {
assert(
'<AuInput>: An `@onChange` handler was provided but that will only be called if `@mask` or `@maskOptions` is provided as well.',
!this.args.onChange ||
(typeof this.args.onChange === 'function' && this.isMasked)
(typeof this.args.onChange === 'function' && this.isMasked),
);
}

Expand Down Expand Up @@ -107,5 +107,5 @@ const InputmaskModifier = modifier(
input.inputmask.remove();
};
},
{ eager: false }
{ eager: false },
);
4 changes: 2 additions & 2 deletions addon/components/au-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class AuModal extends Component {

assert(
'au-modal: No target element was found. Please add the `<AuModalContainer />` component where appropriate.',
this.destinationElement
this.destinationElement,
);
}

Expand Down Expand Up @@ -44,7 +44,7 @@ export default class AuModal extends Component {

get additionalElements() {
return FOCUS_TRAP_ADDITIONAL_ELEMENTS.filter(
(element) => document.querySelector(element) !== null
(element) => document.querySelector(element) !== null,
);
}

Expand Down
2 changes: 1 addition & 1 deletion addon/components/au-toggle-switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class AuToggleSwitch extends Component {
since: {
enabled: '2.6.0',
},
}
},
);
}

Expand Down
2 changes: 1 addition & 1 deletion addon/modifiers/au-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default modifier(
element[propertyName] = properties[propertyName];
}
},
{ eager: false }
{ eager: false },
);
2 changes: 1 addition & 1 deletion addon/private/helpers/link-to-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { assert } from '@ember/debug';
export function linkToModels([model, models]) {
assert(
'You cannot provide both the `@model` and `@models` arguments to the component.',
!model || !models
!model || !models,
);

if (model) {
Expand Down
Loading