Skip to content

Commit

Permalink
Prettier Fix (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay authored Jul 9, 2024
2 parents 13c4fff + a607bc6 commit 1699a2d
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 229 deletions.
24 changes: 4 additions & 20 deletions .github/workflows/FissionESLintFormat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,14 @@ jobs:
npm install
- name: Linter
id: linter-validation
if: ${{ always() }}
run: |
cd fission
npm run lint
continue-on-error: true
- name: Check EsLint
run: |
if [ ${{ steps.linter-validation.outcome }} == "success" ]; then
echo "EsLint Validation Passed"
else
echo "EsLint Validation Failed"
exit 1
fi
npm run lint && echo "ESLint Validation Passed" || (echo "ESLint Validation Failed" && exit 1)
- name: Prettier
id: prettier-validation
if: ${{ always() }}
run: |
cd fission
npx prettier --version
npm run prettier
continue-on-error: true
- name: Check Prettier
run: |
if [ ${{ steps.prettier-validation.outcome }} == "success" ]; then
echo "Prettier Validation Passed"
else
echo "Prettier Validation Failed"
exit 1
fi
npm run prettier && echo "Prettier Validation Passed" || (echo "Prettier Validation Failed" && exit 1)
Binary file modified fission/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion fission/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"jsdom": "^24.1.0",
"pako": "^2.1.0",
"postcss": "^8.4.26",
"prettier": "^3.0.0",
"prettier": "3.3.2",
"protobufjs": "^7.2.6",
"protobufjs-cli": "^1.1.2",
"tailwindcss": "^3.3.3",
Expand Down
2 changes: 1 addition & 1 deletion fission/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = {
},
},
],
endOfLine: "lf",
endOfLine: "auto",
}

export default config
6 changes: 4 additions & 2 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import ImportMirabufModal from "@/modals/mirabuf/ImportMirabufModal.tsx"
import ImportLocalMirabufModal from "@/modals/mirabuf/ImportLocalMirabufModal.tsx"
import APS from "./aps/APS.ts"
import ResetAllInputsModal from "./ui/modals/configuring/ResetAllInputsModal.tsx"
import Skybox from './ui/components/Skybox.tsx';
import Skybox from "./ui/components/Skybox.tsx"

const DEFAULT_MIRA_PATH = "/api/mira/Robots/Team 2471 (2018)_v7.mira"

Expand Down Expand Up @@ -135,11 +135,13 @@ function Synthesis() {
World.DestroyWorld()
// World.SceneRenderer.RemoveAllSceneObjects();
}

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
<AnimatePresence>
<Skybox key="123"/>
<Skybox key="123" />
<TooltipControlProvider
showTooltip={(type: TooltipType, controls?: TooltipControl[], duration: number = TOOLTIP_DURATION) => {
showTooltip(type, controls, duration)
Expand Down
33 changes: 16 additions & 17 deletions fission/src/aps/APS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ class APS {
* @param {number} expires_at - When the token expires
*/
static setExpiresAt(expires_at: number) {
if (this.auth)
this.auth.expires_at = expires_at;
if (this.auth) this.auth.expires_at = expires_at
}

/**
Expand Down Expand Up @@ -113,15 +112,15 @@ class APS {
}

/**
* Logs the user out by setting their auth data to undefined.
*/
* Logs the user out by setting their auth data to undefined.
*/
static async logout() {
this.auth = undefined
}

/**
* Prompts the user to sign in, which will retrieve the auth code.
*/
* Prompts the user to sign in, which will retrieve the auth code.
*/
static async requestAuthCode() {
await this.requestMutex.runExclusive(async () => {
const callbackUrl = import.meta.env.DEV
Expand Down Expand Up @@ -157,9 +156,9 @@ class APS {
}

/**
* Refreshes the access token using our refresh token.
* @param {string} refresh_token - The refresh token from our auth data
*/
* Refreshes the access token using our refresh token.
* @param {string} refresh_token - The refresh token from our auth data
*/
static async refreshAuthToken(refresh_token: string) {
await this.requestMutex.runExclusive(async () => {
try {
Expand Down Expand Up @@ -199,9 +198,9 @@ class APS {
}

/**
* Fetches the auth data from Autodesk using the auth code.
* @param {string} code - The auth code
*/
* Fetches the auth data from Autodesk using the auth code.
* @param {string} code - The auth code
*/
static async convertAuthToken(code: string) {
let retry_login = false
try {
Expand Down Expand Up @@ -237,9 +236,9 @@ class APS {
}

/**
* Fetches user information using the auth data. See {@link APSAuth}
* @param {APSAuth} auth - The auth data
*/
* Fetches user information using the auth data. See {@link APSAuth}
* @param {APSAuth} auth - The auth data
*/
static async loadUserInfo(auth: APSAuth) {
console.log("Loading user information")
try {
Expand Down Expand Up @@ -272,8 +271,8 @@ class APS {
}

/**
* Fetches the code challenge from our server for requesting the auth code.
*/
* Fetches the code challenge from our server for requesting the auth code.
*/
static async codeChallenge() {
try {
const res = await fetch(ENDPOINT_SYNTHESIS_CHALLENGE)
Expand Down
46 changes: 23 additions & 23 deletions fission/src/mirabuf/MirabufSceneObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ interface RnDebugMeshes {
}

class MirabufSceneObject extends SceneObject {
private _assemblyName: string;
private _mirabufInstance: MirabufInstance;
private _mechanism: Mechanism;
private _brain: SynthesisBrain | undefined;
private _assemblyName: string
private _mirabufInstance: MirabufInstance
private _mechanism: Mechanism
private _brain: SynthesisBrain | undefined

private _debugBodies: Map<string, RnDebugMeshes> | null;
private _physicsLayerReserve: LayerReserve | undefined = undefined;
private _debugBodies: Map<string, RnDebugMeshes> | null
private _physicsLayerReserve: LayerReserve | undefined = undefined

public constructor(mirabufInstance: MirabufInstance, assemblyName: string) {
super()

this._mirabufInstance = mirabufInstance
this._assemblyName = assemblyName;
this._assemblyName = assemblyName

this._mechanism = World.PhysicsSystem.CreateMechanismFromParser(this._mirabufInstance.parser)
if (this._mechanism.layerReserve) {
Expand Down Expand Up @@ -63,10 +63,10 @@ class MirabufSceneObject extends SceneObject {
}

// Simulation
World.SimulationSystem.RegisterMechanism(this._mechanism);
const simLayer = World.SimulationSystem.GetSimulationLayer(this._mechanism)!;
this._brain = new SynthesisBrain(this._mechanism, this._assemblyName);
simLayer.SetBrain(this._brain);
World.SimulationSystem.RegisterMechanism(this._mechanism)
const simLayer = World.SimulationSystem.GetSimulationLayer(this._mechanism)!
this._brain = new SynthesisBrain(this._mechanism, this._assemblyName)
simLayer.SetBrain(this._brain)
}

public Update(): void {
Expand Down Expand Up @@ -111,16 +111,16 @@ class MirabufSceneObject extends SceneObject {
World.PhysicsSystem.DestroyMechanism(this._mechanism)
this._mirabufInstance.Dispose(World.SceneRenderer.scene)
this._debugBodies?.forEach(x => {
World.SceneRenderer.scene.remove(x.colliderMesh, x.comMesh);
x.colliderMesh.geometry.dispose();
x.comMesh.geometry.dispose();
(x.colliderMesh.material as THREE.Material).dispose();
(x.comMesh.material as THREE.Material).dispose();
});
this._debugBodies?.clear();
this._physicsLayerReserve?.Release();

this._brain?.clearControls();
World.SceneRenderer.scene.remove(x.colliderMesh, x.comMesh)
x.colliderMesh.geometry.dispose()
x.comMesh.geometry.dispose()
;(x.colliderMesh.material as THREE.Material).dispose()
;(x.comMesh.material as THREE.Material).dispose()
})
this._debugBodies?.clear()
this._physicsLayerReserve?.Release()

this._brain?.clearControls()
}

private CreateMeshForShape(shape: Jolt.Shape): THREE.Mesh {
Expand Down Expand Up @@ -167,8 +167,8 @@ export async function CreateMirabuf(assembly: mirabuf.Assembly): Promise<Mirabuf
console.error(`Assembly Parser produced significant errors for '${assembly.info!.name!}'`)
return
}
return new MirabufSceneObject(new MirabufInstance(parser), assembly.info!.name!);

return new MirabufSceneObject(new MirabufInstance(parser), assembly.info!.name!)
}

export default MirabufSceneObject
116 changes: 81 additions & 35 deletions fission/src/systems/input/DefaultInputs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AxisInput, Input, EmptyModifierState } from "./InputSystem"

export type InputScheme = {
schemeName: string,
usesGamepad: boolean,
schemeName: string
usesGamepad: boolean
inputs: Input[]
}

Expand All @@ -14,18 +14,38 @@ class DefaultInputs {
new AxisInput("arcadeDrive", "KeyW", "KeyS"),
new AxisInput("arcadeTurn", "KeyD", "KeyA"),

new AxisInput("joint 1", "Digit1", "Digit1", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: true, meta: false }),
new AxisInput("joint 2", "Digit2", "Digit2", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: true, meta: false }),
new AxisInput("joint 3", "Digit3", "Digit3", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: true, meta: false }),
new AxisInput("joint 4", "Digit4", "Digit4", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: true, meta: false }),
new AxisInput("joint 5", "Digit5", "Digit5", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: true, meta: false })
]
};
new AxisInput("joint 1", "Digit1", "Digit1", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: true,
meta: false,
}),
new AxisInput("joint 2", "Digit2", "Digit2", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: true,
meta: false,
}),
new AxisInput("joint 3", "Digit3", "Digit3", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: true,
meta: false,
}),
new AxisInput("joint 4", "Digit4", "Digit4", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: true,
meta: false,
}),
new AxisInput("joint 5", "Digit5", "Digit5", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: true,
meta: false,
}),
],
}

private static arrowKeys: InputScheme = {
schemeName: "Arrow Keys",
Expand All @@ -34,18 +54,38 @@ class DefaultInputs {
new AxisInput("arcadeDrive", "ArrowUp", "ArrowDown"),
new AxisInput("arcadeTurn", "ArrowRight", "ArrowLeft"),

new AxisInput("joint 1", "Slash", "Slash", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: true, alt: false, shift: false, meta: false }),
new AxisInput("joint 2", "Period", "Period", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: true, alt: false, shift: false, meta: false }),
new AxisInput("joint 3", "Comma", "Comma", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: true, alt: false, shift: false, meta: false }),
new AxisInput("joint 4", "KeyM", "KeyM", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: true, alt: false, shift: false, meta: false }),
new AxisInput("joint 5", "KeyN", "true", -1, false, false, -1, -1, false,
EmptyModifierState, { ctrl: false, alt: false, shift: false, meta: false })
]
};
new AxisInput("joint 1", "Slash", "Slash", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: true,
alt: false,
shift: false,
meta: false,
}),
new AxisInput("joint 2", "Period", "Period", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: true,
alt: false,
shift: false,
meta: false,
}),
new AxisInput("joint 3", "Comma", "Comma", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: true,
alt: false,
shift: false,
meta: false,
}),
new AxisInput("joint 4", "KeyM", "KeyM", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: true,
alt: false,
shift: false,
meta: false,
}),
new AxisInput("joint 5", "KeyN", "true", -1, false, false, -1, -1, false, EmptyModifierState, {
ctrl: false,
alt: false,
shift: false,
meta: false,
}),
],
}

