Fix most Github Actions 'annotations' in PRs (#417)
* Fix Github Actions 'annotations' in PRs Fixes #383 * Fix the React Hooks complains, and _app for rust * Revert "Fix the React Hooks complains, and _app for rust" This reverts commit4a2ff925e5
. * Add back prettier fix and rust _app * Fmt * More annotation fixes * More non-hooks fixes * Rollback with eslint rule * Add APPLE_TEAM_ID secret * Revert "Add APPLE_TEAM_ID secret" This reverts commit346aaff5f4
. * More fixes
This commit is contained in:
@ -129,10 +129,10 @@ async fn get_user(
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
.setup(|_app| {
|
||||
#[cfg(debug_assertions)] // only include this code on debug builds
|
||||
{
|
||||
let window = app.get_window("main").unwrap();
|
||||
let window = _app.get_window("main").unwrap();
|
||||
// comment out the below if you don't devtools to open everytime.
|
||||
// it's useful because otherwise devtools shuts everytime rust code changes.
|
||||
window.open_devtools();
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { ToolTip } from './useStore'
|
||||
import { Fragment, WheelEvent, useRef, useMemo } from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faSearch, faX } from '@fortawesome/free-solid-svg-icons'
|
||||
@ -15,23 +14,6 @@ export const sketchButtonClassnames = {
|
||||
icon: 'text-fern-20 h-auto group-hover:text-fern-10 hover:text-fern-10 dark:text-chalkboard-100 dark:group-hover:text-chalkboard-100 dark:hover:text-chalkboard-100 group-disabled:bg-chalkboard-60 hover:group-disabled:text-inherit',
|
||||
}
|
||||
|
||||
const sketchFnLabels: Record<ToolTip | 'sketch_line' | 'move', string> = {
|
||||
sketch_line: 'Line',
|
||||
line: 'Line',
|
||||
move: 'Move',
|
||||
angledLine: 'Angled Line',
|
||||
angledLineThatIntersects: 'Angled Line That Intersects',
|
||||
angledLineOfXLength: 'Angled Line Of X Length',
|
||||
angledLineOfYLength: 'Angled Line Of Y Length',
|
||||
angledLineToX: 'Angled Line To X',
|
||||
angledLineToY: 'Angled Line To Y',
|
||||
lineTo: 'Line to Point',
|
||||
xLine: 'Horizontal Line',
|
||||
yLine: 'Vertical Line',
|
||||
xLineTo: 'Horizontal Line to Point',
|
||||
yLineTo: 'Vertical Line to Point',
|
||||
}
|
||||
|
||||
export const Toolbar = () => {
|
||||
const { state, send, context } = useModelingContext()
|
||||
const toolbarButtonsRef = useRef<HTMLSpanElement>(null)
|
||||
|
@ -184,6 +184,7 @@ function DisplayObj({
|
||||
</li>
|
||||
)
|
||||
}
|
||||
return null
|
||||
})}
|
||||
</ul>
|
||||
</span>
|
||||
|
@ -2,7 +2,7 @@ import { IndexLoaderData, paths } from 'Router'
|
||||
import { ActionButton } from './ActionButton'
|
||||
import Tooltip from './Tooltip'
|
||||
import { FileEntry } from '@tauri-apps/api/fs'
|
||||
import { Dispatch, useEffect, useRef, useState } from 'react'
|
||||
import { Dispatch, useRef, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Dialog, Disclosure } from '@headlessui/react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
|
@ -20,7 +20,6 @@ import {
|
||||
recast,
|
||||
parse,
|
||||
Program,
|
||||
VariableDeclarator,
|
||||
PipeExpression,
|
||||
CallExpression,
|
||||
} from 'lang/wasm'
|
||||
|
@ -267,11 +267,11 @@ export const Stream = ({ className = '' }) => {
|
||||
}
|
||||
engineCommandManager.sendSceneCommand(command).then(async () => {
|
||||
if (!context.sketchPathToNode) return
|
||||
const varDec = getNodeFromPath<VariableDeclarator>(
|
||||
getNodeFromPath<VariableDeclarator>(
|
||||
kclManager.ast,
|
||||
context.sketchPathToNode,
|
||||
'VariableDeclarator'
|
||||
).node
|
||||
)
|
||||
// Get the current plane string for plane we are on.
|
||||
let currentPlaneString = ''
|
||||
if (context.sketchPlaneId === kclManager.getPlaneId('xy')) {
|
||||
|
@ -69,7 +69,7 @@ export function applyConstraintEqualLength({
|
||||
modifiedAst: Program
|
||||
pathToNodeMap: PathToNodeMap
|
||||
} {
|
||||
const { enabled, transforms } = setEqualLengthInfo({ selectionRanges })
|
||||
const { transforms } = setEqualLengthInfo({ selectionRanges })
|
||||
const { modifiedAst, pathToNodeMap } = transformSecondarySketchLinesTagFirst({
|
||||
ast: kclManager.ast,
|
||||
selectionRanges,
|
||||
|
@ -108,6 +108,7 @@ export default class Client extends jsrpc.JSONRPCServerAndClient {
|
||||
break
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
messageString += message
|
||||
return
|
||||
})
|
||||
|
@ -2,8 +2,6 @@ import { useEffect } from 'react'
|
||||
import { useStore } from 'useStore'
|
||||
import { engineCommandManager } from '../lang/std/engineConnection'
|
||||
import { useModelingContext } from './useModelingContext'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { SourceRange } from 'lang/wasm'
|
||||
import { getEventForSelectWithPoint } from 'lib/selections'
|
||||
|
||||
export function useEngineConnectionSubscriptions() {
|
||||
@ -13,11 +11,6 @@ export function useEngineConnectionSubscriptions() {
|
||||
}))
|
||||
const { send, context } = useModelingContext()
|
||||
|
||||
interface RangeAndId {
|
||||
id: string
|
||||
range: SourceRange
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!engineCommandManager) return
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useLayoutEffect, useEffect, useRef } from 'react'
|
||||
import { _executor, parse } from '../lang/wasm'
|
||||
import { parse } from '../lang/wasm'
|
||||
import { useStore } from '../useStore'
|
||||
import { engineCommandManager } from '../lang/std/engineConnection'
|
||||
import { deferExecution } from 'lib/utils'
|
||||
|
@ -310,7 +310,7 @@ export function extrudeSketch(
|
||||
const name = findUniqueName(node, 'part')
|
||||
const VariableDeclaration = createVariableDeclaration(name, extrudeCall)
|
||||
let showCallIndex = getShowIndex(_node)
|
||||
if (showCallIndex == -1) {
|
||||
if (showCallIndex === -1) {
|
||||
// We didn't find a show, so let's just append everything
|
||||
showCallIndex = _node.body.length
|
||||
}
|
||||
|
@ -982,7 +982,7 @@ export class EngineCommandManager {
|
||||
if (parseCommand.type === 'modeling_cmd_req')
|
||||
return this.handlePendingCommand(id, parseCommand?.cmd, range)
|
||||
}
|
||||
throw 'shouldnt reach here'
|
||||
throw Error('shouldnt reach here')
|
||||
}
|
||||
handlePendingCommand(
|
||||
id: string,
|
||||
|
@ -20,7 +20,6 @@ import {
|
||||
import { isLiteralArrayOrStatic } from './sketchcombos'
|
||||
import { toolTips, ToolTip } from '../../useStore'
|
||||
import { createPipeExpression, splitPathAtPipeExpression } from '../modifyAst'
|
||||
import { generateUuidFromHashSeed } from '../../lib/uuid'
|
||||
|
||||
import { SketchLineHelper, ModifyAstBase, TransformCallback } from './stdTypes'
|
||||
|
||||
@ -92,18 +91,12 @@ export function createFirstArg(
|
||||
throw new Error('all sketch line types should have been covered')
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
type LineData = {
|
||||
from: [number, number, number]
|
||||
to: [number, number, number]
|
||||
}
|
||||
|
||||
function makeId(seed: string | any) {
|
||||
if (typeof seed === 'string') {
|
||||
return generateUuidFromHashSeed(seed)
|
||||
}
|
||||
return generateUuidFromHashSeed(JSON.stringify(seed))
|
||||
}
|
||||
|
||||
export const lineTo: SketchLineHelper = {
|
||||
add: ({
|
||||
node,
|
||||
@ -250,9 +243,6 @@ export const line: SketchLineHelper = {
|
||||
])
|
||||
|
||||
if (callExpression.arguments?.[0].type === 'ObjectExpression') {
|
||||
const toProp = callExpression.arguments?.[0].properties?.find(
|
||||
({ key }) => key.name === 'to'
|
||||
)
|
||||
mutateObjExpProp(callExpression.arguments?.[0], toArrExp, 'to')
|
||||
} else {
|
||||
mutateArrExp(callExpression.arguments?.[0], toArrExp)
|
||||
@ -974,14 +964,12 @@ export function addNewSketchLn({
|
||||
const node = JSON.parse(JSON.stringify(_node))
|
||||
const { add, updateArgs } = sketchLineHelperMap?.[fnName] || {}
|
||||
if (!add || !updateArgs) throw new Error('not a sketch line helper')
|
||||
const { node: varDec } = getNodeFromPath<VariableDeclarator>(
|
||||
getNodeFromPath<VariableDeclarator>(node, pathToNode, 'VariableDeclarator')
|
||||
getNodeFromPath<PipeExpression | CallExpression>(
|
||||
node,
|
||||
pathToNode,
|
||||
'VariableDeclarator'
|
||||
'PipeExpression'
|
||||
)
|
||||
const { node: pipeExp, shallowPath: pipePath } = getNodeFromPath<
|
||||
PipeExpression | CallExpression
|
||||
>(node, pathToNode, 'PipeExpression')
|
||||
return add({
|
||||
node,
|
||||
previousProgramMemory,
|
||||
|
@ -9,6 +9,7 @@ import { v4 as uuidv4 } from 'uuid'
|
||||
type WebSocketResponse = Models['OkWebSocketResponseData_type']
|
||||
|
||||
class MockEngineCommandManager {
|
||||
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||
constructor(mockParams: {
|
||||
setIsStreamReady: (isReady: boolean) => void
|
||||
setMediaStream: (stream: MediaStream) => void
|
||||
|
@ -882,7 +882,7 @@ export const modelingMachine = createMachine(
|
||||
// TODO implement source ranges for all of these constraints
|
||||
// need to make the async like the modal constraints
|
||||
'Make selection horizontal': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintHorzVert(
|
||||
const { modifiedAst } = applyConstraintHorzVert(
|
||||
selectionRanges,
|
||||
'horizontal',
|
||||
kclManager.ast,
|
||||
@ -891,7 +891,7 @@ export const modelingMachine = createMachine(
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Make selection vertical': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintHorzVert(
|
||||
const { modifiedAst } = applyConstraintHorzVert(
|
||||
selectionRanges,
|
||||
'vertical',
|
||||
kclManager.ast,
|
||||
@ -900,33 +900,33 @@ export const modelingMachine = createMachine(
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Constrain horizontally align': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintHorzVertAlign({
|
||||
const { modifiedAst } = applyConstraintHorzVertAlign({
|
||||
selectionRanges,
|
||||
constraint: 'setVertDistance',
|
||||
})
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Constrain vertically align': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintHorzVertAlign({
|
||||
const { modifiedAst } = applyConstraintHorzVertAlign({
|
||||
selectionRanges,
|
||||
constraint: 'setHorzDistance',
|
||||
})
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Constrain equal length': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintEqualLength({
|
||||
const { modifiedAst } = applyConstraintEqualLength({
|
||||
selectionRanges,
|
||||
})
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Constrain parallel': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyConstraintEqualAngle({
|
||||
const { modifiedAst } = applyConstraintEqualAngle({
|
||||
selectionRanges,
|
||||
})
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
},
|
||||
'Constrain remove constraints': ({ selectionRanges }) => {
|
||||
const { modifiedAst, pathToNodeMap } = applyRemoveConstrainingValues({
|
||||
const { modifiedAst } = applyRemoveConstrainingValues({
|
||||
selectionRanges,
|
||||
})
|
||||
kclManager.updateAst(modifiedAst, true)
|
||||
|
Reference in New Issue
Block a user