@pulumi/pulumi 3.18.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cmd/run/run.js CHANGED
@@ -126,7 +126,7 @@ function throwOrPrintModuleLoadError(program, error) {
126
126
  }
127
127
  /** @internal */
128
128
  function run(argv, programStarted, reportLoggedError, isErrorReported) {
129
- var _a;
129
+ var _a, _b;
130
130
  // If there is a --pwd directive, switch directories.
131
131
  const pwd = argv["pwd"];
132
132
  if (pwd) {
@@ -139,13 +139,14 @@ function run(argv, programStarted, reportLoggedError, isErrorReported) {
139
139
  // find a tsconfig.json. For us, it's reasonable to say that the "root" of the project is the cwd,
140
140
  // if there's a tsconfig.json file here. Otherwise, just tell ts-node to not load project options at all.
141
141
  // This helps with cases like pulumi/pulumi#1772.
142
- const tsConfigPath = "tsconfig.json";
142
+ const defaultTsConfigPath = "tsconfig.json";
143
+ const tsConfigPath = (_a = process.env["PULUMI_NODEJS_TSCONFIG_PATH"], (_a !== null && _a !== void 0 ? _a : defaultTsConfigPath));
143
144
  const skipProject = !fs.existsSync(tsConfigPath);
144
145
  let compilerOptions;
145
146
  try {
146
147
  const tsConfigString = fs.readFileSync(tsConfigPath).toString();
147
148
  const tsConfig = typescript_1.parseConfigFileTextToJson(tsConfigPath, tsConfigString).config;
148
- compilerOptions = (_a = tsConfig["compilerOptions"], (_a !== null && _a !== void 0 ? _a : {}));
149
+ compilerOptions = (_b = tsConfig["compilerOptions"], (_b !== null && _b !== void 0 ? _b : {}));
149
150
  }
150
151
  catch (e) {
151
152
  compilerOptions = {};
@@ -202,6 +203,14 @@ ${defaultMessage}`);
202
203
  process.on("unhandledRejection", uncaughtHandler);
203
204
  process.on("exit", runtime.disconnectSync);
204
205
  programStarted();
206
+ // This needs to occur after `programStarted` to ensure execution of the parent process stops.
207
+ if (skipProject && tsConfigPath !== defaultTsConfigPath) {
208
+ return new Promise(() => {
209
+ const e = new Error(`tsconfig path was set to ${tsConfigPath} but the file was not found`);
210
+ e.stack = undefined;
211
+ throw e;
212
+ });
213
+ }
205
214
  const runProgram = () => __awaiter(this, void 0, void 0, function* () {
206
215
  // We run the program inside this context so that it adopts all resources.
207
216
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/pulumi",
3
- "version": "3.18.0",
3
+ "version": "3.18.1",
4
4
  "description": "Pulumi's Node.js SDK",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/version.js CHANGED
@@ -13,4 +13,4 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.version = "3.18.0";
16
+ exports.version = "3.18.1";