From 3cde3caf984e6baead98465ef61726765795ae22 Mon Sep 17 00:00:00 2001 From: Kazunori Kimura Date: Sun, 19 Jan 2025 17:57:48 +0900 Subject: [PATCH] update patch 0003-fix_preinstall.mjs-to-avoid-removing-node_modules-dir.patch File updated No changes to the scripts we want to modify - Simplify fileURLToPath usage in scripts https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173402 especially in commit https://gitlab.com/gitlab-org/gitlab/-/commit/462273d2ba17d2a506caf962830344798b1598cc first contained in : v17.7.0-ee --- ...stall.mjs-to-avoid-removing-node_modules_dir.patch | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/build/patches/gitlabhq/0003-fix_preinstall.mjs-to-avoid-removing-node_modules_dir.patch b/assets/build/patches/gitlabhq/0003-fix_preinstall.mjs-to-avoid-removing-node_modules_dir.patch index a5646ff3..3aba9e8f 100644 --- a/assets/build/patches/gitlabhq/0003-fix_preinstall.mjs-to-avoid-removing-node_modules_dir.patch +++ b/assets/build/patches/gitlabhq/0003-fix_preinstall.mjs-to-avoid-removing-node_modules_dir.patch @@ -1,16 +1,15 @@ diff --git a/scripts/frontend/preinstall.mjs b/scripts/frontend/preinstall.mjs -index 09d980344eac..b1514e803b75 100644 +index e86525cd20d2..f849c423f1b6 100644 --- a/scripts/frontend/preinstall.mjs +++ b/scripts/frontend/preinstall.mjs -@@ -1,6 +1,6 @@ - import { dirname, join } from 'node:path'; - import { fileURLToPath } from 'node:url'; +@@ -1,5 +1,5 @@ + import { join } from 'node:path'; -import { readFile, rm } from 'node:fs/promises'; +import { readdir, readFile, rm, stat } from 'node:fs/promises'; - const ROOT_PATH = join(dirname(fileURLToPath(import.meta.url)), '..', '..'); + const ROOT_PATH = join(import.meta.dirname, '..', '..'); const NODE_MODULES = join(ROOT_PATH, 'node_modules'); -@@ -55,5 +55,14 @@ if (!arraysHaveSameItems(prevTopLevelPatterns, currentTopLevelPatterns)) { +@@ -54,5 +54,14 @@ if (!arraysHaveSameItems(prevTopLevelPatterns, currentTopLevelPatterns)) { console.error( '[WARNING] package.json changed significantly. Removing node_modules to be sure there are no problems.', );