Compare commits
51 Commits
achalmers/
...
nightly-v2
Author | SHA1 | Date | |
---|---|---|---|
c8cee6a0dc | |||
167445ef8a | |||
95b72d839b | |||
9365186bed | |||
eea026f8e0 | |||
3cd7a3533e | |||
9e1f1152e3 | |||
60d2be9ff2 | |||
0f59894d66 | |||
74c07fc0eb | |||
67a8bf525d | |||
129b91518f | |||
c0aa763c3b | |||
319c60d4fa | |||
66f95d25f6 | |||
72ab72cea1 | |||
4e1e9f9c6e | |||
8b14d32879 | |||
7c5170dc16 | |||
a07dbc3aac | |||
7d3294ff78 | |||
121c393466 | |||
c6ec54c138 | |||
1f6b90d383 | |||
c45c2e27ba | |||
5832890dbb | |||
6f2e6d14b6 | |||
0d899694b2 | |||
7bd5e7365d | |||
a63e51e2ad | |||
1b8eee86a1 | |||
6d50278d34 | |||
35844842de | |||
843e772094 | |||
9d0518dfeb | |||
d33d399c31 | |||
970cf7f017 | |||
d125efcd60 | |||
4664427832 | |||
d84b9cc875 | |||
0c6b6bf5d5 | |||
d275995dfe | |||
b03ca30379 | |||
e5f23a49b4 | |||
e78100eaac | |||
ae9d8be4e4 | |||
e4f73a6d5c | |||
a31fd608cf | |||
a98d5aa2fb | |||
4c6ef841bb | |||
997f539a8c |
@ -1,3 +1,3 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
|
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
|
||||||
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo
|
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts
|
||||||
|
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -7,11 +7,11 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
|
|||||||
# If no last run artifact, than run Playwright normally
|
# If no last run artifact, than run Playwright normally
|
||||||
echo "run playwright normally"
|
echo "run playwright normally"
|
||||||
if [[ "$3" == *ubuntu* ]]; then
|
if [[ "$3" == *ubuntu* ]]; then
|
||||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --shard=$1/$2 || true
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --shard=$1/$2 || true
|
||||||
elif [[ "$3" == *windows* ]]; then
|
elif [[ "$3" == *windows* ]]; then
|
||||||
yarn test:playwright:electron:windows -- --shard=$1/$2 || true
|
npm run test:playwright:electron:windows -- --shard=$1/$2 || true
|
||||||
elif [[ "$3" == *macos* ]]; then
|
elif [[ "$3" == *macos* ]]; then
|
||||||
yarn test:playwright:electron:macos -- --shard=$1/$2 || true
|
npm run test:playwright:electron:macos -- --shard=$1/$2 || true
|
||||||
else
|
else
|
||||||
echo "Do not run Playwright. Unable to detect os runtime."
|
echo "Do not run Playwright. Unable to detect os runtime."
|
||||||
exit 1
|
exit 1
|
||||||
@ -31,11 +31,11 @@ while [[ $retry -le $max_retries ]]; do
|
|||||||
echo "retried=true" >>$GITHUB_OUTPUT
|
echo "retried=true" >>$GITHUB_OUTPUT
|
||||||
echo "run playwright with last failed tests and retry $retry"
|
echo "run playwright with last failed tests and retry $retry"
|
||||||
if [[ "$3" == *ubuntu* ]]; then
|
if [[ "$3" == *ubuntu* ]]; then
|
||||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --last-failed || true
|
||||||
elif [[ "$3" == *windows* ]]; then
|
elif [[ "$3" == *windows* ]]; then
|
||||||
yarn test:playwright:electron:windows -- --last-failed || true
|
npm run test:playwright:electron:windows -- --last-failed || true
|
||||||
elif [[ "$3" == *macos* ]]; then
|
elif [[ "$3" == *macos* ]]; then
|
||||||
yarn test:playwright:electron:macos -- --last-failed || true
|
npm run test:playwright:electron:macos -- --last-failed || true
|
||||||
else
|
else
|
||||||
echo "Do not run playwright. Unable to detect os runtime."
|
echo "Do not run playwright. Unable to detect os runtime."
|
||||||
exit 1
|
exit 1
|
||||||
|
6
.github/workflows/build-and-store-wasm.yml
vendored
6
.github/workflows/build-and-store-wasm.yml
vendored
@ -13,9 +13,9 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: npm install
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust
|
||||||
- name: build wasm
|
- name: build wasm
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
|
|
||||||
# Upload the WASM bundle as an artifact
|
# Upload the WASM bundle as an artifact
|
||||||
|
37
.github/workflows/build-apps.yml
vendored
37
.github/workflows/build-apps.yml
vendored
@ -29,9 +29,9 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- id: filter
|
- id: filter
|
||||||
name: Check for Rust changes
|
name: Check for Rust changes
|
||||||
@ -90,20 +90,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Run build:wasm
|
- name: Run build:wasm
|
||||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
run: "yarn build:wasm"
|
run: "npm run build:wasm"
|
||||||
|
|
||||||
- name: Set nightly version, product name, release notes, and icons
|
- name: Set nightly version, product name, release notes, and icons
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
export VERSION=${GITHUB_REF_NAME#nightly-v}
|
export VERSION=${GITHUB_REF_NAME#nightly-v}
|
||||||
yarn files:set-version
|
npm run files:set-version
|
||||||
yarn files:flip-to-nightly
|
npm run files:flip-to-nightly
|
||||||
|
|
||||||
- name: Set release version
|
- name: Set release version
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
export VERSION=${GITHUB_REF_NAME#v}
|
export VERSION=${GITHUB_REF_NAME#v}
|
||||||
yarn files:set-version
|
npm run files:set-version
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -172,16 +172,16 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
cache: 'npm' # Set this to npm, npm or pnpm.
|
||||||
|
|
||||||
- name: yarn install
|
- name: npm 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.2
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
timeout_minutes: 2
|
timeout_minutes: 2
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn install
|
command: npm install
|
||||||
|
|
||||||
- name: Prepare certificate and variables (Windows only)
|
- name: Prepare certificate and variables (Windows only)
|
||||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
||||||
@ -207,13 +207,20 @@ jobs:
|
|||||||
smctl.exe keypair ls
|
smctl.exe keypair ls
|
||||||
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
|
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
|
||||||
smksp_cert_sync.exe
|
smksp_cert_sync.exe
|
||||||
|
smctl windows certsync
|
||||||
|
# This last line `smctl windows certsync` was added after windows codesign failures started happening
|
||||||
|
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
|
||||||
|
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
|
||||||
|
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
|
||||||
|
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
|
||||||
|
# TODO: we still need to make sign-win.js errors fail the workflow, see issue #6276
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Build the app (debug)
|
- name: Build the app (debug)
|
||||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
||||||
# electron-builder doesn't have a concept of release vs debug,
|
# electron-builder doesn't have a concept of release vs debug,
|
||||||
# this is just not doing any codesign or release yml generation, and points to dev infra
|
# this is just not doing any codesign or release yml generation, and points to dev infra
|
||||||
run: yarn tronb:package:dev
|
run: npm run tronb:package:dev
|
||||||
|
|
||||||
- name: Build the app (release)
|
- name: Build the app (release)
|
||||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||||
@ -233,7 +240,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: npm run tronb:package:prod
|
||||||
|
|
||||||
- name: List artifacts in out/
|
- name: List artifacts in out/
|
||||||
run: ls -R out
|
run: ls -R out
|
||||||
@ -295,7 +302,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn tronb:package:prod
|
command: npm run tronb:package:prod
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
@ -378,7 +385,7 @@ jobs:
|
|||||||
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
||||||
PUB_DATE: ${{ github.event.repository.updated_at }}
|
PUB_DATE: ${{ github.event.repository.updated_at }}
|
||||||
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||||
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
|
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_DIR=https://${WEBSITE_DIR}
|
RELEASE_DIR=https://${WEBSITE_DIR}
|
||||||
jq --null-input \
|
jq --null-input \
|
||||||
@ -435,7 +442,7 @@ jobs:
|
|||||||
export TAG="nightly-${VERSION}"
|
export TAG="nightly-${VERSION}"
|
||||||
export PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
|
export PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
|
||||||
export NOTES=$(./scripts/get-nightly-changelog.sh)
|
export NOTES=$(./scripts/get-nightly-changelog.sh)
|
||||||
yarn files:set-notes
|
npm run files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
@ -460,4 +467,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
run: yarn files:invalidate-bucket:nightly
|
run: npm run files:invalidate-bucket:nightly
|
||||||
|
7
.github/workflows/check-exampleKcl.yml
vendored
7
.github/workflows/check-exampleKcl.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
paths:
|
paths:
|
||||||
- 'src/lib/exampleKcl.ts'
|
- 'src/lib/exampleKcl.ts'
|
||||||
|
- 'public/kcl-samples/bracket/main.kcl'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -22,11 +23,11 @@ jobs:
|
|||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
|
const message = '`public/kcl-samples/bracket/main.kcl` or `src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
|
||||||
const issue_number = context.payload.pull_request.number;
|
const issue_number = context.payload.pull_request.number;
|
||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
const repo = context.repo.repo;
|
||||||
|
|
||||||
const { data: comments } = await github.rest.issues.listComments({
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
@ -43,4 +44,4 @@ jobs:
|
|||||||
issue_number,
|
issue_number,
|
||||||
body: message,
|
body: message,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
13
.github/workflows/codemirror-lang-kcl.yml
vendored
13
.github/workflows/codemirror-lang-kcl.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yarn-unit-test:
|
npm-unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -19,14 +19,11 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
|
||||||
- run: yarn tsc
|
- run: npm run tsc --workspace=packages/codemirror-lang-kcl
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
|
||||||
- name: run unit tests
|
- name: run unit tests
|
||||||
run: yarn test
|
run: npm run test --workspace=packages/codemirror-lang-kcl
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
38
.github/workflows/e2e-tests.yml
vendored
38
.github/workflows/e2e-tests.yml
vendored
@ -97,11 +97,11 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
@ -154,7 +154,7 @@ jobs:
|
|||||||
- name: Build Wasm
|
- name: Build Wasm
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -197,12 +197,12 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
id: deps-install
|
id: deps-install
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
- name: Cache Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -210,27 +210,32 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/ms-playwright/
|
~/.cache/ms-playwright/
|
||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn playwright install --with-deps
|
run: npm run playwright install --with-deps
|
||||||
|
|
||||||
- name: build web
|
- name: build web
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn tronb:vite:dev
|
run: npm run tronb:vite:dev
|
||||||
|
|
||||||
- name: Run ubuntu/chrome snapshots
|
- name: Run ubuntu/chrome snapshots
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
uses: nick-fields/retry@v3.0.2
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
command: yarn test:snapshots
|
command: npm run test:snapshots
|
||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
env:
|
env:
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||||
|
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||||
|
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
|
TARGET: web
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||||
@ -316,12 +321,12 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
id: deps-install
|
id: deps-install
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
- name: Cache Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -329,15 +334,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/ms-playwright/
|
~/.cache/ms-playwright/
|
||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn playwright install --with-deps
|
run: npm run playwright install --with-deps
|
||||||
|
|
||||||
- name: Build web
|
- name: Build web
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn tronb:vite:dev
|
run: npm run tronb:vite:dev
|
||||||
|
|
||||||
- name: Start Vector
|
- name: Start Vector
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !contains(matrix.os, 'windows') }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !contains(matrix.os, 'windows') }}
|
||||||
@ -365,6 +370,11 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
FAIL_ON_CONSOLE_ERRORS: true
|
FAIL_ON_CONSOLE_ERRORS: true
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||||
|
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||||
|
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
|
TARGET: desktop
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||||
|
@ -21,10 +21,10 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- run: yarn generate:machine-api
|
- run: npm run generate:machine-api
|
||||||
- run: yarn fmt
|
- run: npm run fmt || true
|
||||||
- name: check for changes
|
- name: check for changes
|
||||||
id: git-check
|
id: git-check
|
||||||
run: |
|
run: |
|
||||||
|
30
.github/workflows/kcl-language-server.yml
vendored
30
.github/workflows/kcl-language-server.yml
vendored
@ -56,21 +56,19 @@ jobs:
|
|||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
npm install
|
||||||
cd rust/kcl-language-server
|
|
||||||
yarn install
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
yarn build
|
npm run build
|
||||||
yarn test-compile
|
npm run test-compile
|
||||||
ls -la dist
|
ls -la dist
|
||||||
xvfb-run -a yarn test
|
xvfb-run -a npm run test
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
yarn test
|
npm run test
|
||||||
if: runner.os != 'Linux'
|
if: runner.os != 'Linux'
|
||||||
build-release:
|
build-release:
|
||||||
strategy:
|
strategy:
|
||||||
@ -183,19 +181,20 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
|
# npm will symlink which will cause issues w tarballing later
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
||||||
|
|
||||||
- name: Package Extension (nightly)
|
- name: Package Extension (nightly)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
||||||
|
|
||||||
- name: remove server
|
- name: remove server
|
||||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
@ -207,13 +206,13 @@ jobs:
|
|||||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix
|
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
|
||||||
|
|
||||||
- name: Package Extension (no server, nightly)
|
- name: Package Extension (no server, nightly)
|
||||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix --pre-release
|
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -244,8 +243,8 @@ jobs:
|
|||||||
lld \
|
lld \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
nodejs \
|
nodejs \
|
||||||
yarn \
|
npm \
|
||||||
npm
|
yarn
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -272,19 +271,20 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
|
# npm will symlink which will cause issues w tarballing later
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
55
.github/workflows/nix.yml
vendored
Normal file
55
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
name: Test Nix Flake
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
jobs:
|
||||||
|
nix-flake-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix flake check for all platforms
|
||||||
|
run: |
|
||||||
|
nix flake check --all-systems
|
||||||
|
|
||||||
|
nix-build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix build . for x86_64-linux
|
||||||
|
run: nix build .
|
||||||
|
|
||||||
|
nix-build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix build . for x86_64-darwin
|
||||||
|
run: nix build .
|
||||||
|
|
6
.github/workflows/publish-apps-release.yml
vendored
6
.github/workflows/publish-apps-release.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Find tag workflow id
|
- name: Find tag workflow id
|
||||||
id: tag_workflow_id
|
id: tag_workflow_id
|
||||||
@ -105,7 +105,7 @@ jobs:
|
|||||||
- name: Override release notes
|
- name: Override release notes
|
||||||
env:
|
env:
|
||||||
NOTES: ${{ github.event.release.body }}
|
NOTES: ${{ github.event.release.body }}
|
||||||
run: yarn files:set-notes
|
run: npm run files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
uses: 'google-github-actions/auth@v2.1.8'
|
uses: 'google-github-actions/auth@v2.1.8'
|
||||||
@ -126,7 +126,7 @@ jobs:
|
|||||||
destination: 'dl.kittycad.io/releases/modeling-app'
|
destination: 'dl.kittycad.io/releases/modeling-app'
|
||||||
|
|
||||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||||
run: yarn files:invalidate-bucket
|
run: npm run files:invalidate-bucket
|
||||||
|
|
||||||
- name: Upload release files to Github
|
- name: Upload release files to Github
|
||||||
if: ${{ github.event_name == 'release' }}
|
if: ${{ github.event_name == 'release' }}
|
||||||
|
74
.github/workflows/static-analysis.yml
vendored
74
.github/workflows/static-analysis.yml
vendored
@ -16,18 +16,18 @@ permissions:
|
|||||||
actions: read
|
actions: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yarn-fmt-check:
|
npm-fmt-check:
|
||||||
runs-on: 'ubuntu-22.04'
|
runs-on: 'ubuntu-22.04'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- run: yarn fmt-check
|
- run: npm run fmt-check
|
||||||
|
|
||||||
yarn-build-wasm:
|
npm-build-wasm:
|
||||||
# Build the wasm blob once on the fastest runner.
|
# Build the wasm blob once on the fastest runner.
|
||||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||||
steps:
|
steps:
|
||||||
@ -36,10 +36,10 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install
|
run: npm install
|
||||||
|
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -62,7 +62,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Wasm
|
- name: Build Wasm
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -76,17 +76,17 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
rust/kcl-lib/bindings/*
|
rust/kcl-lib/bindings/*
|
||||||
|
|
||||||
yarn-tsc:
|
npm-tsc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -104,19 +104,19 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn tsc
|
- run: npm run tsc
|
||||||
|
|
||||||
yarn-lint:
|
npm-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -134,19 +134,19 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn lint
|
- run: npm run lint
|
||||||
|
|
||||||
yarn-circular-dependencies:
|
npm-circular-dependencies:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -164,7 +164,7 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn circular-deps:diff
|
- run: npm run circular-deps:diff
|
||||||
|
|
||||||
python-codespell:
|
python-codespell:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@ -179,18 +179,18 @@ jobs:
|
|||||||
- name: Run codespell
|
- name: Run codespell
|
||||||
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
||||||
|
|
||||||
yarn-unit-test-kcl-samples:
|
npm-unit-test-kcl-samples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -211,31 +211,31 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: npm run simpleserver:bg
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
|
|
||||||
- name: Install Chromium Browser
|
- name: Install Chromium Browser
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn playwright install chromium --with-deps
|
run: npm run playwright install chromium --with-deps
|
||||||
|
|
||||||
- name: run unit tests for kcl samples
|
- name: run unit tests for kcl samples
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn test:unit:kcl-samples
|
run: npm run test:unit:kcl-samples
|
||||||
env:
|
env:
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
yarn-unit-test:
|
npm-unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -256,16 +256,16 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: npm run simpleserver:bg
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
|
|
||||||
- name: Install Chromium Browser
|
- name: Install Chromium Browser
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn playwright install chromium --with-deps
|
run: npm run playwright install chromium --with-deps
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: xvfb-run -a yarn test:unit
|
run: xvfb-run -a npm run test:unit
|
||||||
env:
|
env:
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
|
2
.github/workflows/tag-nightly.yml
vendored
2
.github/workflows/tag-nightly.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Push tag
|
- name: Push tag
|
||||||
run: |
|
run: |
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,10 +26,12 @@ yarn-error.log*
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.helix
|
.helix
|
||||||
|
result
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
rust/target
|
rust/target
|
||||||
rust/kcl-lib/bindings
|
rust/kcl-lib/bindings
|
||||||
|
rust/kcl-language-server/server
|
||||||
public/kcl_wasm_lib_bg.wasm
|
public/kcl_wasm_lib_bg.wasm
|
||||||
rust/lcov.info
|
rust/lcov.info
|
||||||
rust/kcl-wasm-lib/pkg
|
rust/kcl-wasm-lib/pkg
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn fmt-check
|
npm run fmt-check
|
||||||
|
76
Makefile
76
Makefile
@ -5,36 +5,38 @@ all: install build check
|
|||||||
# INSTALL
|
# INSTALL
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
CARGO ?= ~/.cargo/bin/cargo.exe
|
export WINDOWS := true
|
||||||
WASM_PACK ?= ~/.cargo/bin/wasm-pack.exe
|
ifndef MSYSTEM
|
||||||
|
export POWERSHELL := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef WINDOWS
|
||||||
|
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
|
||||||
|
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
|
||||||
else
|
else
|
||||||
CARGO ?= ~/.cargo/bin/cargo
|
CARGO ?= ~/.cargo/bin/cargo
|
||||||
WASM_PACK ?= ~/.cargo/bin/wasm-pack
|
WASM_PACK ?= ~/.cargo/bin/wasm-pack
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: node_modules/.yarn-integrity $(CARGO) $(WASM_PACK) ## Install dependencies
|
install: node_modules/.package-lock.json $(CARGO) $(WASM_PACK) ## Install dependencies
|
||||||
|
|
||||||
node_modules/.yarn-integrity: package.json yarn.lock
|
node_modules/.package-lock.json: package.json package-lock.json
|
||||||
yarn install
|
npm install
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
@ type nul > $@
|
|
||||||
else
|
|
||||||
@ touch $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(CARGO):
|
$(CARGO):
|
||||||
ifeq ($(OS),Windows_NT)
|
ifdef WINDOWS
|
||||||
yarn install:rust:windows
|
npm run install:rust:windows
|
||||||
else
|
else
|
||||||
yarn install:rust
|
npm run install:rust
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(WASM_PACK):
|
$(WASM_PACK):
|
||||||
ifeq ($(OS),Windows_NT)
|
ifdef WINDOWS
|
||||||
yarn install:wasm-pack:cargo
|
npm run install:wasm-pack:cargo
|
||||||
else
|
else
|
||||||
yarn install:wasm-pack:sh
|
npm run install:wasm-pack:sh
|
||||||
endif
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -57,17 +59,17 @@ build-web: install public/kcl_wasm_lib_bg.wasm build/index.html
|
|||||||
build-desktop: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
|
build-desktop: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
|
||||||
|
|
||||||
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
|
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
|
||||||
ifeq ($(OS),Windows_NT)
|
ifdef WINDOWS
|
||||||
yarn build:wasm:dev:windows
|
npm run build:wasm:dev:windows
|
||||||
else
|
else
|
||||||
yarn build:wasm:dev
|
npm run build:wasm:dev
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||||
yarn build:local
|
npm run build:local
|
||||||
|
|
||||||
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||||
yarn tronb:vite:dev
|
npm run tronb:vite:dev
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# CHECK
|
# CHECK
|
||||||
@ -77,12 +79,12 @@ check: format lint
|
|||||||
|
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
format: install ## Format the code
|
format: install ## Format the code
|
||||||
yarn fmt
|
npm run fmt
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: install ## Lint the code
|
lint: install ## Lint the code
|
||||||
yarn tsc
|
npm run tsc
|
||||||
yarn lint
|
npm run lint
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# RUN
|
# RUN
|
||||||
@ -94,11 +96,11 @@ run: run-$(TARGET)
|
|||||||
|
|
||||||
.PHONY: run-web
|
.PHONY: run-web
|
||||||
run-web: install build-web ## Start the web app
|
run-web: install build-web ## Start the web app
|
||||||
yarn start
|
npm run start
|
||||||
|
|
||||||
.PHONY: run-desktop
|
.PHONY: run-desktop
|
||||||
run-desktop: install build-desktop ## Start the desktop app
|
run-desktop: install build-desktop ## Start the desktop app
|
||||||
yarn tron:start
|
npm run tron:start
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# TEST
|
# TEST
|
||||||
@ -113,7 +115,7 @@ test: test-unit test-e2e
|
|||||||
.PHONY: test-unit
|
.PHONY: test-unit
|
||||||
test-unit: install ## Run the unit tests
|
test-unit: install ## Run the unit tests
|
||||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||||
yarn test:unit
|
npm run test:unit
|
||||||
|
|
||||||
.PHONY: test-e2e
|
.PHONY: test-e2e
|
||||||
test-e2e: test-e2e-$(TARGET)
|
test-e2e: test-e2e-$(TARGET)
|
||||||
@ -122,17 +124,17 @@ test-e2e: test-e2e-$(TARGET)
|
|||||||
test-e2e-web: install build-web ## Run the web e2e tests
|
test-e2e-web: install build-web ## Run the web e2e tests
|
||||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||||
ifdef E2E_GREP
|
ifdef E2E_GREP
|
||||||
yarn chrome:test --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||||
else
|
else
|
||||||
yarn chrome:test --headed --workers='100%'
|
npm run chrome:test -- --headed --workers='100%'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: test-e2e-desktop
|
.PHONY: test-e2e-desktop
|
||||||
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
||||||
ifdef E2E_GREP
|
ifdef E2E_GREP
|
||||||
yarn test:playwright:electron --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||||
else
|
else
|
||||||
yarn test:playwright:electron --workers='100%'
|
npm run test:playwright:electron -- --workers='100%'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -140,8 +142,8 @@ endif
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: ## Delete all artifacts
|
clean: ## Delete all artifacts
|
||||||
ifeq ($(OS),Windows_NT)
|
ifdef POWERSHELL
|
||||||
git clean --force -d -X
|
git clean --force -d -x --exclude=.env* --exclude=**/*.env
|
||||||
else
|
else
|
||||||
rm -rf .vite/ build/
|
rm -rf .vite/ build/
|
||||||
rm -rf trace.zip playwright-report/ test-results/
|
rm -rf trace.zip playwright-report/ test-results/
|
||||||
@ -152,7 +154,7 @@ endif
|
|||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: install
|
help: install
|
||||||
ifeq ($(OS),Windows_NT)
|
ifdef POWERSHELL
|
||||||
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
|
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
|
||||||
else
|
else
|
||||||
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
@ -167,5 +169,5 @@ endif
|
|||||||
# It should work for you other Linux users.
|
# It should work for you other Linux users.
|
||||||
lee-electron-test:
|
lee-electron-test:
|
||||||
Xephyr -br -ac -noreset -screen 1200x500 :2 &
|
Xephyr -br -ac -noreset -screen 1200x500 :2 &
|
||||||
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn tron:test -g "when using the file tree"
|
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run tron:test -g "when using the file tree"
|
||||||
killall Xephyr
|
killall Xephyr
|
||||||
|
80
README.md
80
README.md
@ -62,39 +62,39 @@ fnm use
|
|||||||
Install the NPM dependencies with:
|
Install the NPM dependencies with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
npm 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
|
npm run install:rust
|
||||||
yarn install:wasm-pack:sh
|
npm run install:wasm-pack:sh
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn install:rust:windows
|
npm run install:rust:windows
|
||||||
yarn install:wasm-pack:cargo
|
npm run 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
|
npm run build:wasm
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn build:wasm:windows
|
npm run build:wasm:windows
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `yarn install:tools:windows`.
|
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `npm run install:tools:windows`.
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn fetch:wasm
|
npm run fetch:wasm
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn fetch:wasm:windows
|
npm run fetch:wasm:windows
|
||||||
```
|
```
|
||||||
|
|
||||||
That will build the WASM binary and put in the `public` dir (though gitignored).
|
That will build the WASM binary and put in the `public` dir (though gitignored).
|
||||||
@ -102,7 +102,7 @@ That will build the WASM binary and put in the `public` dir (though gitignored).
|
|||||||
Finally, to run the web app only, run:
|
Finally, to run the web app only, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||||
@ -122,17 +122,17 @@ Third-Party Cookies".
|
|||||||
|
|
||||||
## Desktop
|
## Desktop
|
||||||
|
|
||||||
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then:
|
To spin up the desktop app, `npm install` and `npm run build:wasm` need to have been done before hand then:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tron:start
|
npm run tron:start
|
||||||
```
|
```
|
||||||
|
|
||||||
This will start the application and hot-reload on changes.
|
This will start the application and hot-reload on changes.
|
||||||
|
|
||||||
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables).
|
To package the app for your platform with electron-builder, run `npm run tronb:package:dev` (or `npm run tronb:package:prod` to point to the .env.production variables).
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
@ -141,9 +141,9 @@ 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
|
npm install
|
||||||
yarn build:wasm
|
npm run build:wasm
|
||||||
yarn start # or yarn build:local && yarn serve for slower but more production-like build
|
npm start # or npm run build:local && npm run serve for slower but more production-like build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Before submitting a PR
|
## Before submitting a PR
|
||||||
@ -153,10 +153,10 @@ Before you submit a contribution PR to this repo, please ensure that:
|
|||||||
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
||||||
- You have separated out refactoring commits from feature commits as much as possible
|
- You have separated out refactoring commits from feature commits as much as possible
|
||||||
- You have run all of the following commands locally:
|
- You have run all of the following commands locally:
|
||||||
- `yarn fmt`
|
- `npm run fmt`
|
||||||
- `yarn tsc`
|
- `npm run tsc`
|
||||||
- `yarn test`
|
- `npm run test`
|
||||||
- Here they are all together: `yarn fmt && yarn tsc && yarn test`
|
- Here they are all together: `npm run fmt && npm run tsc && npm run test`
|
||||||
|
|
||||||
## Release a new version
|
## Release a new version
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ docker run --network host --rm --init -it playwright/chrome:playwright-x.xx.x
|
|||||||
and in another terminal, run:
|
and in another terminal, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
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/ npm run playwright test --project="Google Chrome" <test suite>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Specific example
|
#### Specific example
|
||||||
@ -280,7 +280,7 @@ docker run --network host --rm --init -it playwright/chrome:playwright-1.46.0
|
|||||||
and in another terminal, run:
|
and in another terminal, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
|
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
run a specific test change the test from `test('...` to `test.only('...`
|
run a specific test change the test from `test('...` to `test.only('...`
|
||||||
@ -291,13 +291,13 @@ run a specific test change the test from `test('...` to `test.only('...`
|
|||||||
run headed
|
run headed
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn playwright test --headed
|
npm run playwright test --headed
|
||||||
```
|
```
|
||||||
|
|
||||||
run with step through debugger
|
run with step through debugger
|
||||||
|
|
||||||
```
|
```
|
||||||
PWDEBUG=1 yarn playwright test
|
PWDEBUG=1 npm run playwright test
|
||||||
```
|
```
|
||||||
|
|
||||||
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
||||||
@ -308,7 +308,7 @@ Or comment out browsers in `playwright.config.ts`.
|
|||||||
|
|
||||||
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
||||||
|
|
||||||
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `yarn playwright codegen -b wk --load-storage ./store localhost:3000`
|
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `npm run playwright codegen -b wk --load-storage ./store localhost:3000`
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
@ -351,21 +351,21 @@ However because much of our tests involve clicking in the stream at specific loc
|
|||||||
If you already haven't, run the following:
|
If you already haven't, run the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn
|
npm
|
||||||
yarn build:wasm
|
npm run build:wasm
|
||||||
yarn start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
and finally:
|
and finally:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test:unit
|
npm run test:unit
|
||||||
```
|
```
|
||||||
|
|
||||||
For individual testing:
|
For individual testing:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
npm run test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
||||||
```
|
```
|
||||||
|
|
||||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
||||||
@ -439,16 +439,16 @@ Part of the CI CD pipeline performs static analysis on the code. Use the followi
|
|||||||
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test-setup
|
npm run 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
|
npm run tsc
|
||||||
yarn fmt-check
|
npm run fmt-check
|
||||||
yarn lint
|
npm run lint
|
||||||
yarn test:unit:local
|
npm run test:unit:local
|
||||||
```
|
```
|
||||||
|
|
||||||
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
||||||
@ -460,10 +460,10 @@ yarn test:unit:local
|
|||||||
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test:playwright:electron:local
|
npm run test:playwright:electron:local
|
||||||
yarn test:playwright:electron:windows:local
|
npm run test:playwright:electron:windows:local
|
||||||
yarn test:playwright:electron:macos:local
|
npm run test:playwright:electron:macos:local
|
||||||
yarn test:playwright:electron:ubuntu:local
|
npm run test:playwright:electron:ubuntu:local
|
||||||
```
|
```
|
||||||
|
|
||||||
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
||||||
|
@ -36,9 +36,9 @@ myAngle = -120
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [8, 0])
|
|> line(end = [8, 0])
|
||||||
|> angledLine({ angle = abs(myAngle), length = 5 }, %)
|
|> angledLine(angle = abs(myAngle), length = 5)
|
||||||
|> line(end = [-5, 0])
|
|> line(end = [-5, 0])
|
||||||
|> angledLine({ angle = myAngle, length = 5 }, %)
|
|> angledLine(angle = myAngle, length = 5)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
baseExtrusion = extrude(sketch001, length = 5)
|
baseExtrusion = extrude(sketch001, length = 5)
|
||||||
|
@ -33,10 +33,7 @@ acos(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(acos(0.5)), length = 10)
|
||||||
angle = toDegrees(acos(0.5)),
|
|
||||||
length = 10
|
|
||||||
}, %)
|
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> line(endAbsolute = [12, 0])
|
|> line(endAbsolute = [12, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -36,7 +36,7 @@ angleToMatchLengthX(
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [2, 5], tag = $seg01)
|
|> line(end = [2, 5], tag = $seg01)
|
||||||
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)
|
|> angledLine(angle = -angleToMatchLengthX(seg01, 7, %), endAbsoluteX = 10)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrusion = extrude(sketch001, length = 5)
|
extrusion = extrude(sketch001, length = 5)
|
||||||
|
@ -36,10 +36,7 @@ angleToMatchLengthY(
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [1, 2], tag = $seg01)
|
|> line(end = [1, 2], tag = $seg01)
|
||||||
|> angledLine({
|
|> angledLine(angle = angleToMatchLengthY(seg01, 15, %), length = 5)
|
||||||
angle = angleToMatchLengthY(seg01, 15, %),
|
|
||||||
length = 5
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -10,8 +10,13 @@ Draw a line segment relative to the current origin using the polar measure of so
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
angledLine(
|
angledLine(
|
||||||
data: AngledLineData,
|
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
|
angle: number,
|
||||||
|
length?: number,
|
||||||
|
lengthX?: number,
|
||||||
|
lengthY?: number,
|
||||||
|
endAbsoluteX?: number,
|
||||||
|
endAbsoluteY?: number,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -21,9 +26,14 @@ angledLine(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `length` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `lengthX` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -36,7 +46,7 @@ angledLine(
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> yLine(endAbsolute = 15)
|
|> yLine(endAbsolute = 15)
|
||||||
|> angledLine({ angle = 30, length = 15 }, %)
|
|> angledLine(angle = 30, length = 15)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -33,10 +33,7 @@ asin(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(asin(0.5)), length = 20)
|
||||||
angle = toDegrees(asin(0.5)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ atan(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(atan(1.25)), length = 20)
|
||||||
angle = toDegrees(atan(1.25)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -37,10 +37,7 @@ atan2(
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(atan2(1.25, 2)), length = 20)
|
||||||
angle = toDegrees(atan2(1.25, 2)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@ std::math::E: number = 2.71828182845904523536028747135266250_
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 2 * E ^ 2,
|
length = 2 * E ^ 2,
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -17,10 +17,10 @@ std::math::TAU: number = 6.28318530717958647692528676655900577_
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 10 * TAU,
|
length = 10 * TAU,
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ e(): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|
|> angledLine(angle = 30, length = 2 * e() ^ 2)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -30,10 +30,10 @@ getNextAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -30,10 +30,10 @@ getOppositeEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -30,10 +30,10 @@ getPreviousAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -65,7 +65,7 @@ case = startSketchOn(-XZ)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -43,11 +43,7 @@ layout: manual
|
|||||||
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
||||||
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
||||||
* [`angledLine`](kcl/angledLine)
|
* [`angledLine`](kcl/angledLine)
|
||||||
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
|
||||||
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
|
||||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||||
* [`angledLineToX`](kcl/angledLineToX)
|
|
||||||
* [`angledLineToY`](kcl/angledLineToY)
|
|
||||||
* [`appearance`](kcl/appearance)
|
* [`appearance`](kcl/appearance)
|
||||||
* [`arc`](kcl/arc)
|
* [`arc`](kcl/arc)
|
||||||
* [`arcTo`](kcl/arcTo)
|
* [`arcTo`](kcl/arcTo)
|
||||||
@ -81,6 +77,8 @@ layout: manual
|
|||||||
* [`helix`](kcl/std-helix)
|
* [`helix`](kcl/std-helix)
|
||||||
* [`hole`](kcl/hole)
|
* [`hole`](kcl/hole)
|
||||||
* [`hollow`](kcl/hollow)
|
* [`hollow`](kcl/hollow)
|
||||||
|
* [`intersect`](kcl/intersect)
|
||||||
|
* [`involuteCircular`](kcl/involuteCircular)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
* [`legAngX`](kcl/legAngX)
|
* [`legAngX`](kcl/legAngX)
|
||||||
@ -127,14 +125,14 @@ layout: manual
|
|||||||
* [`sqrt`](kcl/sqrt)
|
* [`sqrt`](kcl/sqrt)
|
||||||
* [`startProfileAt`](kcl/startProfileAt)
|
* [`startProfileAt`](kcl/startProfileAt)
|
||||||
* [`startSketchOn`](kcl/startSketchOn)
|
* [`startSketchOn`](kcl/startSketchOn)
|
||||||
|
* [`subtract`](kcl/subtract)
|
||||||
* [`sweep`](kcl/sweep)
|
* [`sweep`](kcl/sweep)
|
||||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||||
* [`tangentialArc`](kcl/tangentialArc)
|
* [`tangentialArc`](kcl/tangentialArc)
|
||||||
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
|
||||||
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
|
||||||
* [`toDegrees`](kcl/toDegrees)
|
* [`toDegrees`](kcl/toDegrees)
|
||||||
* [`toRadians`](kcl/toRadians)
|
* [`toRadians`](kcl/toRadians)
|
||||||
* [`translate`](kcl/translate)
|
* [`translate`](kcl/translate)
|
||||||
|
* [`union`](kcl/union)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`xLine`](kcl/xLine)
|
||||||
* [`yLine`](kcl/yLine)
|
* [`yLine`](kcl/yLine)
|
||||||
* **std::math**
|
* **std::math**
|
||||||
|
File diff suppressed because one or more lines are too long
57
docs/kcl/involuteCircular.md
Normal file
57
docs/kcl/involuteCircular.md
Normal file
File diff suppressed because one or more lines are too long
@ -33,10 +33,7 @@ max(args: [number]): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 70, length = max(15, 31, 4, 13, 22))
|
||||||
angle = 70,
|
|
||||||
length = max(15, 31, 4, 13, 22)
|
|
||||||
}, %)
|
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ min(args: [number]): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 70, length = min(15, 31, 4, 13, 22))
|
||||||
angle = 70,
|
|
||||||
length = min(15, 31, 4, 13, 22)
|
|
||||||
}, %)
|
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close(%)
|
|> close(%)
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close(%)
|
|> close(%)
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ pow(
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 50, length = pow(5, 2) }, %)
|
|> angledLine(angle = 50, length = pow(5, 2))
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -29,11 +29,8 @@ profileStart(sketch: Sketch): [number]
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XY)
|
sketch001 = startSketchOn(XY)
|
||||||
|> startProfileAt([5, 2], %)
|
|> startProfileAt([5, 2], %)
|
||||||
|> angledLine({ angle = 120, length = 50 }, %, $seg01)
|
|> angledLine(angle = 120, length = 50, tag = $seg01)
|
||||||
|> angledLine({
|
|> angledLine(angle = segAng(seg01) + 120, length = 50)
|
||||||
angle = segAng(seg01) + 120,
|
|
||||||
length = 50
|
|
||||||
}, %)
|
|
||||||
|> line(end = profileStart(%))
|
|> line(end = profileStart(%))
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 20)
|
|> extrude(length = 20)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -78,7 +78,7 @@ assertEqual(sum, 6, 0.00001, "1 + 2 + 3 summed is 6")
|
|||||||
```js
|
```js
|
||||||
// Declare a function that sketches a decagon.
|
// Declare a function that sketches a decagon.
|
||||||
fn decagon(radius) {
|
fn decagon(radius) {
|
||||||
// Each side of the decagon is turned this many degrees from the previous angle.
|
// Each side of the decagon is turned this many radians from the previous angle.
|
||||||
stepAngle = 1 / 10 * TAU
|
stepAngle = 1 / 10 * TAU
|
||||||
|
|
||||||
// Start the decagon sketch at this point.
|
// Start the decagon sketch at this point.
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -32,9 +32,9 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> line(end = [5, 10], tag = $seg01)
|
|> line(end = [5, 10], tag = $seg01)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine([segAng(seg01), 10], %)
|
|> angledLine(angle = segAng(seg01), length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine([segAng(seg01), -15], %)
|
|> angledLine(angle = segAng(seg01), length = -15)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 4)
|
example = extrude(exampleSketch, length = 4)
|
||||||
|
@ -29,9 +29,9 @@ segLen(tag: TagIdentifier): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 60, length = 10 }, %, $thing)
|
|> angledLine(angle = 60, length = 10, tag = $thing)
|
||||||
|> tangentialArc({ offset = -120, radius = 5 }, %)
|
|> tangentialArc(angle = -120, radius = 5)
|
||||||
|> angledLine({ angle = -60, length = segLen(thing) }, %)
|
|> angledLine(angle = -60, length = segLen(thing))
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -103,7 +103,7 @@ case = startSketchOn(-XZ)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ sqrt(num: number): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 50, length = sqrt(2500) }, %)
|
|> angledLine(angle = 50, length = sqrt(2500))
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -9,7 +9,15 @@ Create a helix.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
helix(revolutions: number(_), angleStart: number(deg), ccw?: bool, radius?: number(mm), axis?: Axis3d | Edge, length?: number(mm), cylinder?: Solid): Helix
|
helix(
|
||||||
|
revolutions: number(_),
|
||||||
|
angleStart: number(deg),
|
||||||
|
ccw?: bool,
|
||||||
|
radius?: number(mm),
|
||||||
|
axis?: Axis3d | Edge,
|
||||||
|
length?: number(mm),
|
||||||
|
cylinder?: Solid,
|
||||||
|
): Helix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@ cos(@num: number(rad)): number(_)
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 3 / cos(toRadians(30)),
|
length = 3 / cos(toRadians(30)),
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -6,10 +6,14 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Convert polar/sphere (azimuth, elevation, distance) coordinates tocartesian (x/y/z grid) coordinates.
|
Convert polar/sphere (azimuth, elevation, distance) coordinates to
|
||||||
|
cartesian (x/y/z grid) coordinates.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
polar(angle: number(deg), length: number(mm)): [number(mm); 2]
|
polar(
|
||||||
|
angle: number(deg),
|
||||||
|
length: number(mm),
|
||||||
|
): [number(mm); 2]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -29,10 +29,10 @@ tan(@num: number(rad)): number(_)
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 50 * tan(1/2),
|
length = 50 * tan(1/2),
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -6,10 +6,16 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Construct a 2-dimensional circle, of the specified radius, centered atthe provided (x, y) origin point.
|
Construct a 2-dimensional circle, of the specified radius, centered at
|
||||||
|
the provided (x, y) origin point.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
circle(@sketch_or_surface: Sketch | Plane | Face, center: Point2d, radius: number, tag?: tag): Sketch
|
circle(
|
||||||
|
@sketch_or_surface: Sketch | Plane | Face,
|
||||||
|
center: Point2d,
|
||||||
|
radius: number,
|
||||||
|
tag?: tag,
|
||||||
|
): Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,10 @@ Only works on unclosed sketches for now.
|
|||||||
Mirror occurs around a local sketch axis rather than a global axis.
|
Mirror occurs around a local sketch axis rather than a global axis.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
mirror2d(@sketches: [Sketch; 1+], axis: Axis2d | Edge): Sketch
|
mirror2d(
|
||||||
|
@sketches: [Sketch; 1+],
|
||||||
|
axis: Axis2d | Edge,
|
||||||
|
): Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -100,9 +103,9 @@ example = extrude(sketch001, length = 10)
|
|||||||
sketch0011 = startSketchOn(XY)
|
sketch0011 = startSketchOn(XY)
|
||||||
|> startProfileAt([6.77, 0], %)
|
|> startProfileAt([6.77, 0], %)
|
||||||
|> yLine(length = 1.27)
|
|> yLine(length = 1.27)
|
||||||
|> tangentialArcTo([5.96, 2.37], %)
|
|> tangentialArc(endAbsolute = [5.96, 2.37])
|
||||||
|> tangentialArcTo([-6.2, 2.44], %)
|
|> tangentialArc(endAbsolute = [-6.2, 2.44])
|
||||||
|> tangentialArcTo([-6.6, 1.82], %)
|
|> tangentialArc(endAbsolute = [-6.6, 1.82])
|
||||||
|> yLine(length = -1.82)
|
|> yLine(length = -1.82)
|
||||||
|> mirror2d( axis = X )
|
|> mirror2d( axis = X )
|
||||||
|> extrude(length = 10)
|
|> extrude(length = 10)
|
||||||
|
65607
docs/kcl/std.json
65607
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -31,12 +31,9 @@ tangentToEnd(tag: TagIdentifier): number
|
|||||||
pillSketch = startSketchOn(XZ)
|
pillSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> tangentialArcToRelative([0, 10], %, $arc1)
|
|> tangentialArc(end = [0, 10], tag = $arc1)
|
||||||
|> angledLine({
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
||||||
angle = tangentToEnd(arc1),
|
|> tangentialArc(end = [0, -10])
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> tangentialArcToRelative([0, -10], %)
|
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
pillExtrude = extrude(pillSketch, length = 10)
|
pillExtrude = extrude(pillSketch, length = 10)
|
||||||
@ -49,12 +46,9 @@ pillExtrude = extrude(pillSketch, length = 10)
|
|||||||
pillSketch = startSketchOn(XZ)
|
pillSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [0, 20])
|
|> line(end = [0, 20])
|
||||||
|> tangentialArcTo([10, 20], %, $arc1)
|
|> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
|
||||||
|> angledLine({
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
||||||
angle = tangentToEnd(arc1),
|
|> tangentialArc(end = [-10, 0])
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> tangentialArcToRelative([-10, 0], %)
|
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
pillExtrude = extrude(pillSketch, length = 10)
|
pillExtrude = extrude(pillSketch, length = 10)
|
||||||
@ -66,10 +60,7 @@ pillExtrude = extrude(pillSketch, length = 10)
|
|||||||
rectangleSketch = startSketchOn(XZ)
|
rectangleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0], tag = $seg1)
|
|> line(end = [10, 0], tag = $seg1)
|
||||||
|> angledLine({
|
|> angledLine(angle = tangentToEnd(seg1), length = 10)
|
||||||
angle = tangentToEnd(seg1),
|
|
||||||
length = 10
|
|
||||||
}, %)
|
|
||||||
|> line(end = [0, 10])
|
|> line(end = [0, 10])
|
||||||
|> line(end = [-20, 0])
|
|> line(end = [-20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
@ -83,7 +74,7 @@ rectangleExtrude = extrude(rectangleSketch, length = 10)
|
|||||||
bottom = startSketchOn(XY)
|
bottom = startSketchOn(XY)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> arcTo({ end = [10, 10], interior = [5, 1] }, %, $arc1)
|
|> arcTo({ end = [10, 10], interior = [5, 1] }, %, $arc1)
|
||||||
|> angledLine([tangentToEnd(arc1), 20], %)
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
||||||
|> close()
|
|> close()
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -95,7 +86,7 @@ circSketch = startSketchOn(XY)
|
|||||||
|
|
||||||
triangleSketch = startSketchOn(XY)
|
triangleSketch = startSketchOn(XY)
|
||||||
|> startProfileAt([-5, 0], %)
|
|> startProfileAt([-5, 0], %)
|
||||||
|> angledLine([tangentToEnd(circ), 10], %)
|
|> angledLine(angle = tangentToEnd(circ), length = 10)
|
||||||
|> line(end = [-15, 0])
|
|> line(end = [-15, 0])
|
||||||
|> close()
|
|> close()
|
||||||
```
|
```
|
||||||
|
File diff suppressed because one or more lines are too long
@ -35,7 +35,7 @@ tangentialArcTo(
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> tangentialArcTo([15, 15], %)
|
|> tangentialArcTo([15, 15], %)
|
||||||
|> line(end = [10, -15])
|
|> line(end = [10, -15])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -35,7 +35,7 @@ tangentialArcToRelative(
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 45, length = 10 }, %)
|
|> angledLine(angle = 45, length = 10)
|
||||||
|> tangentialArcToRelative([0, -10], %)
|
|> tangentialArcToRelative([0, -10], %)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -30,7 +30,7 @@ tau(): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 50, length = 10 * tau() }, %)
|
|> angledLine(angle = 50, length = 10 * tau())
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ toDegrees(num: number): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 50, length = 70 * cos(toDegrees(pi() / 4)))
|
||||||
angle = 50,
|
|
||||||
length = 70 * cos(toDegrees(pi() / 4))
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ toRadians(num: number): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 50, length = 70 * cos(toRadians(45)))
|
||||||
angle = 50,
|
|
||||||
length = 70 * cos(toRadians(45))
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -184,15 +184,17 @@ way:
|
|||||||
```norun
|
```norun
|
||||||
startSketchOn('XZ')
|
startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99,
|
length = 196.99,
|
||||||
}, %, $rectangleSegmentB001)
|
tag = $rectangleSegmentB001,
|
||||||
|> angledLine({
|
)
|
||||||
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001),
|
length = -segLen(rectangleSegmentA001),
|
||||||
}, %, $rectangleSegmentC001)
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
```
|
```
|
||||||
@ -217,15 +219,17 @@ However if the code was written like this:
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
length = 196.99,
|
||||||
}, %, $rectangleSegmentB001)
|
tag = $rectangleSegmentB001,
|
||||||
|> angledLine({
|
)
|
||||||
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
length = -segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
}
|
}
|
||||||
@ -245,15 +249,17 @@ For example the following code works.
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
length = 196.99,
|
||||||
}, %, $rectangleSegmentB001)
|
tag = $rectangleSegmentB001,
|
||||||
|> angledLine({
|
)
|
||||||
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
length = -segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ Data for an imported geometry.
|
|||||||
|
|
||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`ImportedGeometry`](/docs/kcl/types/ImportedGeometry)| | No |
|
| `type` |enum: `ImportedGeometry`| | No |
|
||||||
| `id` |[`string`](/docs/kcl/types/string)| The ID of the imported geometry. | No |
|
| `id` |[`string`](/docs/kcl/types/string)| The ID of the imported geometry. | No |
|
||||||
| `value` |`[` [`string`](/docs/kcl/types/string) `]`| The original file paths. | No |
|
| `value` |`[` [`string`](/docs/kcl/types/string) `]`| The original file paths. | No |
|
||||||
|
|
||||||
|
@ -14,15 +14,17 @@ way:
|
|||||||
```js
|
```js
|
||||||
startSketchOn('XZ')
|
startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99,
|
length = 196.99,
|
||||||
}, %, $rectangleSegmentB001)
|
tag = $rectangleSegmentB001,
|
||||||
|> angledLine({
|
)
|
||||||
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001),
|
length = -segLen(rectangleSegmentA001),
|
||||||
}, %, $rectangleSegmentC001)
|
tag = $rectangleSegmentC001,
|
||||||
|
)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
```
|
```
|
||||||
@ -46,15 +48,16 @@ However if the code was written like this:
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
length = 196.99,
|
||||||
}, %, $rectangleSegmentB001)
|
tag = $rectangleSegmentB001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
length = -segLen(rectangleSegmentA001),
|
||||||
}, %, $rectangleSegmentC001)
|
tag = $rectangleSegmentC001
|
||||||
|
)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
}
|
}
|
||||||
@ -74,15 +77,15 @@ For example the following code works.
|
|||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn('XZ')
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine({angle = 0, length = 191.26}, %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001) - 90,
|
angle = segAng(rectangleSegmentA001) - 90,
|
||||||
length = 196.99
|
length = 196.99
|
||||||
}, %, $rectangleSegmentB001)
|
, %, $rectangleSegmentB001)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = segAng(rectangleSegmentA001),
|
angle = segAng(rectangleSegmentA001),
|
||||||
length = -segLen(rectangleSegmentA001)
|
length = -segLen(rectangleSegmentA001)
|
||||||
}, %, $rectangleSegmentC001)
|
, %, $rectangleSegmentC001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -38,10 +38,10 @@ xLine(
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> xLine(length = 15)
|
|> xLine(length = 15)
|
||||||
|> angledLine({ angle = 80, length = 15 }, %)
|
|> angledLine(angle = 80, length = 15)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|> xLine(length = 10)
|
|> xLine(length = 10)
|
||||||
|> angledLine({ angle = 120, length = 30 }, %)
|
|> angledLine(angle = 120, length = 30)
|
||||||
|> xLine(length = -15)
|
|> xLine(length = -15)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ yLine(
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> yLine(length = 15)
|
|> yLine(length = 15)
|
||||||
|> angledLine({ angle = 30, length = 15 }, %)
|
|> angledLine(angle = 30, length = 15)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|> yLine(length = -5)
|
|> yLine(length = -5)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -137,7 +137,7 @@ async function doBasicSketch(
|
|||||||
await page.waitForTimeout(100)
|
await page.waitForTimeout(100)
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Length: open menu' }).click()
|
await page.getByRole('button', { name: 'constraints: open menu' }).click()
|
||||||
await page.getByRole('button', { name: 'Equal Length' }).click()
|
await page.getByRole('button', { name: 'Equal Length' }).click()
|
||||||
|
|
||||||
// Open the code pane.
|
// Open the code pane.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { bracket } from '@src/lib/exampleKcl'
|
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||||
import fsp from 'fs/promises'
|
import fsp from 'fs/promises'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
|
|
||||||
|
@ -920,7 +920,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([4.61, -14.01], %)
|
|> startProfileAt([4.61, -14.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArcTo([24.95, -5.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||||
|> close()`
|
|> close()`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -969,7 +969,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
|
|
||||||
// expect the code to have changed
|
// expect the code to have changed
|
||||||
await expect(page.locator('.cm-content')).toHaveText(
|
await expect(page.locator('.cm-content')).toHaveText(
|
||||||
`sketch001 = startSketchOn(XZ) |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09]) |> tangentialArcTo([24.95, -5.38], %) |> close()extrude001 = extrude(sketch001, length = 5)`
|
`sketch001 = startSketchOn(XZ) |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09]) |> tangentialArc(endAbsolute = [24.95, -5.38]) |> close()extrude001 = extrude(sketch001, length = 5)`
|
||||||
)
|
)
|
||||||
|
|
||||||
// Now hit undo
|
// Now hit undo
|
||||||
@ -982,7 +982,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
.toHaveText(`sketch001 = startSketchOn(XZ)
|
.toHaveText(`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([4.61, -14.01], %)
|
|> startProfileAt([4.61, -14.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArcTo([24.95, -5.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||||
|> close()`)
|
|> close()`)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -998,7 +998,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([4.61, -10.01], %)
|
|> startProfileAt([4.61, -10.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArcTo([24.95, -0.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 5)`
|
|> extrude(length = 5)`
|
||||||
)
|
)
|
||||||
@ -1072,7 +1072,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
// we wait so it saves the code
|
// we wait so it saves the code
|
||||||
await page.waitForTimeout(800)
|
await page.waitForTimeout(800)
|
||||||
|
|
||||||
// drag tangentialArcTo handle
|
// drag tangentialArc handle
|
||||||
const tangentEnd = await u.getBoundingBox('[data-overlay-index="1"]')
|
const tangentEnd = await u.getBoundingBox('[data-overlay-index="1"]')
|
||||||
await page.dragAndDrop('#stream', '#stream', {
|
await page.dragAndDrop('#stream', '#stream', {
|
||||||
sourcePosition: { x: tangentEnd.x + 10, y: tangentEnd.y - 5 },
|
sourcePosition: { x: tangentEnd.x + 10, y: tangentEnd.y - 5 },
|
||||||
@ -1089,7 +1089,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([2.71, -2.71], %)
|
|> startProfileAt([2.71, -2.71], %)
|
||||||
|> line(end = [15.4, -2.78])
|
|> line(end = [15.4, -2.78])
|
||||||
|> tangentialArcTo([27.6, -3.05], %)
|
|> tangentialArc(endAbsolute = [27.6, -3.05])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 5)`,
|
|> extrude(length = 5)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
@ -1104,7 +1104,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([2.71, -2.71], %)
|
|> startProfileAt([2.71, -2.71], %)
|
||||||
|> line(end = [15.4, -2.78])
|
|> line(end = [15.4, -2.78])
|
||||||
|> tangentialArcTo([24.95, -0.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 5)`,
|
|> extrude(length = 5)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
@ -1119,7 +1119,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([2.71, -2.71], %)
|
|> startProfileAt([2.71, -2.71], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArcTo([24.95, -0.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 5)`,
|
|> extrude(length = 5)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
@ -1135,7 +1135,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([4.61, -10.01], %)
|
|> startProfileAt([4.61, -10.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArcTo([24.95, -0.38], %)
|
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 5)`,
|
|> extrude(length = 5)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
@ -1144,7 +1144,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
`Can use the import stdlib function on a local OBJ file`,
|
`Can import a local OBJ file`,
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ page, context }, testInfo) => {
|
async ({ page, context }, testInfo) => {
|
||||||
test.fixme(orRunWhenFullSuiteEnabled())
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
@ -1194,7 +1194,7 @@ sketch001 = startSketchOn(XZ)
|
|||||||
.toBeLessThan(15)
|
.toBeLessThan(15)
|
||||||
})
|
})
|
||||||
await test.step(`Write the import function line`, async () => {
|
await test.step(`Write the import function line`, async () => {
|
||||||
await u.codeLocator.fill(`import('cube.obj')`)
|
await u.codeLocator.fill(`import 'cube.obj'\ncube`)
|
||||||
await page.waitForTimeout(800)
|
await page.waitForTimeout(800)
|
||||||
})
|
})
|
||||||
await test.step(`Reset the camera before checking`, async () => {
|
await test.step(`Reset the camera before checking`, async () => {
|
||||||
@ -1353,4 +1353,51 @@ sketch001 = startSketchOn(XZ)
|
|||||||
15
|
15
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test(`test-toolbar-buttons`, async ({
|
||||||
|
page,
|
||||||
|
homePage,
|
||||||
|
toolbar,
|
||||||
|
scene,
|
||||||
|
cmdBar,
|
||||||
|
}) => {
|
||||||
|
await test.step('Load an empty file', async () => {
|
||||||
|
await page.addInitScript(async () => {
|
||||||
|
localStorage.setItem('persistCode', '')
|
||||||
|
})
|
||||||
|
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||||
|
await homePage.goToModelingScene()
|
||||||
|
|
||||||
|
// wait until scene is ready to be interacted with
|
||||||
|
await scene.connectionEstablished()
|
||||||
|
await scene.settled(cmdBar)
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Test toolbar button correct selection', async () => {
|
||||||
|
await toolbar.expectToolbarMode.toBe('modeling')
|
||||||
|
|
||||||
|
await toolbar.startSketchPlaneSelection()
|
||||||
|
|
||||||
|
// Click on a default plane
|
||||||
|
await page.mouse.click(700, 200)
|
||||||
|
|
||||||
|
// tools cannot be selected immediately, couldn't find an event to await instead.
|
||||||
|
await page.waitForTimeout(1000)
|
||||||
|
|
||||||
|
await toolbar.selectCenterRectangle()
|
||||||
|
|
||||||
|
await expect(page.getByTestId('center-rectangle')).toHaveAttribute(
|
||||||
|
'aria-pressed',
|
||||||
|
'true'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Test Toolbar dropdown remembering last selection', async () => {
|
||||||
|
// Select another tool
|
||||||
|
await page.getByTestId('circle-center').click()
|
||||||
|
|
||||||
|
// center-rectangle should still be the active option in the rectangle dropdown
|
||||||
|
await expect(page.getByTestId('center-rectangle')).toBeVisible()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@ -19,7 +19,7 @@ length001 = timesFive(1) * 5
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([20, 10], %)
|
|> startProfileAt([20, 10], %)
|
||||||
|> line(end = [10, 10])
|
|> line(end = [10, 10])
|
||||||
|> angledLine([-45, length001], %)
|
|> angledLine(angle = -45, length = length001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
revolve001 = revolve(sketch001, axis = X)
|
revolve001 = revolve(sketch001, axis = X)
|
||||||
@ -38,15 +38,9 @@ extrude001 = extrude(sketch002, length = 10)
|
|||||||
|
|
||||||
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine([0, 4], %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 4, tag = $rectangleSegmentA001)
|
||||||
|> angledLine([
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2, tag = $rectangleSegmentB001)
|
||||||
segAng(rectangleSegmentA001) - 90,
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|
||||||
2
|
|
||||||
], %, $rectangleSegmentB001)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001),
|
|
||||||
-segLen(rectangleSegmentA001)
|
|
||||||
], %, $rectangleSegmentC001)
|
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close(%)
|
|> close(%)
|
||||||
extrude001 = extrude(sketch001, length = 10)
|
extrude001 = extrude(sketch001, length = 10)
|
||||||
|
16
e2e/playwright/fixtures/bracket.ts
Normal file
16
e2e/playwright/fixtures/bracket.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
|
export const bracket = fs.readFileSync(
|
||||||
|
path.resolve(
|
||||||
|
__dirname,
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'..',
|
||||||
|
'public',
|
||||||
|
'kcl-samples',
|
||||||
|
'bracket',
|
||||||
|
'main.kcl'
|
||||||
|
),
|
||||||
|
'utf8'
|
||||||
|
)
|
@ -99,7 +99,6 @@ export class HomePageFixture {
|
|||||||
createAndGoToProject = async (projectTitle = 'untitled') => {
|
createAndGoToProject = async (projectTitle = 'untitled') => {
|
||||||
await this.projectsLoaded()
|
await this.projectsLoaded()
|
||||||
await this.projectButtonNew.click()
|
await this.projectButtonNew.click()
|
||||||
await this.projectTextName.click()
|
|
||||||
await this.projectTextName.fill(projectTitle)
|
await this.projectTextName.fill(projectTitle)
|
||||||
await this.projectButtonContinue.click()
|
await this.projectButtonContinue.click()
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,9 @@ export class SceneFixture {
|
|||||||
constructor(page: Page) {
|
constructor(page: Page) {
|
||||||
this.page = page
|
this.page = page
|
||||||
this.streamWrapper = page.getByTestId('stream')
|
this.streamWrapper = page.getByTestId('stream')
|
||||||
this.networkToggleConnected = page.getByTestId('network-toggle-ok')
|
this.networkToggleConnected = page
|
||||||
|
.getByTestId('network-toggle-ok')
|
||||||
|
.or(page.getByTestId('network-toggle-other'))
|
||||||
this.startEditSketchBtn = page
|
this.startEditSketchBtn = page
|
||||||
.getByRole('button', { name: 'Start Sketch' })
|
.getByRole('button', { name: 'Start Sketch' })
|
||||||
.or(page.getByRole('button', { name: 'Edit Sketch' }))
|
.or(page.getByRole('button', { name: 'Edit Sketch' }))
|
||||||
@ -231,7 +233,7 @@ export class SceneFixture {
|
|||||||
settled = async (cmdBar: CmdBarFixture) => {
|
settled = async (cmdBar: CmdBarFixture) => {
|
||||||
const u = await getUtils(this.page)
|
const u = await getUtils(this.page)
|
||||||
|
|
||||||
await expect(this.startEditSketchBtn).not.toBeDisabled()
|
await expect(this.startEditSketchBtn).not.toBeDisabled({ timeout: 15_000 })
|
||||||
await expect(this.startEditSketchBtn).toBeVisible()
|
await expect(this.startEditSketchBtn).toBeVisible()
|
||||||
|
|
||||||
await cmdBar.openCmdBar()
|
await cmdBar.openCmdBar()
|
||||||
|
@ -169,7 +169,7 @@ export class ToolbarFixture {
|
|||||||
}
|
}
|
||||||
selectCenterRectangle = async () => {
|
selectCenterRectangle = async () => {
|
||||||
await this.page
|
await this.page
|
||||||
.getByRole('button', { name: 'caret down Corner rectangle:' })
|
.getByRole('button', { name: 'caret down rectangles:' })
|
||||||
.click()
|
.click()
|
||||||
await expect(
|
await expect(
|
||||||
this.page.getByTestId('dropdown-center-rectangle')
|
this.page.getByTestId('dropdown-center-rectangle')
|
||||||
@ -178,7 +178,7 @@ export class ToolbarFixture {
|
|||||||
}
|
}
|
||||||
selectBoolean = async (operation: 'union' | 'subtract' | 'intersect') => {
|
selectBoolean = async (operation: 'union' | 'subtract' | 'intersect') => {
|
||||||
await this.page
|
await this.page
|
||||||
.getByRole('button', { name: 'caret down Union: open menu' })
|
.getByRole('button', { name: 'caret down booleans: open menu' })
|
||||||
.click()
|
.click()
|
||||||
const operationTestId = `dropdown-boolean-${operation}`
|
const operationTestId = `dropdown-boolean-${operation}`
|
||||||
await expect(this.page.getByTestId(operationTestId)).toBeVisible()
|
await expect(this.page.getByTestId(operationTestId)).toBeVisible()
|
||||||
@ -186,25 +186,19 @@ export class ToolbarFixture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectCircleThreePoint = async () => {
|
selectCircleThreePoint = async () => {
|
||||||
await this.page
|
await this.page.getByRole('button', { name: 'caret down circles:' }).click()
|
||||||
.getByRole('button', { name: 'caret down Center circle:' })
|
|
||||||
.click()
|
|
||||||
await expect(
|
await expect(
|
||||||
this.page.getByTestId('dropdown-circle-three-points')
|
this.page.getByTestId('dropdown-circle-three-points')
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
await this.page.getByTestId('dropdown-circle-three-points').click()
|
await this.page.getByTestId('dropdown-circle-three-points').click()
|
||||||
}
|
}
|
||||||
selectArc = async () => {
|
selectArc = async () => {
|
||||||
await this.page
|
await this.page.getByRole('button', { name: 'caret down arcs:' }).click()
|
||||||
.getByRole('button', { name: 'caret down Tangential Arc:' })
|
|
||||||
.click()
|
|
||||||
await expect(this.page.getByTestId('dropdown-arc')).toBeVisible()
|
await expect(this.page.getByTestId('dropdown-arc')).toBeVisible()
|
||||||
await this.page.getByTestId('dropdown-arc').click()
|
await this.page.getByTestId('dropdown-arc').click()
|
||||||
}
|
}
|
||||||
selectThreePointArc = async () => {
|
selectThreePointArc = async () => {
|
||||||
await this.page
|
await this.page.getByRole('button', { name: 'caret down arcs:' }).click()
|
||||||
.getByRole('button', { name: 'caret down Tangential Arc:' })
|
|
||||||
.click()
|
|
||||||
await expect(
|
await expect(
|
||||||
this.page.getByTestId('dropdown-three-point-arc')
|
this.page.getByTestId('dropdown-three-point-arc')
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
|
@ -21,15 +21,9 @@ test.describe('Import UI tests', () => {
|
|||||||
path.join(projectDir, 'toBeImported.kcl'),
|
path.join(projectDir, 'toBeImported.kcl'),
|
||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
profile001 = startProfileAt([281.54, 305.81], sketch001)
|
profile001 = startProfileAt([281.54, 305.81], sketch001)
|
||||||
|> angledLine([0, 123.43], %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|
||||||
|> angledLine([
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|
||||||
segAng(rectangleSegmentA001) - 90,
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||||
85.99
|
|
||||||
], %)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001),
|
|
||||||
-segLen(rectangleSegmentA001)
|
|
||||||
], %)
|
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
extrude(profile001, length = 100)`
|
extrude(profile001, length = 100)`
|
||||||
@ -44,15 +38,9 @@ importedCube
|
|||||||
|
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
profile001 = startProfileAt([-134.53, -56.17], sketch001)
|
profile001 = startProfileAt([-134.53, -56.17], sketch001)
|
||||||
|> angledLine([0, 79.05], %, $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 79.05, tag = $rectangleSegmentA001)
|
||||||
|> angledLine([
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 76.28)
|
||||||
segAng(rectangleSegmentA001) - 90,
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
|
||||||
76.28
|
|
||||||
], %)
|
|
||||||
|> angledLine([
|
|
||||||
segAng(rectangleSegmentA001),
|
|
||||||
-segLen(rectangleSegmentA001)
|
|
||||||
], %, $seg01)
|
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||||
|> close()
|
|> close()
|
||||||
extrude001 = extrude(profile001, length = 100)
|
extrude001 = extrude(profile001, length = 100)
|
||||||
|
63
e2e/playwright/lib/api-reporter.ts
Normal file
63
e2e/playwright/lib/api-reporter.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import type { Reporter, TestCase, TestResult } from '@playwright/test/reporter'
|
||||||
|
|
||||||
|
class MyAPIReporter implements Reporter {
|
||||||
|
onTestEnd(test: TestCase, result: TestResult): void {
|
||||||
|
if (!process.env.TAB_API_URL || !process.env.TAB_API_KEY) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
// Required information
|
||||||
|
project: 'https://github.com/KittyCAD/modeling-app',
|
||||||
|
branch: process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || '',
|
||||||
|
commit: process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA || '',
|
||||||
|
test: test.titlePath().slice(2).join(' › '),
|
||||||
|
status: result.status,
|
||||||
|
// Optional information
|
||||||
|
duration: result.duration / 1000,
|
||||||
|
message: result.error?.stack,
|
||||||
|
target: process.env.TARGET || null,
|
||||||
|
platform: process.env.RUNNER_OS || process.platform,
|
||||||
|
// Extra test and result data
|
||||||
|
annotations: test.annotations.map((a) => a.type),
|
||||||
|
retries: result.retry,
|
||||||
|
// Extra environment variables
|
||||||
|
CI_COMMIT_SHA: process.env.CI_COMMIT_SHA || null,
|
||||||
|
CI_PR_NUMBER: process.env.CI_PR_NUMBER || null,
|
||||||
|
GITHUB_BASE_REF: process.env.GITHUB_BASE_REF || null,
|
||||||
|
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || null,
|
||||||
|
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF || null,
|
||||||
|
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || null,
|
||||||
|
GITHUB_REF: process.env.GITHUB_REF || null,
|
||||||
|
GITHUB_SHA: process.env.GITHUB_SHA || null,
|
||||||
|
GITHUB_WORKFLOW: process.env.GITHUB_WORKFLOW || null,
|
||||||
|
RUNNER_ARCH: process.env.RUNNER_ARCH || null,
|
||||||
|
}
|
||||||
|
|
||||||
|
void (async () => {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${process.env.TAB_API_URL}/api/results`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: new Headers({
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-API-Key': process.env.TAB_API_KEY || '',
|
||||||
|
}),
|
||||||
|
body: JSON.stringify(payload),
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!response.ok && !process.env.CI) {
|
||||||
|
console.error(
|
||||||
|
'TAB API - Failed to send test result:',
|
||||||
|
await response.text()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
if (!process.env.CI) {
|
||||||
|
console.error('TAB API - Unable to send test result')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MyAPIReporter
|
@ -6,7 +6,9 @@ import type { NamedView } from '@rust/kcl-lib/bindings/NamedView'
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
createProject,
|
createProject,
|
||||||
perProjectsettingsToToml,
|
orRunWhenFullSuiteEnabled,
|
||||||
|
perProjectSettingsToToml,
|
||||||
|
runningOnMac,
|
||||||
tomlToPerProjectSettings,
|
tomlToPerProjectSettings,
|
||||||
} from '@e2e/playwright/test-utils'
|
} from '@e2e/playwright/test-utils'
|
||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||||
@ -57,10 +59,13 @@ function tomlStringOverWriteNamedViewUuids(toml: string): string {
|
|||||||
settings.settings.app.named_views = remappedNamedViews
|
settings.settings.app.named_views = remappedNamedViews
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return perProjectsettingsToToml(settings)
|
return perProjectSettingsToToml(settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
test.describe('Named view tests', () => {
|
test.describe('Named view tests', () => {
|
||||||
|
if (runningOnMac()) {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
}
|
||||||
test('Verify project.toml is not created', async ({ page }, testInfo) => {
|
test('Verify project.toml is not created', async ({ page }, testInfo) => {
|
||||||
// Create project and load it
|
// Create project and load it
|
||||||
const projectName = 'named-views'
|
const projectName = 'named-views'
|
||||||
@ -104,6 +109,9 @@ test.describe('Named view tests', () => {
|
|||||||
PROJECT_SETTINGS_FILE_NAME
|
PROJECT_SETTINGS_FILE_NAME
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const toastMessage = page.getByText('Named view uuid1 created.')
|
||||||
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
// Expect project.toml to be generated on disk since a named view was created
|
// Expect project.toml to be generated on disk since a named view was created
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
let exists = await fileExists(tempProjectSettingsFilePath)
|
let exists = await fileExists(tempProjectSettingsFilePath)
|
||||||
@ -129,7 +137,6 @@ test.describe('Named view tests', () => {
|
|||||||
}, testInfo) => {
|
}, testInfo) => {
|
||||||
const projectName = 'named-views'
|
const projectName = 'named-views'
|
||||||
const myNamedView1 = 'uuid1'
|
const myNamedView1 = 'uuid1'
|
||||||
const myNamedView2 = 'uuid2'
|
|
||||||
|
|
||||||
// Create project and go into the project
|
// Create project and go into the project
|
||||||
await createProject({ name: projectName, page })
|
await createProject({ name: projectName, page })
|
||||||
@ -141,6 +148,9 @@ test.describe('Named view tests', () => {
|
|||||||
await cmdBar.argumentInput.fill(myNamedView1)
|
await cmdBar.argumentInput.fill(myNamedView1)
|
||||||
await cmdBar.progressCmdBar(false)
|
await cmdBar.progressCmdBar(false)
|
||||||
|
|
||||||
|
let toastMessage = page.getByText('Named view uuid1 created.')
|
||||||
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
// Generate file paths for project.toml
|
// Generate file paths for project.toml
|
||||||
const projectDirName = testInfo.outputPath('electron-test-projects-dir')
|
const projectDirName = testInfo.outputPath('electron-test-projects-dir')
|
||||||
const tempProjectSettingsFilePath = join(
|
const tempProjectSettingsFilePath = join(
|
||||||
@ -169,17 +179,20 @@ test.describe('Named view tests', () => {
|
|||||||
// Delete a named view
|
// Delete a named view
|
||||||
await cmdBar.openCmdBar()
|
await cmdBar.openCmdBar()
|
||||||
await cmdBar.chooseCommand('delete named view')
|
await cmdBar.chooseCommand('delete named view')
|
||||||
cmdBar.selectOption({ name: myNamedView2 })
|
cmdBar.selectOption({ name: myNamedView1 })
|
||||||
await cmdBar.progressCmdBar(false)
|
await cmdBar.progressCmdBar(false)
|
||||||
|
|
||||||
|
toastMessage = page.getByText('Named view uuid1 removed.')
|
||||||
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
// Read project.toml into memory again since we deleted a named view
|
// Read project.toml into memory again since we deleted a named view
|
||||||
let tomlString = await fsp.readFile(tempProjectSettingsFilePath, 'utf-8')
|
let tomlString = await fsp.readFile(tempProjectSettingsFilePath, 'utf-8')
|
||||||
// Rewrite the uuids in the named views to match snapshot otherwise they will be randomly generated from rust and break
|
// Rewrite the uuids in the named views to match snapshot otherwise they will be randomly generated from rust and break
|
||||||
tomlString = tomlStringOverWriteNamedViewUuids(tomlString)
|
tomlString = tomlStringOverWriteNamedViewUuids(tomlString)
|
||||||
|
|
||||||
// // Write the entire tomlString to a snapshot.
|
// Write the entire tomlString to a snapshot.
|
||||||
// // There are many key/value pairs to check this is a safer match.
|
// There are many key/value pairs to check this is a safer match.
|
||||||
expect(tomlString).toMatchSnapshot('verify-named-view-gets-deleted')
|
expect(tomlString).toMatchSnapshot('verify-named-view-gets-deleted')
|
||||||
}).toPass()
|
}).toPass()
|
||||||
})
|
})
|
||||||
@ -201,6 +214,9 @@ test.describe('Named view tests', () => {
|
|||||||
await cmdBar.argumentInput.fill(myNamedView)
|
await cmdBar.argumentInput.fill(myNamedView)
|
||||||
await cmdBar.progressCmdBar(false)
|
await cmdBar.progressCmdBar(false)
|
||||||
|
|
||||||
|
let toastMessage = page.getByText('Named view uuid1 created.')
|
||||||
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
// Generate file paths for project.toml
|
// Generate file paths for project.toml
|
||||||
const projectDirName = testInfo.outputPath('electron-test-projects-dir')
|
const projectDirName = testInfo.outputPath('electron-test-projects-dir')
|
||||||
const tempProjectSettingsFilePath = join(
|
const tempProjectSettingsFilePath = join(
|
||||||
@ -257,26 +273,19 @@ test.describe('Named view tests', () => {
|
|||||||
await cmdBar.argumentInput.fill(myNamedView1)
|
await cmdBar.argumentInput.fill(myNamedView1)
|
||||||
await cmdBar.progressCmdBar(false)
|
await cmdBar.progressCmdBar(false)
|
||||||
|
|
||||||
await page.waitForTimeout(1000)
|
let toastMessage = page.getByText('Named view uuid1 created.')
|
||||||
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
const orbitMouseStart = { x: 800, y: 130 }
|
await scene.moveCameraTo({ x: 608, y: 0, z: 0 }, { x: 0, y: 0, z: 0 })
|
||||||
const orbitMouseEnd = { x: 0, y: 130 }
|
await page.waitForTimeout(2500)
|
||||||
await page.mouse.move(orbitMouseStart.x, orbitMouseStart.y)
|
|
||||||
await page.mouse.down({ button: 'middle' })
|
|
||||||
await page.mouse.move(orbitMouseEnd.x, orbitMouseEnd.y, {
|
|
||||||
steps: 3,
|
|
||||||
})
|
|
||||||
await page.mouse.up({ button: 'middle' })
|
|
||||||
|
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
|
|
||||||
await cmdBar.openCmdBar()
|
await cmdBar.openCmdBar()
|
||||||
await cmdBar.chooseCommand('create named view')
|
await cmdBar.chooseCommand('create named view')
|
||||||
await cmdBar.argumentInput.fill(myNamedView2)
|
await cmdBar.argumentInput.fill(myNamedView2)
|
||||||
await cmdBar.progressCmdBar(false)
|
await cmdBar.progressCmdBar(false)
|
||||||
|
|
||||||
// Wait a moment for the project.toml to get written to disk with the new view point
|
toastMessage = page.getByText('Named view uuid2 created.')
|
||||||
await page.waitForTimeout(1000)
|
await expect(toastMessage).toBeInViewport()
|
||||||
|
|
||||||
// Generate paths for the project.toml
|
// Generate paths for the project.toml
|
||||||
const tempProjectSettingsFilePath = join(
|
const tempProjectSettingsFilePath = join(
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
[settings]
|
||||||
|
modeling = { }
|
||||||
|
text_editor = { }
|
||||||
|
command_bar = { }
|
||||||
|
|
||||||
|
[settings.app.named_views.0656fb1a-9640-473e-b334-591dc70c0138]
|
||||||
|
name = "uuid1"
|
||||||
|
eye_offset = 1_378.0059
|
||||||
|
fov_y = 45
|
||||||
|
is_ortho = false
|
||||||
|
ortho_scale_enabled = true
|
||||||
|
ortho_scale_factor = 1.6
|
||||||
|
pivot_position = [ 0, 0, 0 ]
|
||||||
|
pivot_rotation = [ 0.5380994, 0.0, 0.0, 0.8428814 ]
|
||||||
|
world_coord_system = "right_handed_up_z"
|
||||||
|
version = 1
|
@ -1,16 +1,5 @@
|
|||||||
[settings]
|
[settings]
|
||||||
|
app = { }
|
||||||
modeling = { }
|
modeling = { }
|
||||||
text_editor = { }
|
text_editor = { }
|
||||||
command_bar = { }
|
command_bar = { }
|
||||||
|
|
||||||
[settings.app.named_views.0656fb1a-9640-473e-b334-591dc70c0138]
|
|
||||||
name = "uuid1"
|
|
||||||
eye_offset = 1_378.0059
|
|
||||||
fov_y = 45
|
|
||||||
is_ortho = false
|
|
||||||
ortho_scale_enabled = true
|
|
||||||
ortho_scale_factor = 1.6
|
|
||||||
pivot_position = [ 0, 0, 0 ]
|
|
||||||
pivot_rotation = [ 0.5380994, 0.0, 0.0, 0.8428814 ]
|
|
||||||
world_coord_system = "right_handed_up_z"
|
|
||||||
version = 1
|
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
[settings]
|
||||||
|
modeling = { }
|
||||||
|
text_editor = { }
|
||||||
|
command_bar = { }
|
||||||
|
|
||||||
|
[settings.app.named_views.0656fb1a-9640-473e-b334-591dc70c0138]
|
||||||
|
name = "uuid1"
|
||||||
|
eye_offset = 1_378.0059
|
||||||
|
fov_y = 45
|
||||||
|
is_ortho = false
|
||||||
|
ortho_scale_enabled = true
|
||||||
|
ortho_scale_factor = 1.6
|
||||||
|
pivot_position = [ 0, 0, 0 ]
|
||||||
|
pivot_rotation = [ 0.5380994, 0.0, 0.0, 0.8428814 ]
|
||||||
|
world_coord_system = "right_handed_up_z"
|
||||||
|
version = 1
|
||||||
|
|
||||||
|
[settings.app.named_views.c810cf04-c6cc-4a4a-8b11-17bf445dcab7]
|
||||||
|
name = "uuid2"
|
||||||
|
eye_offset = 1_378.0059
|
||||||
|
fov_y = 45
|
||||||
|
is_ortho = false
|
||||||
|
ortho_scale_enabled = true
|
||||||
|
ortho_scale_factor = 1.6
|
||||||
|
pivot_position = [ 1_826.5239, 0.0, 0.0 ]
|
||||||
|
pivot_rotation = [ 0.5380994, 0.0, 0.0, 0.8428814 ]
|
||||||
|
world_coord_system = "right_handed_up_z"
|
||||||
|
version = 1
|
@ -17,12 +17,12 @@ version = 1
|
|||||||
|
|
||||||
[settings.app.named_views.c810cf04-c6cc-4a4a-8b11-17bf445dcab7]
|
[settings.app.named_views.c810cf04-c6cc-4a4a-8b11-17bf445dcab7]
|
||||||
name = "uuid2"
|
name = "uuid2"
|
||||||
eye_offset = 1_378.0059
|
eye_offset = 608
|
||||||
fov_y = 45
|
fov_y = 45
|
||||||
is_ortho = false
|
is_ortho = false
|
||||||
ortho_scale_enabled = true
|
ortho_scale_enabled = true
|
||||||
ortho_scale_factor = 1.6
|
ortho_scale_factor = 1.6
|
||||||
pivot_position = [ 1_826.5239, 0.0, 0.0 ]
|
pivot_position = [ 0, 0, 0 ]
|
||||||
pivot_rotation = [ 0.5380994, 0.0, 0.0, 0.8428814 ]
|
pivot_rotation = [ 0.5, 0.5, 0.5, 0.5 ]
|
||||||
world_coord_system = "right_handed_up_z"
|
world_coord_system = "right_handed_up_z"
|
||||||
version = 1
|
version = 1
|
||||||
|
@ -7,6 +7,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
|
|||||||
* Test file menu actions that trigger something in the frontend
|
* Test file menu actions that trigger something in the frontend
|
||||||
*/
|
*/
|
||||||
test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
||||||
|
test.skip() // TODO: Reimplement native file menu tests
|
||||||
test.describe('Home page', () => {
|
test.describe('Home page', () => {
|
||||||
test.describe('File role', () => {
|
test.describe('File role', () => {
|
||||||
test('Home.File.Create project', async ({ tronApp, cmdBar, page }) => {
|
test('Home.File.Create project', async ({ tronApp, cmdBar, page }) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { bracket } from '@src/lib/exampleKcl'
|
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
||||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
||||||
import fsp from 'fs/promises'
|
import fsp from 'fs/promises'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
@ -15,6 +15,7 @@ import {
|
|||||||
executorInputPath,
|
executorInputPath,
|
||||||
getUtils,
|
getUtils,
|
||||||
orRunWhenFullSuiteEnabled,
|
orRunWhenFullSuiteEnabled,
|
||||||
|
runningOnWindows,
|
||||||
settingsToToml,
|
settingsToToml,
|
||||||
} from '@e2e/playwright/test-utils'
|
} from '@e2e/playwright/test-utils'
|
||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||||
@ -279,6 +280,9 @@ test.describe('Onboarding tests', () => {
|
|||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
|
if (runningOnWindows()) {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
}
|
||||||
await tronApp.cleanProjectDir({
|
await tronApp.cleanProjectDir({
|
||||||
app: {
|
app: {
|
||||||
onboarding_status: '/parametric-modeling',
|
onboarding_status: '/parametric-modeling',
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user