Skip to content

Cleanup Build Scripts #5483

Closed
Closed
@pano9000

Description

@pano9000

Describe Task

We currently have a weird and confusing mixture of ways of how to build our packages.

I can identify

  • Desktop Version

    • we have an npm script for building locally, but it also is called in our Github CI actions
    • this build with node v20 as base (if I am not fully mistaken)
  • Server Version

    • we don't seem to have an npm script for this but the Github CI Action is running ./bin/build-server.sh, which is running
      • ./bin/copy-trilium.sh which is doing similar things like copy-dist.ts above, but some additional cleaning
      • ./bin/build-server.sh then does also some clean up like of unneeded files for the Server version
    • we have a Dockerfile
      • has its own build instructions directly in the Dockerfile,
      • which are doing similar things like copy-dist.ts and ./bin/build-server.sh
    • this builds with node v22 as base
    • we have a ./bin/build-docker.sh script that builds above Dockerfile, but first needs to transpile the code locally via tsc???
    • we have a main-docker.yml workflow, which seems to be doing what ./bin/build-docker.sh is doing, but it runs the commands explicitly (i.e. not the script itself -> in other words: we have code duplication)

copy-dists.ts seems to be less "advanced" than copy-trilium.sh in regards to "cleanup", i.e. copy-trilium.sh tries to delete unnecessary test files from npm modules as well.

In ./bin we also have a build.sh script, that references some other build-scripts that are not existing anymore (because they were replaced by using electron-forge), which also calls copy-trilium.sh

We should take a look at all of these and try to clean them up and make them a bit less confusing and duplicated :-)

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions