Commit Graph

11 Commits

Author SHA1 Message Date
Abhinav Gupta fc081e08e3
pkg/codegen/nodejs: Prefer contract.Assertf over Assert
Incremental step towards 

Migrates uses of contract.{Assert, AssertNoError, Require}
to `*f` variants so that we're required to provide more error context.

Refs 
2023-03-01 13:22:32 -08:00
Anton Tayanovskyy 9597386a89
[codegen/node] Implement support for lazy-loaded Node modules ()
* First experiment: export a type directly, but still use require.

* WIP: Add lazy-loading to utils, build export list.

* Untested: add submodule export generation with lazy-loading

* WIP: Syntactically valid submodule export

* Add tests, finish submodExportList generation

* Clean up comments

* Fix compilation error

* WIP

* Lazy-load class modules and re-export them

* Revert original approach

* Handle the class-with-method case eagerly

* Accept codegen

* Fix typo in method namespace condition

* Fix lazyLoadProperty to call require() in source context

* Support lazy-loading function modules

* Revert useles diff, PR feedback

* Remove extra ws diff

* Remove unused

* Accept codegen output

* Function-only files still need utilites import

* Optimize for not loading enums all the time

* Improve further

* Accept codegen

* Implement flags to control lazy-loading

* Accept codegen tests

* Illustrate on azure-native-nested-types

* Test lazy-loaded functions on output-funcs

* Start factoring out

* More cases

* More unit tests

* Reduce flag surface

* Separate fileInfo structs into its own module

* Merge lazyloads

* Accept codegen changes

* CHANGELOG

* Lint

* Revert caching require()

* Accept codegen

Co-authored-by: Robbie McKinstry <robbiemckinstry@Robbies-MacBook-Pro.local>
Co-authored-by: Robbie McKinstry <robbiemckinstry@macbook-pro.mynetworksettings.com>
2022-09-01 18:42:44 -04:00
Fraser Waters 7a257335f4
Escape deprecation messages before interpolating into source text ()
* Escape deprecation messages before interpolating into source text

Fixes https://github.com/pulumi/pulumi/issues/9342

* Add to CHANGELOG

* Move to utilities.go

* lint
2022-04-08 16:40:11 +01:00
Ian Wahbe 272c4643b2
Update error handling ()
This is the result of a change applied via `go-rewrap-errors`.
2021-11-12 18:37:17 -08:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Komal 9b33dd84d5
[codegen/*] - Fix enum names that start with an underscore. () 2020-12-16 09:22:44 -08:00
Komal 8fb8ea80c0
[codegen/*] - Extract common enum name replacer ()
* Extract common enum char replacer

* PR feedback
2020-11-11 10:42:08 -08:00
Komal a259d59624
[codegen/dotnet,nodejs] - Improve makeSafeEnumName ()
* Improve makeSafeEnumName

* Improve nodejs enumName generator

* Fix comment

* PR feedback
2020-11-09 11:33:22 -08:00
Mikhail Shilkov f66100ce28
Initial support for C# program gen ()
Initial support for C# program gen
2020-05-19 10:18:38 +02:00
Pat Gavlin 1f19cbbe08
Clean up the language-specific schema APIs. ()
Rather than forcing consumers to deal with language-specific data
ad-hoc, add an API that allows all language-specific data to be decoded
up-front.
2020-04-20 16:36:05 -07:00
Pat Gavlin 4ae2867a15
Add a code generator for NodeJS programs. ()
This code generator processes a bound Pulumi program represented using
an HCL2-based IR and converts it to an equivalent NodeJS program.
2020-04-02 23:27:05 -07:00