chore(docs): restructure developer guide for monorepo

This commit is contained in:
Elian Doran 2025-05-02 20:51:13 +03:00
parent 27d1948bb1
commit 81ebbb9390
No known key found for this signature in database
111 changed files with 2632 additions and 2202 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
# Environment Setup
## Setting up `pnpm`
Trilium uses the `pnpm` package manager in order to better manage its mono-repo structure. Unlike `npm` which comes by default with Node.js, `pnpm` needs to be manually activated.
For most systems this can be achieved via `corepack`:
```
corepack enable
```
After that, run `pnpm` in a new terminal to see if it is working. On Windows, if you get:
```
pnpm : The term 'pnpm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
```
The solution is to run `corepack enable` in a Terminal with administrative rights.
As a quick heads-up of some differences when compared to `npm`:
* Generally instead of `npm run` we have `pnpm run` instead.
* Instead of `npx` we have `pnpm exec`.
## Installing dependencies
Run `pnpm i` at the top of the `Notes` repository to install the dependencies.
## IDE
Our recommended IDE for working on TriliumNext is Visual Studio Code (or VSCodium if you are looking for a fully open-source alternative).
By default we include a number of suggested extensions which should appear when opening the repository in VS Code. Most of the extensions are for integrating various technologies we are using such as Playwright and Vitest for testing and NX for mono-repo management.

View File

@ -1,2 +0,0 @@
# Releasing a version
This is a clone of a note. Go to its [primary location](../Building%20and%20deployment/Releasing%20a%20version.md).

View File

@ -1,2 +0,0 @@
# Running a development build
This is a clone of a note. Go to its [primary location](../Building%20and%20deployment/Running%20a%20development%20build.md).

View File

@ -1,2 +1,2 @@
# Build deliveries locally
This is a clone of a note. Go to its [primary location](../Building%20and%20deployment/Build%20deliveries%20locally.md).
This is a clone of a note. Go to its [primary location](../Build%20deliveries%20locally.md).

View File

@ -2,7 +2,7 @@
The main workflow of the CI:
* Builds the Docker image and publishes in the GitHub Docker registry.
* Builds using a portion of the [delivery script](../Build%20deliveries%20locally.md) artifacts for the following platforms:
* Builds using a portion of the [delivery script](../../Build%20deliveries%20locally.md) artifacts for the following platforms:
* Windows `x86_64` as .zip file
* Windows `x86_64` installer (using Squirrel)
* macOS `x86_64` and `aarch64`.

View File

@ -0,0 +1,2 @@
# Releasing a version
This is a clone of a note. Go to its [primary location](../Releasing%20a%20version.md).

View File

@ -0,0 +1,2 @@
# Running a development build
This is a clone of a note. Go to its [primary location](../Running%20a%20development%20build.md).

View File

@ -1,4 +1,4 @@
# Build information
* Provides context about when the build was made and the corresponding Git revision.
* The information is displayed to the client when going in the about dialog.
* The build information is hard-coded in `src/services/build.ts`. This file is generated automatically via `npm run update-build-info` which itself is run automatically whenever making a build in the CI, or a [local delivery](../Building%20and%20deployment/Build%20deliveries%20locally.md).
* The build information is hard-coded in `src/services/build.ts`. This file is generated automatically via `npm run update-build-info` which itself is run automatically whenever making a build in the CI, or a [local delivery](../Build%20deliveries%20locally.md).

View File

