Commit Graph

13 Commits

Author SHA1 Message Date
Thomas Gummerer 31071976e5
improve error message when gRPC fails ()
Currently when there are errors we just say "one or more errors
occurred", without anymore explanation. Actually print the error which
will help when debugging issues here.

This would have helped debug
https://github.com/pulumi/pulumi/issues/15239.
2024-03-13 09:07:54 +00:00
Fraser Waters eb4bec4dce
Update node sdk to use typescript definitions for grpc and protobufs. ()
Updates the node SDK to have types for the generated protobufs and grpc
services. No more `any`.

I don't think these types show up on any user facing parts of the SDK.
The two places they could show up are the mock monitor (but I've left
that as any for now) and the provider interfaces (which I've also left
alone for now).

But this fixes up most of our sdk internal code to have types, which
flagged a couple of oddities like assuming `Input<string>` was `string`
in the alias code, and a whole load of missing undefined checks.
2023-12-04 15:22:44 +00:00
Justin Van Patten b22087715f
[auto/nodejs] Remove SxS check that's no longer needed ()
This change removes the SxS check in the Node.js Automation API since
it's blocking a customer scenario and isn't needed anymore now that
 has been addressed with .

The check was originally added in  to provide a helpful error
message when multiple versions of `@pulumi/pulumi` were used with inline
programs, which could cause clashes with global state. Since then, we've
changed how state is stored to allow parallel execution of multiple
inline programs with . However, the SxS checks were not removed as
part of that change.

A customer recently hit the error associated with the SxS check. They
are creating a Next.js program that runs Pulumi operations as inline
programs. Next.js ends up loading modules multiple times in a way that
confuses the SxS checker, causing the error to be thrown, even though it
wouldn't have been a problem.

Fixes 
2023-10-11 18:09:58 +00:00
Robbie McKinstry d6fd384e63
Eliminate unnecessary double negations.
This commit removes instances of prefix-!! where the value
would already be coerced into a boolean. It also removes
instances where the "optional chaining" operator (?.)
would suffice.
2023-05-09 18:35:59 -04:00
Robbie McKinstry e05a3bd81c
Apply autoformat
This commit applies the Rome autoformatter to the Node SDK.
These changes are automatically produced. To reproduce these
changes, run `make format` from inside sdk/nodejs.
2023-04-28 18:27:10 -04:00
Fraser Waters 0251f7331e Test and fix for nodejs automation api 2023-01-23 08:26:58 +00:00
Kyle Pitzen 5cfad4a909 fix: Allows for parallel pulumi programs to run in the node runtime 2022-10-13 07:15:25 -04:00
Fraser Waters 615ae91477
Add getOrganization to nodejs and python ()
* Add getOrganization to nodejs and python

* Add to CHANGELOG

* lint

* lint

* format

* Fix python test

* Fix nodejs settings

* Add contextproperty

* Backcompat python kwargs
2022-08-31 10:33:29 +01:00
Anton Tayanovskyy f6fc099792
Avoid importing typescript unless necessary ()
* Avoid importing typescript in node SDK where possible

* Lazy-load runtime/closure in dynamic/index.ts

* More targeted runtime import in config.ts

* More precise imports in run-policy-pack/run.ts

* More precise imports for dynamic-provider/index.ts

* More precise imports for automation/server.ts

* Share typescript compiler option loading func in run.ts and run-policy-pack/run.ts

* Lazy-load ts-node that depends on TypeScript

* Break module import cycle

* Fix node lint
2022-07-20 17:38:55 -04:00
Horace Lee a92a005d68
Use ESlint instead of TSlint ()
Migrated TSlint configs to ESlint ones using [tslint-to-eslint-config](https://github.com/typescript-eslint/tslint-to-eslint-config) tool, and refined the configs to better match the current coding style.

Changes:
- [member-delimiter-style](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md#options) that as suggested default for type definition to be  with `semicolon`
- Indentation fixes that is enforced by [eslint-indent](https://eslint.org/docs/rules/indent#options)
- Added dependencies for ESlint with Typescript
- Removed TSlint
2021-08-10 11:31:59 -07:00
Evan Boyle a850648504
detect nodejs side by side pulumi for inline automation programs and fail fast () 2021-06-23 07:57:36 -07:00
Justin Van Patten a61e79eb0d
[sdk/nodejs] Warn when a secret config is read as a non-secret () 2021-05-18 09:48:08 -07:00
Paul Stack 3fad2e5329 Removing x namespace from go/python/nodejs automation packages () 2021-04-14 19:32:18 +01:00