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

[Snyk] Security upgrade del from 6.1.1 to 8.0.0 #8031

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6492465
fix: package.json & package-lock.json to reduce vulnerabilities
snyk-bot Oct 11, 2024
5946f30
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
ToniBonittoGSA Oct 11, 2024
bc81a02
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
RileySeaburg Oct 15, 2024
2b12dfc
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
ToniBonittoGSA Oct 17, 2024
73e1e4a
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
ToniBonittoGSA Oct 21, 2024
e6b81dd
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
ToniBonittoGSA Nov 5, 2024
f9a69ef
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
RileySeaburg Nov 5, 2024
b58ed5c
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
ToniBonittoGSA Nov 8, 2024
51f7d84
Removed del package, replaced with native fs methods
nick-mon1 Nov 19, 2024
aebbe95
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 19, 2024
87b8dfe
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 20, 2024
43b2109
Pulled down changes, npm audit passes
nick-mon1 Nov 20, 2024
d99c10b
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
RileySeaburg Nov 21, 2024
c8c0802
Replaces npm-run-all with concurrently, adds arm64 support for sass a…
nick-mon1 Nov 21, 2024
c520ee0
Removed cross-spawn override for npm-run-all
nick-mon1 Nov 21, 2024
2fc67bb
Removed sass for arm64, causes build failure
nick-mon1 Nov 21, 2024
8be1f34
Removed package-lock packages
nick-mon1 Nov 21, 2024
a3cd577
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 22, 2024
8073a10
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 22, 2024
00927f5
Updated cross-spawn for eslint
nick-mon1 Nov 25, 2024
a651fdc
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 25, 2024
4c661d9
Merge branch 'main' into snyk-fix-4d01306e6aca5a2791e2be5edbbe2b84
nick-mon1 Nov 27, 2024
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
18 changes: 11 additions & 7 deletions config/gulp/file-prep.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { src, series } = require("gulp");
const sharp = require("sharp");
const del = require("del");
const tap = require("gulp-tap");
const sizeOf = require("image-size");
const fs = require("fs");
Expand Down Expand Up @@ -205,12 +204,17 @@ function cleanFileName(origfilename) {
* removes files in content/images/_inbox directories
* keeps _inbox/__add image or static files to this folder__
*/
function cleanInbox() {
return del([
"content/uploads/_inbox/**",
"!content/uploads/_inbox",
"!content/uploads/_inbox/__add image or static files to this folder__",
]);
function cleanInbox(done) {
const inboxDir = `${filePaths.uploads}`;
const filesToDelete = fs
.readdirSync(inboxDir)
.filter((file) => file !== "__add image or static files to this folder__");

filesToDelete.forEach((file) => {
const filePath = path.join(inboxDir, file);
fs.unlinkSync(filePath);
});
done();
}

/**
Expand Down
20 changes: 12 additions & 8 deletions config/gulp/file-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { series } = require("gulp");
const sharp = require("sharp");
const fs = require("fs");
const path = require("path");
const del = require("del");

/**
* Set input and output directories for image processing
Expand Down Expand Up @@ -136,7 +135,7 @@ async function processImages() {
const imageToProcess = getImageDetails(image);
return Promise.all([
processImageOriginal(imageToProcess),
processImageVariants(imageToProcess)
processImageVariants(imageToProcess),
]);
});

Expand All @@ -156,12 +155,17 @@ async function processImages() {
*/
function removeProcessedImage() {
return new Promise((resolve, reject) => {
const imageDir = "content/uploads/_working-images/processed";

if (fs.existsSync(imageDir) && fs.readdirSync(imageDir).length > 0) {
return del([
"content/uploads/_working-images/to-process",
]).then(() => resolve()).catch((err) => reject(err));
if (
fs.existsSync(processedImagesDirectory) &&
fs.readdirSync(processedImagesDirectory).length > 0
) {
fs.rmdir(processImagesDirectory, { recursive: true }, (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
} else {
resolve();
}
Expand Down
4 changes: 2 additions & 2 deletions config/gulp/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const replace = require("gulp-replace");
const sass = require("gulp-sass")(require("sass-embedded"));
const sourcemaps = require("gulp-sourcemaps");
const svgSprite = require("gulp-svg-sprite");
const del = require("del");
const rename = require("gulp-rename");
const pkg = require("../../node_modules/@uswds/uswds/package.json");

Expand Down Expand Up @@ -144,7 +143,8 @@ function renameSprite() {
}

function cleanSprite() {
return del.sync(`${IMG_DEST}/symbol`);
const spriteDir = `${IMG_DEST}/symbol`;
fs.rmdirSync(spriteDir, { recursive: true });
}

exports.init = series(
Expand Down
Loading