Skip to content

Commit 976796f

Browse files
authored
Update Lit and chai (#4922)
* updated chai * try to update Lit * update TS
1 parent b8d6b32 commit 976796f

File tree

75 files changed

+1633
-1467
lines changed

Some content is hidden

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

75 files changed

+1633
-1467
lines changed

package-lock.json

Lines changed: 1523 additions & 1361 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
"eslint-plugin-wc": "^1.3.0",
4949
"http-server": "^14.1.1",
5050
"husky": "^7.0.1",
51-
"typescript": "4.8.4"
51+
"typescript": "5.6.3"
5252
}
5353
}

packages/model-viewer-effects/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"filter"
7373
],
7474
"dependencies": {
75-
"lit": "^2.2.3",
75+
"lit": "^3.2.1",
7676
"postprocessing": "^6.35.3"
7777
},
7878
"peerDependencies": {
@@ -83,15 +83,13 @@
8383
"@rollup/plugin-commonjs": "^28.0.1",
8484
"@rollup/plugin-node-resolve": "^15.3.0",
8585
"@rollup/plugin-replace": "^6.0.1",
86-
"@types/chai": "^4.3.1",
87-
"@types/mocha": "^9.1.1",
86+
"@types/mocha": "^10.0.9",
8887
"@types/pngjs": "^6.0.1",
8988
"@types/three": "^0.164.0",
9089
"@ungap/event-target": "^0.2.3",
91-
"@web/test-runner": "^0.16.1",
92-
"@web/test-runner-playwright": "^0.10.0",
93-
"@esm-bundle/chai": "4.3.4",
94-
"chai": "^4.3.6",
90+
"@web/test-runner": "^0.19.0",
91+
"@web/test-runner-playwright": "^0.11.0",
92+
"chai": "^5.1.2",
9593
"focus-visible": "^5.2.0",
9694
"http-server": "^14.1.1",
9795
"mocha": "^10.0.0",
@@ -102,7 +100,7 @@
102100
"rollup-plugin-polyfill": "^3.0.0",
103101
"@rollup/plugin-terser": "^0.4.4",
104102
"three": "^0.169.0",
105-
"typescript": "4.8.4"
103+
"typescript": "5.6.3"
106104
},
107105
"publishConfig": {
108106
"access": "public"

packages/model-viewer-effects/src/test/effect-composer-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {expect} from '@esm-bundle/chai';
1716
import {ModelViewerElement} from '@google/model-viewer';
17+
import {expect} from 'chai';
1818
import {DotScreenEffect, Effect, EffectPass, GridEffect} from 'postprocessing';
1919
import {Camera} from 'three';
2020

packages/model-viewer-effects/src/test/effects/color-grade-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {expect} from '@esm-bundle/chai';
1716
import {ModelViewerElement} from '@google/model-viewer';
17+
import {expect} from 'chai';
1818

1919
import {ColorGradeEffect, EffectComposer} from '../../model-viewer-effects.js';
2020
import {ArraysAreEqual, assetPath, AverageHSL, CompareArrays, createModelViewerElement, rafPasses, screenshot, waitForEvent} from '../utilities.js';

packages/model-viewer-effects/src/test/utilities-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* limitations under the License.
1414
*/
1515

16-
import {expect} from '@esm-bundle/chai';
1716
import {ModelViewerElement} from '@google/model-viewer';
1817
import {Renderer} from '@google/model-viewer/lib/three-components/Renderer.js';
18+
import {expect} from 'chai';
1919

2020
import {$effectComposer} from '../effect-composer.js';
2121
import {EffectComposer} from '../model-viewer-effects.js';

packages/model-viewer/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"3d"
8484
],
8585
"dependencies": {
86-
"lit": "^2.7.2",
86+
"lit": "^3.2.1",
8787
"@monogrid/gainmap-js": "^3.0.1"
8888
},
8989
"peerDependencies": {
@@ -93,14 +93,13 @@
9393
"@rollup/plugin-commonjs": "^28.0.1",
9494
"@rollup/plugin-node-resolve": "^15.3.0",
9595
"@rollup/plugin-replace": "^6.0.1",
96-
"@types/chai": "^4.3.1",
97-
"@types/mocha": "^9.1.1",
96+
"@types/mocha": "^10.0.9",
9897
"@types/pngjs": "^6.0.1",
9998
"@types/three": "^0.164.0",
10099
"@ungap/event-target": "^0.2.3",
101-
"@web/test-runner": "^0.16.1",
102-
"@web/test-runner-playwright": "^0.10.0",
103-
"@esm-bundle/chai": "4.3.4",
100+
"@web/test-runner": "^0.19.0",
101+
"@web/test-runner-playwright": "^0.11.0",
102+
"chai": "^5.1.2",
104103
"http-server": "^14.1.1",
105104
"mocha": "^10.0.0",
106105
"npm-run-all": "^4.1.5",
@@ -109,7 +108,7 @@
109108
"rollup-plugin-dts": "^6.1.1",
110109
"rollup-plugin-polyfill": "^3.0.0",
111110
"@rollup/plugin-terser": "^0.4.4",
112-
"typescript": "4.8.4",
111+
"typescript": "5.6.3",
113112
"three": "^0.169.0"
114113
},
115114
"publishConfig": {

packages/model-viewer/src/features/scene-graph/material.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class Material extends ThreeDOMElement implements MaterialInterface {
6464
return (this[$correlatedObjects] as Set<MeshPhysicalMaterial>)
6565
.values()
6666
.next()
67-
.value;
67+
.value!;
6868
}
6969

7070
constructor(
@@ -98,7 +98,7 @@ export class Material extends ThreeDOMElement implements MaterialInterface {
9898
new PBRMetallicRoughness(onUpdate, correlatedMaterials);
9999

100100
const {normalMap, aoMap, emissiveMap} =
101-
correlatedMaterials.values().next().value;
101+
correlatedMaterials.values().next().value!;
102102

103103
this[$normalTexture] = new TextureInfo(
104104
onUpdate,

packages/model-viewer/src/features/scene-graph/nodes/primitive-node.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class PrimitiveNode extends Node {
137137
if (baseMaterial != null) {
138138
this.mesh.material = baseMaterial;
139139
} else {
140-
this.mesh.material = backingMaterials.values().next().value;
140+
this.mesh.material = backingMaterials.values().next().value!;
141141
}
142142

143143
this.parser.assignFinalMaterial(this.mesh);
@@ -247,7 +247,8 @@ export class PrimitiveNode extends Node {
247247
const map = this.mesh.userData.variantMaterials! as
248248
Map<number, UserDataVariantMapping>;
249249
map.set(variantIndex, {
250-
material: materialVariant[$correlatedObjects]!.values().next().value,
250+
material: materialVariant[$correlatedObjects]!.values().next().value as
251+
ThreeMaterial,
251252
gltfMaterialIndex: materialVariant.index,
252253
});
253254
}

packages/model-viewer/src/features/scene-graph/pbr-metallic-roughness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class PBRMetallicRoughness extends ThreeDOMElement implements
4646
onUpdate: () => void, correlatedMaterials: Set<MeshPhysicalMaterial>) {
4747
super(onUpdate, correlatedMaterials);
4848

49-
const {map, metalnessMap} = correlatedMaterials.values().next().value;
49+
const {map, metalnessMap} = correlatedMaterials.values().next().value!;
5050

5151
this[$baseColorTexture] =
5252
new TextureInfo(onUpdate, TextureUsage.Base, map, correlatedMaterials);

0 commit comments

Comments
 (0)