~Maybe~ (Lee: ABSOLUTELY) use biome (#6327)

* maybe use biome

* import organising

* Removed unused new fmt commands; fix to not use linter

* Don't use fmt:generated - fmt is fast, but also use Makefile for this sort of thing

---------

Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
This commit is contained in:
Kurt Hutten
2025-04-16 00:11:25 +10:00
committed by GitHub
parent 3cca4a30af
commit d9be308c36
66 changed files with 357 additions and 253 deletions

View File

@ -25,7 +25,7 @@ jobs:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: 'npm' cache: 'npm'
- run: npm install - run: npm install
- run: npm run fmt-check - run: npm run fmt:check
npm-build-wasm: npm-build-wasm:
# Build the wasm blob once on the fastest runner. # Build the wasm blob once on the fastest runner.

1
.gitignore vendored
View File

@ -84,3 +84,4 @@ dist
venv venv
.vscode-test .vscode-test
.biome/

View File

@ -420,7 +420,7 @@ npm run test-setup
``` ```
npm run tsc npm run tsc
npm run fmt-check npm run fmt:check
npm run lint npm run lint
npm run test:unit:local npm run test:unit:local
``` ```

48
biome.json Normal file
View File

@ -0,0 +1,48 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
},
"suspicious": {
"noExplicitAny": "warn"
},
"style": {
"useBlockStatements": "error",
"useShorthandArrayType": "error"
}
}
},
"formatter": {
"enabled": true,
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 80,
"formatWithErrors": true
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "es5",
"semicolons": "asNeeded"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"css": {
"parser": {
"cssModules": true
}
},
"files": {
"ignore": ["**/*.json"]
}
}

View File

