Wiki source code of Developer Guide
Last modified by Pierre Jeanjean on 2026/04/30 11:20
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
2.1 | 1 | We currently don't provide way to contribute outside the [[main repository>>https://github.com/xwiki-contrib/cristal/]]. |
| |
3.1 | 2 | See the list of [[extensions>>doc:Documentation.Extensions.WebHome]]. Each extension contains a section dedicated to developers. |
![]() |
4.1 | 3 | |
| 4 | = Cristal development with local xwiki-platform = | ||
| 5 | |||
![]() |
6.1 | 6 | {{version product='Cristal' since='1.3.0'}} |
![]() |
4.1 | 7 | Cristal packages have dependencies on packages managed by the [[xwiki-platform>>https://github.com/xwiki/xwiki-platform]] repository, which has its own release cycle. |
| 8 | |||
| 9 | In some instances, you might have to make changes to these packages' sources while working on Cristal, and will need to build them locally to use them. This is not a trivial process, mainly because ##npm## and ##pnpm## were not designed around the use-case of arbitrarily using a set of locally built packages in an otherwise "normal" build. | ||
| 10 | |||
| 11 | To help with this, Cristal's codebase includes a script to take care of all of the plumbing. From Cristal's repository root, you can run: | ||
| 12 | |||
| 13 | {{code language="bash"}} | ||
| 14 | node ./scripts/external-deps-start.js <xwiki-platform-root> <start|dev> | ||
| 15 | {{/code}} | ||
| 16 | |||
| 17 | Where ##<xwiki-platform-root>## is the location of your local copy of xwiki-platform's repository, and ##start## and ##dev## correspond to the start mode of Vite's server. | ||
| 18 | |||
| 19 | Ideally, if you run this in ##dev## mode, it should take care of everything and even detect, rebuild and restart Vite's server on changes made to xwiki-platform's codebase. Be careful to not commit anything while this is running (because it makes changes to Cristal's configuration), and close it beforehand using ##CTRL+C## (which should clean up any change). | ||
| 20 | |||
| 21 | {{warning}} | ||
| 22 | In some occasions, the automatic rebuild might lead to broken packages due to race conditions. If this happens to you, you can simply save your file a second time to restart the build, which should hopefully fix the issue. | ||
| 23 | {{/warning}} | ||
| 24 | |||
| 25 | The next part is a detail of all the different actions of this script : | ||
| 26 | |||
| 27 | * On start, uncomment the line in ##.npmrc## that declares a local package registry, | ||
| 28 | * Detect all the node packages in ##<xwiki-platform-root>##, build them, and move the outputs to a ##.xwiki-platform## inside the current folder, | ||
| 29 | * Start a local npm server, which is a custom-made proxy provided in the ##npm-server## directory. Its function is to return the locally built versions of packages available in ##.xwiki-platform## and defer to the xwiki nexus server if not found, | ||
| 30 | * Run a dependency update to use the "new" (//i.e.//, local) versions of the packages, | ||
| 31 | * Run the Vite server, | ||
| 32 | * If the Vite server is run in dev mode, also add resources watchers to the detected local packages, handling rebuild and updates to the ##.xwiki-platform## folder. Also, the Vite server is started with a custom plugin that detects changes in ##.xwiki-platform## and triggers a server restart if needed, | ||
| 33 | * On stop, stop all servers and clean up every change (enabled repositories and packages versions). | ||
![]() |
5.1 | 34 | {{/version}} |

This project is being financed by the French State as part of the France 2030 program
Ce projet est financé par l’État Français dans le cadre de France 2030
