Skip to content

Commit

Permalink
Fix CI (#813)
Browse files Browse the repository at this point in the history
* Revert "Remove namespaces (#805)"

This reverts commit 8ee6905.

* Attempt to fix CI

* Test removing module augmentation

* Add examples

* Update patch

* Remove examples
  • Loading branch information
Methuselah96 authored Feb 8, 2024
1 parent 734c87b commit a502c02
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 115 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- run: git config --global user.name "Nathan Bierema"
- run: git commit -m "Changes"
working-directory: 'DefinitelyTyped'
- run: pnpm install --filter . --filter '...[origin/master]'
- run: pnpm install --filter . --filter ...[HEAD^1]...
working-directory: 'DefinitelyTyped'
- run: pnpm run test-all
- run: pnpm run test-all --diffBase HEAD^1
working-directory: 'DefinitelyTyped'
check-fomatting:
runs-on: ubuntu-latest
Expand Down
95 changes: 0 additions & 95 deletions examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13569,54 +13569,6 @@ index 6aadaf2..bb7fa30 100644

init();
animate();
diff --git a/examples-testing/examples/webgpu_backdrop.ts b/examples-testing/examples/webgpu_backdrop.ts
index 9a2b1d8..21a9da9 100644
--- a/examples-testing/examples/webgpu_backdrop.ts
+++ b/examples-testing/examples/webgpu_backdrop.ts
@@ -12,6 +12,8 @@ import {
oscSine,
output,
MeshStandardNodeMaterial,
+ Node,
+ ShaderNodeObject,
} from 'three/nodes';

import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -23,10 +25,10 @@ import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

-let camera, scene, renderer;
-let portals,
+let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: WebGPURenderer;
+let portals: THREE.Group,
rotate = true;
-let mixer, clock;
+let mixer: THREE.AnimationMixer, clock: THREE.Clock;

init();

@@ -58,7 +60,7 @@ function init() {
const object = gltf.scene;
mixer = new THREE.AnimationMixer(object);

- const material = object.children[0].children[0].material;
+ const material = (object.children[0].children[0] as THREE.Mesh<THREE.BufferGeometry, THREE.Material>).material;

// output material effect ( better using hsv )
// ignore output.sRGBToLinear().linearTosRGB() for now
@@ -78,7 +80,10 @@ function init() {
portals = new THREE.Group();
scene.add(portals);

- function addBackdropSphere(backdropNode, backdropAlphaNode = null) {
+ function addBackdropSphere(
+ backdropNode: ShaderNodeObject<Node>,
+ backdropAlphaNode: ShaderNodeObject<Node> | null = null,
+ ) {
const distance = 1;
const id = portals.children.length;
const rotation = THREE.MathUtils.degToRad(id * 45);
diff --git a/examples-testing/examples/webgpu_backdrop_area.ts b/examples-testing/examples/webgpu_backdrop_area.ts
index a40092c..9dc155c 100644
--- a/examples-testing/examples/webgpu_backdrop_area.ts
Expand Down Expand Up @@ -13648,53 +13600,6 @@ index a40092c..9dc155c 100644
box.material = materials[name];
});
}
diff --git a/examples-testing/examples/webgpu_backdrop_water.ts b/examples-testing/examples/webgpu_backdrop_water.ts
index 50291c7..1c02c55 100644
--- a/examples-testing/examples/webgpu_backdrop_water.ts
+++ b/examples-testing/examples/webgpu_backdrop_water.ts
@@ -17,6 +17,8 @@ import {
timerLocal,
MeshStandardNodeMaterial,
MeshBasicNodeMaterial,
+ ShaderNodeObject,
+ Node,
} from 'three/nodes';

import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -33,12 +35,14 @@ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

import Stats from 'three/addons/libs/stats.module.js';

-let camera, scene, renderer;
-let mixer, objects, clock;
-let model, floor, floorPosition;
-let postProcessing;
-let controls;
-let stats;
+let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: WebGPURenderer;
+let mixer: THREE.AnimationMixer, objects: THREE.Group, clock: THREE.Clock;
+let model: THREE.Group,
+ floor: THREE.Mesh<THREE.CylinderGeometry, MeshStandardNodeMaterial>,
+ floorPosition: THREE.Vector3;
+let postProcessing: PostProcessing;
+let controls: OrbitControls;
+let stats: Stats;

init();

@@ -177,10 +181,10 @@ function init() {

const waterPosY = positionWorld.y.sub(water.position.y);

- let transition = waterPosY.add(0.1).saturate().oneMinus();
+ let transition: ShaderNodeObject<Node> = waterPosY.add(0.1).saturate().oneMinus();
transition = waterPosY.lessThan(0).cond(transition, normalWorld.y.mix(transition, 0)).toVar();

- const colorNode = transition.mix(material.colorNode, material.colorNode.add(waterLayer0));
+ const colorNode = transition.mix(material.colorNode!, material.colorNode!.add(waterLayer0));

//material.colorNode = colorNode;
floor.material.colorNode = colorNode;
diff --git a/examples-testing/examples/webgpu_camera_logarithmicdepthbuffer.ts b/examples-testing/examples/webgpu_camera_logarithmicdepthbuffer.ts
index 2e0d37c..deac7ad 100644
--- a/examples-testing/examples/webgpu_camera_logarithmicdepthbuffer.ts
Expand Down
4 changes: 2 additions & 2 deletions examples-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ const files = {
'webgl2_volume_perlin',
],
'webgpu (wip)': [
'webgpu_backdrop',
// 'webgpu_backdrop',
'webgpu_backdrop_area',
'webgpu_backdrop_water',
// 'webgpu_backdrop_water',
'webgpu_camera_logarithmicdepthbuffer',
'webgpu_clearcoat',
// 'webgpu_compute_audio',
Expand Down
1 change: 1 addition & 0 deletions types/three/build/three.d.cts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "../src/Three.js";
export as namespace THREE;
1 change: 1 addition & 0 deletions types/three/build/three.module.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "../src/Three.js";
export as namespace THREE;
1 change: 1 addition & 0 deletions types/three/build/three.module.min.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "../src/Three.js";
export as namespace THREE;
4 changes: 2 additions & 2 deletions types/three/examples/jsm/loaders/USDZLoader.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Group, Loader, LoadingManager, Mesh } from "three";
import { Loader, LoadingManager, Mesh } from "three";

export class USDAParser {
parse(text: string): object;
Expand All @@ -7,5 +7,5 @@ export class USDAParser {
export class USDZLoader extends Loader<Mesh> {
constructor(manager?: LoadingManager);

parse(buffer: ArrayBuffer | string): Group;
parse(buffer: ArrayBuffer | string): THREE.Group;
}
12 changes: 0 additions & 12 deletions types/three/examples/jsm/renderers/common/Renderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ import Color4 from "./../common/Color4.js";
import Backend from "./Backend.js";
import Info from "./Info.js";

declare module "three" {
interface Material {
outputNode?: Node | null | undefined;
}

interface Scene {
environmentNode?: Node | null | undefined;
backgroundNode?: Node | null | undefined;
fogNode?: Node | null | undefined;
}
}

export interface RendererParameters {
logarithmicDepthBuffer?: boolean | undefined;
alpha?: boolean | undefined;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/webxr/XRPlanes.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Object3D, WebGLRenderer } from "three";
import { Object3D } from "three";

export class XRPlanes extends Object3D {
constructor(renderer: WebGLRenderer);
constructor(renderer: THREE.WebGLRenderer);
}
2 changes: 2 additions & 0 deletions types/three/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
// and released in the @types/three npm package.

export * from "./src/Three";

export as namespace THREE;

0 comments on commit a502c02

Please sign in to comment.