@ -66,15 +66,17 @@ async function doBasicSketch(
await page.waitForTimeout(500) await page.waitForTimeout(500)
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
await expect(u.codeLocator) await expect(
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001) u.codeLocator
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(length = ${commonPoints.num1})`) |> xLine(length = ${commonPoints.num1})`)
} }
await page.waitForTimeout(500) await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
await expect(u.codeLocator) await expect(
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${ u.codeLocator
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}) |> xLine(length = ${commonPoints.num1})
@ -85,8 +87,9 @@ async function doBasicSketch(
await page.waitForTimeout(200) await page.waitForTimeout(200)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
await expect(u.codeLocator) await expect(
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${ u.codeLocator
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}) |> xLine(length = ${commonPoints.num1})
@ -142,8 +145,9 @@ async function doBasicSketch(
// Open the code pane. // Open the code pane.
await u.openKclCodePanel() await u.openKclCodePanel()
await expect(u.codeLocator) await expect(
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${ u.codeLocator
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}, tag = $seg01) |> xLine(length = ${commonPoints.num1}, tag = $seg01)

View File

@ -1,6 +1,6 @@
import { join } from 'path'
import { bracket } from '@e2e/playwright/fixtures/bracket' import { bracket } from '@e2e/playwright/fixtures/bracket'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import { join } from 'path'
import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from '@e2e/playwright/storageStates' import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from '@e2e/playwright/storageStates'
import { import {

View File

@ -1,6 +1,6 @@
import path, { join } from 'path'
import { KCL_DEFAULT_LENGTH } from '@src/lib/constants' import { KCL_DEFAULT_LENGTH } from '@src/lib/constants'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import path, { join } from 'path'
import { import {
executorInputPath, executorInputPath,

View File

@ -1,5 +1,5 @@
import fsp from 'fs/promises'
import path from 'path' import path from 'path'
import fsp from 'fs/promises'
import { import {
executorInputPath, executorInputPath,

View File

@ -1,6 +1,6 @@
import { join } from 'path'
import { uuidv4 } from '@src/lib/utils' import { uuidv4 } from '@src/lib/utils'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import { join } from 'path'
import { import {
TEST_COLORS, TEST_COLORS,
@ -409,8 +409,9 @@ sketch_001 = startSketchOn(XY)
// Hit alt+shift+f to format the code // Hit alt+shift+f to format the code
await page.keyboard.press('Alt+Shift+KeyF') await page.keyboard.press('Alt+Shift+KeyF')
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`sketch001 = startSketchOn(XY) page.locator('.cm-content')
).toHaveText(`sketch001 = startSketchOn(XY)
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
@ -462,8 +463,9 @@ sketch_001 = startSketchOn(XY)
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`sketch_001 = startSketchOn(XY) page.locator('.cm-content')
).toHaveText(`sketch_001 = startSketchOn(XY)
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
@ -978,8 +980,9 @@ sketch001 = startSketchOn(XZ)
await page.keyboard.up('Control') await page.keyboard.up('Control')
await page.waitForTimeout(100) await page.waitForTimeout(100)
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`sketch001 = startSketchOn(XZ) page.locator('.cm-content')
).toHaveText(`sketch001 = startSketchOn(XZ)
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArc(endAbsolute = [24.95, -5.38]) |> tangentialArc(endAbsolute = [24.95, -5.38])

View File

@ -1,5 +1,5 @@
import * as fsp from 'fs/promises'
import { join } from 'path' import { join } from 'path'
import * as fsp from 'fs/promises'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'

View File

@ -1,7 +1,7 @@
import { FILE_EXT } from '@src/lib/constants'
import * as fs from 'fs' import * as fs from 'fs'
import * as fsp from 'fs/promises'
import { join } from 'path' import { join } from 'path'
import { FILE_EXT } from '@src/lib/constants'
import * as fsp from 'fs/promises'
import { import {
createProject, createProject,

View File

@ -1,7 +1,7 @@
import type { Locator, Page, Request, Route, TestInfo } from '@playwright/test'
import { expect } from '@playwright/test'
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import type { Locator, Page, Request, Route, TestInfo } from '@playwright/test'
import { expect } from '@playwright/test'
export type CmdBarSerialised = export type CmdBarSerialised =
| { | {

View File

@ -7,11 +7,11 @@ import type {
} from '@playwright/test' } from '@playwright/test'
import { _electron as electron } from '@playwright/test' import { _electron as electron } from '@playwright/test'
import fs from 'node:fs'
import path from 'path'
import { SETTINGS_FILE_NAME } from '@src/lib/constants' import { SETTINGS_FILE_NAME } from '@src/lib/constants'
import type { DeepPartial } from '@src/lib/types' import type { DeepPartial } from '@src/lib/types'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import fs from 'node:fs'
import path from 'path'
import type { Settings } from '@rust/kcl-lib/bindings/Settings' import type { Settings } from '@rust/kcl-lib/bindings/Settings'

View File

@ -1,6 +1,6 @@
import path from 'path'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import path from 'path'
test.describe('Import UI tests', () => { test.describe('Import UI tests', () => {
test('shows toast when trying to sketch on imported face, and hovering over imported geometry should NOT highlight any code', async ({ test('shows toast when trying to sketch on imported face, and hovering over imported geometry should NOT highlight any code', async ({

View File

@ -1,5 +1,5 @@
import fsp from 'fs/promises'
import { join } from 'path' import { join } from 'path'
import fsp from 'fs/promises'
import { executorInputPath } from '@e2e/playwright/test-utils' import { executorInputPath } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test' import { expect, test } from '@e2e/playwright/zoo-test'

View File

@ -1,6 +1,6 @@
import { join } from 'path'
import { PROJECT_SETTINGS_FILE_NAME } from '@src/lib/constants' import { PROJECT_SETTINGS_FILE_NAME } from '@src/lib/constants'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { join } from 'path'
import type { NamedView } from '@rust/kcl-lib/bindings/NamedView' import type { NamedView } from '@rust/kcl-lib/bindings/NamedView'

View File

@ -1,7 +1,7 @@
import { join } from 'path'
import { bracket } from '@e2e/playwright/fixtures/bracket' import { bracket } from '@e2e/playwright/fixtures/bracket'
import { onboardingPaths } from '@src/routes/Onboarding/paths' import { onboardingPaths } from '@src/routes/Onboarding/paths'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import { join } from 'path'
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture' import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
import { import {

View File

@ -1,5 +1,5 @@
import * as fsp from 'fs/promises'
import path from 'path' import path from 'path'
import * as fsp from 'fs/promises'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture' import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture' import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'

View File

@ -1,6 +1,6 @@
import type { Locator, Page } from '@playwright/test'
import fs from 'node:fs/promises' import fs from 'node:fs/promises'
import path from 'node:path' import path from 'node:path'
import type { Locator, Page } from '@playwright/test'
import type { EditorFixture } from '@e2e/playwright/fixtures/editorFixture' import type { EditorFixture } from '@e2e/playwright/fixtures/editorFixture'
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture' import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'

View File

@ -1,7 +1,7 @@
import { DEFAULT_PROJECT_KCL_FILE } from '@src/lib/constants'
import fs from 'fs' import fs from 'fs'
import fsp from 'fs/promises'
import path from 'path' import path from 'path'
import { DEFAULT_PROJECT_KCL_FILE } from '@src/lib/constants'
import fsp from 'fs/promises'
import type { Paths } from '@e2e/playwright/test-utils' import type { Paths } from '@e2e/playwright/test-utils'
import { import {

View File

@ -1,8 +1,8 @@
import path from 'path'
import { bracket } from '@e2e/playwright/fixtures/bracket' import { bracket } from '@e2e/playwright/fixtures/bracket'
import type { Page } from '@playwright/test' import type { Page } from '@playwright/test'
import { reportRejection } from '@src/lib/trap' import { reportRejection } from '@src/lib/trap'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import path from 'path'
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from '@e2e/playwright/storageStates' import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from '@e2e/playwright/storageStates'
import type { TestColor } from '@e2e/playwright/test-utils' import type { TestColor } from '@e2e/playwright/test-utils'
@ -304,8 +304,9 @@ extrude001 = extrude(sketch001, length = 50)
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await page.keyboard.press('ArrowLeft') await page.keyboard.press('ArrowLeft')
await expect(page.locator('.cm-content')) await expect(
.toContainText(`exampleSketch = startSketchOn("XZ") page.locator('.cm-content')
).toContainText(`exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine(angle = 50, length = 45 ) |> angledLine(angle = 50, length = 45 )
|> yLine(endAbsolute = 0) |> yLine(endAbsolute = 0)

View File

@ -1,7 +1,7 @@
import type { Page } from '@playwright/test'
import { roundOff, uuidv4 } from '@src/lib/utils'
import fs from 'node:fs/promises' import fs from 'node:fs/promises'
import path from 'node:path' import path from 'node:path'
import type { Page } from '@playwright/test'
import { roundOff, uuidv4 } from '@src/lib/utils'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture' import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture' import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
@ -161,7 +161,8 @@ sketch001 = startSketchOn(XZ)
// click to add segment // click to add segment
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
await expect.poll(u.normalisedEditorCode, { timeout: 1000 }) await expect
.poll(u.normalisedEditorCode, { timeout: 1000 })
.toBe(`@settings(defaultLengthUnit = in) .toBe(`@settings(defaultLengthUnit = in)
@ -403,8 +404,9 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
await u.openKclCodePanel() await u.openKclCodePanel()
// expect the code to have changed // expect the code to have changed
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`sketch001 = startSketchOn(XZ) page.locator('.cm-content')
).toHaveText(`sketch001 = startSketchOn(XZ)
|> startProfileAt([6.44, -12.07], %) |> startProfileAt([6.44, -12.07], %)
|> line(end = [14.72, 1.97]) |> line(end = [14.72, 1.97])
|> tangentialArc(endAbsolute = [26.92, -3.32]) |> tangentialArc(endAbsolute = [26.92, -3.32])

View File

@ -1,9 +1,9 @@
import { spawn } from 'child_process'
import path from 'path'
import type { Models } from '@kittycad/lib' import type { Models } from '@kittycad/lib'
import { KCL_DEFAULT_LENGTH } from '@src/lib/constants' import { KCL_DEFAULT_LENGTH } from '@src/lib/constants'
import { spawn } from 'child_process'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import JSZip from 'jszip' import JSZip from 'jszip'
import path from 'path'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture' import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture' import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'

View File

@ -126,8 +126,9 @@ test.describe('Test network and connection issues', () => {
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001) page.locator('.cm-content')
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(length = ${commonPoints.num1})`) |> xLine(length = ${commonPoints.num1})`)
// Expect the network to be up // Expect the network to be up
@ -215,7 +216,8 @@ test.describe('Test network and connection issues', () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
// Ensure we can continue sketching // Ensure we can continue sketching
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
await expect.poll(u.normalisedEditorCode) await expect
.poll(u.normalisedEditorCode)
.toBe(`sketch001 = startSketchOn(XZ) .toBe(`sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([12.34, -12.34], sketch001) profile001 = startProfileAt([12.34, -12.34], sketch001)
|> xLine(length = 12.34) |> xLine(length = 12.34)
@ -225,7 +227,8 @@ profile001 = startProfileAt([12.34, -12.34], sketch001)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect.poll(u.normalisedEditorCode) await expect
.poll(u.normalisedEditorCode)
.toBe(`sketch001 = startSketchOn(XZ) .toBe(`sketch001 = startSketchOn(XZ)
profile001 = startProfileAt([12.34, -12.34], sketch001) profile001 = startProfileAt([12.34, -12.34], sketch001)
|> xLine(length = 12.34) |> xLine(length = 12.34)

View File

@ -1,3 +1,4 @@
import path from 'path'
import * as TOML from '@iarna/toml' import * as TOML from '@iarna/toml'
import type { Models } from '@kittycad/lib' import type { Models } from '@kittycad/lib'
import type { BrowserContext, Locator, Page, TestInfo } from '@playwright/test' import type { BrowserContext, Locator, Page, TestInfo } from '@playwright/test'
@ -9,7 +10,6 @@ import { reportRejection } from '@src/lib/trap'
import type { DeepPartial } from '@src/lib/types' import type { DeepPartial } from '@src/lib/types'
import { isArray } from '@src/lib/utils' import { isArray } from '@src/lib/utils'
import fsp from 'fs/promises' import fsp from 'fs/promises'
import path from 'path'
import pixelMatch from 'pixelmatch' import pixelMatch from 'pixelmatch'
import type { Protocol } from 'playwright-core/types/protocol' import type { Protocol } from 'playwright-core/types/protocol'
import { PNG } from 'pngjs' import { PNG } from 'pngjs'

View File

@ -1,6 +1,6 @@
import path from 'node:path'
import { XOR } from '@src/lib/utils' import { XOR } from '@src/lib/utils'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import path from 'node:path'
import { import {
TEST_COLORS, TEST_COLORS,

View File

@ -1,7 +1,7 @@
import { join } from 'path'
import { bracket } from '@e2e/playwright/fixtures/bracket' import { bracket } from '@e2e/playwright/fixtures/bracket'
import { FILE_EXT } from '@src/lib/constants' import { FILE_EXT } from '@src/lib/constants'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { join } from 'path'
import type { CmdBarSerialised } from '@e2e/playwright/fixtures/cmdBarFixture' import type { CmdBarSerialised } from '@e2e/playwright/fixtures/cmdBarFixture'
import type { ElectronZoo } from '@e2e/playwright/fixtures/fixtureSetup' import type { ElectronZoo } from '@e2e/playwright/fixtures/fixtureSetup'

View File

@ -78,22 +78,25 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001) page.locator('.cm-content')
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(length = ${commonPoints.num1})`) |> xLine(length = ${commonPoints.num1})`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${ page.locator('.cm-content')
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}) |> xLine(length = ${commonPoints.num1})
|> yLine(length = ${commonPoints.num1 + 0.01})`) |> yLine(length = ${commonPoints.num1 + 0.01})`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${ page.locator('.cm-content')
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}) |> xLine(length = ${commonPoints.num1})

View File

@ -1,3 +1,4 @@
import { join } from 'path'
import { import {
PROJECT_SETTINGS_FILE_NAME, PROJECT_SETTINGS_FILE_NAME,
SETTINGS_FILE_NAME, SETTINGS_FILE_NAME,
@ -5,7 +6,6 @@ import {
import type { SettingsLevel } from '@src/lib/settings/settingsTypes' import type { SettingsLevel } from '@src/lib/settings/settingsTypes'
import type { DeepPartial } from '@src/lib/types' import type { DeepPartial } from '@src/lib/types'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { join } from 'path'
import type { Settings } from '@rust/kcl-lib/bindings/Settings' import type { Settings } from '@rust/kcl-lib/bindings/Settings'

View File

@ -1,6 +1,6 @@
import type { Page } from '@playwright/test'
import fs from 'fs' import fs from 'fs'
import { join } from 'path' import { join } from 'path'
import type { Page } from '@playwright/test'
import { import {
createProject, createProject,

View File

@ -1,8 +1,8 @@
import path from 'path'
import { FusesPlugin } from '@electron-forge/plugin-fuses' import { FusesPlugin } from '@electron-forge/plugin-fuses'
import { VitePlugin } from '@electron-forge/plugin-vite' import { VitePlugin } from '@electron-forge/plugin-vite'
import type { ForgeConfig } from '@electron-forge/shared-types' import type { ForgeConfig } from '@electron-forge/shared-types'
import { FuseV1Options, FuseVersion } from '@electron/fuses' import { FuseV1Options, FuseVersion } from '@electron/fuses'
import path from 'path'
const rootDir = process.cwd() const rootDir = process.cwd()

4
interface.d.ts vendored
View File

@ -1,10 +1,10 @@
import { MachinesListing } from 'components/MachineManagerProvider' import { MachinesListing } from 'components/MachineManagerProvider'
import 'electron' import 'electron'
import fs from 'node:fs/promises'
import path from 'path'
import { dialog, shell } from 'electron' import { dialog, shell } from 'electron'
import type { WebContentSendPayload } from 'menu/channels' import type { WebContentSendPayload } from 'menu/channels'
import { ZooLabel } from 'menu/roles' import { ZooLabel } from 'menu/roles'
import fs from 'node:fs/promises'
import path from 'path'
// Extend the interface with additional custom properties // Extend the interface with additional custom properties
declare module 'electron' { declare module 'electron' {

243
package-lock.json generated
View File

@ -76,6 +76,7 @@
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.26.9", "@babel/preset-env": "^7.26.9",
"@biomejs/biome": "^1.9.4",
"@electron-forge/cli": "^7.8.0", "@electron-forge/cli": "^7.8.0",
"@electron-forge/plugin-fuses": "^7.8.0", "@electron-forge/plugin-fuses": "^7.8.0",
"@electron-forge/plugin-vite": "^7.8.0", "@electron-forge/plugin-vite": "^7.8.0",
@ -87,7 +88,6 @@
"@playwright/test": "^1.51.1", "@playwright/test": "^1.51.1",
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^15.0.2", "@testing-library/react": "^15.0.2",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/diff": "^7.0.2", "@types/diff": "^7.0.2",
"@types/electron": "^1.6.10", "@types/electron": "^1.6.10",
"@types/isomorphic-fetch": "^0.0.39", "@types/isomorphic-fetch": "^0.0.39",
@ -131,8 +131,6 @@
"pngjs": "^7.0.0", "pngjs": "^7.0.0",
"postcss": "^8.4.43", "postcss": "^8.4.43",
"postinstall-postinstall": "^2.1.0", "postinstall-postinstall": "^2.1.0",
"prettier": "^3.5.3",
"prettier-plugin-organize-imports": "^4.1.0",
"setimmediate": "^1.0.5", "setimmediate": "^1.0.5",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
@ -1926,6 +1924,170 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@biomejs/biome": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz",
"integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==",
"dev": true,
"hasInstallScript": true,
"license": "MIT OR Apache-2.0",
"bin": {
"biome": "bin/biome"
},
"engines": {
"node": ">=14.21.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/biome"
},
"optionalDependencies": {
"@biomejs/cli-darwin-arm64": "1.9.4",
"@biomejs/cli-darwin-x64": "1.9.4",
"@biomejs/cli-linux-arm64": "1.9.4",
"@biomejs/cli-linux-arm64-musl": "1.9.4",
"@biomejs/cli-linux-x64": "1.9.4",
"@biomejs/cli-linux-x64-musl": "1.9.4",
"@biomejs/cli-win32-arm64": "1.9.4",
"@biomejs/cli-win32-x64": "1.9.4"
}
},
"node_modules/@biomejs/cli-darwin-arm64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz",
"integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-darwin-x64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz",
"integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-arm64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz",
"integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz",
"integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-x64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz",
"integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-x64-musl": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz",
"integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-win32-arm64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz",
"integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-win32-x64": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz",
"integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@codemirror/autocomplete": { "node_modules/@codemirror/autocomplete": {
"version": "6.18.6", "version": "6.18.6",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz",
@ -5038,41 +5200,6 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/@trivago/prettier-plugin-sort-imports": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-5.2.2.tgz",
"integrity": "sha512-fYDQA9e6yTNmA13TLVSA+WMQRc5Bn/c0EUBditUHNfMMxN7M82c38b1kEggVE3pLpZ0FwkwJkUEKMiOi52JXFA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@babel/generator": "^7.26.5",
"@babel/parser": "^7.26.7",
"@babel/traverse": "^7.26.7",
"@babel/types": "^7.26.7",
"javascript-natural-sort": "^0.7.1",
"lodash": "^4.17.21"
},
"engines": {
"node": ">18.12"
},
"peerDependencies": {
"@vue/compiler-sfc": "3.x",
"prettier": "2.x - 3.x",
"prettier-plugin-svelte": "3.x",
"svelte": "4.x || 5.x"
},
"peerDependenciesMeta": {
"@vue/compiler-sfc": {
"optional": true
},
"prettier-plugin-svelte": {
"optional": true
},
"svelte": {
"optional": true
}
}
},
"node_modules/@ts-stack/markdown": { "node_modules/@ts-stack/markdown": {
"version": "1.5.0", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/@ts-stack/markdown/-/markdown-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@ts-stack/markdown/-/markdown-1.5.0.tgz",
@ -13349,13 +13476,6 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/javascript-natural-sort": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
"dev": true,
"license": "MIT"
},
"node_modules/jest-diff": { "node_modules/jest-diff": {
"version": "29.7.0", "version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz",
@ -16552,39 +16672,6 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz",
"integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/prettier-plugin-organize-imports": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
"integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"prettier": ">=2.0",
"typescript": ">=2.9",
"vue-tsc": "^2.1.0"
},
"peerDependenciesMeta": {
"vue-tsc": {
"optional": true
}
}
},
"node_modules/pretty-format": { "node_modules/pretty-format": {
"version": "27.5.1", "version": "27.5.1",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",

View File

@ -96,9 +96,10 @@
"simpleserver:stop": "kill-port 3000", "simpleserver:stop": "kill-port 3000",
"tsc": "tsc", "tsc": "tsc",
"playwright": "playwright", "playwright": "playwright",
"fmt": "prettier --write .eslintrc.json ./src *.ts *.json *.js ./e2e ./packages ./rust/kcl-language-server ./rust/kcl-lib/bindings ./rust/kcl-wasm-lib/pkg", "fmt": "biome format --write .eslintrc.json ./src *.ts *.js ./e2e ./packages ./rust/kcl-language-server ./rust/kcl-lib/bindings ./rust/kcl-wasm-lib/pkg",
"fmt:generated": "prettier --write .eslintrc.json *.ts *.json *.js ./rust/kcl-lib/bindings ./rust/kcl-wasm-lib/pkg", "fmt:check": "biome check --write --organize-imports-enabled=true --formatter-enabled=false --linter-enabled=false --files-ignore-unknown=true ./src *.ts *.js ./e2e ./packages ./rust/kcl-language-server ./rust/kcl-lib/bindings ./rust/kcl-wasm-lib/pkg",
"fmt-check": "prettier --check .eslintrc.json ./src *.ts *.json *.js ./e2e ./packages ./rust/kcl-language-server", "organize-imports": "biome check --write --organize-imports-enabled=true --formatter-enabled=false --linter-enabled=false ./src ./e2e ./packages --files-ignore-unknown=true",
"check": "biome check ./src ./e2e ./packages/codemirror-lsp-client/src ./rust/kcl-language-server/client/src",
"fetch:wasm": "./scripts/get-latest-wasm-bundle.sh", "fetch:wasm": "./scripts/get-latest-wasm-bundle.sh",
"fetch:wasm:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/get-latest-wasm-bundle.ps1", "fetch:wasm:windows": "powershell -ExecutionPolicy Bypass -File ./scripts/get-latest-wasm-bundle.ps1",
"fetch:samples": "rm -rf public/kcl-samples* && curl -L -o public/kcl-samples.zip https://github.com/KittyCAD/kcl-samples/archive/refs/heads/achalmers/kw-args-xylineto.zip && unzip -o public/kcl-samples.zip -d public && mv public/kcl-samples-* public/kcl-samples", "fetch:samples": "rm -rf public/kcl-samples* && curl -L -o public/kcl-samples.zip https://github.com/KittyCAD/kcl-samples/archive/refs/heads/achalmers/kw-args-xylineto.zip && unzip -o public/kcl-samples.zip -d public && mv public/kcl-samples-* public/kcl-samples",
@ -146,32 +147,8 @@
"test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000", "test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000",
"test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000" "test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000"
}, },
"prettier": {
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^@rust/(.*)$",
"^@public/(.*)$",
"^@e2e/(.*)$",
"^@src/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": [
"@trivago/prettier-plugin-sort-imports",
"prettier-plugin-organize-imports"
]
},
"browserslist": { "browserslist": {
"production": [ "production": [">0.2%", "not dead", "not op_mini all"],
">0.2%",
"not dead",
"not op_mini all"
],
"development": [ "development": [
"last 1 chrome version", "last 1 chrome version",
"last 1 firefox version", "last 1 firefox version",
@ -181,6 +158,7 @@
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.26.9", "@babel/preset-env": "^7.26.9",
"@biomejs/biome": "^1.9.4",
"@electron-forge/cli": "^7.8.0", "@electron-forge/cli": "^7.8.0",
"@electron-forge/plugin-fuses": "^7.8.0", "@electron-forge/plugin-fuses": "^7.8.0",
"@electron-forge/plugin-vite": "^7.8.0", "@electron-forge/plugin-vite": "^7.8.0",
@ -192,7 +170,6 @@
"@playwright/test": "^1.51.1", "@playwright/test": "^1.51.1",
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^15.0.2", "@testing-library/react": "^15.0.2",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/diff": "^7.0.2", "@types/diff": "^7.0.2",
"@types/electron": "^1.6.10", "@types/electron": "^1.6.10",
"@types/isomorphic-fetch": "^0.0.39", "@types/isomorphic-fetch": "^0.0.39",
@ -236,8 +213,6 @@
"pngjs": "^7.0.0", "pngjs": "^7.0.0",
"postcss": "^8.4.43", "postcss": "^8.4.43",
"postinstall-postinstall": "^2.1.0", "postinstall-postinstall": "^2.1.0",
"prettier": "^3.5.3",
"prettier-plugin-organize-imports": "^4.1.0",
"setimmediate": "^1.0.5", "setimmediate": "^1.0.5",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",

View File

@ -32,7 +32,5 @@
"vite-tsconfig-paths": "^5.1.4", "vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.1" "vitest": "^3.1.1"
}, },
"files": [ "files": ["dist/"]
"dist/"
]
} }

View File

@ -1,6 +1,6 @@
import { fileTests } from '@lezer/generator/dist/test'
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import { fileTests } from '@lezer/generator/dist/test'
import { KclLanguage } from '../src/index' import { KclLanguage } from '../src/index'

View File

@ -1,5 +1,5 @@
import { defineConfig, devices } from '@playwright/test'
import os from 'os' import os from 'os'
import { defineConfig, devices } from '@playwright/test'
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows) const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)

View File

@ -1,5 +1,5 @@
import { defineConfig, devices } from '@playwright/test'
import os from 'os' import os from 'os'
import { defineConfig, devices } from '@playwright/test'
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows) const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)

View File

@ -1,5 +1,5 @@
import { runTests } from '@vscode/test-electron'
import * as path from 'path' import * as path from 'path'
import { runTests } from '@vscode/test-electron'
async function main() { async function main() {
try { try {

View File

@ -17,9 +17,7 @@
"cad", "cad",
"manufacturing" "manufacturing"
], ],
"categories": [ "categories": ["Programming Languages"],
"Programming Languages"
],
"repository": { "repository": {
"url": "https://github.com/kittycad/modeling-app.git", "url": "https://github.com/kittycad/modeling-app.git",
"type": "git" "type": "git"
@ -28,17 +26,13 @@
"vscode": "^1.97.0" "vscode": "^1.97.0"
}, },
"enabledApiProposals": [], "enabledApiProposals": [],
"activationEvents": [ "activationEvents": ["onLanguage:kcl"],
"onLanguage:kcl"
],
"main": "./dist/main.js", "main": "./dist/main.js",
"contributes": { "contributes": {
"languages": [ "languages": [
{ {
"id": "kcl", "id": "kcl",
"extensions": [ "extensions": [".kcl"]
".kcl"
]
} }
], ],
"configuration": { "configuration": {
@ -46,10 +40,7 @@
"title": "kcl-language-server", "title": "kcl-language-server",
"properties": { "properties": {
"kcl-language-server.server.path": { "kcl-language-server.server.path": {
"type": [ "type": ["null", "string"],
"null",
"string"
],
"scope": "machine-overridable", "scope": "machine-overridable",
"default": null, "default": null,
"markdownDescription": "Path to kcl-language-server executable (points to bundled binary by default)." "markdownDescription": "Path to kcl-language-server executable (points to bundled binary by default)."
@ -57,16 +48,8 @@
"kcl-language-server.trace.server": { "kcl-language-server.trace.server": {
"type": "string", "type": "string",
"scope": "window", "scope": "window",
"enum": [ "enum": ["off", "messages", "verbose"],
"off", "enumDescriptions": ["No traces", "Error only", "Full log"],
"messages",
"verbose"
],
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
],
"default": "off", "default": "off",
"description": "Trace requests to the kcl-language-server (this is usually overly verbose and not recommended for regular users)." "description": "Trace requests to the kcl-language-server (this is usually overly verbose and not recommended for regular users)."
}, },

View File

@ -19,4 +19,4 @@ cargo test -p kcl-lib export_bindings
cd .. cd ..
copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public
npm run fmt:generated npm run fmt

View File

@ -13,4 +13,4 @@ cargo test -p kcl-lib export_bindings
cd .. cd ..
cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
npm run fmt:generated npm run fmt

View File

@ -19,4 +19,4 @@ cargo test -p kcl-lib export_bindings
cd .. cd ..
copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public
npm run fmt:generated npm run fmt

View File

@ -13,4 +13,4 @@ cargo test -p kcl-lib export_bindings
cd .. cd ..
cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
npm run fmt:generated npm run fmt

View File

@ -1,5 +1,5 @@
import { Fragment } from 'react' import { Fragment } from 'react'
import { create, type InstanceProps } from 'react-modal-promise' import { type InstanceProps, create } from 'react-modal-promise'
import { Dialog, Transition } from '@headlessui/react' import { Dialog, Transition } from '@headlessui/react'
import { ActionButton } from '@src/components/ActionButton' import { ActionButton } from '@src/components/ActionButton'

View File

@ -59,7 +59,6 @@ import {
CIRCLE_THREE_POINT_SEGMENT, CIRCLE_THREE_POINT_SEGMENT,
DRAFT_DASHED_LINE, DRAFT_DASHED_LINE,
EXTRA_SEGMENT_HANDLE, EXTRA_SEGMENT_HANDLE,
getParentGroup,
PROFILE_START, PROFILE_START,
SEGMENT_BODIES, SEGMENT_BODIES,
SEGMENT_BODIES_PLUS_PROFILE_START, SEGMENT_BODIES_PLUS_PROFILE_START,
@ -70,6 +69,7 @@ import {
THREE_POINT_ARC_HANDLE2, THREE_POINT_ARC_HANDLE2,
THREE_POINT_ARC_HANDLE3, THREE_POINT_ARC_HANDLE3,
THREE_POINT_ARC_SEGMENT, THREE_POINT_ARC_SEGMENT,
getParentGroup,
} from '@src/clientSideScene/sceneConstants' } from '@src/clientSideScene/sceneConstants'
import type { import type {
OnClickCallbackArgs, OnClickCallbackArgs,
@ -83,13 +83,13 @@ import {
AXIS_GROUP, AXIS_GROUP,
DRAFT_POINT, DRAFT_POINT,
DRAFT_POINT_GROUP, DRAFT_POINT_GROUP,
getSceneScale,
INTERSECTION_PLANE_LAYER, INTERSECTION_PLANE_LAYER,
RAYCASTABLE_PLANE, RAYCASTABLE_PLANE,
SKETCH_GROUP_SEGMENTS, SKETCH_GROUP_SEGMENTS,
SKETCH_LAYER, SKETCH_LAYER,
X_AXIS, X_AXIS,
Y_AXIS, Y_AXIS,
getSceneScale,
} from '@src/clientSideScene/sceneUtils' } from '@src/clientSideScene/sceneUtils'
import type { SegmentUtils } from '@src/clientSideScene/segments' import type { SegmentUtils } from '@src/clientSideScene/segments'
import { import {
@ -99,6 +99,7 @@ import {
segmentUtils, segmentUtils,
} from '@src/clientSideScene/segments' } from '@src/clientSideScene/segments'
import type EditorManager from '@src/editor/manager' import type EditorManager from '@src/editor/manager'
import type { KclManager } from '@src/lang/KclSingleton'
import type CodeManager from '@src/lang/codeManager' import type CodeManager from '@src/lang/codeManager'
import { ARG_END, ARG_END_ABSOLUTE } from '@src/lang/constants' import { ARG_END, ARG_END_ABSOLUTE } from '@src/lang/constants'
import { import {
@ -113,7 +114,6 @@ import {
createVariableDeclaration, createVariableDeclaration,
findUniqueName, findUniqueName,
} from '@src/lang/create' } from '@src/lang/create'
import type { KclManager } from '@src/lang/KclSingleton'
import type { ToolTip } from '@src/lang/langHelpers' import type { ToolTip } from '@src/lang/langHelpers'
import { executeAstMock } from '@src/lang/langHelpers' import { executeAstMock } from '@src/lang/langHelpers'
import { updateModelingState } from '@src/lang/modelingWorkflows' import { updateModelingState } from '@src/lang/modelingWorkflows'
@ -3725,7 +3725,6 @@ function prepareTruncatedAst(
(updatedSrcRangeAst.body[bodyStartIndex] as VariableDeclaration) (updatedSrcRangeAst.body[bodyStartIndex] as VariableDeclaration)
.declaration.init as PipeExpression .declaration.init as PipeExpression
).body.slice(-1)[0] ).body.slice(-1)[0]
;( ;(
(_ast.body[bodyStartIndex] as VariableDeclaration).declaration (_ast.body[bodyStartIndex] as VariableDeclaration).declaration
.init as PipeExpression .init as PipeExpression

View File

@ -6,7 +6,7 @@
var(--primary-hue, 264.48); var(--primary-hue, 264.48);
--primary: oklch( --primary: oklch(
var(--primary-lightness) var(--primary-chroma) var(--primary-hue, 264.48) / var(--primary-lightness) var(--primary-chroma) var(--primary-hue, 264.48) /
var(--opacity, 1) var(--opacity, 1)
); );
/* /*

View File

@ -3,7 +3,7 @@
} }
.folder::after { .folder::after {
content: ''; content: "";
width: 1px; width: 1px;
z-index: -1; z-index: -1;
@apply absolute top-0 bottom-0; @apply absolute top-0 bottom-0;

View File

@ -21,9 +21,7 @@
.toggle > span { .toggle > span {
@apply relative rounded border border-chalkboard-70 hover:border-chalkboard-80 cursor-pointer; @apply relative rounded border border-chalkboard-70 hover:border-chalkboard-80 cursor-pointer;
border-width: var(--border); border-width: var(--border);
width: calc( width: calc(2 * (var(--toggle-size) + var(--padding) * 2 - var(--border) * 2));
2 * (var(--toggle-size) + var(--padding) * 2 - var(--border) * 2)
);
height: calc(var(--toggle-size) + var(--padding) * 2 - var(--border) * 2); height: calc(var(--toggle-size) + var(--padding) * 2 - var(--border) * 2);
} }
@ -35,7 +33,7 @@
width: var(--toggle-size); width: var(--toggle-size);
height: var(--toggle-size); height: var(--toggle-size);
border-radius: calc(var(--toggle-size) / 8); border-radius: calc(var(--toggle-size) / 8);
content: ''; content: "";
@apply absolute bg-chalkboard-70; @apply absolute bg-chalkboard-70;
top: 50%; top: 50%;
left: 50%; left: 50%;

View File

@ -20,9 +20,7 @@
/* The parts that will be transitioned */ /* The parts that will be transitioned */
opacity: 0; opacity: 0;
transform: translate(var(--_x, 0), var(--_y, 0)); transform: translate(var(--_x, 0), var(--_y, 0));
transition: transition: transform 0.15s ease-out, opacity 0.11s ease-out;
transform 0.15s ease-out,
opacity 0.11s ease-out;
} }
.tooltip { .tooltip {
@ -83,18 +81,18 @@
} }
.tooltip::before { .tooltip::before {
content: '; Has tooltip: '; content: "; Has tooltip: ";
} }
/* Sometimes there's no visible label, /* Sometimes there's no visible label,
* so we'll use the tooltip as the label * so we'll use the tooltip as the label
*/ */
.tooltip:only-child::before { .tooltip:only-child::before {
content: ''; content: "";
} }
.tooltip:only-child::after { .tooltip:only-child::after {
content: ' (tooltip)'; content: " (tooltip)";
} }
.top, .top,

View File

@ -24,7 +24,6 @@ export const useProjectsLoader = (deps?: [number]) => {
if (deps) { if (deps) {
setLastTs(deps[0]) setLastTs(deps[0])
} }
;(async () => { ;(async () => {
const { configuration } = await loadAndValidateSettings() const { configuration } = await loadAndValidateSettings()
const _projectsDir = await ensureProjectDirectoryExists(configuration) const _projectsDir = await ensureProjectDirectoryExists(configuration)

View File

@ -1,4 +1,4 @@
@import './colors.css'; @import "./colors.css";
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@ -131,13 +131,13 @@ input {
} }
.mono { .mono {
font-family: font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; monospace;
} }
code { code {
font-family: font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; monospace;
} }
/* /*
@ -249,10 +249,10 @@ code {
#code-mirror-override .cm-tooltip-autocomplete li { #code-mirror-override .cm-tooltip-autocomplete li {
@apply px-2 py-1; @apply px-2 py-1;
} }
#code-mirror-override .cm-tooltip-autocomplete li[aria-selected='true'] { #code-mirror-override .cm-tooltip-autocomplete li[aria-selected="true"] {
@apply bg-liquid-10 text-liquid-110; @apply bg-liquid-10 text-liquid-110;
} }
.dark #code-mirror-override .cm-tooltip-autocomplete li[aria-selected='true'] { .dark #code-mirror-override .cm-tooltip-autocomplete li[aria-selected="true"] {
@apply bg-liquid-100 text-liquid-20; @apply bg-liquid-100 text-liquid-20;
} }

View File

@ -122,9 +122,11 @@ export class KclManager {
private _isExecutingCallback: (arg: boolean) => void = () => {} private _isExecutingCallback: (arg: boolean) => void = () => {}
private _astCallBack: (arg: Node<Program>) => void = () => {} private _astCallBack: (arg: Node<Program>) => void = () => {}
private _variablesCallBack: (arg: { private _variablesCallBack: (
[key in string]?: KclValue | undefined arg: {
}) => void = () => {} [key in string]?: KclValue | undefined
}
) => void = () => {}
private _logsCallBack: (arg: string[]) => void = () => {} private _logsCallBack: (arg: string[]) => void = () => {}
private _kclErrorsCallBack: (errors: KCLError[]) => void = () => {} private _kclErrorsCallBack: (errors: KCLError[]) => void = () => {}
private _diagnosticsCallback: (errors: Diagnostic[]) => void = () => {} private _diagnosticsCallback: (errors: Diagnostic[]) => void = () => {}

View File

@ -5,8 +5,8 @@ import { BSON } from 'bson'
import type { MachineManager } from '@src/components/MachineManagerProvider' import type { MachineManager } from '@src/components/MachineManagerProvider'
import type { useModelingContext } from '@src/hooks/useModelingContext' import type { useModelingContext } from '@src/hooks/useModelingContext'
import type CodeManager from '@src/lang/codeManager'
import type { KclManager } from '@src/lang/KclSingleton' import type { KclManager } from '@src/lang/KclSingleton'
import type CodeManager from '@src/lang/codeManager'
import type { EngineCommand, ResponseMap } from '@src/lang/std/artifactGraph' import type { EngineCommand, ResponseMap } from '@src/lang/std/artifactGraph'
import type { CommandLog } from '@src/lang/std/commandLog' import type { CommandLog } from '@src/lang/std/commandLog'
import { CommandLogType } from '@src/lang/std/commandLog' import { CommandLogType } from '@src/lang/std/commandLog'

View File

@ -28,8 +28,8 @@ import type { UnitLen } from '@rust/kcl-lib/bindings/UnitLen'
import { KCLError } from '@src/lang/errors' import { KCLError } from '@src/lang/errors'
import { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils' import { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils'
import { import {
defaultArtifactGraph,
type Artifact, type Artifact,
defaultArtifactGraph,
} from '@src/lang/std/artifactGraph' } from '@src/lang/std/artifactGraph'
import type { Coords2d } from '@src/lang/std/sketch' import type { Coords2d } from '@src/lang/std/sketch'
import { import {

View File

@ -1,7 +1,7 @@
import { init, reloadModule } from '@src/lib/wasm_lib_wrapper'
import fs from 'fs' import fs from 'fs'
import fsPromises from 'fs/promises'
import path from 'path' import path from 'path'
import { init, reloadModule } from '@src/lib/wasm_lib_wrapper'
import fsPromises from 'fs/promises'
export const wasmUrlNode = () => { export const wasmUrlNode = () => {
// In prod the file will be right next to the compiled js file. // In prod the file will be right next to the compiled js file.

View File

@ -1,10 +1,10 @@
import type { Stats } from 'fs'
import * as path from 'path'
import { import {
importFileExtensions, importFileExtensions,
relevantFileExtensions, relevantFileExtensions,
} from '@src/lang/wasmUtils' } from '@src/lang/wasmUtils'
import type { Stats } from 'fs'
import * as fs from 'fs/promises' import * as fs from 'fs/promises'
import * as path from 'path'
import { PROJECT_ENTRYPOINT } from '@src/lib/constants' import { PROJECT_ENTRYPOINT } from '@src/lib/constants'

View File

@ -1,4 +1,4 @@
import type { Operation, OpKclValue } from '@rust/kcl-lib/bindings/Operation' import type { OpKclValue, Operation } from '@rust/kcl-lib/bindings/Operation'
import type { CustomIconName } from '@src/components/CustomIcon' import type { CustomIconName } from '@src/components/CustomIcon'
import { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils' import { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils'

View File

@ -15,7 +15,6 @@ import { createProfileStartHandle } from '@src/clientSideScene/segments'
import type { MachineManager } from '@src/components/MachineManagerProvider' import type { MachineManager } from '@src/components/MachineManagerProvider'
import type { ModelingMachineContext } from '@src/components/ModelingMachineProvider' import type { ModelingMachineContext } from '@src/components/ModelingMachineProvider'
import type { SidebarType } from '@src/components/ModelingSidebar/ModelingPanes' import type { SidebarType } from '@src/components/ModelingSidebar/ModelingPanes'
import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo'
import { import {
applyConstraintEqualAngle, applyConstraintEqualAngle,
equalAngleInfo, equalAngleInfo,
@ -42,6 +41,7 @@ import {
applyConstraintHorzVertAlign, applyConstraintHorzVertAlign,
horzVertDistanceInfo, horzVertDistanceInfo,
} from '@src/components/Toolbar/SetHorzVertDistance' } from '@src/components/Toolbar/SetHorzVertDistance'
import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo'
import { createLiteral, createLocalName } from '@src/lang/create' import { createLiteral, createLocalName } from '@src/lang/create'
import { updateModelingState } from '@src/lang/modelingWorkflows' import { updateModelingState } from '@src/lang/modelingWorkflows'
import { import {

View File

@ -1,3 +1,5 @@
import os from 'node:os'
import path from 'path'
// Some of the following was taken from bits and pieces of the vite-typescript // Some of the following was taken from bits and pieces of the vite-typescript
// template that ElectronJS provides. // template that ElectronJS provides.
// @ts-ignore: TS1343 // @ts-ignore: TS1343
@ -18,9 +20,7 @@ import {
systemPreferences, systemPreferences,
} from 'electron' } from 'electron'
import electronUpdater, { type AppUpdater } from 'electron-updater' import electronUpdater, { type AppUpdater } from 'electron-updater'
import os from 'node:os'
import { Issuer } from 'openid-client' import { Issuer } from 'openid-client'
import path from 'path'
import { import {
argvFromYargs, argvFromYargs,

View File

@ -1,3 +1,4 @@
import os from 'node:os'
import { modelingDesignRole } from '@src/menu/designRole' import { modelingDesignRole } from '@src/menu/designRole'
import { modelingEditRole, projectEditRole } from '@src/menu/editRole' import { modelingEditRole, projectEditRole } from '@src/menu/editRole'
import { modelingFileRole, projectFileRole } from '@src/menu/fileRole' import { modelingFileRole, projectFileRole } from '@src/menu/fileRole'
@ -6,7 +7,6 @@ import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
import { modelingViewRole, projectViewRole } from '@src/menu/viewRole' import { modelingViewRole, projectViewRole } from '@src/menu/viewRole'
import type { BrowserWindow } from 'electron' import type { BrowserWindow } from 'electron'
import { Menu, app } from 'electron' import { Menu, app } from 'electron'
import os from 'node:os'
const isMac = os.platform() === 'darwin' const isMac = os.platform() === 'darwin'

View File

@ -1,5 +1,5 @@
import type { BrowserWindow } from 'electron'
import os from 'node:os' import os from 'node:os'
import type { BrowserWindow } from 'electron'
import { typeSafeWebContentsSend } from '@src/menu/channels' import { typeSafeWebContentsSend } from '@src/menu/channels'
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles' import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'

View File

@ -1,5 +1,5 @@
import type { BrowserWindow } from 'electron'
import os from 'node:os' import os from 'node:os'
import type { BrowserWindow } from 'electron'
import { typeSafeWebContentsSend } from '@src/menu/channels' import { typeSafeWebContentsSend } from '@src/menu/channels'
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles' import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'

View File

@ -1,5 +1,5 @@
import type { BrowserWindow } from 'electron'
import os from 'node:os' import os from 'node:os'
import type { BrowserWindow } from 'electron'
import { typeSafeWebContentsSend } from '@src/menu/channels' import { typeSafeWebContentsSend } from '@src/menu/channels'
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles' import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'

View File

@ -1,12 +1,12 @@
import fsSync from 'node:fs'
import fs from 'node:fs/promises'
import os from 'node:os'
import path from 'path'
import packageJson from '@root/package.json' import packageJson from '@root/package.json'
import type { MachinesListing } from '@src/components/MachineManagerProvider' import type { MachinesListing } from '@src/components/MachineManagerProvider'
import chokidar from 'chokidar' import chokidar from 'chokidar'
import type { IpcRendererEvent } from 'electron' import type { IpcRendererEvent } from 'electron'
import { contextBridge, ipcRenderer } from 'electron' import { contextBridge, ipcRenderer } from 'electron'
import fsSync from 'node:fs'
import fs from 'node:fs/promises'
import os from 'node:os'
import path from 'path'
import type { Channel } from '@src/channels' import type { Channel } from '@src/channels'
import type { WebContentSendPayload } from '@src/menu/channels' import type { WebContentSendPayload } from '@src/menu/channels'

View File

@ -2,8 +2,8 @@ import { bracketWidthConstantLine } from '@src/lib/exampleKcl'
import { onboardingPaths } from '@src/routes/Onboarding/paths' import { onboardingPaths } from '@src/routes/Onboarding/paths'
import { import {
kbdClasses,
OnboardingButtons, OnboardingButtons,
kbdClasses,
useDemoCode, useDemoCode,
} from '@src/routes/Onboarding/utils' } from '@src/routes/Onboarding/utils'