chore(edidt-docs): fix entrypoint partially

This commit is contained in:
Elian Doran 2025-04-30 22:17:31 +03:00
parent 52d6efedff
commit e314372fbd
No known key found for this signature in database
6 changed files with 42 additions and 14 deletions

View File

@ -1,2 +1,2 @@
TRILIUM_PORT=37741
TRILIUM_DATA_DIR=./apps/desktop/data
TRILIUM_DATA_DIR=../data

View File

@ -53,10 +53,10 @@
"cache": true,
"configurations": {
"default": {
"command": "electron-rebuild {projectRoot}/dist/main.js -m {projectRoot}/dist"
"command": "electron-rebuild -f {projectRoot}/dist/main.js -m {projectRoot}/dist"
},
"nixos": {
"command": "electron-rebuild -v $(nix-shell -p electron_35 --run \"electron --version\") ${projectRoot}/dist/main.js -m ${projectRoot}/dist"
"command": "electron-rebuild -f -v $(nix-shell -p electron_35 --run \"electron --version\") ${projectRoot}/dist/main.js -m ${projectRoot}/dist"
}
}
},

View File

@ -2,3 +2,7 @@ TRILIUM_DATA_DIR=../data
TRILIUM_ENV=dev
TRILIUM_INTEGRATION_TEST=memory-no-store
TRILIUM_PORT=37741
# Paths are relative to dist root
DOCS_ROOT=../../../docs
USER_GUIDE_ROOT=../../../apps/server/src/public/app/doc_notes

View File

@ -3,10 +3,12 @@
"version": "0.0.1",
"private": true,
"devDependencies": {
"@electron/rebuild": "3.7.2",
"@triliumnext/client": "workspace:*",
"@triliumnext/desktop": "workspace:*",
"@types/fs-extra": "11.0.4",
"copy-webpack-plugin": "13.0.0",
"electron": "35.1.5",
"fs-extra": "11.3.0"
},
"nx": {
@ -21,10 +23,12 @@
"cache": true,
"configurations": {
"default": {
"command": "electron-rebuild -f {projectRoot}/dist/main.js -m {projectRoot}/dist"
"command": "electron-rebuild",
"cwd": "{projectRoot}/dist"
},
"nixos": {
"command": "electron-rebuild -f -v $(nix-shell -p electron_35 --run \"electron --version\") ${projectRoot}/dist/main.js -m ${projectRoot}/dist"
"command": "electron-rebuild -v $(nix-shell -p electron_35 --run \"electron --version\")",
"cwd": "{projectRoot}/dist"
}
}
},
@ -37,15 +41,18 @@
"configurations": {
"default": {
"command": "electron .",
"cwd": "{projectRoot}/dist"
"cwd": "./apps/edit-docs/dist"
},
"nixos": {
"command": "nix-shell -p electron_35 --run \"electron {projectRoot}/dist/main.js\"",
"cwd": ".",
"forwardAllArgs": false
"command": "nix-shell -p electron_35 --run \"electron .\"",
"forwardAllArgs": false,
"cwd": "./apps/edit-docs/dist"
}
}
}
}
},
"dependencies": {
"archiver": "7.0.1"
}
}

View File

@ -12,6 +12,7 @@ import type { AdvancedExportOptions } from "@triliumnext/server/src/services/exp
import TaskContext from "@triliumnext/server/src/services/task_context.js";
import { deferred } from "@triliumnext/server/src/services/utils.js";
import { parseNoteMetaFile } from "@triliumnext/server/src/services/in_app_help.js";
import { resolve } from "path";
interface NoteMapping {
rootNoteId: string;
@ -21,27 +22,32 @@ interface NoteMapping {
exportOnly?: boolean;
}
const { DOCS_ROOT, USER_GUIDE_ROOT } = process.env;
if (!DOCS_ROOT || !USER_GUIDE_ROOT) {
throw new Error("Missing DOCS_ROOT or USER_GUIDE_ROOT environment variable.");
}
const NOTE_MAPPINGS: NoteMapping[] = [
{
rootNoteId: "pOsGYCXsbNQG",
path: path.join("docs", "User Guide"),
path: path.join(DOCS_ROOT, "User Guide"),
format: "markdown"
},
{
rootNoteId: "pOsGYCXsbNQG",
path: path.join("src", "public", "app", "doc_notes", "en", "User Guide"),
path: USER_GUIDE_ROOT,
format: "html",
ignoredFiles: ["index.html", "navigation.html", "style.css", "User Guide.html"],
exportOnly: true
},
{
rootNoteId: "jdjRLhLV3TtI",
path: path.join("docs", "Developer Guide"),
path: path.join(DOCS_ROOT, "Developer Guide"),
format: "markdown"
},
{
rootNoteId: "hD3V4hiu2VW4",
path: path.join("docs", "Release Notes"),
path: path.join(DOCS_ROOT, "Release Notes"),
format: "markdown"
}
];
@ -96,6 +102,7 @@ async function createImportZip(path: string) {
zlib: { level: 0 }
});
console.log("Archive path is ", resolve(path))
archive.directory(path, "/");
const outputStream = fsExtra.createWriteStream(inputFile);

10
pnpm-lock.yaml generated
View File

@ -386,7 +386,14 @@ importers:
version: 17.0.33
apps/edit-docs:
dependencies:
archiver:
specifier: 7.0.1
version: 7.0.1
devDependencies:
'@electron/rebuild':
specifier: 3.7.2
version: 3.7.2
'@triliumnext/client':
specifier: workspace:*
version: link:../client
@ -399,6 +406,9 @@ importers:
copy-webpack-plugin:
specifier: 13.0.0
version: 13.0.0(webpack@5.99.6(@swc/core@1.5.29(@swc/helpers@0.5.17))(esbuild@0.19.12)(webpack-cli@5.1.4))
electron:
specifier: 35.1.5
version: 35.1.5
fs-extra:
specifier: 11.3.0
version: 11.3.0