Skip to content

refactor(gulp): modernize build pipeline and streamline dependencies - #4759

Merged
jekkos merged 1 commit into
opensourcepos:masterfrom
BudsieBuds:gulp-modernization
Oct 21, 2026
Merged

jekkos merged 1 commit into
opensourcepos:masterfrom
BudsieBuds:gulp-modernization

Conversation

@BudsieBuds

@BudsieBuds BudsieBuds commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Modernizes gulpfile.js by replacing outdated Gulp wrapper plugins with modern native Node.js APIs (node:fs/promises, node:child_process, node:stream), deduplicates repetitive asset copy tasks, safely removes 10 obsolete packages, updates frontend vendor dependencies, and reorganizes the build file into 5 structured task groups.


Motivation

The existing Gulp build script relied on multiple 10+ year-old wrapper plugins and repetitive stream chains. The goal of this PR is to modernize the build tooling to use native Node.js standard library capabilities, drop unneeded packages, and update current dependencies where possible, while ensuring generated asset bundles remain 100% functionally identical to master.


Package Audit: Why Packages Could Safely Be Removed or Updated

1. Removed Packages

  • gulp-clean: Replaced with native Node.js fs.rm('./public/resources', { recursive: true, force: true }) via node:fs/promises. Eliminates an unneeded external wrapper.
  • gulp-run: Replaced with native node:child_process (promisify(exec)), removing fragile shell stream wrappers.
  • stream-series: Replaced with a clean native PassThrough stream sequencer helper (streamSeries) using node:stream, avoiding an external package for sequential Vinyl stream piping.
  • gulp-rename: File copying tasks now calculate destinations directly or copy files to exact target paths using fs.copyFile.
  • readable-stream: Was a legacy polyfill for Node.js stream implementations in older Node versions. Modern Node.js (18+) has native WHATWG and stream promises built-in.
  • coffeescript: Completely unused legacy dependency. There is not a single .coffee file in the entire repository.
  • es6-promise: An obsolete polyfill for Internet Explorer 11. OSPOS does not support IE11, and modern browsers have native Promise.
  • gulp-debug, gulp-gzip, gulp-header: Diagnostic or unused packaging plugins with zero usage in the active build pipeline.

2. Updated Dependencies

  • bootstrap-table (^1.23.5 $\rightarrow$ ^1.27.3): Minor version upgrades providing sticky header, column formatting, and responsive rendering bugfixes.
  • dompurify (^3.4.16 $\rightarrow$ ^3.4.17): Patch update providing DOM XSS sanitization security fixes with a 100% backward-compatible API.
  • jquery-ui-dist (^1.12.1 $\rightarrow$ ^1.13.3): Security and compatibility fixes for UI widgets (autocomplete, datepicker).
  • jquery-validation (^1.19.5 $\rightarrow$ ^1.22.1): Minor update with validation regex and browser compatibility updates.
  • jspdf-autotable (^5.0.7 $\rightarrow$ ^5.0.9): Patch update fixing table layout and pagination quirks in PDF export generation.
  • license-report & npm-check-updates: Tooling updates for license compilation and dependency auditing.

Structural Improvements in gulpfile.js

  1. Deduplicating Repetitive Task Streams:
    • Bootswatch 3 & 5: Previously chained 15+ individual stream pipelines one by one. Replaced with clean glob patterns and an exclusion list (BOOTSWATCH5_EXCLUDED_THEMES).
    • Menubar Icons: Previously executed 19 individual Gulp stream pipelines for simple file renaming. Replaced with a configuration array (MENUBAR_ICONS) using native fs.copyFile in parallel with Promise.all.
  2. Standardized Inject Options:
    • Added injectOptions(tag, options) to eliminate repetitive { addRootSlash: false, ignorePath: '/public/', starttag: '...' } boilerplate across tasks.
  3. Structured Task Organization:
    • Organized into 5 clear, documented task groups:
      1. Clean & Licensing
      2. Vendor Themes & Static Asset Copies
      3. Global Application Assets
      4. Page-Scoped Assets
      5. Master Build Pipeline & Distribution Packaging
  4. Zero Output Regression:
    • Bundle contents remain identical to master. No application views are touched in this PR.

How to Verify

# Clean and build all production and debug assets
npm run build

Summary by CodeRabbit

  • New Features
    • Added support for Bootstrap 5 right-to-left styling and additional menubar icons.
    • Compressed packages now include the example environment configuration and exclude local environment files, dependencies, and build artifacts.
  • Updates
    • Updated the table component and several bundled UI and document-generation libraries.
    • Theme assets now include Bootswatch 3 styles and fonts; Bootswatch 5 themes without a Bootswatch 3 equivalent are no longer included.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⛔ Files ignored due to path filters: 1
  • package-lock.json is excluded by !**/package-lock.json
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc33bd99-c83a-47e8-84a3-801770f3c49f
📥 Commits

Reviewing files that changed from the base of the PR and between bb846bc and 5f14248.

⛔ Files ignored due to path filters: 1
  • package-lock.json is excluded by !**/package-lock.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73589af2-3464-45c8-b631-9db4a27f2658
📥 Commits

Reviewing files that changed from the base of the PR and between 312a877 and f6eb92a.

⛔ Files ignored due to path filters: 1
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing: 2
  • gulpfile.js
  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The Gulp build now uses updated task helpers and asset pipelines. It changes resource copying, license generation, task ordering, dependency versions, and archive contents.

Changes: Gulp asset build and packaging

Layer / File(s) Summary
Build helpers and resource preparation
gulpfile.js, package.json
The Gulp file adds shared helpers and updates cleanup, license generation, theme copying, and icon copying. Development dependencies are updated or removed.
Asset bundling and view injection
gulpfile.js, package.json
CSS, JavaScript, and configuration asset pipelines use updated bundling and injection steps. Runtime dependencies, including bootstrap-table, receive version updates; coffeescript and es6-promise are removed.
Task ordering and archives
gulpfile.js
The default task groups work after cleanup. Compression creates tar and zip archives, includes .env.example, and excludes node_modules, dist, and .git.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: jekkos

Merge Risk: ⚪ Minimal · up to f6eb9

The build pipeline refactor shows no concrete merge-blocking risk in the supplied evidence. Normal build verification is still advisable.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: modernization of the Gulp build pipeline and dependency cleanup.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Replace third-party Gulp plugins (gulp-clean, gulp-run, gulp-rename, stream-series, readable-stream) with native Node.js APIs (node:fs/promises, node:child_process, node:stream)
- Streamline Bootswatch 3 and 5 theme copies using glob patterns and exclusion lists instead of repetitive streams
- Refactor menubar icon copying to use a mapped configuration array with fs.copyFile
- Add injectOptions helper to standardize gulp-inject marker configuration
- Remove obsolete and unneeded dependencies (coffeescript, es6-promise, gulp-debug, gulp-gzip, gulp-header)
- Update dependencies (bootstrap-table, dompurify, jquery-ui-dist, jquery-validation, jspdf-autotable, license-report, npm-check-updates)
- Reorganize gulpfile.js into structured task groups and optimize task concurrency in default and compress pipelines
Comment thread gulpfile.js Resolved
@jekkos
jekkos merged commit 538f23b into opensourcepos:master Oct 21, 2026
26 checks passed
@BudsieBuds
BudsieBuds deleted the gulp-modernization branch October 21, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants