Compare commits
	
		
			4 Commits
		
	
	
		
			v0.21.7
			...
			lee/native
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8b0510a244 | |||
| 5c6483ae67 | |||
| 7700d01403 | |||
| b212ff4470 | 
| @ -1,3 +1,3 @@ | |||||||
| [codespell] | [codespell] | ||||||
| ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast | ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo | ||||||
| skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas | skip: **/target,node_modules,build,**/Cargo.lock | ||||||
|  | |||||||
| @ -3,4 +3,3 @@ VITE_KC_API_BASE_URL=https://api.dev.zoo.dev | |||||||
| VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | ||||||
| VITE_KC_SKIP_AUTH=false | VITE_KC_SKIP_AUTH=false | ||||||
| VITE_KC_CONNECTION_TIMEOUT_MS=5000 | VITE_KC_CONNECTION_TIMEOUT_MS=5000 | ||||||
| VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local" |  | ||||||
|  | |||||||
							
								
								
									
										12
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -9,27 +9,15 @@ updates: | |||||||
|       directory: '/' # Location of package manifests |       directory: '/' # Location of package manifests | ||||||
|       schedule: |       schedule: | ||||||
|           interval: 'daily' |           interval: 'daily' | ||||||
|       reviewers: |  | ||||||
|           - franknoirot  |  | ||||||
|           - irev-dev |  | ||||||
|     - package-ecosystem: 'github-actions' # See documentation for possible values |     - package-ecosystem: 'github-actions' # See documentation for possible values | ||||||
|       directory: '/' # Location of package manifests |       directory: '/' # Location of package manifests | ||||||
|       schedule: |       schedule: | ||||||
|           interval: 'daily' |           interval: 'daily' | ||||||
|       reviewers: |  | ||||||
|           - adamchalmers |  | ||||||
|           - jessfraz |  | ||||||
|     - package-ecosystem: 'cargo' # See documentation for possible values |     - package-ecosystem: 'cargo' # See documentation for possible values | ||||||
|       directory: '/src/wasm-lib/' # Location of package manifests |       directory: '/src/wasm-lib/' # Location of package manifests | ||||||
|       schedule: |       schedule: | ||||||
|           interval: 'daily' |           interval: 'daily' | ||||||
|       reviewers: |  | ||||||
|           - adamchalmers |  | ||||||
|           - jessfraz |  | ||||||
|     - package-ecosystem: 'cargo' # See documentation for possible values |     - package-ecosystem: 'cargo' # See documentation for possible values | ||||||
|       directory: '/src-tauri/' # Location of package manifests |       directory: '/src-tauri/' # Location of package manifests | ||||||
|       schedule: |       schedule: | ||||||
|           interval: 'daily' |           interval: 'daily' | ||||||
|       reviewers: |  | ||||||
|           - adamchalmers |  | ||||||
|           - jessfraz |  | ||||||
|  | |||||||
							
								
								
									
										33
									
								
								.github/workflows/build-and-store-wasm.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -1,33 +0,0 @@ | |||||||
