Compare commits
	
		
			14 Commits
		
	
	
		
			lf94/tauri
			...
			kurt-speed
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 182865014e | |||
| 2452eede0b | |||
| 98442b9ec2 | |||
| fb1c8036f6 | |||
| 2918612d4b | |||
| abbd065c2c | |||
| 23e29b024f | |||
| 807adac371 | |||
| 03eb8dca32 | |||
| e3358f8251 | |||
| 49ea3991b2 | |||
| f32f0e2717 | |||
| 0363e4f4e0 | |||
| 5e60dbd5e8 | 
| @ -1,5 +1,6 @@ | |||||||
| VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands | VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands | ||||||
| VITE_KC_API_BASE_URL=https://api.dev.zoo.dev | VITE_KC_API_BASE_URL=https://api.dev.zoo.dev | ||||||
| VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | VITE_KC_SITE_BASE_URL=https://dev.zoo.dev | ||||||
|  | VITE_KC_WASM_OVERRIDE_URL="" | ||||||
| VITE_KC_SKIP_AUTH=false | VITE_KC_SKIP_AUTH=false | ||||||
| VITE_KC_CONNECTION_TIMEOUT_MS=5000 | VITE_KC_CONNECTION_TIMEOUT_MS=5000 | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands | VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands | ||||||
| VITE_KC_API_BASE_URL=https://api.zoo.dev | VITE_KC_API_BASE_URL=https://api.zoo.dev | ||||||
| VITE_KC_SITE_BASE_URL=https://zoo.dev | VITE_KC_SITE_BASE_URL=https://zoo.dev | ||||||
|  | VITE_KC_WASM_OVERRIDE_URL="" | ||||||
| VITE_KC_SKIP_AUTH=false | VITE_KC_SKIP_AUTH=false | ||||||
| VITE_KC_CONNECTION_TIMEOUT_MS=15000 | VITE_KC_CONNECTION_TIMEOUT_MS=15000 | ||||||
|  | |||||||
							
								
								
									
										35
									
								
								.github/workflows/playwright.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								.github/workflows/playwright.yml
									
									
									
									
										vendored
									
									
								
							| @ -14,9 +14,31 @@ permissions: | |||||||
