Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block extra dev dependencies for now #13731

Merged
merged 2 commits into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions make-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ var buildNodeTask = function (taskPath, outDir) {
// verify no dev dependencies
// we allow a TS dev-dependency to indicate a task should use a different TS version
var packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
var devDeps = packageJson.devDependencies ? Object.keys(packageJson.devDependencies).length != 0 : 0;
var devDeps = packageJson.devDependencies ? Object.keys(packageJson.devDependencies).length : 0;
if (devDeps == 1 && packageJson.devDependencies["typescript"]) {
var version = packageJson.devDependencies["typescript"];
if (!allowedTypescriptVersions.includes(version)) {
Expand All @@ -170,7 +170,7 @@ var buildNodeTask = function (taskPath, outDir) {
overrideTscPath = path.join(taskPath, "node_modules", "typescript");
console.log(`Detected Typescript version: ${version}`);
} else if (devDeps >= 1) {
fail('The package.json should not contain dev dependencies. Move the dev dependencies into a package.json file under the Tests sub-folder. Offending package.json: ' + packageJsonPath);
fail('The package.json should not contain dev dependencies other than typescript. Move the dev dependencies into a package.json file under the Tests sub-folder. Offending package.json: ' + packageJsonPath);
}

run('npm install');
Expand Down