@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 +12 -3
- package/package.json +1 -1
- package/version.js +1 -1
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
|
|
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 = (
|
|
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
package/version.js
CHANGED