Skip to content

Commit

Permalink
VSTS-268 HotFix shelljs dependency at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
7PH committed May 27, 2024
1 parent 0c48f31 commit c8eaec7
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require("path");
const gulp = require("gulp");
const gulpFile = require("gulp-file");
const fs = require("fs-extra");
const yargs = require("yargs");
const gulpReplace = require("gulp-replace");
Expand Down Expand Up @@ -175,9 +176,18 @@ gulp.task("build:copy", () => {
const version = path.basename(path.dirname(task));
const commonPath = getTaskCommonFolder(taskName, version); // What common files to copy (latest vs legacy?)

// Where to copy the task code
// Where to copy the task files
const outPath = path.join(BUILD_EXTENSION_DIR, extension, "tasks", taskName, version);

/**
* Hotfix for shelljs dependency
* @see https://github.com/microsoft/azure-pipelines-task-lib/issues/942#issuecomment-1904939900
*/
const createShellJsDummyFile = gulpFile("index.js", "", { src: true }).pipe(
gulp.dest(path.join(outPath, "node_modules", "shelljs")),
);
streams.push(createShellJsDummyFile);

// Copy task icon
streams.push(
gulp
Expand Down
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"gulp-decompress": "2.0.2",
"gulp-download": "0.0.1",
"gulp-exec": "5.0.0",
"gulp-file": "^0.4.0",
"gulp-json-editor": "2.5.6",
"gulp-rename": "1.2.2",
"gulp-replace": "0.6.1",
Expand Down
4 changes: 4 additions & 0 deletions src/common/latest/esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ module.exports = {
format: "cjs",
target: "node10",
minify: true,
/**
* @see https://github.com/microsoft/azure-pipelines-task-lib/issues/942#issuecomment-1904939900
*/
external: ["shelljs"],
};
1 change: 1 addition & 0 deletions src/common/sonarqube-v4/esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ module.exports = {
format: "cjs",
target: "node8",
minify: true,
external: ["shelljs"],
};

0 comments on commit c8eaec7

Please sign in to comment.