Compare commits
182 Commits
ascii
...
updater-te
Author | SHA1 | Date | |
---|---|---|---|
73045811b4 | |||
d9be308c36 | |||
3cca4a30af | |||
c51db5bd4a | |||
7fce38b212 | |||
d0e9b111af | |||
add1b21503 | |||
39af110ac1 | |||
bf7ec424a7 | |||
6c7e42b541 | |||
542a9a3f13 | |||
264779a9d0 | |||
22dd4a67dd | |||
5c188664bd | |||
f6e23fe619 | |||
160f55ede5 | |||
7d7b153085 | |||
8f487a441b | |||
c8cee6a0dc | |||
167445ef8a | |||
95b72d839b | |||
9365186bed | |||
eea026f8e0 | |||
3cd7a3533e | |||
9e1f1152e3 | |||
60d2be9ff2 | |||
0f59894d66 | |||
74c07fc0eb | |||
67a8bf525d | |||
129b91518f | |||
c0aa763c3b | |||
319c60d4fa | |||
66f95d25f6 | |||
72ab72cea1 | |||
4e1e9f9c6e | |||
8b14d32879 | |||
7c5170dc16 | |||
a07dbc3aac | |||
7d3294ff78 | |||
121c393466 | |||
c6ec54c138 | |||
1f6b90d383 | |||
c45c2e27ba | |||
5832890dbb | |||
6f2e6d14b6 | |||
0d899694b2 | |||
7bd5e7365d | |||
a63e51e2ad | |||
1b8eee86a1 | |||
6d50278d34 | |||
35844842de | |||
843e772094 | |||
9d0518dfeb | |||
d33d399c31 | |||
970cf7f017 | |||
d125efcd60 | |||
4664427832 | |||
d84b9cc875 | |||
0c6b6bf5d5 | |||
d275995dfe | |||
b03ca30379 | |||
e5f23a49b4 | |||
e78100eaac | |||
ae9d8be4e4 | |||
e4f73a6d5c | |||
a31fd608cf | |||
a98d5aa2fb | |||
4c6ef841bb | |||
997f539a8c | |||
83f74faaf7 | |||
0bb5797377 | |||
c3097aa334 | |||
2cd0fcc9a7 | |||
5b653fb558 | |||
6a5b23f848 | |||
a480783ee8 | |||
bc0f5b5787 | |||
962eb0e376 | |||
ababe24b97 | |||
1bf7a2abd4 | |||
0ea4f94e8f | |||
6cc6130b6a | |||
8294903cd0 | |||
7b7379c3dd | |||
9acdf1e42f | |||
5dd95d27de | |||
1016b4c879 | |||
df6f571294 | |||
be05dd7ba1 | |||
bc22d888ee | |||
e6ae89ebf9 | |||
e7b23e1638 | |||
ce7a967f5f | |||
38446b5b2a | |||
48e1a8ed02 | |||
a059166b9c | |||
086a2b851d | |||
8e4c5fb24d | |||
6993893600 | |||
bfdf8babed | |||
4d31fb890d | |||
ef451fd8f7 | |||
656eb0abec | |||
a7896329f7 | |||
b9e11ac201 | |||
1aa27bd91c | |||
118ec28b04 | |||
449b43792b | |||
f1e95156ea | |||
45e5b25cda | |||
bdec611cf3 | |||
fa612d5f28 | |||
d270447777 | |||
1a59fc4f99 | |||
d38dcb9ba2 | |||
c7b348390e | |||
bf6c91932c | |||
716ed3acb3 | |||
65e08bea92 | |||
74859e99e7 | |||
aad583be2e | |||
3e4505e2e3 | |||
1fe1cfb397 | |||
2f721c84ed | |||
9112ff8c0a | |||
96e12b5aba | |||
bec3ba71cd | |||
c6766d2a73 | |||
befac6ad87 | |||
60bc38559b | |||
2a56155587 | |||
87c3673a71 | |||
21889162ff | |||
f1cccc22cd | |||
4fa88396ad | |||
10c1f3a849 | |||
d168ef94e9 | |||
29f8b05f56 | |||
af482c30bd | |||
4e36e398ee | |||
b5f81b9384 | |||
879b471aed | |||
964d81dc0e | |||
443f7cd5fd | |||
2fc8cb5376 | |||
ee20a09e7e | |||
f4e801351c | |||
7329753211 | |||
7d46e7e271 | |||
0583eb07d5 | |||
73694563cf | |||
bb4ed59191 | |||
566143757f | |||
822f2ffc73 | |||
eb3ceba497 | |||
2c6d0621c9 | |||
d8e84cb5e3 | |||
0b1e79871f | |||
954fddf578 | |||
f94f748339 | |||
e2b7b22ca9 | |||
efc8c82d8b | |||
eac5abba79 | |||
1956c14b8a | |||
017fac7041 | |||
0bdc50c78f | |||
57d78b6094 | |||
db5ce7ba85 | |||
51c16d0048 | |||
6532b23f1c | |||
49304b9ecd | |||
1106ab50a5 | |||
e518828b91 | |||
a3f2865a13 | |||
08c5a3b499 | |||
9f36478518 | |||
71123915e8 | |||
eb8cbfd770 | |||
2121a6c364 | |||
57c6d78c6d | |||
7657b93a00 | |||
af12a460df |
@ -1,3 +1,3 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
|
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
|
||||||
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo
|
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts
|
||||||
|
91
.eslintrc
91
.eslintrc
@ -1,91 +0,0 @@
|
|||||||
{
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.json"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"react-perf",
|
|
||||||
"css-modules",
|
|
||||||
"jest",
|
|
||||||
"jsx-a11y",
|
|
||||||
"react",
|
|
||||||
"react-hooks",
|
|
||||||
"suggest-no-throw",
|
|
||||||
"testing-library",
|
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"plugin:css-modules/recommended",
|
|
||||||
"plugin:jsx-a11y/recommended",
|
|
||||||
"plugin:react-hooks/recommended"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
|
||||||
"@typescript-eslint/no-array-constructor": "error",
|
|
||||||
"@typescript-eslint/no-array-delete": "error",
|
|
||||||
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
||||||
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
||||||
"@typescript-eslint/no-empty-object-type": "error",
|
|
||||||
"@typescript-eslint/no-floating-promises": "error",
|
|
||||||
"no-implied-eval": "off", // This is wrong; use the @typescript-eslint one instead.
|
|
||||||
"@typescript-eslint/no-implied-eval": "error",
|
|
||||||
"@typescript-eslint/no-misused-promises": "error",
|
|
||||||
"@typescript-eslint/no-namespace": "error",
|
|
||||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
||||||
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
||||||
"no-unused-vars": "off", // This is wrong; use the @typescript-eslint one instead.
|
|
||||||
"@typescript-eslint/no-unused-vars": ["error", {
|
|
||||||
"varsIgnorePattern": "^_",
|
|
||||||
"argsIgnorePattern": "^_",
|
|
||||||
"ignoreRestSiblings": true,
|
|
||||||
"vars": "all",
|
|
||||||
"args": "none"
|
|
||||||
}],
|
|
||||||
"@typescript-eslint/prefer-as-const": "warn",
|
|
||||||
"jsx-a11y/click-events-have-key-events": "off",
|
|
||||||
"jsx-a11y/no-autofocus": "off",
|
|
||||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
|
||||||
"no-restricted-globals": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"name": "isNaN",
|
|
||||||
"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": [
|
|
||||||
"error",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"react-hooks/exhaustive-deps": "off",
|
|
||||||
"suggest-no-throw/suggest-no-throw": "warn",
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
|
||||||
"extends": [
|
|
||||||
"plugin:testing-library/react"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"suggest-no-throw/suggest-no-throw": "off",
|
|
||||||
"testing-library/prefer-screen-queries": "off",
|
|
||||||
"jest/valid-expect": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["src/**/*.test.ts"],
|
|
||||||
"extends": [
|
|
||||||
"plugin:testing-library/react"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"suggest-no-throw/suggest-no-throw": "off",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
127
.eslintrc.json
Normal file
127
.eslintrc.json
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
{
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "./tsconfig.json"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react-perf",
|
||||||
|
"css-modules",
|
||||||
|
"jest",
|
||||||
|
"jsx-a11y",
|
||||||
|
"react",
|
||||||
|
"react-hooks",
|
||||||
|
"suggest-no-throw",
|
||||||
|
"testing-library",
|
||||||
|
"@typescript-eslint"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:css-modules/recommended",
|
||||||
|
"plugin:jsx-a11y/recommended",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||||
|
"@typescript-eslint/no-array-constructor": "error",
|
||||||
|
"@typescript-eslint/no-array-delete": "error",
|
||||||
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
||||||
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
||||||
|
"@typescript-eslint/no-empty-object-type": "error",
|
||||||
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||||
|
"@typescript-eslint/no-floating-promises": "error",
|
||||||
|
"@typescript-eslint/no-for-in-array": "error",
|
||||||
|
"no-implied-eval": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||||
|
"@typescript-eslint/no-implied-eval": "error",
|
||||||
|
"@typescript-eslint/no-misused-new": "error",
|
||||||
|
"@typescript-eslint/no-misused-promises": "error",
|
||||||
|
"@typescript-eslint/no-namespace": "error",
|
||||||
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
||||||
|
"@typescript-eslint/no-redundant-type-constituents": "error",
|
||||||
|
"@typescript-eslint/no-this-alias": "warn",
|
||||||
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||||
|
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
||||||
|
"no-unused-vars": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"varsIgnorePattern": "^_",
|
||||||
|
"argsIgnorePattern": "^_",
|
||||||
|
"ignoreRestSiblings": true,
|
||||||
|
"vars": "all",
|
||||||
|
"args": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
||||||
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
||||||
|
"no-throw-literal": "off", // Use @typescript-eslint/only-throw-error instead.
|
||||||
|
"@typescript-eslint/only-throw-error": "error",
|
||||||
|
"@typescript-eslint/prefer-as-const": "warn",
|
||||||
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
||||||
|
"@typescript-eslint/consistent-type-imports": "error",
|
||||||
|
"@typescript-eslint/restrict-plus-operands": "error",
|
||||||
|
"jsx-a11y/click-events-have-key-events": "off",
|
||||||
|
"jsx-a11y/no-autofocus": "off",
|
||||||
|
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||||
|
"no-restricted-globals": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"name": "isNaN",
|
||||||
|
"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()."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='stringify']",
|
||||||
|
"message": "Do not use TOML.stringify directly. Use the wrappers in test-utils instead like settingsToToml."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='parse']",
|
||||||
|
"message": "Do not use TOML.parse directly. Use the wrappers in test-utils instead like tomlToSettings."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-restricted-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"patterns": [
|
||||||
|
// Restrict all relative imports except for .css files.
|
||||||
|
{
|
||||||
|
"group": ["./*", "../*", "!./*.css", "!../*.css"],
|
||||||
|
"message": "Use absolute imports instead."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"semi": ["error", "never"],
|
||||||
|
"react-hooks/exhaustive-deps": "off",
|
||||||
|
"suggest-no-throw/suggest-no-throw": "error"
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
||||||
|
"extends": ["plugin:testing-library/react"],
|
||||||
|
"rules": {
|
||||||
|
"suggest-no-throw/suggest-no-throw": "off",
|
||||||
|
"testing-library/prefer-screen-queries": "off",
|
||||||
|
"jest/valid-expect": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["src/**/*.test.ts"],
|
||||||
|
"extends": ["plugin:testing-library/react"],
|
||||||
|
"rules": {
|
||||||
|
"suggest-no-throw/suggest-no-throw": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["packages/**/*.ts", "rust/**/*.ts"],
|
||||||
|
"extends": [],
|
||||||
|
"rules": {
|
||||||
|
"no-restricted-imports": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Bug Report
|
name: Bug Report
|
||||||
description: File a bug report for the Zoo Modeling App
|
description: File a bug report for the Zoo Design Studio
|
||||||
title: "[BUG]: "
|
title: "[BUG]: "
|
||||||
labels: ["bug"]
|
labels: ["bug"]
|
||||||
assignees: []
|
assignees: []
|
||||||
@ -70,7 +70,7 @@ body:
|
|||||||
id: version
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
label: Version
|
label: Version
|
||||||
description: "The version of the Zoo Modeling App you're using."
|
description: "The version of the Zoo Design Studio you're using."
|
||||||
placeholder: "example: v0.15.0. You can find this in the settings."
|
placeholder: "example: v0.15.0. You can find this in the settings."
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
12
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -7,11 +7,11 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
|
|||||||
# If no last run artifact, than run Playwright normally
|
# If no last run artifact, than run Playwright normally
|
||||||
echo "run playwright normally"
|
echo "run playwright normally"
|
||||||
if [[ "$3" == *ubuntu* ]]; then
|
if [[ "$3" == *ubuntu* ]]; then
|
||||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --shard=$1/$2 || true
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --shard=$1/$2 || true
|
||||||
elif [[ "$3" == *windows* ]]; then
|
elif [[ "$3" == *windows* ]]; then
|
||||||
yarn test:playwright:electron:windows -- --shard=$1/$2 || true
|
npm run test:playwright:electron:windows -- --shard=$1/$2 || true
|
||||||
elif [[ "$3" == *macos* ]]; then
|
elif [[ "$3" == *macos* ]]; then
|
||||||
yarn test:playwright:electron:macos -- --shard=$1/$2 || true
|
npm run test:playwright:electron:macos -- --shard=$1/$2 || true
|
||||||
else
|
else
|
||||||
echo "Do not run Playwright. Unable to detect os runtime."
|
echo "Do not run Playwright. Unable to detect os runtime."
|
||||||
exit 1
|
exit 1
|
||||||
@ -31,11 +31,11 @@ while [[ $retry -le $max_retries ]]; do
|
|||||||
echo "retried=true" >>$GITHUB_OUTPUT
|
echo "retried=true" >>$GITHUB_OUTPUT
|
||||||
echo "run playwright with last failed tests and retry $retry"
|
echo "run playwright with last failed tests and retry $retry"
|
||||||
if [[ "$3" == *ubuntu* ]]; then
|
if [[ "$3" == *ubuntu* ]]; then
|
||||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
|
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --last-failed || true
|
||||||
elif [[ "$3" == *windows* ]]; then
|
elif [[ "$3" == *windows* ]]; then
|
||||||
yarn test:playwright:electron:windows -- --last-failed || true
|
npm run test:playwright:electron:windows -- --last-failed || true
|
||||||
elif [[ "$3" == *macos* ]]; then
|
elif [[ "$3" == *macos* ]]; then
|
||||||
yarn test:playwright:electron:macos -- --last-failed || true
|
npm run test:playwright:electron:macos -- --last-failed || true
|
||||||
else
|
else
|
||||||
echo "Do not run playwright. Unable to detect os runtime."
|
echo "Do not run playwright. Unable to detect os runtime."
|
||||||
exit 1
|
exit 1
|
||||||
|
24
.github/ci-cd-scripts/start-vector-macos.sh
vendored
Executable file
24
.github/ci-cd-scripts/start-vector-macos.sh
vendored
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Install vector
|
||||||
|
brew tap vectordotdev/brew && brew install vector
|
||||||
|
|
||||||
|
# Configure vector
|
||||||
|
mkdir -p /tmp/vector
|
||||||
|
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||||
|
sed -i '' "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
|
||||||
|
sed -i '' "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||||
|
sed -i '' "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||||
|
sed -i '' "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||||
|
sed -i '' "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||||
|
sed -i '' "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
|
||||||
|
|
||||||
|
# Display settings
|
||||||
|
echo
|
||||||
|
echo 'Vector config:'
|
||||||
|
cat /tmp/vector.toml
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Start in the background
|
||||||
|
$(brew --prefix)/opt/vector/bin/vector --config /tmp/vector.toml &
|
24
.github/ci-cd-scripts/start-vector-ubuntu.sh
vendored
Executable file
24
.github/ci-cd-scripts/start-vector-ubuntu.sh
vendored
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Install vector
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev | bash -s -- -y
|
||||||
|
|
||||||
|
# Configure vector
|
||||||
|
mkdir -p /tmp/vector
|
||||||
|
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||||
|
sed -i "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
|
||||||
|
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||||
|
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||||
|
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||||
|
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||||
|
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
|
||||||
|
|
||||||
|
# Display settings
|
||||||
|
echo
|
||||||
|
echo 'Vector config:'
|
||||||
|
cat /tmp/vector.toml
|
||||||
|
echo
|
||||||
|
|
||||||
|
# Start in background
|
||||||
|
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
8
.github/workflows/build-and-store-wasm.yml
vendored
8
.github/workflows/build-and-store-wasm.yml
vendored
@ -13,9 +13,9 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: npm install
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -24,7 +24,7 @@ jobs:
|
|||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
cache: false # Configured below.
|
cache: false # Configured below.
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
workspaces: rust
|
workspaces: rust
|
||||||
- name: build wasm
|
- name: build wasm
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
|
|
||||||
# Upload the WASM bundle as an artifact
|
# Upload the WASM bundle as an artifact
|
||||||
|
176
.github/workflows/build-apps.yml
vendored
176
.github/workflows/build-apps.yml
vendored
@ -5,12 +5,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- updater-test
|
||||||
tags:
|
tags:
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
|
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
# IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
||||||
|
IS_RELEASE: true
|
||||||
IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
|
IS_NIGHTLY: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@ -29,9 +31,9 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- id: filter
|
- id: filter
|
||||||
name: Check for Rust changes
|
name: Check for Rust changes
|
||||||
@ -77,7 +79,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: false # Configured below.
|
cache: false # Configured below.
|
||||||
|
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -90,20 +92,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Run build:wasm
|
- name: Run build:wasm
|
||||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
run: "yarn build:wasm"
|
run: "npm run build:wasm"
|
||||||
|
|
||||||
- name: Set nightly version, product name, release notes, and icons
|
- name: Set nightly version, product name, release notes, and icons
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
export VERSION=${GITHUB_REF_NAME#nightly-v}
|
export VERSION=${GITHUB_REF_NAME#nightly-v}
|
||||||
yarn files:set-version
|
npm run files:set-version
|
||||||
yarn files:flip-to-nightly
|
npm run files:flip-to-nightly
|
||||||
|
|
||||||
- name: Set release version
|
# - name: Set release version
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
run: |
|
# run: |
|
||||||
export VERSION=${GITHUB_REF_NAME#v}
|
# export VERSION=${GITHUB_REF_NAME#v}
|
||||||
yarn files:set-version
|
# npm run files:set-version
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -122,17 +124,17 @@ jobs:
|
|||||||
- id: export_notes
|
- id: export_notes
|
||||||
run: echo "notes=`cat release-notes.md`" >> "$GITHUB_OUTPUT"
|
run: echo "notes=`cat release-notes.md`" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Prepare electron-builder.yml file for updater test
|
# - name: Prepare electron-builder.yml file for updater test
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
run: |
|
# run: |
|
||||||
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/updater-test"' electron-builder.yml
|
# yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/updater-test"' electron-builder.yml
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
# - uses: actions/upload-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
with:
|
# with:
|
||||||
name: prepared-files-updater-test
|
# name: prepared-files-updater-test
|
||||||
path: |
|
# path: |
|
||||||
electron-builder.yml
|
# electron-builder.yml
|
||||||
|
|
||||||
|
|
||||||
build-apps:
|
build-apps:
|
||||||
@ -172,16 +174,9 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
cache: 'npm' # Set this to npm, npm or pnpm.
|
||||||
|
|
||||||
- name: yarn install
|
- run: npm install
|
||||||
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
|
||||||
uses: nick-fields/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
shell: bash
|
|
||||||
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' }}
|
||||||
@ -207,13 +202,20 @@ jobs:
|
|||||||
smctl.exe keypair ls
|
smctl.exe keypair ls
|
||||||
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
|
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
|
||||||
smksp_cert_sync.exe
|
smksp_cert_sync.exe
|
||||||
|
smctl windows certsync
|
||||||
|
# This last line `smctl windows certsync` was added after windows codesign failures started happening
|
||||||
|
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
|
||||||
|
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
|
||||||
|
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
|
||||||
|
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
|
||||||
|
# TODO: we still need to make sign-win.js errors fail the workflow, see issue #6276
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Build the app (debug)
|
- name: Build the app (debug)
|
||||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
||||||
# electron-builder doesn't have a concept of release vs debug,
|
# electron-builder doesn't have a concept of release vs debug,
|
||||||
# this is just not doing any codesign or release yml generation, and points to dev infra
|
# this is just not doing any codesign or release yml generation, and points to dev infra
|
||||||
run: yarn tronb:package:dev
|
run: npm run tronb:package:dev
|
||||||
|
|
||||||
- name: Build the app (release)
|
- name: Build the app (release)
|
||||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||||
@ -226,14 +228,7 @@ jobs:
|
|||||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
run: npm run tronb:package:prod
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
|
||||||
uses: nick-fields/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
shell: bash
|
|
||||||
timeout_minutes: 10
|
|
||||||
max_attempts: 3
|
|
||||||
command: yarn tronb:package:prod
|
|
||||||
|
|
||||||
- name: List artifacts in out/
|
- name: List artifacts in out/
|
||||||
run: ls -R out
|
run: ls -R out
|
||||||
@ -241,7 +236,7 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: out-arm64-${{ matrix.platform }}
|
name: out-arm64-${{ matrix.platform }}
|
||||||
# first two will pick both Zoo Modeling App-$VERSION-arm64-win.exe and Zoo Modeling App-$VERSION-win.exe
|
# first two will pick both Zoo Design Studio-$VERSION-arm64-win.exe and Zoo Design Studio-$VERSION-win.exe
|
||||||
path: |
|
path: |
|
||||||
out/*-${{ env.VERSION_NO_V }}-win.*
|
out/*-${{ env.VERSION_NO_V }}-win.*
|
||||||
out/*-${{ env.VERSION_NO_V }}-arm64-win.*
|
out/*-${{ env.VERSION_NO_V }}-arm64-win.*
|
||||||
@ -267,60 +262,53 @@ jobs:
|
|||||||
|
|
||||||
# The steps below are for updater-test builds, only on release
|
# The steps below are for updater-test builds, only on release
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
# - uses: actions/download-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
name: prepared-files-updater-test
|
# name: prepared-files-updater-test
|
||||||
|
|
||||||
- name: Copy updated electron-builder.yml file for updater test
|
# - name: Copy updated electron-builder.yml file for updater test
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
run: |
|
# run: |
|
||||||
ls -R prepared-files-updater-test
|
# ls -R prepared-files-updater-test
|
||||||
cp prepared-files-updater-test/electron-builder.yml electron-builder.yml
|
# cp prepared-files-updater-test/electron-builder.yml electron-builder.yml
|
||||||
|
|
||||||
- name: Build the app (updater-test)
|
# - name: Build the app (updater-test)
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
env:
|
# env:
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
# APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
|
# CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
# CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
# CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
# WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||||
DEBUG: "electron-notarize*"
|
# run: npm run tronb:package:prod
|
||||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
|
||||||
uses: nick-fields/retry@v3.0.2
|
|
||||||
with:
|
|
||||||
shell: bash
|
|
||||||
timeout_minutes: 10
|
|
||||||
max_attempts: 3
|
|
||||||
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' }}
|
||||||
with:
|
# with:
|
||||||
name: updater-test-arm64-${{ matrix.platform }}
|
# name: updater-test-arm64-${{ matrix.platform }}
|
||||||
path: |
|
# path: |
|
||||||
out/*-arm64-win.exe
|
# out/*-arm64-win.exe
|
||||||
out/*-arm64-mac.dmg
|
# out/*-arm64-mac.dmg
|
||||||
out/*-arm64-linux.AppImage
|
# out/*-arm64-linux.AppImage
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
# - uses: actions/upload-artifact@v4
|
||||||
if: ${{ env.IS_RELEASE == 'true' }}
|
# if: ${{ env.IS_RELEASE == 'true' }}
|
||||||
with:
|
# with:
|
||||||
name: updater-test-x64-${{ matrix.platform }}
|
# name: updater-test-x64-${{ matrix.platform }}
|
||||||
path: |
|
# path: |
|
||||||
out/*-x64-win.exe
|
# out/*-x64-win.exe
|
||||||
out/*-x64-mac.dmg
|
# out/*-x64-mac.dmg
|
||||||
out/*-x86_64-linux.AppImage
|
# out/*-x86_64-linux.AppImage
|
||||||
|
|
||||||
|
|
||||||
upload-apps-release:
|
upload-apps-release:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
# 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) }}
|
||||||
@ -378,7 +366,7 @@ jobs:
|
|||||||
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
||||||
PUB_DATE: ${{ github.event.repository.updated_at }}
|
PUB_DATE: ${{ github.event.repository.updated_at }}
|
||||||
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||||
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
|
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_DIR=https://${WEBSITE_DIR}
|
RELEASE_DIR=https://${WEBSITE_DIR}
|
||||||
jq --null-input \
|
jq --null-input \
|
||||||
@ -435,16 +423,16 @@ jobs:
|
|||||||
export TAG="nightly-${VERSION}"
|
export TAG="nightly-${VERSION}"
|
||||||
export PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
|
export PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
|
||||||
export NOTES=$(./scripts/get-nightly-changelog.sh)
|
export NOTES=$(./scripts/get-nightly-changelog.sh)
|
||||||
yarn files:set-notes
|
npm run files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
# if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
uses: 'google-github-actions/auth@v2.1.8'
|
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.4
|
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 }}
|
||||||
@ -458,6 +446,14 @@ jobs:
|
|||||||
parent: false
|
parent: false
|
||||||
destination: 'dl.kittycad.io/releases/modeling-app/nightly'
|
destination: 'dl.kittycad.io/releases/modeling-app/nightly'
|
||||||
|
|
||||||
|
- name: Upload updater-test files to public bucket
|
||||||
|
uses: google-github-actions/upload-cloud-storage@v2.2.1
|
||||||
|
with:
|
||||||
|
path: out
|
||||||
|
glob: '*'
|
||||||
|
parent: false
|
||||||
|
destination: 'dl.kittycad.io/releases/modeling-app/updater-test'
|
||||||
|
|
||||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||||
run: yarn files:invalidate-bucket:nightly
|
run: npm run files:invalidate-bucket:nightly
|
||||||
|
19
.github/workflows/cargo-test.yml
vendored
19
.github/workflows/cargo-test.yml
vendored
@ -34,20 +34,11 @@ jobs:
|
|||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
cache: false # Configured below.
|
cache: false # Configured below.
|
||||||
- name: Install vector
|
- name: Start Vector
|
||||||
run: |
|
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
env:
|
||||||
chmod +x /tmp/vector.sh
|
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||||
/tmp/vector.sh -y -no-modify-path
|
OS_NAME: ${{ env.OS_NAME }}
|
||||||
mkdir -p /tmp/vector
|
|
||||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
|
||||||
cat /tmp/vector.toml
|
|
||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
|
||||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||||
- uses: taiki-e/install-action@nextest
|
- uses: taiki-e/install-action@nextest
|
||||||
- name: Install just
|
- name: Install just
|
||||||
|
3
.github/workflows/check-exampleKcl.yml
vendored
3
.github/workflows/check-exampleKcl.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
paths:
|
paths:
|
||||||
- 'src/lib/exampleKcl.ts'
|
- 'src/lib/exampleKcl.ts'
|
||||||
|
- 'public/kcl-samples/bracket/main.kcl'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -22,7 +23,7 @@ jobs:
|
|||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
|
const message = '`public/kcl-samples/bracket/main.kcl` or `src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
|
||||||
const issue_number = context.payload.pull_request.number;
|
const issue_number = context.payload.pull_request.number;
|
||||||
const owner = context.repo.owner;
|
const owner = context.repo.owner;
|
||||||
const repo = context.repo.repo;
|
const repo = context.repo.repo;
|
||||||
|
13
.github/workflows/codemirror-lang-kcl.yml
vendored
13
.github/workflows/codemirror-lang-kcl.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yarn-unit-test:
|
npm-unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -19,14 +19,11 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
|
||||||
- run: yarn tsc
|
- run: npm run tsc --workspace=packages/codemirror-lang-kcl
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
|
||||||
- name: run unit tests
|
- name: run unit tests
|
||||||
run: yarn test
|
run: npm run test --workspace=packages/codemirror-lang-kcl
|
||||||
working-directory: packages/codemirror-lang-kcl
|
|
||||||
|
78
.github/workflows/e2e-tests.yml
vendored
78
.github/workflows/e2e-tests.yml
vendored
@ -97,11 +97,11 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Download Wasm Cache
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
@ -140,7 +140,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: false # Configured below.
|
cache: false # Configured below.
|
||||||
|
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
@ -154,7 +154,7 @@ jobs:
|
|||||||
- name: Build Wasm
|
- name: Build Wasm
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -197,12 +197,12 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
id: deps-install
|
id: deps-install
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
- name: Cache Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -210,31 +210,32 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/ms-playwright/
|
~/.cache/ms-playwright/
|
||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn playwright install --with-deps
|
run: npm run playwright install --with-deps
|
||||||
|
|
||||||
- name: build web
|
- name: build web
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn tronb:vite:dev
|
run: npm run tronb:vite:dev
|
||||||
|
|
||||||
- name: Run ubuntu/chrome snapshots
|
- name: Run ubuntu/chrome snapshots
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
uses: nick-fields/retry@v3.0.2
|
uses: nick-fields/retry@v3.0.2
|
||||||
with:
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
command: yarn test:snapshots
|
command: npm run test:snapshots
|
||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
env:
|
env:
|
||||||
CI: true
|
|
||||||
NODE_ENV: development
|
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
|
||||||
VITE_KC_SKIP_AUTH: true
|
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||||
|
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||||
|
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
|
TARGET: web
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||||
@ -285,7 +286,7 @@ jobs:
|
|||||||
os:
|
os:
|
||||||
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
- namespace-profile-macos-8-cores
|
- namespace-profile-macos-8-cores
|
||||||
- windows-latest
|
- windows-latest-8-cores
|
||||||
shardIndex: [1, 2, 3, 4]
|
shardIndex: [1, 2, 3, 4]
|
||||||
shardTotal: [4]
|
shardTotal: [4]
|
||||||
# Disable macos and windows tests on hourly e2e tests since we only care
|
# Disable macos and windows tests on hourly e2e tests since we only care
|
||||||
@ -296,7 +297,7 @@ jobs:
|
|||||||
exclude:
|
exclude:
|
||||||
- os: namespace-profile-macos-8-cores
|
- os: namespace-profile-macos-8-cores
|
||||||
isScheduled: true
|
isScheduled: true
|
||||||
- os: windows-latest
|
- os: windows-latest-8-cores
|
||||||
isScheduled: true
|
isScheduled: true
|
||||||
# TODO: add ref here for main and latest release tag
|
# TODO: add ref here for main and latest release tag
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -320,12 +321,12 @@ jobs:
|
|||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
id: deps-install
|
id: deps-install
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn
|
run: npm install
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
- name: Cache Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
@ -333,32 +334,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/ms-playwright/
|
~/.cache/ms-playwright/
|
||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn playwright install --with-deps
|
run: npm run playwright install --with-deps
|
||||||
|
|
||||||
- name: Build web
|
- name: Build web
|
||||||
if: needs.conditions.outputs.should-run == 'true'
|
if: needs.conditions.outputs.should-run == 'true'
|
||||||
run: yarn tronb:vite:dev
|
run: npm run tronb:vite:dev
|
||||||
|
|
||||||
- name: Install vector
|
- name: Start Vector
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && contains(matrix.os, 'ubuntu') }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !contains(matrix.os, 'windows') }}
|
||||||
shell: bash
|
run: .github/ci-cd-scripts/start-vector-${{ env.OS_NAME }}.sh
|
||||||
run: |
|
env:
|
||||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||||
chmod +x /tmp/vector.sh
|
OS_NAME: ${{ env.OS_NAME }}
|
||||||
/tmp/vector.sh -y -no-modify-path
|
|
||||||
mkdir -p /tmp/vector
|
|
||||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
|
||||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
|
||||||
cat /tmp/vector.toml
|
|
||||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
|
||||||
@ -374,15 +365,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
shell: bash
|
shell: bash
|
||||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
|
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
|
||||||
timeout_minutes: 45
|
timeout_minutes: 30
|
||||||
max_attempts: 15
|
max_attempts: 9
|
||||||
env:
|
env:
|
||||||
CI: true
|
|
||||||
FAIL_ON_CONSOLE_ERRORS: true
|
FAIL_ON_CONSOLE_ERRORS: true
|
||||||
NODE_ENV: development
|
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
|
||||||
VITE_KC_SKIP_AUTH: true
|
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||||
|
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||||
|
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
|
TARGET: desktop
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
|
||||||
|
@ -21,10 +21,10 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- run: yarn generate:machine-api
|
- run: npm run generate:machine-api
|
||||||
- run: yarn fmt
|
- run: npm run fmt || true
|
||||||
- name: check for changes
|
- name: check for changes
|
||||||
id: git-check
|
id: git-check
|
||||||
run: |
|
run: |
|
||||||
|
30
.github/workflows/kcl-language-server.yml
vendored
30
.github/workflows/kcl-language-server.yml
vendored
@ -56,21 +56,19 @@ jobs:
|
|||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
npm install
|
||||||
cd rust/kcl-language-server
|
|
||||||
yarn install
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
yarn build
|
npm run build
|
||||||
yarn test-compile
|
npm run test-compile
|
||||||
ls -la dist
|
ls -la dist
|
||||||
xvfb-run -a yarn test
|
xvfb-run -a npm run test
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
yarn test
|
npm run test
|
||||||
if: runner.os != 'Linux'
|
if: runner.os != 'Linux'
|
||||||
build-release:
|
build-release:
|
||||||
strategy:
|
strategy:
|
||||||
@ -183,19 +181,20 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
|
# npm will symlink which will cause issues w tarballing later
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
||||||
|
|
||||||
- name: Package Extension (nightly)
|
- name: Package Extension (nightly)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
||||||
|
|
||||||
- name: remove server
|
- name: remove server
|
||||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
@ -207,13 +206,13 @@ jobs:
|
|||||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix
|
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
|
||||||
|
|
||||||
- name: Package Extension (no server, nightly)
|
- name: Package Extension (no server, nightly)
|
||||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o ../build/kcl-language-server-no-server.vsix --pre-release
|
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -244,8 +243,8 @@ jobs:
|
|||||||
lld \
|
lld \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
nodejs \
|
nodejs \
|
||||||
yarn \
|
npm \
|
||||||
npm
|
yarn
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -272,19 +271,20 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
|
# npm will symlink which will cause issues w tarballing later
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
||||||
|
|
||||||
- name: Package Extension (release)
|
- name: Package Extension (release)
|
||||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||||
run: |
|
run: |
|
||||||
cd rust/kcl-language-server
|
cd rust/kcl-language-server
|
||||||
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
55
.github/workflows/nix.yml
vendored
Normal file
55
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
name: Test Nix Flake
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
jobs:
|
||||||
|
nix-flake-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix flake check for all platforms
|
||||||
|
run: |
|
||||||
|
nix flake check --all-systems
|
||||||
|
|
||||||
|
nix-build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix build . for x86_64-linux
|
||||||
|
run: nix build .
|
||||||
|
|
||||||
|
nix-build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- name: nix build . for x86_64-darwin
|
||||||
|
run: nix build .
|
||||||
|
|
6
.github/workflows/publish-apps-release.yml
vendored
6
.github/workflows/publish-apps-release.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Find tag workflow id
|
- name: Find tag workflow id
|
||||||
id: tag_workflow_id
|
id: tag_workflow_id
|
||||||
@ -105,7 +105,7 @@ jobs:
|
|||||||
- name: Override release notes
|
- name: Override release notes
|
||||||
env:
|
env:
|
||||||
NOTES: ${{ github.event.release.body }}
|
NOTES: ${{ github.event.release.body }}
|
||||||
run: yarn files:set-notes
|
run: npm run files:set-notes
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
uses: 'google-github-actions/auth@v2.1.8'
|
uses: 'google-github-actions/auth@v2.1.8'
|
||||||
@ -126,7 +126,7 @@ jobs:
|
|||||||
destination: 'dl.kittycad.io/releases/modeling-app'
|
destination: 'dl.kittycad.io/releases/modeling-app'
|
||||||
|
|
||||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||||
run: yarn files:invalidate-bucket
|
run: npm run files:invalidate-bucket
|
||||||
|
|
||||||
- name: Upload release files to Github
|
- name: Upload release files to Github
|
||||||
if: ${{ github.event_name == 'release' }}
|
if: ${{ github.event_name == 'release' }}
|
||||||
|
100
.github/workflows/static-analysis.yml
vendored
100
.github/workflows/static-analysis.yml
vendored
@ -16,18 +16,18 @@ permissions:
|
|||||||
actions: read
|
actions: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
yarn-fmt-check:
|
npm-fmt-check:
|
||||||
runs-on: 'ubuntu-22.04'
|
runs-on: 'ubuntu-22.04'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- run: yarn fmt-check
|
- run: npm run fmt:check
|
||||||
|
|
||||||
yarn-build-wasm:
|
npm-build-wasm:
|
||||||
# Build the wasm blob once on the fastest runner.
|
# Build the wasm blob once on the fastest runner.
|
||||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||||
steps:
|
steps:
|
||||||
@ -36,10 +36,10 @@ jobs:
|
|||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install
|
run: npm install
|
||||||
|
|
||||||
- name: Use correct Rust toolchain
|
- name: Use correct Rust toolchain
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: false # Configured below.
|
cache: false # Configured below.
|
||||||
|
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Wasm
|
- name: Build Wasm
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn build:wasm
|
run: npm run build:wasm
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -76,17 +76,17 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
rust/kcl-lib/bindings/*
|
rust/kcl-lib/bindings/*
|
||||||
|
|
||||||
yarn-tsc:
|
npm-tsc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -104,19 +104,19 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn tsc
|
- run: npm run tsc
|
||||||
|
|
||||||
yarn-lint:
|
npm-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -134,7 +134,37 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn lint
|
- run: npm run lint
|
||||||
|
|
||||||
|
npm-circular-dependencies:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: npm-build-wasm
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm install
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
|
||||||
|
- name: Copy prepared wasm
|
||||||
|
run: |
|
||||||
|
ls -R prepared-wasm
|
||||||
|
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||||
|
mkdir rust/kcl-wasm-lib/pkg
|
||||||
|
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||||
|
|
||||||
|
- name: Copy prepared ts-rs bindings
|
||||||
|
run: |
|
||||||
|
ls -R prepared-ts-rs-bindings
|
||||||
|
mkdir rust/kcl-lib/bindings
|
||||||
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
|
- run: npm run circular-deps:diff
|
||||||
|
|
||||||
python-codespell:
|
python-codespell:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@ -149,19 +179,19 @@ jobs:
|
|||||||
- name: Run codespell
|
- name: Run codespell
|
||||||
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
||||||
|
|
||||||
yarn-unit-test-kcl-samples:
|
npm-unit-test-kcl-samples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
|
|
||||||
@ -181,32 +211,32 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: npm run simpleserver:bg
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
|
|
||||||
- name: Install Chromium Browser
|
- name: Install Chromium Browser
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn playwright install chromium --with-deps
|
run: npm run playwright install chromium --with-deps
|
||||||
|
|
||||||
- name: run unit tests for kcl samples
|
- name: run unit tests for kcl samples
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn test:unit:kcl-samples
|
run: npm run test:unit:kcl-samples
|
||||||
env:
|
env:
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
yarn-unit-test:
|
npm-unit-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: yarn-build-wasm
|
needs: npm-build-wasm
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
|
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||||
with:
|
with:
|
||||||
tool: wasm-pack
|
tool: wasm-pack
|
||||||
|
|
||||||
@ -226,16 +256,16 @@ jobs:
|
|||||||
mkdir rust/kcl-lib/bindings
|
mkdir rust/kcl-lib/bindings
|
||||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||||
|
|
||||||
- run: yarn simpleserver:bg
|
- run: npm run simpleserver:bg
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
|
|
||||||
- name: Install Chromium Browser
|
- name: Install Chromium Browser
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: yarn playwright install chromium --with-deps
|
run: npm run playwright install chromium --with-deps
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: xvfb-run -a yarn test:unit
|
run: xvfb-run -a npm run test:unit
|
||||||
env:
|
env:
|
||||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
|
2
.github/workflows/tag-nightly.yml
vendored
2
.github/workflows/tag-nightly.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- run: yarn install
|
- run: npm install
|
||||||
|
|
||||||
- name: Push tag
|
- name: Push tag
|
||||||
run: |
|
run: |
|
||||||
|
1
.github/workflows/vector.toml
vendored
1
.github/workflows/vector.toml
vendored
@ -8,6 +8,7 @@ include = ["/tmp/github-actions.log"]
|
|||||||
type = "remap"
|
type = "remap"
|
||||||
inputs = [ "github-actions-file" ]
|
inputs = [ "github-actions-file" ]
|
||||||
source = '''
|
source = '''
|
||||||
|
.platform = "OS_NAME"
|
||||||
.action = "GITHUB_WORKFLOW"
|
.action = "GITHUB_WORKFLOW"
|
||||||
.repo = "GITHUB_REPOSITORY"
|
.repo = "GITHUB_REPOSITORY"
|
||||||
.sha = "GITHUB_SHA"
|
.sha = "GITHUB_SHA"
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -26,10 +26,12 @@ yarn-error.log*
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.helix
|
.helix
|
||||||
|
result
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
rust/target
|
rust/target
|
||||||
rust/kcl-lib/bindings
|
rust/kcl-lib/bindings
|
||||||
|
rust/kcl-language-server/server
|
||||||
public/kcl_wasm_lib_bg.wasm
|
public/kcl_wasm_lib_bg.wasm
|
||||||
rust/lcov.info
|
rust/lcov.info
|
||||||
rust/kcl-wasm-lib/pkg
|
rust/kcl-wasm-lib/pkg
|
||||||
@ -82,3 +84,4 @@ dist
|
|||||||
venv
|
venv
|
||||||
|
|
||||||
.vscode-test
|
.vscode-test
|
||||||
|
.biome/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn fmt-check
|
npm run fmt-check
|
||||||
|
20
INSTALL.md
20
INSTALL.md
@ -1,27 +1,27 @@
|
|||||||
# Setting Up Zoo Modeling App
|
# Setting Up Zoo Design Studio
|
||||||
|
|
||||||
Compared to other CAD software, getting Zoo Modeling App up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
Compared to other CAD software, getting Zoo Design Studio up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
||||||
|
|
||||||
2. Once downloaded, run the installer `Zoo Modeling App-{version}-{arch}-win.exe` which should take a few seconds.
|
2. Once downloaded, run the installer `Zoo Design Studio-{version}-{arch}-win.exe` which should take a few seconds.
|
||||||
|
|
||||||
3. The installation happens at `C:\Program Files\Zoo Modeling App`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
3. The installation happens at `C:\Program Files\Zoo Design Studio`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
||||||
|
|
||||||
2. Once downloaded, open the disk image `Zoo Modeling App-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
2. Once downloaded, open the disk image `Zoo Design Studio-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
||||||
|
|
||||||
3. You can then open your `Applications` directory and double-click on `Zoo Modeling App` to open.
|
3. You can then open your `Applications` directory and double-click on `Zoo Design Studio` to open.
|
||||||
|
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
|
|
||||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
||||||
|
|
||||||
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
|
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
|
||||||
- On Ubuntu, install the FUSE library with these commands in a terminal.
|
- On Ubuntu, install the FUSE library with these commands in a terminal.
|
||||||
@ -30,7 +30,7 @@ Compared to other CAD software, getting Zoo Modeling App up and running is quick
|
|||||||
sudo apt install libfuse2
|
sudo apt install libfuse2
|
||||||
```
|
```
|
||||||
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
|
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
|
||||||
- Once installed, copy the downloaded `Zoo Modeling App-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
- Once installed, copy the downloaded `Zoo Design Studio-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
||||||
|
|
||||||
- `appimaged` should automatically find it and make it executable. If not, run:
|
- `appimaged` should automatically find it and make it executable. If not, run:
|
||||||
```bash
|
```bash
|
||||||
|
94
Makefile
94
Makefile
@ -4,18 +4,40 @@ all: install build check
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# INSTALL
|
# INSTALL
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
export WINDOWS := true
|
||||||
|
ifndef MSYSTEM
|
||||||
|
export POWERSHELL := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef WINDOWS
|
||||||
|
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
|
||||||
|
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
|
||||||
|
else
|
||||||
|
CARGO ?= ~/.cargo/bin/cargo
|
||||||
WASM_PACK ?= ~/.cargo/bin/wasm-pack
|
WASM_PACK ?= ~/.cargo/bin/wasm-pack
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: node_modules/.yarn-integrity $(WASM_PACK) ## Install dependencies
|
install: node_modules/.package-lock.json $(CARGO) $(WASM_PACK) ## Install dependencies
|
||||||
|
|
||||||
node_modules/.yarn-integrity: package.json yarn.lock
|
node_modules/.package-lock.json: package.json package-lock.json
|
||||||
yarn install
|
npm install
|
||||||
@ touch $@
|
|
||||||
|
$(CARGO):
|
||||||
|
ifdef WINDOWS
|
||||||
|
npm run install:rust:windows
|
||||||
|
else
|
||||||
|
npm run install:rust
|
||||||
|
endif
|
||||||
|
|
||||||
$(WASM_PACK):
|
$(WASM_PACK):
|
||||||
yarn install:rust
|
ifdef WINDOWS
|
||||||
yarn install:wasm-pack:sh
|
npm run install:wasm-pack:cargo
|
||||||
|
else
|
||||||
|
npm run install:wasm-pack:sh
|
||||||
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# BUILD
|
# BUILD
|
||||||
@ -31,19 +53,23 @@ VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
|
|||||||
build: build-web build-desktop
|
build: build-web build-desktop
|
||||||
|
|
||||||
.PHONY: build-web
|
.PHONY: build-web
|
||||||
build-web: public/kcl_wasm_lib_bg.wasm build/index.html
|
build-web: install public/kcl_wasm_lib_bg.wasm build/index.html
|
||||||
|
|
||||||
.PHONY: build-desktop
|
.PHONY: build-desktop
|
||||||
build-desktop: public/kcl_wasm_lib_bg.wasm .vite/build/main.js
|
build-desktop: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
|
||||||
|
|
||||||
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES)$(RUST_SOURCES)
|
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
|
||||||
yarn build:wasm:dev
|
ifdef WINDOWS
|
||||||
|
npm run build:wasm:dev:windows
|
||||||
|
else
|
||||||
|
npm run build:wasm:dev
|
||||||
|
endif
|
||||||
|
|
||||||
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||||
yarn build:local
|
npm run build:local
|
||||||
|
|
||||||
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||||
yarn tronb:vite:dev
|
npm run tronb:vite:dev
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# CHECK
|
# CHECK
|
||||||
@ -53,33 +79,35 @@ check: format lint
|
|||||||
|
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
format: install ## Format the code
|
format: install ## Format the code
|
||||||
yarn fmt
|
npm run fmt
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: install ## Lint the code
|
lint: install ## Lint the code
|
||||||
yarn tsc
|
npm run tsc
|
||||||
yarn lint
|
npm run lint
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# RUN
|
# RUN
|
||||||
|
|
||||||
|
TARGET ?= desktop
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: run-web
|
run: run-$(TARGET)
|
||||||
|
|
||||||
.PHONY: run-web
|
.PHONY: run-web
|
||||||
run-web: install build-web ## Start the web app
|
run-web: install build-web ## Start the web app
|
||||||
yarn start
|
npm run start
|
||||||
|
|
||||||
.PHONY: run-desktop
|
.PHONY: run-desktop
|
||||||
run-desktop: install build-desktop ## Start the desktop app
|
run-desktop: install build-desktop ## Start the desktop app
|
||||||
yarn tron:start
|
npm run tron:start
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# TEST
|
# TEST
|
||||||
|
|
||||||
E2E_WORKERS ?= 1
|
E2E_GREP ?=
|
||||||
|
E2E_WORKERS ?=
|
||||||
E2E_FAILURES ?= 1
|
E2E_FAILURES ?= 1
|
||||||
E2E_GREP ?= ""
|
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: test-unit test-e2e
|
test: test-unit test-e2e
|
||||||
@ -87,34 +115,50 @@ test: test-unit test-e2e
|
|||||||
.PHONY: test-unit
|
.PHONY: test-unit
|
||||||
test-unit: install ## Run the unit tests
|
test-unit: install ## Run the unit tests
|
||||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||||
yarn test:unit
|
npm run test:unit
|
||||||
|
|
||||||
.PHONY: test-e2e
|
.PHONY: test-e2e
|
||||||
test-e2e: test-e2e-desktop
|
test-e2e: test-e2e-$(TARGET)
|
||||||
|
|
||||||
.PHONY: test-e2e-web
|
.PHONY: test-e2e-web
|
||||||
test-e2e-web: install build-web ## Run the web e2e tests
|
test-e2e-web: install build-web ## Run the web e2e tests
|
||||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||||
yarn chrome:test --headed --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
|
ifdef E2E_GREP
|
||||||
|
npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||||
|
else
|
||||||
|
npm run chrome:test -- --headed --workers='100%'
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: test-e2e-desktop
|
.PHONY: test-e2e-desktop
|
||||||
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
||||||
yarn test:playwright:electron --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep="$(E2E_GREP)"
|
ifdef E2E_GREP
|
||||||
|
npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||||
|
else
|
||||||
|
npm run test:playwright:electron -- --workers='100%'
|
||||||
|
endif
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# CLEAN
|
# CLEAN
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: ## Delete all artifacts
|
clean: ## Delete all artifacts
|
||||||
|
ifdef POWERSHELL
|
||||||
|
git clean --force -d -x --exclude=.env* --exclude=**/*.env
|
||||||
|
else
|
||||||
rm -rf .vite/ build/
|
rm -rf .vite/ build/
|
||||||
rm -rf trace.zip playwright-report/ test-results/
|
rm -rf trace.zip playwright-report/ test-results/
|
||||||
rm -rf public/kcl_wasm_lib_bg.wasm
|
rm -rf public/kcl_wasm_lib_bg.wasm
|
||||||
rm -rf rust/*/bindings/ rust/*/pkg/ rust/target/
|
rm -rf rust/*/bindings/ rust/*/pkg/ rust/target/
|
||||||
rm -rf node_modules/ rust/*/node_modules/
|
rm -rf node_modules/ rust/*/node_modules/
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: install
|
help: install
|
||||||
|
ifdef POWERSHELL
|
||||||
|
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
|
||||||
|
else
|
||||||
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
endif
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
@ -125,5 +169,5 @@ help: install
|
|||||||
# It should work for you other Linux users.
|
# It should work for you other Linux users.
|
||||||
lee-electron-test:
|
lee-electron-test:
|
||||||
Xephyr -br -ac -noreset -screen 1200x500 :2 &
|
Xephyr -br -ac -noreset -screen 1200x500 :2 &
|
||||||
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn tron:test -g "when using the file tree"
|
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run tron:test -g "when using the file tree"
|
||||||
killall Xephyr
|
killall Xephyr
|
||||||
|
140
README.md
140
README.md
@ -1,17 +1,17 @@
|
|||||||

|

|
||||||
|
|
||||||
## Zoo Modeling App
|
## Zoo Design Studio
|
||||||
|
|
||||||
download at [zoo.dev/modeling-app/download](https://zoo.dev/modeling-app/download)
|
download at [zoo.dev/modeling-app/download](https://zoo.dev/modeling-app/download)
|
||||||
|
|
||||||
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
|
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
|
||||||
|
|
||||||
Modeling App is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
||||||
|
|
||||||
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
|
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
|
||||||
- This makes version control—which is a solved problem in software engineering—trivial for CAD
|
- This makes version control—which is a solved problem in software engineering—trivial for CAD
|
||||||
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
|
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
|
||||||
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Modeling App
|
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
|
||||||
- Everything graphics _has_ to be built for the GPU
|
- Everything graphics _has_ to be built for the GPU
|
||||||
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
|
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
|
||||||
- Make the resource-intensive pieces of an application auto-scaling
|
- Make the resource-intensive pieces of an application auto-scaling
|
||||||
@ -19,9 +19,9 @@ Modeling App is our take on what a modern modelling experience can be. It is app
|
|||||||
|
|
||||||
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
|
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
|
||||||
|
|
||||||
Modeling App is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
||||||
|
|
||||||
The 3D view in Modeling App is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
@ -62,39 +62,39 @@ fnm use
|
|||||||
Install the NPM dependencies with:
|
Install the NPM dependencies with:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn install:rust
|
npm run install:rust
|
||||||
yarn install:wasm-pack:sh
|
npm run install:wasm-pack:sh
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn install:rust:windows
|
npm run install:rust:windows
|
||||||
yarn install:wasm-pack:cargo
|
npm run install:wasm-pack:cargo
|
||||||
```
|
```
|
||||||
|
|
||||||
Then to build the WASM layer, run:
|
Then to build the WASM layer, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn build:wasm
|
npm run build:wasm
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn build:wasm:windows
|
npm run build:wasm:windows
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `yarn install:tools:windows`.
|
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `npm run install:tools:windows`.
|
||||||
|
|
||||||
```
|
```
|
||||||
# macOS/Linux
|
# macOS/Linux
|
||||||
yarn fetch:wasm
|
npm run fetch:wasm
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
yarn fetch:wasm:windows
|
npm run fetch:wasm:windows
|
||||||
```
|
```
|
||||||
|
|
||||||
That will build the WASM binary and put in the `public` dir (though gitignored).
|
That will build the WASM binary and put in the `public` dir (though gitignored).
|
||||||
@ -102,7 +102,7 @@ That will build the WASM binary and put in the `public` dir (though gitignored).
|
|||||||
Finally, to run the web app only, run:
|
Finally, to run the web app only, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||||
@ -122,17 +122,17 @@ Third-Party Cookies".
|
|||||||
|
|
||||||
## Desktop
|
## Desktop
|
||||||
|
|
||||||
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then:
|
To spin up the desktop app, `npm install` and `npm run build:wasm` need to have been done before hand then:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tron:start
|
npm run tron:start
|
||||||
```
|
```
|
||||||
|
|
||||||
This will start the application and hot-reload on changes.
|
This will start the application and hot-reload on changes.
|
||||||
|
|
||||||
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
||||||
|
|
||||||
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables).
|
To package the app for your platform with electron-builder, run `npm run tronb:package:dev` (or `npm run tronb:package:prod` to point to the .env.production variables).
|
||||||
|
|
||||||
## Checking out commits / Bisecting
|
## Checking out commits / Bisecting
|
||||||
|
|
||||||
@ -141,9 +141,9 @@ Which commands from setup are one off vs. need to be run every time?
|
|||||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn install
|
npm install
|
||||||
yarn build:wasm
|
npm run build:wasm
|
||||||
yarn start # or yarn build:local && yarn serve for slower but more production-like build
|
npm start # or npm run build:local && npm run serve for slower but more production-like build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Before submitting a PR
|
## Before submitting a PR
|
||||||
@ -153,10 +153,10 @@ Before you submit a contribution PR to this repo, please ensure that:
|
|||||||
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
||||||
- You have separated out refactoring commits from feature commits as much as possible
|
- You have separated out refactoring commits from feature commits as much as possible
|
||||||
- You have run all of the following commands locally:
|
- You have run all of the following commands locally:
|
||||||
- `yarn fmt`
|
- `npm run fmt`
|
||||||
- `yarn tsc`
|
- `npm run tsc`
|
||||||
- `yarn test`
|
- `npm run test`
|
||||||
- Here they are all together: `yarn fmt && yarn tsc && yarn test`
|
- Here they are all together: `npm run fmt && npm run tsc && npm run test`
|
||||||
|
|
||||||
## Release a new version
|
## Release a new version
|
||||||
|
|
||||||
@ -198,13 +198,13 @@ If the prompt doesn't show up, start the app in command line to grab the electro
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Windows (PowerShell)
|
# Windows (PowerShell)
|
||||||
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
./Zoo Modeling App-{version}-{arch}-linux.AppImage
|
./Zoo Design Studio-{version}-{arch}-linux.AppImage
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 4. Publish the release
|
#### 4. Publish the release
|
||||||
@ -250,55 +250,29 @@ You will need a `./e2e/playwright/playwright-secrets.env` file:
|
|||||||
$ touch ./e2e/playwright/playwright-secrets.env
|
$ touch ./e2e/playwright/playwright-secrets.env
|
||||||
$ cat ./e2e/playwright/playwright-secrets.env
|
$ cat ./e2e/playwright/playwright-secrets.env
|
||||||
token=<dev.zoo.dev/account/api-tokens>
|
token=<dev.zoo.dev/account/api-tokens>
|
||||||
snapshottoken=<your-snapshot-token>
|
snapshottoken=<zoo.dev/account/api-tokens>
|
||||||
```
|
```
|
||||||
|
or use `export` to set the environment variables `token` and `snapshottoken`.
|
||||||
|
|
||||||
For a portable way to run Playwright you'll need Docker.
|
#### Snapshot tests (Google Chrome on Ubuntu only)
|
||||||
|
|
||||||
#### Generic example
|
Only Ubunu and Google Chrome is supported for the set of tests evaluating screenshot snapshots.
|
||||||
|
If you don't run Ubuntu locally or in a VM, you may use a GitHub Codespace.
|
||||||
After that, open a terminal and run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker run --network host --rm --init -it playwright/chrome:playwright-x.xx.x
|
|
||||||
```
|
```
|
||||||
|
npm run playwright -- install chrome
|
||||||
and in another terminal, run:
|
npm run test:snapshots
|
||||||
|
|
||||||
```bash
|
|
||||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
|
||||||
```
|
```
|
||||||
|
You may use `-- --update-snapshots` as needed.
|
||||||
|
|
||||||
#### Specific example
|
#### Electron flow tests (Chromium on Ubuntu, macOS, Windows)
|
||||||
|
|
||||||
open a terminal and run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker run --network host --rm --init -it playwright/chrome:playwright-1.46.0
|
|
||||||
```
|
|
||||||
|
|
||||||
and in another terminal, run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
**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
|
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn playwright test --headed
|
npm run playwright -- install chromium
|
||||||
|
npm run test:playwright:electron:local
|
||||||
```
|
```
|
||||||
|
You may use `-- -g "my test"` to match specific test titles, or `-- path/to/file.spec.ts` for a test file.
|
||||||
|
|
||||||
run with step through debugger
|
#### Debugger
|
||||||
|
|
||||||
```
|
|
||||||
PWDEBUG=1 yarn playwright test
|
|
||||||
```
|
|
||||||
|
|
||||||
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
||||||
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
|
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
|
||||||
@ -308,7 +282,7 @@ Or comment out browsers in `playwright.config.ts`.
|
|||||||
|
|
||||||
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
||||||
|
|
||||||
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `yarn playwright codegen -b wk --load-storage ./store localhost:3000`
|
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `npm run playwright codegen -b wk --load-storage ./store localhost:3000`
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
@ -351,21 +325,21 @@ However because much of our tests involve clicking in the stream at specific loc
|
|||||||
If you already haven't, run the following:
|
If you already haven't, run the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn
|
npm
|
||||||
yarn build:wasm
|
npm run build:wasm
|
||||||
yarn start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
and finally:
|
and finally:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test:unit
|
npm run test:unit
|
||||||
```
|
```
|
||||||
|
|
||||||
For individual testing:
|
For individual testing:
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
npm run test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
||||||
```
|
```
|
||||||
|
|
||||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
||||||
@ -439,16 +413,16 @@ Part of the CI CD pipeline performs static analysis on the code. Use the followi
|
|||||||
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test-setup
|
npm run test-setup
|
||||||
```
|
```
|
||||||
|
|
||||||
> Gotcha, are packages up to date and is the wasm built?
|
> Gotcha, are packages up to date and is the wasm built?
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn tsc
|
npm run tsc
|
||||||
yarn fmt-check
|
npm run fmt:check
|
||||||
yarn lint
|
npm run lint
|
||||||
yarn test:unit:local
|
npm run test:unit:local
|
||||||
```
|
```
|
||||||
|
|
||||||
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
||||||
@ -460,10 +434,10 @@ yarn test:unit:local
|
|||||||
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn test:playwright:electron:local
|
npm run test:playwright:electron:local
|
||||||
yarn test:playwright:electron:windows:local
|
npm run test:playwright:electron:windows:local
|
||||||
yarn test:playwright:electron:macos:local
|
npm run test:playwright:electron:macos:local
|
||||||
yarn test:playwright:electron:ubuntu:local
|
npm run test:playwright:electron:ubuntu:local
|
||||||
```
|
```
|
||||||
|
|
||||||
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
||||||
|
48
biome.json
Normal file
48
biome.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
|
||||||
|
"organizeImports": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true,
|
||||||
|
"correctness": {
|
||||||
|
"noUnusedVariables": "error"
|
||||||
|
},
|
||||||
|
"suspicious": {
|
||||||
|
"noExplicitAny": "warn"
|
||||||
|
},
|
||||||
|
"style": {
|
||||||
|
"useBlockStatements": "error",
|
||||||
|
"useShorthandArrayType": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"formatter": {
|
||||||
|
"enabled": true,
|
||||||
|
"indentWidth": 2,
|
||||||
|
"indentStyle": "space",
|
||||||
|
"lineWidth": 80,
|
||||||
|
"formatWithErrors": true
|
||||||
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"quoteStyle": "single",
|
||||||
|
"jsxQuoteStyle": "double",
|
||||||
|
"trailingCommas": "es5",
|
||||||
|
"semicolons": "asNeeded"
|
||||||
|
},
|
||||||
|
"parser": {
|
||||||
|
"unsafeParameterDecoratorsEnabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"css": {
|
||||||
|
"parser": {
|
||||||
|
"cssModules": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"ignore": ["**/*.json"]
|
||||||
|
}
|
||||||
|
}
|
@ -36,9 +36,9 @@ myAngle = -120
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [8, 0])
|
|> line(end = [8, 0])
|
||||||
|> angledLine({ angle = abs(myAngle), length = 5 }, %)
|
|> angledLine(angle = abs(myAngle), length = 5)
|
||||||
|> line(end = [-5, 0])
|
|> line(end = [-5, 0])
|
||||||
|> angledLine({ angle = myAngle, length = 5 }, %)
|
|> angledLine(angle = myAngle, length = 5)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
baseExtrusion = extrude(sketch001, length = 5)
|
baseExtrusion = extrude(sketch001, length = 5)
|
||||||
|
@ -33,10 +33,7 @@ acos(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(acos(0.5)), length = 10)
|
||||||
angle = toDegrees(acos(0.5)),
|
|
||||||
length = 10
|
|
||||||
}, %)
|
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> line(endAbsolute = [12, 0])
|
|> line(endAbsolute = [12, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -36,7 +36,7 @@ angleToMatchLengthX(
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [2, 5], tag = $seg01)
|
|> line(end = [2, 5], tag = $seg01)
|
||||||
|> angledLineToX([-angleToMatchLengthX(seg01, 7, %), 10], %)
|
|> angledLine(angle = -angleToMatchLengthX(seg01, 7, %), endAbsoluteX = 10)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
extrusion = extrude(sketch001, length = 5)
|
extrusion = extrude(sketch001, length = 5)
|
||||||
|
@ -36,10 +36,7 @@ angleToMatchLengthY(
|
|||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [1, 2], tag = $seg01)
|
|> line(end = [1, 2], tag = $seg01)
|
||||||
|> angledLine({
|
|> angledLine(angle = angleToMatchLengthY(seg01, 15, %), length = 5)
|
||||||
angle = angleToMatchLengthY(seg01, 15, %),
|
|
||||||
length = 5
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -10,8 +10,13 @@ Draw a line segment relative to the current origin using the polar measure of so
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
angledLine(
|
angledLine(
|
||||||
data: AngledLineData,
|
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
|
angle: number,
|
||||||
|
length?: number,
|
||||||
|
lengthX?: number,
|
||||||
|
lengthY?: number,
|
||||||
|
endAbsoluteX?: number,
|
||||||
|
endAbsoluteY?: number,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -21,9 +26,14 @@ angledLine(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `length` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `lengthX` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||||
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -36,7 +46,7 @@ angledLine(
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> yLine(endAbsolute = 15)
|
|> yLine(endAbsolute = 15)
|
||||||
|> angledLine({ angle = 30, length = 15 }, %)
|
|> angledLine(angle = 30, length = 15)
|
||||||
|> line(end = [8, -10])
|
|> line(end = [8, -10])
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -10,8 +10,10 @@ Draw an angled line from the current origin, constructing a line segment such th
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
angledLineThatIntersects(
|
angledLineThatIntersects(
|
||||||
data: AngledLineThatIntersectsData,
|
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
|
angle: number,
|
||||||
|
intersectTag: TagIdentifier,
|
||||||
|
offset?: number,
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -21,9 +23,11 @@ angledLineThatIntersects(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
| `intersectTag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | The tag of the line to intersect with | Yes |
|
||||||
|
| `offset` | [`number`](/docs/kcl/types/number) | The offset from the intersecting line. Defaults to 0. | No |
|
||||||
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -38,11 +42,7 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> line(endAbsolute = [5, 10])
|
|> line(endAbsolute = [5, 10])
|
||||||
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
||||||
|> line(endAbsolute = [0, 20])
|
|> line(endAbsolute = [0, 20])
|
||||||
|> angledLineThatIntersects({
|
|> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)
|
||||||
angle = 80,
|
|
||||||
intersectTag = lineToIntersect,
|
|
||||||
offset = 10
|
|
||||||
}, %)
|
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 10)
|
example = extrude(exampleSketch, length = 10)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -33,10 +33,7 @@ asin(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(asin(0.5)), length = 20)
|
||||||
angle = toDegrees(asin(0.5)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ atan(num: number): number
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(atan(1.25)), length = 20)
|
||||||
angle = toDegrees(atan(1.25)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ atan2(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
|
| `y` | [`number`](/docs/kcl/types/number) | Y | Yes |
|
||||||
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
|
| `x` | [`number`](/docs/kcl/types/number) | X | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -37,10 +37,7 @@ atan2(
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XZ)
|
sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = toDegrees(atan2(y = 1.25, x = 2)), length = 20)
|
||||||
angle = toDegrees(atan2(1.25, 2)),
|
|
||||||
length = 20
|
|
||||||
}, %)
|
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ part001 = cube([0, 0], 20)
|
|||||||
// We tag the chamfer to reference it later.
|
// We tag the chamfer to reference it later.
|
||||||
|> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
|
|> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
|
||||||
|
|
||||||
sketch001 = startSketchOn(part001, chamfer1)
|
sketch001 = startSketchOn(part001, face = chamfer1)
|
||||||
|> startProfileAt([10, 10], %)
|
|> startProfileAt([10, 10], %)
|
||||||
|> line(end = [2, 0])
|
|> line(end = [2, 0])
|
||||||
|> line(end = [0, 2])
|
|> line(end = [0, 2])
|
||||||
|
@ -9,13 +9,14 @@ layout: manual
|
|||||||
|
|
||||||
### `std`
|
### `std`
|
||||||
|
|
||||||
- [`HALF_TURN`](/docs/kcl/consts/std-HALF_TURN)
|
- [`END`](/docs/kcl/consts/std-END)
|
||||||
- [`QUARTER_TURN`](/docs/kcl/consts/std-QUARTER_TURN)
|
- [`START`](/docs/kcl/consts/std-START)
|
||||||
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-THREE_QUARTER_TURN)
|
- [`X`](/docs/kcl/consts/std-X)
|
||||||
- [`XY`](/docs/kcl/consts/std-XY)
|
- [`XY`](/docs/kcl/consts/std-XY)
|
||||||
- [`XZ`](/docs/kcl/consts/std-XZ)
|
- [`XZ`](/docs/kcl/consts/std-XZ)
|
||||||
|
- [`Y`](/docs/kcl/consts/std-Y)
|
||||||
- [`YZ`](/docs/kcl/consts/std-YZ)
|
- [`YZ`](/docs/kcl/consts/std-YZ)
|
||||||
- [`ZERO`](/docs/kcl/consts/std-ZERO)
|
- [`Z`](/docs/kcl/consts/std-Z)
|
||||||
|
|
||||||
### `std::math`
|
### `std::math`
|
||||||
|
|
||||||
@ -23,3 +24,10 @@ layout: manual
|
|||||||
- [`PI`](/docs/kcl/consts/std-math-PI)
|
- [`PI`](/docs/kcl/consts/std-math-PI)
|
||||||
- [`TAU`](/docs/kcl/consts/std-math-TAU)
|
- [`TAU`](/docs/kcl/consts/std-math-TAU)
|
||||||
|
|
||||||
|
### `std::turns`
|
||||||
|
|
||||||
|
- [`HALF_TURN`](/docs/kcl/consts/std-turns-HALF_TURN)
|
||||||
|
- [`QUARTER_TURN`](/docs/kcl/consts/std-turns-QUARTER_TURN)
|
||||||
|
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-turns-THREE_QUARTER_TURN)
|
||||||
|
- [`ZERO`](/docs/kcl/consts/std-turns-ZERO)
|
||||||
|
|
||||||
|
15
docs/kcl/consts/std-END.md
Normal file
15
docs/kcl/consts/std-END.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::END"
|
||||||
|
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::END: string = 'end'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::HALF_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::HALF_TURN: number(deg) = 180deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::QUARTER_TURN: number(deg) = 90deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-START.md
Normal file
15
docs/kcl/consts/std-START.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::START"
|
||||||
|
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::START: string = 'start'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::THREE_QUARTER_TURN"
|
|
||||||
excerpt: ""
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
std::THREE_QUARTER_TURN: number(deg) = 270deg
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::ZERO"
|
title: "std::X"
|
||||||
excerpt: ""
|
excerpt: ""
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
@ -9,7 +9,7 @@ layout: manual
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
std::ZERO: number = 0
|
std::X
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-Y.md
Normal file
15
docs/kcl/consts/std-Y.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::Y"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::Y
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-Z.md
Normal file
15
docs/kcl/consts/std-Z.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::Z"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::Z
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -17,10 +17,10 @@ std::math::E: number = 2.71828182845904523536028747135266250_
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 2 * E ^ 2,
|
length = 2 * E ^ 2,
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_
|
|||||||
circumference = 70
|
circumference = 70
|
||||||
|
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> circle(center = [0, 0], radius = circumference/ (2 * PI))
|
|> circle(center = [0, 0], radius = circumference / (2 * PI))
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
```
|
```
|
||||||
|
@ -17,10 +17,10 @@ std::math::TAU: number = 6.28318530717958647692528676655900577_
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 10 * TAU,
|
length = 10 * TAU,
|
||||||
}, %)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
15
docs/kcl/consts/std-turns-HALF_TURN.md
Normal file
15
docs/kcl/consts/std-turns-HALF_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::turns::HALF_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::turns::HALF_TURN: number(deg) = 180deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-turns-QUARTER_TURN.md
Normal file
15
docs/kcl/consts/std-turns-QUARTER_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::turns::QUARTER_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::turns::QUARTER_TURN: number(deg) = 90deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-turns-THREE_QUARTER_TURN.md
Normal file
15
docs/kcl/consts/std-turns-THREE_QUARTER_TURN.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::turns::THREE_QUARTER_TURN"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||||
|
```
|
||||||
|
|
||||||
|
|
15
docs/kcl/consts/std-turns-ZERO.md
Normal file
15
docs/kcl/consts/std-turns-ZERO.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "std::turns::ZERO"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
std::turns::ZERO: number = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ e(): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|
|> angledLine(angle = 30, length = 2 * e() ^ 2)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
45
docs/kcl/fromCm.md
Normal file
45
docs/kcl/fromCm.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
@ -30,10 +30,10 @@ getNextAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -30,10 +30,10 @@ getOppositeEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -30,10 +30,10 @@ getPreviousAdjacentEdge(tag: TagIdentifier): Uuid
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> angledLine({ angle = 60, length = 10 }, %)
|
|> angledLine(angle = 60, length = 10)
|
||||||
|> angledLine({ angle = 120, length = 10 }, %)
|
|> angledLine(angle = 120, length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|
|> angledLine(angle = 240, length = 10, tag = $referenceEdge)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -65,15 +65,15 @@ case = startSketchOn(-XZ)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, face = END)
|
||||||
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, face = END)
|
||||||
|> circle(center = [size / 2, -size / 2], radius = 25)
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "KCL Standard Library"
|
title: "KCL Standard Library"
|
||||||
excerpt: "Documentation for the KCL standard library for the Zoo Modeling App."
|
excerpt: "Documentation for the KCL standard library for the Zoo Design Studio."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -22,30 +22,30 @@ layout: manual
|
|||||||
* [`string`](kcl/types/string)
|
* [`string`](kcl/types/string)
|
||||||
* [`tag`](kcl/types/tag)
|
* [`tag`](kcl/types/tag)
|
||||||
* **std**
|
* **std**
|
||||||
|
* [`Axis2d`](kcl/types/Axis2d)
|
||||||
|
* [`Axis3d`](kcl/types/Axis3d)
|
||||||
|
* [`END`](kcl/consts/std-END)
|
||||||
|
* [`Edge`](kcl/types/Edge)
|
||||||
* [`Face`](kcl/types/Face)
|
* [`Face`](kcl/types/Face)
|
||||||
* [`HALF_TURN`](kcl/consts/std-HALF_TURN)
|
|
||||||
* [`Helix`](kcl/types/Helix)
|
* [`Helix`](kcl/types/Helix)
|
||||||
* [`Plane`](kcl/types/Plane)
|
* [`Plane`](kcl/types/Plane)
|
||||||
* [`Point2d`](kcl/types/Point2d)
|
* [`Point2d`](kcl/types/Point2d)
|
||||||
* [`Point3d`](kcl/types/Point3d)
|
* [`Point3d`](kcl/types/Point3d)
|
||||||
* [`QUARTER_TURN`](kcl/consts/std-QUARTER_TURN)
|
* [`START`](kcl/consts/std-START)
|
||||||
* [`Sketch`](kcl/types/Sketch)
|
* [`Sketch`](kcl/types/Sketch)
|
||||||
* [`Solid`](kcl/types/Solid)
|
* [`Solid`](kcl/types/Solid)
|
||||||
* [`THREE_QUARTER_TURN`](kcl/consts/std-THREE_QUARTER_TURN)
|
* [`X`](kcl/consts/std-X)
|
||||||
* [`XY`](kcl/consts/std-XY)
|
* [`XY`](kcl/consts/std-XY)
|
||||||
* [`XZ`](kcl/consts/std-XZ)
|
* [`XZ`](kcl/consts/std-XZ)
|
||||||
|
* [`Y`](kcl/consts/std-Y)
|
||||||
* [`YZ`](kcl/consts/std-YZ)
|
* [`YZ`](kcl/consts/std-YZ)
|
||||||
* [`ZERO`](kcl/consts/std-ZERO)
|
* [`Z`](kcl/consts/std-Z)
|
||||||
* [`abs`](kcl/abs)
|
* [`abs`](kcl/abs)
|
||||||
* [`acos`](kcl/acos)
|
* [`acos`](kcl/acos)
|
||||||
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
|
||||||
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
* [`angleToMatchLengthY`](kcl/angleToMatchLengthY)
|
||||||
* [`angledLine`](kcl/angledLine)
|
* [`angledLine`](kcl/angledLine)
|
||||||
* [`angledLineOfXLength`](kcl/angledLineOfXLength)
|
|
||||||
* [`angledLineOfYLength`](kcl/angledLineOfYLength)
|
|
||||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||||
* [`angledLineToX`](kcl/angledLineToX)
|
|
||||||
* [`angledLineToY`](kcl/angledLineToY)
|
|
||||||
* [`appearance`](kcl/appearance)
|
* [`appearance`](kcl/appearance)
|
||||||
* [`arc`](kcl/arc)
|
* [`arc`](kcl/arc)
|
||||||
* [`arcTo`](kcl/arcTo)
|
* [`arcTo`](kcl/arcTo)
|
||||||
@ -63,19 +63,24 @@ layout: manual
|
|||||||
* [`chamfer`](kcl/chamfer)
|
* [`chamfer`](kcl/chamfer)
|
||||||
* [`circleThreePoint`](kcl/circleThreePoint)
|
* [`circleThreePoint`](kcl/circleThreePoint)
|
||||||
* [`close`](kcl/close)
|
* [`close`](kcl/close)
|
||||||
* [`cm`](kcl/cm)
|
|
||||||
* [`extrude`](kcl/extrude)
|
* [`extrude`](kcl/extrude)
|
||||||
* [`fillet`](kcl/fillet)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`floor`](kcl/floor)
|
* [`floor`](kcl/floor)
|
||||||
* [`ft`](kcl/ft)
|
* [`fromCm`](kcl/fromCm)
|
||||||
|
* [`fromFt`](kcl/fromFt)
|
||||||
|
* [`fromInches`](kcl/fromInches)
|
||||||
|
* [`fromM`](kcl/fromM)
|
||||||
|
* [`fromMm`](kcl/fromMm)
|
||||||
|
* [`fromYd`](kcl/fromYd)
|
||||||
* [`getCommonEdge`](kcl/getCommonEdge)
|
* [`getCommonEdge`](kcl/getCommonEdge)
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||||
* [`helix`](kcl/helix)
|
* [`helix`](kcl/std-helix)
|
||||||
* [`hole`](kcl/hole)
|
* [`hole`](kcl/hole)
|
||||||
* [`hollow`](kcl/hollow)
|
* [`hollow`](kcl/hollow)
|
||||||
* [`inch`](kcl/inch)
|
* [`intersect`](kcl/intersect)
|
||||||
|
* [`involuteCircular`](kcl/involuteCircular)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
* [`legAngX`](kcl/legAngX)
|
* [`legAngX`](kcl/legAngX)
|
||||||
@ -87,12 +92,9 @@ layout: manual
|
|||||||
* [`log`](kcl/log)
|
* [`log`](kcl/log)
|
||||||
* [`log10`](kcl/log10)
|
* [`log10`](kcl/log10)
|
||||||
* [`log2`](kcl/log2)
|
* [`log2`](kcl/log2)
|
||||||
* [`m`](kcl/m)
|
|
||||||
* [`map`](kcl/map)
|
* [`map`](kcl/map)
|
||||||
* [`max`](kcl/max)
|
* [`max`](kcl/max)
|
||||||
* [`min`](kcl/min)
|
* [`min`](kcl/min)
|
||||||
* [`mirror2d`](kcl/mirror2d)
|
|
||||||
* [`mm`](kcl/mm)
|
|
||||||
* [`offsetPlane`](kcl/offsetPlane)
|
* [`offsetPlane`](kcl/offsetPlane)
|
||||||
* [`patternCircular2d`](kcl/patternCircular2d)
|
* [`patternCircular2d`](kcl/patternCircular2d)
|
||||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||||
@ -100,7 +102,6 @@ layout: manual
|
|||||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||||
* [`patternTransform`](kcl/patternTransform)
|
* [`patternTransform`](kcl/patternTransform)
|
||||||
* [`patternTransform2d`](kcl/patternTransform2d)
|
* [`patternTransform2d`](kcl/patternTransform2d)
|
||||||
* [`polar`](kcl/polar)
|
|
||||||
* [`polygon`](kcl/polygon)
|
* [`polygon`](kcl/polygon)
|
||||||
* [`pop`](kcl/pop)
|
* [`pop`](kcl/pop)
|
||||||
* [`pow`](kcl/pow)
|
* [`pow`](kcl/pow)
|
||||||
@ -110,7 +111,7 @@ layout: manual
|
|||||||
* [`push`](kcl/push)
|
* [`push`](kcl/push)
|
||||||
* [`reduce`](kcl/reduce)
|
* [`reduce`](kcl/reduce)
|
||||||
* [`rem`](kcl/rem)
|
* [`rem`](kcl/rem)
|
||||||
* [`revolve`](kcl/revolve)
|
* [`revolve`](kcl/std-revolve)
|
||||||
* [`rotate`](kcl/rotate)
|
* [`rotate`](kcl/rotate)
|
||||||
* [`round`](kcl/round)
|
* [`round`](kcl/round)
|
||||||
* [`scale`](kcl/scale)
|
* [`scale`](kcl/scale)
|
||||||
@ -126,23 +127,29 @@ layout: manual
|
|||||||
* [`sqrt`](kcl/sqrt)
|
* [`sqrt`](kcl/sqrt)
|
||||||
* [`startProfileAt`](kcl/startProfileAt)
|
* [`startProfileAt`](kcl/startProfileAt)
|
||||||
* [`startSketchOn`](kcl/startSketchOn)
|
* [`startSketchOn`](kcl/startSketchOn)
|
||||||
|
* [`subtract`](kcl/subtract)
|
||||||
* [`sweep`](kcl/sweep)
|
* [`sweep`](kcl/sweep)
|
||||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||||
* [`tangentialArc`](kcl/tangentialArc)
|
* [`tangentialArc`](kcl/tangentialArc)
|
||||||
* [`tangentialArcTo`](kcl/tangentialArcTo)
|
|
||||||
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
|
|
||||||
* [`toDegrees`](kcl/toDegrees)
|
* [`toDegrees`](kcl/toDegrees)
|
||||||
* [`toRadians`](kcl/toRadians)
|
* [`toRadians`](kcl/toRadians)
|
||||||
* [`translate`](kcl/translate)
|
* [`translate`](kcl/translate)
|
||||||
|
* [`union`](kcl/union)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`xLine`](kcl/xLine)
|
||||||
* [`yLine`](kcl/yLine)
|
* [`yLine`](kcl/yLine)
|
||||||
* [`yd`](kcl/yd)
|
|
||||||
* **std::math**
|
* **std::math**
|
||||||
* [`E`](kcl/consts/std-math-E)
|
* [`E`](kcl/consts/std-math-E)
|
||||||
* [`PI`](kcl/consts/std-math-PI)
|
* [`PI`](kcl/consts/std-math-PI)
|
||||||
* [`TAU`](kcl/consts/std-math-TAU)
|
* [`TAU`](kcl/consts/std-math-TAU)
|
||||||
* [`cos`](kcl/std-math-cos)
|
* [`cos`](kcl/std-math-cos)
|
||||||
|
* [`polar`](kcl/std-math-polar)
|
||||||
* [`sin`](kcl/std-math-sin)
|
* [`sin`](kcl/std-math-sin)
|
||||||
* [`tan`](kcl/std-math-tan)
|
* [`tan`](kcl/std-math-tan)
|
||||||
* **std::sketch**
|
* **std::sketch**
|
||||||
* [`circle`](kcl/std-sketch-circle)
|
* [`circle`](kcl/std-sketch-circle)
|
||||||
|
* [`mirror2d`](kcl/std-sketch-mirror2d)
|
||||||
|
* **std::turns**
|
||||||
|
* [`turns::HALF_TURN`](kcl/consts/std-turns-HALF_TURN)
|
||||||
|
* [`turns::QUARTER_TURN`](kcl/consts/std-turns-QUARTER_TURN)
|
||||||
|
* [`turns::THREE_QUARTER_TURN`](kcl/consts/std-turns-THREE_QUARTER_TURN)
|
||||||
|
* [`turns::ZERO`](kcl/consts/std-turns-ZERO)
|
||||||
|
File diff suppressed because one or more lines are too long
57
docs/kcl/involuteCircular.md
Normal file
57
docs/kcl/involuteCircular.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "KCL Known Issues"
|
title: "KCL Known Issues"
|
||||||
excerpt: "Known issues with the KCL standard library for the Zoo Modeling App."
|
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ line(
|
|||||||
```js
|
```js
|
||||||
triangle = startSketchOn(XZ)
|
triangle = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
// The 'end' argument means it ends at exactly [10, 0].
|
// The END argument means it ends at exactly [10, 0].
|
||||||
// This is an absolute measurement, it is NOT relative to
|
// This is an absolute measurement, it is NOT relative to
|
||||||
// the start of the sketch.
|
// the start of the sketch.
|
||||||
|> line(endAbsolute = [10, 0])
|
|> line(endAbsolute = [10, 0])
|
||||||
|
@ -33,10 +33,7 @@ max(args: [number]): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 70, length = max(15, 31, 4, 13, 22))
|
||||||
angle = 70,
|
|
||||||
length = max(15, 31, 4, 13, 22)
|
|
||||||
}, %)
|
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -33,10 +33,7 @@ min(args: [number]): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({
|
|> angledLine(angle = 70, length = min(15, 31, 4, 13, 22))
|
||||||
angle = 70,
|
|
||||||
length = min(15, 31, 4, 13, 22)
|
|
||||||
}, %)
|
|
||||||
|> line(end = [20, 0])
|
|> line(end = [20, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "KCL Modules"
|
title: "KCL Modules"
|
||||||
excerpt: "Documentation of modules for the KCL language for the Zoo Modeling App."
|
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ import "tests/inputs/cube.obj"
|
|||||||
When importing a GLTF file, the bin file will be imported as well.
|
When importing a GLTF file, the bin file will be imported as well.
|
||||||
|
|
||||||
Import paths are relative to the current project directory. Imports currently only work when
|
Import paths are relative to the current project directory. Imports currently only work when
|
||||||
using the native Modeling App, not in the browser.
|
using the native Design Studio, not in the browser.
|
||||||
|
|
||||||
### Supported values
|
### Supported values
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ offsetPlane(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
|
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. XY) which this new plane is created from. | Yes |
|
||||||
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
|
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -57,15 +57,15 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close(%)
|
|> close(%)
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, face = END)
|
||||||
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
thing2 = startSketchOn(case, 'end')
|
thing2 = startSketchOn(case, face = END)
|
||||||
|> circle(center = [size / 2, -size / 2], radius = 25)
|
|> circle(center = [size / 2, -size / 2], radius = 25)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
@ -88,11 +88,11 @@ case = startSketchOn(XY)
|
|||||||
|> startProfileAt([-size, -size], %)
|
|> startProfileAt([-size, -size], %)
|
||||||
|> line(end = [2 * size, 0])
|
|> line(end = [2 * size, 0])
|
||||||
|> line(end = [0, 2 * size])
|
|> line(end = [0, 2 * size])
|
||||||
|> tangentialArcTo([-size, size], %)
|
|> tangentialArc(endAbsolute = [-size, size])
|
||||||
|> close(%)
|
|> close(%)
|
||||||
|> extrude(length = 65)
|
|> extrude(length = 65)
|
||||||
|
|
||||||
thing1 = startSketchOn(case, 'end')
|
thing1 = startSketchOn(case, face = END)
|
||||||
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
|> circle(center = [-size / 2, -size / 2], radius = 25)
|
||||||
|> extrude(length = 50)
|
|> extrude(length = 50)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -37,7 +37,7 @@ pow(
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 50, length = pow(5, 2) }, %)
|
|> angledLine(angle = 50, length = pow(5, 2))
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -29,11 +29,8 @@ profileStart(sketch: Sketch): [number]
|
|||||||
```js
|
```js
|
||||||
sketch001 = startSketchOn(XY)
|
sketch001 = startSketchOn(XY)
|
||||||
|> startProfileAt([5, 2], %)
|
|> startProfileAt([5, 2], %)
|
||||||
|> angledLine({ angle = 120, length = 50 }, %, $seg01)
|
|> angledLine(angle = 120, length = 50, tag = $seg01)
|
||||||
|> angledLine({
|
|> angledLine(angle = segAng(seg01) + 120, length = 50)
|
||||||
angle = segAng(seg01) + 120,
|
|
||||||
length = 50
|
|
||||||
}, %)
|
|
||||||
|> line(end = profileStart(%))
|
|> line(end = profileStart(%))
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 20)
|
|> extrude(length = 20)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -78,7 +78,7 @@ assertEqual(sum, 6, 0.00001, "1 + 2 + 3 summed is 6")
|
|||||||
```js
|
```js
|
||||||
// Declare a function that sketches a decagon.
|
// Declare a function that sketches a decagon.
|
||||||
fn decagon(radius) {
|
fn decagon(radius) {
|
||||||
// Each side of the decagon is turned this many degrees from the previous angle.
|
// Each side of the decagon is turned this many radians from the previous angle.
|
||||||
stepAngle = 1 / 10 * TAU
|
stepAngle = 1 / 10 * TAU
|
||||||
|
|
||||||
// Start the decagon sketch at this point.
|
// Start the decagon sketch at this point.
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -32,9 +32,9 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> line(end = [5, 10], tag = $seg01)
|
|> line(end = [5, 10], tag = $seg01)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine([segAng(seg01), 10], %)
|
|> angledLine(angle = segAng(seg01), length = 10)
|
||||||
|> line(end = [-10, 0])
|
|> line(end = [-10, 0])
|
||||||
|> angledLine([segAng(seg01), -15], %)
|
|> angledLine(angle = segAng(seg01), length = -15)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 4)
|
example = extrude(exampleSketch, length = 4)
|
||||||
|
@ -29,9 +29,9 @@ segLen(tag: TagIdentifier): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 60, length = 10 }, %, $thing)
|
|> angledLine(angle = 60, length = 10, tag = $thing)
|
||||||
|> tangentialArc({ offset = -120, radius = 5 }, %)
|
|> tangentialArc(angle = -120, radius = 5)
|
||||||
|> angledLine({ angle = -60, length = segLen(thing) }, %)
|
|> angledLine(angle = -60, length = segLen(thing))
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
example = extrude(exampleSketch, length = 5)
|
example = extrude(exampleSketch, length = 5)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: "KCL Settings"
|
title: "KCL Settings"
|
||||||
excerpt: "Documentation of settings for the KCL language and Zoo Modeling App."
|
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
# KCL Settings
|
# KCL Settings
|
||||||
|
|
||||||
There are three levels of settings available in the KittyCAD modeling application:
|
There are three levels of settings available in Zoo Design Studio:
|
||||||
|
|
||||||
1. [User Settings](/docs/kcl/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
1. [User Settings](/docs/kcl/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
||||||
2. [Project Settings](/docs/kcl/settings/project): Settings specific to a project, stored in `project.toml`
|
2. [Project Settings](/docs/kcl/settings/project): Settings specific to a project, stored in `project.toml`
|
||||||
@ -14,7 +14,7 @@ There are three levels of settings available in the KittyCAD modeling applicatio
|
|||||||
|
|
||||||
## Configuration Files
|
## Configuration Files
|
||||||
|
|
||||||
The KittyCAD modeling app uses TOML files for configuration:
|
Zoo Design Studio uses TOML files for configuration:
|
||||||
|
|
||||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user)
|
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user)
|
||||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project)
|
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project)
|
||||||
|
@ -35,7 +35,7 @@ base_unit = "in"
|
|||||||
|
|
||||||
#### app
|
#### app
|
||||||
|
|
||||||
The settings for the modeling app.
|
The settings for the Design Studio.
|
||||||
|
|
||||||
|
|
||||||
**Default:** None
|
**Default:** None
|
||||||
|
@ -37,7 +37,7 @@ text_wrapping = false
|
|||||||
|
|
||||||
#### app
|
#### app
|
||||||
|
|
||||||
The settings for the modeling app.
|
The settings for the Design Studio.
|
||||||
|
|
||||||
|
|
||||||
**Default:** None
|
**Default:** None
|
||||||
@ -96,7 +96,7 @@ Permanently dismiss the banner warning to download the desktop app. This setting
|
|||||||
|
|
||||||
##### stream_idle_mode
|
##### stream_idle_mode
|
||||||
|
|
||||||
When the user is idle, and this is true, the stream will be torn down.
|
When the user is idle, teardown the stream after some time.
|
||||||
|
|
||||||
|
|
||||||
**Default:** None
|
**Default:** None
|
||||||
|
File diff suppressed because one or more lines are too long
@ -33,7 +33,7 @@ sqrt(num: number): number
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine({ angle = 50, length = sqrt(2500) }, %)
|
|> angledLine(angle = 50, length = sqrt(2500))
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user