Build System

Gulp tasks for JS/CSS bundling, translations and versioning

Bundling, translation compilation and versioning are driven by Gulp tasks in gulpfile.mjs , invoked with npx gulp <task>. The npm run * scripts cover testing only — see the Testing page.

Tasks

TaskCommandWhat it does
buildnpx gulp buildclean → JS (Rollup) + CSS (PostCSS)
devbuildnpx gulp devbuildlike build, but Dev-Mode (no minify, source maps)
updateponpx gulp updateporuns update-po-files.sh → xgettext over src/ → messages.pot
po2phpnpx gulp po2phpcompiles resources/lang/*.po → resources/lang/*.php
syncversionnpx gulp syncversionkeeps latest-version.txt ↔ LinkEnhancerModule.php in sync
bumpversionnpx gulp bumpversionrequires a clean git tree → version bump → syncversion
archivenpx gulp archivebuild + po2php + create-archive.sh (release ZIP)
forgejo:issue-refsnpx gulp forgejo:issue-refs[:dry]adds issue refs to commit messages (needs FORGEJO_TOKEN in .env) - was used only once to migrate the repo from GitHub to Codeberg

JS / CSS bundling

build = clean → (in parallel) JS + CSS.

  • clean deletes resources/js/bundle* and resources/css/bundle* first.
  • JS (Rollup): two entry bundles — jsIndex (the main index-le.js ) and jsExtractLeConfig (le-config.js ). Output to resources/js/bundle*.
  • CSS (PostCSS): per-file subtasks from getCssSubTasks(), with autoprefixer + cssnano. Output to resources/css/bundle*.

Dev-Mode (devbuild) toggles a flag via toggleDevMode(true) — it disables minification and emits source maps.

Build & archive pipeline

flowchart LR
    subgraph B["🔧 npx gulp build"]
        C["🧹 clean<br/>(bundle*)"]
        J["`📜 Rollup<br/>**index-le.js** · le-config.js`"]
        P["🎨 PostCSS<br/>autoprefixer · cssnano"]
        C --> J
        C --> P
    end
    subgraph A["📦 npx gulp archive"]
        A1["build"]
        A2["po2php"]
        A3["`create-archive.sh<br/>**dist/linkenhancer_v<ver>.zip**`"]
        A1 --> A2 --> A3
    end

    classDef bStyle fill:#e3f2fd,stroke:#1565C0,stroke-width:2px
    classDef aStyle fill:#e8f5e9,stroke:#2E7D32,stroke-width:2px

    class C,J,P bStyle
    class A1,A2,A3 aStyle

Translation files

  • updatepo only regenerates the template (messages.pot). The .po files themselves are updated via Weblate, not locally, to avoid conflicts — see the Translation Pipeline page.
  • po2php converts the committed .po files into the PHP arrays webtrees loads at runtime.
Last modified November 5, 2026: added cross-links (9b8168b)