Open rawkode opened 3 years ago
Could you please clarify what you're trying to do? crd2pulumi
generates a package on your behalf, which will have its own package.json
and this is what utilities.{ts,js}
refers to. You should have your own package.json
for your application.
I already have code in my directory / repo, and I want to generate the types into a directory of an existing project.
Looking at this further, it's awkward since the package.json
generated by crd2pulumi
doesn't actually have the right version information in it, so it's not really "ready" to be used out of the box via npm install ./<dir>
yet at the same time, it's not really fulfilling your need of just having it in existing code. A bunch of this code generation is related to the underlying code generators for resource providers, so I think the right answer here is something along the lines of:
crd2pulumi
so that package.json
is actually meaningful.@leezen I'm also in this group:
- Provide an option to simply provide the code w/o trying to generate it like a package module.
I want to integrate the generated files into an npm package containing our Pulumi abstractions so far.
Generating a new npm package for each CRD one wants to generate code for, forces us into setting up a build pipeline & release process for each of these npm projects.
I think this is important for some of the multi-language components we might want to build. It'll be super useful to be able to build this into the component libraries themself.
same here. we are trying to integrate this into an existing package. it would be great if there's an option to disable generating an entire package or reading from package.json.
I'm using the following command to generate Pulumi types for Cluster API components.
./crd2pulumi --nodejsName capp --nodejsPath ./src/capp ./capp-components.yaml --force
This creates a
utilities.{ts,js}
that has code for loading the Node version frompackage.json
.This code fails if the code is generated into a subdirectory of the node project.
It would be cool if we could provide another flag to provide a subpath to store the generated code