Closed Nemikolh closed 2 months ago
Run & review this pull request in StackBlitz Codeflow.
Latest commit: |
c716577
|
Status: | ✅ Deploy successful! |
Preview URL: | https://987bfb79.tutorialkit-demo-page.pages.dev |
Branch Preview URL: | https://joan-sync-files-from-fs.tutorialkit-demo-page.pages.dev |
Thanks for the questions! :smiley: Answering inline:
Does this enable users to create files from terminal/commands so that they appear in file editor?
It does not at the moment. I was thinking we would do this later. Maybe as part of the filesystem.visible
work you started?
What do you think?
If not, maybe this doesn't close #208?
I think it does. Or at least based on what the first comment says:
I'm creating a NgRx (Angular state management library) and the first step is to add the library with the
ng add @ngrx/store@latest
. It adds the dependency in package.json and updates some files.I added all these files in the _files folder as the student task is to run the script and sees how it affect the project. However even if the command succeeds, the files are not updated.
I think we can consider it closed when we merge this PR.
We should keep https://github.com/stackblitz/tutorialkit/pull/165 in mind during this PR. I think that could be
filesystem.visible: string | string[]
.
Oh I really like that naming! :star2:
Naming of
filesystem.syncChanges
. As this could in future also allow globs for watched files, should we rename this tofilesystem.watch
instead?
Ah yeah this makes more sense, I'll rename it :+1:
Does this enable users to create files from terminal/commands so that they appear in file editor?
It does not at the moment. I was thinking we would do this later. Maybe as part of the
filesystem.visible
work you started?What do you think?
Sounds good to me, let's leave it to the next PR.
Oh very good point!!
Dang, I knew there was something missing with testing and this PR :sweat_smile: , I'll add it :+1:
This PR adds a new property
filesystem
to the metadata of a Tutorial / Chapter / Lesson:When
syncChanges
is set totrue
, if files are modified on WebContainer via a terminal or by a process spawned manually via thewebcontainer
export ontutorialkit:core
, the changes will be reflected in the editor.Closes #208
This is opt-in because it can have a performance impact on the UI if lots of files are being modified / generated.
In the future we will likely accept
boolean | string
forsyncChanges
to be able to narrow down the watched files and improve performance.