Skip to content

Commit

Permalink
Merge branch 'develop' into feature/llm-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectra1n committed Dec 28, 2024
2 parents 294fc05 + 62696a4 commit 1de2407
Show file tree
Hide file tree
Showing 328 changed files with 7,468 additions and 4,478 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.{js,ts}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/package-lock.json linguist-generated=true
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"lokalise.i18n-ally"
"lokalise.i18n-ally",
"editorconfig.editorconfig"
]
}
26 changes: 26 additions & 0 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Place your Notes workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }

"JQuery HTMLElement field": {
"scope": "typescript",
"prefix": "jqf",
"body": [
"private $${1:name}!: JQuery<HTMLElement>;"
]
}
}
13 changes: 8 additions & 5 deletions _check_ts_progress.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env bash

cd src/public
echo Summary
cloc HEAD \
--git --md \
--include-lang=javascript,typescript \
--found=filelist.txt \
--exclude-dir=public,libraries,views,docs
--include-lang=javascript,typescript

grep -R \.js$ filelist.txt
rm filelist.txt
echo By file
cloc HEAD \
--git --md \
--include-lang=javascript,typescript \
--by-file | grep \.js\|
10 changes: 5 additions & 5 deletions bin/copy-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ async function copyNodeModuleFileOrFolder(source: string) {
}

const copy = async () => {
for (const srcFile of fs.readdirSync("build")) {
for (const srcFile of fs.readdirSync("build")) {
const destFile = path.join(DEST_DIR, path.basename(srcFile));
log(`Copying source ${srcFile} -> ${destFile}.`);
fs.copySync(path.join("build", srcFile), destFile, { recursive: true });
}

const filesToCopy = ["config-sample.ini"];
const filesToCopy = ["config-sample.ini", "tsconfig.webpack.json"];
for (const file of filesToCopy) {
log(`Copying ${file}`);
await fs.copy(file, path.join(DEST_DIR, file));
Expand All @@ -45,11 +45,11 @@ const copy = async () => {
for (const dir of srcDirsToCopy) {
log(`Copying ${dir}`);
await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir)));
}
}

/**
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
*/
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
*/
const publicDirsToCopy = [ "./src/public/app/doc_notes" ];
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
for (const dir of publicDirsToCopy) {
Expand Down
2 changes: 1 addition & 1 deletion bin/copy-trilium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cp -R "$script_dir/../build/src" "$DIR"
cp "$script_dir/../build/electron-main.js" "$DIR"

# run in subshell (so we return to original dir)
(cd $DIR && npm install --omit=dev)
(cd $DIR && npm install --omit=dev --legacy-peer-deps)

if [[ -d "$DIR"/node_modules ]]; then
# cleanup of useless files in dependencies
Expand Down
2 changes: 1 addition & 1 deletion bin/update-build-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export default {
};
`;

fs.writeFileSync("src/services/build.ts", output);
fs.writeFileSync("src/services/build.ts", output);
10 changes: 5 additions & 5 deletions bin/update-nightly-version.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* @module
*
*
* The nightly version works uses the version described in `package.json`, just like any release.
* The problem with this approach is that production builds have a very aggressive cache, and
* usually running the nightly with this cached version of the application will mean that the
* user might run into module not found errors or styling errors caused by an old cache.
*
*
* This script is supposed to be run in the CI, which will update locally the version field of
* `package.json` to contain the date. For example, `0.90.9-beta` will become `0.90.9-test-YYMMDD-HHMMSS`.
*
*
*/

import { fileURLToPath } from "url";
Expand All @@ -33,7 +33,7 @@ function processVersion(version) {
function main() {
const scriptDir = dirname(fileURLToPath(import.meta.url));
const packageJsonPath = join(scriptDir, "..", "package.json");

// Read the version from package.json and process it.
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
const currentVersion = packageJson.version;
Expand All @@ -43,7 +43,7 @@ function main() {

// Write the adjusted version back in.
packageJson.version = adjustedVersion;
const formattedJson = JSON.stringify(packageJson, null, 4);
const formattedJson = JSON.stringify(packageJson, null, 4);
fs.writeFileSync(packageJsonPath, formattedJson);
}

Expand Down
2 changes: 1 addition & 1 deletion bin/watch-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ const sourceDir = "src/public";
chokidar
.watch(sourceDir)
.on("change", onFileChanged);
console.log(`Watching for changes to ${sourceDir}...`);
console.log(`Watching for changes to ${sourceDir}...`);
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ services:
ports:
# By default, Trilium will be available at http://localhost:8080
# It will also be accessible at http://<host-ip>:8080
# You might want to limit this with something like Docker Networks, reverse proxies, or firewall rules, such as UFW
# You might want to limit this with something like Docker Networks, reverse proxies, or firewall rules,
# however be aware that using UFW is known to not work with default Docker installations, see:
# https://docs.docker.com/engine/network/packet-filtering-firewalls/#docker-and-ufw
- '8080:8080'
volumes:
# Unless TRILIUM_DATA_DIR is set, the data will be stored in the "trilium-data" directory in the home directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/BasicWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/FAttachment.html
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/FAttribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/FBranch.html
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/FNote.html
Original file line number Diff line number Diff line change
Expand Up @@ -8806,7 +8806,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/FrontendScriptApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -8730,7 +8730,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/NoteContextAwareWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/RightPanelWidget.html
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/entities_fattachment.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/entities_fattribute.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/entities_fblob.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/entities_fbranch.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/entities_fnote.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/services_frontend_script_api.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/widgets_basic_widget.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontend_api/widgets_right_panel_widget.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidg
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion electron-main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { initializeTranslations } from "./src/services/i18n.js";

await initializeTranslations();
await import("./electron.js")
await import("./electron.js")
6 changes: 3 additions & 3 deletions electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ electron.app.on("ready", async () => {
await windowService.createMainWindow(electron.app);

if (process.platform === "darwin") {
electron.app.on("activate", async () => {
electron.app.on("activate", async () => {
if (electron.BrowserWindow.getAllWindows().length === 0) {
await windowService.createMainWindow(electron.app);
await windowService.createMainWindow(electron.app);
}
});
});
}

tray.createTray();
Expand Down
2 changes: 1 addition & 1 deletion images/icon-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/icon-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/icon-purple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/icon-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1de2407

Please sign in to comment.