~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:
2
.github/workflows/static-analysis.yml
vendored
2
.github/workflows/static-analysis.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
- run: npm run fmt-check
|
||||
- run: npm run fmt:check
|
||||
|
||||
npm-build-wasm:
|
||||
# Build the wasm blob once on the fastest runner.
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -84,3 +84,4 @@ dist
|
||||
venv
|
||||
|
||||
.vscode-test
|
||||
.biome/
|
||||
|
@ -420,7 +420,7 @@ npm run test-setup
|
||||
|
||||
```
|
||||
npm run tsc
|
||||
npm run fmt-check
|
||||
npm run fmt:check
|
||||
npm run lint
|
||||
npm run test:unit:local
|
||||
```
|
||||
|
48
biome.json
Normal file
48
biome.json
Normal 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"]
|
||||
}
|
||||
}
|
@ -66,15 +66,17 @@ async function doBasicSketch(
|
||||
await page.waitForTimeout(500)
|
||||
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
await expect(
|
||||
u.codeLocator
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})`)
|
||||
}
|
||||
await page.waitForTimeout(500)
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
await expect(
|
||||
u.codeLocator
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})
|
||||
@ -85,8 +87,9 @@ async function doBasicSketch(
|
||||
await page.waitForTimeout(200)
|
||||
await page.mouse.click(startXPx, 500 - PUR * 20)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
await expect(
|
||||
u.codeLocator
|
||||
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})
|
||||
@ -142,8 +145,9 @@ async function doBasicSketch(
|
||||
|
||||
// Open the code pane.
|
||||
await u.openKclCodePanel()
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
await expect(
|
||||
u.codeLocator
|
||||
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1}, tag = $seg01)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { join } from 'path'
|
||||
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||
import fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from '@e2e/playwright/storageStates'
|
||||
import {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import path, { join } from 'path'
|
||||
import { KCL_DEFAULT_LENGTH } from '@src/lib/constants'
|
||||
import * as fsp from 'fs/promises'
|
||||
import path, { join } from 'path'
|
||||
|
||||
import {
|
||||
executorInputPath,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
import fsp from 'fs/promises'
|
||||
|
||||
import {
|
||||
executorInputPath,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { join } from 'path'
|
||||
import { uuidv4 } from '@src/lib/utils'
|
||||
import fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import {
|
||||
TEST_COLORS,
|
||||
@ -409,8 +409,9 @@ sketch_001 = startSketchOn(XY)
|
||||
// Hit alt+shift+f to format the code
|
||||
await page.keyboard.press('Alt+Shift+KeyF')
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XY)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
@ -462,8 +463,9 @@ sketch_001 = startSketchOn(XY)
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||
await u.closeDebugPanel()
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch_001 = startSketchOn(XY)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
@ -978,8 +980,9 @@ sketch001 = startSketchOn(XZ)
|
||||
await page.keyboard.up('Control')
|
||||
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import * as fsp from 'fs/promises'
|
||||
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { FILE_EXT } from '@src/lib/constants'
|
||||
import * as fs from 'fs'
|
||||
import * as fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import { FILE_EXT } from '@src/lib/constants'
|
||||
import * as fsp from 'fs/promises'
|
||||
|
||||
import {
|
||||
createProject,
|
||||
|
@ -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 path from 'path'
|
||||
import type { Locator, Page, Request, Route, TestInfo } from '@playwright/test'
|
||||
import { expect } from '@playwright/test'
|
||||
|
||||
export type CmdBarSerialised =
|
||||
| {
|
||||
|
@ -7,11 +7,11 @@ import type {
|
||||
} 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 type { DeepPartial } from '@src/lib/types'
|
||||
import fsp from 'fs/promises'
|
||||
import fs from 'node:fs'
|
||||
import path from 'path'
|
||||
|
||||
import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import path from 'path'
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
import * as fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
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 ({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import fsp from 'fs/promises'
|
||||
|
||||
import { executorInputPath } from '@e2e/playwright/test-utils'
|
||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { join } from 'path'
|
||||
import { PROJECT_SETTINGS_FILE_NAME } from '@src/lib/constants'
|
||||
import * as fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import type { NamedView } from '@rust/kcl-lib/bindings/NamedView'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { join } from 'path'
|
||||
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
||||
import fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
import * as fsp from 'fs/promises'
|
||||
|
||||
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
|
||||
import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { Locator, Page } from '@playwright/test'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import type { Locator, Page } from '@playwright/test'
|
||||
|
||||
import type { EditorFixture } from '@e2e/playwright/fixtures/editorFixture'
|
||||
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DEFAULT_PROJECT_KCL_FILE } from '@src/lib/constants'
|
||||
import fs from 'fs'
|
||||
import fsp from 'fs/promises'
|
||||
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 {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import path from 'path'
|
||||
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||
import type { Page } from '@playwright/test'
|
||||
import { reportRejection } from '@src/lib/trap'
|
||||
import * as fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from '@e2e/playwright/storageStates'
|
||||
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('ArrowLeft')
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toContainText(`exampleSketch = startSketchOn("XZ")
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toContainText(`exampleSketch = startSketchOn("XZ")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine(angle = 50, length = 45 )
|
||||
|> yLine(endAbsolute = 0)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
import { roundOff, uuidv4 } from '@src/lib/utils'
|
||||
import fs from 'node:fs/promises'
|
||||
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 { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
|
||||
@ -161,7 +161,8 @@ sketch001 = startSketchOn(XZ)
|
||||
// click to add segment
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect.poll(u.normalisedEditorCode, { timeout: 1000 })
|
||||
await expect
|
||||
.poll(u.normalisedEditorCode, { timeout: 1000 })
|
||||
.toBe(`@settings(defaultLengthUnit = in)
|
||||
|
||||
|
||||
@ -403,8 +404,9 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
||||
await u.openKclCodePanel()
|
||||
|
||||
// expect the code to have changed
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line(end = [14.72, 1.97])
|
||||
|> tangentialArc(endAbsolute = [26.92, -3.32])
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { spawn } from 'child_process'
|
||||
import path from 'path'
|
||||
import type { Models } from '@kittycad/lib'
|
||||
import { KCL_DEFAULT_LENGTH } from '@src/lib/constants'
|
||||
import { spawn } from 'child_process'
|
||||
import fsp from 'fs/promises'
|
||||
import JSZip from 'jszip'
|
||||
import path from 'path'
|
||||
|
||||
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
|
||||
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
|
||||
|
@ -126,8 +126,9 @@ test.describe('Test network and connection issues', () => {
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})`)
|
||||
|
||||
// Expect the network to be up
|
||||
@ -215,7 +216,8 @@ test.describe('Test network and connection issues', () => {
|
||||
await page.waitForTimeout(100)
|
||||
// Ensure we can continue sketching
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
|
||||
await expect.poll(u.normalisedEditorCode)
|
||||
await expect
|
||||
.poll(u.normalisedEditorCode)
|
||||
.toBe(`sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([12.34, -12.34], sketch001)
|
||||
|> xLine(length = 12.34)
|
||||
@ -225,7 +227,8 @@ profile001 = startProfileAt([12.34, -12.34], sketch001)
|
||||
await page.waitForTimeout(100)
|
||||
await page.mouse.click(startXPx, 500 - PUR * 20)
|
||||
|
||||
await expect.poll(u.normalisedEditorCode)
|
||||
await expect
|
||||
.poll(u.normalisedEditorCode)
|
||||
.toBe(`sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([12.34, -12.34], sketch001)
|
||||
|> xLine(length = 12.34)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import path from 'path'
|
||||
import * as TOML from '@iarna/toml'
|
||||
import type { Models } from '@kittycad/lib'
|
||||
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 { isArray } from '@src/lib/utils'
|
||||
import fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
import pixelMatch from 'pixelmatch'
|
||||
import type { Protocol } from 'playwright-core/types/protocol'
|
||||
import { PNG } from 'pngjs'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import path from 'node:path'
|
||||
import { XOR } from '@src/lib/utils'
|
||||
import * as fsp from 'fs/promises'
|
||||
import path from 'node:path'
|
||||
|
||||
import {
|
||||
TEST_COLORS,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { join } from 'path'
|
||||
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||
import { FILE_EXT } from '@src/lib/constants'
|
||||
import * as fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import type { CmdBarSerialised } from '@e2e/playwright/fixtures/cmdBarFixture'
|
||||
import type { ElectronZoo } from '@e2e/playwright/fixtures/fixtureSetup'
|
||||
|
@ -78,22 +78,25 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
|
||||
await page.waitForTimeout(100)
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})`)
|
||||
|
||||
await page.waitForTimeout(100)
|
||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})
|
||||
|> yLine(length = ${commonPoints.num1 + 0.01})`)
|
||||
await page.waitForTimeout(100)
|
||||
await page.mouse.click(startXPx, 500 - PUR * 20)
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { join } from 'path'
|
||||
import {
|
||||
PROJECT_SETTINGS_FILE_NAME,
|
||||
SETTINGS_FILE_NAME,
|
||||
@ -5,7 +6,6 @@ import {
|
||||
import type { SettingsLevel } from '@src/lib/settings/settingsTypes'
|
||||
import type { DeepPartial } from '@src/lib/types'
|
||||
import * as fsp from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
|
||||
import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { Page } from '@playwright/test'
|
||||
import fs from 'fs'
|
||||
import { join } from 'path'
|
||||
import type { Page } from '@playwright/test'
|
||||
|
||||
import {
|
||||
createProject,
|
||||
|
@ -1,8 +1,8 @@
|
||||
import path from 'path'
|
||||
import { FusesPlugin } from '@electron-forge/plugin-fuses'
|
||||
import { VitePlugin } from '@electron-forge/plugin-vite'
|
||||
import type { ForgeConfig } from '@electron-forge/shared-types'
|
||||
import { FuseV1Options, FuseVersion } from '@electron/fuses'
|
||||
import path from 'path'
|
||||
|
||||
const rootDir = process.cwd()
|
||||
|
||||
|
4
interface.d.ts
vendored
4
interface.d.ts
vendored
@ -1,10 +1,10 @@
|
||||
import { MachinesListing } from 'components/MachineManagerProvider'
|
||||
import 'electron'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'path'
|
||||
import { dialog, shell } from 'electron'
|
||||
import type { WebContentSendPayload } from 'menu/channels'
|
||||
import { ZooLabel } from 'menu/roles'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
// Extend the interface with additional custom properties
|
||||
declare module 'electron' {
|
||||
|
243
package-lock.json
generated
243
package-lock.json
generated
@ -76,6 +76,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.26.9",
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@electron-forge/cli": "^7.8.0",
|
||||
"@electron-forge/plugin-fuses": "^7.8.0",
|
||||
"@electron-forge/plugin-vite": "^7.8.0",
|
||||
@ -87,7 +88,6 @@
|
||||
"@playwright/test": "^1.51.1",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^15.0.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
||||
"@types/diff": "^7.0.2",
|
||||
"@types/electron": "^1.6.10",
|
||||
"@types/isomorphic-fetch": "^0.0.39",
|
||||
@ -131,8 +131,6 @@
|
||||
"pngjs": "^7.0.0",
|
||||
"postcss": "^8.4.43",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^3.5.3",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-node": "^10.0.0",
|
||||
@ -1926,6 +1924,170 @@
|
||||
"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": {
|
||||
"version": "6.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz",
|
||||
@ -5038,41 +5200,6 @@
|
||||
"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": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@ts-stack/markdown/-/markdown-1.5.0.tgz",
|
||||
@ -13349,13 +13476,6 @@
|
||||
"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": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz",
|
||||
@ -16552,39 +16672,6 @@
|
||||
"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": {
|
||||
"version": "27.5.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
|
||||
|
37
package.json
37
package.json
@ -96,9 +96,10 @@
|
||||
"simpleserver:stop": "kill-port 3000",
|
||||
"tsc": "tsc",
|
||||
"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:generated": "prettier --write .eslintrc.json *.ts *.json *.js ./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",
|
||||
"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: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",
|
||||
"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: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",
|
||||
@ -146,32 +147,8 @@
|
||||
"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"
|
||||
},
|
||||
"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": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"production": [">0.2%", "not dead", "not op_mini all"],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
@ -181,6 +158,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.26.9",
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@electron-forge/cli": "^7.8.0",
|
||||
"@electron-forge/plugin-fuses": "^7.8.0",
|
||||
"@electron-forge/plugin-vite": "^7.8.0",
|
||||
@ -192,7 +170,6 @@
|
||||
"@playwright/test": "^1.51.1",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^15.0.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
||||
"@types/diff": "^7.0.2",
|
||||
"@types/electron": "^1.6.10",
|
||||
"@types/isomorphic-fetch": "^0.0.39",
|
||||
@ -236,8 +213,6 @@
|
||||
"pngjs": "^7.0.0",
|
||||
"postcss": "^8.4.43",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^3.5.3",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-node": "^10.0.0",
|
||||
|
@ -32,7 +32,5 @@
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^3.1.1"
|
||||
},
|
||||
"files": [
|
||||
"dist/"
|
||||
]
|
||||
"files": ["dist/"]
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { fileTests } from '@lezer/generator/dist/test'
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import { fileTests } from '@lezer/generator/dist/test'
|
||||
|
||||
import { KclLanguage } from '../src/index'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
import os from 'os'
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
import os from 'os'
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
const platform = os.platform() // 'linux' (Ubuntu), 'darwin' (macOS), 'win32' (Windows)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { runTests } from '@vscode/test-electron'
|
||||
import * as path from 'path'
|
||||
import { runTests } from '@vscode/test-electron'
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
|
@ -17,9 +17,7 @@
|
||||
"cad",
|
||||
"manufacturing"
|
||||
],
|
||||
"categories": [
|
||||
"Programming Languages"
|
||||
],
|
||||
"categories": ["Programming Languages"],
|
||||
"repository": {
|
||||
"url": "https://github.com/kittycad/modeling-app.git",
|
||||
"type": "git"
|
||||
@ -28,17 +26,13 @@
|
||||
"vscode": "^1.97.0"
|
||||
},
|
||||
"enabledApiProposals": [],
|
||||
"activationEvents": [
|
||||
"onLanguage:kcl"
|
||||
],
|
||||
"activationEvents": ["onLanguage:kcl"],
|
||||
"main": "./dist/main.js",
|
||||
"contributes": {
|
||||
"languages": [
|
||||
{
|
||||
"id": "kcl",
|
||||
"extensions": [
|
||||
".kcl"
|
||||
]
|
||||
"extensions": [".kcl"]
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
@ -46,10 +40,7 @@
|
||||
"title": "kcl-language-server",
|
||||
"properties": {
|
||||
"kcl-language-server.server.path": {
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
],
|
||||
"type": ["null", "string"],
|
||||
"scope": "machine-overridable",
|
||||
"default": null,
|
||||
"markdownDescription": "Path to kcl-language-server executable (points to bundled binary by default)."
|
||||
@ -57,16 +48,8 @@
|
||||
"kcl-language-server.trace.server": {
|
||||
"type": "string",
|
||||
"scope": "window",
|
||||
"enum": [
|
||||
"off",
|
||||
"messages",
|
||||
"verbose"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"No traces",
|
||||
"Error only",
|
||||
"Full log"
|
||||
],
|
||||
"enum": ["off", "messages", "verbose"],
|
||||
"enumDescriptions": ["No traces", "Error only", "Full log"],
|
||||
"default": "off",
|
||||
"description": "Trace requests to the kcl-language-server (this is usually overly verbose and not recommended for regular users)."
|
||||
},
|
||||
|
@ -19,4 +19,4 @@ cargo test -p kcl-lib export_bindings
|
||||
cd ..
|
||||
|
||||
copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public
|
||||
npm run fmt:generated
|
||||
npm run fmt
|
||||
|
@ -13,4 +13,4 @@ cargo test -p kcl-lib export_bindings
|
||||
cd ..
|
||||
|
||||
cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||
npm run fmt:generated
|
||||
npm run fmt
|
||||
|
@ -19,4 +19,4 @@ cargo test -p kcl-lib export_bindings
|
||||
cd ..
|
||||
|
||||
copy rust\kcl-wasm-lib\pkg\kcl_wasm_lib_bg.wasm public
|
||||
npm run fmt:generated
|
||||
npm run fmt
|
||||
|
@ -13,4 +13,4 @@ cargo test -p kcl-lib export_bindings
|
||||
cd ..
|
||||
|
||||
cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||
npm run fmt:generated
|
||||
npm run fmt
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 { ActionButton } from '@src/components/ActionButton'
|
||||
|
@ -59,7 +59,6 @@ import {
|
||||
CIRCLE_THREE_POINT_SEGMENT,
|
||||
DRAFT_DASHED_LINE,
|
||||
EXTRA_SEGMENT_HANDLE,
|
||||
getParentGroup,
|
||||
PROFILE_START,
|
||||
SEGMENT_BODIES,
|
||||
SEGMENT_BODIES_PLUS_PROFILE_START,
|
||||
@ -70,6 +69,7 @@ import {
|
||||
THREE_POINT_ARC_HANDLE2,
|
||||
THREE_POINT_ARC_HANDLE3,
|
||||
THREE_POINT_ARC_SEGMENT,
|
||||
getParentGroup,
|
||||
} from '@src/clientSideScene/sceneConstants'
|
||||
import type {
|
||||
OnClickCallbackArgs,
|
||||
@ -83,13 +83,13 @@ import {
|
||||
AXIS_GROUP,
|
||||
DRAFT_POINT,
|
||||
DRAFT_POINT_GROUP,
|
||||
getSceneScale,
|
||||
INTERSECTION_PLANE_LAYER,
|
||||
RAYCASTABLE_PLANE,
|
||||
SKETCH_GROUP_SEGMENTS,
|
||||
SKETCH_LAYER,
|
||||
X_AXIS,
|
||||
Y_AXIS,
|
||||
getSceneScale,
|
||||
} from '@src/clientSideScene/sceneUtils'
|
||||
import type { SegmentUtils } from '@src/clientSideScene/segments'
|
||||
import {
|
||||
@ -99,6 +99,7 @@ import {
|
||||
segmentUtils,
|
||||
} from '@src/clientSideScene/segments'
|
||||
import type EditorManager from '@src/editor/manager'
|
||||
import type { KclManager } from '@src/lang/KclSingleton'
|
||||
import type CodeManager from '@src/lang/codeManager'
|
||||
import { ARG_END, ARG_END_ABSOLUTE } from '@src/lang/constants'
|
||||
import {
|
||||
@ -113,7 +114,6 @@ import {
|
||||
createVariableDeclaration,
|
||||
findUniqueName,
|
||||
} from '@src/lang/create'
|
||||
import type { KclManager } from '@src/lang/KclSingleton'
|
||||
import type { ToolTip } from '@src/lang/langHelpers'
|
||||
import { executeAstMock } from '@src/lang/langHelpers'
|
||||
import { updateModelingState } from '@src/lang/modelingWorkflows'
|
||||
@ -3725,7 +3725,6 @@ function prepareTruncatedAst(
|
||||
(updatedSrcRangeAst.body[bodyStartIndex] as VariableDeclaration)
|
||||
.declaration.init as PipeExpression
|
||||
).body.slice(-1)[0]
|
||||
|
||||
;(
|
||||
(_ast.body[bodyStartIndex] as VariableDeclaration).declaration
|
||||
.init as PipeExpression
|
||||
|
@ -3,7 +3,7 @@
|
||||
}
|
||||
|
||||
.folder::after {
|
||||
content: '';
|
||||
content: "";
|
||||
width: 1px;
|
||||
z-index: -1;
|
||||
@apply absolute top-0 bottom-0;
|
||||
|
@ -21,9 +21,7 @@
|
||||
.toggle > span {
|
||||
@apply relative rounded border border-chalkboard-70 hover:border-chalkboard-80 cursor-pointer;
|
||||
border-width: var(--border);
|
||||
width: calc(
|
||||
2 * (var(--toggle-size) + var(--padding) * 2 - var(--border) * 2)
|
||||
);
|
||||
width: calc(2 * (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);
|
||||
height: var(--toggle-size);
|
||||
border-radius: calc(var(--toggle-size) / 8);
|
||||
content: '';
|
||||
content: "";
|
||||
@apply absolute bg-chalkboard-70;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
|
@ -20,9 +20,7 @@
|
||||
/* The parts that will be transitioned */
|
||||
opacity: 0;
|
||||
transform: translate(var(--_x, 0), var(--_y, 0));
|
||||
transition:
|
||||
transform 0.15s ease-out,
|
||||
opacity 0.11s ease-out;
|
||||
transition: transform 0.15s ease-out, opacity 0.11s ease-out;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
@ -83,18 +81,18 @@
|
||||
}
|
||||
|
||||
.tooltip::before {
|
||||
content: '; Has tooltip: ';
|
||||
content: "; Has tooltip: ";
|
||||
}
|
||||
|
||||
/* Sometimes there's no visible label,
|
||||
* so we'll use the tooltip as the label
|
||||
*/
|
||||
.tooltip:only-child::before {
|
||||
content: '';
|
||||
content: "";
|
||||
}
|
||||
|
||||
.tooltip:only-child::after {
|
||||
content: ' (tooltip)';
|
||||
content: " (tooltip)";
|
||||
}
|
||||
|
||||
.top,
|
||||
|
@ -24,7 +24,6 @@ export const useProjectsLoader = (deps?: [number]) => {
|
||||
if (deps) {
|
||||
setLastTs(deps[0])
|
||||
}
|
||||
|
||||
;(async () => {
|
||||
const { configuration } = await loadAndValidateSettings()
|
||||
const _projectsDir = await ensureProjectDirectoryExists(configuration)
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import './colors.css';
|
||||
@import "./colors.css";
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@ -131,13 +131,13 @@ input {
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family:
|
||||
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family:
|
||||
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -249,10 +249,10 @@ code {
|
||||
#code-mirror-override .cm-tooltip-autocomplete li {
|
||||
@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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
|
@ -122,9 +122,11 @@ export class KclManager {
|
||||
|
||||
private _isExecutingCallback: (arg: boolean) => void = () => {}
|
||||
private _astCallBack: (arg: Node<Program>) => void = () => {}
|
||||
private _variablesCallBack: (arg: {
|
||||
private _variablesCallBack: (
|
||||
arg: {
|
||||
[key in string]?: KclValue | undefined
|
||||
}) => void = () => {}
|
||||
}
|
||||
) => void = () => {}
|
||||
private _logsCallBack: (arg: string[]) => void = () => {}
|
||||
private _kclErrorsCallBack: (errors: KCLError[]) => void = () => {}
|
||||
private _diagnosticsCallback: (errors: Diagnostic[]) => void = () => {}
|
||||
|
@ -5,8 +5,8 @@ import { BSON } from 'bson'
|
||||
|
||||
import type { MachineManager } from '@src/components/MachineManagerProvider'
|
||||
import type { useModelingContext } from '@src/hooks/useModelingContext'
|
||||
import type CodeManager from '@src/lang/codeManager'
|
||||
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 { CommandLog } from '@src/lang/std/commandLog'
|
||||
import { CommandLogType } from '@src/lang/std/commandLog'
|
||||
|
@ -28,8 +28,8 @@ import type { UnitLen } from '@rust/kcl-lib/bindings/UnitLen'
|
||||
import { KCLError } from '@src/lang/errors'
|
||||
import { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils'
|
||||
import {
|
||||
defaultArtifactGraph,
|
||||
type Artifact,
|
||||
defaultArtifactGraph,
|
||||
} from '@src/lang/std/artifactGraph'
|
||||
import type { Coords2d } from '@src/lang/std/sketch'
|
||||
import {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { init, reloadModule } from '@src/lib/wasm_lib_wrapper'
|
||||
import fs from 'fs'
|
||||
import fsPromises from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { init, reloadModule } from '@src/lib/wasm_lib_wrapper'
|
||||
import fsPromises from 'fs/promises'
|
||||
|
||||
export const wasmUrlNode = () => {
|
||||
// In prod the file will be right next to the compiled js file.
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { Stats } from 'fs'
|
||||
import * as path from 'path'
|
||||
import {
|
||||
importFileExtensions,
|
||||
relevantFileExtensions,
|
||||
} from '@src/lang/wasmUtils'
|
||||
import type { Stats } from 'fs'
|
||||
import * as fs from 'fs/promises'
|
||||
import * as path from 'path'
|
||||
|
||||
import { PROJECT_ENTRYPOINT } from '@src/lib/constants'
|
||||
|
||||
|
@ -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 { getNodePathFromSourceRange } from '@src/lang/queryAstNodePathUtils'
|
||||
|
@ -15,7 +15,6 @@ import { createProfileStartHandle } from '@src/clientSideScene/segments'
|
||||
import type { MachineManager } from '@src/components/MachineManagerProvider'
|
||||
import type { ModelingMachineContext } from '@src/components/ModelingMachineProvider'
|
||||
import type { SidebarType } from '@src/components/ModelingSidebar/ModelingPanes'
|
||||
import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo'
|
||||
import {
|
||||
applyConstraintEqualAngle,
|
||||
equalAngleInfo,
|
||||
@ -42,6 +41,7 @@ import {
|
||||
applyConstraintHorzVertAlign,
|
||||
horzVertDistanceInfo,
|
||||
} from '@src/components/Toolbar/SetHorzVertDistance'
|
||||
import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo'
|
||||
import { createLiteral, createLocalName } from '@src/lang/create'
|
||||
import { updateModelingState } from '@src/lang/modelingWorkflows'
|
||||
import {
|
||||
|
@ -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
|
||||
// template that ElectronJS provides.
|
||||
// @ts-ignore: TS1343
|
||||
@ -18,9 +20,7 @@ import {
|
||||
systemPreferences,
|
||||
} from 'electron'
|
||||
import electronUpdater, { type AppUpdater } from 'electron-updater'
|
||||
import os from 'node:os'
|
||||
import { Issuer } from 'openid-client'
|
||||
import path from 'path'
|
||||
|
||||
import {
|
||||
argvFromYargs,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import os from 'node:os'
|
||||
import { modelingDesignRole } from '@src/menu/designRole'
|
||||
import { modelingEditRole, projectEditRole } from '@src/menu/editRole'
|
||||
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 type { BrowserWindow } from 'electron'
|
||||
import { Menu, app } from 'electron'
|
||||
import os from 'node:os'
|
||||
|
||||
const isMac = os.platform() === 'darwin'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { BrowserWindow } from 'electron'
|
||||
import os from 'node:os'
|
||||
import type { BrowserWindow } from 'electron'
|
||||
|
||||
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
||||
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { BrowserWindow } from 'electron'
|
||||
import os from 'node:os'
|
||||
import type { BrowserWindow } from 'electron'
|
||||
|
||||
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
||||
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { BrowserWindow } from 'electron'
|
||||
import os from 'node:os'
|
||||
import type { BrowserWindow } from 'electron'
|
||||
|
||||
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
||||
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
||||
|
@ -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 type { MachinesListing } from '@src/components/MachineManagerProvider'
|
||||
import chokidar from 'chokidar'
|
||||
import type { IpcRendererEvent } 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 { WebContentSendPayload } from '@src/menu/channels'
|
||||
|
@ -2,8 +2,8 @@ import { bracketWidthConstantLine } from '@src/lib/exampleKcl'
|
||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
||||
|
||||
import {
|
||||
kbdClasses,
|
||||
OnboardingButtons,
|
||||
kbdClasses,
|
||||
useDemoCode,
|
||||
} from '@src/routes/Onboarding/utils'
|
||||
|
||||
|
Reference in New Issue
Block a user