Skip to content

Commit 35d8aaa

Browse files
Revert "Update build scripts to use a strict TS config (#21164)" (#21180)
This reverts commit 8fb8034.
1 parent 8fb8034 commit 35d8aaa

File tree

5 files changed

+1094
-3192
lines changed

5 files changed

+1094
-3192
lines changed

make-util.js

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ var getCommonPackInfo = function (modOutDir) {
159159
}
160160
exports.getCommonPackInfo = getCommonPackInfo;
161161

162-
/**
163-
* Performs npm audit on the specified task path.
164-
* @param {string} taskPath - The path to the task directory where npm audit should be performed.
165-
*/
166162
function performNpmAudit(taskPath) {
167163
console.log('\n🛫 Running npm audit...');
168164

@@ -183,12 +179,12 @@ function performNpmAudit(taskPath) {
183179
shell: true
184180
});
185181

186-
if (auditResult.status) {
182+
if (auditResult.error) {
187183
console.log(`\x1b[A\x1b[K❌ npm audit failed because the build task at "${taskPath}" has vulnerable dependencies.`);
188184
console.log('👉 Please see details by running the command');
189185
console.log(`\tnpm audit --prefix ${taskPath}`);
190186
console.log('or execute the command with --BypassNpmAudit argument to skip the auditing');
191-
console.log(`\tnode make.js build --task ${args.task} --BypassNpmAudit`);
187+
console.log(`\tnode make.js --build --task ${args.task} --BypassNpmAudit`);
192188
process.exit(1);
193189
} else {
194190
console.log('\x1b[A\x1b[K✅ npm audit completed successfully.');
@@ -200,24 +196,11 @@ function performNpmAudit(taskPath) {
200196
}
201197
}
202198

203-
function getAdditionalTypeScriptArguments() {
204-
const tsArgs = [];
205-
206-
if (process.argv.includes("--include-sourcemap")) {
207-
tsArgs.push('--sourceMap');
208-
}
209-
210-
return tsArgs.join('');
211-
}
212-
213199
var buildNodeTask = function (taskPath, outDir, isServerBuild) {
214200
var originalDir = shell.pwd().toString();
215201
cd(taskPath);
216202
var packageJsonPath = rp('package.json');
217203
var overrideTscPath;
218-
219-
performNpmAudit(taskPath);
220-
221204
if (test('-f', packageJsonPath)) {
222205
// verify no dev dependencies
223206
// we allow only two dev dependencies: typescript and @tsconfig/node10
@@ -250,14 +233,16 @@ var buildNodeTask = function (taskPath, outDir, isServerBuild) {
250233
cd(taskPath);
251234
}
252235

236+
performNpmAudit(taskPath);
237+
253238
// Use the tsc version supplied by the task if it is available, otherwise use the global default.
254239
if (overrideTscPath) {
255240
var tscExec = path.join(overrideTscPath, "bin", "tsc");
256-
run(`node ${tscExec} --outDir "${outDir}" --rootDir "${taskPath}" ${getAdditionalTypeScriptArguments()}`);
241+
run("node " + tscExec + ' --outDir "' + outDir + '" --rootDir "' + taskPath + '"');
257242
// Don't include typescript in node_modules
258243
rm("-rf", overrideTscPath);
259244
} else {
260-
run(`tsc --outDir "${outDir}" --rootDir "${taskPath}" ${getAdditionalTypeScriptArguments()}`);
245+
run('tsc --outDir "' + outDir + '" --rootDir "' + taskPath + '"');
261246
}
262247

263248
cd(originalDir);

make.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ var rm = util.rm;
2121
var test = util.test;
2222
var run = util.run;
2323
var banner = util.banner;
24+
var rp = util.rp;
2425
var fail = util.fail;
2526
var ensureExists = util.ensureExists;
27+
var pathExists = util.pathExists;
2628
var buildNodeTask = util.buildNodeTask;
2729
var addPath = util.addPath;
2830
var copyTaskResources = util.copyTaskResources;

0 commit comments

Comments
 (0)