Files
modeling-app/vite.config.ts

87 lines
2.2 KiB
TypeScript
Raw Normal View History

import react from '@vitejs/plugin-react'
import viteTsconfigPaths from 'vite-tsconfig-paths'
import eslint from '@nabla/vite-plugin-eslint'
import { defineConfig, configDefaults } from 'vitest/config'
import version from 'vite-plugin-package-version'
import topLevelAwait from 'vite-plugin-top-level-await'
// @ts-ignore: No types available
import { lezer } from '@lezer/generator/rollup'
2023-07-24 17:26:26 -04:00
const config = defineConfig({
server: {
open: true,
port: 3000,
watch: {
codemirror lsp highlighter (#2806) * tokenizer Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) udates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) updates Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> more cleaniup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> dont react to non relevant events Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) faster Signed-off-by: Jess Frazelle <github@jessfraz.com> cleanup code Signed-off-by: Jess Frazelle <github@jessfraz.com> defer Signed-off-by: Jess Frazelle <github@jessfraz.com> more events Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> user events Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates ; Signed-off-by: Jess Frazelle <github@jessfraz.com> upfates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> make highlighting code blocks easier Signed-off-by: Jess Frazelle <github@jessfraz.com> improvements Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> better builds Signed-off-by: Jess Frazelle <github@jessfraz.com> remove weird hacks Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> better checks Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) make release builds in prod (#2839) Update package.json udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix some tests Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) updates Signed-off-by: Jess Frazelle <github@jessfraz.com> better timing Signed-off-by: Jess Frazelle <github@jessfraz.com> tweak delay Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) upfates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> ifxup Signed-off-by: Jess Frazelle <github@jessfraz.com> udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> wait for the lsp for all screenshots so consistent Signed-off-by: Jess Frazelle <github@jessfraz.com> better playwright Signed-off-by: Jess Frazelle <github@jessfraz.com> A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> Call core dump from the bug reporting button(s) (#2783) * Add coredump to refresh button - this one indicates that there should be something like a core dump that is triggered. * Added lower right control bug report button - included custom toasts for bug reporting, supports fallback bug reporting when app cannot generate a core dump better keymaps Signed-off-by: Jess Frazelle <github@jessfraz.com> emptu in comment Signed-off-by: Jess Frazelle <github@jessfraz.com> fix logs Signed-off-by: Jess Frazelle <github@jessfraz.com> fxes Signed-off-by: Jess Frazelle <github@jessfraz.com> add a test for tab to autocomplete Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> better Signed-off-by: Jess Frazelle <github@jessfraz.com> printl Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * upfates Signed-off-by: Jess Frazelle <github@jessfraz.com> * cleanup Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * empty * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-29 18:10:07 -07:00
ignored: [
'**/target/**',
'**/dist/**',
'**/build/**',
'**/test-results/**',
'**/playwright-report/**',
],
},
},
test: {
globals: true,
File based settings (#1679) * Rename GlobalStateContext to SettingsAuthContext * Naive initial impl of settings persistence to file system * Update app identifier in tauri config * Add "show in folder" tauri command * Load from and save to file system in Tauri app * Add documents drive to tauri permission scope * Add recursive prop to default dir selection dialog * Add success toast to web restore defaults action * Add a way to validate read-in settings * Update imports to use separate settings lib file * Validate localStorage-loaded settings, combine error message * Add a e2e test for validation * Clean up state state bugs * Reverse validation looping so new users don't error * update settingsMachine typegen to remove conflicts * Fmt * Fix TS errors * Fix import paths, etc post-merge * Make default length units `mm` and 'metric' * Rename to SettingsAuth* * cargo fmt * Revert Tauri config identifier change * Update clientSideInfra's baseUnits from settings * Break apart CommandBar and CommandBarProvider * Bugfix: don't validate defaultValue when it's not configured * Allow some TauriFS functions to no-op from browser * Sidestep circular deps by loading context and kclManager only from React-land * Update broken import paths * Separate loaders from Router, load settings on every route * Break apart settings types, utils, and constants * Fix Jest tests by decoupling reliance on useLoaderData from SettingsAuthProvider * Fix up Router loader data with "layout routes" https://reactrouter.com/en/main/route/route#layout-routes * Move settings validation and toast to custom hook so the toast renders * fmt * Use forks for Vitest https://vitest.dev/guide/common-errors.html#failed-to-terminate-worker * $APPCONFIG !== $APPDATA only on Linux + change the identifier back since it really doesn't seem to affect app signing * Debugging on Linux * Better directory validation, fix reset settings button * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * defaultDirectory can be empty in browser * fmt * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * re-trigger CI --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-14 15:56:45 -04:00
pool: 'forks',
poolOptions: {
forks: {
maxForks: 2,
minForks: 1,
},
File based settings (#1679) * Rename GlobalStateContext to SettingsAuthContext * Naive initial impl of settings persistence to file system * Update app identifier in tauri config * Add "show in folder" tauri command * Load from and save to file system in Tauri app * Add documents drive to tauri permission scope * Add recursive prop to default dir selection dialog * Add success toast to web restore defaults action * Add a way to validate read-in settings * Update imports to use separate settings lib file * Validate localStorage-loaded settings, combine error message * Add a e2e test for validation * Clean up state state bugs * Reverse validation looping so new users don't error * update settingsMachine typegen to remove conflicts * Fmt * Fix TS errors * Fix import paths, etc post-merge * Make default length units `mm` and 'metric' * Rename to SettingsAuth* * cargo fmt * Revert Tauri config identifier change * Update clientSideInfra's baseUnits from settings * Break apart CommandBar and CommandBarProvider * Bugfix: don't validate defaultValue when it's not configured * Allow some TauriFS functions to no-op from browser * Sidestep circular deps by loading context and kclManager only from React-land * Update broken import paths * Separate loaders from Router, load settings on every route * Break apart settings types, utils, and constants * Fix Jest tests by decoupling reliance on useLoaderData from SettingsAuthProvider * Fix up Router loader data with "layout routes" https://reactrouter.com/en/main/route/route#layout-routes * Move settings validation and toast to custom hook so the toast renders * fmt * Use forks for Vitest https://vitest.dev/guide/common-errors.html#failed-to-terminate-worker * $APPCONFIG !== $APPDATA only on Linux + change the identifier back since it really doesn't seem to affect app signing * Debugging on Linux * Better directory validation, fix reset settings button * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * defaultDirectory can be empty in browser * fmt * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * re-trigger CI --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-14 15:56:45 -04:00
},
setupFiles: ['src/setupTests.ts', '@vitest/web-worker'],
environment: 'happy-dom',
coverage: {
provider: 'istanbul', // or 'v8'
},
exclude: [...configDefaults.exclude, '**/e2e/**/*.spec.*', 'rust'],
Client sketch scene (#1271) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * make tsc happ * better error msg * fix control point issue * basic code gen working for tangentialArc * partical fix for move with arcs * tangential arc move * fix * make eslint rules less annoying * inital refactor of some xstate stuff * more old tangential arc clean up stuff * more tweaks * add testing * tweak xstate inspect * temp remove test * update formating for less conflicts * fix state machine layout after merge * shrug, something weird with xstate typegen * renaming some xstate events * tweak numbers to make CI playwright happ * CI hacks * more CI hacks * more CI hacks * new hack strategy * run tests agian * make cmd bar less flaky * ci hacks * CI hacks * CI hacks * CI hacks * clean up * fix * still have constraint stuff to deal with * progress on move rules * update source ranges after no execute code-mod * typo * mvp working * hide show sketch overlay * match scaling * update arrow head style * animate line tool * bypass xstate for animations, much smoother * add new segment working with refactor needed for setup paper sketch * refactor setup paper sketch * tangantialArcTo drag animations working * tangential arc polish * cargo fmt * clippy * more clippy * mock canvas * last of clippy? * typo * more clippy stuff * move util function so they are shareable with typescript * migrate a bunch to rust and only rust * add arc center point for draft tangential ac * clippy tweak * delete uneeded test * Rough start to scaling arrow heads. The tangent arrow heads are basically nuked and replaced while the straight line sections are just rotated and repositioned, this means they miss out on updating scaling number after a screen size changes. Needs fixing * fix bug with tool tips * fix draft line start position Having drag the end of teh path before selecting a tooltip would result in the draft line starting where the path used to end, stale data * some progress with pan maybe * fmt * inital camera sync working For perspective camera at least * change three.js to use z-up * add grid * orthographic camera working with polish items TODO * fix zoom level when swapping camera * fix up camera/orbit changing on cam change (pan wasn't being respected) * tidy up * use orbit target instead of assuming scene center * dynamic fov working * animate orthographic to perspective and reverse * fix import * temp fix for batch commands * initial client side scene sketch working * remove hover log * FOV adjust fix * fix comment * tear down sketch and small tweaks * some progress with camera tweening * combine dollyZoom engine commands see https://github.com/KittyCAD/modeling-api/compare/kurt-perspective-settings?expand=1 and https://github.com/KittyCAD/engine/compare/kurt-perspective-settings?expand=1 * make tests happy (mocks) * fix tween to vertical/camera-up bug * tween to each axis with hacky solutions in there * fix startSketchOn planes * tidy startSketchOn * tweening okay for now I think * get sketching on default planes working * allow editing on all default planes * clean up enter and exit sketch logic * tidy * tidy * remove more default plane stuff * start of draft line * remove some annoying parts of the paper.js implementation * fix drag than equip line bug * comment * don't animate on skech tear down since it's used for draft line * remove more default plane shit * style draft line * refine dashed line * draft line set up and tear down mostly happy * add on click logic ready for draft lines * sketch mode with drag and draft mode working solidly now, straight segments only * default planes match colors, hover and select still TODO * hover and click logic working for default planes Now just need the code mode to fire to 'startSketchOn(...)' * select default planes * remove some logs * fix update infinite loop * start of orbitControls port to Franks control guards * hiding scenes at different times * scene hide on camera move should be respected by scroll zoom * basic hover working * Hook up user camera settings to ClientSideScene (#1334) * Refactor to not import utilities from Router.tsx * Stop tracking changes or formatting *.typegen.ts * Hook up cameraControls to ClientSideScene * Remove camera controls toggle from temp debug panel --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * add select segment moves cursor * highlight segments yellow on hover * cursor ranges effect 2d line colors * fix constrainst i.e. make sure the sketch is rejiged * selecting nothing should remove selections * remove hardcoded strings * update get_tangential_arc_to_info rust util * initial drawing of tangential arcs in client scene * fix tangentialArc arrow head direction * correct userData types for tangential arcs * get tangential arc updates working Doesn't include draging the head of the tangential arc itself yet * spot of clean up * make selections work with tangential arcs * get draft tangential segment animated * fix initial click weirdness for adding new tangential line * couple tweaks * add grace pixels /threshold to raycast * redo arc dashes so that they spawn from the ccenter of the arc * fix multi drag bug * fmt * add temp solution for close * add default axis hover colors, still needs select logic * selection of axis works, just with out selection color * get axis selection colors working * fix outdate source ranges after drag problem * update moreNodePathFromSourceRange * fix ts-rs issue/workaround * fix default plane weirdness * fix tangential arc rounding issue * review clean up part 1 * review clean up part 2 Big state-diagram cull * clippy * typo * clippy * fix xstate types with typegen * fix types * clippy * catch error * fix test import issue Not sure exactly what was happening but guessing circular import that vite didn't like * add axis/plane info to sketch group tests * case changes because of rs-ts bug, can probably revert this later * start of playwright test fixes * reduce geo complexity for straight segments * fix cam adjust tests * Revert "Clean up vite build warnings (#1332)" This reverts commit c1f661ab5254458c3e9fdb396a31860a22c790f1. * selection e2e test fixed< * remove camToggle to allow playwright tests to pass * remove drag test too brittle and needs to be redone from the ground up anyway * trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * fix last test * clean up part 3 * clean up part 4 * clean up part 5 * clean up sketch enter exit logic * fix engine side selections * default plane should not be selected form 'onDragEnd' i.e. rotating the camera should not mean the user acidently selects a plane * clean up state diagram around animating to sketch mode Embracing that the animation is async and puting the interdiate steps in the state diagram clean up some logic and solved some bugs at the same time * add test for multiple sketches * typo * make highlight more robust * type tweak * scale segmenst with distance from camera so they have a consistent pixel size/ screenspace size * Jess's advice * tsc and fmt * clean up part 6 remove integer from xstate names * clean up part 7 * integrate sequency in to camera moves * fix tests * update snapshot e2e * small snapshot change * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * trigger ci * Fix HomeLoaderData types * update std stuff * update kittycad rs client lib --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-11 12:59:00 +11:00
deps: {
optimizer: {
web: {
include: ['vitest-canvas-mock'],
},
},
},
clearMocks: true,
restoreMocks: true,
mockReset: true,
reporters: process.env.GITHUB_ACTIONS
? ['dot', 'github-actions']
: // Gotcha: 'hanging-process' is very noisey, turn off by default on localhost
// : ['verbose', 'hanging-process'],
['verbose'],
testTimeout: 1000,
hookTimeout: 1000,
teardownTimeout: 1000,
},
build: {
outDir: 'build',
},
resolve: {
alias: {
'@kittycad/codemirror-lsp-client': '/packages/codemirror-lsp-client/src',
'@kittycad/codemirror-lang-kcl': '/packages/codemirror-lang-kcl/src',
Move the wasm lib, and cleanup rust directory and all references (#5585) * git mv src/wasm-lib rust Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv wasm-lib to workspace Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv kcl-lib Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv derive docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * resolve file paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * move more shit Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix more paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * make yarn build:wasm work Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix scripts Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * better references Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix cargo ci Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix reference Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix more ci Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * cargo sort Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix script Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix a dep Signed-off-by: Jess Frazelle <github@jessfraz.com> * sort Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove unused deps Signed-off-by: Jess Frazelle <github@jessfraz.com> * Revert "remove unused deps" This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972. * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * deps; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 13:59:01 -08:00
'@rust': '/rust',
},
},
plugins: [
react(),
viteTsconfigPaths(),
eslint(),
version(),
lezer(),
topLevelAwait({
// The export name of top-level await promise for each chunk module
promiseExportName: '__tla',
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: (i) => `__tla_${i}`,
}),
],
worker: {
plugins: () => [viteTsconfigPaths()],
},
2023-07-24 17:26:26 -04:00
})
export default config