Compare commits

..

22 Commits

Author SHA1 Message Date
e4edffa569 bump kcl friends (#5993)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-25 11:05:17 -07:00
c28bad267a Add utilities to check platform to determine if a test should run (#5983)
* Add tests for utility to bypass unreliable tests

* Limit skip to just Windows

* Ignore unit tests from Playwright

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-25 13:24:41 -04:00
81f92bc7f9 Codify dependencies to run web end-to-end tests (#5926) 2025-03-25 10:35:49 -04:00
58dc3382eb Fix to update the code in the editor before executing (#5976)
* Fix spelling

* Fix to update the code in the editor before executing
2025-03-25 05:06:27 -04:00
f7f7d9fa2c Remove all tooltip delays throughout the app (#5969) 2025-03-24 22:58:54 -04:00
8c3408fda3 Fix: Ignore KCL changes when loading settings and fixed useEffect to use .current (#5126)
* fix: fixed use effect logic to use .current, fixed useEffect file watcher to not watch .kcl files when loading settings

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* bump

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* bump

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* bump

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: merge wrote this back...

* fix: deleted unused variable init

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* bump

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-03-24 23:23:12 +00:00
7c9f1248d4 Extract extrude to variables and format onboarding code (#5949)
* Extract extrude to variables and format onboarding code

* A snapshot a day keeps the bugs away! 📷🐛

* add spaces between sketches and extrudes

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: jgomez720 <114548659+jgomez720@users.noreply.github.com>
2025-03-24 17:10:41 -04:00
89dd4fb039 Add edge and segment selection in point-and-click Helix flow (#5866)
* WIP: Add edge and segment selection in point-and-click Helix flow
Fixes #5393

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Working edge based helix edit

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Add utility function for shared code between revolve and helix

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Use updateModelingState in codemod

* A snapshot a day keeps the bugs away! 📷🐛

* Add skip: true for edge helix to be consistent with axis as options

* A snapshot a day keeps the bugs away! 📷🐛

* Add support for sweepEdge and tests

* Lint

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Clean up snapshots

* Fix up tests after ccw change

* Use displayName: 'CounterClockWise' cause ccw not cutting it

* Fix tsc

* Update 2020 snapshots after helix change

* Update 2020 snapshots after helix change

* A snapshot a day keeps the bugs away! 📷🐛

* Another one :djkhaled:

* Clean up

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-24 16:08:19 -04:00
fdeb2b3f49 Feature: Implement read write access checking on Project Directory and report any issues in home page (#5676)
* chore: skeleton to detect read write directories and if we have access to notify user

* chore: adding buttont to easily change project directory

* chore: cleaning up home page error bar layout and button

* fix: adding clearer comments

* fix: ugly console debugging but I need to save off progress

* fix: removing project dir check on empty string

* fix: debug progress to save off listProjects once. Still bugged...

* fix: more hard coded debugging to get project loading optimizted

* fix: yarp, we got another one bois

* fix: cleaning up code

* fix: massive bug comment to warn devs about chokidar bugs

* fix: returning error instead of throwing

* fix: cleaning up PR

* fix: fixed loading the projects when the project directory changes

* fix: remove testing code

* fix: only skip directories if you can access the project directory since we don't need to view them

* fix: unit tests, turning off noisey localhost vitest garbage

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: deleted testing state

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-03-24 19:57:01 +00:00
65c455ae7c Use app token to sync 'all-e2e' branch (#5968) 2025-03-24 19:17:04 +00:00
c3e12e5ff7 Update 2020 snapshots after helix change (#5970)
* Update 2020 snapshots after helix change

* Another one :djkhaled:

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-24 14:28:01 -04:00
4dce1612c1 Bump the major group in /rust/kcl-language-server with 4 updates (#5966)
* Bump the major group in /rust/kcl-language-server with 4 updates

Bumps the major group in /rust/kcl-language-server with 4 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser), [@vscode/vsce](https://github.com/Microsoft/vsce) and [glob](https://github.com/isaacs/node-glob).


Updates `@typescript-eslint/eslint-plugin` from 6.21.0 to 8.27.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.27.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.21.0 to 8.27.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.27.0/packages/parser)

Updates `@vscode/vsce` from 2.30.0 to 3.3.0
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](https://github.com/Microsoft/vsce/compare/v2.30.0...v3.3.0)

Updates `glob` from 10.4.5 to 11.0.1
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.4.5...v11.0.1)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: "@vscode/vsce"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
...

Signed-off-by: dependabot[bot] <support@github.com>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-24 10:09:04 -07:00
1b98897120 Bump @types/node from 22.13.10 to 22.13.13 in /packages/codemirror-lsp-client in the patch group (#5962)
Bump @types/node in /packages/codemirror-lsp-client in the patch group

Bumps the patch group in /packages/codemirror-lsp-client with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 22.13.10 to 22.13.13
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 09:03:46 -04:00
3b2abe5814 Declare std kwarg functions in KCL and migrate circle (#5955)
* Support calling KCL std KW fns, and move circle to KCL std

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Doc comments on parameters

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Update grammar

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Change use of counterClockWise to ccw

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-24 21:55:24 +13:00
dddcd5ff46 Support paths to names rather than just raw idents (#5778)
* Support paths to names rather than just raw idents

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-24 20:58:55 +13:00
cfbb03765e Add fixme to a file-tree test (#5941) 2025-03-22 07:25:39 -04:00
0d0dd1019b Enable tests to run on pushes to 'all-e2e' branch (#5945)
* Enable tests to run on pushes to 'all-e2e' branch

* Document branch behavior
2025-03-22 01:55:54 +00:00
de2b1b3bea Fix so that only comments doesn't format to empty (#5944) 2025-03-22 00:56:04 +00:00
3464f93a30 fix: revert quick file write on refresh (#5943)
* fix: REVERT REVERT REVERT

* fix: one more unused remove

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Make sure connection is established before advancing settings theme test

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-03-21 17:33:43 -07:00
f6936f55d6 bump kcl friends (#5948)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-21 17:33:26 -07:00
eef1a28ebb Move helix revolutions into the main helix args (#5942)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updaes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-21 22:38:08 +00:00
5aed80e930 Switch to a variable that is set on pushes (#5940) 2025-03-21 20:00:07 +00:00
590 changed files with 91816 additions and 30356 deletions

2
.envrc
View File

@ -1 +1,3 @@
source_up_if_exists
use flake . use flake .

View File

@ -1,7 +1,9 @@
name: E2E Tests name: E2E Tests
on: on:
push: push:
branches: [ main ] branches:
- main
- all-e2e # this bypasses `fixme()` using `orRunWhenFullSuiteEnabled()`
pull_request: pull_request:
schedule: schedule:
- cron: 0 * * * * # hourly - cron: 0 * * * * # hourly
@ -15,7 +17,6 @@ permissions:
pull-requests: write pull-requests: write
actions: read actions: read
jobs: jobs:
conditions: conditions:
@ -67,14 +68,16 @@ jobs:
- name: Display conditions - name: Display conditions
shell: bash shell: bash
run: | run: |
# For debugging purposes. # For debugging purposes
set -euo pipefail set -euo pipefail
echo "GITHUB_REF: $GITHUB_REF"
echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF"
echo "GITHUB_BASE_REF: $GITHUB_BASE_REF"
echo "significant: ${{ steps.path-changes.outputs.significant }}" echo "significant: ${{ steps.path-changes.outputs.significant }}"
echo "should-run: ${{ steps.should-run.outputs.should-run }}" echo "should-run: ${{ steps.should-run.outputs.should-run }}"
prepare-wasm: prepare-wasm:
# seperate job on Ubuntu to build or fetch the wasm blob once on the fastest runner # separate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64 runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
needs: conditions needs: conditions
steps: steps:
@ -159,7 +162,6 @@ jobs:
name: prepared-wasm name: prepared-wasm
path: | path: |
rust/kcl-wasm-lib/pkg/kcl_wasm_lib* rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
snapshots: snapshots:
name: playwright:snapshots:ubuntu name: playwright:snapshots:ubuntu
@ -243,7 +245,7 @@ jobs:
retention-days: 30 retention-days: 30
overwrite: true overwrite: true
- name: check for changes - name: Check for changes
if: ${{ needs.conditions.outputs.should-run == 'true' && github.ref != 'refs/heads/main' }} if: ${{ needs.conditions.outputs.should-run == 'true' && github.ref != 'refs/heads/main' }}
shell: bash shell: bash
id: git-check id: git-check

View File

@ -141,13 +141,13 @@ jobs:
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }} if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn playwright install chromium --with-deps run: yarn playwright install chromium --with-deps
- name: run unit tests - name: Run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }} if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: xvfb-run -a yarn test:unit run: xvfb-run -a yarn test:unit
env: env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
- name: check for changes - name: Check for changes
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }} if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
id: git-check id: git-check
run: | run: |

View File

@ -14,10 +14,19 @@ permissions:
jobs: jobs:
update-branch: update-branch:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- shell: bash with:
token: ${{ steps.app-token.outputs.token }}
- name: Sync with main
run: | run: |
# checkout our branch # checkout our branch
git checkout all-e2e || git checkout -b all-e2e git checkout all-e2e || git checkout -b all-e2e
@ -26,4 +35,5 @@ jobs:
# reset to main # reset to main
git reset --hard origin/main git reset --hard origin/main
# force push it # force push it
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
git push --force origin all-e2e git push --force origin all-e2e

View File

@ -20,8 +20,12 @@ $(WASM_PACK):
############################################################################### ###############################################################################
# BUILD # BUILD
RUST_SOURCES := $(wildcard rust/*) $(wildcard rust/**/*) CARGO_SOURCES := rust/.cargo/config.toml $(wildcard rust/Cargo.*) $(wildcard rust/**/Cargo.*)
TYPESCRIPT_SOURCES := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts) RUST_SOURCES := $(wildcard rust/**/*.rs)
REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
.PHONY: build .PHONY: build
build: build-web build-desktop build: build-web build-desktop
@ -32,13 +36,13 @@ build-web: public/kcl_wasm_lib_bg.wasm build/index.html
.PHONY: build-desktop .PHONY: build-desktop
build-desktop: public/kcl_wasm_lib_bg.wasm .vite/build/main.js build-desktop: public/kcl_wasm_lib_bg.wasm .vite/build/main.js
public/kcl_wasm_lib_bg.wasm: $(RUST_SOURCES) public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES)$(RUST_SOURCES)
yarn build:wasm yarn build:wasm
build/index.html: $(TYPESCRIPT_SOURCES) build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
yarn build:local yarn build:local
.vite/build/main.js: $(TYPESCRIPT_SOURCES) .vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
yarn tronb:vite:dev yarn tronb:vite:dev
############################################################################### ###############################################################################
@ -73,19 +77,29 @@ run-desktop: install build-desktop ## Start the desktop app
############################################################################### ###############################################################################
# TEST # TEST
GREP ?= "" E2E_WORKERS ?= 1
E2E_FAILURES ?= 1
E2E_GREP ?= ""
.PHONY: test .PHONY: test
test: test-unit test-e2e test: test-unit test-e2e
.PHONY: test-unit .PHONY: test-unit
test-unit: install ## Run the unit tests test-unit: install ## Run the unit tests
@ nc -z localhost 3000 || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 ) @ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
yarn test:unit yarn test:unit
.PHONY: test-e2e .PHONY: test-e2e
test-e2e: install build-desktop ## Run the e2e tests test-e2e: test-e2e-desktop
yarn test:playwright:electron --workers=1 --grep=$(GREP)
.PHONY: test-e2e-web
test-e2e-web: install build-web ## Run the web e2e tests
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
yarn chrome:test --headed --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
.PHONY: test-e2e-desktop
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
yarn test:playwright:electron --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
############################################################################### ###############################################################################
# CLEAN # CLEAN

File diff suppressed because one or more lines are too long

View File

@ -10,10 +10,10 @@ Construct a circle derived from 3 points.
```js ```js
circleThreePoint( circleThreePoint(
sketchSurfaceOrGroup: SketchOrSurface,
p1: [number], p1: [number],
p2: [number], p2: [number],
p3: [number], p3: [number],
sketchSurfaceOrGroup: SketchOrSurface,
tag?: TagDeclarator, tag?: TagDeclarator,
): Sketch ): Sketch
``` ```
@ -23,10 +23,10 @@ circleThreePoint(
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes | | `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes | | `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes | | `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No | | [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
### Returns ### Returns

View File

@ -15,7 +15,7 @@ std::math::E: number = 2.71828182845904523536028747135266250_
### Examples ### Examples
```js ```js
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ |> angledLine({
angle = 30, angle = 30,

View File

@ -17,7 +17,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_
```js ```js
circumference = 70 circumference = 70
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> circle(center = [0, 0], radius = circumference/ (2 * PI)) |> circle(center = [0, 0], radius = circumference/ (2 * PI))
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -15,7 +15,7 @@ std::math::TAU: number = 6.28318530717958647692528676655900577_
### Examples ### Examples
```js ```js
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ |> angledLine({
angle = 50, angle = 50,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -61,7 +61,6 @@ layout: manual
* [`bezierCurve`](kcl/bezierCurve) * [`bezierCurve`](kcl/bezierCurve)
* [`ceil`](kcl/ceil) * [`ceil`](kcl/ceil)
* [`chamfer`](kcl/chamfer) * [`chamfer`](kcl/chamfer)
* [`circle`](kcl/circle)
* [`circleThreePoint`](kcl/circleThreePoint) * [`circleThreePoint`](kcl/circleThreePoint)
* [`close`](kcl/close) * [`close`](kcl/close)
* [`cm`](kcl/cm) * [`cm`](kcl/cm)
@ -74,7 +73,6 @@ layout: manual
* [`getOppositeEdge`](kcl/getOppositeEdge) * [`getOppositeEdge`](kcl/getOppositeEdge)
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
* [`helix`](kcl/helix) * [`helix`](kcl/helix)
* [`helixRevolutions`](kcl/helixRevolutions)
* [`hole`](kcl/hole) * [`hole`](kcl/hole)
* [`hollow`](kcl/hollow) * [`hollow`](kcl/hollow)
* [`inch`](kcl/inch) * [`inch`](kcl/inch)
@ -146,3 +144,5 @@ layout: manual
* [`cos`](kcl/std-math-cos) * [`cos`](kcl/std-math-cos)
* [`sin`](kcl/std-math-sin) * [`sin`](kcl/std-math-sin)
* [`tan`](kcl/std-math-tan) * [`tan`](kcl/std-math-tan)
* **std::sketch**
* [`circle`](kcl/std-sketch-circle)

View File

@ -9,7 +9,7 @@ Compute the cosine of a number (in radians).
```js ```js
cos(num: number(rad)): number(_) cos(@num: number(rad)): number(_)
``` ```
@ -27,7 +27,7 @@ cos(num: number(rad)): number(_)
### Examples ### Examples
```js ```js
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ |> angledLine({
angle = 30, angle = 30,

View File

@ -9,7 +9,7 @@ Compute the sine of a number (in radians).
```js ```js
sin(num: number(rad)): number(_) sin(@num: number(rad)): number(_)
``` ```
@ -27,7 +27,7 @@ sin(num: number(rad)): number(_)
### Examples ### Examples
```js ```js
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ |> angledLine({
angle = 50, angle = 50,

View File

@ -9,7 +9,7 @@ Compute the tangent of a number (in radians).
```js ```js
tan(num: number(rad)): number(_) tan(@num: number(rad)): number(_)
``` ```
@ -27,7 +27,7 @@ tan(num: number(rad)): number(_)
### Examples ### Examples
```js ```js
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ |> angledLine({
angle = 50, angle = 50,

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@ A helix.
| `revolutions` |[`number`](/docs/kcl/types/number)| Number of revolutions. | No | | `revolutions` |[`number`](/docs/kcl/types/number)| Number of revolutions. | No |
| `angleStart` |[`number`](/docs/kcl/types/number)| Start angle (in degrees). | No | | `angleStart` |[`number`](/docs/kcl/types/number)| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No | | `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
| `cylinderId` |[`string`](/docs/kcl/types/string)| The cylinder the helix was created on. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No | | `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |

View File

@ -10,8 +10,8 @@ A point in two dimensional space.
type Point2d = [number; 2] type Point2d = [number; 2]
``` ```
`Point2d` is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value [`Point2d`](/docs/kcl/types/Point2d) is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value
with type `Point2d`, use an array, e.g., `[0, 0]` or `[5.0, 3.14]`. with type [`Point2d`](/docs/kcl/types/Point2d), use an array, e.g., `[0, 0]` or `[5.0, 3.14]`.

View File

@ -10,8 +10,8 @@ A point in three dimensional space.
type Point3d = [number; 3] type Point3d = [number; 3]
``` ```
`Point3d` is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value [`Point3d`](/docs/kcl/types/Point3d) is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value
with type `Point3d`, use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`. with type [`Point3d`](/docs/kcl/types/Point3d), use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`.

View File

@ -17,7 +17,7 @@ mySketch = startSketchOn('XY')
|> close() |> close()
``` ```
The `mySketch` variable will be an executed `Sketch` object. Executed being past The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past
tense, because the engine has already executed the commands to create the sketch. tense, because the engine has already executed the commands to create the sketch.
The previous sketch commands will never be executed again, in this case. The previous sketch commands will never be executed again, in this case.

View File

@ -18,7 +18,7 @@ myPart = startSketchOn('XY')
|> extrude(length = 6) |> extrude(length = 6)
``` ```
The `myPart` variable will be an executed `Solid` object. Executed being past The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past
tense, because the engine has already executed the commands to create the solid. tense, because the engine has already executed the commands to create the solid.
The previous solid commands will never be executed again, in this case. The previous solid commands will never be executed again, in this case.

View File

@ -85,7 +85,7 @@ async function doBasicSketch(
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(u.codeLocator)
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(length = ${commonPoints.num1}) |> xLine(length = ${commonPoints.num1})
@ -145,7 +145,7 @@ async function doBasicSketch(
// Open the code pane. // Open the code pane.
await u.openKclCodePanel() await u.openKclCodePanel()
await expect(u.codeLocator) await expect(u.codeLocator)
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`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

@ -46,7 +46,7 @@ test.describe(
}, },
} }
const code = `@settings(defaultLengthUnit = in)sketch001 = startSketchOn('${plane}')profile001 = startProfileAt([0.91, -1.22], sketch001)` const code = `sketch001 = startSketchOn(${plane})profile001 = startProfileAt([0.91, -1.22], sketch001)`
await u.openDebugPanel() await u.openDebugPanel()

View File

@ -250,11 +250,11 @@ test(
]) ])
await Promise.all([ await Promise.all([
fsp.copyFile( fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('router-template-slate.kcl'),
join(routerTemplateDir, 'main.kcl') join(routerTemplateDir, 'main.kcl')
), ),
fsp.copyFile( fsp.copyFile(
executorInputPath('e2e-can-sketch-on-chamfer.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
join(bracketDir, 'main.kcl') join(bracketDir, 'main.kcl')
), ),
]) ])

View File

@ -20,11 +20,11 @@ test(
await Promise.all([fsp.mkdir(bracketDir, { recursive: true })]) await Promise.all([fsp.mkdir(bracketDir, { recursive: true })])
await Promise.all([ await Promise.all([
fsp.copyFile( fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('router-template-slate.kcl'),
path.join(bracketDir, 'other.kcl') path.join(bracketDir, 'other.kcl')
), ),
fsp.copyFile( fsp.copyFile(
executorInputPath('e2e-can-sketch-on-chamfer.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
), ),
]) ])
@ -107,7 +107,7 @@ test(
}, },
{ timeout: 15_000 } { timeout: 15_000 }
) )
.toBeGreaterThan(30_000) .toBeGreaterThan(300_000)
}) })
}) })
@ -187,7 +187,7 @@ test(
}, },
{ timeout: 15_000 } { timeout: 15_000 }
) )
.toBeGreaterThan(50_000) .toBeGreaterThan(70_000)
}) })
}) })
} }

