This is a demo package which controls the system volume on MacOS, executing a throttled terminal command.
Warning
Careful with this demo package. Sudden audio jumps may occur. Make sure you lower app volumes and avoid using headphones.
- The
index.jsfile is the NodeJS entrypoint of the package. There are specific hooks exported from this file which are read by the Grid Editor's package manager. In Editor, the package manager sideloads all packages in their own threads. - There is a components folder which contains the UI of the package. It is a Svelte + Vite project, built as a web-component.
- There are two
package.jsonfiles. One in the root folder, which is for the package manager to read the package metadata and also for any NodeJS only backend npm packages. The other is in the components folder, which is for the Svelte + Vite project, where you can install client-side npm packages.
-
Clone the repo to
grid-userdate/packages, which is under your user's documents folder. -
After cloning the repo, run
npm installin both the root and components folder.
npm install # in the root folder
cd components && npm install-
Build the package by running
npm run buildin the root folder, this builds both the webcomponent and the package itself. -
Open Grid Editor, go to the Package Manager and enable the package. The package must be built first, before it can be used in the Editor.
-
After you make code changes, the package must be rebuilt and sometimes the package manager restarted to see the changes.
-
Current advise is to clone the Grid Editor app as well, and open both the Editor and the package in your code editor. As of today in Editor version 1.6.0, the logs of the package is only visible when you run the Editor from source and look at the terminal logs.
Caution
Uninstalling the package from the package manager, will delete the actual files and essentially your code from grid-userdata/packages. Make sure you save your work, commit to git or copy the folder somewhere else before uninstalling the package.
To release a package be able to share it with others, you need to build a zip package from it. It's best to do that based on the .github/workflows/main.yml file.
You will need to enable the workflow to write packages on your repository in the Github settings menu.

