Compare commits
	
		
			11 Commits
		
	
	
		
			pierremtb/
			...
			pierremtb/
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 9b2ae8f4b2 | |||
| 2949e6d325 | |||
| 61436caa0b | |||
| ff3d961b48 | |||
| 31a6b6d967 | |||
| 64e4fec0fc | |||
| 93c872a747 | |||
| b6101ae154 | |||
| 4b2e22c867 | |||
| 41c543f898 | |||
| e8c206be77 | 
| @ -4,6 +4,7 @@ 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_SITE_BASE_URL=https://dev.zoo.dev | ||||
| VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev | ||||
| VITE_KC_KCL_SAMPLES_REF=4fef4c34805322272ffb9486e524203ba0d78c1d | ||||
| VITE_KC_SKIP_AUTH=false | ||||
| VITE_KC_CONNECTION_TIMEOUT_MS=5000 | ||||
| # ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence! | ||||
|  | ||||
| @ -3,5 +3,6 @@ VITE_KC_API_WS_MODELING_URL=wss://api.zoo.dev/ws/modeling/commands | ||||
| VITE_KC_API_BASE_URL=https://api.zoo.dev | ||||
| VITE_KC_SITE_BASE_URL=https://zoo.dev | ||||
| VITE_KC_SITE_APP_URL=https://app.zoo.dev | ||||
| VITE_KC_KCL_SAMPLES_REF=4fef4c34805322272ffb9486e524203ba0d78c1d | ||||
| VITE_KC_SKIP_AUTH=false | ||||
| VITE_KC_CONNECTION_TIMEOUT_MS=15000 | ||||
|  | ||||
							
								
								
									
										1
									
								
								interface.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								interface.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -70,6 +70,7 @@ export interface IElectronAPI { | ||||
|       VITE_KC_SKIP_AUTH: string | ||||
|       VITE_KC_CONNECTION_TIMEOUT_MS: string | ||||
|       VITE_KC_DEV_TOKEN: string | ||||
|       VITE_KC_KCL_SAMPLES_REF: string | ||||
|       NODE_ENV: string | ||||
|       PROD: string | ||||
|       DEV: string | ||||
|  | ||||
| @ -85,7 +85,7 @@ | ||||
|     "fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages", | ||||
|     "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages", | ||||
|     "fetch:wasm": "./get-latest-wasm-bundle.sh", | ||||
|     "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/achalmers/kw-pattern-transform2/manifest.json", | ||||
|     "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/4fef4c34805322272ffb9486e524203ba0d78c1d/manifest.json", | ||||
|     "isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)", | ||||
|     "build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt", | ||||
|     "build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt", | ||||
|  | ||||
| @ -34,6 +34,13 @@ | ||||
|     "title": "Car Wheel Assembly", | ||||
|     "description": "A car wheel assembly with a rotor, tire, and lug nuts." | ||||
|   }, | ||||
|   { | ||||
|     "file": "main.kcl", | ||||
|     "pathFromProjectDirectoryToFirstFile": "cycloidal-gear/main.kcl", | ||||
|     "multipleFiles": false, | ||||
|     "title": "Cycloidal Gear", | ||||
|     "description": "A cycloidal gear is a gear with a continuous, curved tooth profile. They are used in watchmaking and high precision robotics actuation" | ||||
|   }, | ||||
|   { | ||||
|     "file": "main.kcl", | ||||
|     "pathFromProjectDirectoryToFirstFile": "dodecahedron/main.kcl", | ||||
| @ -48,6 +55,13 @@ | ||||
|     "title": "Enclosure", | ||||
|     "description": "An enclosure body and sealing lid for storing items" | ||||
|   }, | ||||
|   { | ||||
|     "file": "main.kcl", | ||||
|     "pathFromProjectDirectoryToFirstFile": "exhaust-manifold/main.kcl", | ||||
|     "multipleFiles": false, | ||||
|     "title": "Exhaust Manifold", | ||||
|     "description": "A welded exhaust header for an inline 4-cylinder engine" | ||||
|   }, | ||||
|   { | ||||
|     "file": "main.kcl", | ||||
|     "pathFromProjectDirectoryToFirstFile": "flange-with-patterns/main.kcl", | ||||
|  | ||||
| @ -11,6 +11,7 @@ export const VITE_KC_API_WS_MODELING_URL = env.VITE_KC_API_WS_MODELING_URL as | ||||
| export const VITE_KC_API_BASE_URL = env.VITE_KC_API_BASE_URL as string | ||||
| export const VITE_KC_SITE_BASE_URL = env.VITE_KC_SITE_BASE_URL as string | ||||
| export const VITE_KC_SITE_APP_URL = env.VITE_KC_SITE_APP_URL as string | ||||
| export const VITE_KC_KCL_SAMPLES_REF = env.VITE_KC_KCL_SAMPLES_REF as string | ||||
| export const VITE_KC_SKIP_AUTH = env.VITE_KC_SKIP_AUTH as string | undefined | ||||
| export const VITE_KC_CONNECTION_TIMEOUT_MS = | ||||
|   env.VITE_KC_CONNECTION_TIMEOUT_MS as string | undefined | ||||
|  | ||||
| @ -4,6 +4,7 @@ import { enginelessExecutor } from '../lib/testHelpers' | ||||
| import path from 'node:path' | ||||
| import fs from 'node:fs/promises' | ||||
| import child_process from 'node:child_process' | ||||
| import { VITE_KC_KCL_SAMPLES_REF } from 'env' | ||||
|  | ||||
| // The purpose of these tests is to act as a first line of defense | ||||
| // if something gets real screwy with our KCL ecosystem. | ||||
| @ -28,14 +29,11 @@ try { | ||||
|   console.log(e) | ||||
| } | ||||
|  | ||||
| child_process.spawnSync('git', [ | ||||
|   'clone', | ||||
|   '--single-branch', | ||||
|   '--branch', | ||||
|   'achalmers/kw-pattern-transform2', | ||||
|   URL_GIT_KCL_SAMPLES, | ||||
|   DIR_KCL_SAMPLES, | ||||
| ]) | ||||
| child_process.spawnSync('git', ['clone', URL_GIT_KCL_SAMPLES, DIR_KCL_SAMPLES]) | ||||
|  | ||||
| child_process.spawnSync('git', ['checkout', VITE_KC_KCL_SAMPLES_REF], { | ||||
|   cwd: DIR_KCL_SAMPLES, | ||||
| }) | ||||
|  | ||||
| // @ts-expect-error | ||||
| let files = await fs.readdir(DIR_KCL_SAMPLES) | ||||
|  | ||||
| @ -105,8 +105,8 @@ export const MAKE_TOAST_MESSAGES = { | ||||
|  | ||||
| /** The URL for the KCL samples manifest files */ | ||||
| export const KCL_SAMPLES_MANIFEST_URLS = { | ||||
|   remote: | ||||
|     'https://raw.githubusercontent.com/KittyCAD/kcl-samples/main/manifest.json', | ||||
|   // TODO: enable remote fetching again, maybe? | ||||
|   // remote: `https://raw.githubusercontent.com/KittyCAD/kcl-samples/${VITE_KC_KCL_SAMPLES_REF}/manifest.json`, | ||||
|   localFallback: '/kcl-samples-manifest-fallback.json', | ||||
| } as const | ||||
|  | ||||
|  | ||||
| @ -10,23 +10,27 @@ export type KclSamplesManifestItem = { | ||||
| } | ||||
|  | ||||
| export async function getKclSamplesManifest() { | ||||
|   let response = await fetch(KCL_SAMPLES_MANIFEST_URLS.remote) | ||||
|   if (!response.ok) { | ||||
|     console.warn( | ||||
|       'Failed to fetch latest remote KCL samples manifest, falling back to local:', | ||||
|       response.statusText | ||||
|     ) | ||||
|     response = await fetch( | ||||
|       (isDesktop() ? '.' : '') + KCL_SAMPLES_MANIFEST_URLS.localFallback | ||||
|     ) | ||||
|     if (!response.ok) { | ||||
|       console.error( | ||||
|         'Failed to fetch fallback KCL samples manifest:', | ||||
|         response.statusText | ||||
|       ) | ||||
|       return [] | ||||
|     } | ||||
|   } | ||||
|   // TODO: enable remote fetching again, maybe? | ||||
|   // let response = await fetch(KCL_SAMPLES_MANIFEST_URLS.remote) | ||||
|   // if (!response.ok) { | ||||
|   //   console.warn( | ||||
|   //     'Failed to fetch latest remote KCL samples manifest, falling back to local:', | ||||
|   //     response.statusText | ||||
|   //   ) | ||||
|   //   response = await fetch( | ||||
|   //     (isDesktop() ? '.' : '') + KCL_SAMPLES_MANIFEST_URLS.localFallback | ||||
|   //   ) | ||||
|   //   if (!response.ok) { | ||||
|   //     console.error( | ||||
|   //       'Failed to fetch fallback KCL samples manifest:', | ||||
|   //       response.statusText | ||||
|   //     ) | ||||
|   //     return [] | ||||
|   //   } | ||||
|   // } | ||||
|   const response = await fetch( | ||||
|     (isDesktop() ? '.' : '') + KCL_SAMPLES_MANIFEST_URLS.localFallback | ||||
|   ) | ||||
|   return response.json().then((manifest) => { | ||||
|     return manifest as KclSamplesManifestItem[] | ||||
|   }) | ||||
|  | ||||
| @ -7,6 +7,7 @@ import { UnitLength_type } from '@kittycad/lib/dist/types/src/models' | ||||
| import { reportRejection } from './trap' | ||||
| import { IndexLoaderData } from './types' | ||||
| import { copyFileShareLink } from './links' | ||||
| import { VITE_KC_KCL_SAMPLES_REF } from 'env' | ||||
|  | ||||
| interface OnSubmitProps { | ||||
|   sampleName: string | ||||
| @ -63,7 +64,7 @@ export function kclCommands(commandProps: KclCommandConfig): Command[] { | ||||
|         const pathParts = data.sample.split('/') | ||||
|         const projectPathPart = pathParts[0] | ||||
|         const primaryKclFile = pathParts[1] | ||||
|         const sampleCodeUrl = `https://raw.githubusercontent.com/KittyCAD/kcl-samples/main/${encodeURIComponent( | ||||
|         const sampleCodeUrl = `https://raw.githubusercontent.com/KittyCAD/kcl-samples/${VITE_KC_KCL_SAMPLES_REF}/${encodeURIComponent( | ||||
|           projectPathPart | ||||
|         )}/${encodeURIComponent(primaryKclFile)}` | ||||
|  | ||||
|  | ||||
| @ -45,6 +45,7 @@ process.env.VITE_KC_API_WS_MODELING_URL ??= viteEnv.VITE_KC_API_WS_MODELING_URL | ||||
| process.env.VITE_KC_API_BASE_URL ??= viteEnv.VITE_KC_API_BASE_URL | ||||
| process.env.VITE_KC_SITE_BASE_URL ??= viteEnv.VITE_KC_SITE_BASE_URL | ||||
| process.env.VITE_KC_SITE_APP_URL ??= viteEnv.VITE_KC_SITE_APP_URL | ||||
| process.env.VITE_KC_KCL_SAMPLES_REF ??= viteEnv.VITE_KC_KCL_SAMPLES_REF | ||||
| process.env.VITE_KC_SKIP_AUTH ??= viteEnv.VITE_KC_SKIP_AUTH | ||||
| process.env.VITE_KC_CONNECTION_TIMEOUT_MS ??= | ||||
|   viteEnv.VITE_KC_CONNECTION_TIMEOUT_MS | ||||
|  | ||||
| @ -187,6 +187,7 @@ contextBridge.exposeInMainWorld('electron', { | ||||
|         'VITE_KC_API_BASE_URL', | ||||
|         'VITE_KC_SITE_BASE_URL', | ||||
|         'VITE_KC_SITE_APP_URL', | ||||
|         'VITE_KC_KCL_SAMPLES_REF', | ||||
|         'VITE_KC_SKIP_AUTH', | ||||
|         'VITE_KC_CONNECTION_TIMEOUT_MS', | ||||
|         'VITE_KC_DEV_TOKEN', | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	