Editor home folder and menu for npm scripts in package.json


#1

Hello,

I just tried the “clone” repository feature and this is the resulting project:

This project has an integrated build system which requires to run “pnpm run build” whenever the user wants to publish modifications to the website.

Basically the user edits the content in the ./source folder, while the website is published/served from the ./docs folder.

So I have two requests (or questions?) about that.

  • Can the home folder of the editor point to a different location rather than the app’s root?
  • Can we have a menu in the editor with a shortcut to run scripts listed in package.json (but the ‘start’ one)

This way the user can focus on authoring content in the ./source folder without having to deal or see all the other stuff coming from the build system.

Then the user could also just hit the option “Build” to publish to the “./docs” folder, without having to open the console and type pnpm run build himself.

Perhaps we could use the enviroment vars for such purpose? Something like:

EDITOR_HOME=./source
PACKAGE_SCRIPT_MENU=true

Cheers,
g.


#2

You can’t change the root folder. But you can add files/folders to a .gitignore file and they will be hidden from the editor.

The script runner suggestion is an interesting one, I’ll raise a feature request for it.


#3

The .gitignore hint worked but then I noticed that there are missing files I did not put in the .gitignore file.
Specifically files in the images/ folder are missing in the editor.
This is the actual file list in the source/images folder.

app@ebook:~ 10:49 
$ ls -la source/images/
total 20
drwxr-xr-x 1 app app   126 Jul 22 11:22 .
drwxr-xr-x 1 app app   304 Jul 23 09:03 ..
drwxr-xr-x 1 app app   106 Jul 22 11:22 banners
drwxr-xr-x 1 app app    28 Jul 22 11:22 gifs
drwxr-xr-x 1 app app   262 Jul 22 11:22 icons
-rw-r--r-- 1 app app 13791 Jul 22 11:22 lighthouse_score.jpg
-rw-r--r-- 1 app app  2199 Jul 22 11:22 menu_template_preview_1.png

but the editor only shows one entry:

source/images/icons/desktop/safari-pinned-tab.svg

#4

Binary files aren’t shown in the editor, see https://glitch.com/help/hidden-files/