plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

Unable to save Plunk if a path name starts with `_` #553

Open boghyon opened 3 years ago

boghyon commented 3 years ago

To Reproduce

Steps to reproduce the behavior:

  1. Open https://plnkr.co/edit (and select a template if not already done).
  2. Prepend an underscore (_) to a file or folder name. E.g. lib/script.jslib/_script.js .
  3. Save the plunk.

Errors / logs in developer tools

The server responds with the following error message:

plunker-save-error-if-a-file-or-folder-name-starts-with-an-underscore

Child \"entries\" fails because [\"entries\" at position 2 fails because [child \"pathname\" fails because [\"pathname\" with value \"lib/_script.js\" fails to match the required pattern: /^\/?(?:\.[a-zA-Z0-9]|[a-zA-Z0-9]|\$)[\w-](?:\.[\w-]+)(?:\/[a-zA-Z0-9][\w-](?:\.[\w-]+))$/], child \"pathname\" fails because [\"pathname\" with value \"lib/_script.js\" fails to match the required pattern: /^\/?(?:\.[a-zA-Z0-9]|[a-zA-Z0-9]|\$)[\w-](?:\.[\w-]+)(?:\/[a-zA-Z0-9][\w-](?:\.[\w-]+))$/]]]

Additional context

Some frameworks and organizations have naming conventions that require filenames or folder names to start with an underscore in order to indicate that their visibility is private. E.g. go to https://github.com/SAP/openui5/find/master and type _. There are many files starting with _.

It would be nice if Plunker could support such names.