Compare commits
300 Commits
jtran/fix-
...
nightly-v2
Author | SHA1 | Date | |
---|---|---|---|
a4db302174 | |||
66f3500ca9 | |||
c3bdc6f106 | |||
0a2bf4b55f | |||
bbae9b6363 | |||
180d52280d | |||
dce1dca7c7 | |||
343f6572a2 | |||
c8e58d49e0 | |||
c18546fb2f | |||
466c23a9d8 | |||
8403025c77 | |||
9ce591a1a1 | |||
f238f3882b | |||
a91208eb1c | |||
b92b0a9afe | |||
964347f43a | |||
3811c88b5c | |||
69a1473197 | |||
1f1e996cfa | |||
58167deda7 | |||
83d22a4f5f | |||
7003b19a70 | |||
687ef1429d | |||
b1b00a9a22 | |||
a0924bcfa3 | |||
5ce22e2de8 | |||
850c5c62d1 | |||
b31786c9ab | |||
936549d60f | |||
0babbcff49 | |||
02c2e80b31 | |||
da236d9a3e | |||
1104d908c0 | |||
2efea3ec06 | |||
775007ef0d | |||
f490e7d6fe | |||
89bc93e4cd | |||
12edb6375d | |||
8d9bba02d6 | |||
56e100fad7 | |||
38f7a4089e | |||
91f5465e2d | |||
58a9c60d0b | |||
725c4d95f8 | |||
615b7feabb | |||
5743b9ced0 | |||
8896d06028 | |||
1f217ef50b | |||
5ef5c6280c | |||
aac95e1e2e | |||
18f4a1303c | |||
ded97eda61 | |||
f6b06520ee | |||
dcfcdc98ce | |||
9ab3325580 | |||
cb5ad3ab27 | |||
1e539cc134 | |||
4297dc43ae | |||
935b4ee7f5 | |||
2523242bb1 | |||
309e4fadf0 | |||
842054de09 | |||
af146284b6 | |||
5ac40e6849 | |||
d3e0625e8a | |||
484da28374 | |||
fa9e6ccea9 | |||
77fbb68419 | |||
253a7910b0 | |||
88c6be810f | |||
2860926571 | |||
fb81c02877 | |||
d78648f0f8 | |||
fe31769be5 | |||
388371b05d | |||
9db69007e5 | |||
f2a6492ab7 | |||
3ddce116e5 | |||
57f7d022ca | |||
cbc12559c7 | |||
b3cd5ef3ba | |||
a094995730 | |||
46b4b01d23 | |||
4d1eaf9381 | |||
df3668adc8 | |||
270781d5cd | |||
96b93f8d51 | |||
59b1c414f0 | |||
fd07b8cff5 | |||
21efb2c0bd | |||
30029a63a1 | |||
9f5003cafc | |||
5232e1d40a | |||
23c25c2b50 | |||
50273c0edc | |||
8a03bf50e3 | |||
7500ef0065 | |||
099c48cd63 | |||
f35cd3ef26 | |||
695c432d1e | |||
2835665a6a | |||
45707d2974 | |||
b2e1d21d45 | |||
b98f5605b6 | |||
c050e03df1 | |||
b6fa4325f0 | |||
0804aecc63 | |||
3dfc2c86e1 | |||
71647ede29 | |||
cd679f4be3 | |||
18d87b99bd | |||
70a2202877 | |||
f5c9f84ae9 | |||
71f701dec7 | |||
bffbed1d42 | |||
9f60ed8e75 | |||
57b366b2d0 | |||
6f3f5dbda9 | |||
8dd25715fb | |||
834f7133d8 | |||
8c5662e458 | |||
f37fc357af | |||
e27e9ecc63 | |||
78b42ea191 | |||
5d02a27122 | |||
49d52ce94b | |||
a572d7b0db | |||
1f405b9327 | |||
0874891dd0 | |||
59d0e079a1 | |||
b9862baed0 | |||
592c5259c6 | |||
950f5cebfd | |||
4c0ea136e0 | |||
81c0035adc | |||
c68e5d7774 | |||
ed8a0e4aaa | |||
322f398049 | |||
bc4d254297 | |||
10b7a772bf | |||
86ba586318 | |||
cc313afb89 | |||
d0c8311e41 | |||
28311d160a | |||
162856064b | |||
652f82e8c3 | |||
d4d9bf6c7f | |||
0e9d37c0a0 | |||
9c18060d73 | |||
e2be66b024 | |||
1bb372b642 | |||
627fbda671 | |||
74bdb72edc | |||
a9182bf357 | |||
5f14023404 | |||
9a3ac64603 | |||
67e60cb832 | |||
110037df79 | |||
30b1dae38a | |||
f20fc5b467 | |||
1bfc3a0a3c | |||
f6e975db84 | |||
b82eec85fd | |||
5dc4213295 | |||
61807e7629 | |||
357bbffce5 | |||
6ac9c49773 | |||
020497cde2 | |||
688852a5df | |||
6c635bd70d | |||
1c0a38a1e2 | |||
019cb815f9 | |||
c8653beae7 | |||
9ea3cb51ba | |||
e0de0493ab | |||
11cac0c30e | |||
4de50edf5a | |||
bebace193d | |||
f4d5578faf | |||
fed922cfb8 | |||
2b7325655b | |||
d3b02b8c5b | |||
9008fb636f | |||
eb4048cd16 | |||
c30b161e95 | |||
0e68d03612 | |||
95fd14eedc | |||
3c367426c6 | |||
a277cce636 | |||
df86c93a04 | |||
8aabac0be7 | |||
138728a95d | |||
9a92e7d642 | |||
efedc8de58 | |||
f7ee248a26 | |||
336f4f27ba | |||
e1f128d64a | |||
f858a611f1 | |||
6ce270c0d0 | |||
30ac0e4f48 | |||
8f90c352fe | |||
bc6f0fceca | |||
5c830a4ed4 | |||
8a9d50226f | |||
8397405998 | |||
f5b8298735 | |||
25ad603502 | |||
86349375d0 | |||
56d861f2cc | |||
3e8ee3ffc4 | |||
a44516bc7e | |||
ce62fe67cf | |||
763a1b6628 | |||
3281e62e6b | |||
f1a458f124 | |||
229433126d | |||
b962b5fcb3 | |||
428d125139 | |||
cffeb52b4b | |||
e0ef10e7bb | |||
7095ce2377 | |||
5b207d7d1a | |||
2fac213c58 | |||
2f72a8ef14 | |||
27ce9f8aa4 | |||
b0426e3f94 | |||
d707c66e53 | |||
f8f44743fa | |||
f262eda12a | |||
9e1136195a | |||
4ff07ddaee | |||
1e565379a7 | |||
76e34ac4da | |||
4cd427bf91 | |||
f321ecdff0 | |||
d114ab798c | |||
69fec37107 | |||
8ca8c49cc3 | |||
b25fc302fd | |||
648b37c1dd | |||
18e5da5ca4 | |||
46524cda10 | |||
4585671a5d | |||
e7203b9e7a | |||
ab375f4b92 | |||
04ed6f52ee | |||
2332338ca1 | |||
41b97de3d1 | |||
8ef31a0be1 | |||
3adb42b5f2 | |||
20016b101e | |||
8d9dbf36c3 | |||
440704ed9f | |||
2261217a5d | |||
10da986649 | |||
10789d9c3c | |||
67cc4f5835 | |||
2692f2b73a | |||
965cb18059 | |||
a022b8ef6c | |||
4d24bf7c94 | |||
9a537da183 | |||
df81b76b8b | |||
ac3f7ab712 | |||
dac91d3b79 | |||
0698432abf | |||
0592d3b5da | |||
31e4d60045 | |||
c0817b00e4 | |||
4ea1d16fb6 | |||
d049bf33e8 | |||
7b11047d07 | |||
412e9568f2 | |||
9be208e5e1 | |||
842ef5ede9 | |||
3f855d7bad | |||
0a1a6e50cf | |||
d4e955289c | |||
c147a219f4 | |||
38513a1e25 | |||
c0c5c790ca | |||
8b60f75220 | |||
f91ad4331f | |||
59103a2118 | |||
9737c2550a | |||
bf9d01a8dd | |||
702e322f90 | |||
e82830754d | |||
7806377a5a | |||
859afa2fd8 | |||
0a5f3093fc | |||
b65f7939f6 | |||
c35dea5e07 | |||
fc66d4745f | |||
b313d26c2a | |||
00b94ead62 | |||
0531ea1ce9 | |||
5f9a4887c1 | |||
da7dfa16d8 |
@ -1,3 +1,3 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall
|
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
|
||||||
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,tsconfig.tsbuildinfo
|
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,tsconfig.tsbuildinfo
|
||||||
|
@ -2,8 +2,8 @@ NODE_ENV=development
|
|||||||
DEV=true
|
DEV=true
|
||||||
VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands
|
VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands
|
||||||
VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
||||||
BASE_URL=https://api.dev.zoo.dev
|
|
||||||
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
||||||
|
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
|
||||||
VITE_KC_SKIP_AUTH=false
|
VITE_KC_SKIP_AUTH=false
|
||||||
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
||||||
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
NODE_ENV=production
|
||||||
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
|
VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands
|
||||||
VITE_KC_API_BASE_URL=https://api.zoo.dev
|
VITE_KC_API_BASE_URL=https://api.zoo.dev
|
||||||
VITE_KC_SITE_BASE_URL=https://zoo.dev
|
VITE_KC_SITE_BASE_URL=https://zoo.dev
|
||||||
|
VITE_KC_SITE_APP_URL=https://app.zoo.dev
|
||||||
VITE_KC_SKIP_AUTH=false
|
VITE_KC_SKIP_AUTH=false
|
||||||
VITE_KC_CONNECTION_TIMEOUT_MS=15000
|
VITE_KC_CONNECTION_TIMEOUT_MS=15000
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
src/wasm-lib/*
|
rust/*
|
||||||
*.typegen.ts
|
*.typegen.ts
|
||||||
packages/codemirror-lsp-client/dist/*
|
packages/codemirror-lsp-client/dist/*
|
||||||
|
e2e/playwright/snapshots/prompt-to-edit/*
|
||||||
|
23
.eslintrc
23
.eslintrc
@ -6,21 +6,36 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
"css-modules",
|
"css-modules",
|
||||||
"jest",
|
"jest",
|
||||||
|
"jsx-a11y",
|
||||||
"react",
|
"react",
|
||||||
|
"react-hooks",
|
||||||
"suggest-no-throw",
|
"suggest-no-throw",
|
||||||
|
"testing-library",
|
||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:css-modules/recommended"
|
"plugin:css-modules/recommended",
|
||||||
|
"plugin:jsx-a11y/recommended",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-floating-promises": "error",
|
"@typescript-eslint/no-floating-promises": "error",
|
||||||
"@typescript-eslint/no-misused-promises": "error",
|
"@typescript-eslint/no-misused-promises": "error",
|
||||||
|
"jsx-a11y/click-events-have-key-events": "off",
|
||||||
|
"jsx-a11y/no-autofocus": "off",
|
||||||
|
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||||
"no-restricted-globals": [
|
"no-restricted-globals": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"name": "isNaN",
|
"name": "isNaN",
|
||||||
"message": "Use Number.isNaN() instead."
|
"message": "Use Number.isNaN() instead."
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"no-restricted-syntax": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"selector": "CallExpression[callee.object.name='Array'][callee.property.name='isArray']",
|
||||||
|
"message": "Use isArray() in lib/utils.ts instead of Array.isArray()."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"semi": [
|
"semi": [
|
||||||
@ -33,6 +48,9 @@
|
|||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
||||||
|
"extends": [
|
||||||
|
"plugin:testing-library/react"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"suggest-no-throw/suggest-no-throw": "off",
|
"suggest-no-throw/suggest-no-throw": "off",
|
||||||
"testing-library/prefer-screen-queries": "off",
|
"testing-library/prefer-screen-queries": "off",
|
||||||
@ -41,6 +59,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["src/**/*.test.ts"],
|
"files": ["src/**/*.test.ts"],
|
||||||
|
"extends": [
|
||||||
|
"plugin:testing-library/react"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"suggest-no-throw/suggest-no-throw": "off",
|
"suggest-no-throw/suggest-no-throw": "off",
|
||||||
}
|
}
|
||||||
|
13
.gitattributes
vendored
Normal file
13
.gitattributes
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
|
||||||
|
# in Windows via a file share from Linux, the scripts will work.
|
||||||
|
*.{cmd,[cC][mM][dD]} text working-tree-encoding=UTF-16LE eol=CRLF
|
||||||
|
*.{bat,[bB][aA][tT]} text working-tree-encoding=UTF-16LE eol=CRLF
|
||||||
|
*.{ics,[iI][cC][sS]} text working-tree-encoding=UTF-16LE eol=CRLF
|
||||||
|
*.{ps1,[iP][sS][1]} text working-tree-encoding=UTF-16LE eol=CRLF
|
||||||
|
|
||||||
|
# Force bash scripts to always use LF line endings so that if a repo is accessed
|
||||||
|
# in Unix via a file share from Windows, the scripts will work.
|
||||||
|
*.sh text eol=lfol=lf
|
2
.github/ci-cd-scripts/playwright-electron.sh
vendored
2
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -21,7 +21,7 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
retry=1
|
retry=1
|
||||||
max_retrys=5
|
max_retrys=1
|
||||||
|
|
||||||
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
|
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
|
||||||
while [[ $retry -le $max_retrys ]]; do
|
while [[ $retry -le $max_retrys ]]; do
|
||||||
|
27
.github/dependabot.yml
vendored
27
.github/dependabot.yml
vendored
@ -6,23 +6,29 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: 'npm' # See documentation for possible values
|
- package-ecosystem: 'npm' # See documentation for possible values
|
||||||
directory: '/' # Location of package manifests
|
directories:
|
||||||
|
- '/'
|
||||||
|
- '/packages/codemirror-lang-kcl/'
|
||||||
|
- '/packages/codemirror-lsp-client/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: 'weekly'
|
interval: weekly
|
||||||
|
day: monday
|
||||||
reviewers:
|
reviewers:
|
||||||
- franknoirot
|
- franknoirot
|
||||||
- irev-dev
|
- irev-dev
|
||||||
- package-ecosystem: 'github-actions' # See documentation for possible values
|
- package-ecosystem: 'github-actions' # See documentation for possible values
|
||||||
directory: '/' # Location of package manifests
|
directory: '/' # Location of package manifests
|
||||||
schedule:
|
schedule:
|
||||||
interval: 'weekly'
|
interval: weekly
|
||||||
|
day: monday
|
||||||
reviewers:
|
reviewers:
|
||||||
- adamchalmers
|
- adamchalmers
|
||||||
- jessfraz
|
- jessfraz
|
||||||
- package-ecosystem: 'cargo' # See documentation for possible values
|
- package-ecosystem: 'cargo' # See documentation for possible values
|
||||||
directory: '/src/wasm-lib/' # Location of package manifests
|
directory: '/rust/' # Location of package manifests
|
||||||
schedule:
|
schedule:
|
||||||
interval: 'weekly'
|
interval: weekly
|
||||||
|
day: monday
|
||||||
reviewers:
|
reviewers:
|
||||||
- adamchalmers
|
- adamchalmers
|
||||||
- jessfraz
|
- jessfraz
|
||||||
@ -30,3 +36,14 @@ updates:
|
|||||||
serde-dependencies:
|
serde-dependencies:
|
||||||
patterns:
|
patterns:
|
||||||
- "serde*"
|
- "serde*"
|
||||||
|
wasm-bindgen-deps:
|
||||||
|
patterns:
|
||||||
|
- "wasm-bindgen*"
|
||||||
|
- package-ecosystem: "pip" # See documentation for possible values
|
||||||
|
directory: "/rust/kcl-python-bindings/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
reviewers:
|
||||||
|
- adamchalmers
|
||||||
|
- jessfraz
|
||||||
|
9
.github/workflows/build-and-store-wasm.yml
vendored
9
.github/workflows/build-and-store-wasm.yml
vendored
@ -21,13 +21,16 @@ jobs:
|
|||||||
- name: Cache wasm
|
- name: Cache wasm
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- name: build wasm
|
- name: build wasm
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
|
|
||||||
|
|
||||||
# Upload the WASM bundle as an artifact
|
# Upload the WASM bundle as an artifact
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
path: src/wasm-lib/pkg
|
path: rust/kcl-wasm-lib/pkg
|
||||||
|
77
.github/workflows/build-apps.yml
vendored
77
.github/workflows/build-apps.yml
vendored
@ -7,14 +7,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
schedule:
|
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
|
||||||
- cron: '0 4 * * *'
|
|
||||||
# Daily at 04:00 AM UTC
|
|
||||||
# Will checkout the last commit from the default branch (main as of 2023-10-04)
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IS_RELEASE: ${{ github.ref_type == 'tag' }}
|
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
||||||
IS_NIGHTLY: ${{ github.event_name == 'schedule' }}
|
IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -41,15 +38,22 @@ jobs:
|
|||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
|
|
||||||
|
# TODO: see if we can fetch from main instead if no diff at rust
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
|
|
||||||
# TODO: see if we can fetch from main instead if no diff at src/wasm-lib
|
|
||||||
- name: Run build:wasm
|
- name: Run build:wasm
|
||||||
run: "yarn build:wasm"
|
run: "yarn 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: yarn files:flip-to-nightly
|
run: |
|
||||||
|
export VERSION=${GITHUB_REF_NAME#nightly-v}
|
||||||
|
yarn files:set-version
|
||||||
|
yarn files:flip-to-nightly
|
||||||
|
|
||||||
- name: Set release version
|
- name: Set release version
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
@ -63,7 +67,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
package.json
|
package.json
|
||||||
electron-builder.yml
|
electron-builder.yml
|
||||||
src/wasm-lib/pkg/wasm_lib*
|
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||||
release-notes.md
|
release-notes.md
|
||||||
assets/icon.ico
|
assets/icon.ico
|
||||||
assets/icon.png
|
assets/icon.png
|
||||||
@ -113,9 +117,9 @@ jobs:
|
|||||||
ls -R prepared-files
|
ls -R prepared-files
|
||||||
cp prepared-files/package.json package.json
|
cp prepared-files/package.json package.json
|
||||||
cp prepared-files/electron-builder.yml electron-builder.yml
|
cp prepared-files/electron-builder.yml electron-builder.yml
|
||||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||||
mkdir src/wasm-lib/pkg
|
mkdir rust/kcl-wasm-lib/pkg
|
||||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib* src/wasm-lib/pkg
|
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||||
cp prepared-files/release-notes.md release-notes.md
|
cp prepared-files/release-notes.md release-notes.md
|
||||||
cp prepared-files/assets/icon.ico assets/icon.ico
|
cp prepared-files/assets/icon.ico assets/icon.ico
|
||||||
cp prepared-files/assets/icon.png assets/icon.png
|
cp prepared-files/assets/icon.png assets/icon.png
|
||||||
@ -126,9 +130,13 @@ jobs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
||||||
|
|
||||||
- run: yarn install
|
- name: yarn install
|
||||||
|
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
||||||
- run: yarn tronb:vite
|
uses: nick-fields/retry@v3.0.1
|
||||||
|
with:
|
||||||
|
timeout_minutes: 2
|
||||||
|
max_attempts: 3
|
||||||
|
command: yarn 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' }}
|
||||||
@ -159,8 +167,8 @@ jobs:
|
|||||||
- 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
|
# this is just not doing any codesign or release yml generation, and points to dev infra
|
||||||
run: yarn electron-builder --config
|
run: yarn 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' }}
|
||||||
@ -175,11 +183,11 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.0
|
uses: nick-fields/retry@v3.0.1
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn electron-builder --config --publish always
|
command: yarn tronb:package:prod
|
||||||
|
|
||||||
- name: List artifacts in out/
|
- name: List artifacts in out/
|
||||||
run: ls -R out
|
run: ls -R out
|
||||||
@ -236,11 +244,11 @@ jobs:
|
|||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
DEBUG: "electron-notarize*"
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||||
uses: nick-fields/retry@v3.0.0
|
uses: nick-fields/retry@v3.0.1
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 10
|
timeout_minutes: 10
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
command: yarn electron-builder --config --publish always
|
command: yarn tronb:package:prod
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
@ -265,7 +273,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
if: ${{ github.ref_type == 'tag' || github.event_name == 'schedule' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
env:
|
env:
|
||||||
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
|
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
|
||||||
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
|
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
|
||||||
@ -322,8 +330,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
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: ${{ github.event_name == 'schedule' && '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: ${{ github.event_name == 'schedule' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
|
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_DIR=https://${WEBSITE_DIR}
|
RELEASE_DIR=https://${WEBSITE_DIR}
|
||||||
jq --null-input \
|
jq --null-input \
|
||||||
@ -378,25 +386,25 @@ jobs:
|
|||||||
# see https://github.com/actions/checkout/issues/1471
|
# see https://github.com/actions/checkout/issues/1471
|
||||||
git fetch --prune --unshallow --tags
|
git fetch --prune --unshallow --tags
|
||||||
export TAG="nightly-${VERSION}"
|
export TAG="nightly-${VERSION}"
|
||||||
export PREVIOUS_TAG=$(git describe --tags --match="nightly-v[0-9]*" --abbrev=0)
|
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
|
yarn files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: 'google-github-actions/auth@v2.1.7'
|
uses: 'google-github-actions/auth@v2.1.8'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||||
|
|
||||||
- name: Set up Google Cloud SDK
|
- name: Set up Google Cloud SDK
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: google-github-actions/setup-gcloud@v2.1.2
|
uses: google-github-actions/setup-gcloud@v2.1.4
|
||||||
with:
|
with:
|
||||||
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
||||||
|
|
||||||
- name: Upload nightly files to public bucket
|
- name: Upload nightly files to public bucket
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: google-github-actions/upload-cloud-storage@v2.2.1
|
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
||||||
with:
|
with:
|
||||||
path: out
|
path: out
|
||||||
glob: '*'
|
glob: '*'
|
||||||
@ -406,14 +414,3 @@ 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: yarn files:invalidate-bucket:nightly
|
||||||
|
|
||||||
- name: Tag nightly commit
|
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { VERSION } = process.env
|
|
||||||
const { owner, repo } = context.repo
|
|
||||||
const { sha } = context
|
|
||||||
const ref = `refs/tags/nightly-${VERSION}`
|
|
||||||
github.rest.git.createRef({ owner, repo, sha, ref })
|
|
||||||
|
44
.github/workflows/cargo-bench.yml
vendored
44
.github/workflows/cargo-bench.yml
vendored
@ -1,44 +0,0 @@
|
|||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- '**.rs'
|
|
||||||
- '**/Cargo.toml'
|
|
||||||
- '**/Cargo.lock'
|
|
||||||
- '**/rust-toolchain.toml'
|
|
||||||
- .github/workflows/cargo-bench.yml
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '**.rs'
|
|
||||||
- '**/Cargo.toml'
|
|
||||||
- '**/Cargo.lock'
|
|
||||||
- '**/rust-toolchain.toml'
|
|
||||||
- .github/workflows/cargo-bench.yml
|
|
||||||
workflow_dispatch:
|
|
||||||
permissions: read-all
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
name: cargo bench
|
|
||||||
jobs:
|
|
||||||
cargo-bench:
|
|
||||||
name: Benchmark with iai
|
|
||||||
runs-on: ubuntu-latest-8-cores
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
cargo install cargo-criterion
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y valgrind
|
|
||||||
- name: Rust Cache
|
|
||||||
uses: Swatinem/rust-cache@v2.6.1
|
|
||||||
- name: Benchmark kcl library
|
|
||||||
shell: bash
|
|
||||||
run: |-
|
|
||||||
cd src/wasm-lib/kcl; cargo bench --all-features -- iai
|
|
||||||
env:
|
|
||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
|
||||||
|
|
5
.github/workflows/cargo-check.yml
vendored
5
.github/workflows/cargo-check.yml
vendored
@ -17,9 +17,6 @@ jobs:
|
|||||||
cargocheck:
|
cargocheck:
|
||||||
name: cargo check
|
name: cargo check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
@ -33,7 +30,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run check
|
- name: Run check
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
# We specifically want to test the disable-println feature
|
# We specifically want to test the disable-println feature
|
||||||
# Since it is not enabled by default, we need to specify it
|
# Since it is not enabled by default, we need to specify it
|
||||||
# This is used in kcl-lsp
|
# This is used in kcl-lsp
|
||||||
|
5
.github/workflows/cargo-clippy.yml
vendored
5
.github/workflows/cargo-clippy.yml
vendored
@ -23,9 +23,6 @@ jobs:
|
|||||||
cargoclippy:
|
cargoclippy:
|
||||||
name: cargo clippy
|
name: cargo clippy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: taiki-e/install-action@just
|
- uses: taiki-e/install-action@just
|
||||||
@ -41,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
just lint
|
just lint
|
||||||
# If this fails, run "cargo check" to update Cargo.lock,
|
# If this fails, run "cargo check" to update Cargo.lock,
|
||||||
# then add Cargo.lock to the PR.
|
# then add Cargo.lock to the PR.
|
||||||
|
5
.github/workflows/cargo-fmt.yml
vendored
5
.github/workflows/cargo-fmt.yml
vendored
@ -26,9 +26,6 @@ jobs:
|
|||||||
cargofmt:
|
cargofmt:
|
||||||
name: cargo fmt
|
name: cargo fmt
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
@ -43,6 +40,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Run cargo fmt
|
- name: Run cargo fmt
|
||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
cargo fmt -- --check
|
cargo fmt -- --check
|
||||||
shell: bash
|
shell: bash
|
||||||
|
11
.github/workflows/cargo-test.yml
vendored
11
.github/workflows/cargo-test.yml
vendored
@ -9,14 +9,11 @@ permissions: read-all
|
|||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
name: cargo test of wasm-lib
|
name: cargo test
|
||||||
jobs:
|
jobs:
|
||||||
cargotest:
|
cargotest:
|
||||||
name: cargo test
|
name: cargo test
|
||||||
runs-on: ubuntu-latest-8-cores
|
runs-on: ubuntu-latest-8-cores
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
dir: ['src/wasm-lib']
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install latest rust
|
- name: Install latest rust
|
||||||
@ -45,8 +42,8 @@ jobs:
|
|||||||
- name: cargo test
|
- name: cargo test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
cd "${{ matrix.dir }}"
|
cd rust
|
||||||
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --test-threads=1 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
||||||
env:
|
env:
|
||||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
RUST_MIN_STACK: 10485760000
|
RUST_MIN_STACK: 10485760000
|
||||||
@ -55,7 +52,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{secrets.CODECOV_TOKEN}}
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
flags: wasm-lib
|
flags: rust
|
||||||
verbose: true
|
verbose: true
|
||||||
files: lcov.info
|
files: lcov.info
|
||||||
|
|
||||||
|
22
.github/workflows/check-exampleKcl.yml
vendored
22
.github/workflows/check-exampleKcl.yml
vendored
@ -26,11 +26,21 @@ jobs:
|
|||||||
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;
|
||||||
|
|
||||||
// Post a comment on the PR
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
issue_number,
|
issue_number
|
||||||
body: message,
|
});
|
||||||
});
|
|
||||||
|
const commentExists = comments.some(comment => comment.body === message);
|
||||||
|
|
||||||
|
if (!commentExists) {
|
||||||
|
// Post a comment on the PR
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number,
|
||||||
|
body: message,
|
||||||
|
});
|
||||||
|
}
|
32
.github/workflows/codemirror-lang-kcl.yml
vendored
Normal file
32
.github/workflows/codemirror-lang-kcl.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: CodeMirror Lang KCL
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
yarn-unit-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- run: yarn install
|
||||||
|
working-directory: packages/codemirror-lang-kcl
|
||||||
|
|
||||||
|
- run: yarn tsc
|
||||||
|
working-directory: packages/codemirror-lang-kcl
|
||||||
|
|
||||||
|
- name: run unit tests
|
||||||
|
run: yarn test
|
||||||
|
working-directory: packages/codemirror-lang-kcl
|
81
.github/workflows/e2e-tests.yml
vendored
81
.github/workflows/e2e-tests.yml
vendored
@ -3,7 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
schedule:
|
||||||
|
- cron: 0 * * * * # hourly
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -16,23 +17,6 @@ permissions:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
check-rust-changes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
rust-changed: ${{ steps.filter.outputs.rust }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- id: filter
|
|
||||||
name: Check for Rust changes
|
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
rust:
|
|
||||||
- 'src/wasm-lib/**'
|
|
||||||
|
|
||||||
electron:
|
electron:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
||||||
@ -43,15 +27,29 @@ jobs:
|
|||||||
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
||||||
shardIndex: [1, 2, 3, 4]
|
shardIndex: [1, 2, 3, 4]
|
||||||
shardTotal: [4]
|
shardTotal: [4]
|
||||||
|
# TODO: add ref here for main and latest release tag
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: check-rust-changes
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/create-github-app-token@v1
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||||
|
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
- id: filter
|
||||||
|
name: Check for Rust changes
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
rust:
|
||||||
|
- 'rust/**'
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- uses: KittyCAD/action-install-cli@main
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn
|
run: yarn
|
||||||
@ -66,7 +64,7 @@ jobs:
|
|||||||
run: yarn playwright install --with-deps
|
run: yarn playwright install --with-deps
|
||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
||||||
uses: dawidd6/action-download-artifact@v7
|
uses: dawidd6/action-download-artifact@v7
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
@ -74,24 +72,27 @@ jobs:
|
|||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
workflow: build-and-store-wasm.yml
|
workflow: build-and-store-wasm.yml
|
||||||
branch: main
|
branch: main
|
||||||
path: src/wasm-lib/pkg
|
path: rust/kcl-wasm-lib/pkg
|
||||||
- name: copy wasm blob
|
- name: copy wasm blob
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: github.event_name != 'schedule' && steps.filter.outputs.rust == 'false'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
run: cp rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- name: Cache Wasm (because rust diff)
|
- name: Cache Wasm (because rust diff)
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
- name: OR Cache Wasm (because wasm cache failed)
|
- name: OR Cache Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
- name: install good sed
|
- name: install good sed
|
||||||
if: ${{ startsWith(matrix.os, 'macos') }}
|
if: ${{ startsWith(matrix.os, 'macos') }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -116,23 +117,23 @@ jobs:
|
|||||||
cat /tmp/vector.toml
|
cat /tmp/vector.toml
|
||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||||
- name: Build Wasm (because rust diff)
|
- name: Build Wasm (because rust diff)
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: github.event_name == 'schedule' || steps.filter.outputs.rust == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: OR Build Wasm (because wasm cache failed)
|
- name: OR Build Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build electron
|
- name: build web
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn tron:package
|
run: yarn tronb:vite:dev
|
||||||
- name: Run ubuntu/chrome snapshots
|
- name: Run ubuntu/chrome snapshots
|
||||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||||
shell: bash
|
shell: bash
|
||||||
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
||||||
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
||||||
run: |
|
run: |
|
||||||
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1
|
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --trace=on --shard=1/1
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
@ -143,7 +144,7 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
if: ${{ !cancelled() && (success() || failure()) }}
|
||||||
with:
|
with:
|
||||||
name: playwright-report-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
|
name: playwright-report-snapshots-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
@ -153,11 +154,11 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: rm -r test-results
|
run: rm -r test-results
|
||||||
- name: check for changes
|
- name: check for changes
|
||||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
id: git-check
|
id: git-check
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||||
if git status | grep -q "Changes to be committed"
|
if git status | grep -q "Changes to be committed"
|
||||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||||
@ -166,14 +167,14 @@ jobs:
|
|||||||
if: steps.git-check.outputs.modified == 'true'
|
if: steps.git-check.outputs.modified == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||||
git fetch origin
|
git fetch origin
|
||||||
echo ${{ github.head_ref }}
|
echo ${{ github.head_ref }}
|
||||||
git checkout ${{ github.head_ref }}
|
git checkout ${{ github.head_ref }}
|
||||||
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
|
git commit -m "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
|
||||||
git push
|
git push
|
||||||
git push origin ${{ github.head_ref }}
|
git push origin ${{ github.head_ref }}
|
||||||
# only upload artifacts if there's actually changes
|
# only upload artifacts if there's actually changes
|
||||||
@ -193,9 +194,11 @@ jobs:
|
|||||||
- name: Run playwright/electron flow (with retries)
|
- name: Run playwright/electron flow (with retries)
|
||||||
id: retry
|
id: retry
|
||||||
if: ${{ !cancelled() && (success() || failure()) }}
|
if: ${{ !cancelled() && (success() || failure()) }}
|
||||||
shell: bash
|
uses: nick-fields/retry@v3.0.1
|
||||||
run: |
|
with:
|
||||||
.github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
||||||
|
timeout_minutes: 30
|
||||||
|
max_attempts: 25
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
FAIL_ON_CONSOLE_ERRORS: true
|
FAIL_ON_CONSOLE_ERRORS: true
|
||||||
|
179
.github/workflows/kcl-python-bindings.yml
vendored
Normal file
179
.github/workflows/kcl-python-bindings.yml
vendored
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
# This file is autogenerated by maturin v1.6.0 and then modified
|
||||||
|
# To update, run
|
||||||
|
#
|
||||||
|
# maturin generate-ci github
|
||||||
|
#
|
||||||
|
name: kcl-python-bindings
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- 'rust/kcl-python-bindings/**'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/kcl-python-bindings.yml
|
||||||
|
tags:
|
||||||
|
- 'kcl-*'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- 'rust/kcl-python-bindings/**'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/kcl-python-bindings.yml
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linux-x86_64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: x86_64
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
manylinux: auto
|
||||||
|
before-script-linux: |
|
||||||
|
yum install openssl-devel -y
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-linux-x86_64
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
windows:
|
||||||
|
runs-on: windows-16-cores
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x64
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
architecture: ${{ matrix.target }}
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-windows-${{ matrix.target }}
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x86_64
|
||||||
|
- aarch64
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- name: Build wheels
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
args: --release --out dist --find-interpreter
|
||||||
|
sccache: 'true'
|
||||||
|
- name: Upload wheels
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-macos-${{ matrix.target }}
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
- uses: taiki-e/install-action@just
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd rust/kcl-python-bindings
|
||||||
|
just setup-uv
|
||||||
|
just test
|
||||||
|
env:
|
||||||
|
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
|
||||||
|
sdist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install the latest version of uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- name: Install codespell
|
||||||
|
run: |
|
||||||
|
uv venv .venv
|
||||||
|
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||||
|
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||||
|
uv pip install pip --upgrade
|
||||||
|
- name: Build sdist
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
command: sdist
|
||||||
|
args: --out dist
|
||||||
|
- name: Upload sdist
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-sdist
|
||||||
|
path: rust/kcl-python-bindings/dist
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
needs: [linux-x86_64, windows, macos, sdist]
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
- name: Install the latest version of uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
- name: Install codespell
|
||||||
|
run: |
|
||||||
|
cd rust/kcl-python-bindings
|
||||||
|
uv venv .venv
|
||||||
|
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||||
|
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||||
|
uv pip install pip --upgrade
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: PyO3/maturin-action@v1
|
||||||
|
env:
|
||||||
|
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
with:
|
||||||
|
working-directory: rust/kcl-python-bindings
|
||||||
|
command: upload
|
||||||
|
args: --non-interactive --skip-existing wheels-*/*
|
6
.github/workflows/publish-apps-release.yml
vendored
6
.github/workflows/publish-apps-release.yml
vendored
@ -108,17 +108,17 @@ jobs:
|
|||||||
run: yarn files:set-notes
|
run: yarn files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
uses: 'google-github-actions/auth@v2.1.7'
|
uses: 'google-github-actions/auth@v2.1.8'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||||
|
|
||||||
- name: Set up Google Cloud SDK
|
- name: Set up Google Cloud SDK
|
||||||
uses: google-github-actions/setup-gcloud@v2.1.2
|
uses: google-github-actions/setup-gcloud@v2.1.4
|
||||||
with:
|
with:
|
||||||
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
project_id: ${{ env.GOOGLE_CLOUD_PROJECT_ID }}
|
||||||
|
|
||||||
- name: Upload release files to public bucket
|
- name: Upload release files to public bucket
|
||||||
uses: google-github-actions/upload-cloud-storage@v2.2.1
|
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
||||||
with:
|
with:
|
||||||
path: out
|
path: out
|
||||||
glob: '*'
|
glob: '*'
|
||||||
|
24
.github/workflows/ruff.yml
vendored
Normal file
24
.github/workflows/ruff.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: ruff
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: main
|
||||||
|
paths:
|
||||||
|
- '**.py'
|
||||||
|
- .github/workflows/ruff.yml
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.py'
|
||||||
|
- .github/workflows/ruff.yml
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
jobs:
|
||||||
|
ruff:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/ruff-action@v3
|
||||||
|
|
14
.github/workflows/static-analysis.yml
vendored
14
.github/workflows/static-analysis.yml
vendored
@ -37,6 +37,9 @@ jobs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
yarn-tsc:
|
yarn-tsc:
|
||||||
@ -51,8 +54,11 @@ jobs:
|
|||||||
- run: yarn install
|
- run: yarn install
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './rust'
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
- run: yarn tsc
|
- run: yarn tsc
|
||||||
|
|
||||||
@ -92,6 +98,9 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: yarn simpleserver:bg
|
||||||
@ -118,6 +127,9 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
- uses: taiki-e/install-action@2dbeb927f58939d3aa13bf06ba0c0a34b76b9bfb
|
||||||
|
with:
|
||||||
|
tool: wasm-pack
|
||||||
- run: yarn build:wasm
|
- run: yarn build:wasm
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: yarn simpleserver:bg
|
||||||
|
39
.github/workflows/tag-nightly.yml
vendored
Normal file
39
.github/workflows/tag-nightly.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: tag-nightly
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 4 * * *'
|
||||||
|
# Daily at 04:00 AM UTC
|
||||||
|
# Will checkout the last commit from the default branch (main as of 2023-10-04)
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag-nightly:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/create-github-app-token@v1
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||||
|
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
|
- run: yarn install
|
||||||
|
|
||||||
|
- name: Push tag
|
||||||
|
run: |
|
||||||
|
VERSION_NO_V=$(date +'%-y.%-m.%-d')
|
||||||
|
TAG="nightly-v$VERSION_NO_V"
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git tag $TAG
|
||||||
|
git push origin tag $TAG
|
30
.gitignore
vendored
30
.gitignore
vendored
@ -25,26 +25,29 @@ yarn-error.log*
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
src/wasm-lib/.idea
|
.helix
|
||||||
src/wasm-lib/.vscode
|
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
src/wasm-lib/target
|
rust/target
|
||||||
src/wasm-lib/bindings
|
rust/kcl-lib/bindings
|
||||||
src/wasm-lib/kcl/bindings
|
public/kcl_wasm_lib_bg.wasm
|
||||||
public/wasm_lib_bg.wasm
|
rust/lcov.info
|
||||||
src/wasm-lib/lcov.info
|
rust/kcl-wasm-lib/pkg
|
||||||
src/wasm-lib/grackle/test_json_output
|
*.snap.new
|
||||||
|
rust/kcl-lib/fuzz/Cargo.lock
|
||||||
|
|
||||||
e2e/playwright/playwright-secrets.env
|
e2e/playwright/playwright-secrets.env
|
||||||
e2e/playwright/temp1.png
|
e2e/playwright/temp1.png
|
||||||
e2e/playwright/temp2.png
|
e2e/playwright/temp2.png
|
||||||
e2e/playwright/temp3.png
|
e2e/playwright/temp3.png
|
||||||
|
# this will be overridden for specific directories
|
||||||
|
e2e/playwright/**/*.png
|
||||||
# exports from snapshot-tests.spec.ts "exports of each format should work"
|
# exports from snapshot-tests.spec.ts "exports of each format should work"
|
||||||
e2e/playwright/export-snapshots/*
|
e2e/playwright/export-snapshots/*
|
||||||
!e2e/playwright/export-snapshots/*.png
|
!e2e/playwright/export-snapshots/*.png
|
||||||
|
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
||||||
|
|
||||||
|
/kcl-samples
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
/blob-report/
|
/blob-report/
|
||||||
@ -55,15 +58,18 @@ e2e/playwright/export-snapshots/*
|
|||||||
## generated files
|
## generated files
|
||||||
src/**/*.typegen.ts
|
src/**/*.typegen.ts
|
||||||
|
|
||||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
|
||||||
Mac_App_Distribution.provisionprofile
|
Mac_App_Distribution.provisionprofile
|
||||||
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
src/wasm-lib/pkg
|
|
||||||
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
venv
|
|
||||||
.vite/
|
.vite/
|
||||||
|
|
||||||
# electron
|
# electron
|
||||||
out/
|
out/
|
||||||
|
|
||||||
|
# python
|
||||||
|
__pycache__/
|
||||||
|
uv.lock
|
||||||
|
rust/kcl-python-bindings/dist
|
||||||
|
venv
|
||||||
|
2
.helix/config.toml
Normal file
2
.helix/config.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[editor]
|
||||||
|
auto-format = true
|
10
.helix/languages.toml
Normal file
10
.helix/languages.toml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[language-server.eslint]
|
||||||
|
args = ["--stdio"]
|
||||||
|
command = "vscode-eslint-language-server"
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "typescript"
|
||||||
|
auto-format = true
|
||||||
|
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
|
||||||
|
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
||||||
|
|
@ -7,9 +7,9 @@ coverage
|
|||||||
*.rs
|
*.rs
|
||||||
*.hbs
|
*.hbs
|
||||||
target
|
target
|
||||||
src/wasm-lib/pkg
|
rust/
|
||||||
src/wasm-lib/kcl/bindings
|
|
||||||
e2e/playwright/export-snapshots
|
e2e/playwright/export-snapshots
|
||||||
|
e2e/playwright/snapshots/prompt-to-edit
|
||||||
|
|
||||||
|
|
||||||
# XState generated files
|
# XState generated files
|
||||||
|
4
Makefile
4
Makefile
@ -1,6 +1,6 @@
|
|||||||
.PHONY: dev
|
.PHONY: dev
|
||||||
|
|
||||||
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
|
KCL_WASM_LIB_FILES := $(wildcard rust/**/*.rs)
|
||||||
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||||
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ lee-electron-test:
|
|||||||
$(XSTATE_TYPEGENS): $(TS_SRC)
|
$(XSTATE_TYPEGENS): $(TS_SRC)
|
||||||
yarn xstate typegen 'src/**/*.ts?(x)'
|
yarn xstate typegen 'src/**/*.ts?(x)'
|
||||||
|
|
||||||
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
|
public/kcl_wasm_lib_bg.wasm: $(KCL_WASM_LIB_FILES)
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
|
|
||||||
node_modules: package.json yarn.lock
|
node_modules: package.json yarn.lock
|
||||||
|
73
README.md
73
README.md
@ -40,7 +40,7 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
|
|||||||
|
|
||||||
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
|
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
|
||||||
|
|
||||||
[Original demo slides](https://github.com/KittyCAD/Eng/files/10398178/demo.pdf)
|
[Original demo slides](https://github.com/user-attachments/files/19010536/demo.pdf)
|
||||||
|
|
||||||
## Get started
|
## Get started
|
||||||
|
|
||||||
@ -48,22 +48,53 @@ We recommend downloading the latest application binary from [our Releases page](
|
|||||||
|
|
||||||
## Running a development build
|
## Running a development build
|
||||||
|
|
||||||
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We always use the latest stable version of Rust, so you may need to run `rustup update stable`. Then, run:
|
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
|
||||||
|
|
||||||
|
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
|
||||||
|
|
||||||
|
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
|
||||||
|
|
||||||
|
```
|
||||||
|
fnm install --corepack-enabled
|
||||||
|
fnm use
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the NPM dependencies with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
followed by:
|
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
|
||||||
|
yarn install:rust
|
||||||
|
yarn install:wasm-pack:sh
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
yarn install:rust:windows
|
||||||
|
yarn install:wasm-pack:cargo
|
||||||
|
```
|
||||||
|
|
||||||
|
Then to build the WASM layer, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
# macOS/Linux
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
yarn build:wasm:windows
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you have the gh cli installed
|
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`.
|
||||||
|
|
||||||
```
|
```
|
||||||
./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle
|
# macOS/Linux
|
||||||
|
yarn fetch:wasm
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
yarn 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).
|
||||||
@ -74,7 +105,7 @@ Finally, to run the web app only, run:
|
|||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not an KittyCAD employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` 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` 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.
|
||||||
|
|
||||||
### Development environment variables
|
### Development environment variables
|
||||||
|
|
||||||
@ -101,13 +132,14 @@ This will start the application and hot-reload on changes.
|
|||||||
|
|
||||||
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To build, run `yarn tron:package`.
|
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)
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
Which commands from setup are one off vs need to be run every time?
|
Which commands from setup are one off vs need to be run every time?
|
||||||
|
|
||||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
yarn install
|
||||||
yarn build:wasm
|
yarn build:wasm
|
||||||
@ -158,11 +190,12 @@ Manually test against this [list](https://github.com/KittyCAD/modeling-app/issue
|
|||||||
|
|
||||||
##### Updater-test builds
|
##### Updater-test builds
|
||||||
|
|
||||||
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
|
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
|
||||||
|
|
||||||
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
|
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
|
||||||
|
|
||||||
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
|
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
|
||||||
|
|
||||||
```
|
```
|
||||||
# Windows (PowerShell)
|
# Windows (PowerShell)
|
||||||
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
||||||
@ -178,15 +211,14 @@ If the prompt doesn't show up, start the app in command line to grab the electro
|
|||||||
|
|
||||||
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
|
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
|
||||||
|
|
||||||
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
|
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
|
||||||
|
|
||||||
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
|
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
|
||||||
|
|
||||||
#### 5. Close the issue
|
#### 5. Close the issue
|
||||||
|
|
||||||
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
||||||
|
|
||||||
|
|
||||||
## Fuzzing the parser
|
## Fuzzing the parser
|
||||||
|
|
||||||
Make sure you install cargo fuzz:
|
Make sure you install cargo fuzz:
|
||||||
@ -196,7 +228,7 @@ $ cargo install cargo-fuzz
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd src/wasm-lib/kcl
|
$ cd rust/kcl-lib
|
||||||
|
|
||||||
# list the fuzz targets
|
# list the fuzz targets
|
||||||
$ cargo fuzz list
|
$ cargo fuzz list
|
||||||
@ -224,6 +256,7 @@ snapshottoken=<your-snapshot-token>
|
|||||||
For a portable way to run Playwright you'll need Docker.
|
For a portable way to run Playwright you'll need Docker.
|
||||||
|
|
||||||
#### Generic example
|
#### Generic example
|
||||||
|
|
||||||
After that, open a terminal and run:
|
After that, open a terminal and run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -236,7 +269,6 @@ and in another terminal, run:
|
|||||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Specific example
|
#### Specific example
|
||||||
|
|
||||||
open a terminal and run:
|
open a terminal and run:
|
||||||
@ -254,7 +286,6 @@ PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project=
|
|||||||
run a specific test change the test from `test('...` to `test.only('...`
|
run a specific test change the test from `test('...` to `test.only('...`
|
||||||
(note if you commit this, the tests will instantly fail without running any of the tests)
|
(note if you commit this, the tests will instantly fail without running any of the tests)
|
||||||
|
|
||||||
|
|
||||||
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
|
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
|
||||||
|
|
||||||
run headed
|
run headed
|
||||||
@ -348,17 +379,19 @@ Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testin
|
|||||||
- `just`
|
- `just`
|
||||||
|
|
||||||
#### Setting KITTYCAD_API_TOKEN
|
#### Setting KITTYCAD_API_TOKEN
|
||||||
|
|
||||||
Use the production zoo.dev token, set this environment variable before running the tests
|
Use the production zoo.dev token, set this environment variable before running the tests
|
||||||
|
|
||||||
#### Installing cargonextest
|
#### Installing cargonextest
|
||||||
|
|
||||||
```
|
```
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
cargo search cargo-nextest
|
cargo search cargo-nextest
|
||||||
cargo install cargo-nextest
|
cargo install cargo-nextest
|
||||||
```
|
```
|
||||||
|
|
||||||
#### just
|
#### just
|
||||||
|
|
||||||
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
||||||
|
|
||||||
#### Running the tests
|
#### Running the tests
|
||||||
@ -368,7 +401,7 @@ install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-bina
|
|||||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||||
# Make sure you installed cargo-nextest
|
# Make sure you installed cargo-nextest
|
||||||
# Make sure you installed just
|
# Make sure you installed just
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
just test
|
just test
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -376,7 +409,7 @@ just test
|
|||||||
# Without just
|
# Without just
|
||||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||||
# Make sure you installed cargo-nextest
|
# Make sure you installed cargo-nextest
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -385,13 +418,14 @@ Where `XXX` is an API token from the production engine (NOT the dev environment)
|
|||||||
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
||||||
|
|
||||||
```
|
```
|
||||||
cd src/wasm-lib
|
cd rust
|
||||||
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mapping CI CD jobs to local commands
|
### Mapping CI CD jobs to local commands
|
||||||
|
|
||||||
When you see the CI CD fail on jobs you may wonder three things
|
When you see the CI CD fail on jobs you may wonder three things
|
||||||
|
|
||||||
- Do I have a bug in my code?
|
- Do I have a bug in my code?
|
||||||
- Is the test flaky?
|
- Is the test flaky?
|
||||||
- Is there a bug in `main`?
|
- Is there a bug in `main`?
|
||||||
@ -410,7 +444,6 @@ yarn test-setup
|
|||||||
|
|
||||||
> Gotcha, are packages up to date and is the wasm built?
|
> Gotcha, are packages up to date and is the wasm built?
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tsc
|
yarn tsc
|
||||||
yarn fmt-check
|
yarn fmt-check
|
||||||
@ -466,7 +499,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
|||||||
|
|
||||||
## KCL
|
## KCL
|
||||||
|
|
||||||
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl).
|
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib).
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
||||||
|
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
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
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
@ -9,7 +9,10 @@ Check a value at runtime, and raise an error if the argument provided
|
|||||||
is false.
|
is false.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(data: bool, message: string) -> ()
|
assert(
|
||||||
|
data: bool,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -22,7 +25,7 @@ assert(data: bool, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,12 @@ Check that a numerical value equals another at runtime,
|
|||||||
otherwise raise an error.
|
otherwise raise an error.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
|
assertEqual(
|
||||||
|
left: number,
|
||||||
|
right: number,
|
||||||
|
epsilon: number,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -24,7 +29,7 @@ assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,11 @@ Check that a numerical value is greater than another at runtime,
|
|||||||
otherwise raise an error.
|
otherwise raise an error.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assertGreaterThan(left: number, right: number, message: string) -> ()
|
assertGreaterThan(
|
||||||
|
left: number,
|
||||||
|
right: number,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +27,7 @@ assertGreaterThan(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,11 @@ Check that a numerical value is greater than or equal to another at runtime,
|
|||||||
otherwise raise an error.
|
otherwise raise an error.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
|
assertGreaterThanOrEq(
|
||||||
|
left: number,
|
||||||
|
right: number,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +27,7 @@ assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,11 @@ Check that a numerical value is less than to another at runtime,
|
|||||||
otherwise raise an error.
|
otherwise raise an error.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assertLessThan(left: number, right: number, message: string) -> ()
|
assertLessThan(
|
||||||
|
left: number,
|
||||||
|
right: number,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +27,7 @@ assertLessThan(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,11 @@ Check that a numerical value is less than or equal to another at runtime,
|
|||||||
otherwise raise an error.
|
otherwise raise an error.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assertLessThanOrEq(left: number, right: number, message: string) -> ()
|
assertLessThanOrEq(
|
||||||
|
left: number,
|
||||||
|
right: number,
|
||||||
|
message: string,
|
||||||
|
) -> ()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +27,7 @@ assertLessThanOrEq(left: number, right: number, message: string) -> ()
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`()`
|
`()`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
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
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
@ -26,7 +26,7 @@ cm() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
15
docs/kcl/const_std-HALF_TURN.md
Normal file
15
docs/kcl/const_std-HALF_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::HALF_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::HALF_TURN: number(deg) = 180deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-QUARTER_TURN.md
Normal file
15
docs/kcl/const_std-QUARTER_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::QUARTER_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::QUARTER_TURN: number(deg) = 90deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-THREE_QUARTER_TURN.md
Normal file
15
docs/kcl/const_std-THREE_QUARTER_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::THREE_QUARTER_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-XY.md
Normal file
15
docs/kcl/const_std-XY.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::XY"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::XY
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-XZ.md
Normal file
15
docs/kcl/const_std-XZ.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::XZ"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::XZ
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-YZ.md
Normal file
15
docs/kcl/const_std-YZ.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::YZ"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::YZ
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/const_std-ZERO.md
Normal file
15
docs/kcl/const_std-ZERO.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::ZERO"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::ZERO: number = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
|
32
docs/kcl/const_std-math-E.md
Normal file
32
docs/kcl/const_std-math-E.md
Normal file
File diff suppressed because one or more lines are too long
28
docs/kcl/const_std-math-PI.md
Normal file
28
docs/kcl/const_std-math-PI.md
Normal file
File diff suppressed because one or more lines are too long
32
docs/kcl/const_std-math-TAU.md
Normal file
32
docs/kcl/const_std-math-TAU.md
Normal file
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
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@ ft() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
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
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
@ -26,7 +26,7 @@ inch() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -6,116 +6,131 @@ layout: manual
|
|||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [Types](kcl/types)
|
### Language
|
||||||
* [Modules](kcl/modules)
|
|
||||||
* [Known Issues](kcl/KNOWN-ISSUES)
|
* [`Types`](kcl/types)
|
||||||
* [`abs`](kcl/abs)
|
* [`Modules`](kcl/modules)
|
||||||
* [`acos`](kcl/acos)
|
* [`Settings`](kcl/settings)
|
||||||
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
* [`Known Issues`](kcl/known-issues)
|
||||||
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
|
||||||
* [`angledLine`](kcl/angledLine)
|
### Standard library
|
||||||
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
|
||||||
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
* **`std`**
|
||||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
* [`HALF_TURN`](kcl/const_std-HALF_TURN)
|
||||||
* [`angledLineToX`](kcl/angledLineToX)
|
* [`QUARTER_TURN`](kcl/const_std-QUARTER_TURN)
|
||||||
* [`angledLineToY`](kcl/angledLineToY)
|
* [`THREE_QUARTER_TURN`](kcl/const_std-THREE_QUARTER_TURN)
|
||||||
* [`appearance`](kcl/appearance)
|
* [`XY`](kcl/const_std-XY)
|
||||||
* [`arc`](kcl/arc)
|
* [`XZ`](kcl/const_std-XZ)
|
||||||
* [`arcTo`](kcl/arcTo)
|
* [`YZ`](kcl/const_std-YZ)
|
||||||
* [`asin`](kcl/asin)
|
* [`ZERO`](kcl/const_std-ZERO)
|
||||||
* [`assert`](kcl/assert)
|
* [`abs`](kcl/abs)
|
||||||
* [`assertEqual`](kcl/assertEqual)
|
* [`acos`](kcl/acos)
|
||||||
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
||||||
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
||||||
* [`assertLessThan`](kcl/assertLessThan)
|
* [`angledLine`](kcl/angledLine)
|
||||||
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
||||||
* [`atan`](kcl/atan)
|
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
||||||
* [`atan2`](kcl/atan2)
|
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||||
* [`bezierCurve`](kcl/bezierCurve)
|
* [`angledLineToX`](kcl/angledLineToX)
|
||||||
* [`ceil`](kcl/ceil)
|
* [`angledLineToY`](kcl/angledLineToY)
|
||||||
* [`chamfer`](kcl/chamfer)
|
* [`appearance`](kcl/appearance)
|
||||||
* [`circle`](kcl/circle)
|
* [`arc`](kcl/arc)
|
||||||
* [`circleThreePoint`](kcl/circleThreePoint)
|
* [`arcTo`](kcl/arcTo)
|
||||||
* [`close`](kcl/close)
|
* [`asin`](kcl/asin)
|
||||||
* [`cm`](kcl/cm)
|
* [`assert`](kcl/assert)
|
||||||
* [`cos`](kcl/cos)
|
* [`assertEqual`](kcl/assertEqual)
|
||||||
* [`e`](kcl/e)
|
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
||||||
* [`extrude`](kcl/extrude)
|
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
||||||
* [`fillet`](kcl/fillet)
|
* [`assertLessThan`](kcl/assertLessThan)
|
||||||
* [`floor`](kcl/floor)
|
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
||||||
* [`ft`](kcl/ft)
|
* [`atan`](kcl/atan)
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`atan2`](kcl/atan2)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`bezierCurve`](kcl/bezierCurve)
|
||||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
* [`ceil`](kcl/ceil)
|
||||||
* [`helix`](kcl/helix)
|
* [`chamfer`](kcl/chamfer)
|
||||||
* [`helixRevolutions`](kcl/helixRevolutions)
|
* [`circle`](kcl/circle)
|
||||||
* [`hole`](kcl/hole)
|
* [`circleThreePoint`](kcl/circleThreePoint)
|
||||||
* [`hollow`](kcl/hollow)
|
* [`close`](kcl/close)
|
||||||
* [`import`](kcl/import)
|
* [`cm`](kcl/cm)
|
||||||
* [`inch`](kcl/inch)
|
* [`extrude`](kcl/extrude)
|
||||||
* [`int`](kcl/int)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`floor`](kcl/floor)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`ft`](kcl/ft)
|
||||||
* [`legAngX`](kcl/legAngX)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`legAngY`](kcl/legAngY)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
* [`legLen`](kcl/legLen)
|
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||||
* [`line`](kcl/line)
|
* [`helix`](kcl/helix)
|
||||||
* [`lineTo`](kcl/lineTo)
|
* [`helixRevolutions`](kcl/helixRevolutions)
|
||||||
* [`ln`](kcl/ln)
|
* [`hole`](kcl/hole)
|
||||||
* [`loft`](kcl/loft)
|
* [`hollow`](kcl/hollow)
|
||||||
* [`log`](kcl/log)
|
* [`inch`](kcl/inch)
|
||||||
* [`log10`](kcl/log10)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`log2`](kcl/log2)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
* [`m`](kcl/m)
|
* [`legAngX`](kcl/legAngX)
|
||||||
* [`map`](kcl/map)
|
* [`legAngY`](kcl/legAngY)
|
||||||
* [`max`](kcl/max)
|
* [`legLen`](kcl/legLen)
|
||||||
* [`min`](kcl/min)
|
* [`line`](kcl/line)
|
||||||
* [`mirror2d`](kcl/mirror2d)
|
* [`ln`](kcl/ln)
|
||||||
* [`mm`](kcl/mm)
|
* [`loft`](kcl/loft)
|
||||||
* [`offsetPlane`](kcl/offsetPlane)
|
* [`log`](kcl/log)
|
||||||
* [`patternCircular2d`](kcl/patternCircular2d)
|
* [`log10`](kcl/log10)
|
||||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
* [`log2`](kcl/log2)
|
||||||
* [`patternLinear2d`](kcl/patternLinear2d)
|
* [`m`](kcl/m)
|
||||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
* [`map`](kcl/map)
|
||||||
* [`patternTransform`](kcl/patternTransform)
|
* [`max`](kcl/max)
|
||||||
* [`patternTransform2d`](kcl/patternTransform2d)
|
* [`min`](kcl/min)
|
||||||
* [`pi`](kcl/pi)
|
* [`mirror2d`](kcl/mirror2d)
|
||||||
* [`polar`](kcl/polar)
|
* [`mm`](kcl/mm)
|
||||||
* [`polygon`](kcl/polygon)
|
* [`offsetPlane`](kcl/offsetPlane)
|
||||||
* [`pop`](kcl/pop)
|
* [`patternCircular2d`](kcl/patternCircular2d)
|
||||||
* [`pow`](kcl/pow)
|
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||||
* [`profileStart`](kcl/profileStart)
|
* [`patternLinear2d`](kcl/patternLinear2d)
|
||||||
* [`profileStartX`](kcl/profileStartX)
|
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||||
* [`profileStartY`](kcl/profileStartY)
|
* [`patternTransform`](kcl/patternTransform)
|
||||||
* [`push`](kcl/push)
|
* [`patternTransform2d`](kcl/patternTransform2d)
|
||||||
* [`reduce`](kcl/reduce)
|
* [`polar`](kcl/polar)
|
||||||
* [`rem`](kcl/rem)
|
* [`polygon`](kcl/polygon)
|
||||||
* [`revolve`](kcl/revolve)
|
* [`pop`](kcl/pop)
|
||||||
* [`round`](kcl/round)
|
* [`pow`](kcl/pow)
|
||||||
* [`segAng`](kcl/segAng)
|
* [`profileStart`](kcl/profileStart)
|
||||||
* [`segEnd`](kcl/segEnd)
|
* [`profileStartX`](kcl/profileStartX)
|
||||||
* [`segEndX`](kcl/segEndX)
|
* [`profileStartY`](kcl/profileStartY)
|
||||||
* [`segEndY`](kcl/segEndY)
|
* [`push`](kcl/push)
|
||||||
* [`segLen`](kcl/segLen)
|
* [`reduce`](kcl/reduce)
|
||||||
* [`segStart`](kcl/segStart)
|
* [`rem`](kcl/rem)
|
||||||
* [`segStartX`](kcl/segStartX)
|
* [`revolve`](kcl/revolve)
|
||||||
* [`segStartY`](kcl/segStartY)
|
* [`rotate`](kcl/rotate)
|
||||||
* [`shell`](kcl/shell)
|
* [`round`](kcl/round)
|
||||||
* [`sin`](kcl/sin)
|
* [`scale`](kcl/scale)
|
||||||
* [`sqrt`](kcl/sqrt)
|
* [`segAng`](kcl/segAng)
|
||||||
* [`startProfileAt`](kcl/startProfileAt)
|
* [`segEnd`](kcl/segEnd)
|
||||||
* [`startSketchOn`](kcl/startSketchOn)
|
* [`segEndX`](kcl/segEndX)
|
||||||
* [`sweep`](kcl/sweep)
|
* [`segEndY`](kcl/segEndY)
|
||||||
* [`tan`](kcl/tan)
|
* [`segLen`](kcl/segLen)
|
||||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
* [`segStart`](kcl/segStart)
|
||||||
* [`tangentialArc`](kcl/tangentialArc)
|
* [`segStartX`](kcl/segStartX)
|
||||||
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
* [`segStartY`](kcl/segStartY)
|
||||||
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
* [`shell`](kcl/shell)
|
||||||
* [`tau`](kcl/tau)
|
* [`sqrt`](kcl/sqrt)
|
||||||
* [`toDegrees`](kcl/toDegrees)
|
* [`startProfileAt`](kcl/startProfileAt)
|
||||||
* [`toRadians`](kcl/toRadians)
|
* [`startSketchOn`](kcl/startSketchOn)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`sweep`](kcl/sweep)
|
||||||
* [`xLineTo`](kcl/xLineTo)
|
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||||
* [`yLine`](kcl/yLine)
|
* [`tangentialArc`](kcl/tangentialArc)
|
||||||
* [`yLineTo`](kcl/yLineTo)
|
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
||||||
* [`yd`](kcl/yd)
|
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
||||||
|
* [`toDegrees`](kcl/toDegrees)
|
||||||
|
* [`toRadians`](kcl/toRadians)
|
||||||
|
* [`translate`](kcl/translate)
|
||||||
|
* [`xLine`](kcl/xLine)
|
||||||
|
* [`xLineTo`](kcl/xLineTo)
|
||||||
|
* [`yLine`](kcl/yLine)
|
||||||
|
* [`yLineTo`](kcl/yLineTo)
|
||||||
|
* [`yd`](kcl/yd)
|
||||||
|
* **`std::math`**
|
||||||
|
* [`E`](kcl/const_std-math-E)
|
||||||
|
* [`PI`](kcl/const_std-math-PI)
|
||||||
|
* [`TAU`](kcl/const_std-math-TAU)
|
||||||
|
* [`cos`](kcl/std-math-cos)
|
||||||
|
* [`sin`](kcl/std-math-sin)
|
||||||
|
* [`tan`](kcl/std-math-tan)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -24,5 +24,3 @@ once fixed in engine will just start working here with no language changes.
|
|||||||
chamfer cases work currently.
|
chamfer cases work currently.
|
||||||
|
|
||||||
- **Appearance**: Changing the appearance on a loft does not work.
|
- **Appearance**: Changing the appearance on a loft does not work.
|
||||||
|
|
||||||
- **Helix**: Currently sweeping a helix does not work.
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,7 +9,10 @@ Compute the angle of the given leg for x.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
legAngX(hypotenuse: number, leg: number) -> number
|
legAngX(
|
||||||
|
hypotenuse: number,
|
||||||
|
leg: number,
|
||||||
|
) -> number
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -26,7 +29,7 @@ legAngX(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,10 @@ Compute the angle of the given leg for y.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
legAngY(hypotenuse: number, leg: number) -> number
|
legAngY(
|
||||||
|
hypotenuse: number,
|
||||||
|
leg: number,
|
||||||
|
) -> number
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -26,7 +29,7 @@ legAngY(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,10 @@ Compute the length of the given leg.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
legLen(hypotenuse: number, leg: number) -> number
|
legLen(
|
||||||
|
hypotenuse: number,
|
||||||
|
leg: number,
|
||||||
|
) -> number
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
@ -26,7 +29,7 @@ legLen(hypotenuse: number, leg: number) -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@ m() -> number
|
|||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
`number`
|
`number`
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
@ -9,7 +9,10 @@ Apply a function to every element of a list.
|
|||||||
Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`
|
Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
map(array: [KclValue], map_fn: FunctionParam) -> [KclValue]
|
map(
|
||||||
|
array: [KclValue],
|
||||||
|
mapFn: FunctionSource,
|
||||||
|
) -> [KclValue]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -18,11 +21,11 @@ map(array: [KclValue], map_fn: FunctionParam) -> [KclValue]
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
| `array` | [`[KclValue]`](/docs/kcl/types/KclValue) | | Yes |
|
||||||
| `map_fn` | `FunctionParam` | | Yes |
|
| `mapFn` | `FunctionSource` | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
[`[KclValue]`](/docs/kcl/types/KclValue)
|
[`[KclValue]`](/docs/kcl/types/KclValue)
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -31,7 +34,7 @@ map(array: [KclValue], map_fn: FunctionParam) -> [KclValue]
|
|||||||
r = 10 // radius
|
r = 10 // radius
|
||||||
fn drawCircle(id) {
|
fn drawCircle(id) {
|
||||||
return startSketchOn("XY")
|
return startSketchOn("XY")
|
||||||
|> circle({ center = [id * 2 * r, 0], radius = r }, %)
|
|> circle(center = [id * 2 * r, 0], radius = r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call `drawCircle`, passing in each element of the array.
|
// Call `drawCircle`, passing in each element of the array.
|
||||||
@ -47,7 +50,7 @@ r = 10 // radius
|
|||||||
// Call `map`, using an anonymous function instead of a named one.
|
// Call `map`, using an anonymous function instead of a named one.
|
||||||
circles = map([1..3], fn(id) {
|
circles = map([1..3], fn(id) {
|
||||||
return startSketchOn("XY")
|
return startSketchOn("XY")
|
||||||
|> circle({ center = [id * 2 * r, 0], radius = r }, %)
|
|> circle(center = [id * 2 * r, 0], radius = r)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user