sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Normalize files paths

Open danilowoz opened this issue 3 years ago • 0 comments

Tell us how you think we can improve Sandpack

Standardize and normalize the files paths provide by:

  • Templates;
  • Files props;
  • External sandboxes (future feature #347);
  • Package.json creation;

How would your idea work?

  • Add leading slash;
  • Remove leading dot (?);
  • Make sure it doesn't affect activePath and openPaths;

What are invalid and valid file paths you can pass to files object?

Valid:

  • "./";
  • "/foo.ts";
  • "/foo" no extension;
  • "foo.ts" no leading;

Invalid

  • "/"
  • "..."
  • "..fooo"

danilowoz avatar Feb 02 '22 14:02 danilowoz