Adjust example API usage
The example API usage for some reason assumes the current working directory is the user's Modules folder, rather than the module folder itself; this contrasts with the shell commands, as those are configured to know the user's Data folder and which subfolder to check in.
So instead of await compilePack("mymodule/packs/src/actors", "mymodule/packs/actors"); the example usage should either mimic a full path or go await compilePack("packs/src/actors", "packs/actors");
I don't understand what is being asked here. The paths used in the API example are just that: examples. Any relative paths you provide to any API will be relative to the CWD.
So, some of this is probably because I was adjusting scripts from the shell command to using the node API, where the paths are handled differently, so I was not in the mindset that they were strictly relative paths. But also in terms of general use case I think it's more likely that the CWD is the module's folder and the examples should reflect that.
So, some of this is probably because I was adjusting scripts from the shell command to using the node API, where the paths are handled differently
Only if you're using the workon porcelain. If you use --in and --out, they will also be relative to the CWD (or at least I thought they were).
But also in terms of general use case I think it's more likely that the CWD is the module's folder and the examples should reflect that.
Yes, that's probably true.