Skip to content

Commit

Permalink
Merge pull request #18145 from timvandermeij/merge-stream
Browse files Browse the repository at this point in the history
Remove the `merge-stream` dependency in favor of the `ordered-read-streams` dependency
  • Loading branch information
timvandermeij committed May 22, 2024
2 parents 821f3a1 + 723e5b2 commit b7b8e5e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
42 changes: 21 additions & 21 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import crypto from "crypto";
import { fileURLToPath } from "url";
import fs from "fs";
import gulp from "gulp";
import merge from "merge-stream";
import ordered from "ordered-read-streams";
import path from "path";
import postcss from "gulp-postcss";
import postcssDarkThemeClass from "postcss-dark-theme-class";
Expand Down Expand Up @@ -948,7 +948,7 @@ gulp.task("locale", function () {
}
const glob = locales.length === 1 ? locales[0] : `{${locales.join(",")}}`;

return merge([
return ordered([
createStringSource("locale.json", JSON.stringify(viewerOutput)).pipe(
gulp.dest(VIEWER_LOCALE_OUTPUT)
),
Expand Down Expand Up @@ -1023,7 +1023,7 @@ function preprocessHTML(source, defines) {
function buildGeneric(defines, dir) {
fs.rmSync(dir, { recursive: true, force: true });

return merge([
return ordered([
createMainBundle(defines).pipe(gulp.dest(dir + "build")),
createWorkerBundle(defines).pipe(gulp.dest(dir + "build")),
createSandboxBundle(defines).pipe(gulp.dest(dir + "build")),
Expand Down Expand Up @@ -1070,7 +1070,7 @@ gulp.task(
"locale",
function scriptingGeneric() {
const defines = { ...DEFINES, GENERIC: true };
return merge([
return ordered([
buildDefaultPreferences(defines, "generic/"),
createTemporaryScriptingBundle(defines),
]);
Expand All @@ -1097,7 +1097,7 @@ gulp.task(
"locale",
function scriptingGenericLegacy() {
const defines = { ...DEFINES, GENERIC: true, SKIP_BABEL: false };
return merge([
return ordered([
buildDefaultPreferences(defines, "generic-legacy/"),
createTemporaryScriptingBundle(defines),
]);
Expand Down Expand Up @@ -1127,7 +1127,7 @@ function buildComponents(defines, dir) {
"web/images/cursor-*.svg",
];

return merge([
return ordered([
createComponentsBundle(defines).pipe(gulp.dest(dir)),
gulp.src(COMPONENTS_IMAGES).pipe(gulp.dest(dir + "images")),
preprocessCSS("web/pdf_viewer.css", defines)
Expand Down Expand Up @@ -1204,7 +1204,7 @@ gulp.task(
function buildMinified(defines, dir) {
fs.rmSync(dir, { recursive: true, force: true });

return merge([
return ordered([
createMainBundle(defines).pipe(gulp.dest(dir + "build")),
createWorkerBundle(defines).pipe(gulp.dest(dir + "build")),
createSandboxBundle(defines).pipe(gulp.dest(dir + "build")),
Expand All @@ -1221,7 +1221,7 @@ gulp.task(
"locale",
function scriptingMinified() {
const defines = { ...DEFINES, MINIFIED: true, GENERIC: true };
return merge([
return ordered([
buildDefaultPreferences(defines, "minified/"),
createTemporaryScriptingBundle(defines),
]);
Expand Down Expand Up @@ -1251,7 +1251,7 @@ gulp.task(
GENERIC: true,
SKIP_BABEL: false,
};
return merge([
return ordered([
buildDefaultPreferences(defines, "minified-legacy/"),
createTemporaryScriptingBundle(defines),
]);
Expand Down Expand Up @@ -1335,7 +1335,7 @@ gulp.task(
// Clear out everything in the firefox extension build directory
fs.rmSync(MOZCENTRAL_DIR, { recursive: true, force: true });

return merge([
return ordered([
createMainBundle(defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
),
Expand Down Expand Up @@ -1409,7 +1409,7 @@ gulp.task(
"locale",
function scriptingChromium() {
const defines = { ...DEFINES, CHROME: true, SKIP_BABEL: false };
return merge([
return ordered([
buildDefaultPreferences(defines, "chromium/"),
createTemporaryScriptingBundle(defines),
]);
Expand All @@ -1435,7 +1435,7 @@ gulp.task(

const version = getVersionJSON().version;

return merge([
return ordered([
createMainBundle(defines).pipe(
gulp.dest(CHROME_BUILD_CONTENT_DIR + "build")
),
Expand Down Expand Up @@ -1587,7 +1587,7 @@ function buildLib(defines, dir) {
DEFAULT_FTL: getDefaultFtl(),
};

const inputStream = merge([
const inputStream = ordered([
gulp.src(
[
"src/{core,display,shared}/**/*.js",
Expand All @@ -1609,7 +1609,7 @@ gulp.task(
createBuildNumber,
function scriptingLib() {
const defines = { ...DEFINES, GENERIC: true, LIB: true };
return merge([
return ordered([
buildDefaultPreferences(defines, "lib/"),
createTemporaryScriptingBundle(defines),
]);
Expand All @@ -1620,7 +1620,7 @@ gulp.task(
function createLib() {
const defines = { ...DEFINES, GENERIC: true, LIB: true };

return merge([
return ordered([
buildLib(defines, "build/lib/"),
createSandboxBundle(defines).pipe(gulp.dest("build/lib/")),
]);
Expand All @@ -1639,7 +1639,7 @@ gulp.task(
LIB: true,
SKIP_BABEL: false,
};
return merge([
return ordered([
buildDefaultPreferences(defines, "lib-legacy/"),
createTemporaryScriptingBundle(defines),
]);
Expand All @@ -1655,7 +1655,7 @@ gulp.task(
SKIP_BABEL: false,
};

return merge([
return ordered([
buildLib(defines, "build/lib-legacy/"),
createSandboxBundle(defines).pipe(gulp.dest("build/lib-legacy/")),
]);
Expand All @@ -1682,7 +1682,7 @@ gulp.task(

config.stableVersion = version;

return merge([
return ordered([
createStringSource(CONFIG_FILE, JSON.stringify(config, null, 2)).pipe(
gulp.dest(".")
),
Expand Down Expand Up @@ -1821,7 +1821,7 @@ gulp.task(
"generic",
"types",
function createTypesTest() {
return merge([
return ordered([
packageJson().pipe(gulp.dest(TYPESTEST_DIR)),
gulp
.src("external/dist/**/*", {
Expand Down Expand Up @@ -2081,7 +2081,7 @@ function ghPagesPrepare() {

fs.rmSync(GH_PAGES_DIR, { recursive: true, force: true });

return merge([
return ordered([
gulp
.src(GENERIC_DIR + "**/*", { base: GENERIC_DIR, removeBOM: false })
.pipe(gulp.dest(GH_PAGES_DIR)),
Expand Down Expand Up @@ -2208,7 +2208,7 @@ gulp.task(
}
}

return merge([
return ordered([
packageJson().pipe(gulp.dest(DIST_DIR)),
gulp
.src("external/dist/**/*", {
Expand Down
24 changes: 19 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"jasmine": "^5.1.0",
"jsdoc": "^4.0.3",
"jstransformer-markdown-it": "^3.0.0",
"merge-stream": "^2.0.0",
"ordered-read-streams": "^2.0.0",
"path2d": "^0.2.0",
"pngjs": "^7.0.0",
"postcss": "^8.4.38",
Expand Down

0 comments on commit b7b8e5e

Please sign in to comment.