https://pulumi.com logo
#golang
Title
# golang
l

limited-rainbow-51650

02/14/2022, 9:07 AM
I want to create a custom component provider, starting from the Go template here https://github.com/pulumi/pulumi-component-provider-go-boilerplate I cloned this repo and ran
make install_nodejs_sdk
on my Mac, but even without a single change, this build command fails:
Copy code
$ make install_nodejs_sdk
rm -rf sdk/nodejs
cd provider/cmd/pulumi-gen-xyz && go run . nodejs ../../../sdk/nodejs /Users/r.de.smet/Projects/pulumi-component-provider-go-boilerplate/schema.yaml
cd sdk/nodejs/ && \
                yarn install && \
                yarn run tsc --version && \
                yarn run tsc && \
                cp ../../README.md ../../LICENSE package.json yarn.lock ./bin/ && \
                sed -i.bak -e "s/\${VERSION}/0.0.1/g" ./bin/package.json && \
                rm ./bin/package.json.bak
yarn install v1.22.17
warning package.json: No license field
info No lockfile found.
warning @pulumi/xyz@${VERSION}: No license field
[1/4] šŸ”  Resolving packages...
warning @pulumi/aws > read-package-tree@5.3.1: The functionality that this package provided is now in @npmcli/arborist
warning @pulumi/aws > @pulumi/pulumi > read-package-tree@5.3.1: The functionality that this package provided is now in @npmcli/arborist
warning @pulumi/aws > aws-sdk > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @pulumi/aws > aws-sdk > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @pulumi/aws > aws-sdk > uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See <https://v8.dev/blog/math-random> for details.
[2/4] šŸšš  Fetching packages...
[3/4] šŸ”—  Linking dependencies...
[4/4] šŸ”Ø  Building fresh packages...
success Saved lockfile.
āœØ  Done in 28.81s.
yarn run v1.22.17
warning package.json: No license field
$ /Users/r.de.smet/Projects/pulumi-component-provider-go-boilerplate/sdk/nodejs/node_modules/.bin/tsc --version
Version 3.9.10
āœØ  Done in 0.35s.
yarn run v1.22.17
warning package.json: No license field
$ /Users/r.de.smet/Projects/pulumi-component-provider-go-boilerplate/sdk/nodejs/node_modules/.bin/tsc
āœØ  Done in 12.38s.
yarn unlink xyz
yarn unlink v1.22.17
error No registered package found called "xyz".
info Visit <https://yarnpkg.com/en/docs/cli/unlink> for documentation about this command.
make: *** [install_nodejs_sdk] Error 1
$
What am I missing here? Also, if I want to change the setup to have my own package name, generated in my own namespace (npm), what files should I update manually and which ones are generated? Not much documented about all of this.
q

quiet-wolf-18467

02/14/2022, 9:21 AM
Looks like a bug in the Makefile. I'll submit some fixes today
q

quiet-wolf-18467

02/14/2022, 9:22 AM
It should be
yarn unlink @pulumi/${PACK}
l

limited-rainbow-51650

02/14/2022, 9:23 AM
Hmm... could you update the template and make the organization changeable as well? My custom components will never be under
<http://github.com/pulumi|github.com/pulumi>
nor the
@pulumi
npm namespace.
q

quiet-wolf-18467

02/14/2022, 9:24 AM
Yeah. It SHOULD but this needs fixed in the upstream codegen
šŸ‘ŒšŸ¼ 1
I fix it with
sed
in the Pulumiverse repos
It's a subpar experience though. I'll get this all fixed
l

limited-rainbow-51650

02/14/2022, 9:25 AM
after codegen that is?
q

quiet-wolf-18467

02/14/2022, 9:25 AM
Yeah
l

limited-rainbow-51650

02/14/2022, 9:29 AM
BTW, even after changing the line to
yarn unlink @pulumi/{PACK}
, this line fails the build. I suppose this line needs to be removed completely.
q

quiet-wolf-18467

02/14/2022, 9:30 AM
I'll clone the repo and run a build. It should be there, but maybe something else is wrong too
Remove it for now
šŸ‘šŸ¼ 1
6 Views