| name: Build and Store WASM |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   push: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   build-and-upload: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/checkout@v4 |  | ||||||
|       - uses: actions/setup-node@v4 |  | ||||||
|         with: |  | ||||||
|           node-version-file: '.nvmrc' |  | ||||||
|           cache: 'yarn' |  | ||||||
|       - name: Install dependencies |  | ||||||
|         run: yarn |  | ||||||
|       - name: Setup Rust |  | ||||||
|         uses: dtolnay/rust-toolchain@stable |  | ||||||
|       - name: Cache wasm |  | ||||||
|         uses: Swatinem/rust-cache@v2 |  | ||||||
|         with: |  | ||||||
|           workspaces: './src/wasm-lib' |  | ||||||
|       - name: build wasm |  | ||||||
|         run: yarn build:wasm |  | ||||||
|  |  | ||||||
|  |  | ||||||
|       # Upload the WASM bundle as an artifact |  | ||||||
|       - uses: actions/upload-artifact@v3 |  | ||||||
|         with: |  | ||||||
|           name: wasm-bundle |  | ||||||
|           path: src/wasm-lib/pkg |  | ||||||
| @ -3,55 +3,48 @@ on: | |||||||
|     branches: |     branches: | ||||||
|       - main |       - main | ||||||
|     paths: |     paths: | ||||||
|       - 'src-tauri/**.rs' |       - '**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|       - .github/workflows/cargo-test-tauri.yml |       - .github/workflows/cargo-build.yml | ||||||
|   pull_request: |   pull_request: | ||||||
|     paths: |     paths: | ||||||
|       - 'src-tauri/**.rs' |       - '**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|       - .github/workflows/cargo-test-tauri.yml |       - .github/workflows/cargo-build.yml | ||||||
|   workflow_dispatch: |  | ||||||
| permissions: read-all |  | ||||||
| concurrency: | concurrency: | ||||||
|   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
|   cancel-in-progress: true |   cancel-in-progress: true | ||||||
| name: cargo test of tauri | name: cargo build | ||||||
| jobs: | jobs: | ||||||
|   cargotest: |   cargobuild: | ||||||
|     name: cargo test |     name: cargo build | ||||||
|     runs-on: ubuntu-latest-8-cores |     runs-on: ubuntu-latest | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         dir: ['src-tauri'] |         dir: ['src/wasm-lib'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|  | 
 | ||||||
|       - name: Install latest rust |       - name: Install latest rust | ||||||
|         uses: actions-rs/toolchain@v1 |         uses: actions-rs/toolchain@v1 | ||||||
|         with: |         with: | ||||||
|             toolchain: stable |             toolchain: stable | ||||||
|             override: true |             override: true | ||||||
|  | 
 | ||||||
|       - name: install dependencies |       - name: install dependencies | ||||||
|         if: matrix.dir ==  'src-tauri' |         if: matrix.dir ==  'src-tauri' | ||||||
|         run: | |         run: | | ||||||
|           sudo apt-get update |           sudo apt-get update | ||||||
|           sudo apt-get install -y \ |           sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | ||||||
|             libgtk-3-dev \ |  | ||||||
|             libayatana-appindicator3-dev \ |  | ||||||
|             webkit2gtk-driver \ |  | ||||||
|             libsoup-3.0-dev \ |  | ||||||
|             libjavascriptcoregtk-4.1-dev \ |  | ||||||
|             libwebkit2gtk-4.1-dev \ |  | ||||||
|             at-spi2-core \ |  | ||||||
|             xvfb |  | ||||||
|       - name: Rust Cache |       - name: Rust Cache | ||||||
|         uses: Swatinem/rust-cache@v2.6.1 |         uses: Swatinem/rust-cache@v2.6.1 | ||||||
|       - name: cargo test | 
 | ||||||
|         shell: bash |       - name: Run cargo build | ||||||
|         run: |- |         run: | | ||||||
|           cd "${{ matrix.dir }}" |           cd "${{ matrix.dir }}" | ||||||
|           cargo test --all |           cargo build --all | ||||||
|  |         shell: bash | ||||||
							
								
								
									
										23
									
								
								.github/workflows/cargo-clippy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -9,6 +9,12 @@ on: | |||||||
|       - '**.rs' |       - '**.rs' | ||||||
|       - .github/workflows/cargo-clippy.yml |       - .github/workflows/cargo-clippy.yml | ||||||
|   pull_request: |   pull_request: | ||||||
|  |     paths: | ||||||
|  |       - '**/Cargo.toml' | ||||||
|  |       - '**/Cargo.lock' | ||||||
|  |       - '**/rust-toolchain.toml' | ||||||
|  |       - '**.rs' | ||||||
|  |       - .github/workflows/cargo-build.yml | ||||||
| concurrency: | concurrency: | ||||||
|   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
|   cancel-in-progress: true |   cancel-in-progress: true | ||||||
| @ -19,7 +25,7 @@ jobs: | |||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         dir: ['src/wasm-lib', 'src-tauri'] |         dir: ['src/wasm-lib'] | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|       - name: Install latest rust |       - name: Install latest rust | ||||||
| @ -31,22 +37,9 @@ jobs: | |||||||
|  |  | ||||||
|       - name: install dependencies |       - name: install dependencies | ||||||
|         if: matrix.dir ==  'src-tauri' |         if: matrix.dir ==  'src-tauri' | ||||||
|         shell: bash |  | ||||||
|         run: | |         run: | | ||||||
|           sudo apt-get update |           sudo apt-get update | ||||||
|           sudo apt-get install -y \ |           sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | ||||||
|             libgtk-3-dev \ |  | ||||||
|             libayatana-appindicator3-dev \ |  | ||||||
|             webkit2gtk-driver \ |  | ||||||
|             libsoup-3.0-dev \ |  | ||||||
|             libjavascriptcoregtk-4.1-dev \ |  | ||||||
|             libwebkit2gtk-4.1-dev \ |  | ||||||
|             at-spi2-core \ |  | ||||||
|             xvfb |  | ||||||
|           yarn install |  | ||||||
|           yarn build:wasm |  | ||||||
|           yarn build:local |  | ||||||
|  |  | ||||||
|       - name: Rust Cache |       - name: Rust Cache | ||||||
|         uses: Swatinem/rust-cache@v2.6.1 |         uses: Swatinem/rust-cache@v2.6.1 | ||||||
|  |  | ||||||
|  | |||||||
| @ -7,23 +7,23 @@ on: | |||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|       - .github/workflows/cargo-bench.yml |       - .github/workflows/cargo-criterion.yml | ||||||
|   pull_request: |   pull_request: | ||||||
|     paths: |     paths: | ||||||
|       - '**.rs' |       - '**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|       - .github/workflows/cargo-bench.yml |       - .github/workflows/cargo-criterion.yml | ||||||
|   workflow_dispatch: |   workflow_dispatch: | ||||||
| permissions: read-all | permissions: read-all | ||||||
| concurrency: | concurrency: | ||||||
|   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
|   cancel-in-progress: true |   cancel-in-progress: true | ||||||
| name: cargo bench | name: cargo criterion | ||||||
| jobs: | jobs: | ||||||
|   cargo-bench: |   cargocriterion: | ||||||
|     name: Benchmark with iai |     name: cargo criterion | ||||||
|     runs-on: ubuntu-latest-8-cores |     runs-on: ubuntu-latest-8-cores | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
| @ -31,12 +31,10 @@ jobs: | |||||||
|       - name: Install dependencies |       - name: Install dependencies | ||||||
|         run: | |         run: | | ||||||
|           cargo install cargo-criterion |           cargo install cargo-criterion | ||||||
|           sudo apt update |  | ||||||
|           sudo apt install -y valgrind |  | ||||||
|       - name: Rust Cache |       - name: Rust Cache | ||||||
|         uses: Swatinem/rust-cache@v2.6.1 |         uses: Swatinem/rust-cache@v2.6.1 | ||||||
|       - name: Benchmark kcl library |       - name: Benchmark kcl library | ||||||
|         shell: bash |         shell: bash | ||||||
|         run: |- |         run: |- | ||||||
|           cd src/wasm-lib/kcl; cargo bench -- iai |           cd src/wasm-lib/kcl; cargo criterion | ||||||
| 
 | 
 | ||||||
							
								
								
									
										4
									
								
								.github/workflows/cargo-test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -3,7 +3,7 @@ on: | |||||||
|     branches: |     branches: | ||||||
|       - main |       - main | ||||||
|     paths: |     paths: | ||||||
|       - 'src/wasm-lib/**.rs' |       - src/wasm-lib/**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
| @ -11,7 +11,7 @@ on: | |||||||
|  |  | ||||||
|   pull_request: |   pull_request: | ||||||
|     paths: |     paths: | ||||||
|       - 'src/wasm-lib/**.rs' |       - src/wasm-lib/**.rs' | ||||||
|       - '**/Cargo.toml' |       - '**/Cargo.toml' | ||||||
|       - '**/Cargo.lock' |       - '**/Cargo.lock' | ||||||
|       - '**/rust-toolchain.toml' |       - '**/rust-toolchain.toml' | ||||||
|  | |||||||
							
								
								
									
										36
									
								
								.github/workflows/check-exampleKcl.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -1,36 +0,0 @@ | |||||||
| name: Check Onboarding KCL |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   pull_request: |  | ||||||
|     types: [opened, synchronize] |  | ||||||
|     paths: |  | ||||||
|       - 'src/lib/exampleKcl.ts' |  | ||||||
|  |  | ||||||
| permissions: |  | ||||||
|   contents: read |  | ||||||
|   issues: write |  | ||||||
|   pull-requests: write |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   comment: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout repository |  | ||||||
|         uses: actions/checkout@v4 |  | ||||||
|  |  | ||||||
|       - name: Comment on PR |  | ||||||
|         uses: actions/github-script@v7 |  | ||||||
|         with: |  | ||||||
|           script: | |  | ||||||
|             const message = '`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 owner = context.repo.owner; |  | ||||||
|             const repo = context.repo.repo; |  | ||||||
|  |  | ||||||
|             // Post a comment on the PR |  | ||||||
|             await github.rest.issues.createComment({ |  | ||||||
|               owner, |  | ||||||
|               repo, |  | ||||||
|               issue_number, |  | ||||||
|               body: message, |  | ||||||
|             }); |  | ||||||
							
								
								
									
										146
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -13,7 +13,7 @@ on: | |||||||
|   # Will checkout the last commit from the default branch (main as of 2023-10-04) |   # Will checkout the last commit from the default branch (main as of 2023-10-04) | ||||||
|  |  | ||||||
| env: | env: | ||||||
|   BUILD_RELEASE: ${{ github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'Cut release v')) }} |   BUILD_RELEASE: ${{ github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'Cut release v') }} | ||||||
|  |  | ||||||
| concurrency: | concurrency: | ||||||
|   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |   group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||||||
| @ -104,11 +104,7 @@ jobs: | |||||||
|         run: | |         run: | | ||||||
|           VERSION=$(date +'%-y.%-m.%-d') yarn bump-jsons |           VERSION=$(date +'%-y.%-m.%-d') yarn bump-jsons | ||||||
|           echo "$(jq --arg url 'https://dl.zoo.dev/releases/modeling-app/nightly/last_update.json' \ |           echo "$(jq --arg url 'https://dl.zoo.dev/releases/modeling-app/nightly/last_update.json' \ | ||||||
|             '.plugins.updater.endpoints[]=$url' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json |             '.tauri.updater.endpoints[]=$url' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json | ||||||
|           echo "$(jq --arg id 'dev.zoo.modeling-app-nightly' \ |  | ||||||
|             '.identifier=$id' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json |  | ||||||
|           echo "$(jq --arg name 'Zoo Modeling App (Nightly)' \ |  | ||||||
|             '.productName=$name' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json |  | ||||||
|  |  | ||||||
|       - uses: actions/upload-artifact@v3 |       - uses: actions/upload-artifact@v3 | ||||||
|         if: github.event_name == 'schedule' |         if: github.event_name == 'schedule' | ||||||
| @ -129,11 +125,6 @@ jobs: | |||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         os: [macos-14, ubuntu-latest, windows-latest] |         os: [macos-14, ubuntu-latest, windows-latest] | ||||||
|     env: |  | ||||||
|       # Specific Apple Universal target for macos |  | ||||||
|       TAURI_ARGS_MACOS: ${{ matrix.os == 'macos-14' && '--target universal-apple-darwin' || '' }} |  | ||||||
|       # Only build executable on linux (no appimage or deb) |  | ||||||
|       TAURI_ARGS_UBUNTU: ${{ matrix.os == 'ubuntu-latest' && '--bundles' || '' }} |  | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v4 |       - uses: actions/checkout@v4 | ||||||
|  |  | ||||||
| @ -149,16 +140,14 @@ jobs: | |||||||
|  |  | ||||||
|       - name: Install ubuntu system dependencies |       - name: Install ubuntu system dependencies | ||||||
|         if: matrix.os == 'ubuntu-latest' |         if: matrix.os == 'ubuntu-latest' | ||||||
|         run: | |         run: > | ||||||
|           sudo apt-get update |           sudo apt-get update && | ||||||
|           sudo apt-get install -y \ |           sudo apt-get install -y | ||||||
|             libgtk-3-dev \ |           libgtk-3-dev | ||||||
|             libayatana-appindicator3-dev \ |           libgtksourceview-3.0-dev | ||||||
|             webkit2gtk-driver \ |           webkit2gtk-4.0 | ||||||
|             libsoup-3.0-dev \ |           libappindicator3-dev | ||||||
|             libjavascriptcoregtk-4.1-dev \ |           webkit2gtk-driver | ||||||
|             libwebkit2gtk-4.1-dev \ |  | ||||||
|             at-spi2-core \ |  | ||||||
|           xvfb |           xvfb | ||||||
|  |  | ||||||
|       - name: Sync node version and setup cache |       - name: Sync node version and setup cache | ||||||
| @ -172,9 +161,7 @@ jobs: | |||||||
|       - name: Setup Rust |       - name: Setup Rust | ||||||
|         uses: dtolnay/rust-toolchain@stable |         uses: dtolnay/rust-toolchain@stable | ||||||
|  |  | ||||||
|       # TODO: re-enable for Windows builds, see https://github.com/tauri-apps/tauri/issues/9045 |  | ||||||
|       - name: Setup Rust cache |       - name: Setup Rust cache | ||||||
|         if: matrix.os != 'windows-latest' |  | ||||||
|         uses: swatinem/rust-cache@v2 |         uses: swatinem/rust-cache@v2 | ||||||
|         with: |         with: | ||||||
|           workspaces: './src-tauri -> target' |           workspaces: './src-tauri -> target' | ||||||
| @ -237,104 +224,14 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           includeRelease: false |           includeRelease: false | ||||||
|           includeDebug: true |           includeDebug: true | ||||||
|           args: "${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}" |           args: ${{ matrix.os == 'macos-14' && '--target universal-apple-darwin' || '' }} | ||||||
|  |  | ||||||
|       - name: Build for Mac TestFlight (nightly) |  | ||||||
|         if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }} |  | ||||||
|         shell: bash |  | ||||||
|         run: | |  | ||||||
|           unset APPLE_SIGNING_IDENTITY |  | ||||||
|           unset APPLE_CERTIFICATE |  | ||||||
|           sign_app="3rd Party Mac Developer Application: KittyCAD Inc (${APPLE_TEAM_ID})" |  | ||||||
|           sign_install="3rd Party Mac Developer Installer: KittyCAD Inc (${APPLE_TEAM_ID})" |  | ||||||
|           profile="src-tauri/entitlements/Mac_App_Distribution.provisionprofile" |  | ||||||
|  |  | ||||||
|           mkdir -p src-tauri/entitlements |  | ||||||
|           echo -n "${APPLE_STORE_PROVISIONING_PROFILE}" | base64 --decode -o "${profile}" |  | ||||||
|  |  | ||||||
|           echo -n "${APPLE_STORE_DISTRIBUTION_CERT}" | base64 --decode -o "dist.cer" |  | ||||||
|           echo -n "${APPLE_STORE_INSTALLER_CERT}" | base64 --decode -o "installer.cer" |  | ||||||
|  |  | ||||||
|           KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db |  | ||||||
|           KEYCHAIN_PASSWORD="password" |  | ||||||
|  |  | ||||||
|           # create temporary keychain |  | ||||||
|           security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH |  | ||||||
|           security set-keychain-settings -lut 21600 $KEYCHAIN_PATH |  | ||||||
|           security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH |  | ||||||
|  |  | ||||||
|           # import certificate to keychain |  | ||||||
|           security import "dist.cer" -P "$APPLE_STORE_P12_PASSWORD" -k $KEYCHAIN_PATH -f pkcs12 -t cert -A |  | ||||||
|           security import "installer.cer" -P "$APPLE_STORE_P12_PASSWORD" -k $KEYCHAIN_PATH -f pkcs12 -t cert -A |  | ||||||
|  |  | ||||||
|           security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH |  | ||||||
|           security list-keychain -d user -s $KEYCHAIN_PATH |  | ||||||
|  |  | ||||||
|           target="universal-apple-darwin" |  | ||||||
|  |  | ||||||
|           # Turn off the default target |  | ||||||
|           # We don't want to install the updater for the apple store build |  | ||||||
|           sed -i.bu "s/default =/# default =/" src-tauri/Cargo.toml |  | ||||||
|           rm src-tauri/Cargo.toml.bu |  | ||||||
|           git diff src-tauri/Cargo.toml |  | ||||||
|  |  | ||||||
|           yarn tauri build --target "${target}" --verbose --config src-tauri/tauri.app-store.conf.json |  | ||||||
|  |  | ||||||
|           app_path="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.app" |  | ||||||
|           build_name="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.pkg" |  | ||||||
|           cp_dir="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.app/Contents/embedded.provisionprofile" |  | ||||||
|           entitlements="src-tauri/entitlements/app-store.entitlements" |  | ||||||
|  |  | ||||||
|           cp "${profile}" "${cp_dir}" |  | ||||||
|  |  | ||||||
|           codesign --deep --force -s "${sign_app}" --entitlements "${entitlements}" "${app_path}" |  | ||||||
|  |  | ||||||
|           productbuild --component "${app_path}" /Applications/ --sign "${sign_install}" "${build_name}" |  | ||||||
|  |  | ||||||
|           # Undo the changes to the Cargo.toml |  | ||||||
|           git checkout src-tauri/Cargo.toml |  | ||||||
|  |  | ||||||
|         env: |  | ||||||
|           APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |  | ||||||
|           APPLE_STORE_PROVISIONING_PROFILE: ${{ secrets.APPLE_STORE_PROVISIONING_PROFILE }} |  | ||||||
|           APPLE_STORE_DISTRIBUTION_CERT: ${{ secrets.APPLE_STORE_DISTRIBUTION_CERT }} |  | ||||||
|           APPLE_STORE_INSTALLER_CERT: ${{ secrets.APPLE_STORE_INSTALLER_CERT }} |  | ||||||
|           APPLE_STORE_P12_PASSWORD: ${{ secrets.APPLE_STORE_P12_PASSWORD }} |  | ||||||
|  |  | ||||||
|  |  | ||||||
|       - name: 'Upload to Mac TestFlight (nightly)' |  | ||||||
|         uses: apple-actions/upload-testflight-build@v1 |  | ||||||
|         if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }} |  | ||||||
|         with: |  | ||||||
|           app-path: 'src-tauri/target/universal-apple-darwin/release/bundle/macos/Zoo Modeling App.pkg' |  | ||||||
|           issuer-id: ${{ secrets.APPLE_STORE_ISSUER_ID }} |  | ||||||
|           api-key-id: ${{ secrets.APPLE_STORE_API_KEY_ID }} |  | ||||||
|           api-private-key: ${{ secrets.APPLE_STORE_API_PRIVATE_KEY }} |  | ||||||
|           app-type: osx |  | ||||||
|  |  | ||||||
|  |  | ||||||
|       - name: Clean up after Mac TestFlight (nightly) |  | ||||||
|         if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }} |  | ||||||
|         shell: bash |  | ||||||
|         run: | |  | ||||||
|           git status |  | ||||||
|           # remove our target builds because we want to make sure the later build |  | ||||||
|           # includes the updater, and that anything we changed with the target |  | ||||||
|           # does not persist |  | ||||||
|           rm -rf src-tauri/target |  | ||||||
|           # Lets get rid of the info.plist for the normal mac builds since its |  | ||||||
|           # being sketchy. |  | ||||||
|           rm src-tauri/Info.plist |  | ||||||
|  |  | ||||||
|       # We do this after the apple store because the apple store build is |  | ||||||
|       # specific and we want to overwrite it with the this new build after and |  | ||||||
|       # not upload the apple store build to the public bucket |  | ||||||
|       - name: Build the app (release) and sign |       - name: Build the app (release) and sign | ||||||
|         uses: tauri-apps/tauri-action@v0 |         uses: tauri-apps/tauri-action@v0 | ||||||
|         if: ${{ env.BUILD_RELEASE == 'true' }} |         if: ${{ env.BUILD_RELEASE == 'true' }} | ||||||
|         env: |         env: | ||||||
|           TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |           TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||||||
|           TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |           TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | ||||||
|           APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} |           APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||||||
|           APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |           APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||||||
|           APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} |           APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | ||||||
| @ -343,7 +240,7 @@ jobs: | |||||||
|           APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |           APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||||||
|           TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}" |           TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}" | ||||||
|         with: |         with: | ||||||
|           args: "${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}" |           args: "${{ matrix.os == 'macos-14' && '--target universal-apple-darwin' || '' }} ${{ env.TAURI_CONF_ARGS }}" | ||||||
|  |  | ||||||
|       - uses: actions/upload-artifact@v3 |       - uses: actions/upload-artifact@v3 | ||||||
|         if: matrix.os != 'ubuntu-latest' |         if: matrix.os != 'ubuntu-latest' | ||||||
| @ -354,9 +251,9 @@ jobs: | |||||||
|           path: "${{ env.PREFIX }}/${{ env.MODE }}/bundle/*/*" |           path: "${{ env.PREFIX }}/${{ env.MODE }}/bundle/*/*" | ||||||
|  |  | ||||||
|       - name: Run e2e tests (linux only) |       - name: Run e2e tests (linux only) | ||||||
|         if: ${{ matrix.os == 'ubuntu-latest' && github.event_name != 'release' && github.event_name != 'schedule' }} |         if: matrix.os == 'ubuntu-latest' | ||||||
|         run: | |         run: | | ||||||
|           cargo install tauri-driver --force |           cargo install tauri-driver@0.1.3 | ||||||
|           source .env.${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }} |           source .env.${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }} | ||||||
|           export VITE_KC_API_BASE_URL |           export VITE_KC_API_BASE_URL | ||||||
|           xvfb-run yarn test:e2e:tauri |           xvfb-run yarn test:e2e:tauri | ||||||
| @ -376,7 +273,6 @@ jobs: | |||||||
|       NOTES: ${{ github.event_name == 'release' && github.event.release.body || format('Nightly build, commit {0}', github.sha) }} |       NOTES: ${{ github.event_name == 'release' && github.event.release.body || format('Nightly build, commit {0}', github.sha) }} | ||||||
|       BUCKET_DIR: ${{ github.event_name == 'release' && 'dl.kittycad.io/releases/modeling-app' || 'dl.kittycad.io/releases/modeling-app/nightly' }} |       BUCKET_DIR: ${{ github.event_name == 'release' && 'dl.kittycad.io/releases/modeling-app' || 'dl.kittycad.io/releases/modeling-app/nightly' }} | ||||||
|       WEBSITE_DIR: ${{ github.event_name == 'release' && 'dl.zoo.dev/releases/modeling-app' || 'dl.zoo.dev/releases/modeling-app/nightly' }} |       WEBSITE_DIR: ${{ github.event_name == 'release' && 'dl.zoo.dev/releases/modeling-app' || 'dl.zoo.dev/releases/modeling-app/nightly' }} | ||||||
|       URL_CODED_NAME: ${{ github.event_name == 'schedule' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }} |  | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/download-artifact@v3 |       - uses: actions/download-artifact@v3 | ||||||
|  |  | ||||||
| @ -391,9 +287,9 @@ jobs: | |||||||
|             --arg pub_date "${PUB_DATE}" \ |             --arg pub_date "${PUB_DATE}" \ | ||||||
|             --arg notes "${NOTES}" \ |             --arg notes "${NOTES}" \ | ||||||
|             --arg darwin_sig "$DARWIN_SIG" \ |             --arg darwin_sig "$DARWIN_SIG" \ | ||||||
|             --arg darwin_url "$RELEASE_DIR/macos/${{ env.URL_CODED_NAME }}.app.tar.gz" \ |             --arg darwin_url "$RELEASE_DIR/macos/Zoo%20Modeling%20App.app.tar.gz" \ | ||||||
|             --arg windows_sig "$WINDOWS_SIG" \ |             --arg windows_sig "$WINDOWS_SIG" \ | ||||||
|             --arg windows_url "$RELEASE_DIR/msi/${{ env.URL_CODED_NAME }}_${VERSION_NO_V}_x64_en-US.msi.zip" \ |             --arg windows_url "$RELEASE_DIR/msi/Zoo%20Modeling%20App_${VERSION_NO_V}_x64_en-US.msi.zip" \ | ||||||
|             '{ |             '{ | ||||||
|               "version": $version, |               "version": $version, | ||||||
|               "pub_date": $pub_date, |               "pub_date": $pub_date, | ||||||
| @ -422,8 +318,8 @@ jobs: | |||||||
|             --arg version "${VERSION}" \ |             --arg version "${VERSION}" \ | ||||||
|             --arg pub_date "${PUB_DATE}" \ |             --arg pub_date "${PUB_DATE}" \ | ||||||
|             --arg notes "${NOTES}" \ |             --arg notes "${NOTES}" \ | ||||||
|             --arg darwin_url "$RELEASE_DIR/dmg/${{ env.URL_CODED_NAME }}_${VERSION_NO_V}_universal.dmg" \ |             --arg darwin_url "$RELEASE_DIR/dmg/Zoo%20Modeling%20App_${VERSION_NO_V}_universal.dmg" \ | ||||||
|             --arg windows_url "$RELEASE_DIR/msi/${{ env.URL_CODED_NAME }}_${VERSION_NO_V}_x64_en-US.msi" \ |             --arg windows_url "$RELEASE_DIR/msi/Zoo%20Modeling%20App_${VERSION_NO_V}_x64_en-US.msi" \ | ||||||
|             '{ |             '{ | ||||||
|               "version": $version, |               "version": $version, | ||||||
|               "pub_date": $pub_date, |               "pub_date": $pub_date, | ||||||
| @ -440,7 +336,7 @@ jobs: | |||||||
|             cat last_download.json |             cat last_download.json | ||||||
|  |  | ||||||
|       - name: Authenticate to Google Cloud |       - name: Authenticate to Google Cloud | ||||||
|         uses: 'google-github-actions/auth@v2.1.3' |         uses: 'google-github-actions/auth@v2.1.2' | ||||||
|         with: |         with: | ||||||
|           credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' |           credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}' | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										37
									
								
								.github/workflows/create-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -1,37 +0,0 @@ | |||||||
| name: Create Release |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   push: |  | ||||||
|     branches: |  | ||||||
|       - main |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|   create-release: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     permissions: |  | ||||||
|       contents: write |  | ||||||
|       pull-requests: read |  | ||||||
|     if: contains(github.event.head_commit.message, 'Cut release v') |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/github-script@v7 |  | ||||||
|         name: Read Cut release PR info and create release |  | ||||||
|         with: |  | ||||||
|           script: | |  | ||||||
|             const { owner, repo } = context.repo |  | ||||||
|             const pulls = await github.rest.repos.listPullRequestsAssociatedWithCommit({ |  | ||||||
|               owner, |  | ||||||
|               repo, |  | ||||||
|               commit_sha: context.sha, |  | ||||||
|             }) |  | ||||||
|             const { title, body } = pulls.data[0] |  | ||||||
|             const version = title.split('Cut release ')[1] |  | ||||||
|  |  | ||||||
|             const result = await github.rest.repos.createRelease({ |  | ||||||
|               owner, |  | ||||||
|               repo, |  | ||||||
|               body, |  | ||||||
|               tag_name: version, |  | ||||||
|               name: version, |  | ||||||
|               draft: true, |  | ||||||
|             }) |  | ||||||
|             console.log(result) |  | ||||||
							
								
								
									
										3
									
								
								.github/workflows/generate-website-docs.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -56,9 +56,6 @@ jobs: | |||||||
|           gh pr create --title "Update KCL docs" \ |           gh pr create --title "Update KCL docs" \ | ||||||
|               --body "Updating the generated kcl docs cc @jessfraz @franknoirot merge this" \ |               --body "Updating the generated kcl docs cc @jessfraz @franknoirot merge this" \ | ||||||
|               --head "$NEW_BRANCH" \ |               --head "$NEW_BRANCH" \ | ||||||
|               --reviewer jessfraz \ |  | ||||||
|               --reviewer irev-dev \ |  | ||||||
|               --reviewer franknoirot \ |  | ||||||
|               --base main || true |               --base main || true | ||||||
|         env: |         env: | ||||||
|           GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |           GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||||||
|  | |||||||
							
								
								
									
										87
									
								
								.github/workflows/playwright.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -9,34 +9,10 @@ concurrency: | |||||||
|   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||||||
|   cancel-in-progress: true |   cancel-in-progress: true | ||||||
|  |  | ||||||
| permissions: |  | ||||||
|   contents: write |  | ||||||
|   pull-requests: write |  | ||||||
|   actions: read |  | ||||||
|    |  | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|  |  | ||||||
|   check-rust-changes: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     outputs: |  | ||||||
|       rust-changed: ${{ steps.filter.outputs.rust }} |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - uses: actions/checkout@v4 |  | ||||||
|  |  | ||||||
|       - id: filter |  | ||||||
|         name: Check for Rust changes |  | ||||||
|         uses: dorny/paths-filter@v3 |  | ||||||
|         with: |  | ||||||
|           filters: | |  | ||||||
|             rust: |  | ||||||
|               - 'src/wasm-lib/**' |  | ||||||
|  |  | ||||||
|   playwright-ubuntu: |   playwright-ubuntu: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: ubuntu-latest-8-cores |     runs-on: ubuntu-latest-8-cores | ||||||
|     needs: check-rust-changes |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
| @ -48,38 +24,13 @@ jobs: | |||||||
|       run: yarn |       run: yarn | ||||||
|     - name: Install Playwright Browsers |     - name: Install Playwright Browsers | ||||||
|       run: yarn playwright install --with-deps |       run: yarn playwright install --with-deps | ||||||
|     - name: Download Wasm Cache |  | ||||||
|       id: download-wasm |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'false' |  | ||||||
|       uses: dawidd6/action-download-artifact@v3 |  | ||||||
|       continue-on-error: true |  | ||||||
|       with: |  | ||||||
|         github_token: ${{secrets.GITHUB_TOKEN}} |  | ||||||
|         name: wasm-bundle |  | ||||||
|         workflow: build-and-store-wasm.yml |  | ||||||
|         branch: main |  | ||||||
|         path: src/wasm-lib/pkg |  | ||||||
|     - name: copy wasm blob |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'false' |  | ||||||
|       run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public |  | ||||||
|       continue-on-error: true |  | ||||||
|     - name: Setup Rust |     - name: Setup Rust | ||||||
|       uses: dtolnay/rust-toolchain@stable |       uses: dtolnay/rust-toolchain@stable | ||||||
|     - name: Cache Wasm (because rust diff) |     - name: Cache wasm | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'true' |  | ||||||
|       uses: Swatinem/rust-cache@v2 |       uses: Swatinem/rust-cache@v2 | ||||||
|       with: |       with: | ||||||
|         workspaces: './src/wasm-lib' |         workspaces: './src/wasm-lib' | ||||||
|     - name: OR Cache Wasm (because wasm cache failed) |     - name: build wasm | ||||||
|       if: steps.download-wasm.outcome == 'failure' |  | ||||||
|       uses: Swatinem/rust-cache@v2 |  | ||||||
|       with: |  | ||||||
|         workspaces: './src/wasm-lib' |  | ||||||
|     - name: Build Wasm (because rust diff) |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'true' |  | ||||||
|       run: yarn build:wasm |  | ||||||
|     - name: OR Build Wasm (because wasm cache failed) |  | ||||||
|       if: steps.download-wasm.outcome == 'failure' |  | ||||||
|       run: yarn build:wasm |       run: yarn build:wasm | ||||||
|     - name: build web |     - name: build web | ||||||
|       run: yarn build:local |       run: yarn build:local | ||||||
| @ -115,7 +66,7 @@ jobs: | |||||||
|         git fetch origin |         git fetch origin | ||||||
|         echo ${{ github.head_ref }} |         echo ${{ github.head_ref }} | ||||||
|         git checkout ${{ github.head_ref }} |         git checkout ${{ github.head_ref }} | ||||||
|         # TODO when webkit works on ubuntu remove the os part of the commit message |         # TODO when safari works on ubuntu remove the os part of the commit message | ||||||
|         git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true |         git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true | ||||||
|         git push |         git push | ||||||
|         git push origin ${{ github.head_ref }} |         git push origin ${{ github.head_ref }} | ||||||
| @ -134,7 +85,6 @@ jobs: | |||||||
|   playwright-macos: |   playwright-macos: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: macos-14 |     runs-on: macos-14 | ||||||
|     needs: check-rust-changes |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
| @ -145,43 +95,18 @@ jobs: | |||||||
|       run: yarn |       run: yarn | ||||||
|     - name: Install Playwright Browsers |     - name: Install Playwright Browsers | ||||||
|       run: yarn playwright install --with-deps |       run: yarn playwright install --with-deps | ||||||
|     - name: Download Wasm Cache |  | ||||||
|       id: download-wasm |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'false' |  | ||||||
|       uses: dawidd6/action-download-artifact@v3 |  | ||||||
|       continue-on-error: true |  | ||||||
|       with: |  | ||||||
|         github_token: ${{secrets.GITHUB_TOKEN}} |  | ||||||
|         name: wasm-bundle |  | ||||||
|         workflow: build-and-store-wasm.yml |  | ||||||
|         branch: main |  | ||||||
|         path: src/wasm-lib/pkg |  | ||||||
|     - name: copy wasm blob |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'false' |  | ||||||
|       run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public |  | ||||||
|       continue-on-error: true |  | ||||||
|     - name: Setup Rust |     - name: Setup Rust | ||||||
|       uses: dtolnay/rust-toolchain@stable |       uses: dtolnay/rust-toolchain@stable | ||||||
|     - name: Cache Wasm (because rust diff) |     - name: Cache wasm | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'true' |  | ||||||
|       uses: Swatinem/rust-cache@v2 |       uses: Swatinem/rust-cache@v2 | ||||||
|       with: |       with: | ||||||
|         workspaces: './src/wasm-lib' |         workspaces: './src/wasm-lib' | ||||||
|     - name: OR Cache Wasm (because wasm cache failed) |     - name: build wasm | ||||||
|       if: steps.download-wasm.outcome == 'failure' |  | ||||||
|       uses: Swatinem/rust-cache@v2 |  | ||||||
|       with: |  | ||||||
|         workspaces: './src/wasm-lib' |  | ||||||
|     - name: Build Wasm (because rust diff) |  | ||||||
|       if: needs.check-rust-changes.outputs.rust-changed == 'true' |  | ||||||
|       run: yarn build:wasm |  | ||||||
|     - name: OR Build Wasm (because wasm cache failed) |  | ||||||
|       if: steps.download-wasm.outcome == 'failure' |  | ||||||
|       run: yarn build:wasm |       run: yarn build:wasm | ||||||
|     - name: build web |     - name: build web | ||||||
|       run: yarn build:local |       run: yarn build:local | ||||||
|     - name: Run macos/safari flow |     - name: Run macos/safari flow | ||||||
|       # webkit doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues) |       # safari doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues) | ||||||
|       # TODO remove this and the matrix and run all tests on ubuntu when this is fixed |       # TODO remove this and the matrix and run all tests on ubuntu when this is fixed | ||||||
|       run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts |       run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts | ||||||
|       env: |       env: | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @ -51,7 +51,5 @@ e2e/playwright/export-snapshots/* | |||||||
|  |  | ||||||
| ## generated files | ## generated files | ||||||
| src/**/*.typegen.ts | src/**/*.typegen.ts | ||||||
| src-tauri/gen |  | ||||||
|  |  | ||||||
| src/wasm-lib/grackle/stdlib_cube_partial.json | src/wasm-lib/grackle/stdlib_cube_partial.json | ||||||
| Mac_App_Distribution.provisionprofile |  | ||||||
|  | |||||||
							
								
								
									
										31
									
								
								README.md
									
									
									
									
									
								
							
							
						
						| @ -60,12 +60,6 @@ followed by: | |||||||
| yarn build:wasm-dev | yarn build:wasm-dev | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| or if you have the gh cli installed |  | ||||||
|  |  | ||||||
| ``` |  | ||||||
| ./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| 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) | ||||||
|  |  | ||||||
| finally, to run the web app only, run: | finally, to run the web app only, run: | ||||||
| @ -74,13 +68,7 @@ finally, to run the web app only, run: | |||||||
| yarn start | yarn start | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| If you're not an KittyCAD employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens ofcourse, 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. | ## Developing in Chrome | ||||||
|  |  | ||||||
| ### Development environment variables |  | ||||||
|  |  | ||||||
| The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service. |  | ||||||
|  |  | ||||||
| ### Developing in Chrome |  | ||||||
|  |  | ||||||
| Chrome is in the process of rolling out a new default which | Chrome is in the process of rolling out a new default which | ||||||
| [blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/). | [blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/). | ||||||
| @ -102,7 +90,6 @@ yarn test | |||||||
| 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. | ||||||
|  |  | ||||||
| For running the rust (not tauri rust though) only, you can | For running the rust (not tauri rust though) only, you can | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| cd src/wasm-lib | cd src/wasm-lib | ||||||
| cargo test | cargo test | ||||||
| @ -165,7 +152,6 @@ console.log( | |||||||
| - `) | - `) | ||||||
| ) | ) | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| grab the md list and delete any that are older than the last bump | grab the md list and delete any that are older than the last bump | ||||||
|  |  | ||||||
| 2. Merge the PR | 2. Merge the PR | ||||||
| @ -195,26 +181,23 @@ $ cargo +nightly fuzz run parser | |||||||
| For more information on fuzzing you can check out | For more information on fuzzing you can check out | ||||||
| [this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html). | [this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html). | ||||||
|  |  | ||||||
|  |  | ||||||
| ### Playwright | ### Playwright | ||||||
|  |  | ||||||
| First time running plawright locally, you'll need to add the secrets file | First time running plawright locally, you'll need to add the secrets file | ||||||
|  |  | ||||||
| ```bash | ```bash | ||||||
| touch ./e2e/playwright/playwright-secrets.env | touch ./e2e/playwright/playwright-secrets.env | ||||||
| printf 'token="your-token"\nsnapshottoken="your-snapshot-token"' > ./e2e/playwright/playwright-secrets.env | printf 'token="your-token"\nsnapshottoken="your-snapshot-token"' > ./e2e/playwright/playwright-secrets.env | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens | then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens | ||||||
|  |  | ||||||
| then: | then: | ||||||
| run playwright | run playwright | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| yarn playwright test | yarn playwright test | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| run a specific test suite | run a specific test suite | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| yarn playwright test src/e2e-tests/example.spec.ts | yarn playwright test src/e2e-tests/example.spec.ts | ||||||
| ``` | ``` | ||||||
| @ -223,17 +206,14 @@ run a specific test change the test from `test('...` to `test.only('...` | |||||||
| (note if you commit this, the tests will instantly fail without running any of the tests) | (note if you commit this, the tests will instantly fail without running any of the tests) | ||||||
|  |  | ||||||
| run headed | run headed | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| yarn playwright test --headed | yarn playwright test --headed | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| run with step through debugger | run with step through debugger | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
| PWDEBUG=1 yarn playwright test | 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. | ||||||
|  |  | ||||||
| @ -278,6 +258,7 @@ Where `./store` should look like this | |||||||
|  |  | ||||||
| </details> | </details> | ||||||
|  |  | ||||||
|  |  | ||||||
| However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use. | However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use. | ||||||
|  |  | ||||||
| #### Some notes on CI | #### Some notes on CI | ||||||
| @ -300,7 +281,7 @@ https://github.com/KittyCAD/modeling-app/assets/29681384/6f5e8e85-1003-4fd9-be7f | |||||||
| <details> | <details> | ||||||
|  |  | ||||||
| <summary> | <summary> | ||||||
| PS: for the debug panel, the following JSON is useful for snapping the camera | Ps for the debug panel, the following JSON is useful for snapping the camera | ||||||
| </summary> | </summary> | ||||||
|  |  | ||||||
| ```JSON | ```JSON | ||||||
| @ -308,7 +289,3 @@ PS: for the debug panel, the following JSON is useful for snapping the camera | |||||||
| ``` | ``` | ||||||
|  |  | ||||||
| </details> | </details> | ||||||
|  |  | ||||||
| ## KCL |  | ||||||
|  |  | ||||||
| For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl). |  | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								app-icon.png
									
									
									
									
									
								
							
							
						
						| Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 120 KiB | 
| @ -1,3 +1,3 @@ | |||||||
| module.exports = { | module.exports = { | ||||||
|   presets: ['@babel/preset-env'], |   presets: ["@babel/preset-env"], | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										175
									
								
								docs/kcl/getExtrudeWallTransform.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @ -0,0 +1,175 @@ | |||||||
|  | --- | ||||||
|  | title: "getExtrudeWallTransform" | ||||||
|  | excerpt: "Returns the extrude wall transform." | ||||||
|  | layout: manual | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | Returns the extrude wall transform. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | getExtrudeWallTransform(surface_name: string, extrude_group: ExtrudeGroup) -> ExtrudeTransform | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Examples | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | const box = startSketchOn('XY') | ||||||
|  |   |> startProfileAt([0, 0], %) | ||||||
|  |   |> line([0, 10], %) | ||||||
|  |   |> line([10, 0], %) | ||||||
|  |   |> line({ to: [0, -10], tag: "surface" }, %) | ||||||
|  |   |> close(%) | ||||||
|  |   |> extrude(5, %) | ||||||
|  |  | ||||||
|  | const transform = getExtrudeWallTransform('surface', box) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Arguments | ||||||
|  |  | ||||||
|  | * `surface_name`: `string` (REQUIRED) | ||||||
|  | * `extrude_group`: `ExtrudeGroup` - An extrude group is a collection of extrude surfaces. (REQUIRED) | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	// The id of the extrusion end cap | ||||||
|  | 	endCapId: uuid, | ||||||
|  | 	// The height of the extrude group. | ||||||
|  | 	height: number, | ||||||
|  | 	// The id of the extrude group. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The position of the extrude group. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation of the extrude group. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The sketch group paths. | ||||||
|  | 	sketchGroupValues: [{ | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "ToPoint", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// arc's direction | ||||||
|  | 	ccw: string, | ||||||
|  | 	// the arc's center | ||||||
|  | 	center: [number, number], | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArcTo", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "TangentialArc", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Horizontal", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "AngledLineTo", | ||||||
|  | 	// The x coordinate. | ||||||
|  | 	x: number, | ||||||
|  | 	// The y coordinate. | ||||||
|  | 	y: number, | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The from point. | ||||||
|  | 	from: [number, number], | ||||||
|  | 	// The name of the path. | ||||||
|  | 	name: string, | ||||||
|  | 	// The to point. | ||||||
|  | 	to: [number, number], | ||||||
|  | 	type: "Base", | ||||||
|  | }], | ||||||
|  | 	// The id of the extrusion start cap | ||||||
|  | 	startCapId: uuid, | ||||||
|  | 	// The extrude surfaces. | ||||||
|  | 	value: [{ | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudePlane", | ||||||
|  | } | | ||||||
|  | { | ||||||
|  | 	// The face id for the extrude plane. | ||||||
|  | 	faceId: uuid, | ||||||
|  | 	// The id of the geometry. | ||||||
|  | 	id: uuid, | ||||||
|  | 	// The name. | ||||||
|  | 	name: string, | ||||||
|  | 	// The position. | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	// The rotation. | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | 	// The source range. | ||||||
|  | 	sourceRange: [number, number], | ||||||
|  | 	type: "extrudeArc", | ||||||
|  | }], | ||||||
|  | 	// The x-axis of the extrude group base plane in the 3D space | ||||||
|  | 	xAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The y-axis of the extrude group base plane in the 3D space | ||||||
|  | 	yAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | 	// The z-axis of the extrude group base plane in the 3D space | ||||||
|  | 	zAxis: { | ||||||
|  | 	x: number, | ||||||
|  | 	y: number, | ||||||
|  | 	z: number, | ||||||
|  | }, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Returns | ||||||
|  |  | ||||||
|  | `ExtrudeTransform` | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  | 	position: [number, number, number], | ||||||
|  | 	rotation: [number, number, number, number], | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -30,11 +30,10 @@ layout: manual | |||||||
| * [`extrude`](kcl/extrude) | * [`extrude`](kcl/extrude) | ||||||
| * [`fillet`](kcl/fillet) | * [`fillet`](kcl/fillet) | ||||||
| * [`floor`](kcl/floor) | * [`floor`](kcl/floor) | ||||||
| * [`getEdge`](kcl/getEdge) | * [`getExtrudeWallTransform`](kcl/getExtrudeWallTransform) | ||||||
| * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) | * [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge) | ||||||
| * [`getOppositeEdge`](kcl/getOppositeEdge) | * [`getOppositeEdge`](kcl/getOppositeEdge) | ||||||
| * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) | * [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge) | ||||||
| * [`helix`](kcl/helix) |  | ||||||
| * [`hole`](kcl/hole) | * [`hole`](kcl/hole) | ||||||
| * [`import`](kcl/import) | * [`import`](kcl/import) | ||||||
| * [`lastSegX`](kcl/lastSegX) | * [`lastSegX`](kcl/lastSegX) | ||||||
| @ -56,10 +55,6 @@ layout: manual | |||||||
| * [`patternLinear3d`](kcl/patternLinear3d) | * [`patternLinear3d`](kcl/patternLinear3d) | ||||||
| * [`pi`](kcl/pi) | * [`pi`](kcl/pi) | ||||||
| * [`pow`](kcl/pow) | * [`pow`](kcl/pow) | ||||||
| * [`profileStart`](kcl/profileStart) |  | ||||||
| * [`profileStartX`](kcl/profileStartX) |  | ||||||
| * [`profileStartY`](kcl/profileStartY) |  | ||||||
| * [`revolve`](kcl/revolve) |  | ||||||
| * [`segAng`](kcl/segAng) | * [`segAng`](kcl/segAng) | ||||||
| * [`segEndX`](kcl/segEndX) | * [`segEndX`](kcl/segEndX) | ||||||
| * [`segEndY`](kcl/segEndY) | * [`segEndY`](kcl/segEndY) | ||||||
|  | |||||||
| @ -12,10 +12,6 @@ Returns the angle of the given leg for x. | |||||||
| legAngX(hypotenuse: number, leg: number) -> number | legAngX(hypotenuse: number, leg: number) -> number | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ### Tags |  | ||||||
|  |  | ||||||
| * `utilities` |  | ||||||
|  |  | ||||||
| ### Examples | ### Examples | ||||||
|  |  | ||||||
| ```js | ```js | ||||||
|  | |||||||
| @ -12,10 +12,6 @@ Returns the angle of the given leg for y. | |||||||
| legAngY(hypotenuse: number, leg: number) -> number | legAngY(hypotenuse: number, leg: number) -> number | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ### Tags |  | ||||||
|  |  | ||||||
| * `utilities` |  | ||||||
|  |  | ||||||
| ### Examples | ### Examples | ||||||
|  |  | ||||||
| ```js | ```js | ||||||
|  | |||||||
| @ -12,10 +12,6 @@ Returns the length of the given leg. | |||||||
| legLen(hypotenuse: number, leg: number) -> number | legLen(hypotenuse: number, leg: number) -> number | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| ### Tags |  | ||||||
|  |  | ||||||
| * `utilities` |  | ||||||
|  |  | ||||||
| ### Examples | ### Examples | ||||||
|  |  | ||||||
| ```js | ```js | ||||||
|  | |||||||
							
								
								
									
										10349
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
							
						
						| Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 193 KiB | 
| Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 259 KiB | 
| Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 220 KiB | 
| Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 193 KiB | 
