Compare commits
40 Commits
v0.45.0
...
lf94/speci
Author | SHA1 | Date | |
---|---|---|---|
b5bcb8a5ff | |||
5e72da5770 | |||
00be11f6d6 | |||
4fd53d527f | |||
0f75d945b1 | |||
9cc956ddff | |||
dec74f633b | |||
dfcea282ec | |||
191dcf8bb0 | |||
cb1bbe4660 | |||
ff66cb1deb | |||
ab46349d63 | |||
cffad78bf7 | |||
bfb81877d3 | |||
c56398db83 | |||
36e0d35968 | |||
62bf7d8715 | |||
a4db302174 | |||
66f3500ca9 | |||
c3bdc6f106 | |||
0a2bf4b55f | |||
bbae9b6363 | |||
180d52280d | |||
dce1dca7c7 | |||
343f6572a2 | |||
c8e58d49e0 | |||
c18546fb2f | |||
466c23a9d8 | |||
8403025c77 | |||
9ce591a1a1 | |||
f238f3882b | |||
a91208eb1c | |||
b92b0a9afe | |||
964347f43a | |||
3811c88b5c | |||
69a1473197 | |||
1f1e996cfa | |||
58167deda7 | |||
83d22a4f5f | |||
7003b19a70 |
@ -1,4 +1,4 @@
|
|||||||
src/wasm-lib/*
|
rust/*
|
||||||
*.typegen.ts
|
*.typegen.ts
|
||||||
packages/codemirror-lsp-client/dist/*
|
packages/codemirror-lsp-client/dist/*
|
||||||
e2e/playwright/snapshots/prompt-to-edit/*
|
e2e/playwright/snapshots/prompt-to-edit/*
|
||||||
|
10
.github/dependabot.yml
vendored
@ -25,7 +25,7 @@ updates:
|
|||||||
- adamchalmers
|
- adamchalmers
|
||||||
- jessfraz
|
- jessfraz
|
||||||
- package-ecosystem: 'cargo' # See documentation for possible values
|
- package-ecosystem: 'cargo' # See documentation for possible values
|
||||||
directory: '/src/wasm-lib/' # Location of package manifests
|
directory: '/rust/' # Location of package manifests
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
day: monday
|
day: monday
|
||||||
@ -39,3 +39,11 @@ updates:
|
|||||||
wasm-bindgen-deps:
|
wasm-bindgen-deps:
|
||||||
patterns:
|
patterns:
|
||||||
- "wasm-bindgen*"
|
- "wasm-bindgen*"
|
||||||
|
- package-ecosystem: "pip" # See documentation for possible values
|
||||||
|
directory: "/rust/kcl-python-bindings/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- jessfraz
|
||||||
|
4
.github/workflows/build-and-store-wasm.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Cache wasm
|
- name: Cache wasm
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -33,4 +33,4 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
path: src/wasm-lib/pkg
|
path: rust/kcl-wasm-lib/pkg
|
||||||
|
21
.github/workflows/build-apps.yml
vendored
@ -38,9 +38,9 @@ jobs:
|
|||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
|
|
||||||
# TODO: see if we can fetch from main instead if no diff at src/wasm-lib
|
# TODO: see if we can fetch from main instead if no diff at rust
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -67,7 +67,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
package.json
|
package.json
|
||||||
electron-builder.yml
|
electron-builder.yml
|
||||||
src/wasm-lib/pkg/wasm_lib*
|
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||||
release-notes.md
|
release-notes.md
|
||||||
assets/icon.ico
|
assets/icon.ico
|
||||||
assets/icon.png
|
assets/icon.png
|
||||||
@ -117,9 +117,9 @@ jobs:
|
|||||||
ls -R prepared-files
|
ls -R prepared-files
|
||||||
cp prepared-files/package.json package.json
|
cp prepared-files/package.json package.json
|
||||||
cp prepared-files/electron-builder.yml electron-builder.yml
|
cp prepared-files/electron-builder.yml electron-builder.yml
|
||||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||||
mkdir src/wasm-lib/pkg
|
mkdir rust/kcl-wasm-lib/pkg
|
||||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib* src/wasm-lib/pkg
|
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||||
cp prepared-files/release-notes.md release-notes.md
|
cp prepared-files/release-notes.md release-notes.md
|
||||||
cp prepared-files/assets/icon.ico assets/icon.ico
|
cp prepared-files/assets/icon.ico assets/icon.ico
|
||||||
cp prepared-files/assets/icon.png assets/icon.png
|
cp prepared-files/assets/icon.png assets/icon.png
|
||||||
@ -132,8 +132,9 @@ jobs:
|
|||||||
|
|
||||||
- name: yarn install
|
- name: yarn install
|
||||||
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
|
shell: bash
|
||||||
timeout_minutes: 2
|
timeout_minutes: 2
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn install
|
command: yarn install
|
||||||
@ -183,8 +184,9 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
|
shell: bash
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: yarn tronb:package:prod
|
||||||
@ -244,8 +246,9 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
|
shell: bash
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: yarn tronb:package:prod
|
||||||
|
8
.github/workflows/cargo-check.yml
vendored
@ -17,23 +17,21 @@ jobs:
|
|||||||
cargocheck:
|
cargocheck:
|
||||||
name: cargo check
|
name: cargo check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 1.85
|
||||||
override: true
|
override: true
|
||||||
|
default: true
|
||||||
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
uses: Swatinem/rust-cache@v2.6.1
|
uses: Swatinem/rust-cache@v2.6.1
|
||||||
|
|
||||||
- name: Run check
|
- name: Run check
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
# We specifically want to test the disable-println feature
|
# We specifically want to test the disable-println feature
|
||||||
# Since it is not enabled by default, we need to specify it
|
# Since it is not enabled by default, we need to specify it
|
||||||
# This is used in kcl-lsp
|
# This is used in kcl-lsp
|
||||||
|
8
.github/workflows/cargo-clippy.yml
vendored
@ -23,17 +23,15 @@ jobs:
|
|||||||
cargoclippy:
|
cargoclippy:
|
||||||
name: cargo clippy
|
name: cargo clippy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: taiki-e/install-action@just
|
- uses: taiki-e/install-action@just
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 1.85
|
||||||
override: true
|
override: true
|
||||||
|
default: true
|
||||||
components: clippy
|
components: clippy
|
||||||
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
@ -41,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
just lint
|
just lint
|
||||||
# If this fails, run "cargo check" to update Cargo.lock,
|
# If this fails, run "cargo check" to update Cargo.lock,
|
||||||
# then add Cargo.lock to the PR.
|
# then add Cargo.lock to the PR.
|
||||||
|
8
.github/workflows/cargo-fmt.yml
vendored
@ -26,16 +26,14 @@ jobs:
|
|||||||
cargofmt:
|
cargofmt:
|
||||||
name: cargo fmt
|
name: cargo fmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 1.85
|
||||||
override: true
|
override: true
|
||||||
|
default: true
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
@ -43,6 +41,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Run cargo fmt
|
- name: Run cargo fmt
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
cargo fmt -- --check
|
cargo fmt -- --check
|
||||||
shell: bash
|
shell: bash
|
||||||
|
14
.github/workflows/cargo-test.yml
vendored
@ -9,21 +9,19 @@ permissions: read-all
|
|||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
name: cargo test of wasm-lib
|
name: cargo test
|
||||||
jobs:
|
jobs:
|
||||||
cargotest:
|
cargotest:
|
||||||
name: cargo test
|
name: cargo test
|
||||||
runs-on: ubuntu-latest-8-cores
|
runs-on: ubuntu-latest-8-cores
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: 1.85
|
||||||
override: true
|
override: true
|
||||||
|
default: true
|
||||||
- name: Install vector
|
- name: Install vector
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
||||||
@ -45,8 +43,8 @@ jobs:
|
|||||||
- name: cargo test
|
- name: cargo test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --test-threads=1 --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
||||||
env:
|
env:
|
||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
RUST_MIN_STACK: 10485760000
|
RUST_MIN_STACK: 10485760000
|
||||||
@ -55,7 +53,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{secrets.CODECOV_TOKEN}}
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
flags: wasm-lib
|
flags: rust
|
||||||
verbose: true
|
verbose: true
|
||||||
files: lcov.info
|
files: lcov.info
|
||||||
|
|
||||||
|
53
.github/workflows/e2e-tests.yml
vendored
@ -3,6 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 * * * * # hourly
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -15,23 +17,6 @@ permissions:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
check-rust-changes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
rust-changed: ${{ steps.filter.outputs.rust }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- id: filter
|
|
||||||
name: Check for Rust changes
|
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
rust:
|
|
||||||
- 'src/wasm-lib/**'
|
|
||||||
|
|
||||||
electron:
|
electron:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
||||||
@ -42,8 +27,8 @@ jobs:
|
|||||||
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
||||||
shardIndex: [1, 2, 3, 4]
|
shardIndex: [1, 2, 3, 4]
|
||||||
shardTotal: [4]
|
shardTotal: [4]
|
||||||
|
# TODO: add ref here for main and latest release tag
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: check-rust-changes
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
@ -54,12 +39,19 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.app-token.outputs.token }}
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
- id: filter
|
||||||
|
name: Check for Rust changes
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
rust:
|
||||||
|
- 'rust/**'
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- uses: KittyCAD/action-install-cli@main
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
id: deps-install
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn
|
run: yarn
|
||||||
- name: Cache Playwright Browsers
|
- name: Cache Playwright Browsers
|
||||||
@ -73,7 +65,7 @@ jobs:
|
|||||||
run: yarn playwright install --with-deps
|
run: yarn playwright install --with-deps
|
||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
||||||
uses: dawidd6/action-download-artifact@v7
|
uses: dawidd6/action-download-artifact@v7
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
@ -81,11 +73,11 @@ jobs:
|
|||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
workflow: build-and-store-wasm.yml
|
workflow: build-and-store-wasm.yml
|
||||||
branch: main
|
branch: main
|
||||||
path: src/wasm-lib/pkg
|
path: rust/kcl-wasm-lib/pkg
|
||||||
- name: copy wasm blob
|
- name: copy wasm blob
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
run: cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
@ -93,15 +85,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
- name: Cache Wasm (because rust diff)
|
- name: Cache Wasm (because rust diff)
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
- name: OR Cache Wasm (because wasm cache failed)
|
- name: OR Cache Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
- name: install good sed
|
- name: install good sed
|
||||||
if: ${{ startsWith(matrix.os, 'macos') }}
|
if: ${{ startsWith(matrix.os, 'macos') }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -126,7 +118,7 @@ jobs:
|
|||||||
cat /tmp/vector.toml
|
cat /tmp/vector.toml
|
||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||||
- name: Build Wasm (because rust diff)
|
- name: Build Wasm (because rust diff)
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: OR Build Wasm (because wasm cache failed)
|
- name: OR Build Wasm (because wasm cache failed)
|
||||||
@ -142,7 +134,7 @@ jobs:
|
|||||||
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
||||||
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
||||||
run: |
|
run: |
|
||||||
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --trace=on --shard=1/1
|
yarn test:snapshots
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
@ -202,9 +194,10 @@ jobs:
|
|||||||
path: test-results/
|
path: test-results/
|
||||||
- name: Run playwright/electron flow (with retries)
|
- name: Run playwright/electron flow (with retries)
|
||||||
id: retry
|
id: retry
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
if: ${{ !cancelled() && steps.deps-install.outcome == 'success' }}
|
||||||
uses: nick-fields/retry@v3.0.1
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
|
shell: bash
|
||||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
max_attempts: 25
|
max_attempts: 25
|
||||||
|
179
.github/workflows/kcl-python-bindings.yml
vendored
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
# This file is autogenerated by maturin v1.6.0 and then modified
|
||||||
|
# To update, run
|
||||||
|
#
|
||||||
|
# maturin generate-ci github
|
||||||
|
#
|
||||||
|
name: kcl-python-bindings
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- 'rust/kcl-python-bindings/**'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/kcl-python-bindings.yml
|
||||||
|
tags:
|
||||||
|
- 'kcl-*'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- 'rust/kcl-python-bindings/**'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/kcl-python-bindings.yml
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linux-x86_64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: x86_64
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
manylinux: auto
|
||||||
|
before-script-linux: |
|
||||||
|
yum install openssl-devel -y
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-linux-x86_64
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
windows:
|
||||||
|
runs-on: windows-16-cores
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x64
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
architecture: ${{ matrix.target }}
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-windows-${{ matrix.target }}
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x86_64
|
||||||
|
- aarch64
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-macos-${{ matrix.target }}
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
- uses: taiki-e/install-action@just
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd rust/kcl-python-bindings
|
||||||
|
just setup-uv
|
||||||
|
just test
|
||||||
|
env:
|
||||||
|
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
|
||||||
|
sdist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install the latest version of uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- name: Install codespell
|
||||||
|
run: |
|
||||||
|
uv venv .venv
|
||||||
|
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||||
|
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||||
|
uv pip install pip --upgrade
|
||||||
|
- name: Build sdist
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
command: sdist
|
||||||
|
args: --out dist
|
||||||
|
- name: Upload sdist
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-sdist
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
needs: [linux-x86_64, windows, macos, sdist]
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
- name: Install the latest version of uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- name: Install codespell
|
||||||
|
run: |
|
||||||
|
cd rust/kcl-python-bindings
|
||||||
|
uv venv .venv
|
||||||
|
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||||
|
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||||
|
uv pip install pip --upgrade
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
env:
|
||||||
|
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
command: upload
|
||||||
|
args: --non-interactive --skip-existing wheels-*/*
|
24
.github/workflows/ruff.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: ruff
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: main
|
||||||
|
paths:
|
||||||
|
- '**.py'
|
||||||
|
- .github/workflows/ruff.yml
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.py'
|
||||||
|
- .github/workflows/ruff.yml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
jobs:
|
||||||
|
ruff:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/ruff-action@v3
|
||||||
|
|
2
.github/workflows/static-analysis.yml
vendored
@ -54,7 +54,7 @@ jobs:
|
|||||||
- run: yarn install
|
- run: yarn install
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
|
|
||||||
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
with:
|
with:
|
||||||
|
25
.gitignore
vendored
@ -26,16 +26,15 @@ yarn-error.log*
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.helix
|
.helix
|
||||||
src/wasm-lib/.idea
|
|
||||||
src/wasm-lib/.vscode
|
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
src/wasm-lib/target
|
rust/target
|
||||||
src/wasm-lib/bindings
|
rust/kcl-lib/bindings
|
||||||
src/wasm-lib/kcl/bindings
|
public/kcl_wasm_lib_bg.wasm
|
||||||
public/wasm_lib_bg.wasm
|
rust/lcov.info
|
||||||
src/wasm-lib/lcov.info
|
rust/kcl-wasm-lib/pkg
|
||||||
src/wasm-lib/grackle/test_json_output
|
*.snap.new
|
||||||
|
rust/kcl-lib/fuzz/Cargo.lock
|
||||||
|
|
||||||
e2e/playwright/playwright-secrets.env
|
e2e/playwright/playwright-secrets.env
|
||||||
e2e/playwright/temp1.png
|
e2e/playwright/temp1.png
|
||||||
@ -59,16 +58,18 @@ e2e/playwright/export-snapshots/*
|
|||||||
## generated files
|
## generated files
|
||||||
src/**/*.typegen.ts
|
src/**/*.typegen.ts
|
||||||
|
|
||||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
|
||||||
Mac_App_Distribution.provisionprofile
|
Mac_App_Distribution.provisionprofile
|
||||||
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
src/wasm-lib/pkg
|
|
||||||
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
venv
|
|
||||||
.vite/
|
.vite/
|
||||||
|
|
||||||
# electron
|
# electron
|
||||||
out/
|
out/
|
||||||
*.snap.new
|
|
||||||
|
# python
|
||||||
|
__pycache__/
|
||||||
|
uv.lock
|
||||||
|
rust/kcl-python-bindings/dist
|
||||||
|
venv
|
||||||
|
@ -7,8 +7,7 @@ coverage
|
|||||||
*.rs
|
*.rs
|
||||||
*.hbs
|
*.hbs
|
||||||
target
|
target
|
||||||
src/wasm-lib/pkg
|
rust/
|
||||||
src/wasm-lib/kcl/bindings
|
|
||||||
e2e/playwright/export-snapshots
|
e2e/playwright/export-snapshots
|
||||||
e2e/playwright/snapshots/prompt-to-edit
|
e2e/playwright/snapshots/prompt-to-edit
|
||||||
|
|
||||||
|
4
Makefile
@ -1,6 +1,6 @@
|
|||||||
.PHONY: dev
|
.PHONY: dev
|
||||||
|
|
||||||
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
|
KCL_WASM_LIB_FILES := $(wildcard rust/**/*.rs)
|
||||||
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||||
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ lee-electron-test:
|
|||||||
$(XSTATE_TYPEGENS): $(TS_SRC)
|
$(XSTATE_TYPEGENS): $(TS_SRC)
|
||||||
yarn xstate typegen 'src/**/*.ts?(x)'
|
yarn xstate typegen 'src/**/*.ts?(x)'
|
||||||
|
|
||||||
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
|
public/kcl_wasm_lib_bg.wasm: $(KCL_WASM_LIB_FILES)
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
|
|
||||||
node_modules: package.json yarn.lock
|
node_modules: package.json yarn.lock
|
||||||
|
28
README.md
@ -40,7 +40,7 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
|
|||||||
|
|
||||||
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
|
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
|
||||||
|
|
||||||
[Original demo slides](https://github.com/KittyCAD/Eng/files/10398178/demo.pdf)
|
[Original demo slides](https://github.com/user-attachments/files/19010536/demo.pdf)
|
||||||
|
|
||||||
## Get started
|
## Get started
|
||||||
|
|
||||||
@ -53,17 +53,20 @@ Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=r
|
|||||||
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
|
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
|
||||||
|
|
||||||
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
|
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
|
||||||
|
|
||||||
```
|
```
|
||||||
fnm install --corepack-enabled
|
fnm install --corepack-enabled
|
||||||
fnm use
|
fnm use
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the NPM dependencies with:
|
Install the NPM dependencies with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn install:rust
|
yarn install:rust
|
||||||
@ -75,6 +78,7 @@ yarn install:wasm-pack:cargo
|
|||||||
```
|
```
|
||||||
|
|
||||||
Then to build the WASM layer, run:
|
Then to build the WASM layer, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
@ -135,6 +139,7 @@ To package the app for your platform with electron-builder, run `yarn tronb:pack
|
|||||||
Which commands from setup are one off vs need to be run every time?
|
Which commands from setup are one off vs need to be run every time?
|
||||||
|
|
||||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
yarn install
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
@ -190,6 +195,7 @@ The other `build-apps` output in the release `build-apps` workflow (triggered by
|
|||||||
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
|
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
|
||||||
|
|
||||||
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
|
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
|
||||||
|
|
||||||
```
|
```
|
||||||
# Windows (PowerShell)
|
# Windows (PowerShell)
|
||||||
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
||||||
@ -213,7 +219,6 @@ A new `publish-apps-release` will kick in and you should be able to find it [her
|
|||||||
|
|
||||||
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
||||||
|
|
||||||
|
|
||||||
## Fuzzing the parser
|
## Fuzzing the parser
|
||||||
|
|
||||||
Make sure you install cargo fuzz:
|
Make sure you install cargo fuzz:
|
||||||
@ -223,7 +228,7 @@ $ cargo install cargo-fuzz
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd src/wasm-lib/kcl
|
$ cd rust/kcl-lib
|
||||||
|
|
||||||
# list the fuzz targets
|
# list the fuzz targets
|
||||||
$ cargo fuzz list
|
$ cargo fuzz list
|
||||||
@ -251,6 +256,7 @@ snapshottoken=<your-snapshot-token>
|
|||||||
For a portable way to run Playwright you'll need Docker.
|
For a portable way to run Playwright you'll need Docker.
|
||||||
|
|
||||||
#### Generic example
|
#### Generic example
|
||||||
|
|
||||||
After that, open a terminal and run:
|
After that, open a terminal and run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -263,7 +269,6 @@ and in another terminal, run:
|
|||||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Specific example
|
#### Specific example
|
||||||
|
|
||||||
open a terminal and run:
|
open a terminal and run:
|
||||||
@ -281,7 +286,6 @@ PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project=
|
|||||||
run a specific test change the test from `test('...` to `test.only('...`
|
run a specific test change the test from `test('...` to `test.only('...`
|
||||||
(note if you commit this, the tests will instantly fail without running any of the tests)
|
(note if you commit this, the tests will instantly fail without running any of the tests)
|
||||||
|
|
||||||
|
|
||||||
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
|
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
|
||||||
|
|
||||||
run headed
|
run headed
|
||||||
@ -375,17 +379,19 @@ Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testin
|
|||||||
- `just`
|
- `just`
|
||||||
|
|
||||||
#### Setting KITTYCAD_API_TOKEN
|
#### Setting KITTYCAD_API_TOKEN
|
||||||
|
|
||||||
Use the production zoo.dev token, set this environment variable before running the tests
|
Use the production zoo.dev token, set this environment variable before running the tests
|
||||||
|
|
||||||
#### Installing cargonextest
|
#### Installing cargonextest
|
||||||
|
|
||||||
```
|
```
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
cargo search cargo-nextest
|
cargo search cargo-nextest
|
||||||
cargo install cargo-nextest
|
cargo install cargo-nextest
|
||||||
```
|
```
|
||||||
|
|
||||||
#### just
|
#### just
|
||||||
|
|
||||||
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
||||||
|
|
||||||
#### Running the tests
|
#### Running the tests
|
||||||
@ -395,7 +401,7 @@ install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-bina
|
|||||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||||
# Make sure you installed cargo-nextest
|
# Make sure you installed cargo-nextest
|
||||||
# Make sure you installed just
|
# Make sure you installed just
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
just test
|
just test
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -403,7 +409,7 @@ just test
|
|||||||
# Without just
|
# Without just
|
||||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||||
# Make sure you installed cargo-nextest
|
# Make sure you installed cargo-nextest
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -412,13 +418,14 @@ Where `XXX` is an API token from the production engine (NOT the dev environment)
|
|||||||
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
||||||
|
|
||||||
```
|
```
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mapping CI CD jobs to local commands
|
### Mapping CI CD jobs to local commands
|
||||||
|
|
||||||
When you see the CI CD fail on jobs you may wonder three things
|
When you see the CI CD fail on jobs you may wonder three things
|
||||||
|
|
||||||
- Do I have a bug in my code?
|
- Do I have a bug in my code?
|
||||||
- Is the test flaky?
|
- Is the test flaky?
|
||||||
- Is there a bug in `main`?
|
- Is there a bug in `main`?
|
||||||
@ -437,7 +444,6 @@ yarn test-setup
|
|||||||
|
|
||||||
> Gotcha, are packages up to date and is the wasm built?
|
> Gotcha, are packages up to date and is the wasm built?
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tsc
|
yarn tsc
|
||||||
yarn fmt-check
|
yarn fmt-check
|
||||||
@ -493,7 +499,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
|||||||
|
|
||||||
## KCL
|
## KCL
|
||||||
|
|
||||||
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl).
|
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib).
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ example = extrude(exampleSketch, length = 5)
|
|||||||
```js
|
```js
|
||||||
// Add color to a revolved solid.
|
// Add color to a revolved solid.
|
||||||
sketch001 = startSketchOn('XY')
|
sketch001 = startSketchOn('XY')
|
||||||
|> circle({ center = [15, 0], radius = 5 }, %)
|
|> circle(center = [15, 0], radius = 5)
|
||||||
|> revolve({ angle = 360, axis = 'y' }, %)
|
|> revolve({ angle = 360, axis = 'y' }, %)
|
||||||
|> appearance(color = '#ff0000', metalness = 90, roughness = 90)
|
|> appearance(color = '#ff0000', metalness = 90, roughness = 90)
|
||||||
```
|
```
|
||||||
@ -195,10 +195,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|> line(end = [0, 7])
|
|> line(end = [0, 7])
|
||||||
|
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> appearance(color = "#ff0000", metalness = 50, roughness = 50)
|
|> appearance(color = "#ff0000", metalness = 50, roughness = 50)
|
||||||
|
@ -10,8 +10,9 @@ the provided (x, y) origin point.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
circle(
|
circle(
|
||||||
data: CircleData,
|
sketchOrSurface: SketchOrSurface,
|
||||||
sketchSurfaceOrGroup: SketchOrSurface,
|
center: [number],
|
||||||
|
radius: number,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
) -> Sketch
|
) -> Sketch
|
||||||
```
|
```
|
||||||
@ -21,9 +22,10 @@ circle(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes |
|
| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
| `center` | `[number]` | The center of the circle. | Yes |
|
||||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `radius` | `number` | The radius of the circle. | Yes |
|
||||||
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ circle(
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn("-XZ")
|
exampleSketch = startSketchOn("-XZ")
|
||||||
|> circle({ center = [0, 0], radius = 10 }, %)
|
|> circle(center = [0, 0], radius = 10)
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
```
|
```
|
||||||
@ -48,7 +50,7 @@ exampleSketch = startSketchOn("XZ")
|
|||||||
|> line(end = [0, 30])
|
|> line(end = [0, 30])
|
||||||
|> line(end = [-30, 0])
|
|> line(end = [-30, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|> hole(circle({ center = [0, 15], radius = 5 }, %), %)
|
|> hole(circle(center = [0, 15], radius = 5), %)
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
```
|
```
|
||||||
|
@ -18,7 +18,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_
|
|||||||
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)
|
||||||
```
|
```
|
||||||
|
@ -51,7 +51,7 @@ helixPath = helix(
|
|||||||
|
|
||||||
// Create a spring by sweeping around the helix path.
|
// Create a spring by sweeping around the helix path.
|
||||||
springSketch = startSketchOn('YZ')
|
springSketch = startSketchOn('YZ')
|
||||||
|> circle({ center = [0, 0], radius = 0.5 }, %)
|
|> circle(center = [0, 0], radius = 0.5)
|
||||||
|> sweep(path = helixPath)
|
|> sweep(path = helixPath)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ helixPath = helix(
|
|||||||
|
|
||||||
// Create a spring by sweeping around the helix path.
|
// Create a spring by sweeping around the helix path.
|
||||||
springSketch = startSketchOn('XY')
|
springSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 0.5 }, %)
|
|> circle(center = [0, 0], radius = 0.5)
|
||||||
|> sweep(path = helixPath)
|
|> sweep(path = helixPath)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ helixPath = helix(
|
|||||||
|
|
||||||
// Create a spring by sweeping around the helix path.
|
// Create a spring by sweeping around the helix path.
|
||||||
springSketch = startSketchOn('XY')
|
springSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1 }, %)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|> sweep(path = helixPath)
|
|> sweep(path = helixPath)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ helixRevolutions(
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
part001 = startSketchOn('XY')
|
part001 = startSketchOn('XY')
|
||||||
|> circle({ center = [5, 5], radius = 10 }, %)
|
|> circle(center = [5, 5], radius = 10)
|
||||||
|> extrude(length = 10)
|
|> extrude(length = 10)
|
||||||
|> helixRevolutions({
|
|> helixRevolutions({
|
||||||
angleStart = 0,
|
angleStart = 0,
|
||||||
|
@ -37,8 +37,8 @@ exampleSketch = startSketchOn(XY)
|
|||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> line(end = [0, -5])
|
|> line(end = [0, -5])
|
||||||
|> close()
|
|> close()
|
||||||
|> hole(circle({ center = [1, 1], radius = .25 }, %), %)
|
|> hole(circle(center = [1, 1], radius = .25), %)
|
||||||
|> hole(circle({ center = [1, 4], radius = .25 }, %), %)
|
|> hole(circle(center = [1, 4], radius = .25), %)
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 1)
|
example = extrude(exampleSketch, length = 1)
|
||||||
```
|
```
|
||||||
@ -57,7 +57,7 @@ fn squareHoleSketch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exampleSketch = startSketchOn(-XZ)
|
exampleSketch = startSketchOn(-XZ)
|
||||||
|> circle({ center = [0, 0], radius = 3 }, %)
|
|> circle(center = [0, 0], radius = 3)
|
||||||
|> hole(squareHoleSketch(), %)
|
|> hole(squareHoleSketch(), %)
|
||||||
example = extrude(exampleSketch, length = 1)
|
example = extrude(exampleSketch, length = 1)
|
||||||
```
|
```
|
||||||
|
@ -70,17 +70,11 @@ case = startSketchOn('-XZ')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
center = [size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
hollow(0.5, case)
|
hollow(0.5, case)
|
||||||
|
@ -37,7 +37,7 @@ n = int(ceil(5 / 2))
|
|||||||
assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
|
assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
|
||||||
// Draw n cylinders.
|
// Draw n cylinders.
|
||||||
startSketchOn('XZ')
|
startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> extrude(length = 5)
|
|> extrude(length = 5)
|
||||||
|> patternTransform(
|
|> patternTransform(
|
||||||
instances = n,
|
instances = n,
|
||||||
|
@ -69,10 +69,10 @@ squareSketch = startSketchOn('XY')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||||
|> circle({ center = [0, 100], radius = 20 }, %)
|
|> circle(center = [0, 100], radius = 20)
|
||||||
|
|
||||||
loft([
|
loft([
|
||||||
squareSketch,
|
squareSketch,
|
||||||
@ -94,10 +94,10 @@ squareSketch = startSketchOn('XY')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||||
|> circle({ center = [0, 100], radius = 20 }, %)
|
|> circle(center = [0, 100], radius = 20)
|
||||||
|
|
||||||
loft(
|
loft(
|
||||||
[
|
[
|
||||||
|
@ -34,7 +34,7 @@ map(
|
|||||||
r = 10 // radius
|
r = 10 // radius
|
||||||
fn drawCircle(id) {
|
fn drawCircle(id) {
|
||||||
return startSketchOn("XY")
|
return startSketchOn("XY")
|
||||||
|> circle({ center = [id * 2 * r, 0], radius = r }, %)
|
|> circle(center = [id * 2 * r, 0], radius = r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call `drawCircle`, passing in each element of the array.
|
// Call `drawCircle`, passing in each element of the array.
|
||||||
@ -50,7 +50,7 @@ r = 10 // radius
|
|||||||
// Call `map`, using an anonymous function instead of a named one.
|
// Call `map`, using an anonymous function instead of a named one.
|
||||||
circles = map([1..3], fn(id) {
|
circles = map([1..3], fn(id) {
|
||||||
return startSketchOn("XY")
|
return startSketchOn("XY")
|
||||||
|> circle({ center = [id * 2 * r, 0], radius = r }, %)
|
|> circle(center = [id * 2 * r, 0], radius = r)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ squareSketch = startSketchOn('XY')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch = startSketchOn(offsetPlane('XY', offset = 150))
|
circleSketch = startSketchOn(offsetPlane('XY', offset = 150))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
loft([squareSketch, circleSketch])
|
loft([squareSketch, circleSketch])
|
||||||
```
|
```
|
||||||
@ -59,7 +59,7 @@ squareSketch = startSketchOn('XZ')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch = startSketchOn(offsetPlane('XZ', offset = 150))
|
circleSketch = startSketchOn(offsetPlane('XZ', offset = 150))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
loft([squareSketch, circleSketch])
|
loft([squareSketch, circleSketch])
|
||||||
```
|
```
|
||||||
@ -77,7 +77,7 @@ squareSketch = startSketchOn('YZ')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch = startSketchOn(offsetPlane('YZ', offset = 150))
|
circleSketch = startSketchOn(offsetPlane('YZ', offset = 150))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
loft([squareSketch, circleSketch])
|
loft([squareSketch, circleSketch])
|
||||||
```
|
```
|
||||||
@ -95,7 +95,7 @@ squareSketch = startSketchOn('-XZ')
|
|||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))
|
circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))
|
||||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
|> circle(center = [0, 100], radius = 50)
|
||||||
|
|
||||||
loft([squareSketch, circleSketch])
|
loft([squareSketch, circleSketch])
|
||||||
```
|
```
|
||||||
@ -106,7 +106,7 @@ loft([squareSketch, circleSketch])
|
|||||||
// A circle on the XY plane
|
// A circle on the XY plane
|
||||||
startSketchOn("XY")
|
startSketchOn("XY")
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> circle({ radius = 10, center = [0, 0] }, %)
|
|> circle(radius = 10, center = [0, 0])
|
||||||
|
|
||||||
// Triangle on the plane 4 units above
|
// Triangle on the plane 4 units above
|
||||||
startSketchOn(offsetPlane("XY", offset = 4))
|
startSketchOn(offsetPlane("XY", offset = 4))
|
||||||
|
@ -42,7 +42,7 @@ patternCircular3d(
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn('XZ')
|
exampleSketch = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 1 }, %)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = -5)
|
example = extrude(exampleSketch, length = -5)
|
||||||
|> patternCircular3d(
|
|> patternCircular3d(
|
||||||
|
@ -38,7 +38,7 @@ patternLinear2d(
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn('XZ')
|
exampleSketch = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 1 }, %)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)
|
|> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 1)
|
example = extrude(exampleSketch, length = 1)
|
||||||
|
@ -64,17 +64,11 @@ case = startSketchOn('XY')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
center = [size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
// We pass in the "case" here since we want to pattern the whole sketch.
|
// We pass in the "case" here since we want to pattern the whole sketch.
|
||||||
@ -101,10 +95,7 @@ case = startSketchOn('XY')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
// We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face.
|
// We pass in `thing1` here with `useOriginal` since we want to pattern just this object on the face.
|
||||||
|
@ -68,7 +68,7 @@ fn transform(id) {
|
|||||||
|
|
||||||
// Sketch 4 cylinders.
|
// Sketch 4 cylinders.
|
||||||
sketch001 = startSketchOn('XZ')
|
sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> extrude(length = 5)
|
|> extrude(length = 5)
|
||||||
|> patternTransform(instances = 4, transform = transform)
|
|> patternTransform(instances = 4, transform = transform)
|
||||||
```
|
```
|
||||||
@ -84,7 +84,7 @@ fn transform(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sketch001 = startSketchOn('XZ')
|
sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> extrude(length = 5)
|
|> extrude(length = 5)
|
||||||
|> patternTransform(instances = 4, transform = transform)
|
|> patternTransform(instances = 4, transform = transform)
|
||||||
```
|
```
|
||||||
@ -184,7 +184,7 @@ fn transform(replicaId) {
|
|||||||
fn layer() {
|
fn layer() {
|
||||||
return startSketchOn("XY")
|
return startSketchOn("XY")
|
||||||
// or some other plane idk
|
// or some other plane idk
|
||||||
|> circle({ center = [0, 0], radius = 1 }, %, $tag1)
|
|> circle(center = [0, 0], radius = 1, tag = $tag1)
|
||||||
|> extrude(length = h)
|
|> extrude(length = h)
|
||||||
}
|
}
|
||||||
// The vase is 100 layers tall.
|
// The vase is 100 layers tall.
|
||||||
|
@ -42,7 +42,7 @@ fn transform(id) {
|
|||||||
|
|
||||||
// Sketch 4 circles.
|
// Sketch 4 circles.
|
||||||
sketch001 = startSketchOn('XZ')
|
sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> patternTransform2d(instances = 4, transform = transform)
|
|> patternTransform2d(instances = 4, transform = transform)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -31,10 +31,7 @@ pi() -> number
|
|||||||
circumference = 70
|
circumference = 70
|
||||||
|
|
||||||
exampleSketch = startSketchOn("XZ")
|
exampleSketch = startSketchOn("XZ")
|
||||||
|> circle({
|
|> circle(center = [0, 0], radius = circumference / (2 * pi()))
|
||||||
center = [0, 0],
|
|
||||||
radius = circumference / (2 * pi())
|
|
||||||
}, %)
|
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
```
|
```
|
||||||
|
@ -51,7 +51,7 @@ part001 = startSketchOn('XY')
|
|||||||
```js
|
```js
|
||||||
// A donut shape.
|
// A donut shape.
|
||||||
sketch001 = startSketchOn('XY')
|
sketch001 = startSketchOn('XY')
|
||||||
|> circle({ center = [15, 0], radius = 5 }, %)
|
|> circle(center = [15, 0], radius = 5)
|
||||||
|> revolve({ angle = 360, axis = 'y' }, %)
|
|> revolve({ angle = 360, axis = 'y' }, %)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ box = startSketchOn('XY')
|
|||||||
|> extrude(length = 20)
|
|> extrude(length = 20)
|
||||||
|
|
||||||
sketch001 = startSketchOn(box, "END")
|
sketch001 = startSketchOn(box, "END")
|
||||||
|> circle({ center = [10, 10], radius = 4 }, %)
|
|> circle(center = [10, 10], radius = 4)
|
||||||
|> revolve({ angle = -90, axis = 'y' }, %)
|
|> revolve({ angle = -90, axis = 'y' }, %)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ box = startSketchOn('XY')
|
|||||||
|> extrude(length = 20)
|
|> extrude(length = 20)
|
||||||
|
|
||||||
sketch001 = startSketchOn(box, "END")
|
sketch001 = startSketchOn(box, "END")
|
||||||
|> circle({ center = [10, 10], radius = 4 }, %)
|
|> circle(center = [10, 10], radius = 4)
|
||||||
|> revolve({
|
|> revolve({
|
||||||
angle = 90,
|
angle = 90,
|
||||||
axis = getOppositeEdge(revolveAxis)
|
axis = getOppositeEdge(revolveAxis)
|
||||||
@ -141,7 +141,7 @@ box = startSketchOn('XY')
|
|||||||
|> extrude(length = 20)
|
|> extrude(length = 20)
|
||||||
|
|
||||||
sketch001 = startSketchOn(box, "END")
|
sketch001 = startSketchOn(box, "END")
|
||||||
|> circle({ center = [10, 10], radius = 4 }, %)
|
|> circle(center = [10, 10], radius = 4)
|
||||||
|> revolve({
|
|> revolve({
|
||||||
angle = 90,
|
angle = 90,
|
||||||
axis = getOppositeEdge(revolveAxis),
|
axis = getOppositeEdge(revolveAxis),
|
||||||
|
@ -69,10 +69,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|
|
||||||
// Create a hole for the pipe.
|
// Create a hole for the pipe.
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> rotate(roll = 10, pitch = 10, yaw = 90)
|
|> rotate(roll = 10, pitch = 10, yaw = 90)
|
||||||
@ -95,10 +95,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|
|
||||||
// Create a hole for the pipe.
|
// Create a hole for the pipe.
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> rotate(axis = [0, 0, 1.0], angle = 90)
|
|> rotate(axis = [0, 0, 1.0], angle = 90)
|
||||||
|
@ -49,10 +49,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|
|
||||||
// Create a hole for the pipe.
|
// Create a hole for the pipe.
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> scale(scale = [1.0, 1.0, 2.5])
|
|> scale(scale = [1.0, 1.0, 2.5])
|
||||||
|
@ -40,10 +40,7 @@ cube = startSketchOn('XY')
|
|||||||
fn cylinder(radius, tag) {
|
fn cylinder(radius, tag) {
|
||||||
return startSketchOn('XY')
|
return startSketchOn('XY')
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> circle({
|
|> circle(radius = radius, center = segEnd(tag))
|
||||||
radius = radius,
|
|
||||||
center = segEnd(tag)
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = radius)
|
|> extrude(length = radius)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,10 +40,7 @@ cube = startSketchOn('XY')
|
|||||||
fn cylinder(radius, tag) {
|
fn cylinder(radius, tag) {
|
||||||
return startSketchOn('XY')
|
return startSketchOn('XY')
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> circle({
|
|> circle(radius = radius, center = segStart(tag))
|
||||||
radius = radius,
|
|
||||||
center = segStart(tag)
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = radius)
|
|> extrude(length = radius)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,17 +108,11 @@ case = startSketchOn('-XZ')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
center = [size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
// We put "case" in the shell function to shell the entire object.
|
// We put "case" in the shell function to shell the entire object.
|
||||||
@ -139,17 +133,11 @@ case = startSketchOn('XY')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
center = [size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
// We put "thing1" in the shell function to shell the end face of the object.
|
// We put "thing1" in the shell function to shell the end face of the object.
|
||||||
@ -173,17 +161,11 @@ case = startSketchOn('XY')
|
|||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
center = [-size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, 'end')
|
||||||
|> circle({
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
center = [size / 2, -size / 2],
|
|
||||||
radius = 25
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
// We put "thing1" and "thing2" in the shell function to shell the end face of the object.
|
// We put "thing1" and "thing2" in the shell function to shell the end face of the object.
|
||||||
|
5063
docs/kcl/std.json
@ -49,10 +49,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|
|
||||||
// Create a hole for the pipe.
|
// Create a hole for the pipe.
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
```
|
```
|
||||||
@ -75,7 +75,7 @@ helixPath = helix(
|
|||||||
|
|
||||||
// Create a spring by sweeping around the helix path.
|
// Create a spring by sweeping around the helix path.
|
||||||
springSketch = startSketchOn('YZ')
|
springSketch = startSketchOn('YZ')
|
||||||
|> circle({ center = [0, 0], radius = 1 }, %)
|
|> circle(center = [0, 0], radius = 1)
|
||||||
|> sweep(path = helixPath)
|
|> sweep(path = helixPath)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ bottom = startSketchOn("XY")
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
circSketch = startSketchOn("XY")
|
circSketch = startSketchOn("XY")
|
||||||
|> circle({ center = [0, 0], radius = 3 }, %, $circ)
|
|> circle(center = [0, 0], radius = 3, tag = $circ)
|
||||||
|
|
||||||
triangleSketch = startSketchOn("XY")
|
triangleSketch = startSketchOn("XY")
|
||||||
|> startProfileAt([-5, 0], %)
|
|> startProfileAt([-5, 0], %)
|
||||||
|
@ -47,10 +47,10 @@ sweepPath = startSketchOn('XZ')
|
|||||||
|
|
||||||
// Create a hole for the pipe.
|
// Create a hole for the pipe.
|
||||||
pipeHole = startSketchOn('XY')
|
pipeHole = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 1.5 }, %)
|
|> circle(center = [0, 0], radius = 1.5)
|
||||||
|
|
||||||
sweepSketch = startSketchOn('XY')
|
sweepSketch = startSketchOn('XY')
|
||||||
|> circle({ center = [0, 0], radius = 2 }, %)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|> hole(pipeHole, %)
|
|> hole(pipeHole, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> translate(translate = [1.0, 1.0, 2.5])
|
|> translate(translate = [1.0, 1.0, 2.5])
|
||||||
|
@ -689,7 +689,7 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
|
|||||||
await page.keyboard.press('ArrowDown')
|
await page.keyboard.press('ArrowDown')
|
||||||
await page.keyboard.press('Enter')
|
await page.keyboard.press('Enter')
|
||||||
await page.keyboard.type(`extrusion = startSketchOn('XY')
|
await page.keyboard.type(`extrusion = startSketchOn('XY')
|
||||||
|> circle({ center: [0, 0], radius: dia/2 }, %)
|
|> circle(center: [0, 0], radius: dia/2)
|
||||||
|> hole(squareHole(length, width, height), %)
|
|> hole(squareHole(length, width, height), %)
|
||||||
|> extrude(length = height)`)
|
|> extrude(length = height)`)
|
||||||
|
|
||||||
|
@ -50,13 +50,13 @@ const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ')
|
|||||||
|> close(%)
|
|> close(%)
|
||||||
extrude001 = extrude(sketch001, length = 10)
|
extrude001 = extrude(sketch001, length = 10)
|
||||||
sketch002 = startSketchOn(extrude001, rectangleSegmentB001)
|
sketch002 = startSketchOn(extrude001, rectangleSegmentB001)
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [-1, 2],
|
center = [-1, 2],
|
||||||
radius = .5
|
radius = .5
|
||||||
}, %)
|
)
|
||||||
plane001 = offsetPlane('XZ', offset = -5)
|
plane001 = offsetPlane('XZ', offset = -5)
|
||||||
sketch003 = startSketchOn(plane001)
|
sketch003 = startSketchOn(plane001)
|
||||||
|> circle({ center = [0, 0], radius = 5 }, %)
|
|> circle(center = [0, 0], radius = 5)
|
||||||
`
|
`
|
||||||
|
|
||||||
test.describe('Feature Tree pane', () => {
|
test.describe('Feature Tree pane', () => {
|
||||||
@ -201,7 +201,7 @@ test.describe('Feature Tree pane', () => {
|
|||||||
await toolbar.exitSketchBtn.click()
|
await toolbar.exitSketchBtn.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('On an offset plane should *not* work', async () => {
|
await test.step('On an offset plane should work', async () => {
|
||||||
// Tooltip is getting in the way of clicking, so I'm first closing the pane
|
// Tooltip is getting in the way of clicking, so I'm first closing the pane
|
||||||
await toolbar.closeFeatureTreePane()
|
await toolbar.closeFeatureTreePane()
|
||||||
await (await toolbar.getFeatureTreeOperation('Sketch', 2)).dblclick()
|
await (await toolbar.getFeatureTreeOperation('Sketch', 2)).dblclick()
|
||||||
@ -212,13 +212,7 @@ test.describe('Feature Tree pane', () => {
|
|||||||
})
|
})
|
||||||
await expect(
|
await expect(
|
||||||
toolbar.exitSketchBtn,
|
toolbar.exitSketchBtn,
|
||||||
'We should not be in sketch mode now'
|
'We should be in sketch mode now'
|
||||||
).not.toBeVisible()
|
|
||||||
await expect(
|
|
||||||
page.getByText(
|
|
||||||
'Editing sketches on faces or offset planes through the feature tree is not yet supported'
|
|
||||||
),
|
|
||||||
'We should see a toast message about this'
|
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -234,11 +228,11 @@ test.describe('Feature Tree pane', () => {
|
|||||||
}) => {
|
}) => {
|
||||||
const initialInput = '23'
|
const initialInput = '23'
|
||||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 5 }, %)
|
|> circle(center = [0, 0], radius = 5)
|
||||||
renamedExtrude = extrude(sketch001, length = ${initialInput})`
|
renamedExtrude = extrude(sketch001, length = ${initialInput})`
|
||||||
const newConstantName = 'distance001'
|
const newConstantName = 'distance001'
|
||||||
const expectedCode = `sketch001 = startSketchOn('XZ')
|
const expectedCode = `sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 5 }, %)
|
|> circle(center = [0, 0], radius = 5)
|
||||||
${newConstantName} = 23
|
${newConstantName} = 23
|
||||||
renamedExtrude = extrude(sketch001, length = ${newConstantName})`
|
renamedExtrude = extrude(sketch001, length = ${newConstantName})`
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ test.describe('when using the file tree to', () => {
|
|||||||
|
|
||||||
// File the main.kcl with contents
|
// File the main.kcl with contents
|
||||||
const kclCube = await fsp.readFile(
|
const kclCube = await fsp.readFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/cube.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/cube.kcl',
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
await pasteCodeInEditor(kclCube)
|
await pasteCodeInEditor(kclCube)
|
||||||
@ -245,7 +245,7 @@ test.describe('when using the file tree to', () => {
|
|||||||
await createProject({ name: 'project-000', page })
|
await createProject({ name: 'project-000', page })
|
||||||
// File the main.kcl with contents
|
// File the main.kcl with contents
|
||||||
const kclCube = await fsp.readFile(
|
const kclCube = await fsp.readFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/cube.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/cube.kcl',
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
await pasteCodeInEditor(kclCube)
|
await pasteCodeInEditor(kclCube)
|
||||||
@ -283,7 +283,7 @@ test.describe('when using the file tree to', () => {
|
|||||||
|
|
||||||
// Create a small file
|
// Create a small file
|
||||||
const kclCube = await fsp.readFile(
|
const kclCube = await fsp.readFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/cube.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/cube.kcl',
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
// pasted into main.kcl
|
// pasted into main.kcl
|
||||||
@ -297,7 +297,7 @@ test.describe('when using the file tree to', () => {
|
|||||||
await expect(legoFile).toBeVisible({ timeout: 60_000 })
|
await expect(legoFile).toBeVisible({ timeout: 60_000 })
|
||||||
await legoFile.click()
|
await legoFile.click()
|
||||||
const kclLego = await fsp.readFile(
|
const kclLego = await fsp.readFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/lego.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
await pasteCodeInEditor(kclLego)
|
await pasteCodeInEditor(kclLego)
|
||||||
|
@ -47,6 +47,8 @@ export class CmdBarFixture {
|
|||||||
private _serialiseCmdBar = async (): Promise<CmdBarSerialised> => {
|
private _serialiseCmdBar = async (): Promise<CmdBarSerialised> => {
|
||||||
if (!(await this.page.getByTestId('command-bar-wrapper').isVisible())) {
|
if (!(await this.page.getByTestId('command-bar-wrapper').isVisible())) {
|
||||||
return { stage: 'commandBarClosed' }
|
return { stage: 'commandBarClosed' }
|
||||||
|
} else if (await this.page.getByTestId('cmd-bar-search').isVisible()) {
|
||||||
|
return { stage: 'pickCommand' }
|
||||||
}
|
}
|
||||||
const reviewForm = this.page.locator('#review-form')
|
const reviewForm = this.page.locator('#review-form')
|
||||||
const getHeaderArgs = async () => {
|
const getHeaderArgs = async () => {
|
||||||
|
@ -45,7 +45,7 @@ export class AuthenticatedApp {
|
|||||||
}
|
}
|
||||||
getInputFile = (fileName: string) => {
|
getInputFile = (fileName: string) => {
|
||||||
return fsp.readFile(
|
return fsp.readFile(
|
||||||
join('src', 'wasm-lib', 'tests', 'executor', 'inputs', fileName),
|
join('rust', 'kcl-lib', 'e2e', 'executor', 'inputs', fileName),
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
import type { Page, Locator } from '@playwright/test'
|
import type { Page, Locator } from '@playwright/test'
|
||||||
import { expect } from '@playwright/test'
|
import { expect } from '../zoo-test'
|
||||||
import { isArray, uuidv4 } from 'lib/utils'
|
import { isArray, uuidv4 } from 'lib/utils'
|
||||||
|
import { CmdBarFixture } from './cmdBarFixture'
|
||||||
import {
|
import {
|
||||||
closeDebugPanel,
|
closeDebugPanel,
|
||||||
doAndWaitForImageDiff,
|
doAndWaitForImageDiff,
|
||||||
getPixelRGBs,
|
getPixelRGBs,
|
||||||
openAndClearDebugPanel,
|
openAndClearDebugPanel,
|
||||||
sendCustomCmd,
|
sendCustomCmd,
|
||||||
|
getUtils,
|
||||||
} from '../test-utils'
|
} from '../test-utils'
|
||||||
|
|
||||||
type MouseParams = {
|
type MouseParams = {
|
||||||
@ -40,9 +42,13 @@ export class SceneFixture {
|
|||||||
public page: Page
|
public page: Page
|
||||||
public streamWrapper!: Locator
|
public streamWrapper!: Locator
|
||||||
public loadingIndicator!: Locator
|
public loadingIndicator!: Locator
|
||||||
|
public networkToggleConnected!: Locator
|
||||||
|
public startEditSketchBtn!: Locator
|
||||||
|
|
||||||
get exeIndicator() {
|
get exeIndicator() {
|
||||||
return this.page.getByTestId('model-state-indicator-execution-done')
|
return this.page
|
||||||
|
.getByTestId('model-state-indicator-execution-done')
|
||||||
|
.or(this.page.getByTestId('model-state-indicator-receive-reliable'))
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(page: Page) {
|
constructor(page: Page) {
|
||||||
@ -70,7 +76,11 @@ export class SceneFixture {
|
|||||||
this.page = page
|
this.page = page
|
||||||
|
|
||||||
this.streamWrapper = page.getByTestId('stream')
|
this.streamWrapper = page.getByTestId('stream')
|
||||||
|
this.networkToggleConnected = page.getByTestId('network-toggle-ok')
|
||||||
this.loadingIndicator = this.streamWrapper.getByTestId('loading')
|
this.loadingIndicator = this.streamWrapper.getByTestId('loading')
|
||||||
|
this.startEditSketchBtn = page
|
||||||
|
.getByRole('button', { name: 'Start Sketch' })
|
||||||
|
.or(page.getByRole('button', { name: 'Edit Sketch' }))
|
||||||
}
|
}
|
||||||
|
|
||||||
makeMouseHelpers = (
|
makeMouseHelpers = (
|
||||||
@ -229,6 +239,27 @@ export class SceneFixture {
|
|||||||
await expect(this.exeIndicator).toBeVisible({ timeout: 30000 })
|
await expect(this.exeIndicator).toBeVisible({ timeout: 30000 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectionEstablished = async () => {
|
||||||
|
const timeout = 30000
|
||||||
|
await expect(this.networkToggleConnected).toBeVisible({ timeout })
|
||||||
|
}
|
||||||
|
|
||||||
|
settled = async (cmdBar: CmdBarFixture) => {
|
||||||
|
const u = await getUtils(this.page)
|
||||||
|
|
||||||
|
await cmdBar.openCmdBar()
|
||||||
|
await cmdBar.chooseCommand('Settings · app · show debug panel')
|
||||||
|
await cmdBar.selectOption({ name: 'on' }).click()
|
||||||
|
|
||||||
|
await u.openDebugPanel()
|
||||||
|
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||||
|
await u.clearAndCloseDebugPanel()
|
||||||
|
|
||||||
|
await this.waitForExecutionDone()
|
||||||
|
await expect(this.startEditSketchBtn).not.toBeDisabled()
|
||||||
|
await expect(this.startEditSketchBtn).toBeVisible()
|
||||||
|
}
|
||||||
|
|
||||||
expectPixelColor = async (
|
expectPixelColor = async (
|
||||||
colour: [number, number, number] | [number, number, number][],
|
colour: [number, number, number] | [number, number, number][],
|
||||||
coords: { x: number; y: number },
|
coords: { x: number; y: number },
|
||||||
|
@ -61,7 +61,7 @@ export class ToolbarFixture {
|
|||||||
this.rectangleBtn = page.getByTestId('corner-rectangle')
|
this.rectangleBtn = page.getByTestId('corner-rectangle')
|
||||||
this.lengthConstraintBtn = page.getByTestId('constraint-length')
|
this.lengthConstraintBtn = page.getByTestId('constraint-length')
|
||||||
this.exitSketchBtn = page.getByTestId('sketch-exit')
|
this.exitSketchBtn = page.getByTestId('sketch-exit')
|
||||||
this.editSketchBtn = page.getByText('Edit Sketch')
|
this.editSketchBtn = page.locator('[name="Edit Sketch"]')
|
||||||
this.fileTreeBtn = page.locator('[id="files-button-holder"]')
|
this.fileTreeBtn = page.locator('[id="files-button-holder"]')
|
||||||
this.createFileBtn = page.getByTestId('create-file-button')
|
this.createFileBtn = page.getByTestId('create-file-button')
|
||||||
this.treeInputField = page.getByTestId('tree-input-field')
|
this.treeInputField = page.getByTestId('tree-input-field')
|
||||||
|
@ -22,7 +22,7 @@ test.describe('Point-and-click tests', () => {
|
|||||||
path.resolve(
|
path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../',
|
'../../',
|
||||||
'./src/wasm-lib/tests/executor/inputs/test-circle-extrude.kcl'
|
'./rust/kcl-lib/e2e/executor/inputs/test-circle-extrude.kcl'
|
||||||
),
|
),
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
@ -42,27 +42,25 @@ test.describe('Point-and-click tests', () => {
|
|||||||
|
|
||||||
await test.step('check code model connection works and that button is still enable once circle is selected ', async () => {
|
await test.step('check code model connection works and that button is still enable once circle is selected ', async () => {
|
||||||
await moveToCircle()
|
await moveToCircle()
|
||||||
const circleSnippet =
|
const circleSnippet = 'circle(center = [318.33, 168.1], radius = 182.8)'
|
||||||
'circle({ center = [318.33, 168.1], radius = 182.8 }, %)'
|
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: ["constsketch002=startSketchOn('XZ')"],
|
activeLines: ["sketch002=startSketchOn('XZ')"],
|
||||||
highlightedCode: circleSnippet,
|
highlightedCode: circleSnippet,
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('check code model connection works and that button is still enable once circle is selected ', async () => {
|
await test.step('check code model connection works and that button is still enable once circle is selected ', async () => {
|
||||||
await moveToCircle()
|
await moveToCircle()
|
||||||
const circleSnippet =
|
const circleSnippet = 'circle(center = [318.33, 168.1], radius = 182.8)'
|
||||||
'circle({ center = [318.33, 168.1], radius = 182.8 }, %)'
|
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: ["constsketch002=startSketchOn('XZ')"],
|
activeLines: ["sketch002=startSketchOn('XZ')"],
|
||||||
highlightedCode: circleSnippet,
|
highlightedCode: circleSnippet,
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
await clickCircle()
|
await clickCircle()
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: [circleSnippet.slice(-5)],
|
activeLines: ['|>' + circleSnippet],
|
||||||
highlightedCode: circleSnippet,
|
highlightedCode: circleSnippet,
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
@ -193,7 +191,7 @@ test.describe('Point-and-click tests', () => {
|
|||||||
path.resolve(
|
path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../',
|
'../../',
|
||||||
'./src/wasm-lib/tests/executor/inputs/e2e-can-sketch-on-chamfer.kcl'
|
'./rust/kcl-lib/e2e/executor/inputs/e2e-can-sketch-on-chamfer.kcl'
|
||||||
),
|
),
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
@ -381,7 +379,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|
|||||||
path.resolve(
|
path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../',
|
'../../',
|
||||||
'./src/wasm-lib/tests/executor/inputs/e2e-can-sketch-on-chamfer-no-pipeExpr.kcl'
|
'./rust/kcl-lib/e2e/executor/inputs/e2e-can-sketch-on-chamfer-no-pipeExpr.kcl'
|
||||||
),
|
),
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
@ -581,7 +579,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|
|||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
|
|
||||||
const initialCode = `closedSketch = startSketchOn('XZ')
|
const initialCode = `closedSketch = startSketchOn('XZ')
|
||||||
|> circle({ center = [8, 5], radius = 2 }, %)
|
|> circle(center = [8, 5], radius = 2)
|
||||||
openSketch = startSketchOn('XY')
|
openSketch = startSketchOn('XY')
|
||||||
|> startProfileAt([-5, 0], %)
|
|> startProfileAt([-5, 0], %)
|
||||||
|> line(endAbsolute = [0, 5])
|
|> line(endAbsolute = [0, 5])
|
||||||
@ -633,8 +631,8 @@ openSketch = startSketchOn('XY')
|
|||||||
await expect(toolbar.startSketchBtn).not.toBeVisible()
|
await expect(toolbar.startSketchBtn).not.toBeVisible()
|
||||||
await expect(toolbar.exitSketchBtn).toBeVisible()
|
await expect(toolbar.exitSketchBtn).toBeVisible()
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: [`|>circle({center=[8,5],radius=2},%)`],
|
activeLines: [`|>circle(center=[8,5],radius=2)`],
|
||||||
highlightedCode: 'circle({center=[8,5],radius=2},%)',
|
highlightedCode: 'circle(center=[8,5],radius=2)',
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -1192,10 +1190,10 @@ openSketch = startSketchOn('XY')
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
|> circle(center = [0, 0], radius = 30)
|
||||||
plane001 = offsetPlane('XZ', offset = 50)
|
plane001 = offsetPlane('XZ', offset = 50)
|
||||||
sketch002 = startSketchOn(plane001)
|
sketch002 = startSketchOn(plane001)
|
||||||
|> circle({ center = [0, 0], radius = 20 }, %)
|
|> circle(center = [0, 0], radius = 20)
|
||||||
`
|
`
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
localStorage.setItem('persistCode', initialCode)
|
localStorage.setItem('persistCode', initialCode)
|
||||||
@ -1278,10 +1276,10 @@ openSketch = startSketchOn('XY')
|
|||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
|> circle(center = [0, 0], radius = 30)
|
||||||
plane001 = offsetPlane('XZ', offset = 50)
|
plane001 = offsetPlane('XZ', offset = 50)
|
||||||
sketch002 = startSketchOn(plane001)
|
sketch002 = startSketchOn(plane001)
|
||||||
|> circle({ center = [0, 0], radius = 20 }, %)
|
|> circle(center = [0, 0], radius = 20)
|
||||||
loft001 = loft([sketch001, sketch002])
|
loft001 = loft([sketch001, sketch002])
|
||||||
`
|
`
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
@ -1304,7 +1302,7 @@ loft001 = loft([sketch001, sketch002])
|
|||||||
await scene.expectPixelColor([89, 89, 89], testPoint, 15)
|
await scene.expectPixelColor([89, 89, 89], testPoint, 15)
|
||||||
await clickOnSketch1()
|
await clickOnSketch1()
|
||||||
await expect(page.locator('.cm-activeLine')).toHaveText(`
|
await expect(page.locator('.cm-activeLine')).toHaveText(`
|
||||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
|> circle(center = [0, 0], radius = 30)
|
||||||
`)
|
`)
|
||||||
await page.keyboard.press('Delete')
|
await page.keyboard.press('Delete')
|
||||||
// Check for sketch 1
|
// Check for sketch 1
|
||||||
@ -1315,7 +1313,7 @@ loft001 = loft([sketch001, sketch002])
|
|||||||
await page.waitForTimeout(1000)
|
await page.waitForTimeout(1000)
|
||||||
await clickOnSketch2()
|
await clickOnSketch2()
|
||||||
await expect(page.locator('.cm-activeLine')).toHaveText(`
|
await expect(page.locator('.cm-activeLine')).toHaveText(`
|
||||||
|> circle({ center = [0, 0], radius = 20 }, %)
|
|> circle(center = [0, 0], radius = 20)
|
||||||
`)
|
`)
|
||||||
await page.keyboard.press('Delete')
|
await page.keyboard.press('Delete')
|
||||||
// Check for plane001
|
// Check for plane001
|
||||||
@ -1344,10 +1342,10 @@ loft001 = loft([sketch001, sketch002])
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('YZ')
|
const initialCode = `sketch001 = startSketchOn('YZ')
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
radius = 500
|
radius = 500
|
||||||
}, %)
|
)
|
||||||
sketch002 = startSketchOn('XZ')
|
sketch002 = startSketchOn('XZ')
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> xLine(-500, %)
|
|> xLine(-500, %)
|
||||||
@ -1438,10 +1436,10 @@ sketch002 = startSketchOn('XZ')
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('YZ')
|
const initialCode = `sketch001 = startSketchOn('YZ')
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
radius = 500
|
radius = 500
|
||||||
}, %)
|
)
|
||||||
sketch002 = startSketchOn('XZ')
|
sketch002 = startSketchOn('XZ')
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> xLine(-500, %)
|
|> xLine(-500, %)
|
||||||
@ -2270,7 +2268,7 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
const initialCode = `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)
|
||||||
`
|
`
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
@ -2445,19 +2443,19 @@ extrude001 = extrude(sketch001, length = 40)
|
|||||||
|
|
||||||
const shellSketchOnFacesCases = [
|
const shellSketchOnFacesCases = [
|
||||||
`sketch001 = startSketchOn('XZ')
|
`sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [0, 0], radius = 100 }, %)
|
|> circle(center = [0, 0], radius = 100)
|
||||||
|> extrude(length = 100)
|
|> extrude(length = 100)
|
||||||
|
|
||||||
sketch002 = startSketchOn(sketch001, 'END')
|
sketch002 = startSketchOn(sketch001, 'END')
|
||||||
|> circle({ center = [0, 0], radius = 50 }, %)
|
|> circle(center = [0, 0], radius = 50)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
`,
|
`,
|
||||||
`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)
|
||||||
|
|
||||||
sketch002 = startSketchOn(extrude001, 'END')
|
sketch002 = startSketchOn(extrude001, 'END')
|
||||||
|> circle({ center = [0, 0], radius = 50 }, %)
|
|> circle(center = [0, 0], radius = 50)
|
||||||
extrude002 = extrude(sketch002, length = 50)
|
extrude002 = extrude(sketch002, length = 50)
|
||||||
`,
|
`,
|
||||||
]
|
]
|
||||||
@ -2631,10 +2629,10 @@ profile001 = startProfileAt([-20, 20], sketch001)
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('YZ')
|
const initialCode = `sketch001 = startSketchOn('YZ')
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
radius = 500
|
radius = 500
|
||||||
}, %)
|
)
|
||||||
sketch002 = startSketchOn('XZ')
|
sketch002 = startSketchOn('XZ')
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> xLine(-2000, %)
|
|> xLine(-2000, %)
|
||||||
@ -2761,10 +2759,10 @@ segAng(rectangleSegmentA001),
|
|||||||
|> close()
|
|> close()
|
||||||
extrude001 = extrude(sketch001, length = 50)
|
extrude001 = extrude(sketch001, length = 50)
|
||||||
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
|
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [-11.34, 10.0],
|
center = [-11.34, 10.0],
|
||||||
radius = 8.69
|
radius = 8.69
|
||||||
}, %)
|
)
|
||||||
`
|
`
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
localStorage.setItem('persistCode', initialCode)
|
localStorage.setItem('persistCode', initialCode)
|
||||||
@ -2811,10 +2809,10 @@ radius = 8.69
|
|||||||
|> close()
|
|> close()
|
||||||
extrude001 = extrude(sketch001, length = 5)
|
extrude001 = extrude(sketch001, length = 5)
|
||||||
sketch003 = startSketchOn(extrude001, 'START')
|
sketch003 = startSketchOn(extrude001, 'START')
|
||||||
|> circle({
|
|> circle(
|
||||||
center = [-0.69, 0.56],
|
center = [-0.69, 0.56],
|
||||||
radius = 0.28
|
radius = 0.28
|
||||||
}, %)
|
)
|
||||||
`
|
`
|
||||||
|
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
@ -2849,10 +2847,11 @@ radius = 8.69
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||||
profile001 = circle({
|
profile001 = circle(
|
||||||
|
sketch001,
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
radius = 100
|
radius = 100
|
||||||
}, sketch001)
|
)
|
||||||
extrude001 = extrude(profile001, length = 100)
|
extrude001 = extrude(profile001, length = 100)
|
||||||
`
|
`
|
||||||
await context.addInitScript((initialCode) => {
|
await context.addInitScript((initialCode) => {
|
||||||
@ -2864,7 +2863,7 @@ extrude001 = extrude(profile001, length = 100)
|
|||||||
|
|
||||||
// One dumb hardcoded screen pixel value
|
// One dumb hardcoded screen pixel value
|
||||||
const testPoint = { x: 500, y: 250 }
|
const testPoint = { x: 500, y: 250 }
|
||||||
const initialColor: [number, number, number] = [135, 135, 135]
|
const initialColor: [number, number, number] = [123, 123, 123]
|
||||||
|
|
||||||
await test.step(`Confirm extrude exists with default appearance`, async () => {
|
await test.step(`Confirm extrude exists with default appearance`, async () => {
|
||||||
await toolbar.closePane('code')
|
await toolbar.closePane('code')
|
||||||
@ -2877,23 +2876,41 @@ extrude001 = extrude(profile001, length = 100)
|
|||||||
shapeColor: [number, number, number]
|
shapeColor: [number, number, number]
|
||||||
) {
|
) {
|
||||||
await toolbar.openPane('feature-tree')
|
await toolbar.openPane('feature-tree')
|
||||||
const operationButton = await toolbar.getFeatureTreeOperation(
|
const enterAppearanceFlow = async (stepName: string) =>
|
||||||
'Extrude',
|
test.step(stepName, async () => {
|
||||||
0
|
const operationButton = await toolbar.getFeatureTreeOperation(
|
||||||
)
|
'Extrude',
|
||||||
await operationButton.click({ button: 'right' })
|
0
|
||||||
const menuButton = page.getByTestId('context-menu-set-appearance')
|
)
|
||||||
await menuButton.click()
|
await operationButton.click({ button: 'right' })
|
||||||
await cmdBar.expectState({
|
const menuButton = page.getByTestId('context-menu-set-appearance')
|
||||||
commandName: 'Appearance',
|
await menuButton.click()
|
||||||
currentArgKey: 'color',
|
await cmdBar.expectState({
|
||||||
currentArgValue: '',
|
commandName: 'Appearance',
|
||||||
headerArguments: {
|
currentArgKey: 'color',
|
||||||
Color: '',
|
currentArgValue: '',
|
||||||
},
|
headerArguments: {
|
||||||
highlightedHeaderArg: 'color',
|
Color: '',
|
||||||
stage: 'arguments',
|
},
|
||||||
|
highlightedHeaderArg: 'color',
|
||||||
|
stage: 'arguments',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
await enterAppearanceFlow(`Open Set Appearance flow`)
|
||||||
|
|
||||||
|
await test.step(`Validate hidden argument "nodeToEdit" can't be reached with Backspace`, async () => {
|
||||||
|
await page.keyboard.press('Backspace')
|
||||||
|
await cmdBar.expectState({
|
||||||
|
stage: 'pickCommand',
|
||||||
|
})
|
||||||
|
await page.keyboard.press('Escape')
|
||||||
|
await cmdBar.expectState({
|
||||||
|
stage: 'commandBarClosed',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await enterAppearanceFlow(`Restart Appearance flow`)
|
||||||
const item = page.getByText(option, { exact: true })
|
const item = page.getByText(option, { exact: true })
|
||||||
await item.click()
|
await item.click()
|
||||||
await cmdBar.expectState({
|
await cmdBar.expectState({
|
||||||
@ -2905,7 +2922,7 @@ extrude001 = extrude(profile001, length = 100)
|
|||||||
})
|
})
|
||||||
await cmdBar.progressCmdBar()
|
await cmdBar.progressCmdBar()
|
||||||
await toolbar.closePane('feature-tree')
|
await toolbar.closePane('feature-tree')
|
||||||
await scene.expectPixelColor(shapeColor, testPoint, 40)
|
await scene.expectPixelColor(shapeColor, testPoint, 10)
|
||||||
await toolbar.openPane('code')
|
await toolbar.openPane('code')
|
||||||
if (hex === 'default') {
|
if (hex === 'default') {
|
||||||
const anyAppearanceDeclaration = `|> appearance(`
|
const anyAppearanceDeclaration = `|> appearance(`
|
||||||
@ -2931,9 +2948,9 @@ extrude001 = extrude(profile001, length = 100)
|
|||||||
await setApperanceAndCheck('Purple', '#FF00FF', [180, 0, 180])
|
await setApperanceAndCheck('Purple', '#FF00FF', [180, 0, 180])
|
||||||
await setApperanceAndCheck('Yellow', '#FFFF00', [180, 180, 0])
|
await setApperanceAndCheck('Yellow', '#FFFF00', [180, 180, 0])
|
||||||
await setApperanceAndCheck('Black', '#000000', [0, 0, 0])
|
await setApperanceAndCheck('Black', '#000000', [0, 0, 0])
|
||||||
await setApperanceAndCheck('Dark Grey', '#080808', [10, 10, 10])
|
await setApperanceAndCheck('Dark Grey', '#080808', [0x33, 0x33, 0x33])
|
||||||
await setApperanceAndCheck('Light Grey', '#D3D3D3', [190, 190, 190])
|
await setApperanceAndCheck('Light Grey', '#D3D3D3', [176, 176, 176])
|
||||||
await setApperanceAndCheck('White', '#FFFFFF', [200, 200, 200])
|
await setApperanceAndCheck('White', '#FFFFFF', [184, 184, 184])
|
||||||
await setApperanceAndCheck(
|
await setApperanceAndCheck(
|
||||||
'Default (clear appearance)',
|
'Default (clear appearance)',
|
||||||
'default',
|
'default',
|
||||||
|
@ -556,7 +556,7 @@ test(
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true })
|
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/router-template-slate/main.kcl`
|
`${dir}/router-template-slate/main.kcl`
|
||||||
)
|
)
|
||||||
const _1975 = new Date('1975-01-01T00:01:11')
|
const _1975 = new Date('1975-01-01T00:01:11')
|
||||||
@ -564,7 +564,7 @@ test(
|
|||||||
|
|
||||||
await fsp.mkdir(`${dir}/bracket`, { recursive: true })
|
await fsp.mkdir(`${dir}/bracket`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
||||||
`${dir}/bracket/main.kcl`
|
`${dir}/bracket/main.kcl`
|
||||||
)
|
)
|
||||||
const _1985 = new Date('1985-01-01T00:02:22')
|
const _1985 = new Date('1985-01-01T00:02:22')
|
||||||
@ -573,7 +573,7 @@ test(
|
|||||||
await new Promise((r) => setTimeout(r, 1_000))
|
await new Promise((r) => setTimeout(r, 1_000))
|
||||||
await fsp.mkdir(`${dir}/lego`, { recursive: true })
|
await fsp.mkdir(`${dir}/lego`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/lego.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/lego.kcl',
|
||||||
`${dir}/lego/main.kcl`
|
`${dir}/lego/main.kcl`
|
||||||
)
|
)
|
||||||
const _1995 = new Date('1995-01-01T00:03:33')
|
const _1995 = new Date('1995-01-01T00:03:33')
|
||||||
@ -755,7 +755,7 @@ test(
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true })
|
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/router-template-slate/main.kcl`
|
`${dir}/router-template-slate/main.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -785,7 +785,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/${projectName}/main.kcl`
|
`${dir}/${projectName}/main.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -846,7 +846,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/${projectName}/main.kcl`
|
`${dir}/${projectName}/main.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -897,7 +897,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/${projectName}/main.kcl`
|
`${dir}/${projectName}/main.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -952,7 +952,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/${projectName}/main.kcl`
|
`${dir}/${projectName}/main.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -1123,11 +1123,11 @@ test(
|
|||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/${projectName}/main.kcl`
|
`${dir}/${projectName}/main.kcl`
|
||||||
)
|
)
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
||||||
`${dir}/${projectName}/otherThingToClickOn.kcl`
|
`${dir}/${projectName}/otherThingToClickOn.kcl`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -1540,9 +1540,9 @@ test(
|
|||||||
})
|
})
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
path.join(
|
path.join(
|
||||||
'src',
|
'rust',
|
||||||
'wasm-lib',
|
'kcl-lib',
|
||||||
'tests',
|
'e2e',
|
||||||
'executor',
|
'executor',
|
||||||
'inputs',
|
'inputs',
|
||||||
'router-template-slate.kcl'
|
'router-template-slate.kcl'
|
||||||
@ -1552,9 +1552,9 @@ test(
|
|||||||
await fsp.mkdir(path.join(dir, 'bracket'), { recursive: true })
|
await fsp.mkdir(path.join(dir, 'bracket'), { recursive: true })
|
||||||
await fsp.copyFile(
|
await fsp.copyFile(
|
||||||
path.join(
|
path.join(
|
||||||
'src',
|
'rust',
|
||||||
'wasm-lib',
|
'kcl-lib',
|
||||||
'tests',
|
'e2e',
|
||||||
'executor',
|
'executor',
|
||||||
'inputs',
|
'inputs',
|
||||||
'focusrite_scarlett_mounting_braket.kcl'
|
'focusrite_scarlett_mounting_braket.kcl'
|
||||||
@ -1673,11 +1673,11 @@ test(
|
|||||||
])
|
])
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
fsp.copyFile(
|
fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/router-template-slate.kcl',
|
||||||
`${dir}/router-template-slate/main.kcl`
|
`${dir}/router-template-slate/main.kcl`
|
||||||
),
|
),
|
||||||
fsp.copyFile(
|
fsp.copyFile(
|
||||||
'src/wasm-lib/tests/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
'rust/kcl-lib/e2e/executor/inputs/focusrite_scarlett_mounting_braket.kcl',
|
||||||
`${dir}/bracket/main.kcl`
|
`${dir}/bracket/main.kcl`
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
@ -1928,7 +1928,7 @@ test(
|
|||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ context, page }, testInfo) => {
|
async ({ context, page }, testInfo) => {
|
||||||
await context.folderSetupFn(async (dir) => {
|
await context.folderSetupFn(async (dir) => {
|
||||||
// src/wasm-lib/tests/executor/inputs/mike_stress_test.kcl
|
// rust/kcl-lib/e2e/executor/inputs/mike_stress_test.kcl
|
||||||
const name = 'mike_stress_test'
|
const name = 'mike_stress_test'
|
||||||
const testDir = path.join(dir, name)
|
const testDir = path.join(dir, name)
|
||||||
await fsp.mkdir(testDir, { recursive: true })
|
await fsp.mkdir(testDir, { recursive: true })
|
||||||
|
@ -12,10 +12,10 @@ profile001 = startProfileAt([57.81, 250.51], sketch001)
|
|||||||
|> close()
|
|> close()
|
||||||
extrude001 = extrude(profile001, length = 200)
|
extrude001 = extrude(profile001, length = 200)
|
||||||
sketch002 = startSketchOn('XZ')
|
sketch002 = startSketchOn('XZ')
|
||||||
|> startProfileAt([-73.64, -42.89], %)
|
|> startProfileAt([-114, 85.52], %)
|
||||||
|> xLine(173.71, %)
|
|> xLine(265.36, %)
|
||||||
|> line(end = [-22.12, -94.4])
|
|> line(end = [33.17, -261.22])
|
||||||
|> xLine(-156.98, %)
|
|> xLine(-297.25, %)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
extrude002 = extrude(sketch002, length = 50)
|
extrude002 = extrude(sketch002, length = 50)
|
||||||
@ -62,8 +62,8 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
await homePage.goToModelingScene()
|
await homePage.goToModelingScene()
|
||||||
await scene.waitForExecutionDone()
|
await scene.waitForExecutionDone()
|
||||||
|
|
||||||
const body1CapCoords = { x: 571, y: 351 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
const greenCheckCoords = { x: 565, y: 345 }
|
const greenCheckCoords = { x: 565, y: 305 }
|
||||||
const body2WallCoords = { x: 609, y: 153 }
|
const body2WallCoords = { x: 609, y: 153 }
|
||||||
const [clickBody1Cap] = scene.makeMouseHelpers(
|
const [clickBody1Cap] = scene.makeMouseHelpers(
|
||||||
body1CapCoords.x,
|
body1CapCoords.x,
|
||||||
@ -88,7 +88,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
await scene.expectPixelColor(yellow, body1CapCoords, 20)
|
await scene.expectPixelColor(yellow, body1CapCoords, 20)
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
highlightedCode: '',
|
highlightedCode: '',
|
||||||
activeLines: ['|>startProfileAt([-73.64,-42.89],%)'],
|
activeLines: ['|>startProfileAt([-114,85.52],%)'],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -157,7 +157,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
await homePage.goToModelingScene()
|
await homePage.goToModelingScene()
|
||||||
await scene.waitForExecutionDone()
|
await scene.waitForExecutionDone()
|
||||||
|
|
||||||
const body1CapCoords = { x: 571, y: 351 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
const [clickBody1Cap] = scene.makeMouseHelpers(
|
const [clickBody1Cap] = scene.makeMouseHelpers(
|
||||||
body1CapCoords.x,
|
body1CapCoords.x,
|
||||||
body1CapCoords.y
|
body1CapCoords.y
|
||||||
@ -176,7 +176,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
|
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
highlightedCode: '',
|
highlightedCode: '',
|
||||||
activeLines: ['|>startProfileAt([-73.64,-42.89],%)'],
|
activeLines: ['|>startProfileAt([-114,85.52],%)'],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -204,7 +204,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
page,
|
page,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
const body1CapCoords = { x: 571, y: 351 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
|
|
||||||
await context.addInitScript((file) => {
|
await context.addInitScript((file) => {
|
||||||
localStorage.setItem('persistCode', file)
|
localStorage.setItem('persistCode', file)
|
||||||
@ -263,7 +263,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
page,
|
page,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
const body1CapCoords = { x: 571, y: 351 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
const body2WallCoords = { x: 620, y: 152 }
|
const body2WallCoords = { x: 620, y: 152 }
|
||||||
const [clickBody1Cap] = scene.makeMouseHelpers(
|
const [clickBody1Cap] = scene.makeMouseHelpers(
|
||||||
body1CapCoords.x,
|
body1CapCoords.x,
|
||||||
@ -299,7 +299,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
// Hold shift and select second body
|
// Hold shift and select second body
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
highlightedCode: '',
|
highlightedCode: '',
|
||||||
activeLines: ['|>startProfileAt([-73.64,-42.89],%)'],
|
activeLines: ['|>startProfileAt([-114,85.52],%)'],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
await page.keyboard.down('Shift')
|
await page.keyboard.down('Shift')
|
||||||
@ -310,7 +310,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
'line(end=[121.13,56.63],tag=$seg02)extrude(profile001,length=200)',
|
'line(end=[121.13,56.63],tag=$seg02)extrude(profile001,length=200)',
|
||||||
activeLines: [
|
activeLines: [
|
||||||
'|>line(end=[121.13,56.63],tag=$seg02)',
|
'|>line(end=[121.13,56.63],tag=$seg02)',
|
||||||
'|>startProfileAt([-73.64,-42.89],%)',
|
'|>startProfileAt([-114,85.52],%)',
|
||||||
],
|
],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
|
@ -20,7 +20,8 @@ test.describe('Regression tests', { tag: ['@skipWin'] }, () => {
|
|||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
'persistCode',
|
'persistCode',
|
||||||
`sketch2 = startSketchOn("XY")
|
`sketch2 = startSketchOn("XY")
|
||||||
sketch001 = startSketchAt([-0, -0])
|
sketch001 = startSketchOn("XY")
|
||||||
|
|> startProfileAt([-0, -0], %)
|
||||||
|> line(end = [0, 0])
|
|> line(end = [0, 0])
|
||||||
|> line(end = [-4.84, -5.29])
|
|> line(end = [-4.84, -5.29])
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
@ -367,7 +367,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
'persistCode',
|
'persistCode',
|
||||||
`sketch001 = startSketchOn('XZ')
|
`sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [4.61, -5.01], radius = 8 }, %)`
|
|> circle(center = [4.61, -5.01], radius = 8)`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -403,9 +403,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
|
|
||||||
const dragPX = 40
|
const dragPX = 40
|
||||||
|
|
||||||
await page
|
await page.getByText('circle(center = [4.61, -5.01], radius = 8)').click()
|
||||||
.getByText('circle({ center = [4.61, -5.01], radius = 8 }, %)')
|
|
||||||
.click()
|
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole('button', { name: 'Edit Sketch' })
|
page.getByRole('button', { name: 'Edit Sketch' })
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
@ -444,7 +442,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
// expect the code to have changed
|
// expect the code to have changed
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`sketch001 = startSketchOn('XZ')
|
`sketch001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [7.26, -2.37], radius = 11.44 }, %)`,
|
|> circle(center = [7.26, -2.37], radius = 11.44)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -1245,7 +1243,7 @@ test.describe('Sketch mode should be toleratant to syntax errors', () => {
|
|||||||
path.resolve(
|
path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../',
|
'../../',
|
||||||
'./src/wasm-lib/tests/executor/inputs/e2e-can-sketch-on-chamfer.kcl'
|
'./rust/kcl-lib/e2e/executor/inputs/e2e-can-sketch-on-chamfer.kcl'
|
||||||
),
|
),
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
@ -1390,12 +1388,14 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
|
|||||||
await toolbar.circleBtn.click()
|
await toolbar.circleBtn.click()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
await circlePoint1()
|
await circlePoint1()
|
||||||
await editor.expectEditor.toContain('profile003 = circle({ center = [')
|
await editor.expectEditor.toContain(
|
||||||
|
'profile003 = circle(sketch001, center = ['
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('equip line tool and verify circle code is removed', async () => {
|
await test.step('equip line tool and verify circle code is removed', async () => {
|
||||||
await toolbar.lineBtn.click()
|
await toolbar.lineBtn.click()
|
||||||
await editor.expectEditor.not.toContain('profile003 = circle({')
|
await editor.expectEditor.not.toContain('profile003 = circle(')
|
||||||
})
|
})
|
||||||
|
|
||||||
const [circle3Point1] = scene.makeMouseHelpers(650, 200)
|
const [circle3Point1] = scene.makeMouseHelpers(650, 200)
|
||||||
@ -1649,7 +1649,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
|||||||
await circle1Radius({ delay: 500 })
|
await circle1Radius({ delay: 500 })
|
||||||
await page.waitForTimeout(300)
|
await page.waitForTimeout(300)
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`profile003 = circle({ center = [23.19, 6.98], radius = 2.5 }, sketch001)`
|
`profile003 = circle(sketch001, center = [23.19, 6.98], radius = 2.5)`
|
||||||
)
|
)
|
||||||
|
|
||||||
await test.step('hover in empty space to wait for overlays to get out of the way', async () => {
|
await test.step('hover in empty space to wait for overlays to get out of the way', async () => {
|
||||||
@ -1661,7 +1661,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
|||||||
await page.waitForTimeout(300)
|
await page.waitForTimeout(300)
|
||||||
await circle2Radius()
|
await circle2Radius()
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`profile004 = circle({ center = [23.74, 1.9], radius = 0.72 }, sketch001)`
|
`profile004 = circle(sketch001, center = [23.74, 1.9], radius = 0.72)`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
await test.step('create two corner rectangles in a row without unequip', async () => {
|
await test.step('create two corner rectangles in a row without unequip', async () => {
|
||||||
@ -1855,7 +1855,7 @@ profile002 = startProfileAt([11.19, 5.02], sketch001)
|
|||||||
], %)
|
], %)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001)
|
profile003 = circle(sketch001, center = [6.92, -4.2], radius = 3.16)
|
||||||
profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07], p3 = [18.75, -4.41])
|
profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07], p3 = [18.75, -4.41])
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
@ -1931,7 +1931,7 @@ profile004 = circleThreePoint(sketch001, p1 = [13.44, -6.8], p2 = [13.39, -2.07]
|
|||||||
await dragCircleTo()
|
await dragCircleTo()
|
||||||
await page.mouse.up()
|
await page.mouse.up()
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`profile003 = circle({ center = [6.92, -4.2], radius = 4.81 }, sketch001)`
|
`profile003 = circle(sketch001, center = [6.92, -4.2], radius = 4.81)`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -2000,7 +2000,7 @@ profile002 = startProfileAt([11.19, 5.02], sketch001)
|
|||||||
], %)
|
], %)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
profile003 = circle({ center = [6.92, -4.2], radius = 3.16 }, sketch001)
|
profile003 = circle(sketch001, center = [6.92, -4.2], radius = 3.16)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -2108,10 +2108,11 @@ profile003 = startProfileAt([16.79, 38.24], sketch001)
|
|||||||
], %)
|
], %)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
profile004 = circle({
|
profile004 = circle(
|
||||||
|
sketch001,
|
||||||
center = [280.45, 47.57],
|
center = [280.45, 47.57],
|
||||||
radius = 55.26
|
radius = 55.26
|
||||||
}, sketch001)
|
)
|
||||||
extrude002 = extrude(profile001, length = 50)
|
extrude002 = extrude(profile001, length = 50)
|
||||||
extrude001 = extrude(profile003, length = 5)
|
extrude001 = extrude(profile003, length = 5)
|
||||||
`
|
`
|
||||||
@ -2173,10 +2174,11 @@ extrude001 = extrude(profile003, length = 5)
|
|||||||
'myVar = 5',
|
'myVar = 5',
|
||||||
`myVar = 5
|
`myVar = 5
|
||||||
sketch001 = startSketchOn('XZ')
|
sketch001 = startSketchOn('XZ')
|
||||||
profile001 = circle({
|
profile001 = circle(
|
||||||
|
sketch001,
|
||||||
center = [12.41, 3.87],
|
center = [12.41, 3.87],
|
||||||
radius = myVar
|
radius = myVar
|
||||||
}, sketch001)`
|
)`
|
||||||
)
|
)
|
||||||
|
|
||||||
await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15)
|
await scene.expectPixelColor([255, 255, 255], { x: 633, y: 211 }, 15)
|
||||||
@ -2320,7 +2322,7 @@ profile004 = startProfileAt([3.15, 9.39], sketch002)
|
|||||||
|> line(end = [-7.41, -2.85])
|
|> line(end = [-7.41, -2.85])
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
profile005 = circle({ center = [5.15, 4.34], radius = 1.66 }, sketch002)
|
profile005 = circle(sketch002, center = [5.15, 4.34], radius = 1.66)
|
||||||
profile006 = startProfileAt([9.65, 3.82], sketch002)
|
profile006 = startProfileAt([9.65, 3.82], sketch002)
|
||||||
|> line(end = [2.38, 5.62])
|
|> line(end = [2.38, 5.62])
|
||||||
|> line(end = [2.13, -5.57])
|
|> line(end = [2.13, -5.57])
|
||||||
@ -2345,10 +2347,11 @@ profile009 = startProfileAt([5.23, 1.95], sketch003)
|
|||||||
|> line(end = [7.34, -2.75])
|
|> line(end = [7.34, -2.75])
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
profile010 = circle({
|
profile010 = circle(
|
||||||
|
sketch003,
|
||||||
center = [7.18, -2.11],
|
center = [7.18, -2.11],
|
||||||
radius = 2.67
|
radius = 2.67
|
||||||
}, sketch003)
|
)
|
||||||
profile011 = startProfileAt([5.07, -6.39], sketch003)
|
profile011 = startProfileAt([5.07, -6.39], sketch003)
|
||||||
|> angledLine([0, 4.54], %, $rectangleSegmentA002)
|
|> angledLine([0, 4.54], %, $rectangleSegmentA002)
|
||||||
|> angledLine([
|
|> angledLine([
|
||||||
@ -2417,8 +2420,8 @@ extrude003 = extrude(profile011, length = 2.5)
|
|||||||
},
|
},
|
||||||
// TODO keeps failing
|
// TODO keeps failing
|
||||||
// {
|
// {
|
||||||
// title: 'select cap circle',
|
// title: 'select cap circle',
|
||||||
// selectClick: scene.makeMouseHelpers(679, 290)[0],
|
// selectClick: scene.makeMouseHelpers(679, 290)[0],
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
title: 'select cap extrude wall',
|
title: 'select cap extrude wall',
|
||||||
@ -2468,7 +2471,7 @@ extrude003 = extrude(profile011, length = 2.5)
|
|||||||
})
|
})
|
||||||
|
|
||||||
const verifyCapProfilesAreDrawn = async () =>
|
const verifyCapProfilesAreDrawn = async () =>
|
||||||
test.step('verify wall profiles are drawn', async () => {
|
test.step('verify cap profiles are drawn', async () => {
|
||||||
// open polygon
|
// open polygon
|
||||||
await scene.expectPixelColor(
|
await scene.expectPixelColor(
|
||||||
TEST_COLORS.WHITE,
|
TEST_COLORS.WHITE,
|
||||||
@ -2519,13 +2522,14 @@ extrude003 = extrude(profile011, length = 2.5)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('select cap profiles', async () => {
|
/* FIXME: the cap part of this test is insanely flaky, and I'm not sure
|
||||||
|
* why.
|
||||||
|
* await test.step('select cap profiles', async () => {
|
||||||
for (const { title, selectClick } of capSelectionOptions) {
|
for (const { title, selectClick } of capSelectionOptions) {
|
||||||
await test.step(title, async () => {
|
await test.step(title, async () => {
|
||||||
await camPositionForSelectingSketchOnCapProfiles()
|
await camPositionForSelectingSketchOnCapProfiles()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
await selectClick()
|
await selectClick()
|
||||||
await page.waitForTimeout(100)
|
|
||||||
await toolbar.editSketch()
|
await toolbar.editSketch()
|
||||||
await page.waitForTimeout(600)
|
await page.waitForTimeout(600)
|
||||||
await verifyCapProfilesAreDrawn()
|
await verifyCapProfilesAreDrawn()
|
||||||
@ -2533,7 +2537,7 @@ extrude003 = extrude(profile011, length = 2.5)
|
|||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}) */
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { test, expect } from '@playwright/test'
|
import { test, expect } from './zoo-test'
|
||||||
import { secrets } from './secrets'
|
import { secrets } from './secrets'
|
||||||
import { Paths, doExport, getUtils } from './test-utils'
|
import { Paths, doExport, getUtils } from './test-utils'
|
||||||
import { Models } from '@kittycad/lib'
|
import { Models } from '@kittycad/lib'
|
||||||
@ -13,27 +13,10 @@ import {
|
|||||||
TEST_SETTINGS_KEY,
|
TEST_SETTINGS_KEY,
|
||||||
} from './storageStates'
|
} from './storageStates'
|
||||||
import * as TOML from '@iarna/toml'
|
import * as TOML from '@iarna/toml'
|
||||||
|
import { SceneFixture } from './fixtures/sceneFixture'
|
||||||
|
import { CmdBarFixture } from './fixtures/cmdBarFixture'
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page, context }) => {
|
||||||
// reducedMotion kills animations, which speeds up tests and reduces flakiness
|
|
||||||
await page.emulateMedia({ reducedMotion: 'reduce' })
|
|
||||||
|
|
||||||
// set the default settings
|
|
||||||
await page.addInitScript(
|
|
||||||
async ({ token, settingsKey, settings, IS_PLAYWRIGHT_KEY }) => {
|
|
||||||
localStorage.setItem('TOKEN_PERSIST_KEY', token)
|
|
||||||
localStorage.setItem('persistCode', ``)
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
localStorage.setItem(IS_PLAYWRIGHT_KEY, 'true')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
token: secrets.token,
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: TOML.stringify({ settings: TEST_SETTINGS }),
|
|
||||||
IS_PLAYWRIGHT_KEY: IS_PLAYWRIGHT_KEY,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Make the user avatar image always 404
|
// Make the user avatar image always 404
|
||||||
// so we see the fallback menu icon for all snapshot tests
|
// so we see the fallback menu icon for all snapshot tests
|
||||||
await page.route('https://lh3.googleusercontent.com/**', async (route) => {
|
await page.route('https://lh3.googleusercontent.com/**', async (route) => {
|
||||||
@ -45,6 +28,14 @@ test.beforeEach(async ({ page }) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Help engine-manager: tear shit down.
|
||||||
|
test.afterEach(async ({ page }) => {
|
||||||
|
await page.evaluate(() => {
|
||||||
|
// @ts-expect-error
|
||||||
|
window.tearDown()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
test.setTimeout(60_000)
|
test.setTimeout(60_000)
|
||||||
|
|
||||||
// We test this end to end already - getting this to work on web just to take
|
// We test this end to end already - getting this to work on web just to take
|
||||||
@ -54,7 +45,7 @@ test.setTimeout(60_000)
|
|||||||
test.skip(
|
test.skip(
|
||||||
'exports of each format should work',
|
'exports of each format should work',
|
||||||
{ tag: ['@snapshot', '@skipWin', '@skipMacos'] },
|
{ tag: ['@snapshot', '@skipWin', '@skipMacos'] },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, scene, cmdBar }) => {
|
||||||
// FYI this test doesn't work with only engine running locally
|
// FYI this test doesn't work with only engine running locally
|
||||||
// And you will need to have the KittyCAD CLI installed
|
// And you will need to have the KittyCAD CLI installed
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
@ -106,11 +97,8 @@ part001 = startSketchOn('-XZ')
|
|||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
await scene.settled(cmdBar)
|
||||||
await u.waitForCmdReceive('extrude')
|
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
|
|
||||||
const axisDirectionPair: Models['AxisDirectionPair_type'] = {
|
const axisDirectionPair: Models['AxisDirectionPair_type'] = {
|
||||||
axis: 'z',
|
axis: 'z',
|
||||||
@ -313,8 +301,25 @@ part001 = startSketchOn('-XZ')
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|
const extrudeDefaultPlane = async (
|
||||||
await context.addInitScript(async () => {
|
context: any,
|
||||||
|
page: any,
|
||||||
|
cmdBar: CmdBarFixture,
|
||||||
|
scene: SceneFixture,
|
||||||
|
plane: string
|
||||||
|
) => {
|
||||||
|
const code = `part001 = startSketchOn('${plane}')
|
||||||
|
|> startProfileAt([7.00, 4.40], %)
|
||||||
|
|> line(end = [6.60, -0.20])
|
||||||
|
|> line(end = [2.80, 5.00])
|
||||||
|
|> line(end = [-5.60, 4.40])
|
||||||
|
|> line(end = [-5.40, -3.80])
|
||||||
|
|> close()
|
||||||
|
|> extrude(length = 10.00)
|
||||||
|
`
|
||||||
|
|
||||||
|
// This probably does absolutely nothing based on my trip through here.
|
||||||
|
await page.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
'SETTINGS_PERSIST_KEY',
|
'SETTINGS_PERSIST_KEY',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@ -331,41 +336,17 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const code = `part001 = startSketchOn('${plane}')
|
|
||||||
|> startProfileAt([7.00, 4.40], %)
|
|
||||||
|> line(end = [6.60, -0.20])
|
|
||||||
|> line(end = [2.80, 5.00])
|
|
||||||
|> line(end = [-5.60, 4.40])
|
|
||||||
|> line(end = [-5.40, -3.80])
|
|
||||||
|> close()
|
|
||||||
|> extrude(length = 10.00)
|
|
||||||
`
|
|
||||||
await page.addInitScript(async (code: string) => {
|
await page.addInitScript(async (code: string) => {
|
||||||
localStorage.setItem('persistCode', code)
|
localStorage.setItem('persistCode', code)
|
||||||
})
|
}, code)
|
||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
await scene.connectionEstablished()
|
||||||
|
await scene.settled(cmdBar)
|
||||||
|
|
||||||
// wait for execution done
|
|
||||||
await u.openDebugPanel()
|
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
await page.waitForTimeout(200)
|
|
||||||
// clear code
|
|
||||||
await u.removeCurrentCode()
|
|
||||||
await u.openAndClearDebugPanel()
|
|
||||||
await u.doAndWaitForImageDiff(
|
|
||||||
() => page.locator('.cm-content').fill(code),
|
|
||||||
200
|
|
||||||
)
|
|
||||||
// wait for execution done
|
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
|
|
||||||
await u.closeKclCodePanel()
|
|
||||||
await expect(page).toHaveScreenshot({
|
await expect(page).toHaveScreenshot({
|
||||||
maxDiffPixels: 100,
|
maxDiffPixels: 100,
|
||||||
mask: [page.getByTestId('model-state-indicator')],
|
mask: [page.getByTestId('model-state-indicator')],
|
||||||
@ -380,28 +361,28 @@ test.describe(
|
|||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
test('XY', async ({ page, context }) => {
|
test('XY', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, 'XY')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, 'XY')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('XZ', async ({ page, context }) => {
|
test('XZ', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, 'XZ')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, 'XZ')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('YZ', async ({ page, context }) => {
|
test('YZ', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, 'YZ')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, 'YZ')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('-XY', async ({ page, context }) => {
|
test('-XY', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, '-XY')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, '-XY')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('-XZ', async ({ page, context }) => {
|
test('-XZ', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, '-XZ')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, '-XZ')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('-YZ', async ({ page, context }) => {
|
test('-YZ', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, '-YZ')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, '-YZ')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -409,7 +390,7 @@ test.describe(
|
|||||||
test(
|
test(
|
||||||
'Draft segments should look right',
|
'Draft segments should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, scene, cmdBar }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -418,17 +399,9 @@ test(
|
|||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).not.toBeDisabled()
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// click on "Start Sketch" button
|
// click on "Start Sketch" button
|
||||||
await u.clearCommandLogs()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
||||||
200
|
200
|
||||||
@ -448,8 +421,9 @@ test(
|
|||||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await page.mouse.move(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.move(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
|
|
||||||
|
await page.waitForTimeout(500)
|
||||||
await expect(page).toHaveScreenshot({
|
await expect(page).toHaveScreenshot({
|
||||||
maxDiffPixels: 100,
|
maxDiffPixels: 100,
|
||||||
mask: [page.getByTestId('model-state-indicator')],
|
mask: [page.getByTestId('model-state-indicator')],
|
||||||
@ -458,7 +432,7 @@ test(
|
|||||||
const lineEndClick = () =>
|
const lineEndClick = () =>
|
||||||
page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await lineEndClick()
|
await lineEndClick()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(500)
|
||||||
|
|
||||||
code += `
|
code += `
|
||||||
|> xLine(7.25, %)`
|
|> xLine(7.25, %)`
|
||||||
@ -469,18 +443,16 @@ test(
|
|||||||
.click()
|
.click()
|
||||||
|
|
||||||
// click on the end of the profile to continue it
|
// click on the end of the profile to continue it
|
||||||
await page.waitForTimeout(300)
|
await page.waitForTimeout(500)
|
||||||
await lineEndClick()
|
await lineEndClick()
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(500)
|
||||||
|
|
||||||
// click to continue profile
|
// click to continue profile
|
||||||
await page.mouse.move(813, 392, { steps: 10 })
|
await page.mouse.move(813, 392, { steps: 10 })
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(500)
|
||||||
|
|
||||||
await page.mouse.move(startXPx + PUR * 30, 500 - PUR * 20, { steps: 10 })
|
await page.mouse.move(startXPx + PUR * 30, 500 - PUR * 20, { steps: 10 })
|
||||||
|
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
|
|
||||||
await expect(page).toHaveScreenshot({
|
await expect(page).toHaveScreenshot({
|
||||||
maxDiffPixels: 100,
|
maxDiffPixels: 100,
|
||||||
mask: [page.getByTestId('model-state-indicator')],
|
mask: [page.getByTestId('model-state-indicator')],
|
||||||
@ -491,7 +463,7 @@ test(
|
|||||||
test(
|
test(
|
||||||
'Draft rectangles should look right',
|
'Draft rectangles should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -500,17 +472,10 @@ test(
|
|||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
|
||||||
|
|
||||||
await expect(
|
await scene.connectionEstablished()
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).not.toBeDisabled()
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// click on "Start Sketch" button
|
// click on "Start Sketch" button
|
||||||
await u.clearCommandLogs()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
||||||
200
|
200
|
||||||
@ -523,8 +488,8 @@ test(
|
|||||||
`sketch001 = startSketchOn('XZ')`
|
`sketch001 = startSketchOn('XZ')`
|
||||||
)
|
)
|
||||||
|
|
||||||
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
|
// Wait for camera animation
|
||||||
await u.closeDebugPanel()
|
await page.waitForTimeout(2000)
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
|
|
||||||
@ -548,7 +513,7 @@ test(
|
|||||||
test(
|
test(
|
||||||
'Draft circle should look right',
|
'Draft circle should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
// test.skip(process.platform === 'darwin', 'Skip on macos')
|
// test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -557,17 +522,9 @@ test(
|
|||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
|
||||||
|
|
||||||
await expect(
|
await scene.connectionEstablished()
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).not.toBeDisabled()
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// click on "Start Sketch" button
|
|
||||||
await u.clearCommandLogs()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
||||||
200
|
200
|
||||||
@ -580,8 +537,8 @@ test(
|
|||||||
`sketch001 = startSketchOn('XZ')`
|
`sketch001 = startSketchOn('XZ')`
|
||||||
)
|
)
|
||||||
|
|
||||||
await page.waitForTimeout(500) // TODO detect animation ending, or disable animation
|
// Wait for camera animation
|
||||||
await u.closeDebugPanel()
|
await page.waitForTimeout(2000)
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
|
|
||||||
@ -599,7 +556,7 @@ test(
|
|||||||
mask: [page.getByTestId('model-state-indicator')],
|
mask: [page.getByTestId('model-state-indicator')],
|
||||||
})
|
})
|
||||||
await expect(page.locator('.cm-content')).toHaveText(
|
await expect(page.locator('.cm-content')).toHaveText(
|
||||||
`sketch001 = startSketchOn('XZ')profile001 = circle({ center = [14.44, -2.44], radius = 1 }, sketch001)`
|
`sketch001 = startSketchOn('XZ')profile001 = circle(sketch001, center = [14.44, -2.44], radius = 1)`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -611,23 +568,15 @@ test.describe(
|
|||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
test('Inch scale', async ({ page }) => {
|
test('Inch scale', async ({ page, cmdBar, scene }) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
|
||||||
|
|
||||||
await expect(
|
await scene.connectionEstablished()
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).not.toBeDisabled()
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// click on "Start Sketch" button
|
|
||||||
await u.clearCommandLogs()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
||||||
200
|
200
|
||||||
@ -639,7 +588,8 @@ test.describe(
|
|||||||
let code = `sketch001 = startSketchOn('XZ')`
|
let code = `sketch001 = startSketchOn('XZ')`
|
||||||
await expect(page.locator('.cm-content')).toHaveText(code)
|
await expect(page.locator('.cm-content')).toHaveText(code)
|
||||||
|
|
||||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
// Wait for camera animation
|
||||||
|
await page.waitForTimeout(2000)
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||||
@ -647,8 +597,6 @@ test.describe(
|
|||||||
await expect(u.codeLocator).toHaveText(code)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
|
|
||||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
@ -683,17 +631,12 @@ test.describe(
|
|||||||
mask: [page.getByTestId('model-state-indicator')],
|
mask: [page.getByTestId('model-state-indicator')],
|
||||||
})
|
})
|
||||||
|
|
||||||
// exit sketch
|
|
||||||
await u.openAndClearDebugPanel()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Exit Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Exit Sketch' }).click(),
|
||||||
200
|
200
|
||||||
)
|
)
|
||||||
|
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
await page.waitForTimeout(300)
|
|
||||||
|
|
||||||
// second screen shot should look almost identical, i.e. scale should be the same.
|
// second screen shot should look almost identical, i.e. scale should be the same.
|
||||||
await expect(page).toHaveScreenshot({
|
await expect(page).toHaveScreenshot({
|
||||||
@ -702,8 +645,8 @@ test.describe(
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Millimeter scale', async ({ page }) => {
|
test('Millimeter scale', async ({ page, context, cmdBar, scene }) => {
|
||||||
await page.addInitScript(
|
await context.addInitScript(
|
||||||
async ({ settingsKey, settings }) => {
|
async ({ settingsKey, settings }) => {
|
||||||
localStorage.setItem(settingsKey, settings)
|
localStorage.setItem(settingsKey, settings)
|
||||||
},
|
},
|
||||||
@ -725,17 +668,10 @@ test.describe(
|
|||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
await u.openDebugPanel()
|
|
||||||
|
|
||||||
await expect(
|
await scene.connectionEstablished()
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
await scene.settled(cmdBar)
|
||||||
).not.toBeDisabled()
|
|
||||||
await expect(
|
|
||||||
page.getByRole('button', { name: 'Start Sketch' })
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// click on "Start Sketch" button
|
|
||||||
await u.clearCommandLogs()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Start Sketch' }).click(),
|
||||||
200
|
200
|
||||||
@ -747,7 +683,8 @@ test.describe(
|
|||||||
let code = `sketch001 = startSketchOn('XZ')`
|
let code = `sketch001 = startSketchOn('XZ')`
|
||||||
await expect(u.codeLocator).toHaveText(code)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
|
|
||||||
await page.waitForTimeout(600) // TODO detect animation ending, or disable animation
|
// Wait for camera animation
|
||||||
|
await page.waitForTimeout(2000)
|
||||||
|
|
||||||
const startXPx = 600
|
const startXPx = 600
|
||||||
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
|
||||||
@ -755,8 +692,6 @@ test.describe(
|
|||||||
await expect(u.codeLocator).toHaveText(code)
|
await expect(u.codeLocator).toHaveText(code)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
|
|
||||||
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
|
|
||||||
@ -790,16 +725,12 @@ test.describe(
|
|||||||
})
|
})
|
||||||
|
|
||||||
// exit sketch
|
// exit sketch
|
||||||
await u.openAndClearDebugPanel()
|
|
||||||
await u.doAndWaitForImageDiff(
|
await u.doAndWaitForImageDiff(
|
||||||
() => page.getByRole('button', { name: 'Exit Sketch' }).click(),
|
() => page.getByRole('button', { name: 'Exit Sketch' }).click(),
|
||||||
200
|
200
|
||||||
)
|
)
|
||||||
|
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
await page.waitForTimeout(300)
|
|
||||||
|
|
||||||
// second screen shot should look almost identical, i.e. scale should be the same.
|
// second screen shot should look almost identical, i.e. scale should be the same.
|
||||||
await expect(page).toHaveScreenshot({
|
await expect(page).toHaveScreenshot({
|
||||||
@ -812,7 +743,7 @@ test.describe(
|
|||||||
test(
|
test(
|
||||||
'Sketch on face with none z-up',
|
'Sketch on face with none z-up',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -840,12 +771,8 @@ part002 = startSketchOn(part001, seg01)
|
|||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1, { timeout: 10_000 })
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
|
|
||||||
// Wait for the second extrusion to appear
|
// Wait for the second extrusion to appear
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
@ -877,7 +804,7 @@ part002 = startSketchOn(part001, seg01)
|
|||||||
test(
|
test(
|
||||||
'Zoom to fit on load - solid 2d',
|
'Zoom to fit on load - solid 2d',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -899,12 +826,8 @@ test(
|
|||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
|
|
||||||
// Wait for the second extrusion to appear
|
// Wait for the second extrusion to appear
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
@ -920,7 +843,7 @@ test(
|
|||||||
test(
|
test(
|
||||||
'Zoom to fit on load - solid 3d',
|
'Zoom to fit on load - solid 3d',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
test.skip(process.platform === 'darwin', 'Skip on macos')
|
test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
@ -943,12 +866,8 @@ test(
|
|||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
|
|
||||||
// Wait for the second extrusion to appear
|
// Wait for the second extrusion to appear
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
@ -965,7 +884,11 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
// FIXME: Skip on macos its being weird.
|
// FIXME: Skip on macos its being weird.
|
||||||
// test.skip(process.platform === 'darwin', 'Skip on macos')
|
// test.skip(process.platform === 'darwin', 'Skip on macos')
|
||||||
|
|
||||||
test('Grid turned off to on via command bar', async ({ page }) => {
|
test('Grid turned off to on via command bar', async ({
|
||||||
|
page,
|
||||||
|
cmdBar,
|
||||||
|
scene,
|
||||||
|
}) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
const stream = page.getByTestId('stream')
|
const stream = page.getByTestId('stream')
|
||||||
const mask = [
|
const mask = [
|
||||||
@ -978,12 +901,9 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
await page.goto('/')
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await u.closeKclCodePanel()
|
await u.closeKclCodePanel()
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
// rendering, because an execution-done message is not sufficient.
|
// rendering, because an execution-done message is not sufficient.
|
||||||
@ -1033,7 +953,7 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Grid turned off', async ({ page }) => {
|
test('Grid turned off', async ({ page, cmdBar, scene }) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
const stream = page.getByTestId('stream')
|
const stream = page.getByTestId('stream')
|
||||||
const mask = [
|
const mask = [
|
||||||
@ -1046,12 +966,9 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
await page.goto('/')
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await u.closeKclCodePanel()
|
await u.closeKclCodePanel()
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
// rendering, because an execution-done message is not sufficient.
|
// rendering, because an execution-done message is not sufficient.
|
||||||
@ -1063,8 +980,8 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Grid turned on', async ({ page }) => {
|
test('Grid turned on', async ({ page, context, cmdBar, scene }) => {
|
||||||
await page.addInitScript(
|
await context.addInitScript(
|
||||||
async ({ settingsKey, settings }) => {
|
async ({ settingsKey, settings }) => {
|
||||||
localStorage.setItem(settingsKey, settings)
|
localStorage.setItem(settingsKey, settings)
|
||||||
},
|
},
|
||||||
@ -1094,12 +1011,9 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
await page.goto('/')
|
await page.goto('/')
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
// wait for execution done
|
await scene.settled(cmdBar)
|
||||||
await expect(
|
|
||||||
page.locator('[data-message-type="execution-done"]')
|
|
||||||
).toHaveCount(1)
|
|
||||||
await u.closeDebugPanel()
|
|
||||||
await u.closeKclCodePanel()
|
await u.closeKclCodePanel()
|
||||||
// TODO: Find a way to truly know that the objects have finished
|
// TODO: Find a way to truly know that the objects have finished
|
||||||
// rendering, because an execution-done message is not sufficient.
|
// rendering, because an execution-done message is not sufficient.
|
||||||
@ -1179,7 +1093,7 @@ test.fixme('theme persists', async ({ page, context }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test.describe('code color goober', { tag: '@snapshot' }, () => {
|
test.describe('code color goober', { tag: '@snapshot' }, () => {
|
||||||
test('code color goober', async ({ page, context }) => {
|
test('code color goober', async ({ page, context, scene, cmdBar }) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async () => {
|
await context.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -1213,19 +1127,22 @@ sweepSketch = startSketchOn('XY')
|
|||||||
})
|
})
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 1000 })
|
await page.setViewportSize({ width: 1200, height: 1000 })
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
await scene.settled(cmdBar)
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
|
|
||||||
await expect(page, 'expect small color widget').toHaveScreenshot({
|
await expect(page, 'expect small color widget').toHaveScreenshot({
|
||||||
maxDiffPixels: 100,
|
maxDiffPixels: 100,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('code color goober opening window', async ({ page, context }) => {
|
test('code color goober opening window', async ({
|
||||||
|
page,
|
||||||
|
context,
|
||||||
|
scene,
|
||||||
|
cmdBar,
|
||||||
|
}) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async () => {
|
await context.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -1259,12 +1176,10 @@ sweepSketch = startSketchOn('XY')
|
|||||||
})
|
})
|
||||||
|
|
||||||
await page.setViewportSize({ width: 1200, height: 1000 })
|
await page.setViewportSize({ width: 1200, height: 1000 })
|
||||||
|
|
||||||
await u.waitForAuthSkipAppStart()
|
await u.waitForAuthSkipAppStart()
|
||||||
|
|
||||||
await u.openDebugPanel()
|
await scene.connectionEstablished()
|
||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
await scene.settled(cmdBar)
|
||||||
await u.clearAndCloseDebugPanel()
|
|
||||||
|
|
||||||
await expect(page.locator('.cm-css-color-picker-wrapper')).toBeVisible()
|
await expect(page.locator('.cm-css-color-picker-wrapper')).toBeVisible()
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 68 KiB |
@ -29,5 +29,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kcl_version": "0.2.41"
|
"kcl_version": "0.2.45"
|
||||||
}
|
}
|
@ -10,13 +10,13 @@ export const TEST_SETTINGS = {
|
|||||||
theme: Themes.Dark,
|
theme: Themes.Dark,
|
||||||
onboardingStatus: 'dismissed',
|
onboardingStatus: 'dismissed',
|
||||||
projectDirectory: '',
|
projectDirectory: '',
|
||||||
enableSSAO: false,
|
showDebugPanel: true,
|
||||||
},
|
},
|
||||||
modeling: {
|
modeling: {
|
||||||
|
enableSSAO: false,
|
||||||
defaultUnit: 'in',
|
defaultUnit: 'in',
|
||||||
mouseControls: 'Zoo',
|
mouseControls: 'Zoo',
|
||||||
cameraProjection: 'perspective',
|
cameraProjection: 'perspective',
|
||||||
showDebugPanel: true,
|
|
||||||
},
|
},
|
||||||
projects: {
|
projects: {
|
||||||
defaultProjectName: 'project-$nnn',
|
defaultProjectName: 'project-$nnn',
|
||||||
@ -59,12 +59,12 @@ export const TEST_SETTINGS_CORRUPTED = {
|
|||||||
theme: Themes.Dark,
|
theme: Themes.Dark,
|
||||||
onboardingStatus: 'dismissed',
|
onboardingStatus: 'dismissed',
|
||||||
projectDirectory: 123 as any,
|
projectDirectory: 123 as any,
|
||||||
|
showDebugPanel: true,
|
||||||
},
|
},
|
||||||
modeling: {
|
modeling: {
|
||||||
defaultUnit: 'invalid' as any,
|
defaultUnit: 'invalid' as any,
|
||||||
mouseControls: `() => alert('hack the planet')` as any,
|
mouseControls: `() => alert('hack the planet')` as any,
|
||||||
cameraProjection: 'perspective',
|
cameraProjection: 'perspective',
|
||||||
showDebugPanel: true,
|
|
||||||
},
|
},
|
||||||
projects: {
|
projects: {
|
||||||
defaultProjectName: false as any,
|
defaultProjectName: false as any,
|
||||||
|
@ -1113,7 +1113,7 @@ export async function createProject({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function executorInputPath(fileName: string): string {
|
export function executorInputPath(fileName: string): string {
|
||||||
return path.join('src', 'wasm-lib', 'tests', 'executor', 'inputs', fileName)
|
return path.join('rust', 'kcl-lib', 'e2e', 'executor', 'inputs', fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function doAndWaitForImageDiff(
|
export async function doAndWaitForImageDiff(
|
||||||
|
@ -243,7 +243,7 @@ test.describe('Testing Gizmo', { tag: ['@skipWin'] }, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test.describe(`Testing gizmo, fixture-based`, () => {
|
test.describe(`Testing gizmo, fixture-based`, () => {
|
||||||
test('Center on selection from menu', async ({
|
test('Center on selection from menu, disable interaction in sketch mode', async ({
|
||||||
context,
|
context,
|
||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
@ -269,10 +269,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
|
|||||||
], %)
|
], %)
|
||||||
|> close()
|
|> close()
|
||||||
const sketch001 = startSketchOn('XZ')
|
const sketch001 = startSketchOn('XZ')
|
||||||
|> circle({
|
|> circle(center = [818.33, 168.1], radius = 182.8)
|
||||||
center: [818.33, 168.1],
|
|
||||||
radius: 182.8
|
|
||||||
}, %)
|
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
@ -295,12 +292,11 @@ test.describe(`Testing gizmo, fixture-based`, () => {
|
|||||||
const [clickCircle, moveToCircle] = scene.makeMouseHelpers(582, 217)
|
const [clickCircle, moveToCircle] = scene.makeMouseHelpers(582, 217)
|
||||||
|
|
||||||
await test.step(`Select an edge of this circle`, async () => {
|
await test.step(`Select an edge of this circle`, async () => {
|
||||||
const circleSnippet =
|
const circleSnippet = 'circle(center = [818.33, 168.1], radius = 182.8)'
|
||||||
'circle({ center: [818.33, 168.1], radius: 182.8 }, %)'
|
|
||||||
await moveToCircle()
|
await moveToCircle()
|
||||||
await clickCircle()
|
await clickCircle()
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: [circleSnippet.slice(-5)],
|
activeLines: ['|>' + circleSnippet],
|
||||||
highlightedCode: circleSnippet,
|
highlightedCode: circleSnippet,
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
})
|
})
|
||||||
@ -318,5 +314,26 @@ test.describe(`Testing gizmo, fixture-based`, () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await test.step(`Gizmo should be disabled when in sketch mode`, async () => {
|
||||||
|
const sketchModeButton = page.getByRole('button', {
|
||||||
|
name: 'Edit sketch',
|
||||||
|
})
|
||||||
|
const exitSketchButton = page.getByRole('button', {
|
||||||
|
name: 'Exit sketch',
|
||||||
|
})
|
||||||
|
|
||||||
|
await sketchModeButton.click()
|
||||||
|
await expect(exitSketchButton).toBeVisible()
|
||||||
|
const gizmoPopoverButton = page.getByRole('button', {
|
||||||
|
name: 'view settings',
|
||||||
|
})
|
||||||
|
await gizmoPopoverButton.click()
|
||||||
|
const buttonToTest = page.getByRole('button', {
|
||||||
|
name: 'right view',
|
||||||
|
})
|
||||||
|
await expect(buttonToTest).toBeVisible()
|
||||||
|
await expect(buttonToTest).toBeDisabled()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -825,7 +825,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|
|||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
'persistCode',
|
'persistCode',
|
||||||
`part001 = startSketchOn('XZ')
|
`part001 = startSketchOn('XZ')
|
||||||
|> circle({ center = [1 + 0, 0], radius = 8 }, %)
|
|> circle(center = [1 + 0, 0], radius = 8)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
localStorage.setItem('disableAxis', 'true')
|
localStorage.setItem('disableAxis', 'true')
|
||||||
@ -840,9 +840,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|
|||||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||||
await u.closeDebugPanel()
|
await u.closeDebugPanel()
|
||||||
|
|
||||||
await page
|
await page.getByText('circle(center = [1 + 0, 0], radius = 8)').click()
|
||||||
.getByText('circle({ center = [1 + 0, 0], radius = 8 }, %)')
|
|
||||||
.click()
|
|
||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
await page.getByRole('button', { name: 'Edit Sketch' }).click()
|
||||||
await page.waitForTimeout(500)
|
await page.waitForTimeout(500)
|
||||||
@ -859,11 +857,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|
|||||||
await clickConstrained({
|
await clickConstrained({
|
||||||
hoverPos,
|
hoverPos,
|
||||||
constraintType: 'xAbsolute',
|
constraintType: 'xAbsolute',
|
||||||
expectBeforeUnconstrained:
|
expectBeforeUnconstrained: 'circle(center = [1 + 0, 0], radius = 8)',
|
||||||
'circle({ center = [1 + 0, 0], radius = 8 }, %)',
|
expectAfterUnconstrained: 'circle(center = [1, 0], radius = 8)',
|
||||||
expectAfterUnconstrained:
|
expectFinal: 'circle(center = [xAbs001, 0], radius = 8)',
|
||||||
'circle({ center = [1, 0], radius = 8 }, %)',
|
|
||||||
expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)',
|
|
||||||
ang: ang + 105,
|
ang: ang + 105,
|
||||||
steps: 6,
|
steps: 6,
|
||||||
locator: '[data-overlay-toolbar-index="0"]',
|
locator: '[data-overlay-toolbar-index="0"]',
|
||||||
@ -873,10 +869,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|
|||||||
hoverPos,
|
hoverPos,
|
||||||
constraintType: 'yAbsolute',
|
constraintType: 'yAbsolute',
|
||||||
expectBeforeUnconstrained:
|
expectBeforeUnconstrained:
|
||||||
'circle({ center = [xAbs001, 0], radius = 8 }, %)',
|
'circle(center = [xAbs001, 0], radius = 8)',
|
||||||
expectAfterUnconstrained:
|
expectAfterUnconstrained:
|
||||||
'circle({ center = [xAbs001, yAbs001], radius = 8 }, %)',
|
'circle(center = [xAbs001, yAbs001], radius = 8)',
|
||||||
expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)',
|
expectFinal: 'circle(center = [xAbs001, 0], radius = 8)',
|
||||||
ang: ang + 180,
|
ang: ang + 180,
|
||||||
steps: 30,
|
steps: 30,
|
||||||
locator: '[data-overlay-toolbar-index="0"]',
|
locator: '[data-overlay-toolbar-index="0"]',
|
||||||
@ -886,10 +882,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|
|||||||
hoverPos,
|
hoverPos,
|
||||||
constraintType: 'radius',
|
constraintType: 'radius',
|
||||||
expectBeforeUnconstrained:
|
expectBeforeUnconstrained:
|
||||||
'circle({ center = [xAbs001, 0], radius = 8 }, %)',
|
'circle(center = [xAbs001, 0], radius = 8)',
|
||||||
expectAfterUnconstrained:
|
expectAfterUnconstrained:
|
||||||
'circle({ center = [xAbs001, 0], radius = radius001 }, %)',
|
'circle(center = [xAbs001, 0], radius = radius001)',
|
||||||
expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)',
|
expectFinal: 'circle(center = [xAbs001, 0], radius = 8)',
|
||||||
ang: ang + 105,
|
ang: ang + 105,
|
||||||
steps: 10,
|
steps: 10,
|
||||||
locator: '[data-overlay-toolbar-index="0"]',
|
locator: '[data-overlay-toolbar-index="0"]',
|
||||||
|
@ -320,10 +320,11 @@ part009 = startSketchOn('XY')
|
|||||||
|> close()
|
|> close()
|
||||||
rev = revolve({ axis = 'y' }, part009)
|
rev = revolve({ axis = 'y' }, part009)
|
||||||
sketch006 = startSketchOn('XY')
|
sketch006 = startSketchOn('XY')
|
||||||
profile001 = circle({
|
profile001 = circle(
|
||||||
|
sketch006,
|
||||||
center = [42.91, -70.42],
|
center = [42.91, -70.42],
|
||||||
radius = 17.96
|
radius = 17.96
|
||||||
}, sketch006)
|
)
|
||||||
profile002 = startProfileAt([86.92, -63.81], sketch006)
|
profile002 = startProfileAt([86.92, -63.81], sketch006)
|
||||||
|> angledLine([0, 63.81], %, $rectangleSegmentA001)
|
|> angledLine([0, 63.81], %, $rectangleSegmentA001)
|
||||||
|> angledLine([
|
|> angledLine([
|
||||||
|
@ -62,7 +62,7 @@ test.describe('Testing settings', () => {
|
|||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
exact: true,
|
exact: true,
|
||||||
})
|
})
|
||||||
const inputLocator = page.locator('input[name="modeling-showDebugPanel"]')
|
const inputLocator = page.locator('input[name="app-showDebugPanel"]')
|
||||||
|
|
||||||
await test.step('Open settings dialog and set "Show debug panel" to on', async () => {
|
await test.step('Open settings dialog and set "Show debug panel" to on', async () => {
|
||||||
await page.keyboard.press('ControlOrMeta+,')
|
await page.keyboard.press('ControlOrMeta+,')
|
||||||
@ -125,7 +125,7 @@ test.describe('Testing settings', () => {
|
|||||||
// Check that the project setting did not change
|
// Check that the project setting did not change
|
||||||
await page.getByRole('radio', { name: 'Project' }).click()
|
await page.getByRole('radio', { name: 'Project' }).click()
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('input[name="modeling-showDebugPanel"]')
|
page.locator('input[name="app-showDebugPanel"]')
|
||||||
).not.toBeChecked()
|
).not.toBeChecked()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -833,7 +833,8 @@ test.describe('Testing settings', () => {
|
|||||||
// but "show debug panel" set to false
|
// but "show debug panel" set to false
|
||||||
appSettings: {
|
appSettings: {
|
||||||
...TEST_SETTINGS,
|
...TEST_SETTINGS,
|
||||||
modeling: { ...TEST_SETTINGS.modeling, showDebugPanel: false },
|
app: { ...TEST_SETTINGS.app, showDebugPanel: false },
|
||||||
|
modeling: { ...TEST_SETTINGS.modeling },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async ({ context, page, homePage }) => {
|
async ({ context, page, homePage }) => {
|
||||||
@ -853,7 +854,7 @@ test.describe('Testing settings', () => {
|
|||||||
const debugPaneButton = page.getByTestId('debug-pane-button')
|
const debugPaneButton = page.getByTestId('debug-pane-button')
|
||||||
const commandsButton = page.getByRole('button', { name: 'Commands' })
|
const commandsButton = page.getByRole('button', { name: 'Commands' })
|
||||||
const debugPaneOption = page.getByRole('option', {
|
const debugPaneOption = page.getByRole('option', {
|
||||||
name: 'Settings · modeling · show debug panel',
|
name: 'Settings · app · show debug panel',
|
||||||
})
|
})
|
||||||
|
|
||||||
async function setShowDebugPanelTo(value: 'On' | 'Off') {
|
async function setShowDebugPanelTo(value: 'On' | 'Off') {
|
||||||
|
23
package.json
@ -13,10 +13,10 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.17.0",
|
"@codemirror/autocomplete": "^6.17.0",
|
||||||
"@codemirror/commands": "^6.6.0",
|
"@codemirror/commands": "^6.8.0",
|
||||||
"@codemirror/language": "^6.10.8",
|
"@codemirror/language": "^6.10.8",
|
||||||
"@codemirror/lint": "^6.8.4",
|
"@codemirror/lint": "^6.8.4",
|
||||||
"@codemirror/search": "^6.5.6",
|
"@codemirror/search": "^6.5.10",
|
||||||
"@codemirror/state": "^6.4.1",
|
"@codemirror/state": "^6.4.1",
|
||||||
"@codemirror/theme-one-dark": "^6.1.2",
|
"@codemirror/theme-one-dark": "^6.1.2",
|
||||||
"@csstools/postcss-oklab-function": "^4.0.7",
|
"@csstools/postcss-oklab-function": "^4.0.7",
|
||||||
@ -69,7 +69,7 @@
|
|||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install:rust": "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y",
|
"install:rust": "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85",
|
||||||
"install:rust:windows": "winget install Microsoft.VisualStudio.2022.Community --silent --override \"--wait --quiet --add ProductLang En-us --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended\" && winget install Rustlang.Rustup",
|
"install:rust:windows": "winget install Microsoft.VisualStudio.2022.Community --silent --override \"--wait --quiet --add ProductLang En-us --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended\" && winget install Rustlang.Rustup",
|
||||||
"install:wasm-pack:sh": ". $HOME/.cargo/env && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y",
|
"install:wasm-pack:sh": ". $HOME/.cargo/env && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y",
|
||||||
"install:wasm-pack:cargo": "cargo install wasm-pack",
|
"install:wasm-pack:cargo": "cargo install wasm-pack",
|
||||||
@ -82,7 +82,7 @@
|
|||||||
"build:both": "vite build",
|
"build:both": "vite build",
|
||||||
"build:both:local": "yarn build:wasm && vite build",
|
"build:both:local": "yarn build:wasm && vite build",
|
||||||
"pretest": "yarn remove-importmeta",
|
"pretest": "yarn remove-importmeta",
|
||||||
"test:rust": "(cd src/wasm-lib && cargo test --workspace && cargo clippy --workspace --all-targets)",
|
"test:rust": "(cd rust && just test && just lint)",
|
||||||
"simpleserver": "yarn pretest && http-server ./public --cors -p 3000",
|
"simpleserver": "yarn pretest && http-server ./public --cors -p 3000",
|
||||||
"simpleserver:ci": "yarn pretest && http-server ./public --cors -p 3000 &",
|
"simpleserver:ci": "yarn pretest && http-server ./public --cors -p 3000 &",
|
||||||
"simpleserver:bg": "yarn pretest && http-server ./public --cors -p 3000 &",
|
"simpleserver:bg": "yarn pretest && http-server ./public --cors -p 3000 &",
|
||||||
@ -92,12 +92,12 @@
|
|||||||
"fetch:wasm": "./scripts/get-latest-wasm-bundle.sh",
|
"fetch:wasm": "./scripts/get-latest-wasm-bundle.sh",
|
||||||
"fetch:wasm:windows": "./scripts/get-latest-wasm-bundle.ps1",
|
"fetch:wasm:windows": "./scripts/get-latest-wasm-bundle.ps1",
|
||||||
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/next/manifest.json",
|
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/next/manifest.json",
|
||||||
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
|
"build:wasm-dev": "yarn wasm-prep && (cd rust && wasm-pack build kcl-wasm-lib --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
|
||||||
"build:wasm:nocopy": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings",
|
"build:wasm:nocopy": "yarn wasm-prep && cd rust && wasm-pack build kcl-wasm-lib --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings",
|
||||||
"build:wasm": "yarn build:wasm:nocopy && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",
|
"build:wasm": "yarn build:wasm:nocopy && cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public && yarn fmt",
|
||||||
"build:wasm:windows": "yarn install:wasm-pack:cargo && yarn build:wasm:nocopy && ./scripts/copy-wasm.ps1 && yarn fmt",
|
"build:wasm:windows": "yarn install:wasm-pack:cargo && yarn build:wasm:nocopy && ./scripts/copy-wasm.ps1 && yarn fmt",
|
||||||
"remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"",
|
"remove-importmeta": "sed -i 's/import.meta.url/window.location.origin/g' \"./rust/kcl-wasm-lib/pkg/kcl_wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./rust/kcl-wasm-lib/pkg/kcl_wasm_lib.js\" || echo \"sed for both mac and linux\"",
|
||||||
"wasm-prep": "rimraf src/wasm-lib/pkg && mkdirp src/wasm-lib/pkg && rimraf src/wasm-lib/kcl/bindings",
|
"wasm-prep": "rimraf rust/kcl-wasm-lib/pkg && mkdirp rust/kcl-wasm-lib/pkg && rimraf rust/kcl-lib/bindings",
|
||||||
"lint-fix": "eslint --fix --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src",
|
"lint-fix": "eslint --fix --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src",
|
||||||
"lint": "eslint --max-warnings 0 --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src",
|
"lint": "eslint --max-warnings 0 --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src",
|
||||||
"files:set-version": "echo \"$(jq --arg v \"$VERSION\" '.version=$v' package.json --indent 2)\" > package.json",
|
"files:set-version": "echo \"$(jq --arg v \"$VERSION\" '.version=$v' package.json --indent 2)\" > package.json",
|
||||||
@ -118,6 +118,7 @@
|
|||||||
"tronb:package:prod": "yarn tronb:vite:prod && electron-builder --config electron-builder.yml --publish always",
|
"tronb:package:prod": "yarn tronb:vite:prod && electron-builder --config electron-builder.yml --publish always",
|
||||||
"test-setup": "yarn install && yarn build:wasm",
|
"test-setup": "yarn install && yarn build:wasm",
|
||||||
"test": "vitest --mode development",
|
"test": "vitest --mode development",
|
||||||
|
"test:snapshots": "PLATFORM=web NODE_ENV=development yarn playwright test --config=playwright.config.ts --update-snapshots --grep=@snapshot --trace=on --shard=1/1",
|
||||||
"test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts",
|
"test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts",
|
||||||
"test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts",
|
"test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts",
|
||||||
"test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot'",
|
"test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot'",
|
||||||
@ -164,7 +165,7 @@
|
|||||||
"@playwright/test": "^1.49.0",
|
"@playwright/test": "^1.49.0",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
"@testing-library/react": "^15.0.2",
|
"@testing-library/react": "^15.0.2",
|
||||||
"@types/diff": "^6.0.0",
|
"@types/diff": "^7.0.1",
|
||||||
"@types/electron": "^1.6.10",
|
"@types/electron": "^1.6.10",
|
||||||
"@types/isomorphic-fetch": "^0.0.39",
|
"@types/isomorphic-fetch": "^0.0.39",
|
||||||
"@types/minimist": "^1.2.5",
|
"@types/minimist": "^1.2.5",
|
||||||
@ -197,7 +198,7 @@
|
|||||||
"eslint-plugin-testing-library": "^7.1.1",
|
"eslint-plugin-testing-library": "^7.1.1",
|
||||||
"happy-dom": "^16.3.0",
|
"happy-dom": "^16.3.0",
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"husky": "^9.1.5",
|
"husky": "^9.1.7",
|
||||||
"kill-port": "^2.0.1",
|
"kill-port": "^2.0.1",
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.3.2",
|
||||||
"pixelmatch": "^5.3.0",
|
"pixelmatch": "^5.3.0",
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": false,
|
"private": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "6.17.0",
|
"@codemirror/autocomplete": "6.18.6",
|
||||||
"@codemirror/language": "^6.10.2",
|
"@codemirror/language": "^6.10.2",
|
||||||
"@codemirror/state": "^6.4.1",
|
"@codemirror/state": "^6.4.1",
|
||||||
"@lezer/highlight": "^1.2.0",
|
"@lezer/highlight": "^1.2.0",
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@codemirror/autocomplete@6.17.0":
|
"@codemirror/autocomplete@6.18.6":
|
||||||
version "6.17.0"
|
version "6.18.6"
|
||||||
resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-6.17.0.tgz#24ff5fc37fd91f6439df6f4ff9c8e910cde1b053"
|
resolved "https://registry.yarnpkg.com/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz#de26e864a1ec8192a1b241eb86addbb612964ddb"
|
||||||
integrity sha512-fdfj6e6ZxZf8yrkMHUSJJir7OJkHkZKaOZGzLWIYp2PZ3jd+d+UjG8zVPqJF6d3bKxkhvXTPan/UZ1t7Bqm0gA==
|
integrity sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@codemirror/language" "^6.0.0"
|
"@codemirror/language" "^6.0.0"
|
||||||
"@codemirror/state" "^6.0.0"
|
"@codemirror/state" "^6.0.0"
|
||||||
|
@ -125,6 +125,34 @@
|
|||||||
"title": "100mm Gear Rack",
|
"title": "100mm Gear Rack",
|
||||||
"description": "A flat bar or rail that is engraved with teeth along its length. These teeth are designed to mesh with the teeth of a gear, known as a pinion. When the pinion, a small cylindrical gear, rotates, its teeth engage with the teeth on the rack, causing the rack to move linearly. Conversely, linear motion applied to the rack will cause the pinion to rotate."
|
"description": "A flat bar or rail that is engraved with teeth along its length. These teeth are designed to mesh with the teeth of a gear, known as a pinion. When the pinion, a small cylindrical gear, rotates, its teeth engage with the teeth on the rack, causing the rack to move linearly. Conversely, linear motion applied to the rack will cause the pinion to rotate."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"file": "main.kcl",
|
||||||
|
"pathFromProjectDirectoryToFirstFile": "gridfinity-baseplate/main.kcl",
|
||||||
|
"multipleFiles": false,
|
||||||
|
"title": "Gridfinity Baseplate",
|
||||||
|
"description": "Gridfinity is a system to help you work more efficiently. This is a system invented by Zack Freedman. There are two main components the baseplate and the bins. The components are comprised of a matrix of squares. Allowing easy stacking and expansion"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "main.kcl",
|
||||||
|
"pathFromProjectDirectoryToFirstFile": "gridfinity-baseplate-magnets/main.kcl",
|
||||||
|
"multipleFiles": false,
|
||||||
|
"title": "Gridfinity Baseplate With Magnets",
|
||||||
|
"description": "Gridfinity is a system to help you work more efficiently. This is a system invented by Zack Freedman. There are two main components the baseplate and the bins. The components are comprised of a matrix of squares. Allowing easy stacking and expansion. This baseplate version includes holes for magnet placement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "main.kcl",
|
||||||
|
"pathFromProjectDirectoryToFirstFile": "gridfinity-bins/main.kcl",
|
||||||
|
"multipleFiles": false,
|
||||||
|
"title": "Gridfinity Bins",
|
||||||
|
"description": "Gridfinity is a system to help you work more efficiently. This is a system invented by Zack Freedman. There are two main components the baseplate and the bins. The components are comprised of a matrix of squares. Allowing easy stacking and expansion"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "main.kcl",
|
||||||
|
"pathFromProjectDirectoryToFirstFile": "gridfinity-bins-stacking-lip/main.kcl",
|
||||||
|
"multipleFiles": false,
|
||||||
|
"title": "Gridfinity Bins With A Stacking Lip",
|
||||||
|
"description": "Gridfinity is a system to help you work more efficiently. This is a system invented by Zack Freedman. There are two main components the baseplate and the bins. The components are comprised of a matrix of squares. Allowing easy stacking and expansion. This Gridfinity bins version includes a lip to allowable stacking Gridfinity bins"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"file": "main.kcl",
|
"file": "main.kcl",
|
||||||
"pathFromProjectDirectoryToFirstFile": "hex-nut/main.kcl",
|
"pathFromProjectDirectoryToFirstFile": "hex-nut/main.kcl",
|
||||||
|
487
src/wasm-lib/Cargo.lock → rust/Cargo.lock
generated
@ -191,12 +191,6 @@ dependencies = [
|
|||||||
"syn 2.0.96",
|
"syn 2.0.96",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "atomic-waker"
|
|
||||||
version = "1.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "auto_impl"
|
name = "auto_impl"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
@ -478,7 +472,7 @@ version = "4.5.24"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
|
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.96",
|
"syn 2.0.96",
|
||||||
@ -531,9 +525,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "convert_case"
|
name = "convert_case"
|
||||||
version = "0.6.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
|
checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
@ -696,7 +690,7 @@ dependencies = [
|
|||||||
"hashbrown 0.14.5",
|
"hashbrown 0.14.5",
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot_core 0.9.10",
|
"parking_lot_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -710,7 +704,7 @@ dependencies = [
|
|||||||
"hashbrown 0.14.5",
|
"hashbrown 0.14.5",
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"parking_lot_core 0.9.10",
|
"parking_lot_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -728,25 +722,6 @@ dependencies = [
|
|||||||
"powerfmt",
|
"powerfmt",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "derive-docs"
|
|
||||||
version = "0.1.40"
|
|
||||||
dependencies = [
|
|
||||||
"Inflector",
|
|
||||||
"anyhow",
|
|
||||||
"convert_case",
|
|
||||||
"expectorate",
|
|
||||||
"once_cell",
|
|
||||||
"pretty_assertions",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"regex",
|
|
||||||
"rustfmt-wrapper",
|
|
||||||
"serde",
|
|
||||||
"serde_tokenstream",
|
|
||||||
"syn 2.0.96",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_arbitrary"
|
name = "derive_arbitrary"
|
||||||
version = "1.4.1"
|
version = "1.4.1"
|
||||||
@ -798,7 +773,7 @@ dependencies = [
|
|||||||
"backtrace",
|
"backtrace",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"mintex",
|
"mintex",
|
||||||
"parking_lot 0.12.3",
|
"parking_lot",
|
||||||
"rustc-hash 1.1.0",
|
"rustc-hash 1.1.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -1108,12 +1083,6 @@ version = "0.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "60884563ea313b5037683cd5d44f1e14e9cb07b08543756242a65887f9cff48e"
|
checksum = "60884563ea313b5037683cd5d44f1e14e9cb07b08543756242a65887f9cff48e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "glob"
|
|
||||||
version = "0.3.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gloo-utils"
|
name = "gloo-utils"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -1151,25 +1120,6 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "h2"
|
|
||||||
version = "0.4.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e"
|
|
||||||
dependencies = [
|
|
||||||
"atomic-waker",
|
|
||||||
"bytes",
|
|
||||||
"fnv",
|
|
||||||
"futures-core",
|
|
||||||
"futures-sink",
|
|
||||||
"http 1.2.0",
|
|
||||||
"indexmap 2.7.1",
|
|
||||||
"slab",
|
|
||||||
"tokio",
|
|
||||||
"tokio-util",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "half"
|
name = "half"
|
||||||
version = "2.4.1"
|
version = "2.4.1"
|
||||||
@ -1214,12 +1164,6 @@ version = "0.15.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "heck"
|
|
||||||
version = "0.4.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "heck"
|
name = "heck"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
@ -1347,7 +1291,6 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
|
||||||
"http 1.2.0",
|
"http 1.2.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"httparse",
|
"httparse",
|
||||||
@ -1638,18 +1581,6 @@ dependencies = [
|
|||||||
"similar",
|
"similar",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "instant"
|
|
||||||
version = "0.1.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"js-sys",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"web-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipnet"
|
name = "ipnet"
|
||||||
version = "2.11.0"
|
version = "2.11.0"
|
||||||
@ -1722,9 +1653,28 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kcl-derive-docs"
|
||||||
|
version = "0.1.45"
|
||||||
|
dependencies = [
|
||||||
|
"Inflector",
|
||||||
|
"anyhow",
|
||||||
|
"convert_case",
|
||||||
|
"expectorate",
|
||||||
|
"once_cell",
|
||||||
|
"pretty_assertions",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"regex",
|
||||||
|
"rustfmt-wrapper",
|
||||||
|
"serde",
|
||||||
|
"serde_tokenstream",
|
||||||
|
"syn 2.0.96",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kcl-lib"
|
name = "kcl-lib"
|
||||||
version = "0.2.41"
|
version = "0.2.45"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"approx 0.5.1",
|
"approx 0.5.1",
|
||||||
@ -1737,7 +1687,6 @@ dependencies = [
|
|||||||
"convert_case",
|
"convert_case",
|
||||||
"criterion",
|
"criterion",
|
||||||
"dashmap 6.1.0",
|
"dashmap 6.1.0",
|
||||||
"derive-docs",
|
|
||||||
"dhat",
|
"dhat",
|
||||||
"expectorate",
|
"expectorate",
|
||||||
"fnv",
|
"fnv",
|
||||||
@ -1752,13 +1701,14 @@ dependencies = [
|
|||||||
"insta",
|
"insta",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
"kcl-derive-docs",
|
||||||
"kittycad",
|
"kittycad",
|
||||||
"kittycad-modeling-cmds",
|
"kittycad-modeling-cmds",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"measurements",
|
"measurements",
|
||||||
"miette",
|
"miette",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
"parse-display 0.9.1",
|
"parse-display 0.10.0",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"pyo3",
|
"pyo3",
|
||||||
"regex",
|
"regex",
|
||||||
@ -1778,7 +1728,6 @@ dependencies = [
|
|||||||
"ts-rs",
|
"ts-rs",
|
||||||
"twenty-twenty",
|
"twenty-twenty",
|
||||||
"url",
|
"url",
|
||||||
"urlencoding",
|
|
||||||
"uuid",
|
"uuid",
|
||||||
"validator",
|
"validator",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@ -1789,9 +1738,24 @@ dependencies = [
|
|||||||
"zip",
|
"zip",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kcl-python-bindings"
|
||||||
|
version = "0.3.45"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"kcl-lib",
|
||||||
|
"kittycad-modeling-cmds",
|
||||||
|
"miette",
|
||||||
|
"pyo3",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kcl-test-server"
|
name = "kcl-test-server"
|
||||||
version = "0.1.40"
|
version = "0.1.45"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"hyper 0.14.32",
|
"hyper 0.14.32",
|
||||||
@ -1816,6 +1780,30 @@ dependencies = [
|
|||||||
"uuid",
|
"uuid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kcl-wasm-lib"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"bson",
|
||||||
|
"console_error_panic_hook",
|
||||||
|
"data-encoding",
|
||||||
|
"futures",
|
||||||
|
"getrandom 0.2.15",
|
||||||
|
"gloo-utils",
|
||||||
|
"js-sys",
|
||||||
|
"kcl-lib",
|
||||||
|
"kittycad",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
"toml",
|
||||||
|
"tower-lsp",
|
||||||
|
"uuid",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"wasm-streams",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kittycad"
|
name = "kittycad"
|
||||||
version = "0.3.28"
|
version = "0.3.28"
|
||||||
@ -1840,10 +1828,6 @@ dependencies = [
|
|||||||
"phonenumber",
|
"phonenumber",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"reqwest-conditional-middleware",
|
|
||||||
"reqwest-middleware",
|
|
||||||
"reqwest-retry",
|
|
||||||
"reqwest-tracing",
|
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
@ -1858,9 +1842,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kittycad-modeling-cmds"
|
name = "kittycad-modeling-cmds"
|
||||||
version = "0.2.99"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "828a0c74476533e6258ea7dd70cfc7d63a5df4b37753d30ef198e0689eaac4eb"
|
checksum = "fb5a824cb9bb4c602962ecbaca5ce71225938aa1abc24103bf46c222f468dd26"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -1994,12 +1978,6 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "matchit"
|
|
||||||
version = "0.8.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2f926ade0c4e170215ae43342bf13b9310a437609c81f29f86c5df6657582ef9"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "measurements"
|
name = "measurements"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
@ -2220,38 +2198,6 @@ version = "0.1.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
|
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "opentelemetry"
|
|
||||||
version = "0.24.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4c365a63eec4f55b7efeceb724f1336f26a9cf3427b70e59e2cd2a5b947fba96"
|
|
||||||
dependencies = [
|
|
||||||
"futures-core",
|
|
||||||
"futures-sink",
|
|
||||||
"js-sys",
|
|
||||||
"once_cell",
|
|
||||||
"pin-project-lite",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "opentelemetry_sdk"
|
|
||||||
version = "0.24.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "692eac490ec80f24a17828d49b40b60f5aeaccdfe6a503f939713afd22bc28df"
|
|
||||||
dependencies = [
|
|
||||||
"async-trait",
|
|
||||||
"futures-channel",
|
|
||||||
"futures-executor",
|
|
||||||
"futures-util",
|
|
||||||
"glob",
|
|
||||||
"once_cell",
|
|
||||||
"opentelemetry",
|
|
||||||
"percent-encoding",
|
|
||||||
"rand 0.8.5",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "owo-colors"
|
name = "owo-colors"
|
||||||
version = "4.1.0"
|
version = "4.1.0"
|
||||||
@ -2260,24 +2206,13 @@ checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "papergrid"
|
name = "papergrid"
|
||||||
version = "0.11.0"
|
version = "0.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ad43c07024ef767f9160710b3a6773976194758c7919b17e63b863db0bdf7fb"
|
checksum = "b915f831b85d984193fdc3d3611505871dc139b2534530fa01c1a6a6707b6723"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytecount",
|
"bytecount",
|
||||||
"fnv",
|
"fnv",
|
||||||
"unicode-width 0.1.14",
|
"unicode-width 0.2.0",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking_lot"
|
|
||||||
version = "0.11.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
|
||||||
dependencies = [
|
|
||||||
"instant",
|
|
||||||
"lock_api",
|
|
||||||
"parking_lot_core 0.8.6",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2287,21 +2222,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
|
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lock_api",
|
"lock_api",
|
||||||
"parking_lot_core 0.9.10",
|
"parking_lot_core",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking_lot_core"
|
|
||||||
version = "0.8.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"instant",
|
|
||||||
"libc",
|
|
||||||
"redox_syscall 0.2.16",
|
|
||||||
"smallvec",
|
|
||||||
"winapi",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2312,7 +2233,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall 0.5.8",
|
"redox_syscall",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows-targets",
|
"windows-targets",
|
||||||
]
|
]
|
||||||
@ -2548,30 +2469,6 @@ dependencies = [
|
|||||||
"yansi",
|
"yansi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "proc-macro-error"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro-error-attr",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
"version_check",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "proc-macro-error-attr"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"version_check",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-error-attr2"
|
name = "proc-macro-error-attr2"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
@ -2618,6 +2515,7 @@ dependencies = [
|
|||||||
"pyo3-build-config",
|
"pyo3-build-config",
|
||||||
"pyo3-ffi",
|
"pyo3-ffi",
|
||||||
"pyo3-macros",
|
"pyo3-macros",
|
||||||
|
"serde",
|
||||||
"unindent",
|
"unindent",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2659,7 +2557,7 @@ version = "0.22.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
|
checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"pyo3-build-config",
|
"pyo3-build-config",
|
||||||
"quote",
|
"quote",
|
||||||
@ -2829,15 +2727,6 @@ dependencies = [
|
|||||||
"rand_core 0.3.1",
|
"rand_core 0.3.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "redox_syscall"
|
|
||||||
version = "0.2.16"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 1.3.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.5.8"
|
version = "0.5.8"
|
||||||
@ -2904,7 +2793,6 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
|
||||||
"http 1.2.0",
|
"http 1.2.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
@ -2941,82 +2829,6 @@ dependencies = [
|
|||||||
"windows-registry",
|
"windows-registry",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "reqwest-conditional-middleware"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f67ad7fdf5c0a015763fcd164bee294b13fb7b6f89f1b55961d40f00c3e32d6b"
|
|
||||||
dependencies = [
|
|
||||||
"async-trait",
|
|
||||||
"http 1.2.0",
|
|
||||||
"reqwest",
|
|
||||||
"reqwest-middleware",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "reqwest-middleware"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d1ccd3b55e711f91a9885a2fa6fbbb2e39db1776420b062efc058c6410f7e5e3"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"http 1.2.0",
|
|
||||||
"reqwest",
|
|
||||||
"serde",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
"tower-service",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "reqwest-retry"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "29c73e4195a6bfbcb174b790d9b3407ab90646976c55de58a6515da25d851178"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"futures",
|
|
||||||
"getrandom 0.2.15",
|
|
||||||
"http 1.2.0",
|
|
||||||
"hyper 1.5.2",
|
|
||||||
"parking_lot 0.11.2",
|
|
||||||
"reqwest",
|
|
||||||
"reqwest-middleware",
|
|
||||||
"retry-policies",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
"tokio",
|
|
||||||
"tracing",
|
|
||||||
"wasm-timer",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "reqwest-tracing"
|
|
||||||
version = "0.5.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "73e6153390585f6961341b50e5a1931d6be6dee4292283635903c26ef9d980d2"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"getrandom 0.2.15",
|
|
||||||
"http 1.2.0",
|
|
||||||
"matchit",
|
|
||||||
"opentelemetry",
|
|
||||||
"reqwest",
|
|
||||||
"reqwest-middleware",
|
|
||||||
"tracing",
|
|
||||||
"tracing-opentelemetry",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "retry-policies"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5875471e6cab2871bc150ecb8c727db5113c9338cc3354dc5ee3425b6aa40a1c"
|
|
||||||
dependencies = [
|
|
||||||
"rand 0.8.5",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rgba_simple"
|
name = "rgba_simple"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
@ -3374,15 +3186,6 @@ dependencies = [
|
|||||||
"digest",
|
"digest",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sharded-slab"
|
|
||||||
version = "0.1.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
|
|
||||||
dependencies = [
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shlex"
|
name = "shlex"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
@ -3497,7 +3300,7 @@ version = "0.26.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
@ -3575,26 +3378,25 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tabled"
|
name = "tabled"
|
||||||
version = "0.15.0"
|
version = "0.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c998b0c8b921495196a48aabaf1901ff28be0760136e31604f7967b0792050e"
|
checksum = "121d8171ee5687a4978d1b244f7d99c43e7385a272185a2f1e1fa4dc0979d444"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"papergrid",
|
"papergrid",
|
||||||
"tabled_derive",
|
"tabled_derive",
|
||||||
"unicode-width 0.1.14",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tabled_derive"
|
name = "tabled_derive"
|
||||||
version = "0.7.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c138f99377e5d653a371cdad263615634cfc8467685dfe8e73e2b8e98f44b17"
|
checksum = "52d9946811baad81710ec921809e2af67ad77719418673b2a3794932d57b7538"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.4.1",
|
"heck",
|
||||||
"proc-macro-error",
|
"proc-macro-error2",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn 2.0.96",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3698,16 +3500,6 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
|
checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thread_local"
|
|
||||||
version = "1.1.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"once_cell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.37"
|
version = "0.3.37"
|
||||||
@ -3784,7 +3576,7 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"parking_lot 0.12.3",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"socket2",
|
"socket2",
|
||||||
@ -3995,47 +3787,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
|
checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"valuable",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-log"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
|
|
||||||
dependencies = [
|
|
||||||
"log",
|
|
||||||
"once_cell",
|
|
||||||
"tracing-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-opentelemetry"
|
|
||||||
version = "0.25.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a9784ed4da7d921bc8df6963f8c80a0e4ce34ba6ba76668acadd3edbd985ff3b"
|
|
||||||
dependencies = [
|
|
||||||
"js-sys",
|
|
||||||
"once_cell",
|
|
||||||
"opentelemetry",
|
|
||||||
"opentelemetry_sdk",
|
|
||||||
"smallvec",
|
|
||||||
"tracing",
|
|
||||||
"tracing-core",
|
|
||||||
"tracing-log",
|
|
||||||
"tracing-subscriber",
|
|
||||||
"web-time",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-subscriber"
|
|
||||||
version = "0.3.19"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
|
|
||||||
dependencies = [
|
|
||||||
"sharded-slab",
|
|
||||||
"thread_local",
|
|
||||||
"tracing-core",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4176,12 +3927,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "urlencoding"
|
|
||||||
version = "2.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "utf-8"
|
name = "utf-8"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
@ -4220,9 +3965,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "validator"
|
name = "validator"
|
||||||
version = "0.19.0"
|
version = "0.20.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0b4a29d8709210980a09379f27ee31549b73292c87ab9899beee1c0d3be6303"
|
checksum = "43fb22e1a008ece370ce08a3e9e4447a910e92621bb49b85d6e48a45397e7cfa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"idna",
|
"idna",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@ -4236,9 +3981,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "validator_derive"
|
name = "validator_derive"
|
||||||
version = "0.19.0"
|
version = "0.20.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bac855a2ce6f843beb229757e6e570a42e837bcb15e5f449dd48d5747d41bf77"
|
checksum = "b7df16e474ef958526d1205f6dda359fdfab79d9aa6d54bafcb92dcd07673dca"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@ -4248,12 +3993,6 @@ dependencies = [
|
|||||||
"syn 2.0.96",
|
"syn 2.0.96",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "valuable"
|
|
||||||
version = "0.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
@ -4366,37 +4105,6 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasm-lib"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"bson",
|
|
||||||
"console_error_panic_hook",
|
|
||||||
"data-encoding",
|
|
||||||
"futures",
|
|
||||||
"getrandom 0.2.15",
|
|
||||||
"gloo-utils",
|
|
||||||
"image",
|
|
||||||
"js-sys",
|
|
||||||
"kcl-lib",
|
|
||||||
"kittycad",
|
|
||||||
"kittycad-modeling-cmds",
|
|
||||||
"lazy_static",
|
|
||||||
"pretty_assertions",
|
|
||||||
"reqwest",
|
|
||||||
"serde_json",
|
|
||||||
"tokio",
|
|
||||||
"toml",
|
|
||||||
"tower-lsp",
|
|
||||||
"twenty-twenty",
|
|
||||||
"uuid",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"wasm-bindgen-futures",
|
|
||||||
"wasm-streams",
|
|
||||||
"web-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-streams"
|
name = "wasm-streams"
|
||||||
version = "0.4.2"
|
version = "0.4.2"
|
||||||
@ -4410,21 +4118,6 @@ dependencies = [
|
|||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasm-timer"
|
|
||||||
version = "0.2.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
|
|
||||||
dependencies = [
|
|
||||||
"futures",
|
|
||||||
"js-sys",
|
|
||||||
"parking_lot 0.11.2",
|
|
||||||
"pin-utils",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"wasm-bindgen-futures",
|
|
||||||
"web-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web-sys"
|
name = "web-sys"
|
||||||
version = "0.3.77"
|
version = "0.3.77"
|
50
rust/Cargo.toml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
members = [
|
||||||
|
"kcl-derive-docs",
|
||||||
|
"kcl-lib",
|
||||||
|
"kcl-python-bindings",
|
||||||
|
"kcl-test-server",
|
||||||
|
"kcl-to-core",
|
||||||
|
"kcl-wasm-lib"
|
||||||
|
]
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
panic = "abort"
|
||||||
|
debug = true
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
debug = 0
|
||||||
|
|
||||||
|
[profile.dev.package]
|
||||||
|
insta = { opt-level = 3 }
|
||||||
|
similar = { opt-level = 3 }
|
||||||
|
|
||||||
|
[profile.test]
|
||||||
|
debug = "line-tables-only"
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
async-trait = "0.1.85"
|
||||||
|
anyhow = { version = "1" }
|
||||||
|
http = "1"
|
||||||
|
indexmap = "2.7.0"
|
||||||
|
kittycad = { version = "0.3.28", default-features = false, features = ["js", "requests"] }
|
||||||
|
kittycad-modeling-cmds = { version = "0.2.100", features = ["ts-rs", "websocket"] }
|
||||||
|
miette = "7.5.0"
|
||||||
|
pyo3 = { version = "0.22.6" }
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = { version = "1" }
|
||||||
|
tokio = { version = "1" }
|
||||||
|
tower-lsp = { version = "0.20.0", default-features = false }
|
||||||
|
uuid = { version = "1", features = ["v4", "serde"] }
|
||||||
|
|
||||||
|
[workspace.lints.clippy]
|
||||||
|
assertions_on_result_states = "warn"
|
||||||
|
dbg_macro = "warn"
|
||||||
|
iter_over_hash_type = "warn"
|
||||||
|
lossy_float_literal = "warn"
|
||||||
|
|
||||||
|
# Example: how to point modeling-app at a different repo (e.g. a branch or a local clone)
|
||||||
|
#[patch.crates-io]
|
||||||
|
#kittycad-modeling-cmds = { path = "../../../modeling-api/modeling-cmds" }
|
||||||
|
#kittycad-modeling-session = { path = "../../../modeling-api/modeling-session" }
|
@ -3,7 +3,7 @@ cita := "cargo insta test --accept"
|
|||||||
|
|
||||||
# Run the same lint checks we run in CI.
|
# Run the same lint checks we run in CI.
|
||||||
lint:
|
lint:
|
||||||
cargo clippy --workspace --all-targets -- -D warnings
|
cargo clippy --workspace --all-targets --tests --all-features --examples --benches -- -D warnings
|
||||||
|
|
||||||
# Run the stdlib docs generation
|
# Run the stdlib docs generation
|
||||||
redo-kcl-stdlib-docs-no-imgs:
|
redo-kcl-stdlib-docs-no-imgs:
|
||||||
@ -17,17 +17,17 @@ redo-kcl-stdlib-docs:
|
|||||||
|
|
||||||
# Copy a test KCL file from executor tests into a new simulation test.
|
# Copy a test KCL file from executor tests into a new simulation test.
|
||||||
copy-exec-test-into-sim-test test_name:
|
copy-exec-test-into-sim-test test_name:
|
||||||
mkdir -p kcl/tests/{{test_name}}
|
mkdir -p kcl-lib/tests/{{test_name}}
|
||||||
cp tests/executor/inputs/{{test_name}}.kcl kcl/tests/{{test_name}}/input.kcl
|
cp kcl-lib/e2e/executor/inputs/{{test_name}}.kcl kcl-lib/tests/{{test_name}}/input.kcl
|
||||||
zoo kcl fmt -w kcl/tests/{{test_name}}/input.kcl
|
zoo kcl fmt -w kcl-lib/tests/{{test_name}}/input.kcl
|
||||||
just new-sim-test {{test_name}}
|
just new-sim-test {{test_name}}
|
||||||
|
|
||||||
# Create a new, empty KCL deterministic simulation test case.
|
# Create a new, empty KCL deterministic simulation test case.
|
||||||
new-sim-test test_name render_to_png="true":
|
new-sim-test test_name render_to_png="true":
|
||||||
mkdir kcl/tests/{{test_name}}
|
mkdir kcl-lib/tests/{{test_name}}
|
||||||
touch kcl/tests/{{test_name}}/input.kcl
|
touch kcl-lib/tests/{{test_name}}/input.kcl
|
||||||
# Add the various tests for this new test case.
|
# Add the various tests for this new test case.
|
||||||
cat kcl/tests/simtest.tmpl | sed "s/TEST_NAME_HERE/{{test_name}}/" | sed "s/RENDER_TO_PNG/{{render_to_png}}/" >> kcl/src/simulation_tests.rs
|
cat kcl-lib/tests/simtest.tmpl | sed "s/TEST_NAME_HERE/{{test_name}}/" | sed "s/RENDER_TO_PNG/{{render_to_png}}/" >> kcl-lib/src/simulation_tests.rs
|
||||||
|
|
||||||
# Run a KCL deterministic simulation test case and accept output.
|
# Run a KCL deterministic simulation test case and accept output.
|
||||||
run-sim-test test_name:
|
run-sim-test test_name:
|
||||||
@ -42,11 +42,13 @@ overwrite-sim-test test_name:
|
|||||||
{{cita}} -p kcl-lib -- tests::{{test_name}}::kcl_test_execute
|
{{cita}} -p kcl-lib -- tests::{{test_name}}::kcl_test_execute
|
||||||
|
|
||||||
test:
|
test:
|
||||||
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --no-fail-fast
|
||||||
|
|
||||||
publish-kcl version:
|
publish-kcl version:
|
||||||
git tag {{version}}
|
git tag kcl-{{version}}
|
||||||
git push --tags
|
cargo publish -p kcl-derive-docs
|
||||||
cargo publish -p derive-docs
|
|
||||||
cargo publish -p kcl-lib
|
cargo publish -p kcl-lib
|
||||||
cargo publish -p kcl-test-server
|
cargo publish -p kcl-test-server
|
||||||
|
# We push the tag at the end of publish since pushing the tag
|
||||||
|
# will trigger CI to release the kcl python bindings.
|
||||||
|
git push origin kcl-{{version}}
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "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.40"
|
version = "0.1.45"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/KittyCAD/modeling-app"
|
repository = "https://github.com/KittyCAD/modeling-app"
|
||||||
@ -13,17 +13,17 @@ proc-macro = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
Inflector = "0.11.4"
|
Inflector = "0.11.4"
|
||||||
convert_case = "0.6.0"
|
convert_case = "0.8.0"
|
||||||
once_cell = "1.20.2"
|
once_cell = "1.20.2"
|
||||||
proc-macro2 = "1"
|
proc-macro2 = "1"
|
||||||
quote = "1"
|
quote = "1"
|
||||||
regex = "1.11"
|
regex = "1.11"
|
||||||
serde = { version = "1.0.217", features = ["derive"] }
|
serde = { workspace = true }
|
||||||
serde_tokenstream = "0.2"
|
serde_tokenstream = "0.2"
|
||||||
syn = { version = "2.0.96", features = ["full"] }
|
syn = { version = "2.0.96", features = ["full"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
anyhow = "1.0.95"
|
anyhow = { workspace = true }
|
||||||
expectorate = "1.1.0"
|
expectorate = "1.1.0"
|
||||||
pretty_assertions = "1.4.1"
|
pretty_assertions = "1.4.1"
|
||||||
rustfmt-wrapper = "0.2.1"
|
rustfmt-wrapper = "0.2.1"
|