@pulumi/pulumi
Advanced tools
Comparing version 0.11.0-dev-99-g4b850dcb to 0.11.0-rc1
@@ -43,2 +43,1 @@ "use strict"; | ||
exports.RemoteArchive = RemoteArchive; | ||
//# sourceMappingURL=archive.js.map |
@@ -52,2 +52,1 @@ "use strict"; | ||
exports.RemoteAsset = RemoteAsset; | ||
//# sourceMappingURL=asset.js.map |
@@ -9,2 +9,1 @@ "use strict"; | ||
__export(require("./asset")); | ||
//# sourceMappingURL=index.js.map |
@@ -214,2 +214,1 @@ "use strict"; | ||
main(process.argv.slice(2)); | ||
//# sourceMappingURL=index.js.map |
@@ -135,7 +135,4 @@ "use strict"; | ||
}); | ||
// If any config variables are present, parse and set them, so the subsequent accesses are fast. | ||
const envObject = runtime.getConfigEnv(); | ||
for (const key of Object.keys(envObject)) { | ||
runtime.setConfig(key, envObject[key]); | ||
} | ||
// Load configuration passed from the language plugin | ||
runtime.loadConfig(); | ||
// If there is a --project=p, and/or a --stack=s, use them in the options. | ||
@@ -246,2 +243,1 @@ const project = argv["project"]; | ||
main(process.argv.slice(2)); | ||
//# sourceMappingURL=index.js.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
const errors_1 = require("./errors"); | ||
const log = require("./log"); | ||
const runtime = require("./runtime"); | ||
@@ -16,2 +17,11 @@ /** | ||
constructor(name) { | ||
// To ease migration of code that already does new Config("<package>:config"), treat this as if | ||
// just new Config("<package>") was called. | ||
if (name.endsWith(":config")) { | ||
const newName = name.replace(/:config$/, ""); | ||
log.warn("`:config` is no longer required at the end of configuration " + | ||
"bag names and support will be removed in a future version, please " + | ||
"use new Config(\"%s\") instead.", newName); | ||
name = newName; | ||
} | ||
this.name = name; | ||
@@ -160,2 +170,1 @@ } | ||
} | ||
//# sourceMappingURL=config.js.map |
"use strict"; | ||
// Copyright 2016-2017, Pulumi Corporation. All rights reserved. | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -15,5 +7,3 @@ const resource = require("../resource"); | ||
function serializeProvider(provider) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return runtime.serializeJavaScriptText(yield runtime.serializeClosure(() => provider)); | ||
}); | ||
return runtime.serializeFunctionAsync(() => provider); | ||
} | ||
@@ -43,2 +33,1 @@ /** | ||
exports.Resource = Resource; | ||
//# sourceMappingURL=index.js.map |
@@ -14,2 +14,1 @@ "use strict"; | ||
exports.RunError = RunError; | ||
//# sourceMappingURL=errors.js.map |
import "source-map-support/register"; | ||
export * from "./config"; | ||
export * from "./errors"; | ||
export * from "./metadata"; | ||
@@ -4,0 +5,0 @@ export * from "./resource"; |
@@ -11,2 +11,3 @@ "use strict"; | ||
__export(require("./config")); | ||
__export(require("./errors")); | ||
__export(require("./metadata")); | ||
@@ -23,2 +24,1 @@ __export(require("./resource")); | ||
exports.runtime = runtime; | ||
//# sourceMappingURL=index.js.map |
@@ -91,2 +91,1 @@ "use strict"; | ||
exports.log = log; | ||
//# sourceMappingURL=index.js.map |
@@ -20,2 +20,1 @@ "use strict"; | ||
exports.getStack = getStack; | ||
//# sourceMappingURL=metadata.js.map |
{ | ||
"name": "@pulumi/pulumi", | ||
"version": "0.11.0-dev-99-g4b850dcb", | ||
"version": "0.11.0-rc1", | ||
"description": "Pulumi's Node.js SDK", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/pulumi/pulumi/sdk/nodejs", |
@@ -50,2 +50,3 @@ "use strict"; | ||
exports.Resource = Resource; | ||
Resource.doNotCapture = true; | ||
/** | ||
@@ -76,2 +77,3 @@ * CustomResource is a resource whose create, read, update, and delete (CRUD) operations are managed | ||
exports.CustomResource = CustomResource; | ||
CustomResource.doNotCapture = true; | ||
/** | ||
@@ -108,2 +110,4 @@ * ComponentResource is a resource that aggregates one or more other child resources into a higher | ||
exports.ComponentResource = ComponentResource; | ||
ComponentResource.doNotCapture = true; | ||
ComponentResource.prototype.registerOutputs.doNotCapture = true; | ||
/** | ||
@@ -177,2 +181,1 @@ * Output helps encode the relationship between Resources in a Pulumi application. Specifically | ||
exports.all = all; | ||
//# sourceMappingURL=resource.js.map |
@@ -1,62 +0,1 @@ | ||
/** | ||
* Closure represents the serialized form of a JavaScript serverless function. | ||
*/ | ||
export interface Closure { | ||
code: string; | ||
runtime: string; | ||
environment: Environment; | ||
} | ||
/** | ||
* Environment is the captured lexical environment for a closure. | ||
*/ | ||
export declare type Environment = { | ||
[key: string]: EnvironmentEntry; | ||
}; | ||
/** | ||
* EnvironmentEntry is the environment slot for a named lexically captured variable. | ||
*/ | ||
export interface EnvironmentEntry { | ||
json?: any; | ||
closure?: Closure; | ||
obj?: Environment; | ||
arr?: EnvironmentEntry[]; | ||
module?: string; | ||
dep?: EnvironmentEntry; | ||
} | ||
/** | ||
* serializeClosure serializes a function and its closure environment into a form that is amenable to persistence | ||
* as simple JSON. Like toString, it includes the full text of the function's source code, suitable for execution. | ||
* Unlike toString, it actually includes information about the captured environment. | ||
*/ | ||
export declare function serializeClosure(func: Function): Promise<Closure>; | ||
/** | ||
* AsyncClosure represents the eventual serialized form of a JavaScript serverless function. | ||
*/ | ||
export interface AsyncClosure { | ||
code: string; | ||
runtime: string; | ||
environment: AsyncEnvironment; | ||
} | ||
/** | ||
* AsyncEnvironment is the eventual captured lexical environment for a closure. | ||
*/ | ||
export declare type AsyncEnvironment = Record<string, Promise<AsyncEnvironmentEntry>>; | ||
/** | ||
* AsyncEnvironmentEntry is the eventual environment slot for a named lexically captured variable. | ||
*/ | ||
export interface AsyncEnvironmentEntry { | ||
json?: any; | ||
closure?: AsyncClosure; | ||
obj?: AsyncEnvironment; | ||
arr?: AsyncEnvironmentEntry[]; | ||
module?: string; | ||
dep?: AsyncEnvironmentEntry; | ||
} | ||
/** | ||
* serializeJavaScriptText converts a Closure object into a string representation of a Node.js module body which | ||
* exposes a single function `exports.handler` representing the serialized function. | ||
* | ||
* @param c The Closure to be serialized into a module string. | ||
*/ | ||
export declare function serializeJavaScriptText(c: Closure): string; | ||
export declare function getClosureHash_forTestingPurposes(closure: Closure): string; | ||
export declare function serializeFunctionAsync(func: Function, serialize?: (o: any) => boolean): Promise<string>; |
/** | ||
* configEnvKey is the environment variable key for configuration that we will check in the event that a | ||
* configuration variable is missing. Explicit overrides take precedence. | ||
*/ | ||
export declare const configEnvKey = "PULUMI_CONFIG"; | ||
/** | ||
* setConfig sets a configuration variable. | ||
@@ -15,11 +10,4 @@ */ | ||
/** | ||
* getConfigEnvKey returns a scrubbed environment variable key, PULUMI_CONFIG_<k>, that can be used for | ||
* setting explicit varaibles. This is unlike PULUMI_CONFIG which is just a JSON-serialized bag. | ||
* loadConfig populates the runtime.config object based on configuration set in the environment. | ||
*/ | ||
export declare function getConfigEnvKey(key: string): string; | ||
/** | ||
* getConfigEnv returns the environment map that will be used for config checking when variables aren't set. | ||
*/ | ||
export declare function getConfigEnv(): { | ||
[key: string]: string; | ||
}; | ||
export declare function loadConfig(): void; |
@@ -5,6 +5,5 @@ "use strict"; | ||
/** | ||
* configEnvKey is the environment variable key for configuration that we will check in the event that a | ||
* configuration variable is missing. Explicit overrides take precedence. | ||
* configEnvKey is the environment variable key that the language plugin uses to set configuration values. | ||
*/ | ||
exports.configEnvKey = "PULUMI_CONFIG"; | ||
const configEnvKey = "PULUMI_CONFIG"; | ||
const config = {}; | ||
@@ -15,3 +14,3 @@ /** | ||
function setConfig(k, v) { | ||
config[k] = v; | ||
config[cleanKey(k)] = v; | ||
} | ||
@@ -27,12 +26,2 @@ exports.setConfig = setConfig; | ||
} | ||
// If there is a specific PULUMI_CONFIG_<k> variable, use it. | ||
const envKey = getConfigEnvKey(k); | ||
if (process.env.hasOwnProperty(envKey)) { | ||
return process.env[envKey]; | ||
} | ||
// If the config hasn't been set, but there is a process-wide PULUMI_CONFIG envvar, use it. | ||
const envObject = getConfigEnv(); | ||
if (envObject.hasOwnProperty(k)) { | ||
return envObject[k]; | ||
} | ||
return undefined; | ||
@@ -42,32 +31,27 @@ } | ||
/** | ||
* getConfigEnvKey returns a scrubbed environment variable key, PULUMI_CONFIG_<k>, that can be used for | ||
* setting explicit varaibles. This is unlike PULUMI_CONFIG which is just a JSON-serialized bag. | ||
* loadConfig populates the runtime.config object based on configuration set in the environment. | ||
*/ | ||
function getConfigEnvKey(key) { | ||
let envkey = ""; | ||
for (const c of key) { | ||
if (c === "_" || (c >= "A" && c <= "Z") || (c >= "0" && c <= "9")) { | ||
envkey += c; | ||
function loadConfig() { | ||
const envConfig = process.env.PULUMI_CONFIG; | ||
if (envConfig) { | ||
const envObject = JSON.parse(envConfig); | ||
for (const key of Object.keys(envObject)) { | ||
setConfig(key, envObject[key]); | ||
} | ||
else if (c >= "a" && c <= "z") { | ||
envkey += c.toUpperCase(); | ||
} | ||
else { | ||
envkey += "_"; | ||
} | ||
} | ||
return `${exports.configEnvKey}_${envkey}`; | ||
} | ||
exports.getConfigEnvKey = getConfigEnvKey; | ||
exports.loadConfig = loadConfig; | ||
/** | ||
* getConfigEnv returns the environment map that will be used for config checking when variables aren't set. | ||
* cleanKey takes a configuration key, and if it is of the form "<string>:config:<string>" removes the ":config:" | ||
* portion. Previously, our keys always had the string ":config:" in them, and we'd like to remove it. However, the | ||
* language host needs to continue to set it so we can be compatable with older versions of our packages. Once we | ||
* stop supporting older packages, we can change the language host to not add this :config: thing and remove this | ||
* function. | ||
*/ | ||
function getConfigEnv() { | ||
const envConfig = process.env.PULUMI_CONFIG; | ||
if (envConfig) { | ||
return JSON.parse(envConfig); | ||
function cleanKey(key) { | ||
const idx = key.indexOf(":"); | ||
if (idx > 0 && key.startsWith("config:", idx + 1)) { | ||
return key.substring(0, idx) + ":" + key.substring(idx + 1 + "config:".length); | ||
} | ||
return {}; | ||
return key; | ||
} | ||
exports.getConfigEnv = getConfigEnv; | ||
//# sourceMappingURL=config.js.map |
@@ -85,2 +85,1 @@ "use strict"; | ||
exports.errorString = errorString; | ||
//# sourceMappingURL=debuggable.js.map |
@@ -14,2 +14,1 @@ "use strict"; | ||
__export(require("./stack")); | ||
//# sourceMappingURL=index.js.map |
@@ -60,2 +60,1 @@ "use strict"; | ||
exports.invoke = invoke; | ||
//# sourceMappingURL=invoke.js.map |
@@ -202,2 +202,1 @@ "use strict"; | ||
} | ||
//# sourceMappingURL=resource.js.map |
@@ -286,2 +286,1 @@ "use strict"; | ||
} | ||
//# sourceMappingURL=rpc.js.map |
@@ -138,2 +138,1 @@ "use strict"; | ||
exports.setRootResource = setRootResource; | ||
//# sourceMappingURL=settings.js.map |
@@ -38,2 +38,1 @@ "use strict"; | ||
} | ||
//# sourceMappingURL=stack.js.map |
@@ -54,2 +54,1 @@ "use strict"; | ||
}); | ||
//# sourceMappingURL=config.spec.js.map |
@@ -6,2 +6,1 @@ "use strict"; | ||
require("../index"); | ||
//# sourceMappingURL=init.spec.js.map |
@@ -9,3 +9,3 @@ // Ensure that certain runtime settings are available. | ||
const config = new pulumi.Config("myBag:config"); | ||
const config = new pulumi.Config("myBag"); | ||
assert.equal(config.getNumber("A"), 42); | ||
@@ -17,1 +17,9 @@ assert.equal(config.requireNumber("A"), 42); | ||
// ensure the older format works as well | ||
const configOld = new pulumi.Config("myBag:config"); | ||
assert.equal(configOld.getNumber("A"), 42); | ||
assert.equal(configOld.requireNumber("A"), 42); | ||
assert.equal(configOld.get("bbbb"), "a string o' b's"); | ||
assert.equal(configOld.require("bbbb"), "a string o' b's"); | ||
assert.equal(configOld.get("missingC"), undefined); | ||
@@ -507,2 +507,1 @@ "use strict"; | ||
} | ||
//# sourceMappingURL=run.spec.js.map |
@@ -35,2 +35,1 @@ "use strict"; | ||
}); | ||
//# sourceMappingURL=props.spec.js.map |
export declare type MochaFunc = (err: Error) => void; | ||
export declare function asyncTest(test: () => Promise<void>): (func: MochaFunc) => void; | ||
export declare function assertAsyncThrows(test: () => Promise<void>): Promise<void>; | ||
export declare function assertAsyncThrows(test: () => Promise<void>): Promise<string>; |
@@ -36,3 +36,2 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let thrown = false; | ||
try { | ||
@@ -42,8 +41,8 @@ yield test(); | ||
catch (err) { | ||
thrown = true; | ||
return err.message; | ||
} | ||
assert(thrown, "Function was expected to throw, but didn't"); | ||
assert(false, "Function was expected to throw, but didn't"); | ||
return ""; | ||
}); | ||
} | ||
exports.assertAsyncThrows = assertAsyncThrows; | ||
//# sourceMappingURL=util.js.map |
"use strict"; | ||
// Copyright 2016-2017, Pulumi Corporation. All rights reserved. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = "0.11.0-dev-99-g4b850dcb"; | ||
//# sourceMappingURL=version.js.map | ||
exports.version = "0.11.0-rc1"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14289
550016
94