ember-container-query 2.0.2 → 2.1.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/CHANGELOG.md +22 -0
- package/addon/components/{container-query.js → container-query.ts} +36 -15
- package/addon/helpers/cq-aspect-ratio.ts +20 -0
- package/addon/helpers/cq-height.ts +20 -0
- package/addon/helpers/cq-width.ts +20 -0
- package/components/container-query.d.ts +35 -0
- package/helpers/cq-aspect-ratio.d.ts +14 -0
- package/helpers/cq-height.d.ts +14 -0
- package/helpers/cq-width.d.ts +14 -0
- package/package.json +44 -15
- package/tsconfig.json +104 -0
- package/types/dummy/index.d.ts +0 -0
- package/types/global.d.ts +6 -0
- package/addon/helpers/cq-aspect-ratio.js +0 -10
- package/addon/helpers/cq-height.js +0 -10
- package/addon/helpers/cq-width.js +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 2.1.0 (2022-06-03)
|
|
2
|
+
|
|
3
|
+
### Enhancement
|
|
4
|
+
* [#119](https://github.com/ijlee2/ember-container-query/pull/119) Introduced TypeScript (Part 3) ([@ijlee2](https://github.com/ijlee2))
|
|
5
|
+
|
|
6
|
+
### Internal
|
|
7
|
+
* [#123](https://github.com/ijlee2/ember-container-query/pull/123) Updated GitHub actions to v3 ([@ijlee2](https://github.com/ijlee2))
|
|
8
|
+
* [#122](https://github.com/ijlee2/ember-container-query/pull/122) Updated Node version in CI to 16 ([@ijlee2](https://github.com/ijlee2))
|
|
9
|
+
* [#121](https://github.com/ijlee2/ember-container-query/pull/121) Updated ember-on-resize-modifier to v1.1.0 ([@ijlee2](https://github.com/ijlee2))
|
|
10
|
+
* [#117](https://github.com/ijlee2/ember-container-query/pull/117) Updated dependencies to their latest version ([@ijlee2](https://github.com/ijlee2))
|
|
11
|
+
* [#115](https://github.com/ijlee2/ember-container-query/pull/115) Updated eslint to v8 ([@ijlee2](https://github.com/ijlee2))
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
* [#120](https://github.com/ijlee2/ember-container-query/pull/120) Introduced TypeScript (Part 4) ([@ijlee2](https://github.com/ijlee2))
|
|
15
|
+
* [#118](https://github.com/ijlee2/ember-container-query/pull/118) Introduced TypeScript (Part 2) ([@ijlee2](https://github.com/ijlee2))
|
|
16
|
+
* [#114](https://github.com/ijlee2/ember-container-query/pull/114) Introduced TypeScript (Part 1) ([@ijlee2](https://github.com/ijlee2))
|
|
17
|
+
* [#116](https://github.com/ijlee2/ember-container-query/pull/116) Updated demo app ([@ijlee2](https://github.com/ijlee2))
|
|
18
|
+
|
|
19
|
+
### Committers: 1
|
|
20
|
+
- Isaac Lee ([@ijlee2](https://github.com/ijlee2))
|
|
21
|
+
|
|
22
|
+
|
|
1
23
|
## 2.0.2 (2022-04-25)
|
|
2
24
|
|
|
3
25
|
### Bug Fix
|
|
@@ -3,28 +3,49 @@ import Component from '@glimmer/component';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { debounce } from '@ember/runloop';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
type Metadata = {
|
|
7
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
8
|
+
max: number;
|
|
9
|
+
min: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type Features = {
|
|
13
|
+
[featureName: string]: Metadata;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type QueryResults = {
|
|
17
|
+
[featureName: string]: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface ContainerQueryComponentArgs {
|
|
21
|
+
dataAttributePrefix?: string;
|
|
22
|
+
debounce?: number;
|
|
23
|
+
features?: Features;
|
|
24
|
+
tagName?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default class ContainerQueryComponent extends Component<ContainerQueryComponentArgs> {
|
|
28
|
+
@tracked queryResults = {} as QueryResults;
|
|
29
|
+
@tracked aspectRatio?: number;
|
|
30
|
+
@tracked height?: number;
|
|
31
|
+
@tracked width?: number;
|
|
11
32
|
|
|
12
|
-
get features() {
|
|
33
|
+
get features(): Features {
|
|
13
34
|
return this.args.features ?? {};
|
|
14
35
|
}
|
|
15
36
|
|
|
16
|
-
get dataAttributePrefix() {
|
|
37
|
+
get dataAttributePrefix(): string {
|
|
17
38
|
return this.args.dataAttributePrefix ?? 'container-query';
|
|
18
39
|
}
|
|
19
40
|
|
|
20
|
-
get debounce() {
|
|
41
|
+
get debounce(): number {
|
|
21
42
|
return this.args.debounce ?? 0;
|
|
22
43
|
}
|
|
23
44
|
|
|
24
45
|
// The dynamic tag is restricted to be immutable
|
|
25
46
|
tagName = this.args.tagName ?? 'div';
|
|
26
47
|
|
|
27
|
-
@action onResize(resizeObserverEntry) {
|
|
48
|
+
@action onResize(resizeObserverEntry: ResizeObserverEntry): void {
|
|
28
49
|
const element = resizeObserverEntry.target;
|
|
29
50
|
|
|
30
51
|
if (this.debounce > 0) {
|
|
@@ -35,24 +56,24 @@ export default class ContainerQueryComponent extends Component {
|
|
|
35
56
|
this.queryContainer(element);
|
|
36
57
|
}
|
|
37
58
|
|
|
38
|
-
@action queryContainer(element) {
|
|
59
|
+
@action queryContainer(element: Element): void {
|
|
39
60
|
this.measureDimensions(element);
|
|
40
61
|
this.evaluateQueries();
|
|
41
62
|
this.setDataAttributes(element);
|
|
42
63
|
}
|
|
43
64
|
|
|
44
|
-
measureDimensions(element) {
|
|
65
|
+
measureDimensions(element: Element): void {
|
|
45
66
|
this.height = element.clientHeight;
|
|
46
67
|
this.width = element.clientWidth;
|
|
47
68
|
this.aspectRatio = this.width / this.height;
|
|
48
69
|
}
|
|
49
70
|
|
|
50
|
-
evaluateQueries() {
|
|
51
|
-
const queryResults = {};
|
|
71
|
+
evaluateQueries(): void {
|
|
72
|
+
const queryResults = {} as QueryResults;
|
|
52
73
|
|
|
53
74
|
for (const [featureName, metadata] of Object.entries(this.features)) {
|
|
54
75
|
const { dimension, min, max } = metadata;
|
|
55
|
-
const value = this[dimension]
|
|
76
|
+
const value = this[dimension]!;
|
|
56
77
|
|
|
57
78
|
queryResults[featureName] = min <= value && value < max;
|
|
58
79
|
}
|
|
@@ -60,7 +81,7 @@ export default class ContainerQueryComponent extends Component {
|
|
|
60
81
|
this.queryResults = queryResults;
|
|
61
82
|
}
|
|
62
83
|
|
|
63
|
-
setDataAttributes(element) {
|
|
84
|
+
setDataAttributes(element: Element): void {
|
|
64
85
|
const prefix = this.dataAttributePrefix;
|
|
65
86
|
|
|
66
87
|
for (const [featureName, meetsFeature] of Object.entries(
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
|
|
3
|
+
type Metadata = {
|
|
4
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
5
|
+
max: number;
|
|
6
|
+
min: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function cqAspectRatio(
|
|
10
|
+
positional: unknown[],
|
|
11
|
+
named: Record<string, unknown>
|
|
12
|
+
): Metadata {
|
|
13
|
+
const dimension = 'aspectRatio';
|
|
14
|
+
const max = (named['max'] as number | undefined) ?? Infinity;
|
|
15
|
+
const min = (named['min'] as number | undefined) ?? 0;
|
|
16
|
+
|
|
17
|
+
return { dimension, max, min };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default helper(cqAspectRatio);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
|
|
3
|
+
type Metadata = {
|
|
4
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
5
|
+
max: number;
|
|
6
|
+
min: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function cqHeight(
|
|
10
|
+
positional: unknown[],
|
|
11
|
+
named: Record<string, unknown>
|
|
12
|
+
): Metadata {
|
|
13
|
+
const dimension = 'height';
|
|
14
|
+
const max = (named['max'] as number | undefined) ?? Infinity;
|
|
15
|
+
const min = (named['min'] as number | undefined) ?? 0;
|
|
16
|
+
|
|
17
|
+
return { dimension, max, min };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default helper(cqHeight);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
|
|
3
|
+
type Metadata = {
|
|
4
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
5
|
+
max: number;
|
|
6
|
+
min: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function cqWidth(
|
|
10
|
+
positional: unknown[],
|
|
11
|
+
named: Record<string, unknown>
|
|
12
|
+
): Metadata {
|
|
13
|
+
const dimension = 'width';
|
|
14
|
+
const max = (named['max'] as number | undefined) ?? Infinity;
|
|
15
|
+
const min = (named['min'] as number | undefined) ?? 0;
|
|
16
|
+
|
|
17
|
+
return { dimension, max, min };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default helper(cqWidth);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
declare type Metadata = {
|
|
3
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
4
|
+
max: number;
|
|
5
|
+
min: number;
|
|
6
|
+
};
|
|
7
|
+
declare type Features = {
|
|
8
|
+
[featureName: string]: Metadata;
|
|
9
|
+
};
|
|
10
|
+
declare type QueryResults = {
|
|
11
|
+
[featureName: string]: boolean;
|
|
12
|
+
};
|
|
13
|
+
interface ContainerQueryComponentArgs {
|
|
14
|
+
dataAttributePrefix?: string;
|
|
15
|
+
debounce?: number;
|
|
16
|
+
features?: Features;
|
|
17
|
+
tagName?: string;
|
|
18
|
+
}
|
|
19
|
+
export default class ContainerQueryComponent extends Component<ContainerQueryComponentArgs> {
|
|
20
|
+
queryResults: QueryResults;
|
|
21
|
+
aspectRatio?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
width?: number;
|
|
24
|
+
get features(): Features;
|
|
25
|
+
get dataAttributePrefix(): string;
|
|
26
|
+
get debounce(): number;
|
|
27
|
+
tagName: string;
|
|
28
|
+
onResize(resizeObserverEntry: ResizeObserverEntry): void;
|
|
29
|
+
queryContainer(element: Element): void;
|
|
30
|
+
measureDimensions(element: Element): void;
|
|
31
|
+
evaluateQueries(): void;
|
|
32
|
+
setDataAttributes(element: Element): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=container-query.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare type Metadata = {
|
|
2
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("@ember/component/helper").FunctionBasedHelper<{
|
|
7
|
+
Args: {
|
|
8
|
+
Positional: unknown[];
|
|
9
|
+
Named: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
Return: Metadata;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=cq-aspect-ratio.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare type Metadata = {
|
|
2
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("@ember/component/helper").FunctionBasedHelper<{
|
|
7
|
+
Args: {
|
|
8
|
+
Positional: unknown[];
|
|
9
|
+
Named: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
Return: Metadata;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=cq-height.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare type Metadata = {
|
|
2
|
+
dimension: 'aspectRatio' | 'height' | 'width';
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("@ember/component/helper").FunctionBasedHelper<{
|
|
7
|
+
Args: {
|
|
8
|
+
Positional: unknown[];
|
|
9
|
+
Named: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
Return: Metadata;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=cq-width.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-container-query",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Container queries using Ember modifiers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"container-queries",
|
|
@@ -31,8 +31,11 @@
|
|
|
31
31
|
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
|
|
32
32
|
"lint:hbs": "ember-template-lint .",
|
|
33
33
|
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
34
|
-
"lint:js": "eslint . --cache",
|
|
34
|
+
"lint:js": "eslint . --cache --ext=.js,.ts",
|
|
35
35
|
"lint:js:fix": "eslint . --fix",
|
|
36
|
+
"lint:types": "tsc --noEmit",
|
|
37
|
+
"prepack": "ember ts:precompile",
|
|
38
|
+
"postpack": "ember ts:clean",
|
|
36
39
|
"start": "ember serve",
|
|
37
40
|
"test": "DEVICE='w3-h3' ember test",
|
|
38
41
|
"test:ember": "ember test",
|
|
@@ -52,27 +55,52 @@
|
|
|
52
55
|
"@ember/render-modifiers": "^2.0.4",
|
|
53
56
|
"ember-cli-babel": "^7.26.11",
|
|
54
57
|
"ember-cli-htmlbars": "^6.0.1",
|
|
58
|
+
"ember-cli-typescript": "^5.1.0",
|
|
55
59
|
"ember-element-helper": "^0.6.1",
|
|
56
|
-
"ember-on-resize-modifier": "^1.
|
|
60
|
+
"ember-on-resize-modifier": "^1.1.0"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
59
63
|
"@ember/optional-features": "^2.0.0",
|
|
60
|
-
"@ember/test-helpers": "^2.
|
|
61
|
-
"@embroider/test-setup": "^1.
|
|
64
|
+
"@ember/test-helpers": "^2.8.1",
|
|
65
|
+
"@embroider/test-setup": "^1.7.1",
|
|
62
66
|
"@glimmer/component": "^1.1.2",
|
|
63
67
|
"@glimmer/tracking": "^1.1.2",
|
|
64
|
-
"@percy/cli": "^1.1
|
|
68
|
+
"@percy/cli": "^1.2.1",
|
|
65
69
|
"@percy/ember": "^3.0.0",
|
|
66
|
-
"
|
|
70
|
+
"@types/ember-qunit": "^5.0.0",
|
|
71
|
+
"@types/ember-resolver": "^5.0.11",
|
|
72
|
+
"@types/ember__application": "^4.0.0",
|
|
73
|
+
"@types/ember__array": "^4.0.1",
|
|
74
|
+
"@types/ember__component": "^4.0.8",
|
|
75
|
+
"@types/ember__controller": "^4.0.0",
|
|
76
|
+
"@types/ember__debug": "^4.0.1",
|
|
77
|
+
"@types/ember__engine": "^4.0.0",
|
|
78
|
+
"@types/ember__error": "^4.0.0",
|
|
79
|
+
"@types/ember__object": "^4.0.2",
|
|
80
|
+
"@types/ember__polyfills": "^4.0.0",
|
|
81
|
+
"@types/ember__routing": "^4.0.7",
|
|
82
|
+
"@types/ember__runloop": "^4.0.1",
|
|
83
|
+
"@types/ember__service": "^4.0.0",
|
|
84
|
+
"@types/ember__string": "^3.0.9",
|
|
85
|
+
"@types/ember__template": "^4.0.0",
|
|
86
|
+
"@types/ember__test": "^4.0.0",
|
|
87
|
+
"@types/ember__test-helpers": "^2.6.1",
|
|
88
|
+
"@types/ember__utils": "^4.0.0",
|
|
89
|
+
"@types/htmlbars-inline-precompile": "^3.0.0",
|
|
90
|
+
"@types/qunit": "^2.19.0",
|
|
91
|
+
"@types/rsvp": "^4.0.4",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
93
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
67
94
|
"broccoli-asset-rev": "^3.0.0",
|
|
68
95
|
"d3-array": "^3.1.6",
|
|
69
96
|
"d3-axis": "^3.0.0",
|
|
70
97
|
"d3-scale": "^4.0.2",
|
|
71
98
|
"d3-selection": "^3.0.0",
|
|
72
99
|
"d3-shape": "^3.1.0",
|
|
100
|
+
"ember-a11y-refocus": "^2.3.0",
|
|
73
101
|
"ember-a11y-testing": "^5.0.0",
|
|
74
|
-
"ember-auto-import": "^2.4.
|
|
75
|
-
"ember-cli": "~4.
|
|
102
|
+
"ember-auto-import": "^2.4.2",
|
|
103
|
+
"ember-cli": "~4.4.0",
|
|
76
104
|
"ember-cli-dependency-checker": "^3.3.1",
|
|
77
105
|
"ember-cli-dependency-lint": "^2.0.1",
|
|
78
106
|
"ember-cli-inject-live-reload": "^2.1.0",
|
|
@@ -87,25 +115,26 @@
|
|
|
87
115
|
"ember-page-title": "^7.0.0",
|
|
88
116
|
"ember-qunit": "^5.1.5",
|
|
89
117
|
"ember-resolver": "^8.0.3",
|
|
90
|
-
"ember-source": "~4.
|
|
118
|
+
"ember-source": "~4.4.0",
|
|
91
119
|
"ember-source-channel-url": "^3.0.0",
|
|
92
120
|
"ember-svg-jar": "^2.3.4",
|
|
93
|
-
"ember-template-lint": "^4.
|
|
121
|
+
"ember-template-lint": "^4.10.0",
|
|
94
122
|
"ember-test-selectors": "^6.0.0",
|
|
95
123
|
"ember-truth-helpers": "^3.0.0",
|
|
96
124
|
"ember-try": "^2.0.0",
|
|
97
|
-
"eslint": "^
|
|
125
|
+
"eslint": "^8.16.0",
|
|
98
126
|
"eslint-config-prettier": "^8.5.0",
|
|
99
|
-
"eslint-plugin-ember": "^10.6.
|
|
127
|
+
"eslint-plugin-ember": "^10.6.1",
|
|
100
128
|
"eslint-plugin-node": "^11.1.0",
|
|
101
129
|
"eslint-plugin-prettier": "^4.0.0",
|
|
102
130
|
"lerna-changelog": "^2.2.0",
|
|
103
131
|
"loader.js": "^4.7.0",
|
|
104
132
|
"npm-run-all": "^4.1.5",
|
|
105
133
|
"prettier": "^2.6.2",
|
|
106
|
-
"qunit": "^2.
|
|
134
|
+
"qunit": "^2.19.1",
|
|
107
135
|
"qunit-dom": "^2.0.0",
|
|
108
|
-
"
|
|
136
|
+
"typescript": "^4.7.2",
|
|
137
|
+
"webpack": "^5.73.0"
|
|
109
138
|
},
|
|
110
139
|
"engines": {
|
|
111
140
|
"node": "12.* || 14.* || >= 16"
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ES2020",
|
|
5
|
+
"moduleResolution": "node",
|
|
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
|
+
// Don't check the types of dependencies
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
|
|
18
|
+
// --- TS for SemVer Types compatibility
|
|
19
|
+
// Strictness settings -- you should *not* change these: Ember code is not
|
|
20
|
+
// guaranteed to type check with these set to looser values.
|
|
21
|
+
"strict": true,
|
|
22
|
+
"noUncheckedIndexedAccess": true,
|
|
23
|
+
|
|
24
|
+
// Interop: these are viral and will require anyone downstream of your
|
|
25
|
+
// package to *also* set them to true. If you *must* enable them to consume
|
|
26
|
+
// an upstream package, you should document that for downstream consumers to
|
|
27
|
+
// be aware of.
|
|
28
|
+
//
|
|
29
|
+
// These *are* safe for apps to enable, since they do not *have* downstream
|
|
30
|
+
// consumers; but leaving them off is still preferred when possible, since
|
|
31
|
+
// it makes it easier to switch between apps and addons and have the same
|
|
32
|
+
// rules for what can be imported and how.
|
|
33
|
+
"allowSyntheticDefaultImports": false,
|
|
34
|
+
"esModuleInterop": false,
|
|
35
|
+
|
|
36
|
+
// --- Lint-style rules
|
|
37
|
+
|
|
38
|
+
// TypeScript also supplies some lint-style checks; nearly all of them are
|
|
39
|
+
// better handled by ESLint with the `@typescript-eslint`. This one is more
|
|
40
|
+
// like a safety check, though, so we leave it on.
|
|
41
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
42
|
+
|
|
43
|
+
// --- Compilation/integration settings
|
|
44
|
+
// Setting `noEmitOnError` here allows ember-cli-typescript to catch errors
|
|
45
|
+
// and inject them into Ember CLI's build error reporting, which provides
|
|
46
|
+
// nice feedback for when
|
|
47
|
+
"noEmitOnError": false,
|
|
48
|
+
|
|
49
|
+
// We use Babel for emitting runtime code, because it's very important that
|
|
50
|
+
// we always and only use the same transpiler for non-stable features, in
|
|
51
|
+
// particular decorators. If you were to change this to `true`, it could
|
|
52
|
+
// lead to accidentally generating code with `tsc` instead of Babel, and
|
|
53
|
+
// could thereby result in broken code at runtime.
|
|
54
|
+
"noEmit": true,
|
|
55
|
+
|
|
56
|
+
// Ember makes heavy use of decorators; TS does not support them at all
|
|
57
|
+
// without this flag.
|
|
58
|
+
"experimentalDecorators": true,
|
|
59
|
+
|
|
60
|
+
// Support generation of source maps. Note: you must *also* enable source
|
|
61
|
+
// maps in your `ember-cli-babel` config and/or `babel.config.js`.
|
|
62
|
+
"declaration": true,
|
|
63
|
+
"declarationMap": true,
|
|
64
|
+
"inlineSourceMap": true,
|
|
65
|
+
"inlineSources": true,
|
|
66
|
+
|
|
67
|
+
// The combination of `baseUrl` with `paths` allows Ember's classic package
|
|
68
|
+
// layout, which is not resolveable with the Node resolution algorithm, to
|
|
69
|
+
// work with TypeScript.
|
|
70
|
+
"baseUrl": ".",
|
|
71
|
+
"paths": {
|
|
72
|
+
"dummy/tests/*": [
|
|
73
|
+
"tests/*"
|
|
74
|
+
],
|
|
75
|
+
"dummy/*": [
|
|
76
|
+
"tests/dummy/app/*",
|
|
77
|
+
"app/*"
|
|
78
|
+
],
|
|
79
|
+
"ember-container-query": [
|
|
80
|
+
"addon"
|
|
81
|
+
],
|
|
82
|
+
"ember-container-query/*": [
|
|
83
|
+
"addon/*"
|
|
84
|
+
],
|
|
85
|
+
"ember-container-query/test-support": [
|
|
86
|
+
"addon-test-support"
|
|
87
|
+
],
|
|
88
|
+
"ember-container-query/test-support/*": [
|
|
89
|
+
"addon-test-support/*"
|
|
90
|
+
],
|
|
91
|
+
"*": [
|
|
92
|
+
"types/*"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"include": [
|
|
97
|
+
"app/**/*",
|
|
98
|
+
"addon/**/*",
|
|
99
|
+
"tests/**/*",
|
|
100
|
+
"types/**/*",
|
|
101
|
+
"test-support/**/*",
|
|
102
|
+
"addon-test-support/**/*"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
File without changes
|