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
| Task | Command | What it does |
|---|---|---|
build | npx gulp build | clean → JS (Rollup) + CSS (PostCSS) |
devbuild | npx gulp devbuild | like build, but Dev-Mode (no minify, source maps) |
updatepo | npx gulp updatepo | runs update-po-files.sh
→ xgettext over src/ → messages.pot |
po2php | npx gulp po2php | compiles resources/lang/*.po → resources/lang/*.php |
syncversion | npx gulp syncversion | keeps latest-version.txt
↔ LinkEnhancerModule.php
in sync |
bumpversion | npx gulp bumpversion | requires a clean git tree → version bump → syncversion |
archive | npx gulp archive | build + po2php + create-archive.sh
(release ZIP) |
forgejo:issue-refs | npx 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*andresources/css/bundle*first. - JS (Rollup): two entry bundles —
jsIndex(the mainindex-le.js) andjsExtractLeConfig(le-config.js). Output toresources/js/bundle*. - CSS (PostCSS): per-file subtasks from
getCssSubTasks(), with autoprefixer + cssnano. Output toresources/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
updatepoonly regenerates the template (messages.pot). The.pofiles themselves are updated via Weblate, not locally, to avoid conflicts — see the Translation Pipeline page.po2phpconverts the committed.pofiles into the PHP arrays webtrees loads at runtime.