@ -17,7 +17,7 @@ These are stored in `images`:
## App icons
<figure class="table"><table><thead><tr><th>Name</th><th>Resolution</th><th>Description</th></tr></thead><tbody><tr><td><code>ios/apple-touch-icon.png</code></td><td>180x180</td><td>Used as <code>apple-touch-icon</code>, but only in <code>login.ejs</code> and <code>set_password.ejs</code> for some reason.</td></tr><tr><td><code>mac/icon.icns</code></td><td>512x512</td><td>Provided as <code>--icon</code> to <code>electron-packager</code> for <code>mac-arm64</code> and <code>mac-x64</code> <a href="../Building%20and%20deployment/Build%20deliveries%20locally.md">builds</a>.</td></tr><tr><td><code>png/128x128.png</code></td><td>128x128</td><td>Used in <code>linux-x64</code> <a href="../Building%20and%20deployment/Build%20deliveries%20locally.md">build</a>, to provide an <code>icon.png</code>.</td></tr><tr><td><code>png/256x256-dev.png</code></td><td>256x256</td><td>Used by the Electron window icon, if in dev mode.</td></tr><tr><td><code>png/256x256.png</code></td><td>Used by the Electron window icon, if not in dev mode.</td></tr><tr><td><code>win/icon.ico</code></td><td><ul><li>ICO 16x16</li><li>ICO 32x32</li><li>ICO 48x48</li><li>ICO 64x64</li><li>ICO 128x128</li><li>PNG 256x256</li></ul></td><td><ul><li>Used by the <code>win-x64</code> <a href="../Building%20and%20deployment/Build%20deliveries%20locally.md">build</a>.</li><li>Used by Squirrel Windows installer for: setup icon, app icon, control panel icon</li><li>Used as the favicon.</li></ul></td></tr><tr><td><code>win/setup-banner.gif</code></td><td>640x480</td><td>Used by the Squirrel Windows installer during the installation process. Has only one frame.</td></tr></tbody></table></figure>
<figure class="table"><table><thead><tr><th>Name</th><th>Resolution</th><th>Description</th></tr></thead><tbody><tr><td><code>ios/apple-touch-icon.png</code></td><td>180x180</td><td>Used as <code>apple-touch-icon</code>, but only in <code>login.ejs</code> and <code>set_password.ejs</code> for some reason.</td></tr><tr><td><code>mac/icon.icns</code></td><td>512x512</td><td>Provided as <code>--icon</code> to <code>electron-packager</code> for <code>mac-arm64</code> and <code>mac-x64</code> <a href="../Build%20deliveries%20locally.md">builds</a>.</td></tr><tr><td><code>png/128x128.png</code></td><td>128x128</td><td>Used in <code>linux-x64</code> <a href="../Build%20deliveries%20locally.md">build</a>, to provide an <code>icon.png</code>.</td></tr><tr><td><code>png/256x256-dev.png</code></td><td>256x256</td><td>Used by the Electron window icon, if in dev mode.</td></tr><tr><td><code>png/256x256.png</code></td><td>Used by the Electron window icon, if not in dev mode.</td></tr><tr><td><code>win/icon.ico</code></td><td><ul><li>ICO 16x16</li><li>ICO 32x32</li><li>ICO 48x48</li><li>ICO 64x64</li><li>ICO 128x128</li><li>PNG 256x256</li></ul></td><td><ul><li>Used by the <code>win-x64</code> <a href="../Build%20deliveries%20locally.md">build</a>.</li><li>Used by Squirrel Windows installer for: setup icon, app icon, control panel icon</li><li>Used as the favicon.</li></ul></td></tr><tr><td><code>win/setup-banner.gif</code></td><td>640x480</td><td>Used by the Squirrel Windows installer during the installation process. Has only one frame.</td></tr></tbody></table></figure>
## Additional locations where the branding is used

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -20,7 +20,7 @@ the module (for instance, using `npm rebuild` or `npm install`).
Locally, this can be fixed by rebuilding the binaries, which is what `npm run switch-electron` does, which uses `electron-rebuild` under the hood.
When the deliveries are built (see <a class="reference-link" href="../../Building%20and%20deployment/Build%20deliveries%20locally.md">Build deliveries locally</a>), it is not feasible to rebuild the dependencies since we are building for multiple platforms. Luckily, `better-sqlite3` provides these prebuilt binaries from us, available as artifacts on [their GitHub releases page](https://github.com/WiseLibs/better-sqlite3/releases/). 
When the deliveries are built (see <a class="reference-link" href="../../Build%20deliveries%20locally.md">Build deliveries locally</a>), it is not feasible to rebuild the dependencies since we are building for multiple platforms. Luckily, `better-sqlite3` provides these prebuilt binaries from us, available as artifacts on [their GitHub releases page](https://github.com/WiseLibs/better-sqlite3/releases/). 
The build script manages the natives for `better-sqlite3` by keeping a copy of the `.node` file for every platform in `bin/better-sqlite3`.
@ -35,7 +35,7 @@ If you get errors during download, check on the [releases page](https://github.c
To determine the `NODE_MODULE_VERSION` that is required, look for `This version of Node.js requires`
`NODE_MODULE_VERSION` in the error when starting Trilium via:
* `npm run start-electron` (or run any Electron [delivery](../../Building%20and%20deployment/Build%20deliveries%20locally.md)), case in which the `ELECTRON_VERSION` variable needs to be changed.
* `npm run start-electron` (or run any Electron [delivery](../../Build%20deliveries%20locally.md)), case in which the `ELECTRON_VERSION` variable needs to be changed.
* `npm run start-server` (or run the Linux server delivery), case in which the `NODE_VERSION` variable needs to be changed.
Check which files got changed after running the update script and for each platform that got changed, test it locally via <a class="reference-link" href="../../Building%20and%20deployment/Build%20deliveries%20locally.md">Build deliveries locally</a> or via the CI.
Check which files got changed after running the update script and for each platform that got changed, test it locally via <a class="reference-link" href="../../Build%20deliveries%20locally.md">Build deliveries locally</a> or via the CI.

View File

@ -17,6 +17,6 @@ If a version ends with `-beta`, it will automatically be marked as pre-release i
This will automatically generate a release in GitHub if everything goes according to plan.
Note that the Windows installer is not automatically uploaded yet, it has to be taken from the [main workflow of the CI from the `develop` branch](CI/Main.md).
Note that the Windows installer is not automatically uploaded yet, it has to be taken from the [main workflow of the CI from the `develop` branch](Building%20and%20deployment/CI/Main.md).
Make sure to check test the artifacts of the release.

Some files were not shown because too many files have changed in this diff Show More