View File

@ -32,30 +32,26 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
await page.keyboard.press('/') await page.keyboard.press('/')
await page.keyboard.up('ControlOrMeta') await page.keyboard.up('ControlOrMeta')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch001 = startSketchOn(XY)
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])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
// |> close()`.replaceAll('\n', '') // |> close()`)
)
// uncomment the code // uncomment the code
await page.keyboard.down('ControlOrMeta') await page.keyboard.down('ControlOrMeta')
await page.keyboard.press('/') await page.keyboard.press('/')
await page.keyboard.up('ControlOrMeta') await page.keyboard.up('ControlOrMeta')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch001 = startSketchOn(XY)
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])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close()`.replaceAll('\n', '') |> close()`)
)
}) })
test('ensure we use the cache, and do not re-execute', async ({ test('ensure we use the cache, and do not re-execute', async ({
@ -182,15 +178,13 @@ sketch001 = startSketchOn('XY')
await page.locator('#code-pane button:first-child').click() await page.locator('#code-pane button:first-child').click()
await page.locator('button:has-text("Format code")').click() await page.locator('button:has-text("Format code")').click()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch001 = startSketchOn(XY)
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])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close()`.replaceAll('\n', '') |> close()`)
)
}) })
test('if you click the format button it formats your code and executes so lints are still there', async ({ test('if you click the format button it formats your code and executes so lints are still there', async ({
@ -233,15 +227,13 @@ sketch001 = 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')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch_001 = startSketchOn(XY)
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])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close()`.replaceAll('\n', '') |> close()`)
)
// error in guter // error in guter
await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible() await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible()
@ -823,12 +815,10 @@ sketch_001 = startSketchOn('XY')
// there shouldn't be any auto complete options for 'lin' in the comment // there shouldn't be any auto complete options for 'lin' in the comment
await expect(page.locator('.cm-completionLabel')).not.toBeVisible() await expect(page.locator('.cm-completionLabel')).not.toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn('XZ')
|> startProfileAt([3.14, 12], %) |> startProfileAt([3.14, 12], %)
|> xLine(%, length = 5) // lin`.replaceAll('\n', '') |> xLine(%, length = 5) // lin`)
)
// expect there to be no KCL errors // expect there to be no KCL errors
await expect(page.locator('.cm-lint-marker-error')).toHaveCount(0) await expect(page.locator('.cm-lint-marker-error')).toHaveCount(0)
@ -898,12 +888,10 @@ sketch001 = startSketchOn('XZ')
// there shouldn't be any auto complete options for 'lin' in the comment // there shouldn't be any auto complete options for 'lin' in the comment
await expect(page.locator('.cm-completionLabel')).not.toBeVisible() await expect(page.locator('.cm-completionLabel')).not.toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content'))
`@settings(defaultLengthUnit = in) .toHaveText(`sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn('XZ')
|> startProfileAt([3.14, 12], %) |> startProfileAt([3.14, 12], %)
|> xLine(%, length = 5) // lin`.replaceAll('\n', '') |> xLine(%, length = 5) // lin`)
)
}) })
}) })
test('Can undo a click and point extrude with ctrl+z', async ({ test('Can undo a click and point extrude with ctrl+z', async ({

View File

@ -6,6 +6,7 @@ import {
executorInputPath, executorInputPath,
getUtils, getUtils,
orRunWhenFullSuiteEnabled, orRunWhenFullSuiteEnabled,
runningOnWindows,
} from './test-utils' } from './test-utils'
import { join } from 'path' import { join } from 'path'
import { FILE_EXT } from 'lib/constants' import { FILE_EXT } from 'lib/constants'
@ -15,6 +16,9 @@ test.describe('integrations tests', () => {
'Creating a new file or switching file while in sketchMode should exit sketchMode', 'Creating a new file or switching file while in sketchMode should exit sketchMode',
{ tag: '@electron' }, { tag: '@electron' },
async ({ page, context, homePage, scene, editor, toolbar, cmdBar }) => { async ({ page, context, homePage, scene, editor, toolbar, cmdBar }) => {
if (runningOnWindows()) {
test.fixme(orRunWhenFullSuiteEnabled())
}
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const bracketDir = join(dir, 'test-sample') const bracketDir = join(dir, 'test-sample')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })

View File

@ -310,9 +310,7 @@ export async function expectPixelColor(
.toBeTruthy() .toBeTruthy()
.catch((cause) => { .catch((cause) => {
throw new Error( throw new Error(
`ExpectPixelColor: point ${JSON.stringify( `ExpectPixelColor: expecting ${colour} got ${finalValue}`,
coords
)} was expecting ${colour} but got ${finalValue}`,
{ cause } { cause }
) )
}) })

View File

@ -11,7 +11,7 @@ test(
const bracketDir = join(dir, 'bracket') const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
join(bracketDir, 'main.kcl') join(bracketDir, 'main.kcl')
) )
}) })
@ -51,7 +51,7 @@ test(
const bracketDir = join(dir, 'bracket') const bracketDir = join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
join(bracketDir, 'main.kcl') join(bracketDir, 'main.kcl')
) )
}) })

View File

