Skip to content

Commit fd1b72f

Browse files
ember-cli-update to latest blueprints (#2624)
1 parent d7057b5 commit fd1b72f

File tree

114 files changed

+2666
-2232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2666
-2232
lines changed

.ember-cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
44
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
55
*/
6-
"isTypeScriptProject": false
6+
"isTypeScriptProject": true
77
}

.eslintignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
- ember-lts-3.28
9090
- ember-lts-4.8
9191
- ember-lts-4.12
92+
- ember-lts-5.4
9293
- ember-release
9394
- ember-beta
9495
- ember-canary

.prettierrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
'use strict';
22

33
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
45
overrides: [
56
{
6-
files: '*.{js,ts}',
7+
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
78
options: {
89
singleQuote: true,
910
},
1011
},
12+
{
13+
files: '*.{gjs,gts}',
14+
options: {
15+
singleQuote: true,
16+
templateSingleQuote: false,
17+
},
18+
},
1119
],
1220
};
File renamed without changes.

app/components/date-property-field.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ export default class DatePropertyFieldComponent extends DatePicker {
77
onInsert(element: HTMLInputElement) {
88
super.onInsert(element);
99

10+
// eslint-disable-next-line ember/no-runloop
1011
scheduleOnce('afterRender', this, this._openFlatpickr);
1112
}
1213

13-
_openFlatpickr() {
14+
_openFlatpickr = () => {
1415
this.flatpickrRef?.open();
15-
}
16+
};
1617
}

app/components/list-content.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ export default class ListContent extends Component<ListContentSignature> {
6767
*/
6868
@action
6969
elementInserted() {
70+
// eslint-disable-next-line ember/no-runloop
7071
schedule('afterRender', this, this.setupHeight);
7172
}
7273

7374
/**
7475
* Set up the content height and listen to any updates to that property.
7576
*/
76-
@action
77-
setupHeight() {
77+
setupHeight = () => {
7878
this.contentHeight = this.layoutService.contentHeight;
7979
this.layoutService.on(
8080
'content-height-update',
8181
this,
8282
this.updateContentHeight,
8383
);
84-
}
84+
};
8585

8686
/**
8787
* Triggered whenever the app's content height changes. This usually happens
@@ -90,8 +90,7 @@ export default class ListContent extends Component<ListContentSignature> {
9090
*
9191
* @param height The app's new content height
9292
*/
93-
@action
94-
updateContentHeight(height: number) {
93+
updateContentHeight = (height: number) => {
9594
this.contentHeight = height;
96-
}
95+
};
9796
}

app/components/list.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ export default class ListComponent extends Component {
1313
/**
1414
* Layout service used to listen to changes to the application
1515
* layout such as resizing of the main nav or object inspector.
16-
*
17-
* @property layoutService
18-
* @type {Service}
1916
*/
2017
@service('layout') layoutService;
2118

@@ -120,6 +117,7 @@ export default class ListComponent extends Component {
120117
let oldSchema = this.oldSchema;
121118
let newSchema = this.schema;
122119
if (newSchema && newSchema !== oldSchema) {
120+
// eslint-disable-next-line ember/no-runloop
123121
scheduleOnce('actions', this, this.setupColumns);
124122
}
125123
this.oldSchema = newSchema;
@@ -128,6 +126,7 @@ export default class ListComponent extends Component {
128126
@action
129127
elementInserted(el) {
130128
this.el = el;
129+
// eslint-disable-next-line ember/no-runloop
131130
scheduleOnce('afterRender', this, this.setupColumns);
132131
this.onResize = () => {
133132
this.debounceColumnWidths.perform();
@@ -157,6 +156,7 @@ export default class ListComponent extends Component {
157156
arr.push({
158157
name,
159158
title: name,
159+
// eslint-disable-next-line ember/no-runloop
160160
fn: bind(this, this.toggleColumnVisibility, id),
161161
});
162162
return arr;

app/components/object-inspector/property.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return */
12
import Component from '@glimmer/component';
23
import { tracked } from '@glimmer/tracking';
4+
// eslint-disable-next-line ember/no-computed-properties-in-native-classes
35
import { action, computed } from '@ember/object';
6+
// eslint-disable-next-line ember/no-computed-properties-in-native-classes
47
import { alias, equal } from '@ember/object/computed';
58
import { next } from '@ember/runloop';
69
import parseText from 'ember-inspector/utils/parse-text';
710

8-
interface ObjectInspectorPropertyArgs {
9-
model: any;
10-
digDeeper: () => unknown;
11-
gotoSource: () => void;
12-
sendToConsole: () => void;
13-
saveProperty: (
14-
property: unknown,
15-
value: unknown,
16-
dataType: unknown
17-
) => unknown;
11+
interface ObjectInspectorPropertySignature {
12+
Args: {
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14+
model: any;
15+
digDeeper: () => unknown;
16+
gotoSource: () => void;
17+
sendToConsole: () => void;
18+
saveProperty: (
19+
property: unknown,
20+
value: unknown,
21+
dataType: unknown,
22+
) => unknown;
23+
};
1824
}
1925

20-
export default class ObjectInspectorProperty extends Component<ObjectInspectorPropertyArgs> {
26+
export default class ObjectInspectorProperty extends Component<ObjectInspectorPropertySignature> {
2127
@tracked dateValue: Date | null = null;
2228
@tracked isDepsExpanded = false;
2329
@tracked isEdit = false;
@@ -66,10 +72,7 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
6672

6773
@computed('args.model.dependentKeys.[]', 'isCalculated')
6874
get hasDependentKeys() {
69-
return (
70-
this.args.model?.dependentKeys?.length &&
71-
this.isCalculated
72-
);
75+
return this.args.model?.dependentKeys?.length && this.isCalculated;
7376
}
7477

7578
get showDependentKeys() {
@@ -121,8 +124,11 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
121124
}
122125

123126
get cannotEdit() {
124-
if (this.args.model.name === '...' || !this.isCalculated || this.readOnly) return true;
125-
return !['type-string', 'type-number', 'type-boolean'].includes(this.args.model?.value?.type);
127+
if (this.args.model.name === '...' || !this.isCalculated || this.readOnly)
128+
return true;
129+
return !['type-string', 'type-number', 'type-boolean'].includes(
130+
this.args.model?.value?.type,
131+
);
126132
}
127133

128134
@action
@@ -143,12 +149,14 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
143149
return;
144150
}
145151

152+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
146153
let value = this.args.model.value.inspect;
147154

148155
if (this.isString) {
149156
value = this._quotedString(value);
150157
}
151158

159+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
152160
this.txtValue = value;
153161
this.isEdit = true;
154162
}
@@ -168,6 +176,7 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
168176

169177
@action
170178
finishedEditing() {
179+
// eslint-disable-next-line ember/no-runloop
171180
next(() => {
172181
this.isEdit = false;
173182
});

0 commit comments

Comments
 (0)