|   pull-requests: write |   pull-requests: write | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|  |   check-wasm-lib-changes: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     outputs: | ||||||
|  |       url: ${{ steps.set-output.outputs.url }} | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/checkout@v2 | ||||||
|  |         with: | ||||||
|  |           fetch-depth: 0 # Fetches all history for all branches and tags | ||||||
|  |  | ||||||
|  |       - name: Check for changes in src/wasm-lib | ||||||
|  |         id: set-output | ||||||
|  |         run: | | ||||||
|  |           if git diff --quiet origin/main...HEAD -- src/wasm-lib; then | ||||||
|  |             echo "url=https://app.zoo.dev" >> $GITHUB_OUTPUT | ||||||
|  |             echo "No changes detected in src/wasm-lib" | ||||||
|  |           else | ||||||
|  |             echo "Changes detected in src/wasm-lib" | ||||||
|  |             echo "url=" >> $GITHUB_OUTPUT | ||||||
|  |           fi | ||||||
|  |  | ||||||
|  |  | ||||||
|   playwright-ubuntu: |   playwright-ubuntu: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: ubuntu-latest-8-cores |     runs-on: ubuntu-latest-8-cores | ||||||
|  |     needs: check-wasm-lib-changes | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
| @ -28,13 +50,19 @@ 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: Print WASM Lib Changes URL | ||||||
|  |       run: | | ||||||
|  |         echo "WASM Lib Changes URL: ${{ needs.check-wasm-lib-changes.outputs.url }}" | ||||||
|     - name: Setup Rust |     - name: Setup Rust | ||||||
|  |       if: ${{ needs.check-wasm-lib-changes.outputs.url }} == '' | ||||||
|       uses: dtolnay/rust-toolchain@stable |       uses: dtolnay/rust-toolchain@stable | ||||||
|     - name: Cache wasm |     - name: Cache wasm | ||||||
|  |       if: ${{ needs.check-wasm-lib-changes.outputs.url }} == '' | ||||||
|       uses: Swatinem/rust-cache@v2 |       uses: Swatinem/rust-cache@v2 | ||||||
|       with: |       with: | ||||||
|         workspaces: './src/wasm-lib' |         workspaces: './src/wasm-lib' | ||||||
|     - name: build wasm |     - name: build wasm | ||||||
|  |       if: ${{ needs.check-wasm-lib-changes.outputs.url }} == '' | ||||||
|       run: yarn build:wasm |       run: yarn build:wasm | ||||||
|     - name: build web |     - name: build web | ||||||
|       run: yarn build:local |       run: yarn build:local | ||||||
| @ -44,6 +72,7 @@ jobs: | |||||||
|         CI: true |         CI: true | ||||||
|         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} |         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} | ||||||
|         snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }} |         snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }} | ||||||
|  |         WASM_OVERRIDE: ${{ steps.check-wasm-lib-changes.outputs.url }} | ||||||
|     - uses: actions/upload-artifact@v3 |     - uses: actions/upload-artifact@v3 | ||||||
|       if: always() |       if: always() | ||||||
|       with: |       with: | ||||||
| @ -79,6 +108,7 @@ jobs: | |||||||
|       env: |       env: | ||||||
|         CI: true |         CI: true | ||||||
|         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} |         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} | ||||||
|  |         WASM_OVERRIDE: ${{ steps.check-wasm-lib-changes.outputs.url }} | ||||||
|     - uses: actions/upload-artifact@v3 |     - uses: actions/upload-artifact@v3 | ||||||
|       if: always() |       if: always() | ||||||
|       with: |       with: | ||||||
| @ -89,6 +119,7 @@ jobs: | |||||||
|   playwright-macos: |   playwright-macos: | ||||||
|     timeout-minutes: 60 |     timeout-minutes: 60 | ||||||
|     runs-on: macos-14 |     runs-on: macos-14 | ||||||
|  |     needs: check-wasm-lib-changes | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v4 |     - uses: actions/checkout@v4 | ||||||
|     - uses: actions/setup-node@v4 |     - uses: actions/setup-node@v4 | ||||||
| @ -100,12 +131,15 @@ jobs: | |||||||
|     - name: Install Playwright Browsers |     - name: Install Playwright Browsers | ||||||
|       run: yarn playwright install --with-deps |       run: yarn playwright install --with-deps | ||||||
|     - name: Setup Rust |     - name: Setup Rust | ||||||
|  |       if: needs.check-wasm-lib-changes.outputs.url == '' | ||||||
|       uses: dtolnay/rust-toolchain@stable |       uses: dtolnay/rust-toolchain@stable | ||||||
|     - name: Cache wasm |     - name: Cache wasm | ||||||
|  |       if: needs.check-wasm-lib-changes.outputs.url == '' | ||||||
|       uses: Swatinem/rust-cache@v2 |       uses: Swatinem/rust-cache@v2 | ||||||
|       with: |       with: | ||||||
|         workspaces: './src/wasm-lib' |         workspaces: './src/wasm-lib' | ||||||
|     - name: build wasm |     - name: build wasm | ||||||
|  |       if: needs.check-wasm-lib-changes.outputs.url == '' | ||||||
|       run: yarn build:wasm |       run: yarn build:wasm | ||||||
|     - name: build web |     - name: build web | ||||||
|       run: yarn build:local |       run: yarn build:local | ||||||
| @ -116,6 +150,7 @@ jobs: | |||||||
|       env: |       env: | ||||||
|         CI: true |         CI: true | ||||||
|         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} |         token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} | ||||||
|  |         WASM_OVERRIDE: ${{ steps.check-wasm-lib-changes.outputs.url }} | ||||||
|     - uses: actions/upload-artifact@v3 |     - uses: actions/upload-artifact@v3 | ||||||
|       if: always() |       if: always() | ||||||
|       with: |       with: | ||||||
|  | |||||||
| @ -72,7 +72,7 @@ export default defineConfig({ | |||||||
|  |  | ||||||
|   /* Run your local dev server before starting the tests */ |   /* Run your local dev server before starting the tests */ | ||||||
|   webServer: { |   webServer: { | ||||||
|     command: 'yarn serve', |     command: 'VITE_KC_WASM_OVERRIDE_URL=$WASM_OVERRIDE yarn serve', | ||||||
|     // url: 'http://127.0.0.1:3000', |     // url: 'http://127.0.0.1:3000', | ||||||
|     reuseExistingServer: !process.env.CI, |     reuseExistingServer: !process.env.CI, | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -7,5 +7,7 @@ export const VITE_KC_API_BASE_URL = import.meta.env.VITE_KC_API_BASE_URL | |||||||
| export const VITE_KC_SITE_BASE_URL = import.meta.env.VITE_KC_SITE_BASE_URL | export const VITE_KC_SITE_BASE_URL = import.meta.env.VITE_KC_SITE_BASE_URL | ||||||
| export const VITE_KC_CONNECTION_TIMEOUT_MS = import.meta.env | export const VITE_KC_CONNECTION_TIMEOUT_MS = import.meta.env | ||||||
|   .VITE_KC_CONNECTION_TIMEOUT_MS |   .VITE_KC_CONNECTION_TIMEOUT_MS | ||||||
|  | export const VITE_KC_WASM_OVERRIDE_URL = import.meta.env | ||||||
|  |   .VITE_KC_WASM_OVERRIDE_URL | ||||||
| export const TEST = import.meta.env.TEST | export const TEST = import.meta.env.TEST | ||||||
| export const DEV = import.meta.env.DEV | export const DEV = import.meta.env.DEV | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ import { AppInfo } from 'wasm-lib/kcl/bindings/AppInfo' | |||||||
| import { CoreDumpManager } from 'lib/coredump' | import { CoreDumpManager } from 'lib/coredump' | ||||||
| import openWindow from 'lib/openWindow' | import openWindow from 'lib/openWindow' | ||||||
| import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes' | import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes' | ||||||
| import { TEST } from 'env' | import { TEST, VITE_KC_WASM_OVERRIDE_URL } from 'env' | ||||||
|  |  | ||||||
| export type { Program } from '../wasm-lib/kcl/bindings/Program' | export type { Program } from '../wasm-lib/kcl/bindings/Program' | ||||||
| export type { Value } from '../wasm-lib/kcl/bindings/Value' | export type { Value } from '../wasm-lib/kcl/bindings/Value' | ||||||
| @ -76,18 +76,19 @@ export type { MemoryItem } from '../wasm-lib/kcl/bindings/MemoryItem' | |||||||
| export type { ExtrudeSurface } from '../wasm-lib/kcl/bindings/ExtrudeSurface' | export type { ExtrudeSurface } from '../wasm-lib/kcl/bindings/ExtrudeSurface' | ||||||
|  |  | ||||||
| export const wasmUrl = () => { | export const wasmUrl = () => { | ||||||
|   const baseUrl = |   const baseUrl = VITE_KC_WASM_OVERRIDE_URL | ||||||
|     typeof window === 'undefined' |     ? VITE_KC_WASM_OVERRIDE_URL | ||||||
|       ? 'http://127.0.0.1:3000' |     : typeof window === 'undefined' | ||||||
|       : window.location.origin.includes('tauri://localhost') |     ? 'http://127.0.0.1:3000' | ||||||
|       ? 'tauri://localhost' // custom protocol for macOS |     : window.location.origin.includes('tauri://localhost') | ||||||
|       : window.location.origin.includes('tauri.localhost') |     ? 'tauri://localhost' // custom protocol for macOS | ||||||
|       ? 'http://tauri.localhost' // fallback for Windows |     : window.location.origin.includes('tauri.localhost') | ||||||
|       : window.location.origin.includes('localhost') |     ? 'http://tauri.localhost' // fallback for Windows | ||||||
|       ? 'http://localhost:3000' |     : window.location.origin.includes('localhost') | ||||||
|       : window.location.origin && window.location.origin !== 'null' |     ? 'http://localhost:3000' | ||||||
|       ? window.location.origin |     : window.location.origin && window.location.origin !== 'null' | ||||||
|       : 'http://localhost:3000' |     ? window.location.origin | ||||||
|  |     : 'http://localhost:3000' | ||||||
|   const fullUrl = baseUrl + '/wasm_lib_bg.wasm' |   const fullUrl = baseUrl + '/wasm_lib_bg.wasm' | ||||||
|   console.log(`Full URL for WASM: ${fullUrl}`) |   console.log(`Full URL for WASM: ${fullUrl}`) | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	