@ -137,7 +137,7 @@ test.describe('Point-and-click tests', () => {
await scene.moveCameraTo(cameraPos, cameraTarget) await scene.moveCameraTo(cameraPos, cameraTarget)
await test.step('check chamfer selection changes cursor position', async () => { await test.step('check chamfer selection changes cursor positon', async () => {
await expect(async () => { await expect(async () => {
// sometimes initial click doesn't register // sometimes initial click doesn't register
await clickChamfer() await clickChamfer()
@ -173,7 +173,7 @@ test.describe('Point-and-click tests', () => {
}) })
await test.step('Check there is no errors after code created in previous steps executes', async () => { await test.step('Check there is no errors after code created in previous steps executes', async () => {
await editor.expectState({ await editor.expectState({
activeLines: ['@settings(defaultLengthUnit = in)'], activeLines: ['sketch001 = startSketchOn(XZ)'],
highlightedCode: '', highlightedCode: '',
diagnostics: [], diagnostics: [],
}) })
@ -299,8 +299,7 @@ test.describe('Point-and-click tests', () => {
await test.step('verify at the end of the test that final code is what is expected', async () => { await test.step('verify at the end of the test that final code is what is expected', async () => {
await editor.expectEditor.toContain( await editor.expectEditor.toContain(
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag] |> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|> angledLine([0, 268.43], %, $rectangleSegmentA001) |> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([ |> angledLine([
@ -370,7 +369,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
}) })
}) })
test('Works on chamfers that are not in a pipeExpression can break up multi edges in a chamfer array', async ({ test('Works on chamfers that are non in a pipeExpression can break up multi edges in a chamfer array', async ({
context, context,
page, page,
homePage, homePage,
@ -419,8 +418,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|>close()`, |>close()`,
}) })
await editor.expectEditor.toContain( await editor.expectEditor.toContain(
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) |> startProfileAt([75.8, 317.2], %)
|> angledLine([0, 268.43], %, $rectangleSegmentA001) |> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([ |> angledLine([
@ -1073,7 +1071,7 @@ openSketch = startSketchOn(XY)
}) })
}) })
test('Helix point-and-click', async ({ test('Helix point-and-click on default axis', async ({
context, context,
page, page,
homePage, homePage,
@ -1084,29 +1082,26 @@ openSketch = startSketchOn(XY)
}) => { }) => {
// One dumb hardcoded screen pixel value // One dumb hardcoded screen pixel value
const testPoint = { x: 620, y: 257 } const testPoint = { x: 620, y: 257 }
const expectedOutput = `helix001 = helix( revolutions = 1, angleStart = 360, counterClockWise = false, radius = 5, axis = 'X', length = 5,)` const expectedOutput = `helix001 = helix( revolutions = 1, angleStart = 360, ccw = false, radius = 5, axis = 'X', length = 5,)`
const expectedLine = `revolutions=1,` const expectedLine = `revolutions=1,`
await homePage.goToModelingScene() await homePage.goToModelingScene()
// await test.step(`Look for the red of the default plane`, async () => {
// await scene.expectPixelColor([96, 52, 52], testPoint, 15)
// })
await test.step(`Go through the command bar flow`, async () => { await test.step(`Go through the command bar flow`, async () => {
await toolbar.helixButton.click() await toolbar.helixButton.click()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'revolutions', currentArgKey: 'axisOrEdge',
currentArgValue: '1', currentArgValue: '',
headerArguments: { headerArguments: {
AngleStart: '', AngleStart: '',
Axis: '', AxisOrEdge: '',
CounterClockWise: '', CounterClockWise: '',
Length: '', Length: '',
Radius: '', Radius: '',
Revolutions: '', Revolutions: '',
}, },
highlightedHeaderArg: 'revolutions', highlightedHeaderArg: 'axisOrEdge',
commandName: 'Helix', commandName: 'Helix',
}) })
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -1116,6 +1111,7 @@ openSketch = startSketchOn(XY)
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
}) })
await test.step(`Confirm code is added to the editor, scene has changed`, async () => { await test.step(`Confirm code is added to the editor, scene has changed`, async () => {
@ -1181,6 +1177,165 @@ openSketch = startSketchOn(XY)
}) })
}) })
const helixCases = [
{
selectionType: 'segment',
testPoint: { x: 513, y: 221 },
expectedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = seg01, length = 100,)`,
expectedEditedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = seg01, length = 50,)`,
},
{
selectionType: 'sweepEdge',
testPoint: { x: 564, y: 364 },
expectedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = getOppositeEdge(seg01), length = 100,)`,
expectedEditedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = getOppositeEdge(seg01), length = 50,)`,
},
]
helixCases.map(
({ selectionType, testPoint, expectedOutput, expectedEditedOutput }) => {
test(`Helix point-and-click around ${selectionType}`, async ({
context,
page,
homePage,
scene,
editor,
toolbar,
cmdBar,
}) => {
page.on('console', console.log)
const initialCode = `sketch001 = startSketchOn('XZ')
profile001 = startProfileAt([0, 0], sketch001)
|> yLine(length = 100)
|> line(endAbsolute = [100, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(profile001, length = 100)`
// One dumb hardcoded screen pixel value
const [clickOnEdge] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
await context.addInitScript((initialCode) => {
localStorage.setItem('persistCode', initialCode)
}, initialCode)
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene()
await test.step(`Go through the command bar flow`, async () => {
await toolbar.closePane('code')
await toolbar.helixButton.click()
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'axisOrEdge',
currentArgValue: '',
headerArguments: {
AngleStart: '',
AxisOrEdge: '',
CounterClockWise: '',
Length: '',
Radius: '',
Revolutions: '',
},
highlightedHeaderArg: 'axisOrEdge',
commandName: 'Helix',
})
await cmdBar.selectOption({ name: 'Edge' }).click()
await clickOnEdge()
await cmdBar.progressCmdBar()
await cmdBar.argumentInput.focus()
await page.keyboard.insertText('20')
await cmdBar.progressCmdBar()
await page.keyboard.insertText('0')
await cmdBar.progressCmdBar()
await cmdBar.selectOption({ name: 'True' }).click()
await page.keyboard.insertText('1')
await cmdBar.progressCmdBar()
await page.keyboard.insertText('100')
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
AngleStart: '0',
AxisOrEdge: 'Edge',
Edge: `1 ${selectionType}`,
CounterClockWise: '',
Length: '100',
Radius: '1',
Revolutions: '20',
},
commandName: 'Helix',
})
await cmdBar.progressCmdBar()
})
await test.step(`Confirm code is added to the editor, scene has changed`, async () => {
await toolbar.openPane('code')
await editor.expectEditor.toContain(expectedOutput)
await toolbar.closePane('code')
})
await test.step(`Edit helix through the feature tree`, async () => {
await toolbar.openPane('feature-tree')
const operationButton = await toolbar.getFeatureTreeOperation(
'Helix',
0
)
await operationButton.dblclick()
const initialInput = '100'
const newInput = '50'
await cmdBar.expectState({
commandName: 'Helix',
stage: 'arguments',
currentArgKey: 'length',
currentArgValue: initialInput,
headerArguments: {
AngleStart: '0',
CounterClockWise: '',
Length: initialInput,
Radius: '1',
Revolutions: '20',
},
highlightedHeaderArg: 'length',
})
await expect(cmdBar.currentArgumentInput).toBeVisible()
await cmdBar.currentArgumentInput
.locator('.cm-content')
.fill(newInput)
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
AngleStart: '0',
CounterClockWise: '',
Length: newInput,
Radius: '1',
Revolutions: '20',
},
commandName: 'Helix',
})
await cmdBar.progressCmdBar()
await toolbar.closePane('feature-tree')
await toolbar.openPane('code')
await editor.expectEditor.toContain(expectedEditedOutput)
await toolbar.closePane('code')
})
await test.step('Delete helix via feature tree selection', async () => {
await toolbar.openPane('feature-tree')
const operationButton = await toolbar.getFeatureTreeOperation(
'Helix',
0
)
await operationButton.click({ button: 'left' })
await page.keyboard.press('Delete')
await editor.expectEditor.not.toContain(expectedEditedOutput)
await expect(
await toolbar.getFeatureTreeOperation('Helix', 0)
).not.toBeVisible()
})
})
}
)
const loftPointAndClickCases = [ const loftPointAndClickCases = [
{ shouldPreselect: true }, { shouldPreselect: true },
{ shouldPreselect: false }, { shouldPreselect: false },
@ -1342,8 +1497,7 @@ loft001 = loft([sketch001, sketch002])
{ {
targetType: 'circle', targetType: 'circle',
testPoint: { x: 700, y: 250 }, testPoint: { x: 700, y: 250 },
initialCode: `@settings(defaultLengthUnit = in) initialCode: `sketch001 = startSketchOn('YZ')
sketch001 = startSketchOn('YZ')
profile001 = circle(sketch001, center = [0, 0], radius = 500) profile001 = circle(sketch001, center = [0, 0], radius = 500)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
@ -1353,8 +1507,7 @@ sketch002 = startSketchOn('XZ')
{ {
targetType: 'rectangle', targetType: 'rectangle',
testPoint: { x: 710, y: 255 }, testPoint: { x: 710, y: 255 },
initialCode: `@settings(defaultLengthUnit = in) initialCode: `sketch001 = startSketchOn('YZ')
sketch001 = startSketchOn('YZ')
profile001 = startProfileAt([-400, -400], sketch001) profile001 = startProfileAt([-400, -400], sketch001)
|> angledLine([0, 800], %, $rectangleSegmentA001) |> angledLine([0, 800], %, $rectangleSegmentA001)
|> angledLine([ |> angledLine([
@ -1511,8 +1664,7 @@ sketch002 = startSketchOn('XZ')
toolbar, toolbar,
cmdBar, cmdBar,
}) => { }) => {
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(YZ)
sketch001 = startSketchOn(YZ)
|> circle( |> circle(
center = [0, 0], center = [0, 0],
radius = 500 radius = 500
@ -2079,8 +2231,7 @@ extrude001 = extrude(profile001, length = 5)
cmdBar, cmdBar,
}) => { }) => {
// Code samples // Code samples
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(XY)
sketch001 = startSketchOn(XY)
|> startProfileAt([-12, -6], %) |> startProfileAt([-12, -6], %)
|> line(end = [0, 12]) |> line(end = [0, 12])
|> line(end = [24, 0]) |> line(end = [24, 0])
@ -2304,8 +2455,7 @@ extrude001 = extrude(sketch001, length = -12)
toolbar, toolbar,
}) => { }) => {
// Code samples // Code samples
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(XY)
sketch001 = startSketchOn(XY)
|> startProfileAt([-12, -6], %) |> startProfileAt([-12, -6], %)
|> line(end = [0, 12]) |> line(end = [0, 12])
|> line(end = [24, 0], tag = $seg02) |> line(end = [24, 0], tag = $seg02)
@ -2459,8 +2609,7 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
toolbar, toolbar,
cmdBar, cmdBar,
}) => { }) => {
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 30) |> circle(center = [0, 0], radius = 30)
extrude001 = extrude(sketch001, length = 30) extrude001 = extrude(sketch001, length = 30)
` `
@ -2595,8 +2744,7 @@ extrude001 = extrude(sketch001, length = 30)
toolbar, toolbar,
cmdBar, cmdBar,
}) => { }) => {
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(XY)
sketch001 = startSketchOn(XY)
|> startProfileAt([-20, 20], %) |> startProfileAt([-20, 20], %)
|> xLine(length = 40) |> xLine(length = 40)
|> yLine(length = -60) |> yLine(length = -60)
@ -2714,8 +2862,7 @@ extrude001 = extrude(sketch001, length = 40)
}) })
const shellSketchOnFacesCases = [ const shellSketchOnFacesCases = [
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100) |> circle(center = [0, 0], radius = 100)
|> extrude(length = 100) |> extrude(length = 100)
@ -2723,8 +2870,7 @@ sketch002 = startSketchOn(sketch001, 'END')
|> circle(center = [0, 0], radius = 50) |> circle(center = [0, 0], radius = 50)
|> extrude(length = 50) |> extrude(length = 50)
`, `,
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100) |> circle(center = [0, 0], radius = 100)
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
@ -3120,8 +3266,7 @@ radius = 8.69
toolbar, toolbar,
cmdBar, cmdBar,
}) => { }) => {
const initialCode = `@settings(defaultLengthUnit = in) const initialCode = `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
profile001 = circle( profile001 = circle(
sketch001, sketch001,
center = [0, 0], center = [0, 0],

View File

@ -86,7 +86,7 @@ test(
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
}) })
@ -123,7 +123,7 @@ test(
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
const errorDir = path.join(dir, 'broken-code') const errorDir = path.join(dir, 'broken-code')
@ -191,7 +191,7 @@ test(
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-error') await page.hover('.cm-lint-marker-error')
const crypticErrorText = `Expected a tag declarator` const crypticErrorText = `The arg tag was given, but it was the wrong type`
await expect(page.getByText(crypticErrorText).first()).toBeVisible() await expect(page.getByText(crypticErrorText).first()).toBeVisible()
// black pixel means the scene has been cleared. // black pixel means the scene has been cleared.
@ -212,7 +212,7 @@ test(
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
const emptyDir = path.join(dir, 'empty') const emptyDir = path.join(dir, 'empty')
@ -289,7 +289,7 @@ test(
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
@ -355,7 +355,7 @@ test(
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
await fsp.copyFile( await fsp.copyFile(
@ -409,7 +409,7 @@ test(
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-error') await page.hover('.cm-lint-marker-error')
const crypticErrorText = `Expected a tag declarator` const crypticErrorText = `The arg tag was given, but it was the wrong type`
await expect(page.getByText(crypticErrorText).first()).toBeVisible() await expect(page.getByText(crypticErrorText).first()).toBeVisible()
// black pixel means the scene has been cleared. // black pixel means the scene has been cleared.
@ -453,7 +453,7 @@ test(
// error text on hover // error text on hover
await page.hover('.cm-lint-marker-error') await page.hover('.cm-lint-marker-error')
const crypticErrorText = `Expected a tag declarator` const crypticErrorText = `The arg tag was given, but it was the wrong type`
await expect(page.getByText(crypticErrorText).first()).toBeVisible() await expect(page.getByText(crypticErrorText).first()).toBeVisible()
} }
) )
@ -474,7 +474,7 @@ test.describe('Can export from electron app', () => {
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
}) })
@ -1497,12 +1497,7 @@ test(
await u.waitForPageLoad() await u.waitForPageLoad()
// The file should be prepopulated with the user's unit settings. await page.locator('.cm-content').fill(`sketch001 = startSketchOn(XZ)
await expect(page.locator('.cm-content')).toHaveText(
'@settings(defaultLengthUnit = in)'
)
await page.locator('.cm-content').fill(`sketch001 = startSketchOn('XZ')
|> startProfileAt([-87.4, 282.92], %) |> startProfileAt([-87.4, 282.92], %)
|> line(end = [324.07, 27.199], tag = $seg01) |> line(end = [324.07, 27.199], tag = $seg01)
|> line(end = [118.328, -291.754]) |> line(end = [118.328, -291.754])

View File

@ -4,9 +4,9 @@ import path from 'path'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
import { import {
getUtils, getUtils,
executorInputPath,
TEST_COLORS, TEST_COLORS,
TestColor, TestColor,
executorInputPath,
orRunWhenFullSuiteEnabled, orRunWhenFullSuiteEnabled,
} from './test-utils' } from './test-utils'
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates' import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
@ -582,7 +582,7 @@ extrude002 = extrude(profile002, length = 150)
const bracketDir = path.join(dir, 'bracket') const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
path.join(bracketDir, 'main.kcl') path.join(bracketDir, 'main.kcl')
) )
}) })
@ -632,13 +632,12 @@ extrude002 = extrude(profile002, length = 150)
await test.step(`Load an empty file`, async () => { await test.step(`Load an empty file`, async () => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem('persistCode', '@settings(defaultLengthUnit = in)') localStorage.setItem('persistCode', '')
}) })
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await u.closeKclCodePanel() await u.closeKclCodePanel()
await page.waitForTimeout(20)
}) })
await test.step(`Zoom out until you can't see the default planes`, async () => { await test.step(`Zoom out until you can't see the default planes`, async () => {
@ -647,14 +646,13 @@ extrude002 = extrude(profile002, length = 150)
timeout: 5000, timeout: 5000,
message: 'Plane color is visible', message: 'Plane color is visible',
}) })
.toBeLessThanOrEqual(20) .toBeLessThanOrEqual(15)
let maxZoomOuts = 10 let maxZoomOuts = 10
let middlePixelIsBackgroundColor = let middlePixelIsBackgroundColor =
(await middlePixelIsColor(bgColor)) < 10 (await middlePixelIsColor(bgColor)) < 10
while (!middlePixelIsBackgroundColor && maxZoomOuts > 0) { while (!middlePixelIsBackgroundColor && maxZoomOuts > 0) {
await page.keyboard.down('Control') await page.keyboard.down('Control')
await page.waitForTimeout(20)
await page.mouse.move(600, 460) await page.mouse.move(600, 460)
await page.mouse.down({ button: 'right' }) await page.mouse.down({ button: 'right' })
await page.mouse.move(600, 50, { steps: 20 }) await page.mouse.move(600, 50, { steps: 20 })
@ -662,7 +660,7 @@ extrude002 = extrude(profile002, length = 150)
await page.keyboard.up('Control') await page.keyboard.up('Control')
await page.waitForTimeout(100) await page.waitForTimeout(100)
maxZoomOuts-- maxZoomOuts--
middlePixelIsBackgroundColor = (await middlePixelIsColor(bgColor)) < 15 middlePixelIsBackgroundColor = (await middlePixelIsColor(bgColor)) < 10
} }
expect(middlePixelIsBackgroundColor, { expect(middlePixelIsBackgroundColor, {
@ -680,12 +678,13 @@ extrude002 = extrude(profile002, length = 150)
homePage, homePage,
scene, scene,
toolbar, toolbar,
viewport,
}) => { }) => {
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const legoDir = path.join(dir, 'lego') const legoDir = path.join(dir, 'lego')
await fsp.mkdir(legoDir, { recursive: true }) await fsp.mkdir(legoDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('e2e-can-sketch-on-chamfer.kcl'), executorInputPath('lego.kcl'),
path.join(legoDir, 'main.kcl') path.join(legoDir, 'main.kcl')
) )
}) })
@ -698,8 +697,11 @@ extrude002 = extrude(profile002, length = 150)
await scene.loadingIndicator.waitFor({ state: 'detached' }) await scene.loadingIndicator.waitFor({ state: 'detached' })
}) })
await test.step(`The part should start loading quickly, not waiting until execution is complete`, async () => { await test.step(`The part should start loading quickly, not waiting until execution is complete`, async () => {
// TODO: use the viewport size to pick the center point, but the `viewport` fixutre's values were wrong. await scene.expectPixelColor(
await scene.expectPixelColor([143, 143, 143], { x: 500, y: 250 }, 15) [143, 143, 143],
{ x: (viewport?.width ?? 1200) / 2, y: (viewport?.height ?? 500) / 2 },
15
)
}) })
}) })

View File

@ -113,8 +113,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([2.61, -4.01], %) |> startProfileAt([2.61, -4.01], %)
|> xLine(length = 8.73) |> xLine(length = 8.73)
|> tangentialArcTo([8.33, -1.31], %)` |> tangentialArcTo([8.33, -1.31], %)`
@ -160,10 +159,7 @@ sketch001 = startSketchOn(XZ)
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(`sketch002 = startSketchOn(XZ)
sketch002 = startSketchOn(XZ)
sketch001 = startProfileAt([12.34, -12.34], sketch002) sketch001 = startProfileAt([12.34, -12.34], sketch002)
|> yLine(length = 12.34) |> yLine(length = 12.34)
@ -793,8 +789,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
200 200
) )
let codeStr = let codeStr = 'sketch001 = startSketchOn(XY)'
'@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XY)'
await page.mouse.click(center.x, viewportSize.height * 0.55) await page.mouse.click(center.x, viewportSize.height * 0.55)
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
@ -1431,8 +1426,7 @@ test.describe(`Sketching with offset planes`, () => {
await context.addInitScript(() => { await context.addInitScript(() => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
`@settings(defaultLengthUnit = in) `offsetPlane001 = offsetPlane(XY, offset = 10)`
offsetPlane001 = offsetPlane(XY, offset = 10)`
) )
}) })
@ -1446,7 +1440,7 @@ offsetPlane001 = offsetPlane(XY, offset = 10)`
await test.step(`Hovering should highlight code`, async () => { await test.step(`Hovering should highlight code`, async () => {
await planeHover() await planeHover()
await editor.expectState({ await editor.expectState({
activeLines: [`@settings(defaultLengthUnit = in)`], activeLines: [`offsetPlane001=offsetPlane(XY,offset=10)`],
diagnostics: [], diagnostics: [],
highlightedCode: 'offsetPlane(XY, offset = 10)', highlightedCode: 'offsetPlane(XY, offset = 10)',
}) })
@ -1459,7 +1453,7 @@ offsetPlane001 = offsetPlane(XY, offset = 10)`
await expect(toolbar.lineBtn).toBeEnabled() await expect(toolbar.lineBtn).toBeEnabled()
await editor.expectEditor.toContain('startSketchOn(offsetPlane001)') await editor.expectEditor.toContain('startSketchOn(offsetPlane001)')
await editor.expectState({ await editor.expectState({
activeLines: [`@settings(defaultLengthUnit = in)`], activeLines: [`offsetPlane001=offsetPlane(XY,offset=10)`],
diagnostics: [], diagnostics: [],
highlightedCode: '', highlightedCode: '',
}) })
@ -2492,11 +2486,7 @@ extrude001 = extrude(profile003, length = 5)
page, page,
}) => { }) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem('persistCode', `myVar = 5`)
'persistCode',
`@settings(defaultLengthUnit = in)
myVar = 5`
)
}) })
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -29,5 +29,5 @@
} }
} }
], ],
"kcl_version": "0.2.52" "kcl_version": "0.2.53"
} }

