Skip to content

Commit bea033e

Browse files
bobbrowpieandcakes
authored andcommitted
TypeScript compile needs to happen as part of prepublish step. (#1629)
1 parent b05e8c5 commit bea033e

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

Extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@
11051105
}
11061106
},
11071107
"scripts": {
1108-
"compile": "npm run vscode:prepublish && tsc -p ./",
1108+
"compile": "npm run vscode:prepublish",
11091109
"integrationTests": "gulp integrationTests",
11101110
"postinstall": "node ./node_modules/vscode/bin/install",
11111111
"pretest": "tsc -p ./",

Extension/src/Support/copyDebuggerDependencies.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ function makeDirectory(dir: string): void {
200200
}
201201
}
202202

203-
let devWorkFlowMessage: string = '\nWARNING: If you are trying to build and run the extension locally, please set the environment variable CPPTOOLS_DEV=1 and try again.\n';
204-
205203
if (enableDevWorkflow()) {
206204
removeFolder("./debugAdapters");
207205
}
@@ -213,5 +211,6 @@ if (enableDevWorkflow()) {
213211
copyMonoDependencies();
214212
copyBinaryDependencies();
215213
} else {
216-
console.warn(devWorkFlowMessage);
214+
console.warn('WARNING: Debugger dependencies are missing.');
215+
console.log('If you are trying to build and run the extension from source and need the debugger dependencies, set the environment variable CPPTOOLS_DEV=1 and try again.');
217216
}

Extension/src/Support/prepublish.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@
1212
const fs = require("fs");
1313
const cp = require("child_process");
1414
const path = require("path");
15+
1516
if (!process.env.CPPTOOLS_DEV && fs.existsSync('./node_modules')) {
16-
console.log("Skipping npm install since it appears to have been executed already.");
17+
console.warn("WARNING: Skipping npm install since it appears to have been executed already.");
1718
} else {
1819
console.log(">> npm install");
1920
cp.execSync("npm install", { stdio: [0, 1, 2] });
2021
}
2122

23+
// Compile the TypeScript code
24+
console.log(">> tsc -p ./");
25+
cp.execSync("tsc -p ./", {stdio:[0, 1, 2]});
26+
2227
// If the required debugger file doesn't exist, make sure it is copied.
23-
if (process.env.CPPTOOLS_DEV || !fs.existsSync('./debugAdapters/bin/cpptools.ad7Engine.json')) {
24-
const outDir = './out/src/Support/'
25-
const copyDebuggerDependenciesJSFile = path.join(outDir, 'copyDebuggerDependencies.js');
26-
if (!fs.existsSync('./out/src/Support/copyDebuggerDependencies.js'))
27-
{
28-
console.log(">> tsc ./src/Support/copyDebuggerDependencies.ts -- outDir" + outDir);
29-
cp.execSync("tsc ./src/Support/copyDebuggerDependencies.ts --outDir " + outDir, { stdio: [0, 1, 2] });
30-
}
28+
if (process.env.CPPTOOLS_DEV || !fs.existsSync('./debugAdapters/bin/cppdbg.ad7Engine.json')) {
29+
const copyDebuggerDependenciesJSFile = './out/src/Support/copyDebuggerDependencies.js';
3130

3231
// Required for nightly builds. Nightly builds do not enable CPPTOOLS_DEV.
3332
console.log(">> node " + copyDebuggerDependenciesJSFile);

0 commit comments

Comments
 (0)