Replies: 2 comments
-
Jason Lantz (Hero to all) pointed me at some oclif docs I'd missed. I assumed I'd have to import, but i can actually cheat and use the I think i'd still love to know more about if y'all plan on abstracting the logic out from the standard plugins into libraries fronted by commands ? maybe? |
Beta Was this translation helpful? Give feedback.
-
The general design of the core sf CLI plugins is that they are wrappers around library APIs. In the case of plugin-deploy-retrieve it uses the SDR (source deploy retrieve) library and STL (source tracking library). If you need source tracking in your plugin take a look at STL. If you just need deploy and retrieve behavior check out SDR. You can call commands that are loaded by the sf CLI in the way you mentioned above as well. If that suits your needs better you can do that too. Here are some docs you might find useful for developing plugins: https://github.com/salesforcecli/cli/wiki |
Beta Was this translation helpful? Give feedback.
-
Greetings,
I'm working on an SF extension and would like to utilize some official functionality. Specifically, at one point in my plugin, i want to deploy some metadata.
I realize i could shell out, and execute the cli but this seems ... a bit like going around one's elbow to scratch one's nose.
I've therefore attempted to import into my command's .ts file the following:
I'm ... early on the learning curve with Typescript, but my LWC experience, googling around, talking to my expert guesser (gpt) and some lovely folk on the sf discord server have led me to believe that these imports should be correct.
However, Intellij shows me
TS2307: Cannot find module...
errors.So... Can we get some documentation or guidance on how to properly import commands / logic from official plugins into our extensions? I realize this is likely me making a stupid mistake, but i'm hoping it's a low-effort-response situation.
In this specific situation, i'm trying to import the DeployMetadata class exported here: https://github.com/salesforcecli/plugin-deploy-retrieve/blob/b13572f450cd4fd63f6a31ac543ebf532d692abf/src/commands/project/deploy/start.ts#L36 and the response type for that command exported here: https://github.com/salesforcecli/plugin-deploy-retrieve/blob/b13572f450cd4fd63f6a31ac543ebf532d692abf/src/utils/types.ts#L76
Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions