Commit graph

28 commits

Author SHA1 Message Date
Horace Lee a92a005d68
Use ESlint instead of TSlint (#7719)
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
Luke Hoban adcf4ea28c
Fix typo (#7216) 2021-06-05 09:40:28 +10:00
Justin Van Patten d6b7762102
Temporarily disable config secrets warning (#7129)
Temporarily disable the new config secret warning to avoid unactionable warnings from provider `config` modules. We'll re-enable the warning when we've addressed that issue.
2021-05-24 16:06:27 -07:00
Justin Van Patten a61e79eb0d
[sdk/nodejs] Warn when a secret config is read as a non-secret (#6896) 2021-05-18 09:48:08 -07:00
Justin Van Patten 9abcca345a
Mark internal APIs @internal to filter from API docs (#3809)
Also:

 - Cleaned up existing tags so they're consistently at the bottom of doc comments where they should be
 - Cleaned up some unused imports while I was taking a pass over the files
 - Marked one function `@deprecated` that should be deprecated
2020-01-26 09:06:35 -08:00
CyrusNajmabadi 35bc41c5d3
Support sxs with old outputs with sync resources only. (#3680) 2019-12-17 19:04:09 -08:00
Justin Van Patten 4545b4a9de
Export NumberConfigOptions and StringConfigOptions (#3615) 2019-12-09 22:48:54 +00:00
Matt Ellis 75744f1d6c Add some convience methods to pulumi.Config for getting secrets 2019-05-10 17:07:52 -07:00
Aaron Friel c7eb608c63 Support string literal bounds and return types on Config#get and Config#require (#2570) 2019-03-20 11:52:44 -07:00
Luke Hoban 375b75be84
Fix requireObject docs (#1961)
Fixes #1958
2018-09-21 07:58:14 -07:00
joeduffy 6883d08796 Fix a comment mistake 2018-08-29 11:29:18 -07:00
joeduffy c2258be408 Adopt code review feedback for config constraints
This change adopts the code review suggestion to use a bag of options
for config constraints rather than having overloaded function names.
This is a much cleaner approach, lets us use more descriptive names,
and is far more future proof in case we decide to add more capabilities.
2018-08-28 18:07:26 -07:00
joeduffy 834987bcd3 Add more config helpers
Everytime I convert a CloudFormation template to Pulumi, I inevitably
run into the fact that CloudFormation has advanced "schema" capabilities
for input variables, like min/max for numbers and string lengths, enums,
and regex pattern matching. This is always cumbersome to convert.

In this change, I've added a number of config helpers for these cases:

For string enums:

    getEnum(key: string, values: string[]): string | undefined;
    requireEnum(key: string: values: string[]): string;

For min/max strlen:

    getMinMax(key: string, min: number, max: number): string | undefined;
    requireMinMax(key: string, min: number, max: number): string;

For regex patterns:

    getPattern(key: string, regexp: string | RegExp): string | undefined;
    requirePattern(key: string, regexp: string | RegExp): string;

For min/max strlen _and_ regex patterns:

    getMinMaxPattern(key: string, min: number, max: number,
        regexp: string | RegExp): string | undefined;
    requireMinMaxPattern(key: string, min: number, max: number,
        regexp: string | RegExp): string;

For min/max numbers:

    getNumberMinMax(key: string, min: number, max: number): number | undefined;
    requireNumberMinMax(key: string, min: number, max: number): number;

Each function throws a detailed RunError-derived exception type if the
configuration value doesn't meet the constraint.

This fixes pulumi/pulumi#1671.
2018-08-28 13:22:53 -07:00
Matt Ellis 153729683a Allow eliding name in pulumi.Config .ctor
When this argument is not provided, we'll default to the value of
pulumi.getProject(). This is what you want for application level code
anyway and it matches the CLI behavior where if you don't qualify a
key with a package we use the name of the current project.

Fixes #1581
2018-08-06 16:03:54 -07:00
CyrusNajmabadi d19942f2b0
Go back to capturing *non-user* modules by 'require' reference. (#1655) 2018-07-31 11:37:46 -04:00
joeduffy 5967259795 Add license headers 2018-05-22 15:02:47 -07:00
CyrusNajmabadi a759f2e085
Switch to a resource-progress oriented view for pulumi preview/update/destroy (#1116) 2018-04-10 12:03:11 -07:00
Pat Gavlin a23b10a9bf
Update the copyright end date to 2018. (#1068)
Just what it says on the tin.
2018-03-21 12:43:21 -07:00
Matt Ellis 1515889a40 Remove the need for the :config: part of a config bag
We now unify new Config("package") and new Config("package:config"),
printing a warning when the new Config("package:config") form is
used and pointing consumers towards just new Config("package")

I've updated our examples to use the newer syntax, but I've added a
test ot the langhost to ensure both forms work.

Fixes #923
2018-03-08 10:52:25 -08:00
Joe Duffy 444ebdd1b5
Improve failure messages (#932)
This improves the failure messages in two circumstances:

1) If the resource monitor RPC connection is missing.  This can happen
   two ways: either you run a Pulumi program using vanilla Node.js, instead
   of the CLI, or you've accidentally loaded the Pulumi SDK more than once.

2) Failure to load the custom Pulumi SDK Node.js extension.  This is a new
   addition and would happen if you tried running a Pulumi program using a
   vanilla Node.js, rather than using the Pulumi CLI.
2018-02-14 09:55:02 -08:00
joeduffy d840a86a0a Fix outdated config error message 2017-11-17 08:53:58 -08:00
Chris Smith d81b00f758
Update error message to reflect current CLI format (#482) 2017-10-27 13:44:32 -07:00
CyrusNajmabadi b713990b5e Enable 'use const' linter rule. (#405)
* Enable 'use const' linter rule.
2017-10-10 14:50:55 -07:00
Cyrus Najmabadi cd48ca2254 Include the actual key that we were unable to find on the error. 2017-10-05 13:55:20 -07:00
joeduffy 141a112950 Improve output formatting
This change improves our output formatting by generally adding
fewer prefixes.  As shown in pulumi/pulumi#359, we were being
excessively verbose in many places, including prefixing every
console.out with "langhost[nodejs].stdout: ", displaying full
stack traces for simple errors like missing configuration, etc.

Overall, this change includes the following:

* Don't prefix stdout and stderr output from the program, other
  than the standard "info:" prefix.  I experimented with various
  schemes here, but they all felt gratuitous.  Simply emitting
  the output seems fine, especially as it's closer to what would
  happen if you just ran the program under node.

* Do NOT make writes to stderr fail the plan/deploy.  Previously
  we assumed that any console.errors, for instance, meant that
  the overall program should fail.  This simply isn't how stderr
  is treated generally and meant you couldn't use certain
  logging techniques and libraries, among other things.

* Do make sure that stderr writes in the program end up going to
  stderr in the Pulumi CLI output, however, so that redirection
  works as it should.  This required a new Infoerr log level.

* Make a small fix to the planning logic so we don't attempt to
  print the summary if an error occurs.

* Finally, add a new error type, RunError, that when thrown and
  uncaught does not result in a full stack trace being printed.
  Anyone can use this, however, we currently use it for config
  errors so that we can terminate with a pretty error message,
  rather than the monstrosity shown in pulumi/pulumi#359.
2017-09-23 05:20:11 -07:00
Luke Hoban c5558e2778 Convert sdk documentation to TypeDoc/JsDoc 2017-09-21 18:15:29 -07:00
joeduffy f718ab6501 Add a runtime.Log class
This change adds the ability to perform runtime logging, including
debug logging, that wires up to the Pulumi Fabric engine in the usual
ways.  Most stdout/stderr will automatically go to the right place,
but this lets us add some debug tracing in the implementation of the
runtime itself (and should come in handy in other places, like perhaps
the Pulumi Framework and even low-level end-user code).
2017-09-04 11:35:21 -07:00
joeduffy d8635fd4f3 Move modules to package root
The organization of packages underneath lib/ breaks the easy consumption
of submodules, a la

    import {FileAsset} from "@pulumi/pulumi-fabric/asset";

We will go back to having everything hanging off the module root directory.
2017-09-04 11:35:21 -07:00
Renamed from sdk/nodejs/lib/config.ts (Browse further)