ember-data-resources 3.0.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/-private/find.d.ts +1 -0
- package/-private/query.d.ts +1 -0
- package/-private/resources/errors.d.ts +1 -0
- package/-private/resources/find-all.d.ts +2 -1
- package/-private/resources/find-record.d.ts +2 -1
- package/-private/resources/query-record.d.ts +2 -1
- package/-private/resources/query.d.ts +2 -1
- package/-private/resources/request.d.ts +10 -4
- package/-private/resources/types.d.ts +1 -0
- package/CHANGELOG.md +36 -0
- package/addon/-private/resources/find-all.ts +1 -4
- package/addon/-private/resources/find-record.ts +3 -4
- package/addon/-private/resources/query-record.ts +1 -4
- package/addon/-private/resources/query.ts +1 -4
- package/addon/-private/resources/request.ts +39 -26
- package/addon/js-helpers.ts +12 -10
- package/index.d.ts +1 -0
- package/js-helpers.d.ts +1 -0
- package/package.json +51 -44
- package/tsconfig.json +59 -14
- package/types/ember-data/types/registries/model.d.ts +6 -0
package/-private/find.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=find.d.ts.map
|
package/-private/query.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -12,7 +12,8 @@ export interface Args {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class FindAll<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
|
|
14
14
|
private _records;
|
|
15
|
-
__WRAPPED_FUNCTION__(): Promise<void>;
|
|
15
|
+
__WRAPPED_FUNCTION__([modelName]: PositionalArgs, { options }: NamedArgs): Promise<void>;
|
|
16
16
|
get records(): ArrayProxy<Model> | undefined;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
19
|
+
//# sourceMappingURL=find-all.d.ts.map
|
|
@@ -12,7 +12,8 @@ export interface Args {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class FindRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
|
|
14
14
|
private _record;
|
|
15
|
-
__WRAPPED_FUNCTION__(): Promise<void>;
|
|
15
|
+
__WRAPPED_FUNCTION__([modelName, id]: PositionalArgs, { options }: NamedArgs): Promise<void>;
|
|
16
16
|
get record(): Model | undefined;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
19
|
+
//# sourceMappingURL=find-record.d.ts.map
|
|
@@ -13,7 +13,8 @@ export interface Args {
|
|
|
13
13
|
}
|
|
14
14
|
export declare class QueryRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
|
|
15
15
|
private _record;
|
|
16
|
-
__WRAPPED_FUNCTION__(): Promise<void>;
|
|
16
|
+
__WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs): Promise<void>;
|
|
17
17
|
get record(): Model | undefined;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
20
|
+
//# sourceMappingURL=query-record.d.ts.map
|
|
@@ -14,7 +14,8 @@ export interface Args {
|
|
|
14
14
|
}
|
|
15
15
|
export declare class Query<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
|
|
16
16
|
private _records;
|
|
17
|
-
__WRAPPED_FUNCTION__(): Promise<void>;
|
|
17
|
+
__WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs): Promise<void>;
|
|
18
18
|
get records(): ArrayProxy<Model> | undefined;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
21
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { Resource } from 'ember-resources';
|
|
2
2
|
import type Store from '@ember-data/store';
|
|
3
|
+
import type { ExpandArgs } from 'ember-resources';
|
|
3
4
|
export declare type FindRecordOptions = Parameters<Store['findRecord']>[2];
|
|
4
5
|
export declare class Request<Args> extends Resource<Args> {
|
|
5
|
-
args: Args;
|
|
6
6
|
store: Store;
|
|
7
7
|
error: Error | undefined;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
hasRan: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Args saved, untracked, for retrying
|
|
12
|
+
*/
|
|
13
|
+
positional: ExpandArgs<Args>['Positional'];
|
|
14
|
+
named: ExpandArgs<Args>['Named'];
|
|
15
|
+
modify(positional: ExpandArgs<Args>['Positional'], named: ExpandArgs<Args>['Named']): void;
|
|
16
|
+
__WRAPPED_FUNCTION__(_positional: ExpandArgs<Args>['Positional'], _named: ExpandArgs<Args>['Named']): Promise<void>;
|
|
12
17
|
get isSuccess(): boolean;
|
|
13
18
|
get isError(): boolean;
|
|
14
19
|
get records(): unknown | undefined;
|
|
15
20
|
get record(): unknown | undefined;
|
|
16
21
|
retry(): Promise<void>;
|
|
17
|
-
__REQUEST_FUNCTION__(): Promise<void>;
|
|
22
|
+
__REQUEST_FUNCTION__(_positional: ExpandArgs<Args>['Positional'], _named: ExpandArgs<Args>['Named']): Promise<void>;
|
|
18
23
|
}
|
|
24
|
+
//# sourceMappingURL=request.d.ts.map
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
# [4.0.0](https://github.com/NullVoxPopuli/ember-data-resources/compare/v3.0.6...v4.0.0) (2022-08-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### chore
|
|
5
|
+
|
|
6
|
+
* upgrade to ember-resources v5 ([0ffab7a](https://github.com/NullVoxPopuli/ember-data-resources/commit/0ffab7aa8b9d018942540c7d7d25138f89368dfa))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* - minimum version of `@glimmer/component` is now `1.1.2`
|
|
12
|
+
- minimum version of `ember-source` is now `3.28`
|
|
13
|
+
- `@glint/template` is required for type-checking (if you use
|
|
14
|
+
typescript)
|
|
15
|
+
|
|
16
|
+
## [3.0.6](https://github.com/NullVoxPopuli/ember-data-resources/compare/v3.0.5...v3.0.6) (2022-02-04)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **deps:** update dependency ember-cli-typescript to v5 ([58e4e91](https://github.com/NullVoxPopuli/ember-data-resources/commit/58e4e91bec621274658801435aaa1fc19b0e20f9))
|
|
22
|
+
|
|
23
|
+
## [3.0.5](https://github.com/NullVoxPopuli/ember-data-resources/compare/v3.0.4...v3.0.5) (2022-02-03)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **deps:** update dependency ember-resources to ^4.3.0 ([7fda73e](https://github.com/NullVoxPopuli/ember-data-resources/commit/7fda73e4a94abefe225e0041846a662ce4ea9a5f))
|
|
29
|
+
|
|
30
|
+
## [3.0.4](https://github.com/NullVoxPopuli/ember-data-resources/compare/v3.0.3...v3.0.4) (2022-01-31)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **deps:** update dependency ember-resources to ^4.2.0 ([7d202b8](https://github.com/NullVoxPopuli/ember-data-resources/commit/7d202b8ad378e47af8bfb08c21eb0909935ee80e))
|
|
36
|
+
|
|
1
37
|
## [3.0.3](https://github.com/NullVoxPopuli/ember-data-resources/compare/v3.0.2...v3.0.3) (2022-01-21)
|
|
2
38
|
|
|
3
39
|
|
|
@@ -23,10 +23,7 @@ export class FindAll<Model, LocalArgs extends Args = Args> extends Request<Local
|
|
|
23
23
|
@tracked private _records: ArrayProxy<Model> | undefined;
|
|
24
24
|
|
|
25
25
|
@action
|
|
26
|
-
async __WRAPPED_FUNCTION__() {
|
|
27
|
-
let [modelName] = this.args.positional;
|
|
28
|
-
let { options } = this.args.named;
|
|
29
|
-
|
|
26
|
+
async __WRAPPED_FUNCTION__([modelName]: PositionalArgs, { options }: NamedArgs) {
|
|
30
27
|
let records = await this.store.findAll(modelName as never, options);
|
|
31
28
|
|
|
32
29
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { tracked } from '@glimmer/tracking';
|
|
2
2
|
import { isDestroyed, isDestroying } from '@ember/destroyable';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
+
import { waitFor } from '@ember/test-waiters';
|
|
4
5
|
|
|
5
6
|
import { IdRequiredError, IdTypeError } from './errors';
|
|
6
7
|
import { Request } from './request';
|
|
@@ -24,10 +25,8 @@ export class FindRecord<Model, LocalArgs extends Args = Args> extends Request<Lo
|
|
|
24
25
|
@tracked private _record: Model | undefined;
|
|
25
26
|
|
|
26
27
|
@action
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
let { options } = this.args.named;
|
|
30
|
-
|
|
28
|
+
@waitFor
|
|
29
|
+
async __WRAPPED_FUNCTION__([modelName, id]: PositionalArgs, { options }: NamedArgs) {
|
|
31
30
|
/**
|
|
32
31
|
* ember-data forbids usage of invalid arguments
|
|
33
32
|
* in JS, this is typically fine as we can also try-catch, but
|
|
@@ -24,10 +24,7 @@ export class QueryRecord<Model, LocalArgs extends Args = Args> extends Request<L
|
|
|
24
24
|
@tracked private _record: Model | undefined;
|
|
25
25
|
|
|
26
26
|
@action
|
|
27
|
-
async __WRAPPED_FUNCTION__() {
|
|
28
|
-
let [modelName, query] = this.args.positional;
|
|
29
|
-
let { options } = this.args.named;
|
|
30
|
-
|
|
27
|
+
async __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs) {
|
|
31
28
|
let record = await this.store.queryRecord(modelName as never, query, options);
|
|
32
29
|
|
|
33
30
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
@@ -25,10 +25,7 @@ export class Query<Model, LocalArgs extends Args = Args> extends Request<LocalAr
|
|
|
25
25
|
@tracked private _records: ArrayProxy<Model> | undefined;
|
|
26
26
|
|
|
27
27
|
@action
|
|
28
|
-
async __WRAPPED_FUNCTION__() {
|
|
29
|
-
let [modelName, query] = this.args.positional;
|
|
30
|
-
let { options } = this.args.named;
|
|
31
|
-
|
|
28
|
+
async __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs) {
|
|
32
29
|
let records = await this.store.query(modelName as never, query, options);
|
|
33
30
|
|
|
34
31
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
@@ -8,26 +8,42 @@ import { waitFor, waitForPromise } from '@ember/test-waiters';
|
|
|
8
8
|
import { Resource } from 'ember-resources';
|
|
9
9
|
|
|
10
10
|
import type Store from '@ember-data/store';
|
|
11
|
-
import type {
|
|
11
|
+
import type { ExpandArgs } from 'ember-resources';
|
|
12
12
|
|
|
13
13
|
export type FindRecordOptions = Parameters<Store['findRecord']>[2];
|
|
14
14
|
|
|
15
15
|
export class Request<Args> extends Resource<Args> {
|
|
16
|
-
declare args: Args;
|
|
17
|
-
|
|
18
16
|
@service declare store: Store;
|
|
19
17
|
|
|
20
18
|
@tracked error: Error | undefined;
|
|
21
19
|
@tracked isLoading = false;
|
|
22
20
|
@tracked hasRan = false;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Args saved, untracked, for retrying
|
|
24
|
+
*/
|
|
25
|
+
declare positional: ExpandArgs<Args>['Positional'];
|
|
26
|
+
declare named: ExpandArgs<Args>['Named'];
|
|
27
|
+
|
|
28
|
+
modify(positional: ExpandArgs<Args>['Positional'], named: ExpandArgs<Args>['Named']) {
|
|
29
|
+
this.positional = positional;
|
|
30
|
+
this.named = named;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* We need to consume all arguments here so that we correctly respond to updates to
|
|
34
|
+
* dirtied source data.
|
|
35
|
+
*
|
|
36
|
+
* e.g.: when an id changes that is passed to findRecord, we re-fetch.
|
|
37
|
+
*/
|
|
38
|
+
this.__REQUEST_FUNCTION__([...(positional as unknown[])] as ExpandArgs<Args>['Positional'], {
|
|
39
|
+
...named,
|
|
40
|
+
});
|
|
28
41
|
}
|
|
29
42
|
|
|
30
|
-
async __WRAPPED_FUNCTION__(
|
|
43
|
+
async __WRAPPED_FUNCTION__(
|
|
44
|
+
_positional: ExpandArgs<Args>['Positional'],
|
|
45
|
+
_named: ExpandArgs<Args>['Named']
|
|
46
|
+
) {
|
|
31
47
|
throw new Error('Not Implemented');
|
|
32
48
|
}
|
|
33
49
|
|
|
@@ -54,14 +70,19 @@ export class Request<Args> extends Resource<Args> {
|
|
|
54
70
|
}
|
|
55
71
|
|
|
56
72
|
@action async retry() {
|
|
57
|
-
return waitForPromise(this.__WRAPPED_FUNCTION__());
|
|
73
|
+
return waitForPromise(this.__WRAPPED_FUNCTION__(this.positional, this.named));
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
@action
|
|
61
77
|
@waitFor
|
|
62
|
-
async __REQUEST_FUNCTION__(
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
async __REQUEST_FUNCTION__(
|
|
79
|
+
_positional: ExpandArgs<Args>['Positional'],
|
|
80
|
+
_named: ExpandArgs<Args>['Named']
|
|
81
|
+
) {
|
|
82
|
+
/**
|
|
83
|
+
* Args are already consumed, but let's delay doing anything
|
|
84
|
+
* until we can get out of a tracking frame.
|
|
85
|
+
*/
|
|
65
86
|
await Promise.resolve();
|
|
66
87
|
|
|
67
88
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
@@ -74,7 +95,12 @@ export class Request<Args> extends Resource<Args> {
|
|
|
74
95
|
} catch (e) {
|
|
75
96
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
76
97
|
|
|
77
|
-
|
|
98
|
+
if (e instanceof Error) {
|
|
99
|
+
this.error = e;
|
|
100
|
+
} else {
|
|
101
|
+
// How likely is this to happen?
|
|
102
|
+
throw e;
|
|
103
|
+
}
|
|
78
104
|
}
|
|
79
105
|
|
|
80
106
|
if (isDestroyed(this) || isDestroying(this)) {
|
|
@@ -85,16 +111,3 @@ export class Request<Args> extends Resource<Args> {
|
|
|
85
111
|
this.hasRan = true;
|
|
86
112
|
}
|
|
87
113
|
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Helper function to bind all arguments to the lifecycle of the resource
|
|
91
|
-
*/
|
|
92
|
-
function consumeEverything(args: ArgsWrapper) {
|
|
93
|
-
for (let i = 0; i < (args.positional?.length || 0); i++) {
|
|
94
|
-
args.positional?.[i];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
for (let key in args.named || {}) {
|
|
98
|
-
args.named?.[key];
|
|
99
|
-
}
|
|
100
|
-
}
|
package/addon/js-helpers.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
-
import { useResource } from 'ember-resources';
|
|
3
|
-
|
|
4
2
|
import { FindAll } from './-private/resources/find-all';
|
|
5
3
|
import { FindRecord } from './-private/resources/find-record';
|
|
6
4
|
import { Query } from './-private/resources/query';
|
|
@@ -19,7 +17,7 @@ export function findRecord<Model = unknown>(
|
|
|
19
17
|
modelName: string,
|
|
20
18
|
thunk: () => FindRecordThunkResult
|
|
21
19
|
) {
|
|
22
|
-
return
|
|
20
|
+
return FindRecord.from(destroyable, () => {
|
|
23
21
|
let reified = thunk();
|
|
24
22
|
let id: Id;
|
|
25
23
|
let options: FindRecordOptions;
|
|
@@ -38,7 +36,8 @@ export function findRecord<Model = unknown>(
|
|
|
38
36
|
options,
|
|
39
37
|
},
|
|
40
38
|
};
|
|
41
|
-
|
|
39
|
+
// Cast needed Until min-supported TS is 4.7
|
|
40
|
+
}) as FindRecord<Model>;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
type FindAllThunkResult = { options: FindAllOptions } | FindAllOptions | void;
|
|
@@ -48,7 +47,7 @@ export function findAll<Model = unknown>(
|
|
|
48
47
|
modelName: string,
|
|
49
48
|
thunk?: () => FindAllThunkResult
|
|
50
49
|
) {
|
|
51
|
-
return
|
|
50
|
+
return FindAll.from(destroyable, () => {
|
|
52
51
|
let reified = thunk?.() || {};
|
|
53
52
|
let options = 'options' in reified ? reified.options : reified;
|
|
54
53
|
|
|
@@ -58,7 +57,8 @@ export function findAll<Model = unknown>(
|
|
|
58
57
|
options,
|
|
59
58
|
},
|
|
60
59
|
};
|
|
61
|
-
|
|
60
|
+
// Cast needed Until min-supported TS is 4.7
|
|
61
|
+
}) as FindAll<Model>;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
type QueryThunkResult = QueryQuery | [QueryQuery] | [QueryQuery, QueryOptions];
|
|
@@ -68,7 +68,7 @@ export function query<Model = unknown>(
|
|
|
68
68
|
modelName: string,
|
|
69
69
|
thunk: () => QueryThunkResult
|
|
70
70
|
) {
|
|
71
|
-
return
|
|
71
|
+
return Query.from(destroyable, () => {
|
|
72
72
|
let reified = thunk();
|
|
73
73
|
|
|
74
74
|
if (Array.isArray(reified)) {
|
|
@@ -88,7 +88,8 @@ export function query<Model = unknown>(
|
|
|
88
88
|
options: {},
|
|
89
89
|
},
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
// Cast needed Until min-supported TS is 4.7
|
|
92
|
+
}) as Query<Model>;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
type QueryRecordThunkResult =
|
|
@@ -101,7 +102,7 @@ export function queryRecord<Model = unknown>(
|
|
|
101
102
|
modelName: string,
|
|
102
103
|
thunk: () => QueryRecordThunkResult
|
|
103
104
|
) {
|
|
104
|
-
return
|
|
105
|
+
return QueryRecord.from(destroyable, () => {
|
|
105
106
|
let reified = thunk();
|
|
106
107
|
|
|
107
108
|
if (Array.isArray(reified)) {
|
|
@@ -121,5 +122,6 @@ export function queryRecord<Model = unknown>(
|
|
|
121
122
|
options: {},
|
|
122
123
|
},
|
|
123
124
|
};
|
|
124
|
-
|
|
125
|
+
// Cast needed Until min-supported TS is 4.7
|
|
126
|
+
}) as QueryRecord<Model>;
|
|
125
127
|
}
|
package/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { FindRecord } from './-private/resources/find-record';
|
|
|
3
3
|
export { Query } from './-private/resources/query';
|
|
4
4
|
export { QueryRecord } from './-private/resources/query-record';
|
|
5
5
|
export { findAll, findRecord, query, queryRecord } from './js-helpers';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
package/js-helpers.d.ts
CHANGED
|
@@ -18,3 +18,4 @@ export declare function query<Model = unknown>(destroyable: object, modelName: s
|
|
|
18
18
|
declare type QueryRecordThunkResult = QueryRecordQuery | [QueryRecordQuery] | [QueryRecordQuery, QueryRecordOptions];
|
|
19
19
|
export declare function queryRecord<Model = unknown>(destroyable: object, modelName: string, thunk: () => QueryRecordThunkResult): QueryRecord<Model, import("./-private/resources/query-record").Args>;
|
|
20
20
|
export {};
|
|
21
|
+
//# sourceMappingURL=js-helpers.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-data-resources",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Resource helpers for reactively (re)fetching data with ember-data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -33,49 +33,56 @@
|
|
|
33
33
|
"ember-auto-import": "^2.4.0",
|
|
34
34
|
"ember-cli-babel": "^7.26.11",
|
|
35
35
|
"ember-cli-htmlbars": "^6.0.1",
|
|
36
|
-
"ember-cli-typescript": "^
|
|
37
|
-
"ember-resources": "^
|
|
36
|
+
"ember-cli-typescript": "^5.1.0",
|
|
37
|
+
"ember-resources": "^5.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@commitlint/cli": "^16.
|
|
41
|
-
"@commitlint/config-conventional": "^16.
|
|
40
|
+
"@commitlint/cli": "^16.2.3",
|
|
41
|
+
"@commitlint/config-conventional": "^16.2.1",
|
|
42
42
|
"@ember/optional-features": "^2.0.0",
|
|
43
|
-
"@ember/test-helpers": "^2.
|
|
43
|
+
"@ember/test-helpers": "^2.8.1",
|
|
44
44
|
"@embroider/test-setup": "^1.0.0",
|
|
45
45
|
"@glimmer/component": "^1.0.4",
|
|
46
|
-
"@
|
|
46
|
+
"@glint/template": "^0.9.2",
|
|
47
|
+
"@nullvoxpopuli/eslint-configs": "^2.2.7",
|
|
47
48
|
"@semantic-release/changelog": "^6.0.1",
|
|
48
49
|
"@semantic-release/git": "^10.0.1",
|
|
49
|
-
"@types/ember
|
|
50
|
-
"@types/ember-
|
|
51
|
-
"@types/ember-
|
|
52
|
-
"@types/ember-
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"@types/
|
|
71
|
-
"@types/
|
|
50
|
+
"@types/ember": "^4.0.0",
|
|
51
|
+
"@types/ember-data": "^4.4.1",
|
|
52
|
+
"@types/ember-data__adapter": "^4.0.0",
|
|
53
|
+
"@types/ember-data__model": "^4.0.0",
|
|
54
|
+
"@types/ember-data__serializer": "^4.0.0",
|
|
55
|
+
"@types/ember-data__store": "^4.0.0",
|
|
56
|
+
"@types/ember-qunit": "^5.0.0",
|
|
57
|
+
"@types/ember-resolver": "^5.0.11",
|
|
58
|
+
"@types/ember__application": "^4.0.1",
|
|
59
|
+
"@types/ember__array": "^4.0.2",
|
|
60
|
+
"@types/ember__component": "^4.0.10",
|
|
61
|
+
"@types/ember__controller": "^4.0.1",
|
|
62
|
+
"@types/ember__debug": "^4.0.1",
|
|
63
|
+
"@types/ember__destroyable": "^4.0.0",
|
|
64
|
+
"@types/ember__engine": "^4.0.2",
|
|
65
|
+
"@types/ember__error": "^4.0.0",
|
|
66
|
+
"@types/ember__object": "^4.0.4",
|
|
67
|
+
"@types/ember__polyfills": "^4.0.0",
|
|
68
|
+
"@types/ember__routing": "^4.0.10",
|
|
69
|
+
"@types/ember__runloop": "^4.0.1",
|
|
70
|
+
"@types/ember__service": "^4.0.0",
|
|
71
|
+
"@types/ember__string": "^3.0.9",
|
|
72
|
+
"@types/ember__template": "^4.0.0",
|
|
73
|
+
"@types/ember__test": "^4.0.0",
|
|
74
|
+
"@types/ember__test-helpers": "^2.8.1",
|
|
75
|
+
"@types/ember__utils": "^4.0.0",
|
|
76
|
+
"@types/htmlbars-inline-precompile": "^3.0.0",
|
|
77
|
+
"@types/qunit": "^2.19.2",
|
|
72
78
|
"@types/rsvp": "^4.0.4",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
74
|
-
"@typescript-eslint/parser": "^5.
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
80
|
+
"@typescript-eslint/parser": "^5.15.0",
|
|
75
81
|
"babel-eslint": "^10.1.0",
|
|
76
82
|
"broccoli-asset-rev": "^3.0.0",
|
|
77
|
-
"ember-cli": "~4.
|
|
78
|
-
"ember-cli-dependency-checker": "^3.
|
|
83
|
+
"ember-cli": "~4.6.0",
|
|
84
|
+
"ember-cli-dependency-checker": "^3.3.1",
|
|
85
|
+
"ember-cli-deprecation-workflow": "^2.1.0",
|
|
79
86
|
"ember-cli-inject-live-reload": "^2.1.0",
|
|
80
87
|
"ember-cli-sri": "^2.1.1",
|
|
81
88
|
"ember-cli-terser": "^4.0.2",
|
|
@@ -90,26 +97,26 @@
|
|
|
90
97
|
"ember-resolver": "^8.0.3",
|
|
91
98
|
"ember-source": "~4.1.0",
|
|
92
99
|
"ember-source-channel-url": "^3.0.0",
|
|
93
|
-
"ember-template-lint": "^3.
|
|
100
|
+
"ember-template-lint": "^4.3.0",
|
|
94
101
|
"ember-try": "^2.0.0",
|
|
95
|
-
"eslint": "^7.
|
|
96
|
-
"eslint-config-prettier": "^8.
|
|
102
|
+
"eslint": "^7.0.0",
|
|
103
|
+
"eslint-config-prettier": "^8.5.0",
|
|
97
104
|
"eslint-plugin-decorator-position": "^4.0.1",
|
|
98
|
-
"eslint-plugin-ember": "^10.5.
|
|
105
|
+
"eslint-plugin-ember": "^10.5.9",
|
|
99
106
|
"eslint-plugin-import": "^2.25.4",
|
|
100
107
|
"eslint-plugin-node": "^11.1.0",
|
|
101
108
|
"eslint-plugin-prettier": "^4.0.0",
|
|
102
109
|
"eslint-plugin-qunit": "^7.2.0",
|
|
103
110
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
104
111
|
"loader.js": "^4.7.0",
|
|
105
|
-
"msw": "^0.36.
|
|
112
|
+
"msw": "^0.36.8",
|
|
106
113
|
"npm-run-all": "^4.1.5",
|
|
107
|
-
"prettier": "^2.
|
|
108
|
-
"qunit": "^2.
|
|
114
|
+
"prettier": "^2.7.1",
|
|
115
|
+
"qunit": "^2.19.1",
|
|
109
116
|
"qunit-dom": "^2.0.0",
|
|
110
117
|
"semantic-release": "^19.0.2",
|
|
111
|
-
"typescript": "
|
|
112
|
-
"webpack": "^5.
|
|
118
|
+
"typescript": "~4.7.0",
|
|
119
|
+
"webpack": "^5.74.0"
|
|
113
120
|
},
|
|
114
121
|
"peerDependencies": {
|
|
115
122
|
"ember-data": "^3.25.0"
|
|
@@ -130,7 +137,7 @@
|
|
|
130
137
|
},
|
|
131
138
|
"volta": {
|
|
132
139
|
"node": "16.13.2",
|
|
133
|
-
"yarn": "1.22.
|
|
140
|
+
"yarn": "1.22.18"
|
|
134
141
|
},
|
|
135
142
|
"engines": {
|
|
136
143
|
"node": "14.* || >= 16"
|
package/tsconfig.json
CHANGED
|
@@ -1,25 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"module": "ES2020",
|
|
5
5
|
"moduleResolution": "node",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
|
|
7
|
+
// Trying to check Ember apps and addons with `allowJs: true` is a recipe
|
|
8
|
+
// for many unresolveable type errors, because with *considerable* extra
|
|
9
|
+
// configuration it ends up including many files which are *not* valid and
|
|
10
|
+
// cannot be: they *appear* to be resolve-able to TS, but are in fact not in
|
|
11
|
+
// valid Node-resolveable locations and may not have TS-ready types. This
|
|
12
|
+
// will likely improve over time
|
|
13
|
+
"allowJs": false,
|
|
14
|
+
|
|
15
|
+
// --- TS for SemVer Types compatibility
|
|
16
|
+
// Strictness settings -- you should *not* change these: Ember code is not
|
|
17
|
+
// guaranteed to type check with these set to looser values.
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
|
|
21
|
+
// Interop: these are viral and will require anyone downstream of your
|
|
22
|
+
// package to *also* set them to true. If you *must* enable them to consume
|
|
23
|
+
// an upstream package, you should document that for downstream consumers to
|
|
24
|
+
// be aware of.
|
|
25
|
+
//
|
|
26
|
+
// These *are* safe for apps to enable, since they do not *have* downstream
|
|
27
|
+
// consumers; but leaving them off is still preferred when possible, since
|
|
28
|
+
// it makes it easier to switch between apps and addons and have the same
|
|
29
|
+
// rules for what can be imported and how.
|
|
30
|
+
"allowSyntheticDefaultImports": false,
|
|
31
|
+
"esModuleInterop": false,
|
|
32
|
+
|
|
33
|
+
// --- Lint-style rules
|
|
34
|
+
|
|
35
|
+
// TypeScript also supplies some lint-style checks; nearly all of them are
|
|
36
|
+
// better handled by ESLint with the `@typescript-eslint`. This one is more
|
|
37
|
+
// like a safety check, though, so we leave it on.
|
|
38
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
39
|
+
|
|
40
|
+
// --- Compilation/integration settings
|
|
41
|
+
// Setting `noEmitOnError` here allows ember-cli-typescript to catch errors
|
|
42
|
+
// and inject them into Ember CLI's build error reporting, which provides
|
|
43
|
+
// nice feedback for when
|
|
16
44
|
"noEmitOnError": false,
|
|
45
|
+
|
|
46
|
+
// We use Babel for emitting runtime code, because it's very important that
|
|
47
|
+
// we always and only use the same transpiler for non-stable features, in
|
|
48
|
+
// particular decorators. If you were to change this to `true`, it could
|
|
49
|
+
// lead to accidentally generating code with `tsc` instead of Babel, and
|
|
50
|
+
// could thereby result in broken code at runtime.
|
|
17
51
|
"noEmit": true,
|
|
52
|
+
|
|
53
|
+
// Ember makes heavy use of decorators; TS does not support them at all
|
|
54
|
+
// without this flag.
|
|
55
|
+
"experimentalDecorators": true,
|
|
56
|
+
|
|
57
|
+
// Support generation of source maps. Note: you must *also* enable source
|
|
58
|
+
// maps in your `ember-cli-babel` config and/or `babel.config.js`.
|
|
59
|
+
"declaration": true,
|
|
60
|
+
"declarationMap": true,
|
|
18
61
|
"inlineSourceMap": true,
|
|
19
62
|
"inlineSources": true,
|
|
63
|
+
|
|
64
|
+
// The combination of `baseUrl` with `paths` allows Ember's classic package
|
|
65
|
+
// layout, which is not resolveable with the Node resolution algorithm, to
|
|
66
|
+
// work with TypeScript.
|
|
20
67
|
"baseUrl": ".",
|
|
21
|
-
"module": "es6",
|
|
22
|
-
"experimentalDecorators": true,
|
|
23
68
|
"paths": {
|
|
24
69
|
"dummy/tests/*": [
|
|
25
70
|
"tests/*"
|