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

Remove obsolete pdfjs-dist code from the Gulpfile #18434

Merged
merged 1 commit into from
Jul 13, 2024
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
22 changes: 3 additions & 19 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ const COMMON_WEB_FILES = [
];
const MOZCENTRAL_DIFF_FILE = "mozcentral.diff";

const DIST_REPO_URL = "https://github.com/mozilla/pdfjs-dist";

const CONFIG_FILE = "pdfjs.config";
const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString());

Expand Down Expand Up @@ -2173,8 +2171,9 @@ function packageJson() {
const DIST_NAME = "pdfjs-dist";
const DIST_DESCRIPTION = "Generic build of Mozilla's PDF.js library.";
const DIST_KEYWORDS = ["Mozilla", "pdf", "pdf.js"];
const DIST_HOMEPAGE = "http://mozilla.github.io/pdf.js/";
const DIST_HOMEPAGE = "https://mozilla.github.io/pdf.js/";
const DIST_BUGS_URL = "https://github.com/mozilla/pdf.js/issues";
const DIST_GIT_URL = "https://github.com/mozilla/pdf.js.git";
const DIST_LICENSE = "Apache-2.0";

const npmManifest = {
Expand All @@ -2200,7 +2199,7 @@ function packageJson() {
},
repository: {
type: "git",
url: `git+https://github.com/mozilla/pdf.js.git`,
url: `git+${DIST_GIT_URL}`,
},
engines: {
node: ">=18",
Expand All @@ -2227,23 +2226,8 @@ gulp.task(
"minified-legacy",
"types",
function createDist() {
console.log();
console.log("### Cloning baseline distribution");

fs.rmSync(DIST_DIR, { recursive: true, force: true });
fs.mkdirSync(DIST_DIR, { recursive: true });
safeSpawnSync("git", ["clone", "--depth", "1", DIST_REPO_URL, DIST_DIR]);

console.log();
console.log("### Overwriting all files");

// Remove all files/folders, except for `.git` because it needs to be a
// valid Git repository for the Git commands in the `dist` target to work.
for (const entry of fs.readdirSync(DIST_DIR)) {
if (entry !== ".git") {
fs.rmSync(DIST_DIR + entry, { recursive: true, force: true });
}
}

return ordered([
packageJson().pipe(gulp.dest(DIST_DIR)),
Expand Down