private static fullController: InputScheme = {
schemeName: "Full Controller",
Expand All @@ -58,8 +98,8 @@ class DefaultInputs {
new AxisInput("joint 2", "", "", -1, false, true, 1, 2),
new AxisInput("joint 3", "", "", -1, false, true, 4, 5),
new AxisInput("joint 3", "", "", -1, false, true, 15, 14),
new AxisInput("joint 3", "", "", -1, false, true, 12, 13)
]
new AxisInput("joint 3", "", "", -1, false, true, 12, 13),
],
}

private static leftStick: InputScheme = {
Expand All @@ -68,10 +108,10 @@ class DefaultInputs {
inputs: [
new AxisInput("arcadeDrive", "", "", 1, true),
new AxisInput("arcadeTurn", "", "", 0, false),

new AxisInput("joint 2", "", "", -1, false, true, 15, 14),
new AxisInput("joint 1", "", "", -1, false, true, 12, 13)
]
new AxisInput("joint 1", "", "", -1, false, true, 12, 13),
],
}

private static rightStick: InputScheme = {
Expand All @@ -82,11 +122,17 @@ class DefaultInputs {
new AxisInput("arcadeTurn", "", "", 2, false),

new AxisInput("joint 1", "", "", -1, false, true, 3, 0),
new AxisInput("joint 2", "", "", -1, false, true, 1, 2)
]
new AxisInput("joint 2", "", "", -1, false, true, 1, 2),
],
}

public static ALL_INPUT_SCHEMES: InputScheme[] = [this.wasd, this.arrowKeys, this.fullController, this.leftStick, this.rightStick];
public static ALL_INPUT_SCHEMES: InputScheme[] = [
this.wasd,
this.arrowKeys,
this.fullController,
this.leftStick,
this.rightStick,
]
}

export default DefaultInputs;
export default DefaultInputs
Loading

0 comments on commit 1699a2d

Please sign in to comment.