Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local file system functionality to all tools #411

Merged
merged 51 commits into from
Sep 10, 2024

Conversation

netalondon
Copy link
Collaborator

@netalondon netalondon commented Jul 23, 2024

Closes #352

Copy link
Collaborator

@DavidSouther DavidSouther left a comment

Choose a reason for hiding this comment

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

I have reviewed the projects part and most of the stores, but I'm getting bogged down in the UI. Can you break this into two PRs - one that updates the project layout and structure, and a second that does the file system user interface?

package.json Outdated Show resolved Hide resolved
simulator/src/test/chiptst.ts Outdated Show resolved Hide resolved
simulator/src/test/tst.ts Outdated Show resolved Hide resolved
simulator/src/test/tst.ts Outdated Show resolved Hide resolved
simulator/src/test/vmtst.ts Outdated Show resolved Hide resolved
extension/views/hdl/src/index.tsx Outdated Show resolved Hide resolved
web/src/shell/test_panel.tsx Outdated Show resolved Hide resolved
components/src/stores/chip.store.ts Outdated Show resolved Hide resolved
components/src/stores/chip.store.ts Outdated Show resolved Hide resolved
components/src/stores/chip.store.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@DavidSouther DavidSouther left a comment

Choose a reason for hiding this comment

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

Again, I was able to review changes in projects/ and most of simulator/ and components, but please pull out (at least) web/ and related changes to a separate PR.

Looks like there's maybe four changes in here?

  1. setStatus to Action
  2. Project test structure
    2b. Project files with updated load instructions
  3. Web shell to create files

package.json Outdated Show resolved Hide resolved
simulator/src/loader.ts Outdated Show resolved Hide resolved
simulator/src/test/chiptst.ts Outdated Show resolved Hide resolved
simulator/src/test/cputst.ts Outdated Show resolved Hide resolved
simulator/src/test/vmtst.ts Outdated Show resolved Hide resolved
web/src/pages/asm.tsx Show resolved Hide resolved
@netalondon
Copy link
Collaborator Author

Again, I was able to review changes in projects/ and most of simulator/ and components, but please pull out (at least) web/ and related changes to a separate PR.

Looks like there's maybe four changes in here?

  1. setStatus to Action
  2. Project test structure
    2b. Project files with updated load instructions
  3. Web shell to create files

Sorry I missed your last comment about this. Will do.

@netalondon netalondon force-pushed the feat/local-fs branch 5 times, most recently from fd76718 to 7220a12 Compare July 31, 2024 11:06
@netalondon netalondon mentioned this pull request Jul 31, 2024
Comment on lines 293 to 294
console.log(path);
console.log(await fs.scandir("/"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

(nit) Remove

components/src/stores/base.context.ts Show resolved Hide resolved
components/src/stores/vm.store.ts Outdated Show resolved Hide resolved
simulator/src/chip/builder.ts Outdated Show resolved Hide resolved
this.cpu = new CPU({ ROM: rom });
this.reset();
}

override async step() {
if (!this.hasLoad && !this.fileLoaded) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

(opt) De Morgan's for readability?

if (!(this.hasLoaded || this.fileLoaded))

@netalondon netalondon marked this pull request as ready for review September 8, 2024 06:41
@DavidSouther DavidSouther changed the base branch from main to release/fs-ui September 10, 2024 22:19
@DavidSouther DavidSouther merged commit 6bfc5f1 into nand2tetris:release/fs-ui Sep 10, 2024
DavidSouther added a commit that referenced this pull request Nov 27, 2024
* Add local file system functionality to all tools (#411)

* Change hardware simulator to use local file system API
* Handle chips with multiple test files
* Allow dash in compare file names
* Use local storage file system as fallback
* Always use file picker component
* Fix test script dropdown
* Only load compare files using compare-to
* Add warning when can't find matching test file
* Track fs upgrade in assembler
* Save assembler result on disk
* Add compare-to inst to cpu and vm tests
* Implement loading custom chips
* Fix ROM32K load inst in computer tests
* Return chip selection dropdowns
* Implement test script load command
* Fix compilation error when loading single vm file
* Fix bug in vm file loading
* Add async behavior to test script load command
* Add error message when loaded file is missing
* Fix bug where switching chips while builtin will override new file content
* Require a load command in test scripts
* Add file not found error message for load command
* Force CPU emulator test to either have load inst or a file already loaded
* Override pull in OutSubBus
* Add option to download project files from the IDE
* Specify return type
* Fix files not loaded on initial entrance in firefox
* Run tests on release/** branches
* Request permission to local FS when needed (#456)
* Detect hdl project folders instead of hardcoding them
* Move dialog.tsx to components
* Prompt user to grant permission when needed
* Fix initialization for local storage fs
* Add back HDL download button
* Improve header layout for hardware simulator
* Fix tooltip placement in chip Open button
* Correctly await resetFiles in loader
* Rework filesystem version IDs
* Improve format and structure of version error handling.
* Rework app async initialization, ensuring the file system is prepared before loading any pages.

Co-authored-by: Neta London <[email protected]>
Co-authored-by: David Souther <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]: Ability to add user-created helper chips
2 participants