47 Commits

Author SHA1 Message Date
Panagiotis Papadopoulos
6b9d8f0d67 build(electron-forge): execute electron-forge commands in our "build" output context
since we build TS and webpack ourselves and are not using any electron-forge plugins (at least at the moment) -> we should use the "build" folder as build context for electron-forge:

in comparison to running electron-forge in the root folder of the project, this avoids electron-forge from packing the source code multiple times (e.g. once as uncompiled TS, then as compiled JS, and then (partially) a third time as webpack bundled JS files), same as some of the assets.

to achieve this, we run our usual TS/Webpack build process, but then install the npm dependencies *inside* the build folder (as otherwise electron-forge would choke on the missing node_modules it and abort building).

In theory we could avoid cd-ing into the build folder, by providing the "dir" as argument to electron-forge's CLI -- BUT that wouldn't play well with our CI, where we are passing --arch and --platform options to it, which need to come *before* the dir argument.

since we now cd into the "build" folder, we also need to adjust the path in package.json "main" again
2025-03-13 07:59:12 +01:00
Panagiotis Papadopoulos
d7aedfbd36 build(copy-dist): exit on any caught error to make sure copy-dist fails during CI if any error occurs
if we don't exit, it will just log the issue - however we *want* it to fail it there is an error, so that it doesn't continue in the CI

alternative would be to rethrow the error, but then we'd print the error into the logs twice :-)

closes https://github.com/TriliumNext/Notes/issues/1413
2025-03-12 09:52:42 +01:00
Panagiotis Papadopoulos
d088c8e5b2 build(copy-dist): fix path to excalidraw fonts 2025-03-12 08:57:05 +01:00
Elian Doran
cf76358dd7
fix(canvas): font loading 2025-03-11 23:03:34 +02:00
Panagiotis Papadopoulos
930be2de05 build(copy-dist): copy LICENSE and README as well
copied over from copy-trilium.sh script
2025-03-09 18:59:54 +01:00
Panagiotis Papadopoulos
607f9096aa build: output into "build" folder again → "dist" will be used for the final output in archive form
this will allow for cleaner separation -> build for the output from the build stage (i.e. TS/Webpack + asset copying) and dist for the archive format of the build folder
2025-03-09 18:59:54 +01:00
Panagiotis Papadopoulos
907b8c503e build: copy package-lock.json into dist folder as well 2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
e389592017 build(copy-dist): copying build folder is not required anymore
TS and Webpack build into the dist folder directly now
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
3032156b45 build(copy-dist): execute code in try/catch -> get rid of function
since we don't export this anywhere, might as well just call the steps directly
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
d75cf8c11e build(copy-dist): consolidate nodeModules copying into a single loop 2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
a816abb372 build(copy-dist): use sync copying
since this is a "standalone" script we are running and no other JS scritps are running "in the background", there's no real benefit for async here.
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
37f1525d0e build(copy-dist): remove unused paths 2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
dbeae62709 build(copy-dist): simplify "copyNodeModuleFileOrFolder" copying
there's no benefit from stripping "node_modules/" from the string, to later add it again using the `DEST_DIR_NODE_MODULES` constant

=> just copy directly into the `DEST_DIR` folder and preserver the `node_modules` part in the path
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
ac3e96291a build(copy-dist): simplify "build" copying
there's no need to read the folder structure and then copy each single file in a loop

