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

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

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Sep 16, 2024

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:

Copy link

stackblitz bot commented Sep 16, 2024

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

@AriPerkkio AriPerkkio marked this pull request as ready for review September 17, 2024 11:24
Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

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

Really good work on this! 🤩

Some very minor things, and let's ship this! 💪

packages/react/src/core/ContextMenu.tsx Outdated Show resolved Hide resolved
packages/react/src/core/ContextMenu.tsx Outdated Show resolved Hide resolved
packages/react/src/Panels/WorkspacePanel.tsx Outdated Show resolved Hide resolved
packages/astro/src/default/styles/variables.css Outdated Show resolved Hide resolved
packages/react/src/Button.tsx Outdated Show resolved Hide resolved
packages/react/src/core/ContextMenu.tsx Outdated Show resolved Hide resolved
packages/react/src/core/ContextMenu.tsx Outdated Show resolved Hide resolved
packages/react/src/utils/classnames.ts Show resolved Hide resolved
packages/astro/src/default/components/LoginButton.tsx Outdated Show resolved Hide resolved
Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

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

Yay! 🤩🤩

@Nemikolh Nemikolh merged commit c1a59f5 into stackblitz:main Sep 18, 2024
10 checks passed
@AriPerkkio AriPerkkio deleted the feat/allow-edits-globs branch September 18, 2024 18:20
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.

2 participants