Skip to content

Commit

Permalink
Next (#609)
Browse files Browse the repository at this point in the history
* fix merge conflicts

* fix bug in command palette

* fix bug with CellLabels when there is no content

* update CONTRIBUTING (#695)

* brew install instructions in readme

* fix bugs with undo/redo (trying to undo empty stack); make fast default npm start

* initial design

* refactoring webWorkers

* delete sheet

* Next firefox clipboard (#693)

* in-app-only support for firefox copy/paste

* better firefox copy/pasting support

* removing commented out lines

* adding cut to the documetn listeners

* working through firefox updates

* disable copy to PNG for firefox

* added sentry event for !e.clipboardData

* coding style tweaks

* refactor: refined UI/X for sheets bar (#697)

* style tweaks

* menu casing

* Update SheetBarTab.tsx

* fix color picker shadowing

* tweaks

* updates

* permissioning

* tweaks

* fix delete; use window.confirm instead of custom dialog box

* create sheet in palette

* sheet ordering fixed; right click no longer allows drag

* Switch to Sheet (command palette)

* disable tabs on mobile

* fix bug with typing over max width content in rename sheet tab

* fix bug where right click after context menu does not select correct sheet tab

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* fix bug with ordering of display with multiple sheets

* WIP for python integration

* Next Dependency Graph (#696)

* directed acyclic graph via petgraph

* allow Pos or Rect

* Modify structure to a link a Rect to a Pos

* add transaction operations for CellDependencies

* refactor dependencies to use HashMap

* remove petgraph

* refactor

* refactor operations to a separate file from transactions

* message

* refactor operations for computation work

* cleanup

* remove unused code

* removed unused code

* cleanup

* fix FloatingContextMenu when switching tabs (#701)

* fix FloatingContextMenu when switching tabs

* fix SheetBarTab bug

* fix cursor when editing

* fix: hide "+" sheet button if you don't have permission

* fix: fix cursor repositioning

Changes from onKeyUp to onKeyDown to prevent the cursor from changing position in the command palette input

* fix: remove auto correct, spelling, etc., on command palette

* fix: copy PNG to clipboard from command palette (#703)

* fix: proper casing for props

* feat: improved sheet switcher in command palette (#704)

* reworking operations

* initial commit (#706)

* fix: proper version comparison (#707)

* remove extra setViewportDirty() in CellsSheets

* revert last change

* cleaned up bug with loading of large files

* Next offsets typescript (#705)

* Begin column & row resizing

* Add grid offsets in Rust

* Fix offsets

* WIP

* screen -> offsets

* fix comments

* WIP

* finished cleaning up errors

* working on heading resize

* fixing pointers WIP

* fix selection highlighting of gridHeadings

* fix fill coordinates

* fix copy as png bounds

* heading resizing UI works properly

* fixed bug where last number was not showing in GridHeadings

* cleaning up unused code

* cellsLabels merged into CellsHash

* update doc

* rename CellsHash to CellsTextHash

* changing column/row size properly regenerates text

* fills and array properly update on column/row adjustments

* added more bounds fetching from rust; select column and row and all works

* arrow keys + meta/cmd arrow keys works again

* leaving some comments on future improvements

* double clicking heading line resizes column to max width

* removing unnecessary spelling word

* removing deprecated files

* fix operations after merge

* fix negative col/row resize

* add ?cell-boxes

* fix spacing for right aligned

* disable row resizing

* cursor moves when selecting all/rows/cols

* fix bugs with empty column/row/all selection

* fix bug with row headings

---------

Co-authored-by: HactarCE <6060305+HactarCE@users.noreply.github.com>

* reworking python stuff

* reworking imports

* removing getcellsdb

* cleaning up type issues

* figured out how to integrate with rust

* python is properly running and requesting cells

* Next import csv (#708)

* Stub out csv import process

* Import CSV from the frontend and display on the grid via rust

* Include headers

* Remove header/record separation

* TS files for imports

* Fix width issue + refactor

* fix hoverover

* increase server file size

* Refactors

* Handles csv file parse errors in rust

* Capture CSV errors in Sentry

* cleanup

* Add in tests and test utils

* Small refactors

* Remove insertCsv.ts and move code directly into FileUploadWrapper

* Remove test csv file

* Add in error handling of failed csv imports in the UI

* Send csv file uint8 bytes before sending to rust

* Small perf enhancement

* Fix typo and handle zero byte file to avoid division errors

* Document test functions plus other PR nits

---------

Co-authored-by: David Kircos <davidkircos@gmail.com>

* File Updating -> Next (#700)

* reworking python connection

* fix create file bug

* fix run_python

* values sorrt of saving

* non-array result for python

* sort of support for python array output

* fix bug with single value

* Port auto complete to rust (#690)

* Basic shell for expandDown port

* Actually write to the spreadsheet PoC, add cursor support

* Handle values in multiple rows/cols for expand_right

* Handle non (0,0) origin cases, refactor to use rect functions

* Recactor set_cell_projections to a function

* Complete expand down

* Replace unwraps with results

* Bubble up errors to wasm_bingen, fix broken test

* Implement expand_left

* TS implementation of expand_left

* Fix broken tests from merge, add documentation + TODOs to auto_complete

* Complete expand up, handle edge cases in all directions, more tests

* Expand formats in all directions

* Cleanup

* Add helpers to test and visualize w/o needing the frontend

* Exhaustive value expansion tests

* Get bolds to show up on the Rust grid

* Test format expanding up and down

* Test format expanding left and right

* Handle format expansion up and down edge cases

* Simplify expands

* Make an expand a single transaction

* Handle combo expansions properly

* Start converting series to Rust

* Complete converting number series detection to Rust

* Implement find_auto_complete() in Rust

* Add in all addition-related test cases

* Support multiplication in a series

* Add in base functions and arrays for dealing with a text series

* Ugly conversion of text series functions, with most tests passing

* Cover all text series use cases + tests

* Refactor series.rs to be more Rust idiomatic

* Series in all directions

* Refactor

* Remove unused

* Move grid calls to PointerAutoComplete

* Implement vertical and horizontal shrinking

* Remove associated TS files

* Implement a generic expand API, get expand right/down working

* Apply formats for expand right/down working

* Complete rework of API, resolves all edge cases

* Re-enable all tests including multiple directions, fix bug on reverse non-series

* Add in validaton of formatting in tests

* Address off-by-one issue in widths

* Pairing

* Small refactors

* Complete re-write to accomodate up/down series expansion on combo with left/right expansion

* First batch of refactors

* Fix up and left series issue

* More refactors

* Finish refactors, fix lint warnings

* fix visual deleteRectangles

* Make shrinking great again

* Dev and test for shrink widht and height together

* Address shrink + expand use cases

* Remove formatting for shrinks

* Remove unused

* Add more comments

* Use a more descripting variable name for the selected rect prior to expansion

* Implement PR suggestions

---------

Co-authored-by: David Kircos <davidkircos@gmail.com>

* separating out offsets

* a clone of offsets.rs is now owned by sheet.ts

* fixing problems with accessing grid during commit

* compute cycle seems to work (w/o save)

* Next small fixes (#717)

* when triggering goto center viewport around cursor

* remove ensureVisible on panMode change

* fix undo/redo file menu

* fix async

* graph is saving

* error sort of shows on python output

* error message updates in console

* get_cell_value returns spill values as well

* better conversion of arrays in python

* Next address clippy lints (#713)

* Auto-fix clippy lints

* Apply clippy lints

* More clippy lints

* More clipply lints

* More clippy lints resolved

* Resolve remaining clippy lints

* Update proptest_derive, clear additional lint errors, add clippy to CI

* Address clippy warnings and enable failure on clippy warnings in CI

* Move clippy lints to test-rust.yaml

* Fix pathing issue in CI

* Allow identity_op in operators.rs

* Requested PR changes

* updated branch

* fixing async function for grid.sheets

* offsets mostly working (except undo :( )

* fix offsets w/undo and redo

* Next fix typescript tests (#716)

* Add tess for sheet in Rust

* More sheet tests

* More tests for sheets

* Remove some duplication

* Test sheet columns

* Test rows

* Remove intentionally ignored test to an ignored folder and exclude in jest.config

* Get validateAndUpgradeLegacyGridFile.test.ts working again

* Remove GridRenderDependency and associated tests

* Revert unnessary changes

* Add jest.config transforms back in

* Prefer .ignore.test.ts pattern over folder pattern for skipping test files

* Revert code that catches json parse errors and update mock files to have iterable cell_dependencies

* Remove logOutput in upgrade functions

* Fix clippy lints

* fix merge issues

* Next cell hash values (#720)

* First pass as populating the new summary.cell_hash_values_modified vec with JsRenderCell values

* Collect JsRenderCells for any operation

* Complete cell hash values + tests

* fix tests

* Add blank cell values into cell_hash_values_modified when setting cells

* sheets

* Get auto_complete tests to play well with async

* Get sheets tests to play well with async

* Get clipboard tests to play well with async

* Get undo/redo tests to play well with async

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Clippy auto-fix

* Fix clippy lints

* reduce nesting and add comment

* Add cell_value_regions_modified to TransactionSummary

* initial work on modified cells

* using JsRenderCellUpdate instead of update; included sheet_id with updates

* reworking TransactionSummary to mirror operations

* operations work

* working through updates

* delete and set cell work better?

* bold and italic properly update on change

* fix preloading of icons

* computing works again

* cleaning up comment

* python cycle is starting to work

* numeric decimals works properly

* clean up transaction_summary; cells array fixes

* Next minimize react reloads (#724)

* Use react-app-rewired to override webpack watcher in cra

* Single browser reload for changes in rust

* Remove log

* tests for fetch_code_cell_differences

* arrays shrink (by erasing values)

* fix value calculation for replaced cells during code run

* fix firefox clipboard commands

* fix a few timing errors in CodeEditor

* Next hate (#728)

* working through rendering

* Compiles, but should redesign

* starting to work through error

* Next python sheet not found error (#726)

* Make ErrorMsg externally tagged during serialization

* Send python error to JsRenderCellUpdate

* Remove unused mocks

* reverts how updates happen for hashes

* added error triangle

* Persist python errors on refresh

* Associate line number with invalid sheet name in python

* Apply clippy lints

* Apply clippy lints

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Next consistent cell value conversion from str (#719)

* Add tess for sheet in Rust

* More sheet tests

* More tests for sheets

* Remove some duplication

* Test sheet columns

* Test rows

* Remove intentionally ignored test to an ignored folder and exclude in jest.config

* Get validateAndUpgradeLegacyGridFile.test.ts working again

* Remove GridRenderDependency and associated tests

* Revert unnessary changes

* Add jest.config transforms back in

* Improved cell converter, implement set_cell_value in import csv

* Remove unused

* Consistent conversions in From<Any> for CellValue

* Handle consistent conversion for JsGridProxy's GridProxy::get()

* Handle consistent conversion for test_util::assert_cell_value()

* Handle consistent conversion for clipboard::array_from_plain_cells()

* Handle consistent conversion for sheet::with_random_floats()

* Fix clippy lints

* Remove unused

* Get TS tests working again

* Fix clippy lints

* Clipboard uses set_cell_value_operations

* Remove unused + refactor

* Revert &str->CellValue impl

* Revert changes, fix clippy lints

* Fix clippy lints

* Fix undo/redo tests

* Rafactor operations.rs to fix broken tests

* Fix clippy lints

* Generate a new package.lock file

* Remove commented out tests and remove unnessary comments

* Regenerate Cargo.lock

* Remove circular conversion

* Revert questionable conversion

* Remove python e2e tests

* Remove python-specific tests from CI

* reworking python flow

* Fix undo issues with bold, italic, align, wrap, and textColor (#729)

* code coming together (slowly)

* WIP

* code is sort of complete. getting it to compile

* files are compiling; fixed bug with renaming sheets

* changing codeEditor api calls

* all tests pass

* improving the way transactions go through the flow

* WIP get_cells

* python's getCells is working synchronously!!!

* free array from computeGetCells

* Fix error message for Python

* fixing compute test

* fixed array output for python

* docs

* adding debug messages to operations/compute

* replaced SheetPos with CellRef in compute cycle

* fix unnecessary imports

* cleaning up code

* WIP

* reimplement BottomBar SelectionSummary (#731)

* reimplement BottomBar SelectionSummary

* cleanup summarize code

* cleanup

* remove async, add tests

* add tests

* remove async

* fixing errors

* add formatting tests

* changing the way summary works with changes to cells

* transactionSummary uses the dumb way again

* update_deps does not call when there's an error

* more js error handling

* rename transaction in progress

* spills are updated after running code

* Add parsing of sheet references

* Move `SheetPos` and `SheetRect` to `position.rs`

* Add sheet IDs to formula references

This breaks:
- Unit tests (which use `FnGrid`)
- JS formula eval bindings

* Remove `GridProxy` and update tests to use `Grid`

We have a type system now that understands blank cells! 🥳

* cell error gets TransactionSummary (in a roundabout way)

* throw error on self referential

* getting closer on errors displaying

* error is working properly in "all" cases

* called focusGrid in floatingContextMenu and CodeEditor

* removing console.logs

* fixes display of single value python result

* code cells undo/redo properly after python execution

* working through a few bugs

* fixed bug with rendering cellsTextHash

* fixed bug where cells_to_compute would have duplicates and cause too many summaries to issue

* removing console.logs

* fix display issue for expanding python output array

* feature=js

* fix tests

* fix summarize test

* throw an error when trying to compute before python loads

* fix python not loaded error

* removing debug message

* fix ui autocomplete bug

* fix autocomplete ux bug

* cleaning up code

* fixing log messages

* adding timing for paste

* docs

* benchmarks wip

* rename expand to autocomplete, make private all autocomplete functions except the one exposed to js

* fix std_out for python

* more benchmarks

* fix bounds calculations after compute cycle

* cleaning up code

* experimenting

* adding formulas to TIP

* Rust borders (#698)

* Formula integration almost there

* fix bug with cell highlighting while in formula

* fixes for merge

* fixed placement of circular reference for python

* LabelMesh can handle multiple meshes

* label mesh can handle large vertices

* fixed bug with resizing column

* removed AI cell type (except for the old data type)

* fix cell input visual bug

* Next delete (#735)

* working through delete code cells

* delete cell/code works again

* add comments

---------

Co-authored-by: David Kircos <davidkircos@gmail.com>

* add benchmark for import csv

* Move Transaction in Progress (#737)

* move files

* fix tests

* Next delete (#738)

* delete cells almost working

* finished undo for code cell paste

* fixed paste test

* fix syntax highlighting for formulas

* Next fix array output (#739)

* fix array output not sending proxies

* reverting a change

* setting output to none when error occurs

* fix test.py imports

* remove numpy mock

* fix python testing; add Cell conversion tests

* add back github python tests

* rehooking up eval_result for AI tab

* Next sheet palette permission (#741)

* sheet commands are only available for editors

* allow switching of sheets w/o editor permission

* fix test failures

* Next renderer preloader (#745)

* improve preloading

* add fill_color check

* adding comment

* remove extra comment

* adding back space

* cleaning up console.log

* move create call back to CellsSheet

* fix arrow keys on CellInput

* add back mixpanel event [CodeEditor].cellRun

* add npm run lint:clippy

* Fix & test sheet references in formulas (#742)

* Fix & test sheet references

* remove console.log

* Fix formula function parsing

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Improve CellInput (#747)

* strip HTML on input

* fix

* scale minWidth by viewport

* compute cells includes all changed cells in array (#749)

* Next file import export (#730)

* Working example of minimilistic import/export

* Import v1.3 file format, convert to v1.5 format sans code, values and dependencies

* Convert 1.5 file format to internal rust structs

* Get imports working for legacy v1.5 json

* Complete full upgrade from v1_3 to v1_5 files + refactors

* TS reversions to 1.5, remove unused bincode

* Load v1.3 basic example from api and convert/render v1.5 in the UI

* Remove several clones

* Remove more clones

* Remove upwraps

* Remove more unwraps and fix ownership issues

* Fix broken tests, remove tests outside of non-file-related files

* Add TODOs for more elaborate tests

* Export remaining column values for v1.5

* Import remaining column values for v1.5

* Export code cells for v1.5

* Correctly import array_output for v1.3 files

* Handle code cells on v1.3 -> v1.5 conversions

* Fix bug in language case

* Handle output_value for v1.5 code cells

* Handle formulas in conversions

* Update default file

* Handle a new, blank file + tests

* Fix bug where numeric cell values weren't saving

* Fix issues related to escaping

* Get spills working properly on v1.3 -> v1.5 upgrade

* Fix code cell reference bug in upgrades, fix code block issue

* Add spills for non-array_output code cells

* Hack to handle output_value in v1.3 conversions

* Rename all v1.5 things to v1.4

* Rename .json quadratic-core examples to .grid

* Fix broken tests

* Remove unused

* Fix textFormat conversions from 1.3, add test

* Fix issue with converting text_color and fill_color attributes

* Properly handle conversion of numeric formats from v1.3 -> v1.5

* Import and export borders that persist in the file format

* Fix broken tests, initial BorderSelection work

* Remove unused

* Clippy auto-fixes

* Have clippy ignore warnings in CI

* Fix Clippy errors

* Fix clippy warnings for all features and all targets

* Revert a clippy auto-fix and override to avoid test breakage

* Fix TS test and clippy lint

* remove console.log on load

* undo/redo w/cursor works again

* adding timing for saving files in FileProvider via debugShowFileIO

* adding size calculation for file save

* fix undo/redo for sheet move, add, and delete (#751)

* fix formula highlighting (#746)

* fix formula highlighting

* cell highlighting when cursor is over grid reference

* ensure indicator doesn't render for non-sheet

* cleaning up old code

* adding test for parse_formula

* adding another failing test in formula.rs

* adding another test

* fix bug with editor crashing when switching cells

* comment out failing formula test

* move --dev out of fast scripts

* Next hide cell input (#757)

* remove CellLabel from rendering when editing cell

* remove console.logs

* cellInput shrinks properly

* Next compute cycle (#755)

* investigating airports distance problems

* fix bug in cells_to_compute

* simplifying clearing of cells_accessed

* adding debug flag to dependency cell output

* Next fix code cell overwrite (#752)

* overwrite value/code with user input

* cell value overwrites any code cells

* fix linting error

* fix linting

* Gird Performance to Sentry (#748)

* strip HTML on input

* fix

* scale minWidth by viewport

* send grid performance metrics to console and sentry

* sample perf and send to Sentry, upgrade Sentry

* code cleanup

* adjust traces

* set sentry environment

* revert cells.rs

* update magic number

* refactor: Remove async from formulas 🎉 (#760)

* Remove async from formulas 🎉

* properly update deps after formula completes

* only update deps when formula runs without error

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Next perf (#754)

* improve performance of rust's getRenderCells

* clean up imports

* fix rendering bug

* cleaning up comments

* fix linting error

* tweaks based on comments

* reverted rendering.rs change; working through other perf improvements

* remove code around not clearing summary for cellSheets

* more experimenting

* preparing for merge

* Next Transaction in Progress / debugShowRustTime (#761)

* fail silently when transaction is already in progress

* added a debugShowRustTime to separate out the proxy calls

* show snackbar message when transaction is busy

* updated busy message

* working on forever snackbar

* fix rust lint issue

* rust lint

* transaction busy

* Next get cell value (#764)

* change get_cell_value so it outputs spills before vlaues

* only cell values during edit

* fix bug where CellInput's text was not removed from renderer

* fix size of input box (#765)

* python output has equally sized 2d arrays

* Next borders working for files (#750)

* Save border sections (partials) for v1.4

* Remove upwraps/clones

* Import and upgrade borders from 1.3 files

* Fix lints

* Store cell borders when copying

* Copy/paste borders, but only displays on refresh

* Render borders on paste w/o a refresh

* Undo copied borders

* Next copy paste borders (#762)

* Store cell borders when copying

* Copy/paste borders, but only displays on refresh

* Render borders on paste w/o a refresh

* Undo copied borders

* Remove unused

* fix rust test

* added docs for test generation

* added better compute setting for clipboard; fixed bug with clipboard (left and top were reversed)

* remove console.log

* fix clippy stuff

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Next number menu (#767)

* clean up menu

* add scientific notation

* fixes based on PR comments

* Next python convert (#763)

* single and array value conversion w/ops

* added formatting to Array and Single Value python output

* clippy fixes

* more clippy fixes

* WIP adding tests to cover formula issues

* WIP tests + debug

* fixed bug with formulas not properly updating deps

* clean up debug flags

* removed debug message

* remove more debug messages

* fix clippy issues

* more clippy

* rendering.rs tweak

* fix update code cell

* ensure renderer updates

* fix clippy issue

* another clippy?

* minor tweaks

* fix tests

* improve npm run lint:clippy

* Next fix number cell issue in array output (#769)

* Update example files

* Store CellValues instead of Strings when importing array_output values

* Revert example files

* Next currency decimals (#768)

* currency changes decimals to 2

* auto formatting

* add tests

* decimal no longer change during currency on import or compute when already set

* format to the right for numbers

* remove log

* Next upgrade examples to v1.4 (#771)

* Update example files

* Store CellValues instead of Strings when importing array_output values

* Revert example files

* Revert example files

* Convert example files to v1.4, import array_output numbers as strings

* Remove unused

* Resave the default example

* Fix import CellSide issue

* left align python example

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Next commas (#772)

* fixed test files; added numeric_commas to columns

* connected UI to commas

* fix test files

* fix clippy

* fixed per feedback

* minor tweaks based on feedback

* fix auto/automatic

* fixed copy paste with commas

* fix icon

* Fix OpenAI Example (#773)

* Update example files

* Store CellValues instead of Strings when importing array_output values

* Revert example files

* Revert example files

* Convert example files to v1.4, import array_output numbers as strings

* Remove unused

* Resave the default example

* Fix import CellSide issue

* Update OpenAI example to work with the new chat/completions API

* Revert python example

* Resave openai file to show the error copy

* Fix import borders issue from v1.3 to v1.4 (#776)

* try to force a render whenever rebuild or attach is called (#774)

* python running indicator in code editor (#777)

* Next fix get cells (#779)

* fix get_cells speed issue

* fixed python casting issue

* cut from code editor doesn't cut from grid

* Next port python tests to rust (#775)

* Test Python code_cells in Rust

* Remove debug info

* Check the output values affected cells for Python tests

* Assert that cell values are empty when the python output shrinks

* Reuse grid controller for shrinking code cell test

* Test python errors + refactors

* Remove unused TS tests

* Next python 2 (#780)

* design tweaks

* Fix None output for Python

* Python outputting an empty array shows a blank cell

* Add sheet info to `parse_formula()` (#782)

* Fix sheet references in `parse_formula()`

* add highlighted cells for different sheets

---------

Co-authored-by: David Figatner <david@yopeyopey.com>

* Next misc (#783)

* don't close code editor when editing another cell

* highlight for formulas no longer show on non-formula languages

* fix Python handling of undefined in arrays

* fix highlighted cells for formulas

* code cursor stays on screen even when editing a different cell

* fix cursor edit outline

* move clippy to lint gh action

* use npm command for lint:clippy in gh runnner

* Next last 2 (#788)

* fixed test_deleting_to_trigger_compute

* fix cell highlighting bug for second sheet

* clippy issues

---------

Co-authored-by: David Kircos <davidkircos@gmail.com>
Co-authored-by: Jim Nielsen <jimniels@gmail.com>
Co-authored-by: HactarCE <6060305+HactarCE@users.noreply.github.com>
Co-authored-by: David D <info@collectivesessions.com>
Co-authored-by: Jacob Rice <jacob.rice.systems@gmail.com>
  • Loading branch information
6 people committed Nov 13, 2023
1 parent a60f8b6 commit 07df3ad
Show file tree
Hide file tree
Showing 406 changed files with 1,139,776 additions and 36,127 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/quadratic-core
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
rustc --version
cargo clippy --version
- name: Run Clippy
run: npm run lint:clippy

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/test-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ jobs:
cargo --version --verbose
rustc --version
cargo clippy --version
# - name: Lint
# run: |
# cd core
# cargo fmt -- --check
# cargo clippy -- -D warnings

- name: Test
run: |
cd quadratic-core
cargo check
cargo test --workspace
cargo test --workspace
2 changes: 1 addition & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ jobs:
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
npm run build:wasm:nodejs
npm run build:wasm
- run: npm run test:unit:ci
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ venv/*

# Generated Rust files
quadratic-core/target/
quadratic-core/tmp.txt

# Generated JS files
quadratic-api/node_modules/
quadratic-api/.env
quadratic-api/.env.local
quadratic-api/dist
quadratic-api/dist
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.svg
*.svg
src/quadratic-core
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"env": {
"NODE_OPTIONS": "--experimental-vm-modules"
Expand Down
59 changes: 43 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
{
"editor.formatOnSave": true,
"cSpell.words": [
"dgraph",
"Fuzzysort",
"hljs",
"openai",
"pixi",
"pixiapp",
"Signin",
"subquadrant",
"subquadrants"
],
"editor.codeActionsOnSave": {
"source.organizeImports": true,
}
}
"editor.formatOnSave": true,
"cSpell.words": [
"actix",
"bigdecimal",
"bindgen",
"dbgjs",
"dcell",
"dgraph",
"endregion",
"Fuzzysort",
"hljs",
"htmlescape",
"indexmap",
"itertools",
"msdf",
"Northbridge",
"openai",
"opensans",
"peekable",
"pixi",
"pixiapp",
"rects",
"Signin",
"smallpop",
"Southborough",
"subquadrant",
"subquadrants",
"unspill",
"vals",
"Westborough"
],
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"rust-analyzer.linkedProjects": ["./quadratic-core/Cargo.toml"],
"rust-analyzer.checkOnSave": true,
"files.associations": {
"*.grid": "json"
}
}
31 changes: 21 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,44 @@ If you have any problems getting the project to run locally, please create an is
2. Install [rustup](https://www.rust-lang.org/tools/install)
3. Install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
4. `rustup target add wasm32-unknown-unknown` to install the WASM toolchain
5. Install cargo watch `cargo install cargo-watch`

## Run Quadratic

In order to run the front-end and/or the server locally, you must have all the environment variables configured in `.env.local` (and `quadratic-api/.env.local` if you’re running a local server). You can grab the values from [our team Notion page](https://www.notion.so/Env-Variables-78b1a1da19d0421993abe8c449e51496?pvs=4) or by asking a team member.

1. Start everything in one thread `npm start`

### Run front-end locally

1. `npm run build:wasm` to compile the Rust code
2. `npm install` to install dependencies (run again when updating Rust)
3. Configure `.env.local` values.
4. `npm start` to run in browser or `npm run dev` to run with Electron
1. `npm install` to install dependencies
2. Configure `.env.local` values
3. (a) `npm start` to run in browser or `npm run dev` to run with Electron; or (b) `npm run watch:front-end` to run in browser with automatic wasm rebuilding

### Run server locally

1. `cd quadratic-api`
2. `npm i`
3. Install [postgress.app](https://postgresapp.com/) (follow instructions on website)
3. Install and configure PostgreSQL:
1. macOS users: Install [postgress.app](https://postgresapp.com/) (follow instructions on website) or `brew install postgresql` ([instructions](https://wiki.postgresql.org/wiki/Homebrew))
2. Linux users:
1. Install [postgres](https://www.prisma.io/dataguide/postgresql/setting-up-a-local-postgresql-database#setting-up-postgresql-on-linux)
2. Configure your user permissions and create the database in the `psql` prompt:
- `# CREATE ROLE username WITH LOGIN PASSWORD 'some_password';`
- `# CREATE DATABASE "quadratic-api" WITH OWNER = username;`
- `# GRANT ALL PRIVILEGES ON DATABASE "quadratic-api" TO username;`
- `# ALTER ROLE username CREATEDB;`
4. Create two environment files `.env.local` & `quadratic-api/.env.local`.

- For the `.env.local` react app ENV variables you will need to set the following variables:
`REACT_APP_AUTH0_DOMAIN` `REACT_APP_AUTH0_CLIENT_ID` `REACT_APP_AUTH0_AUDIENCE` `REACT_APP_AUTH0_ISSUER` `REACT_APP_QUADRATIC_API_URL`
You will need to ask your team for the appropriate values.
- Note: Linux users may need to call it `quadratic-api/.env` instead.

- For the `.env.local` react app ENV variables you will need to set the following variables:
`REACT_APP_AUTH0_DOMAIN` `REACT_APP_AUTH0_CLIENT_ID` `REACT_APP_AUTH0_AUDIENCE` `REACT_APP_AUTH0_ISSUER` `REACT_APP_QUADRATIC_API_URL`
You will need to ask your team for the appropriate values.

- For `quadratic-api/.env.local` you will need to set the `DATABASE_ENV` to point at your local postgres db. You will also need to copy `AUTH0_JWKS_URI` and `AUTH0_ISSUER` from `quadratic-api/.env_example` into your local `quadratic-api/.env.local` api env variables.
- For `quadratic-api/.env.local` you will need to set the `DATABASE_ENV` to point at your local postgres db. You will also need to copy `AUTH0_JWKS_URI` and `AUTH0_ISSUER` from `quadratic-api/.env_example` into your local `quadratic-api/.env.local` api env variables.

5. `npm run prisma:migrate`
6. Start both `npm run api:start` and `npm start`

### Run tests (TypeScript)

Expand Down
8 changes: 8 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function override(config, env) {
config.watchOptions = {
...config.watchOptions,
ignored: ['**/quadratic-core/**/!(quadratic_core_bg.wasm)', '**/quadratic-core/types.d.ts'],
};

return config;
};
10 changes: 9 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"verbose": true,
"testEnvironment": "node",
"preset": "ts-jest",
"testPathIgnorePatterns": [
"<rootDir>/tests-e2e/*",
"<rootDir>/node_modules/",
"<rootDir>/quadratic-api/*",
"<rootDir>/quadratic-core/*"
"<rootDir>/quadratic-core/*",
".ignore.*"
],
"modulePathIgnorePatterns": [
"<rootDir>/quadratic-core/pkg/package.json",
"<rootDir>/src/quadratic-core/package.json",
"<rootDir>/src/quadratic-core/__mocks__/package.json",
"<rootDir>/build/pyodide/package.json"
],
"transform": {
"^.+\\.(ts|tsx|js|jsx)?$": "ts-jest",
Expand Down
Loading

1 comment on commit 07df3ad

@vercel
Copy link

@vercel vercel bot commented on 07df3ad Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

quadratic – ./

quadratic-quadratic.vercel.app
quadratic-nu.vercel.app
quadratic-git-main-quadratic.vercel.app

Please sign in to comment.