stackblitz / tutorialkit

TutorialKit by StackBlitz - Create interactive tutorials powered by the WebContainer API
https://tutorialkit.dev
MIT License
504 stars 48 forks source link

feat: support glob patterns in `editor.fileTree.allowEdits` #332

Closed AriPerkkio closed 2 months ago

AriPerkkio commented 2 months ago

Adds support for users to specify one or multiple glob patterns in editor.fileTree.allowEdits.

---
type: lesson
title: Example
editor:
  fileTree:
    allowEdits:
      # Items in root
      - "/*"

      # Only "allowed-filename-only.js" inside "/first-level" folder
      - "/first-level/allowed-filename-only.js"

      # Anything inside "second-level" folders anywhere
      - "**/second-level/**"
---

When students attempt to create file that doesn't match these patterns, we show an error dialog:

stackblitz[bot] commented 2 months ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.