Loading...
 
Skip to main content

History: The Tiki 27 plus Build System

Source of version: 25 (current)

Copy to clipboard
{REMARKSBOX(type="warning" title="Work in progress" icon="cog")}This page needs updating a lot!{REMARKSBOX}

As of 2025-03-31, pretty much all the relevant dependencies have been moved to the new build system. For those not yet port, an explanation has been added to [https://gitlab.com/tikiwiki/tiki/-/blob/master/vendor_bundled/composer.json#L90|vendor_bundled/composer.json]

https://gitlab.com/tikiwiki/tiki/-/tree/master/src/js#migrating-dependencies

In ((Tiki27)) a new build system was introduced [https://gitlab.com/tikiwiki/tiki/-/merge_requests/3760|MR3760] as part of the  [https://gitlab.com/tikiwiki/tiki/-/blob/master/_PATH_DOCUMENTATION.md|path rework project]. This  ((tw:Open Hub|reduced the code base by 700 000 lines!))

This page will describe what you need to know to switch from using previous Tiki versions up to 26.x when installing Tiki using git.

* You need to install [https://nodejs.org/en/download/package-manager|node.js]
* Then run -+sh setup.sh+- and press return to run the build step (which will also run the composer -+vendor_bundled+- install)

* If you have a con job running you need to change the command to (something like):
** -+cd /home/tiki/master; php8.2 console.php -q vcs:update;  sh setup.sh -p php8.2 -k build;+-



!! Install node.js and npm on Debian12
Log in using ssh as your www tiki user (don't use root)
Use https://nodejs.org/en/download/package-manager
Select the version you need using the dropdown
Install the version as displayed check it is installed

!! Alternative method of installing Node.js and NPM
If you have root access to the server machine, you can use the following alternative (and cleaner) method.  When you can't login as your WWW user, because this isn't enabled in /etc/passwd, you should try this method. This is the case for older Ubuntu distributions, for instance.  I have Ubuntu 22.04.4 and the versions of the nodejs and npm packages are old and unsuitable for Tiki 27. 

The following method uses the [https://nodejs.org/en/download/prebuilt-binaries|prebuilt binaries] of the Node.js distribution. Select the Node.js version. The even numbered versions are stable releases. The odd number versions are development versions. So you'll probably want to use an even number. The version range needed by Tiki 27 is 18 to 21. So you probably want to use version 20. Select "Linux" and "x64". In the following steps, version 20.18.2 is used.

Click on "Download ...". This downloads the tarball -+node-v20.19.2-linux-x64.tar.xz+-. Decide on a place of where to install the binaries, go there and unpack it. I'm using /usr/local/lib. This will create the directory -+node-v20.19.2-linux-x64+-, which includes everything.

Version used or required by Tiki may change in time. You can check what engines version your Tiki version requires in the -+package.json+- file.
{CODE(caption="required engines for nodeJS")}
"engines": {
    "npm": ">=9.0.0 <11",
    "node": ">=18.0.0 <22"
  },
{CODE}

You need to make the binaries in the -+bin+- subdirectory accessible via your PATH, so Tiki's -+setup.sh+- script will find them. The problem is, that you need to (or should) use your WWW user to run this script. Like this:
{CODE()}sudo -u www-data sh setup.sh{CODE}
Bash (and sh) don't load any configuration scripts when called like this (except for a script assigned via the BASH_ENV environment variable, when set). So it isn't easy to add the bin path to your PATH variable. But you can symlink the contents of -+bin+- to somewhere in your path. This is where you need root access. For instance, I use /usr/local/bin. Afterwards, the node and npm programs (as well as corepack and npx) will be found:
{CODE()}
sudo ln -s /usr/local/lib/node-v20.18.2-linux-x64/bin/* /usr/local/bin
{CODE}
This seems to be the only configuration you need to do for the Node.js prebuilt binaries distribution.

{FONT(size=77%)}Volker Wysk, 2024-07-09{FONT}

!!! Troubleshooting
To check which node your user is using -+which node+-
To check which npm your user is using -+which npm+-
To remove installed packages -+~np~apt-get purge npm --auto-remove~/np~+- and -+~np~apt-get purge nodejs --auto-remove~/np~+-

!! Important URLs
* __The main documentation is here__ -> https://gitlab.com/tikiwiki/tiki/-/tree/master/src/js
* https://gitlab.com/tikiwiki/tiki/-/blob/master/src/js/common-externals/package.json

!! Examples of moving libs from Composer to the new build system
* https://gitlab.com/tikiwiki/tiki/-/merge_requests/4652
* https://gitlab.com/tikiwiki/tiki/-/merge_requests/4653
* https://gitlab.com/tikiwiki/tiki/-/merge_requests/4602
* https://gitlab.com/tikiwiki/tiki/-/merge_requests/4579

!! Custom themes in the new build system
* https://themes.tiki.org/Making-or-Updating-a-Theme-for-Tiki-27

~tc~ jonny b testing as user vows ~/tc~
Show PHP error messages