View File

@ -0,0 +1,96 @@
import {
runningOnLinux,
runningOnMac,
runningOnWindows,
orRunWhenFullSuiteEnabled,
} from './test-utils'
describe('platform detection utilities', () => {
const originalPlatform = process.platform
afterAll(() => {
Object.defineProperty(process, 'platform', {
value: originalPlatform,
})
})
describe('runningOnLinux', () => {
it('returns true on Linux', () => {
Object.defineProperty(process, 'platform', {
value: 'linux',
})
expect(runningOnLinux()).toBe(true)
})
it('returns false on other platforms', () => {
Object.defineProperty(process, 'platform', {
value: 'darwin',
})
expect(runningOnLinux()).toBe(false)
})
})
describe('runningOnMac', () => {
it('returns true on Mac', () => {
Object.defineProperty(process, 'platform', {
value: 'darwin',
})
expect(runningOnMac()).toBe(true)
})
it('returns false on other platforms', () => {
Object.defineProperty(process, 'platform', {
value: 'linux',
})
expect(runningOnMac()).toBe(false)
})
})
describe('runningOnWindows', () => {
it('returns true on Windows', () => {
Object.defineProperty(process, 'platform', {
value: 'win32',
})
expect(runningOnWindows()).toBe(true)
})
it('returns false on other platforms', () => {
Object.defineProperty(process, 'platform', {
value: 'linux',
})
expect(runningOnWindows()).toBe(false)
})
})
})
describe('utility to bypass unreliable tests', () => {
const originalEnv = { ...process.env }
afterAll(() => {
process.env = { ...originalEnv }
})
it('always runs them on dedicated branch', () => {
process.env.GITHUB_EVENT_NAME = 'push'
process.env.GITHUB_REF = 'refs/heads/all-e2e'
process.env.GITHUB_HEAD_REF = ''
process.env.GITHUB_BASE_REF = ''
const condition = orRunWhenFullSuiteEnabled()
expect(condition).toBe(false)
})
it('skips them on the main branch', () => {
process.env.GITHUB_EVENT_NAME = 'push'
process.env.GITHUB_REF = 'refs/heads/main'
process.env.GITHUB_HEAD_REF = ''
process.env.GITHUB_BASE_REF = ''
const condition = orRunWhenFullSuiteEnabled()
expect(condition).toBe(true)
})
it('skips them on pull requests', () => {
process.env.GITHUB_EVENT_NAME = 'pull_request'
process.env.GITHUB_REF = 'refs/pull/5883/merge'
process.env.GITHUB_HEAD_REF = 'my-branch'
process.env.GITHUB_BASE_REF = 'main'
const condition = orRunWhenFullSuiteEnabled()
expect(condition).toBe(true)
})
})

View File

@ -55,8 +55,21 @@ export const commonPoints = {
export const editorSelector = '[role="textbox"][data-language="kcl"]' export const editorSelector = '[role="textbox"][data-language="kcl"]'
type PaneId = 'variables' | 'code' | 'files' | 'logs' type PaneId = 'variables' | 'code' | 'files' | 'logs'
export function runningOnLinux() {
return process.platform === 'linux'
}
export function runningOnMac() {
return process.platform === 'darwin'
}
export function runningOnWindows() {
return process.platform === 'win32'
}
export function orRunWhenFullSuiteEnabled() { export function orRunWhenFullSuiteEnabled() {
return process.env.GITHUB_HEAD_REF !== 'all-e2e' const branch = process.env.GITHUB_REF?.replace('refs/heads/', '')
return branch !== 'all-e2e'
} }
async function waitForPageLoadWithRetry(page: Page) { async function waitForPageLoadWithRetry(page: Page) {

View File

@ -4,6 +4,7 @@ import {
getUtils, getUtils,
TEST_COLORS, TEST_COLORS,
pollEditorLinesSelectedLength, pollEditorLinesSelectedLength,
executorInputPath,
orRunWhenFullSuiteEnabled, orRunWhenFullSuiteEnabled,
} from './test-utils' } from './test-utils'
import { XOR } from 'lib/utils' import { XOR } from 'lib/utils'
@ -1116,19 +1117,9 @@ test.describe('Electron constraint tests', () => {
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'test-sample') const bracketDir = path.join(dir, 'test-sample')
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.writeFile( await fsp.copyFile(
path.join(bracketDir, 'main.kcl'), executorInputPath('angled_line.kcl'),
`@settings(defaultLengthUnit = in) path.join(bracketDir, 'main.kcl')
const part001 = startSketchOn(XY)
|> startProfileAt([4.83, 12.56], %)
|> line(end = [15.1, 2.48])
|> line(end = [3.15, -9.85], tag = $seg01)
|> line(end = [-15.17, -4.1])
|> angledLine([segAng(seg01), 12.35], %)
|> line(end = [-13.02, 10.03])
|> close()
|> extrude(length = 4)`,
'utf-8'
) )
}) })

View File

@ -255,7 +255,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
await context.addInitScript(() => { await context.addInitScript(() => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
`@settings(defaultLengthUnit = in) `
const sketch002 = startSketchOn(XZ) const sketch002 = startSketchOn(XZ)
|> startProfileAt([-108.83, -57.48], %) |> startProfileAt([-108.83, -57.48], %)
|> angledLine([0, 105.13], %, $rectangleSegmentA001) |> angledLine([0, 105.13], %, $rectangleSegmentA001)

View File

@ -271,7 +271,7 @@ test.describe('Testing settings', () => {
const bracketDir = join(dir, projectName) const bracketDir = join(dir, projectName)
await fsp.mkdir(bracketDir, { recursive: true }) await fsp.mkdir(bracketDir, { recursive: true })
await fsp.copyFile( await fsp.copyFile(
executorInputPath('cylinder-inches.kcl'), executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
join(bracketDir, 'main.kcl') join(bracketDir, 'main.kcl')
) )
} }
@ -746,6 +746,7 @@ test.describe('Testing settings', () => {
}) })
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
await scene.settled(cmdBar) await scene.settled(cmdBar)
await page.waitForTimeout(1000) await page.waitForTimeout(1000)
@ -950,9 +951,9 @@ test.describe('Testing settings', () => {
) )
}) })
await test.step(`Initial units from settings are ignored`, async () => { await test.step(`Initial units from settings`, async () => {
await homePage.openProject('project-000') await homePage.openProject('project-000')
await expect(unitsIndicator).toHaveText('Current units are: mm') await expect(unitsIndicator).toHaveText('Current units are: in')
}) })
await test.step(`Manually write inline settings`, async () => { await test.step(`Manually write inline settings`, async () => {

View File

@ -483,8 +483,7 @@ test('Sketch on face', async ({ page, homePage, scene, cmdBar, toolbar }) => {
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
`@settings(defaultLengthUnit = in) `sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([3.29, 7.86], %) |> startProfileAt([3.29, 7.86], %)
|> line(end = [2.48, 2.44]) |> line(end = [2.48, 2.44])
|> line(end = [2.66, 1.17]) |> line(end = [2.66, 1.17])

3
interface.d.ts vendored
View File

@ -44,6 +44,9 @@ export interface IElectronAPI {
rm: typeof fs.rm rm: typeof fs.rm
stat: (path: string) => ReturnType<fs.stat> stat: (path: string) => ReturnType<fs.stat>
statIsDirectory: (path: string) => Promise<boolean> statIsDirectory: (path: string) => Promise<boolean>
canReadWriteDirectory: (
path: string
) => Promise<{ value: boolean; error: unknown }>
path: typeof path path: typeof path
mkdir: typeof fs.mkdir mkdir: typeof fs.mkdir
join: typeof path.join join: typeof path.join

View File

@ -75,17 +75,14 @@ LabeledArgument { ArgumentLabel Equals expression }
ArgumentList { "(" commaSep<LabeledArgument | expression> ")" } ArgumentList { "(" commaSep<LabeledArgument | expression> ")" }
type[@isGroup=Type] { type[@isGroup=Type] {
@specialize[@name=PrimitiveType]< PrimitiveType { identifier } |
identifier,
"bool" | "number" | "string" | "tag" | "Sketch" | "SketchSurface" | "Solid" | "Plane"
> |
ArrayType { "[" type !member (";" Number "+"?)? "]" } | ArrayType { "[" type !member (";" Number "+"?)? "]" } |
ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" } ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" }
} }
VariableDefinition { identifier } VariableDefinition { identifier }
VariableName { identifier } VariableName { identifier ("::" identifier)*}
ArgumentLabel { identifier } ArgumentLabel { identifier }
@ -137,7 +134,7 @@ commaSep1NoTrailingComma<term> { term ("," term)* }
"(" ")" "(" ")"
"{" "}" "{" "}"
"[" "]" "[" "]"
"," "?" ":" "." ".." ";" "," "?" ":" "." ".." ";" "::"
} }
@external propSource kclHighlight from "./highlight" @external propSource kclHighlight from "./highlight"

View File

@ -18,7 +18,9 @@ const config = defineConfig({
environment: 'node', environment: 'node',
reporters: process.env.GITHUB_ACTIONS reporters: process.env.GITHUB_ACTIONS
? ['dot', 'github-actions'] ? ['dot', 'github-actions']
: ['verbose', 'hanging-process'], : // Gotcha: 'hanging-process' is very noisey, turn off by default on localhost
// : ['verbose', 'hanging-process'],
['verbose'],
testTimeout: 1000, testTimeout: 1000,
hookTimeout: 1000, hookTimeout: 1000,
teardownTimeout: 1000, teardownTimeout: 1000,

View File

@ -29,7 +29,7 @@
"vscode-uri": "^3.1.0" "vscode-uri": "^3.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.13.10", "@types/node": "^22.13.13",
"ts-node": "^10.9.2" "ts-node": "^10.9.2"
} }
} }

View File

@ -116,10 +116,10 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
"@types/node@^22.13.10": "@types/node@^22.13.13":
version "22.13.10" version "22.13.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.10.tgz#df9ea358c5ed991266becc3109dc2dc9125d77e4" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.13.tgz#5e7d110fb509b0d4a43fbf48fa9d6e0f83e1b1e7"
integrity sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw== integrity sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==
dependencies: dependencies:
undici-types "~6.20.0" undici-types "~6.20.0"

View File

@ -12,6 +12,7 @@ import { defineConfig, devices } from '@playwright/test'
export default defineConfig({ export default defineConfig({
timeout: 120_000, // override the default 30s timeout timeout: 120_000, // override the default 30s timeout
testDir: './e2e/playwright', testDir: './e2e/playwright',
testIgnore: '*.test.ts', // ignore unit tests
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */

20
rust/Cargo.lock generated
View File

@ -1780,7 +1780,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-bumper" name = "kcl-bumper"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1791,7 +1791,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-derive-docs" name = "kcl-derive-docs"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"anyhow", "anyhow",
@ -1810,7 +1810,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-directory-test-macro" name = "kcl-directory-test-macro"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1819,7 +1819,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-language-server" name = "kcl-language-server"
version = "0.2.52" version = "0.2.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1840,7 +1840,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-language-server-release" name = "kcl-language-server-release"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1860,7 +1860,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.2.52" version = "0.2.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx 0.5.1", "approx 0.5.1",
@ -1928,7 +1928,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-python-bindings" name = "kcl-python-bindings"
version = "0.3.52" version = "0.3.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kcl-lib", "kcl-lib",
@ -1943,7 +1943,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-test-server" name = "kcl-test-server"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"hyper 0.14.32", "hyper 0.14.32",
@ -1956,7 +1956,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-to-core" name = "kcl-to-core"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -1970,7 +1970,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-wasm-lib" name = "kcl-wasm-lib"
version = "0.1.52" version = "0.1.54"
dependencies = [ dependencies = [
"bson", "bson",
"console_error_panic_hook", "console_error_panic_hook",

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-bumper" name = "kcl-bumper"
version = "0.1.52" version = "0.1.54"
edition = "2021" edition = "2021"
repository = "https://github.com/KittyCAD/modeling-api" repository = "https://github.com/KittyCAD/modeling-api"
rust-version = "1.76" rust-version = "1.76"

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-derive-docs" name = "kcl-derive-docs"
description = "A tool for generating documentation from Rust derive macros" description = "A tool for generating documentation from Rust derive macros"
version = "0.1.52" version = "0.1.54"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -816,7 +816,7 @@ fn generate_code_block_test(fn_name: &str, code_block: &str, index: usize) -> pr
async fn #test_name() -> miette::Result<()> { async fn #test_name() -> miette::Result<()> {
let code = #code_block; let code = #code_block;
// Note, `crate` must be kcl_lib // Note, `crate` must be kcl_lib
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(code, crate::settings::types::UnitLength::Mm, None).await {
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -31,7 +31,13 @@ mod test_examples_someFn {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_someFn0() -> miette::Result<()> { async fn kcl_test_example_someFn0() -> miette::Result<()> {
let code = "someFn()"; let code = "someFn()";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -31,7 +31,13 @@ mod test_examples_someFn {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_someFn0() -> miette::Result<()> { async fn kcl_test_example_someFn0() -> miette::Result<()> {
let code = "someFn()"; let code = "someFn()";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_show {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_show0() -> miette::Result<()> { async fn kcl_test_example_show0() -> miette::Result<()> {
let code = "This is another code block.\nyes sirrr.\nshow"; let code = "This is another code block.\nyes sirrr.\nshow";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_show {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_show0() -> miette::Result<()> { async fn kcl_test_example_show0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nshow"; let code = "This is code.\nIt does other shit.\nshow";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -33,7 +33,13 @@ mod test_examples_my_func {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_my_func0() -> miette::Result<()> { async fn kcl_test_example_my_func0() -> miette::Result<()> {
let code = "This is another code block.\nyes sirrr.\nmyFunc"; let code = "This is another code block.\nyes sirrr.\nmyFunc";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -33,7 +33,13 @@ mod test_examples_line_to {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_line_to0() -> miette::Result<()> { async fn kcl_test_example_line_to0() -> miette::Result<()> {
let code = "This is another code block.\nyes sirrr.\nlineTo"; let code = "This is another code block.\nyes sirrr.\nlineTo";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_min {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_min0() -> miette::Result<()> { async fn kcl_test_example_min0() -> miette::Result<()> {
let code = "This is another code block.\nyes sirrr.\nmin"; let code = "This is another code block.\nyes sirrr.\nmin";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_show {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_show0() -> miette::Result<()> { async fn kcl_test_example_show0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nshow"; let code = "This is code.\nIt does other shit.\nshow";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_import {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_import0() -> miette::Result<()> { async fn kcl_test_example_import0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nimport"; let code = "This is code.\nIt does other shit.\nimport";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_import {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_import0() -> miette::Result<()> { async fn kcl_test_example_import0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nimport"; let code = "This is code.\nIt does other shit.\nimport";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_import {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_import0() -> miette::Result<()> { async fn kcl_test_example_import0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nimport"; let code = "This is code.\nIt does other shit.\nimport";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -32,7 +32,13 @@ mod test_examples_show {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_show0() -> miette::Result<()> { async fn kcl_test_example_show0() -> miette::Result<()> {
let code = "This is code.\nIt does other shit.\nshow"; let code = "This is code.\nIt does other shit.\nshow";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -31,7 +31,13 @@ mod test_examples_some_function {
#[tokio::test(flavor = "multi_thread", worker_threads = 5)] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
async fn kcl_test_example_some_function0() -> miette::Result<()> { async fn kcl_test_example_some_function0() -> miette::Result<()> {
let code = "someFunction()"; let code = "someFunction()";
let result = match crate::test_server::execute_and_snapshot(code, None).await { let result = match crate::test_server::execute_and_snapshot(
code,
crate::settings::types::UnitLength::Mm,
None,
)
.await
{
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
return Err(miette::Report::new(crate::errors::Report { return Err(miette::Report::new(crate::errors::Report {
error: e.error, error: e.error,

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-directory-test-macro" name = "kcl-directory-test-macro"
description = "A tool for generating tests from a directory of kcl files" description = "A tool for generating tests from a directory of kcl files"
version = "0.1.52" version = "0.1.54"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "kcl-language-server-release" name = "kcl-language-server-release"
version = "0.1.52" version = "0.1.54"
edition = "2021" edition = "2021"
authors = ["KittyCAD Inc <kcl@kittycad.io>"] authors = ["KittyCAD Inc <kcl@kittycad.io>"]
publish = false publish = false

View File

@ -2,7 +2,7 @@
name = "kcl-language-server" name = "kcl-language-server"
description = "A language server for KCL." description = "A language server for KCL."
authors = ["KittyCAD Inc <kcl@kittycad.io>"] authors = ["KittyCAD Inc <kcl@kittycad.io>"]
version = "0.2.52" version = "0.2.54"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -135,13 +135,13 @@
"@types/mocha": "^10.0.10", "@types/mocha": "^10.0.10",
"@types/node": "^22.13.10", "@types/node": "^22.13.10",
"@types/vscode": "^1.97.0", "@types/vscode": "^1.97.0",
"@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/eslint-plugin": "^8.27.0",
"@typescript-eslint/parser": "^6.6.0", "@typescript-eslint/parser": "^8.27.0",
"@vscode/test-electron": "^2.4.1", "@vscode/test-electron": "^2.4.1",
"@vscode/vsce": "^2.30.0", "@vscode/vsce": "^3.3.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"esbuild": "^0.25.1", "esbuild": "^0.25.1",
"glob": "^10.4.3", "glob": "^11.0.1",
"mocha": "^11.1.0", "mocha": "^11.1.0",
"typescript": "^5.8.2" "typescript": "^5.8.2"
}, },

View File

@ -252,7 +252,7 @@
dependencies: dependencies:
eslint-visitor-keys "^3.4.3" eslint-visitor-keys "^3.4.3"
"@eslint-community/regexpp@^4.5.1": "@eslint-community/regexpp@^4.10.0":
version "4.12.1" version "4.12.1"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
@ -308,11 +308,6 @@
"@types/minimatch" "^5.1.2" "@types/minimatch" "^5.1.2"
"@types/node" "*" "@types/node" "*"
"@types/json-schema@^7.0.12":
version "7.0.15"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
"@types/minimatch@^5.1.2": "@types/minimatch@^5.1.2":
version "5.1.2" version "5.1.2"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
@ -330,101 +325,91 @@
dependencies: dependencies:
undici-types "~6.20.0" undici-types "~6.20.0"
"@types/semver@^7.5.0":
version "7.5.8"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
"@types/vscode@^1.97.0": "@types/vscode@^1.97.0":
version "1.97.0" version "1.97.0"
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.97.0.tgz#62ce3a32243019aaa4fc20cee2a3de06bc71af4f" resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.97.0.tgz#62ce3a32243019aaa4fc20cee2a3de06bc71af4f"
integrity sha512-ueE73loeOTe7olaVyqP9mrRI54kVPJifUPjblZo9fYcv1CuVLPOEKEkqW0GkqPC454+nCEoigLWnC2Pp7prZ9w== integrity sha512-ueE73loeOTe7olaVyqP9mrRI54kVPJifUPjblZo9fYcv1CuVLPOEKEkqW0GkqPC454+nCEoigLWnC2Pp7prZ9w==
"@typescript-eslint/eslint-plugin@^6.6.0": "@typescript-eslint/eslint-plugin@^8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.27.0.tgz#fbef10802365832ee1d1bd5d2117dcec82727a72"
integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== integrity sha512-4henw4zkePi5p252c8ncBLzLce52SEUz2Ebj8faDnuUXz2UuHEONYcJ+G0oaCF+bYCWVZtrGzq3FD7YXetmnSA==
dependencies: dependencies:
"@eslint-community/regexpp" "^4.5.1" "@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "6.21.0" "@typescript-eslint/scope-manager" "8.27.0"
"@typescript-eslint/type-utils" "6.21.0" "@typescript-eslint/type-utils" "8.27.0"
"@typescript-eslint/utils" "6.21.0" "@typescript-eslint/utils" "8.27.0"
"@typescript-eslint/visitor-keys" "6.21.0" "@typescript-eslint/visitor-keys" "8.27.0"
debug "^4.3.4"
graphemer "^1.4.0" graphemer "^1.4.0"
ignore "^5.2.4" ignore "^5.3.1"
natural-compare "^1.4.0" natural-compare "^1.4.0"
semver "^7.5.4" ts-api-utils "^2.0.1"
ts-api-utils "^1.0.1"
"@typescript-eslint/parser@^6.6.0": "@typescript-eslint/parser@^8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.27.0.tgz#3f6beaa83934467eda34ae82ef04090014df8227"
integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== integrity sha512-XGwIabPallYipmcOk45DpsBSgLC64A0yvdAkrwEzwZ2viqGqRUJ8eEYoPz0CWnutgAFbNMPdsGGvzjSmcWVlEA==
dependencies: dependencies:
"@typescript-eslint/scope-manager" "6.21.0" "@typescript-eslint/scope-manager" "8.27.0"
"@typescript-eslint/types" "6.21.0" "@typescript-eslint/types" "8.27.0"
"@typescript-eslint/typescript-estree" "6.21.0" "@typescript-eslint/typescript-estree" "8.27.0"
"@typescript-eslint/visitor-keys" "6.21.0" "@typescript-eslint/visitor-keys" "8.27.0"
debug "^4.3.4" debug "^4.3.4"
"@typescript-eslint/scope-manager@6.21.0": "@typescript-eslint/scope-manager@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.27.0.tgz#b51042927067d677fbfc471605cf40d1ffaee482"
integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== integrity sha512-8oI9GwPMQmBryaaxG1tOZdxXVeMDte6NyJA4i7/TWa4fBwgnAXYlIQP+uYOeqAaLJ2JRxlG9CAyL+C+YE9Xknw==
dependencies: dependencies:
"@typescript-eslint/types" "6.21.0" "@typescript-eslint/types" "8.27.0"
"@typescript-eslint/visitor-keys" "6.21.0" "@typescript-eslint/visitor-keys" "8.27.0"
"@typescript-eslint/type-utils@6.21.0": "@typescript-eslint/type-utils@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.27.0.tgz#af3c4eefcb64455ee50aae2d7069918467af085c"
integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== integrity sha512-wVArTVcz1oJOIEJxui/nRhV0TXzD/zMSOYi/ggCfNq78EIszddXcJb7r4RCp/oBrjt8n9A0BSxRMKxHftpDxDA==
dependencies: dependencies:
"@typescript-eslint/typescript-estree" "6.21.0" "@typescript-eslint/typescript-estree" "8.27.0"
"@typescript-eslint/utils" "6.21.0" "@typescript-eslint/utils" "8.27.0"
debug "^4.3.4" debug "^4.3.4"
ts-api-utils "^1.0.1" ts-api-utils "^2.0.1"
"@typescript-eslint/types@6.21.0": "@typescript-eslint/types@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.27.0.tgz#3dd01ced4c81e798d1106fda0904f8d5c91051aa"
integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== integrity sha512-/6cp9yL72yUHAYq9g6DsAU+vVfvQmd1a8KyA81uvfDE21O2DwQ/qxlM4AR8TSdAu+kJLBDrEHKC5/W2/nxsY0A==
"@typescript-eslint/typescript-estree@6.21.0": "@typescript-eslint/typescript-estree@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.27.0.tgz#4e02a1056454a84418cc9bce7c00b1c08b03567a"
integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== integrity sha512-BnKq8cqPVoMw71O38a1tEb6iebEgGA80icSxW7g+kndx0o6ot6696HjG7NdgfuAVmVEtwXUr3L8R9ZuVjoQL6A==
dependencies: dependencies:
"@typescript-eslint/types" "6.21.0" "@typescript-eslint/types" "8.27.0"
"@typescript-eslint/visitor-keys" "6.21.0" "@typescript-eslint/visitor-keys" "8.27.0"
debug "^4.3.4" debug "^4.3.4"
globby "^11.1.0" fast-glob "^3.3.2"
is-glob "^4.0.3" is-glob "^4.0.3"
minimatch "9.0.3" minimatch "^9.0.4"
semver "^7.5.4" semver "^7.6.0"
ts-api-utils "^1.0.1" ts-api-utils "^2.0.1"
"@typescript-eslint/utils@6.21.0": "@typescript-eslint/utils@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.27.0.tgz#d9c2a4891c6a85b952a9d5f9656c379ab111cf6d"
integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== integrity sha512-njkodcwH1yvmo31YWgRHNb/x1Xhhq4/m81PhtvmRngD8iHPehxffz1SNCO+kwaePhATC+kOa/ggmvPoPza5i0Q==
dependencies: dependencies:
"@eslint-community/eslint-utils" "^4.4.0" "@eslint-community/eslint-utils" "^4.4.0"
"@types/json-schema" "^7.0.12" "@typescript-eslint/scope-manager" "8.27.0"
"@types/semver" "^7.5.0" "@typescript-eslint/types" "8.27.0"
"@typescript-eslint/scope-manager" "6.21.0" "@typescript-eslint/typescript-estree" "8.27.0"
"@typescript-eslint/types" "6.21.0"
"@typescript-eslint/typescript-estree" "6.21.0"
semver "^7.5.4"
"@typescript-eslint/visitor-keys@6.21.0": "@typescript-eslint/visitor-keys@8.27.0":
version "6.21.0" version "8.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.27.0.tgz#4a13e9d7ad7e311a07ea1b178b4c9f848ce11334"
integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== integrity sha512-WsXQwMkILJvffP6z4U3FYJPlbf/j07HIxmDjZpbNvBJkMfvwXj5ACRkkHwBDvLBbDbtX5TdU64/rcvKJ/vuInQ==
dependencies: dependencies:
"@typescript-eslint/types" "6.21.0" "@typescript-eslint/types" "8.27.0"
eslint-visitor-keys "^3.4.1" eslint-visitor-keys "^4.2.0"
"@vscode/test-electron@^2.4.1": "@vscode/test-electron@^2.4.1":
version "2.4.1" version "2.4.1"
@ -497,10 +482,10 @@
"@vscode/vsce-sign-win32-arm64" "2.0.2" "@vscode/vsce-sign-win32-arm64" "2.0.2"
"@vscode/vsce-sign-win32-x64" "2.0.2" "@vscode/vsce-sign-win32-x64" "2.0.2"
"@vscode/vsce@^2.30.0": "@vscode/vsce@^3.3.0":
version "2.30.0" version "3.3.0"
resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.30.0.tgz#7a0c16b20ef529fa291fe9d3c7fe51a2a613f773" resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-3.3.0.tgz#803e41368a95d35693ce049076503f34f89fde09"
integrity sha512-MBYpXdCY1SCdc2u/y11kmJuSODKFyZRpeRTQq5p4rSg05QSjSy5pz6h/BGLNdSahgXfKRBATEkjAcJFdJuDz8Q== integrity sha512-HA/pUyvh/TQWkc4wG7AudPIWUvsR8i4jiWZZgM/a69ncPi9Nm5FDogf/wVEk4EWJs4/UdxU7J6X18dfAwfPbxA==
dependencies: dependencies:
"@azure/identity" "^4.1.0" "@azure/identity" "^4.1.0"
"@vscode/vsce-sign" "^2.0.0" "@vscode/vsce-sign" "^2.0.0"
@ -508,19 +493,19 @@
chalk "^2.4.2" chalk "^2.4.2"
cheerio "^1.0.0-rc.9" cheerio "^1.0.0-rc.9"
cockatiel "^3.1.2" cockatiel "^3.1.2"
commander "^6.2.1" commander "^12.1.0"
form-data "^4.0.0" form-data "^4.0.0"
glob "^7.0.6" glob "^11.0.0"
hosted-git-info "^4.0.2" hosted-git-info "^4.0.2"
jsonc-parser "^3.2.0" jsonc-parser "^3.2.0"
leven "^3.1.0" leven "^3.1.0"
markdown-it "^12.3.2" markdown-it "^14.1.0"
mime "^1.3.4" mime "^1.3.4"
minimatch "^3.0.3" minimatch "^3.0.3"
parse-semver "^1.1.1" parse-semver "^1.1.1"
read "^1.0.7" read "^1.0.7"
semver "^7.5.2" semver "^7.5.2"
tmp "^0.2.1" tmp "^0.2.3"
typed-rest-client "^1.8.4" typed-rest-client "^1.8.4"
url-join "^4.0.1" url-join "^4.0.1"
xml2js "^0.5.0" xml2js "^0.5.0"
@ -583,11 +568,6 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
array-union@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
asynckit@^0.4.0: asynckit@^0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@ -832,10 +812,10 @@ combined-stream@^1.0.8:
dependencies: dependencies:
delayed-stream "~1.0.0" delayed-stream "~1.0.0"
commander@^6.2.1: commander@^12.1.0:
version "6.2.1" version "12.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==
concat-map@0.0.1: concat-map@0.0.1:
version "0.0.1" version "0.0.1"
@ -932,13 +912,6 @@ diff@^5.2.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
dependencies:
path-type "^4.0.0"
dom-serializer@^2.0.0: dom-serializer@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53"
@ -1008,11 +981,6 @@ entities@^4.2.0, entities@^4.4.0:
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
entities@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==
es-define-property@^1.0.0: es-define-property@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845"
@ -1071,11 +1039,16 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: eslint-visitor-keys@^3.4.3:
version "3.4.3" version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
eslint-visitor-keys@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45"
integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==
events@^3.0.0: events@^3.0.0:
version "3.3.0" version "3.3.0"
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
@ -1086,7 +1059,7 @@ expand-template@^2.0.3:
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
fast-glob@^3.2.9: fast-glob@^3.3.2:
version "3.3.3" version "3.3.3"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818"
integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==
@ -1153,11 +1126,6 @@ fs-constants@^1.0.0:
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
fsevents@~2.3.2: fsevents@~2.3.2:
version "2.3.3" version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
@ -1196,7 +1164,7 @@ glob-parent@^5.1.2, glob-parent@~5.1.2:
dependencies: dependencies:
is-glob "^4.0.1" is-glob "^4.0.1"
glob@^10.4.3, glob@^10.4.5: glob@^10.4.5:
version "10.4.5" version "10.4.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956"
integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==
@ -1208,29 +1176,17 @@ glob@^10.4.3, glob@^10.4.5:
package-json-from-dist "^1.0.0" package-json-from-dist "^1.0.0"
path-scurry "^1.11.1" path-scurry "^1.11.1"
glob@^7.0.6: glob@^11.0.0, glob@^11.0.1:
version "7.2.3" version "11.0.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.1.tgz#1c3aef9a59d680e611b53dcd24bb8639cef064d9"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== integrity sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==
dependencies: dependencies:
fs.realpath "^1.0.0" foreground-child "^3.1.0"
inflight "^1.0.4" jackspeak "^4.0.1"
inherits "2" minimatch "^10.0.0"
minimatch "^3.1.1" minipass "^7.1.2"
once "^1.3.0" package-json-from-dist "^1.0.0"
path-is-absolute "^1.0.0" path-scurry "^2.0.0"
globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.2.9"
ignore "^5.2.0"
merge2 "^1.4.1"
slash "^3.0.0"
gopd@^1.0.1: gopd@^1.0.1:
version "1.0.1" version "1.0.1"
@ -1321,7 +1277,7 @@ ieee754@^1.1.13, ieee754@^1.2.1:
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
ignore@^5.2.0, ignore@^5.2.4: ignore@^5.3.1:
version "5.3.2" version "5.3.2"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
@ -1331,15 +1287,7 @@ immediate@~3.0.5:
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
inflight@^1.0.4: inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
version "2.0.4" version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@ -1429,6 +1377,13 @@ jackspeak@^3.1.2:
optionalDependencies: optionalDependencies:
"@pkgjs/parseargs" "^0.11.0" "@pkgjs/parseargs" "^0.11.0"
jackspeak@^4.0.1:
version "4.1.0"
resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.1.0.tgz#c489c079f2b636dc4cbe9b0312a13ff1282e561b"
integrity sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==
dependencies:
"@isaacs/cliui" "^8.0.2"
js-yaml@^4.1.0: js-yaml@^4.1.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
@ -1521,12 +1476,12 @@ lie@~3.3.0:
dependencies: dependencies:
immediate "~3.0.5" immediate "~3.0.5"
linkify-it@^3.0.1: linkify-it@^5.0.0:
version "3.0.3" version "5.0.0"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421"
integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==
dependencies: dependencies:
uc.micro "^1.0.1" uc.micro "^2.0.0"
locate-path@^6.0.0: locate-path@^6.0.0:
version "6.0.0" version "6.0.0"
@ -1591,6 +1546,11 @@ lru-cache@^10.2.0:
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878"
integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==
lru-cache@^11.0.0:
version "11.0.2"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39"
integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==
lru-cache@^6.0.0: lru-cache@^6.0.0:
version "6.0.0" version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
@ -1598,23 +1558,24 @@ lru-cache@^6.0.0:
dependencies: dependencies:
yallist "^4.0.0" yallist "^4.0.0"
markdown-it@^12.3.2: markdown-it@^14.1.0:
version "12.3.2" version "14.1.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45"
integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==
dependencies: dependencies:
argparse "^2.0.1" argparse "^2.0.1"
entities "~2.1.0" entities "^4.4.0"
linkify-it "^3.0.1" linkify-it "^5.0.0"
mdurl "^1.0.1" mdurl "^2.0.0"
uc.micro "^1.0.5" punycode.js "^2.3.1"
uc.micro "^2.1.0"
mdurl@^1.0.1: mdurl@^2.0.0:
version "1.0.1" version "2.0.0"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0"
integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==
merge2@^1.3.0, merge2@^1.4.1: merge2@^1.3.0:
version "1.4.1" version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
@ -1654,14 +1615,14 @@ mimic-response@^3.1.0:
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
minimatch@9.0.3: minimatch@^10.0.0:
version "9.0.3" version "10.0.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.1.tgz#ce0521856b453c86e25f2c4c0d03e6ff7ddc440b"
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== integrity sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==
dependencies: dependencies:
brace-expansion "^2.0.1" brace-expansion "^2.0.1"
minimatch@^3.0.3, minimatch@^3.1.1: minimatch@^3.0.3:
version "3.1.2" version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
@ -1777,7 +1738,7 @@ object-inspect@^1.13.1:
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==
once@^1.3.0, once@^1.3.1, once@^1.4.0: once@^1.3.1, once@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
@ -1866,11 +1827,6 @@ path-exists@^4.0.0:
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
path-key@^3.1.0: path-key@^3.1.0:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
@ -1884,10 +1840,13 @@ path-scurry@^1.11.1:
lru-cache "^10.2.0" lru-cache "^10.2.0"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
path-type@^4.0.0: path-scurry@^2.0.0:
version "4.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==
dependencies:
lru-cache "^11.0.0"
minipass "^7.1.2"
pend@~1.2.0: pend@~1.2.0:
version "1.2.0" version "1.2.0"
@ -1930,6 +1889,11 @@ pump@^3.0.0:
end-of-stream "^1.1.0" end-of-stream "^1.1.0"
once "^1.3.1" once "^1.3.1"
punycode.js@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7"
integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==
qs@^6.9.1: qs@^6.9.1:
version "6.12.1" version "6.12.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a" resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a"
@ -2040,10 +2004,10 @@ semver@^5.1.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.2: semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2:
version "7.6.2" version "7.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==
serialize-javascript@^6.0.2: serialize-javascript@^6.0.2:
version "6.0.2" version "6.0.2"
@ -2115,11 +2079,6 @@ simple-get@^4.0.0:
once "^1.3.1" once "^1.3.1"
simple-concat "^1.0.0" simple-concat "^1.0.0"
slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
stdin-discarder@^0.1.0: stdin-discarder@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.1.0.tgz#22b3e400393a8e28ebf53f9958f3880622efde21" resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.1.0.tgz#22b3e400393a8e28ebf53f9958f3880622efde21"
@ -2255,7 +2214,7 @@ tar-stream@^2.1.4:
inherits "^2.0.3" inherits "^2.0.3"
readable-stream "^3.1.1" readable-stream "^3.1.1"
tmp@^0.2.1: tmp@^0.2.3:
version "0.2.3" version "0.2.3"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==
@ -2267,10 +2226,10 @@ to-regex-range@^5.0.1:
dependencies: dependencies:
is-number "^7.0.0" is-number "^7.0.0"
ts-api-utils@^1.0.1: ts-api-utils@^2.0.1:
version "1.4.3" version "2.1.0"
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91"
integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw== integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==
tslib@^2.2.0, tslib@^2.6.2: tslib@^2.2.0, tslib@^2.6.2:
version "2.6.2" version "2.6.2"
@ -2303,10 +2262,10 @@ typescript@^5.8.2:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4"
integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ== integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==
uc.micro@^1.0.1, uc.micro@^1.0.5: uc.micro@^2.0.0, uc.micro@^2.1.0:
version "1.0.6" version "2.1.0"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==
underscore@^1.12.1: underscore@^1.12.1:
version "1.13.6" version "1.13.6"

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-lib" name = "kcl-lib"
description = "KittyCAD Language implementation and tools" description = "KittyCAD Language implementation and tools"
version = "0.2.52" version = "0.2.54"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -76,7 +76,7 @@ fn run_benchmarks(c: &mut Criterion) {
group.bench_function(format!("execute_{}", dir_name), |b| { group.bench_function(format!("execute_{}", dir_name), |b| {
b.iter(|| { b.iter(|| {
if let Err(err) = rt.block_on(async { if let Err(err) = rt.block_on(async {
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await?; let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default()).await?;
let mut exec_state = kcl_lib::ExecState::new(&ctx); let mut exec_state = kcl_lib::ExecState::new(&ctx);
ctx.run(black_box(&program), &mut exec_state).await?; ctx.run(black_box(&program), &mut exec_state).await?;
ctx.close().await; ctx.close().await;

View File

@ -49,6 +49,45 @@ async fn cache_test(
img_results img_results
} }
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cache_change_units_changes_output() {
let code = r#"part001 = startSketchOn('XY')
|> startProfileAt([5.5229, 5.25217], %)
|> line(end = [10.50433, -1.19122])
|> line(end = [8.01362, -5.48731])
|> line(end = [-1.02877, -6.76825])
|> line(end = [-11.53311, 2.81559])
|> close()
|> extrude(length = 4)
"#;
let result = cache_test(
"change_units_changes_output",
vec![
Variation {
code,
settings: &kcl_lib::ExecutorSettings {
units: kcl_lib::UnitLength::In,
..Default::default()
},
},
Variation {
code,
settings: &kcl_lib::ExecutorSettings {
units: kcl_lib::UnitLength::Mm,
..Default::default()
},
},
],
)
.await;
let first = result.first().unwrap();
let second = result.last().unwrap();
assert!(first.1 != second.1);
}
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cache_change_grid_visualizes_grid_off_to_on() { async fn kcl_test_cache_change_grid_visualizes_grid_off_to_on() {
let code = r#"part001 = startSketchOn('XY') let code = r#"part001 = startSketchOn('XY')

View File

@ -1,4 +0,0 @@
@settings(defaultLengthUnit = in)
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 20)
extrude001 = extrude(sketch001, length = 10)

View File

@ -1,5 +1,4 @@
@settings(defaultLengthUnit = in) const sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) |> startProfileAt([75.8, 317.2], %)
|> angledLine([0, 268.43], %, $rectangleSegmentA001) |> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([ |> angledLine([
@ -12,8 +11,8 @@ sketch001 = startSketchOn(XZ)
], %, $yo) ], %, $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = 100) const extrude001 = extrude(sketch001, length = 100)
chamf = chamfer( const chamf = chamfer(
extrude001, extrude001,
length = 30, length = 30,
tags = [ tags = [

View File

@ -1,5 +1,4 @@
@settings(defaultLengthUnit = in) const sketch001 = startSketchOn(XZ)
sketch001 = startSketchOn(XZ)
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag] |> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|> angledLine([0, 268.43], %, $rectangleSegmentA001) |> angledLine([0, 268.43], %, $rectangleSegmentA001)
|> angledLine([ |> angledLine([
@ -12,7 +11,7 @@ sketch001 = startSketchOn(XZ)
], %, $yo) ], %, $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = 100) const extrude001 = extrude(sketch001, length = 100)
|> chamfer( |> chamfer(
length = 30, length = 30,
tags = [ tags = [

View File

@ -1,4 +1,4 @@
const part001 = startSketchOn(XY) const part001 = startSketchOn(XY)
|> circle(center= [5, 5], radius= 10) |> circle(center= [5, 5], radius= 10)
|> extrude(length = 10) |> extrude(length = 10)
|> helixRevolutions({revolutions = 16, angleStart = 0}, %) |> helix(revolutions = 16, angleStart = 0, cylinder = %)

View File

@ -1,4 +1,4 @@
const part001 = startSketchOn(XY) const part001 = startSketchOn(XY)
|> circle(center = [5, 5], radius = 10) |> circle(center = [5, 5], radius = 10)
|> extrude(length = -10) |> extrude(length = -10)
|> helixRevolutions({revolutions = 16, angleStart = 0}, %) |> helix(revolutions = 16, angleStart = 0, cylinder = %)

View File

@ -1,4 +1,4 @@
const part001 = startSketchOn(XY) const part001 = startSketchOn(XY)
|> circle(center= [5, 5], radius= 10) |> circle(center= [5, 5], radius= 10)
|> extrude(length = 10) |> extrude(length = 10)
|> helixRevolutions({revolutions = 16, angleStart = 0, length = 3}, %) |> helix(revolutions = 16, angleStart = 0, length = 3, cylinder = %)

View File

@ -2,7 +2,7 @@ mod cache;
use kcl_lib::{ use kcl_lib::{
test_server::{execute_and_export_step, execute_and_snapshot, execute_and_snapshot_no_auth}, test_server::{execute_and_export_step, execute_and_snapshot, execute_and_snapshot_no_auth},
ExecError, ExecError, UnitLength,
}; };
/// The minimum permissible difference between asserted twenty-twenty images. /// The minimum permissible difference between asserted twenty-twenty images.
@ -26,7 +26,7 @@ pub(crate) fn assert_out(test_name: &str, result: &image::DynamicImage) -> Strin
async fn kcl_test_fillet_duplicate_tags() { async fn kcl_test_fillet_duplicate_tags() {
let code = kcl_input!("fillet_duplicate_tags"); let code = kcl_input!("fillet_duplicate_tags");
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = result.expect_err("Code should have failed due to the duplicate edges being filletted"); let err = result.expect_err("Code should have failed due to the duplicate edges being filletted");
let err = err.as_kcl_error().unwrap(); let err = err.as_kcl_error().unwrap();
@ -48,7 +48,7 @@ async fn kcl_test_execute_engine_error_return() {
|> extrude(length = 4) |> extrude(length = 4)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -61,7 +61,7 @@ async fn kcl_test_execute_i_shape() {
// This is some code from lee that starts a pipe expression with a variable. // This is some code from lee that starts a pipe expression with a variable.
let code = kcl_input!("i_shape"); let code = kcl_input!("i_shape");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("i_shape", &result); assert_out("i_shape", &result);
} }
@ -70,7 +70,7 @@ async fn kcl_test_execute_i_shape() {
async fn kcl_test_execute_pipes_on_pipes() { async fn kcl_test_execute_pipes_on_pipes() {
let code = kcl_input!("pipes_on_pipes"); let code = kcl_input!("pipes_on_pipes");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("pipes_on_pipes", &result); assert_out("pipes_on_pipes", &result);
} }
@ -78,7 +78,7 @@ async fn kcl_test_execute_pipes_on_pipes() {
async fn kcl_test_execute_cylinder() { async fn kcl_test_execute_cylinder() {
let code = kcl_input!("cylinder"); let code = kcl_input!("cylinder");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("cylinder", &result); assert_out("cylinder", &result);
} }
@ -86,7 +86,7 @@ async fn kcl_test_execute_cylinder() {
async fn kcl_test_execute_kittycad_svg() { async fn kcl_test_execute_kittycad_svg() {
let code = kcl_input!("kittycad_svg"); let code = kcl_input!("kittycad_svg");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("kittycad_svg", &result); assert_out("kittycad_svg", &result);
} }
@ -94,7 +94,7 @@ async fn kcl_test_execute_kittycad_svg() {
async fn kcl_test_execute_lsystem() { async fn kcl_test_execute_lsystem() {
let code = kcl_input!("lsystem"); let code = kcl_input!("lsystem");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("lsystem", &result); assert_out("lsystem", &result);
} }
@ -102,7 +102,7 @@ async fn kcl_test_execute_lsystem() {
async fn kcl_test_member_expression_sketch() { async fn kcl_test_member_expression_sketch() {
let code = kcl_input!("member_expression_sketch"); let code = kcl_input!("member_expression_sketch");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("member_expression_sketch", &result); assert_out("member_expression_sketch", &result);
} }
@ -110,7 +110,7 @@ async fn kcl_test_member_expression_sketch() {
async fn kcl_test_helix_defaults() { async fn kcl_test_helix_defaults() {
let code = kcl_input!("helix_defaults"); let code = kcl_input!("helix_defaults");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("helix_defaults", &result); assert_out("helix_defaults", &result);
} }
@ -118,7 +118,7 @@ async fn kcl_test_helix_defaults() {
async fn kcl_test_helix_defaults_negative_extrude() { async fn kcl_test_helix_defaults_negative_extrude() {
let code = kcl_input!("helix_defaults_negative_extrude"); let code = kcl_input!("helix_defaults_negative_extrude");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("helix_defaults_negative_extrude", &result); assert_out("helix_defaults_negative_extrude", &result);
} }
@ -126,7 +126,7 @@ async fn kcl_test_helix_defaults_negative_extrude() {
async fn kcl_test_helix_with_length() { async fn kcl_test_helix_with_length() {
let code = kcl_input!("helix_with_length"); let code = kcl_input!("helix_with_length");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("helix_with_length", &result); assert_out("helix_with_length", &result);
} }
@ -134,7 +134,7 @@ async fn kcl_test_helix_with_length() {
async fn kcl_test_dimensions_match() { async fn kcl_test_dimensions_match() {
let code = kcl_input!("dimensions_match"); let code = kcl_input!("dimensions_match");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("dimensions_match", &result); assert_out("dimensions_match", &result);
} }
@ -142,7 +142,7 @@ async fn kcl_test_dimensions_match() {
async fn kcl_test_close_arc() { async fn kcl_test_close_arc() {
let code = kcl_input!("close_arc"); let code = kcl_input!("close_arc");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("close_arc", &result); assert_out("close_arc", &result);
} }
@ -150,7 +150,7 @@ async fn kcl_test_close_arc() {
async fn kcl_test_negative_args() { async fn kcl_test_negative_args() {
let code = kcl_input!("negative_args"); let code = kcl_input!("negative_args");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("negative_args", &result); assert_out("negative_args", &result);
} }
@ -164,7 +164,7 @@ async fn kcl_test_basic_tangential_arc_with_point() {
|> extrude(length = 10) |> extrude(length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("tangential_arc_with_point", &result); assert_out("tangential_arc_with_point", &result);
} }
@ -178,7 +178,7 @@ async fn kcl_test_basic_tangential_arc_to() {
|> extrude(length = 10) |> extrude(length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("tangential_arc_to", &result); assert_out("tangential_arc_to", &result);
} }
@ -205,7 +205,7 @@ box(30, 43, 18, '-xy')
let thing = box(-12, -15, 10, 'yz') let thing = box(-12, -15, 10, 'yz')
box(-20, -5, 10, 'xy')"#; box(-20, -5, 10, 'xy')"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("different_planes_same_drawing", &result); assert_out("different_planes_same_drawing", &result);
} }
@ -263,7 +263,7 @@ part004 = startSketchOn(YZ)
|> close() |> close()
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("lots_of_planes", &result); assert_out("lots_of_planes", &result);
} }
@ -280,7 +280,7 @@ async fn kcl_test_holes() {
|> extrude(length = 2) |> extrude(length = 2)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("holes", &result); assert_out("holes", &result);
} }
@ -299,7 +299,7 @@ async fn optional_params() {
thing = other_circle([2, 2], 20) thing = other_circle([2, 2], 20)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("optional_params", &result); assert_out("optional_params", &result);
} }
@ -335,7 +335,7 @@ part = roundedRectangle([0, 0], 20, 20, 4)
|> extrude(length = 2) |> extrude(length = 2)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("rounded_with_holes", &result); assert_out("rounded_with_holes", &result);
} }
@ -343,7 +343,7 @@ part = roundedRectangle([0, 0], 20, 20, 4)
async fn kcl_test_top_level_expression() { async fn kcl_test_top_level_expression() {
let code = r#"startSketchOn(XY) |> circle(center = [0,0], radius= 22) |> extrude(length = 14)"#; let code = r#"startSketchOn(XY) |> circle(center = [0,0], radius= 22) |> extrude(length = 14)"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("top_level_expression", &result); assert_out("top_level_expression", &result);
} }
@ -357,7 +357,7 @@ part = startSketchOn(XY)
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic_with_math", &result); assert_out("patterns_linear_basic_with_math", &result);
} }
@ -369,7 +369,7 @@ async fn kcl_test_patterns_linear_basic() {
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic", &result); assert_out("patterns_linear_basic", &result);
} }
@ -385,7 +385,7 @@ async fn kcl_test_patterns_linear_basic_3d() {
|> patternLinear3d(axis = [1, 0, 1], instances = 4, distance = 6) |> patternLinear3d(axis = [1, 0, 1], instances = 4, distance = 6)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic_3d", &result); assert_out("patterns_linear_basic_3d", &result);
} }
@ -397,7 +397,7 @@ async fn kcl_test_patterns_linear_basic_negative_distance() {
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic_negative_distance", &result); assert_out("patterns_linear_basic_negative_distance", &result);
} }
@ -409,7 +409,7 @@ async fn kcl_test_patterns_linear_basic_negative_axis() {
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic_negative_axis", &result); assert_out("patterns_linear_basic_negative_axis", &result);
} }
@ -430,7 +430,7 @@ rectangle = startSketchOn(XY)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_linear_basic_holes", &result); assert_out("patterns_linear_basic_holes", &result);
} }
@ -442,7 +442,7 @@ async fn kcl_test_patterns_circular_basic_2d() {
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_circular_basic_2d", &result); assert_out("patterns_circular_basic_2d", &result);
} }
@ -458,7 +458,7 @@ async fn kcl_test_patterns_circular_basic_3d() {
|> patternCircular3d(axis = [0,0, 1], center = [-20, -20, -20], instances = 41, arcDegrees = 360, rotateDuplicates = false) |> patternCircular3d(axis = [0,0, 1], center = [-20, -20, -20], instances = 41, arcDegrees = 360, rotateDuplicates = false)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_circular_basic_3d", &result); assert_out("patterns_circular_basic_3d", &result);
} }
@ -474,7 +474,7 @@ async fn kcl_test_patterns_circular_3d_tilted_axis() {
|> patternCircular3d(axis = [1,1,0], center = [10, 0, 10], instances = 11, arcDegrees = 360, rotateDuplicates = true) |> patternCircular3d(axis = [1,1,0], center = [10, 0, 10], instances = 11, arcDegrees = 360, rotateDuplicates = true)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("patterns_circular_3d_tilted_axis", &result); assert_out("patterns_circular_3d_tilted_axis", &result);
} }
@ -483,7 +483,7 @@ async fn kcl_test_import_file_doesnt_exist() {
let code = r#"import 'thing.obj' let code = r#"import 'thing.obj'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -496,7 +496,7 @@ async fn kcl_test_import_obj_with_mtl() {
let code = r#"import 'e2e/executor/inputs/cube.obj' let code = r#"import 'e2e/executor/inputs/cube.obj'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_obj_with_mtl", &result); assert_out("import_obj_with_mtl", &result);
} }
@ -506,7 +506,7 @@ async fn kcl_test_import_obj_with_mtl_units() {
import 'e2e/executor/inputs/cube.obj' import 'e2e/executor/inputs/cube.obj'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_obj_with_mtl_units", &result); assert_out("import_obj_with_mtl_units", &result);
} }
@ -515,7 +515,7 @@ async fn kcl_test_import_stl() {
let code = r#"import 'e2e/executor/inputs/2-5-long-m8-chc-screw.stl' as screw let code = r#"import 'e2e/executor/inputs/2-5-long-m8-chc-screw.stl' as screw
model = screw"#; model = screw"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_stl", &result); assert_out("import_stl", &result);
} }
@ -524,7 +524,7 @@ async fn kcl_test_import_gltf_with_bin() {
let code = r#"import 'e2e/executor/inputs/cube.gltf' let code = r#"import 'e2e/executor/inputs/cube.gltf'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_gltf_with_bin", &result); assert_out("import_gltf_with_bin", &result);
} }
@ -533,7 +533,7 @@ async fn kcl_test_import_gltf_embedded() {
let code = r#"import 'e2e/executor/inputs/cube-embedded.gltf' as cube let code = r#"import 'e2e/executor/inputs/cube-embedded.gltf' as cube
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_gltf_embedded", &result); assert_out("import_gltf_embedded", &result);
} }
@ -542,7 +542,7 @@ async fn kcl_test_import_glb() {
let code = r#"import 'e2e/executor/inputs/cube.glb' let code = r#"import 'e2e/executor/inputs/cube.glb'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_glb", &result); assert_out("import_glb", &result);
} }
@ -551,7 +551,7 @@ async fn kcl_test_import_glb_no_assign() {
let code = r#"import 'e2e/executor/inputs/cube.glb' let code = r#"import 'e2e/executor/inputs/cube.glb'
cube"#; cube"#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("import_glb_no_assign", &result); assert_out("import_glb_no_assign", &result);
} }
@ -561,7 +561,7 @@ async fn kcl_test_import_ext_doesnt_match() {
import 'e2e/executor/inputs/cube.gltf' import 'e2e/executor/inputs/cube.gltf'
model = cube"#; model = cube"#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -586,15 +586,14 @@ async fn kcl_test_cube_mm() {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("cube_mm", &result); assert_out("cube_mm", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cube_cm() { async fn kcl_test_cube_cm() {
let code = r#"@settings(defaultLengthUnit = cm) let code = r#"fn cube = (pos, scale) => {
fn cube = (pos, scale) => { sg = startSketchOn(XY)
sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
|> line(end = [0, scale]) |> line(end = [0, scale])
|> line(end = [scale, 0]) |> line(end = [scale, 0])
@ -608,15 +607,14 @@ fn cube = (pos, scale) => {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Cm, None).await.unwrap();
assert_out("cube_cm", &result); assert_out("cube_cm", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cube_m() { async fn kcl_test_cube_m() {
let code = r#"@settings(defaultLengthUnit = m) let code = r#"fn cube = (pos, scale) => {
fn cube = (pos, scale) => { sg = startSketchOn(XY)
sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
|> line(end = [0, scale]) |> line(end = [0, scale])
|> line(end = [scale, 0]) |> line(end = [scale, 0])
@ -630,15 +628,14 @@ fn cube = (pos, scale) => {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::M, None).await.unwrap();
assert_out("cube_m", &result); assert_out("cube_m", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cube_in() { async fn kcl_test_cube_in() {
let code = r#"@settings(defaultLengthUnit = in) let code = r#"fn cube = (pos, scale) => {
fn cube = (pos, scale) => { sg = startSketchOn(XY)
sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
|> line(end = [0, scale]) |> line(end = [0, scale])
|> line(end = [scale, 0]) |> line(end = [scale, 0])
@ -652,15 +649,14 @@ fn cube = (pos, scale) => {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::In, None).await.unwrap();
assert_out("cube_in", &result); assert_out("cube_in", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cube_ft() { async fn kcl_test_cube_ft() {
let code = r#"@settings(defaultLengthUnit = ft) let code = r#"fn cube = (pos, scale) => {
fn cube = (pos, scale) => { sg = startSketchOn(XY)
sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
|> line(end = [0, scale]) |> line(end = [0, scale])
|> line(end = [scale, 0]) |> line(end = [scale, 0])
@ -674,15 +670,14 @@ fn cube = (pos, scale) => {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Ft, None).await.unwrap();
assert_out("cube_ft", &result); assert_out("cube_ft", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_cube_yd() { async fn kcl_test_cube_yd() {
let code = r#"@settings(defaultLengthUnit = yd) let code = r#"fn cube = (pos, scale) => {
fn cube = (pos, scale) => { sg = startSketchOn(XY)
sg = startSketchOn('XY')
|> startProfileAt(pos, %) |> startProfileAt(pos, %)
|> line(end = [0, scale]) |> line(end = [0, scale])
|> line(end = [scale, 0]) |> line(end = [scale, 0])
@ -696,7 +691,7 @@ fn cube = (pos, scale) => {
myCube = cube([0,0], 10) myCube = cube([0,0], 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Yd, None).await.unwrap();
assert_out("cube_yd", &result); assert_out("cube_yd", &result);
} }
@ -724,7 +719,7 @@ part002 = startSketchOn(part001, part001.sketch.tags.here)
|> extrude(length = 1) |> extrude(length = 1)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = result.err().unwrap(); let err = result.err().unwrap();
let ExecError::Kcl(err) = err else { let ExecError::Kcl(err) = err else {
@ -768,7 +763,7 @@ part003 = startSketchOn(part002, "end")
|> extrude(length = 5) |> extrude(length = 5)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("sketch_on_face_of_face", &result); assert_out("sketch_on_face_of_face", &result);
} }
@ -785,7 +780,7 @@ async fn kcl_test_stdlib_kcl_error_right_code_path() {
|> extrude(length = 2) |> extrude(length = 2)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = result.err().unwrap(); let err = result.err().unwrap();
let ExecError::Kcl(err) = err else { let ExecError::Kcl(err) = err else {
panic!("Expected KCL error, found {err}"); panic!("Expected KCL error, found {err}");
@ -816,7 +811,7 @@ part002 = startSketchOn(part001, "end")
|> extrude(length = 5) |> extrude(length = 5)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("sketch_on_face_circle", &result); assert_out("sketch_on_face_circle", &result);
} }
@ -842,10 +837,10 @@ holeIndex = 6
// Create the mounting plate extrusion, holes, and fillets // Create the mounting plate extrusion, holes, and fillets
part = rectShape([0, 0], 20, 20) part = rectShape([0, 0], 20, 20)
|> hole(circle(XY, [-holeIndex, holeIndex], holeRadius), %) |> hole(circle('XY', center = [-holeIndex, holeIndex], radius = holeRadius), %)
|> hole(circle(XY, [holeIndex, holeIndex], holeRadius), %) |> hole(circle('XY', center = [holeIndex, holeIndex], radius = holeRadius), %)
|> hole(circle(XY, [-holeIndex, -holeIndex], holeRadius), %) |> hole(circle('XY', center = [-holeIndex, -holeIndex], radius = holeRadius), %)
|> hole(circle(XY, [holeIndex, -holeIndex], holeRadius), %) |> hole(circle('XY', center = [holeIndex, -holeIndex], radius = holeRadius), %)
|> extrude(length = 2) |> extrude(length = 2)
|> fillet( |> fillet(
radius = 4, radius = 4,
@ -858,14 +853,14 @@ part = rectShape([0, 0], 20, 20)
) )
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = result.err().unwrap(); let err = result.err().unwrap();
let ExecError::Kcl(err) = err else { let ExecError::Kcl(err) = err else {
panic!("Expected KCL error, found {err}"); panic!("Expected KCL error, found {err}");
}; };
assert_eq!( assert_eq!(
err.error.message(), err.error.message(),
"This function requires a keyword argument 'center'" "The input argument of std::sketch::circle requires a value with type `Sketch | Plane | Face`, but found string (text)"
); );
} }
@ -885,7 +880,7 @@ async fn kcl_test_simple_revolve() {
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve", &result); assert_out("simple_revolve", &result);
} }
@ -905,7 +900,7 @@ async fn kcl_test_simple_revolve_uppercase() {
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve_uppercase", &result); assert_out("simple_revolve_uppercase", &result);
} }
@ -925,7 +920,7 @@ async fn kcl_test_simple_revolve_negative() {
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve_negative", &result); assert_out("simple_revolve_negative", &result);
} }
@ -945,7 +940,7 @@ async fn kcl_test_revolve_bad_angle_low() {
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert!(result assert!(result
@ -971,7 +966,7 @@ async fn kcl_test_revolve_bad_angle_high() {
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert!(result assert!(result
@ -997,7 +992,7 @@ async fn kcl_test_simple_revolve_custom_angle() {
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve_custom_angle", &result); assert_out("simple_revolve_custom_angle", &result);
} }
@ -1017,7 +1012,7 @@ async fn kcl_test_simple_revolve_custom_axis() {
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve_custom_axis", &result); assert_out("simple_revolve_custom_axis", &result);
} }
@ -1041,7 +1036,7 @@ sketch001 = startSketchOn(box, "end")
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("revolve_on_edge", &result); assert_out("revolve_on_edge", &result);
} }
@ -1065,7 +1060,7 @@ sketch001 = startSketchOn(box, revolveAxis)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
result.unwrap_err(); result.unwrap_err();
//this fails right now, but slightly differently, lets just say its enough for it to fail - mike //this fails right now, but slightly differently, lets just say its enough for it to fail - mike
@ -1093,7 +1088,7 @@ sketch001 = startSketchOn(box, "END")
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("revolve_on_face_circle_edge", &result); assert_out("revolve_on_face_circle_edge", &result);
} }
@ -1115,7 +1110,7 @@ sketch001 = startSketchOn(box, "END")
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("revolve_on_face_circle", &result); assert_out("revolve_on_face_circle", &result);
} }
@ -1141,7 +1136,7 @@ sketch001 = startSketchOn(box, "end")
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("revolve_on_face", &result); assert_out("revolve_on_face", &result);
} }
@ -1155,7 +1150,7 @@ async fn kcl_test_basic_revolve_circle() {
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("basic_revolve_circle", &result); assert_out("basic_revolve_circle", &result);
} }
@ -1182,7 +1177,7 @@ part002 = startSketchOn(part001, 'end')
|> extrude(length = 5) |> extrude(length = 5)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("simple_revolve_sketch_on_edge", &result); assert_out("simple_revolve_sketch_on_edge", &result);
} }
@ -1245,7 +1240,7 @@ plumbus1 = circle1
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("plumbus_fillets", &result); assert_out("plumbus_fillets", &result);
} }
@ -1253,7 +1248,7 @@ plumbus1 = circle1
async fn kcl_test_empty_file_is_ok() { async fn kcl_test_empty_file_is_ok() {
let code = r#""#; let code = r#""#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
result.unwrap(); result.unwrap();
} }
@ -1283,7 +1278,7 @@ async fn kcl_test_member_expression_in_params() {
capScrew([0, 0.5, 0], 50, 37.5, 50, 25) capScrew([0, 0.5, 0], 50, 37.5, 50, 25)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("member_expression_in_params", &result); assert_out("member_expression_in_params", &result);
} }
@ -1328,7 +1323,7 @@ bracket = startSketchOn(XY)
) )
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
result.unwrap(); result.unwrap();
} }
@ -1348,11 +1343,11 @@ secondSketch = startSketchOn(part001, '')
|> extrude(length = 20) |> extrude(length = 20)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([297, 299, 0])], message: "Argument at index 1 was supposed to be type Option<kcl_lib::std::sketch::FaceTag> but found string (text)" }"# r#"semantic: KclErrorDetails { source_ranges: [SourceRange([297, 299, 0])], message: "Argument at index 1 was supposed to be type Option<FaceTag> but found string (text)" }"#
); );
} }
@ -1379,7 +1374,7 @@ extrusion = startSketchOn(XY)
|> extrude(length = height) |> extrude(length = height)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1412,7 +1407,7 @@ sketch001 = [profile001, profile002]
extrude(sketch001, length = 10) extrude(sketch001, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("array_of_sketches", &result); assert_out("array_of_sketches", &result);
} }
@ -1449,7 +1444,7 @@ pattn1 = patternLinear3d(
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("pattern3d_array_of_extrudes", &result); assert_out("pattern3d_array_of_extrudes", &result);
} }
@ -1497,7 +1492,7 @@ baseExtrusion = extrude(sketch001, length = width)
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("fillets_referencing_other_fillets", &result); assert_out("fillets_referencing_other_fillets", &result);
} }
@ -1545,7 +1540,7 @@ baseExtrusion = extrude(sketch001, length = width)
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("chamfers_referencing_other_chamfers", &result); assert_out("chamfers_referencing_other_chamfers", &result);
} }
@ -1565,7 +1560,7 @@ async fn kcl_test_shell_with_tag() {
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("shell_with_tag", &result); assert_out("shell_with_tag", &result);
} }
@ -1596,7 +1591,7 @@ pattn1 = patternLinear3d(
) )
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("linear_pattern3d_filleted_sketch", &result); assert_out("linear_pattern3d_filleted_sketch", &result);
} }
@ -1623,7 +1618,7 @@ pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], i
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("circular_pattern3d_filleted_sketch", &result); assert_out("circular_pattern3d_filleted_sketch", &result);
} }
@ -1649,7 +1644,7 @@ part001 = cube([0,0], 20)
pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], instances = 5, arcDegrees = 360, rotateDuplicates = false) pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], instances = 5, arcDegrees = 360, rotateDuplicates = false)
"#; "#;
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("circular_pattern3d_chamfered_sketch", &result); assert_out("circular_pattern3d_chamfered_sketch", &result);
} }
@ -1676,7 +1671,7 @@ part001 = cube([0,0], 20)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = result.err().unwrap(); let err = result.err().unwrap();
let ExecError::Kcl(err) = err else { let ExecError::Kcl(err) = err else {
panic!("Expected KCL error, found {err}"); panic!("Expected KCL error, found {err}");
@ -1706,7 +1701,7 @@ async fn kcl_test_duplicate_tags_should_error() {
let p = triangle(200) let p = triangle(200)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1717,49 +1712,49 @@ let p = triangle(200)
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_global_tags() { async fn kcl_test_global_tags() {
let code = kcl_input!("global-tags"); let code = kcl_input!("global-tags");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("global_tags", &result); assert_out("global_tags", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_extrude_inside_fn_with_tags() { async fn kcl_test_extrude_inside_fn_with_tags() {
let code = kcl_input!("extrude-inside-fn-with-tags"); let code = kcl_input!("extrude-inside-fn-with-tags");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("extrude-inside-fn-with-tags", &result); assert_out("extrude-inside-fn-with-tags", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_pattern_vase() { async fn kcl_test_pattern_vase() {
let code = kcl_input!("pattern_vase"); let code = kcl_input!("pattern_vase");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("pattern_vase", &result); assert_out("pattern_vase", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_scoped_tags() { async fn kcl_test_scoped_tags() {
let code = kcl_input!("scoped-tags"); let code = kcl_input!("scoped-tags");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("scoped_tags", &result); assert_out("scoped_tags", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_order_sketch_extrude_in_order() { async fn kcl_test_order_sketch_extrude_in_order() {
let code = kcl_input!("order-sketch-extrude-in-order"); let code = kcl_input!("order-sketch-extrude-in-order");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("order-sketch-extrude-in-order", &result); assert_out("order-sketch-extrude-in-order", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_order_sketch_extrude_out_of_order() { async fn kcl_test_order_sketch_extrude_out_of_order() {
let code = kcl_input!("order-sketch-extrude-out-of-order"); let code = kcl_input!("order-sketch-extrude-out-of-order");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("order-sketch-extrude-out-of-order", &result); assert_out("order-sketch-extrude-out-of-order", &result);
} }
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_extrude_custom_plane() { async fn kcl_test_extrude_custom_plane() {
let code = kcl_input!("extrude-custom-plane"); let code = kcl_input!("extrude-custom-plane");
let result = execute_and_snapshot(code, None).await.unwrap(); let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
assert_out("extrude-custom-plane", &result); assert_out("extrude-custom-plane", &result);
} }
@ -1781,7 +1776,7 @@ async fn kcl_test_arc_error_same_start_end() {
) )
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1801,7 +1796,7 @@ async fn kcl_test_angled_line_to_x_90() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1821,7 +1816,7 @@ async fn kcl_test_angled_line_to_x_270() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1841,7 +1836,7 @@ async fn kcl_test_angled_line_to_y_0() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1861,7 +1856,7 @@ async fn kcl_test_angled_line_to_y_180() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1881,7 +1876,7 @@ async fn kcl_test_angled_line_of_x_length_90() {
extrusion = extrude(sketch001, length = 10) extrusion = extrude(sketch001, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1901,7 +1896,7 @@ async fn kcl_test_angled_line_of_x_length_270() {
extrusion = extrude(sketch001, length = 10) extrusion = extrude(sketch001, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1923,7 +1918,7 @@ async fn kcl_test_angled_line_of_y_length_0() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1945,7 +1940,7 @@ async fn kcl_test_angled_line_of_y_length_180() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1967,7 +1962,7 @@ async fn kcl_test_angled_line_of_y_length_negative_180() {
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
@ -1984,11 +1979,11 @@ async fn kcl_test_error_inside_fn_also_has_source_range_of_call_site() {
someFunction('INVALID') someFunction('INVALID')
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "Argument at index 0 was supposed to be type kcl_lib::std::sketch::SketchData but found string (text)" }"# r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
); );
} }
@ -2005,11 +2000,11 @@ async fn kcl_test_error_inside_fn_also_has_source_range_of_call_site_recursive()
someFunction('INVALID') someFunction('INVALID')
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert_eq!( assert_eq!(
result.err().unwrap().to_string(), result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "Argument at index 0 was supposed to be type kcl_lib::std::sketch::SketchData but found string (text)" }"# r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
); );
} }
@ -2029,7 +2024,7 @@ async fn kcl_test_error_no_auth_websocket() {
) )
"#; "#;
let result = execute_and_snapshot_no_auth(code, None).await; let result = execute_and_snapshot_no_auth(code, UnitLength::Mm, None).await;
assert!(result.is_err()); assert!(result.is_err());
assert!(result assert!(result
.err() .err()
@ -2055,7 +2050,9 @@ sketch000 = startSketchOn(XY)
|> line(end = [0, innerDiameter / 2]) |> line(end = [0, innerDiameter / 2])
"#; "#;
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await.unwrap(); let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
.await
.unwrap();
let mut exec_state = kcl_lib::ExecState::new(&ctx); let mut exec_state = kcl_lib::ExecState::new(&ctx);
let program = kcl_lib::Program::parse_no_errs(code).unwrap(); let program = kcl_lib::Program::parse_no_errs(code).unwrap();
ctx.run(&program, &mut exec_state).await.unwrap(); ctx.run(&program, &mut exec_state).await.unwrap();
@ -2078,7 +2075,9 @@ async fn kcl_test_ensure_nothing_left_in_batch_multi_file() {
// Change the current working directory to the test directory. // Change the current working directory to the test directory.
std::env::set_current_dir(path.parent().unwrap()).unwrap(); std::env::set_current_dir(path.parent().unwrap()).unwrap();
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await.unwrap(); let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
.await
.unwrap();
let mut exec_state = kcl_lib::ExecState::new(&ctx); let mut exec_state = kcl_lib::ExecState::new(&ctx);
let program = kcl_lib::Program::parse_no_errs(&code).unwrap(); let program = kcl_lib::Program::parse_no_errs(&code).unwrap();
ctx.run(&program, &mut exec_state).await.unwrap(); ctx.run(&program, &mut exec_state).await.unwrap();
@ -2096,7 +2095,7 @@ async fn kcl_test_better_type_names() {
|> circle(center = [-95.51, -74.7], radius = 262.23) |> circle(center = [-95.51, -74.7], radius = 262.23)
|> appearance(metalness = 0.9) |> appearance(metalness = 0.9)
"#; "#;
let result = execute_and_snapshot(code, None).await; let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
let err = match result.err() { let err = match result.err() {
Some(x) => match x { Some(x) => match x {
@ -2115,7 +2114,7 @@ async fn kcl_test_exporting_step_file() {
// This tests export like how we do it in cli and kcl.py. // This tests export like how we do it in cli and kcl.py.
let code = kcl_input!("helix_defaults_negative_extrude"); let code = kcl_input!("helix_defaults_negative_extrude");
let (_, _, files) = execute_and_export_step(code, None).await.unwrap(); let (_, _, files) = execute_and_export_step(code, UnitLength::Mm, None).await.unwrap();
for file in files { for file in files {
expectorate::assert_contents( expectorate::assert_contents(
format!("e2e/executor/outputs/helix_defaults_negative_extrude_{}", file.name), format!("e2e/executor/outputs/helix_defaults_negative_extrude_{}", file.name),

Some files were not shown because too many files have changed in this diff Show More