=> just copy the whole folder and be done with it :-)
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
9ac451e2b2 build(copy-dist): consolidate files and folder copying into one asset copying job
there's no benefit in having them split up like before
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
dbc2df0820 build(copy-dist): consolidate folder copying
the "srcDirsToCopy" block is useless now, we can just use the previous dirsToCopy to achieve the exact same thing
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
24382d8176 build(copy-dist): avoid copying over the app dir into dist
we have the bundled "app-dist" already in the "dist", copying over the original unbundled "app" folder serves no benefit here
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
af5e4ee3b5 build(copy-dist): copy over required folders/files from "public" folder 2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
135101f57b build(copy-dist): do not copy build folder into src folder
stop the build folder from being copied into the dist/src subfolder
→ there is no sense in doing that
→ the contents of the build folder are corretly copied previously already (see line 26ff)
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
60a2b56636 chore(copy-dist): removee unnecesary copy of tsconfig.webpack.json
webpack bundling already ran before this script, so there is no need to copy this file over
2025-03-07 23:14:56 +01:00
Panagiotis Papadopoulos
e7d204dfd2 chore(copy-dist): remove now unneeded manual copying of bootstrap dir
webpack is taking care of that for us
2025-02-22 11:56:56 +01:00
Panagiotis Papadopoulos
dd4f8a8c27 chore(copy-dist): "unpack" log messages before printing
previously it was printin all messages as part of an array, i.e.
["message"]
After spreading the array, we get the desired out
"message"
2025-02-15 13:08:13 +01:00
Elian Doran
9299f90b85
feat(docs): internal API docs 2025-02-15 00:33:12 +02:00
Panagiotis Papadopoulos
010783102a build: fix missing copying of etapi.openapi.yaml into dist folder
fixes build via electron-forge
2025-02-12 23:09:20 +01:00
Elian Doran
2cc7113c2c
refactor(deps): get rid of print-this 2025-02-01 00:52:46 +02:00
Panagiotis Papadopoulos
ed33b72f57 chore(assets): remove manual provision of knockout
this is only used in setup.ts and there it is already packed by webpack – so no need to manually provide it as static asset anymore
2025-01-29 08:48:03 +01:00
Elian Doran
7a3a5141af
fix(geomap): not working on electron 2025-01-22 23:08:25 +02:00
Elian Doran
eaacdb57d1
fix(build): add back copying canvas dist files 2025-01-18 11:19:35 +02:00
Elian Doran
7d3f506efb
refactor(deps): use webpack import for canvas 2025-01-18 11:09:57 +02:00
Elian Doran
e7eb385b8f
refactor(deps): integrate force-graph into webpack 2025-01-17 20:21:52 +02:00
Elian Doran
25e0dc3355
fix(electron): copy dist not working due to missing lib 2025-01-11 17:04:07 +02:00
Elian Doran
4cbb529fd4
chore(prettier): fix all files 2025-01-09 18:07:02 +02:00
Elian Doran
7a2b5e731e
chore(code): fix more js & ts files 2024-12-22 15:45:54 +02:00
Elian Doran
4e75ba78b4
fix(electron): not starting in dev mode 2024-12-22 00:28:17 +02:00
Elian Doran
018557bb57
fix(electron): mind map not working due to missing deps 2024-12-09 23:32:39 +02:00
Elian Doran
fa3200ba8f
electron: Fix docnotes not rendering 2024-11-02 16:11:59 +02:00
Elian Doran
df3f51d1f3
electron: Fix loading of highlight.js 2024-11-01 23:42:23 +02:00
Elian Doran
a5fd57308a
server: Fix translations in standalone build 2024-10-13 12:09:36 +03:00
Elian Doran
0dbad48d47
electron: Fix missing mind-elixir 2024-09-01 17:24:44 +03:00
Jin
2fec1b79af remove codemirror and autocomplete libraries 2024-08-15 20:48:14 +02:00
Jin
b5e8fcaf57 fix eslint module 2024-08-11 10:13:01 +02:00
Jin
0967ee1b46 remove fancytree and bootstrap 2024-08-11 10:13:01 +02:00
Jin
c16c528270 fix electron import 2024-08-11 10:13:01 +02:00
Elian Doran
e5cdccc066
build: Make copy-dist silent 2024-07-27 16:42:47 +03:00
Elian Doran
25db092b41
electron: Fix crash due to missing i18next 2024-07-24 21:04:20 +03:00
Elian Doran
595402adea
dev: Fix npm start-electron script 2024-07-14 13:03:06 +03:00
alexpietsch
d2604e91d4 feat: add ts script for cross plattform use 2024-05-01 00:05:24 +02:00