Skip to content

Commit

Permalink
[PM-13277] Gulp: Remove unnecessary filtering (#11456)
Browse files Browse the repository at this point in the history
Part of the browser build script refactor effort. bitwarden.atlassian.net/browse/PM-6683

We seem to have some very old filters related to fonts and safari build files. These predates our modern usage of webpack for bundling only used assets.

I've run diff -qr on Chrome, Firefox and Safari builds and the only difference is that we now include a bwi-font.svg resource. bwi-font.svg is referenced in our css files and "should" be included.
  • Loading branch information
Hinton authored Oct 22, 2024
1 parent 023abe2 commit 173a5e2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 136 deletions.
1 change: 0 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"cross-env",
"del",
"gulp",
"gulp-filter",
"gulp-if",
"gulp-json-editor",
"gulp-replace",
Expand Down
21 changes: 0 additions & 21 deletions apps/browser/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,9 @@ const betaBuild = process.env.BETA_BUILD === "1";
const paths = {
build: "./build/",
dist: "./dist/",
node_modules: "./node_modules/",
popupDir: "./src/popup/",
cssDir: "./src/popup/css/",
safari: "./src/safari/",
};

const filters = {
fonts: [
"!build/popup/fonts/*",
"build/popup/fonts/Open_Sans*.woff",
"build/popup/fonts/bwi-font.woff2",
"build/popup/fonts/bwi-font.woff",
"build/popup/fonts/bwi-font.ttf",
],
safari: ["!build/safari/**/*"],
};

/**
* Converts a number to a tuple containing two Uint16's
* @param num {number} This number is expected to be a integer style number with no decimals
Expand Down Expand Up @@ -64,11 +50,9 @@ function distFileName(browserName, ext) {

async function dist(browserName, manifest) {
const { default: zip } = await import("gulp-zip");
const { default: filter } = await import("gulp-filter");

return gulp
.src(paths.build + "**/*")
.pipe(filter(["**"].concat(filters.fonts).concat(filters.safari)))
.pipe(gulpif("popup/index.html", replace("__BROWSER__", "browser_" + browserName)))
.pipe(gulpif("manifest.json", jeditor(manifest)))
.pipe(zip(distFileName(browserName, "zip")))
Expand Down Expand Up @@ -192,8 +176,6 @@ function distSafariApp(cb, subBuildPath) {
return new Promise((resolve) => proc.on("close", resolve));
})
.then(async () => {
const { default: filter } = await import("gulp-filter");

const libs = fs
.readdirSync(builtAppexFrameworkPath)
.filter((p) => p.endsWith(".dylib"))
Expand Down Expand Up @@ -237,13 +219,10 @@ function safariCopyAssets(source, dest) {
}

async function safariCopyBuild(source, dest) {
const { default: filter } = await import("gulp-filter");

return new Promise((resolve, reject) => {
gulp
.src(source)
.on("error", reject)
.pipe(filter(["**"].concat(filters.fonts)))
.pipe(gulpif("popup/index.html", replace("__BROWSER__", "browser_safari")))
.pipe(
gulpif(
Expand Down
113 changes: 0 additions & 113 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-tailwindcss": "3.17.4",
"gulp": "4.0.2",
"gulp-filter": "9.0.1",
"gulp-if": "3.0.0",
"gulp-json-editor": "2.6.0",
"gulp-replace": "1.1.4",
Expand Down

0 comments on commit 173a5e2

Please sign in to comment.