-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide how to handle 3rd party actions #39
Comments
I would use: import { pythonista } from '@joshfarrant/shortcuts-js/actions';
pythonista.editScript();
pythonista.runScript(); This would work well also in your site's Playground. Regarding the directory structure, I would prefer to have camelCased folders:
CamelCase will homogenize app names and built-in action names.
|
I think what @xAlien95 has suggested sounds great. We’ll need to be mindful about naming as some apps will be very similar... As an example here are 2 of the Carrot apps: Carrot⁵ (Carrot Weather) |
I like the explicit namespacing of @xAlien95's solution, as well. |
I do like that this is quite a clean solution. My only concern with this is that it introduces the possibility of collisions between action names and app names. It’s not unreasonable to think that there could be an app called import { list } from ‘@joshfarrant/shortcuts-js/actions’; actually import? Do we just have to make special cases for those and set the app name as |
Prefacing each app action group with app[appName] could be a good way to do this. From a folder structure POV it would keep them all together too rather than spread between the native actions in alphabetical order (for the most part) |
What about an apps directory in import {
pythonista,
} from ‘@joshfarrant/shortcuts-js/actions/apps’;
pythonista.editScript(); We could then also expose an import {
apps,
} from ‘@joshfarrant/shortcuts-js/actions’;
const {
pythonista,
} = apps;
pythonista.editScript(); People can then use whichever method they prefer. |
A user cannot really distinguish a "third-party" action from a "first-party" action, since this attribute isn't explicitly specified in the Shortcuts app. As an example, the Post on Facebook action is a first-party action although it refers to a third-party app, and this may led to confusion.
If in the near future the Facebook app will add support for custom third-party shortcuts actions, then we will have actions in different groups/sub-modules that belong to the same app: the ones starting with Early, I suggested pythonista.editScript();
pythonista.runScript(); just to distinguish those actions from future actions that may have a similar or equal shown name. I would not reject the possibility to call those actions with completely custom names, like editPythonistaScript();
runPythonistaScript(); if a good documentation is provided on the cool Shortcuts Fun website (really, those css, that editor.. I do really like how you presented that website!). Can we work on a documentation page in which all the actions are grouped and listed as they shows up in the Shortcuts app? That way users won't have any problems distinguishing all the actions and getting the right function names used in this node module. |
We need to decide how best to store and expose actions from 3rd party apps.
#37 Adds support for Pythonista actions, and it would be good to start as we mean to go on with regards to these actions.
This has briefly been discussed before (here) but it would be good to get more feedback on the correct approach to take.
My main concern is that I don't want the import of these 3rd party actions to be too messy. Ideally we'd have something like:
We could potentially have something like
Which is arguably a bit cleaner, but does introduce the possibility of collisions between app names and built-in action names, which probably rules this option out.
In terms of directory structure we could have:
Does anyone else have any thoughts on this?
The text was updated successfully, but these errors were encountered: