@tutorialkit-rb/runtime 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -509,10 +509,16 @@ export class TutorialRunner {
509
509
  }
510
510
  }
511
511
  if (!this._editorStore.documents.get()[filePath]) {
512
- this._editorStore.addFileOrFolder({ path: filePath, type: 'file' });
512
+ const isDirectory = await _isDirectory(webcontainer, filePath);
513
+ if (isDirectory) {
514
+ this._editorStore.addFileOrFolder({ path: filePath, type: 'folder' });
515
+ }
516
+ else {
517
+ this._editorStore.addFileOrFolder({ path: filePath, type: 'file' });
518
+ this._updateCurrentFiles({ [filePath]: '' });
519
+ scheduleReadFor(filePath, 'utf-8');
520
+ }
513
521
  }
514
- this._updateCurrentFiles({ [filePath]: '' });
515
- scheduleReadFor(filePath, 'utf-8');
516
522
  }
517
523
  }
518
524
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tutorialkit-rb/runtime",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "TutorialKit runtime",
5
5
  "author": "StackBlitz Inc.",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "@webcontainer/api": "1.5.1",
32
32
  "nanostores": "^0.10.3",
33
33
  "picomatch": "^4.0.2",
34
- "@tutorialkit-rb/types": "0.1.4"
34
+ "@tutorialkit-rb/types": "0.1.5"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/picomatch": "^3.0.1",