I want to program my own package in Typescript. Is...
# typescript
g
I want to program my own package in Typescript. Is this possible at all and if so are there any examples? So far I have come across https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers, is that what I am looking for? All existing packages in the registry seem to have been implemented directly in go or with the tf bridge.
l
Hey @gorgeous-painting-25877, if you want to create an NPM package with your abstractions, dynamic providers is not what you need to look at. Have a look at component resources: https://www.pulumi.com/docs/intro/concepts/resources/components/ These are regular JS/TS classes. After you built your components, follow the regular NPM package creation and publishing documentation. Nothing more to it.
g
My goal is not to simplify or link existing elements, but to create new elements. I want to program a pulumi discord package with which you can define the discord as code
l
Ah, a Pulumi provider for Discord.
g
In terraform it would be a provider, here I was not sure if it is called provider as well
l
General terminology is a package, but we have three different kinds: • native provider package • terraform bridged provider package • component package You can read more on that here: https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-language-components/
g
So I can use existing providers in component packages but not create my own provider in e.g. typescript?
l
In your case, the fastest way is to take an existing Terraform Discord provider and bridge it to become a Pulumi provider package. There is not much manual work to that besides setting up a mapping from Terraform resource names to Pulumi resource names, complemented with a build setup.
At the moment, we do not have everything ready yet to have a pure Typescript Pulumi provider package. We only have this in Go for now.
g
Unfortunately, there is no sufficiently well supported discord terraform module. So I would have to teach myself Go to implement the whole thing. Is there a roadmap for provider in typescript?
l
Not that I know off.
g
Okay thanks for the help