Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- uses: nrwl/nx-set-shas@v4
- name: Check affected
run: pnpm nx affected --verbose -t typecheck build rebuild-deps
run: pnpm nx affected --verbose -t typecheck build rebuild-deps test-build

test_dev:
name: Test development
Expand Down
7 changes: 1 addition & 6 deletions .nxignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
_regroup
_regroup_monorepo

# Asset copying respects .gitignore / .nxignore for some reason.
# See https://github.com/nrwl/nx/issues/20309
!dist
!node_modules
_regroup_monorepo
6 changes: 6 additions & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@
}
]
}
},
"test-build": {
"dependsOn": [
"build"
],
"command": "vitest --config {projectRoot}/vitest.build.config.mts"
}
}
},
Expand Down
46 changes: 46 additions & 0 deletions apps/server/spec/build-checks/artifacts.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { globSync } from "fs";
import { join } from "path";
import { it, describe, expect } from "vitest";

describe("Check artifacts are present", () => {
const distPath = join(__dirname, "../../dist");

it("has the necessary node modules", async () => {
const paths = [
"node_modules/better-sqlite3",
"node_modules/bindings",
"node_modules/file-uri-to-path"
];

ensurePathsExist(paths);
});

it("includes the client", async () => {
const paths = [
"public/assets",
"public/fonts",
"public/node_modules",
"public/src",
"public/stylesheets",
"public/translations"
];

ensurePathsExist(paths);
});

it("includes necessary assets", async () => {
const paths = [
"assets",
"share-theme"
];

ensurePathsExist(paths);
});

function ensurePathsExist(paths: string[]) {
for (const path of paths) {
const result = globSync(join(distPath, path, "**"));
expect(result, path).not.toHaveLength(0);
}
}
});
4 changes: 3 additions & 1 deletion apps/server/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default defineConfig(() => ({
setupFiles: ["./spec/setup.ts"],
environment: "node",
include: ['{src,spec}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
"spec/build-checks/**",
],
reporters: [
"verbose"
],
Expand All @@ -19,7 +22,6 @@ export default defineConfig(() => ({
provider: 'v8' as const,
reporter: [ "text", "html" ]
},
fileParallelism: false,
pool: "threads"
},
}));
18 changes: 18 additions & 0 deletions apps/server/vitest.build.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';

export default defineConfig(() => ({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/server',
plugins: [],
test: {
watch: false,
globals: true,
setupFiles: ["./spec/setup.ts"],
environment: "node",
include: ['spec/build-checks/**'],
reporters: [
"verbose"
]
},
}));
7 changes: 7 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@
},
"dependencies": {
"@inlang/paraglide-js": "^2.0.0"
},
"nx": {
"typecheck": {
"dependsOn": [
"build"
]
}
}
}
21 changes: 18 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"patchedDependencies": {
"@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch",
"@ckeditor/ckeditor5-code-block": "patches/@ckeditor__ckeditor5-code-block.patch",
"ckeditor5": "patches/ckeditor5.patch"
"ckeditor5": "patches/ckeditor5.patch",
"@nx/js": "patches/@nx__js.patch"
},
"overrides": {
"node-abi": "4.9.0",
Expand All @@ -99,11 +100,25 @@
"dompurify@<3.2.4": ">=3.2.4",
"esbuild@<=0.24.2": ">=0.25.0"
},
"ignoredBuiltDependencies": [
"sqlite3"
],
"onlyBuiltDependencies": [
"esbuild"
"@parcel/watcher",
"@scarf/scarf",
"better-sqlite3",
"bufferutil",
"core-js-pure",
"electron",
"electron-winstaller",
"esbuild",
"fs-xattr",
"macos-alias",
"nx",
"utf-8-validate"
]
},
"nx": {
"name": "triliumnext"
}
}
}
17 changes: 17 additions & 0 deletions patches/@nx__js.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/utils/assets/copy-assets-handler.js b/src/utils/assets/copy-assets-handler.js
index 6b68205d833ce9e8277283ac31230c020d2921ec..2f0a7f018b03eae3b8f3ce1a4cf4790aaafed677 100644
--- a/src/utils/assets/copy-assets-handler.js
+++ b/src/utils/assets/copy-assets-handler.js
@@ -39,12 +39,6 @@ class CopyAssetsHandler {
this.callback = opts.callback ?? exports.defaultFileEventHandler;
// TODO(jack): Should handle nested .gitignore files
this.ignore = (0, ignore_1.default)();
- const gitignore = pathPosix.join(opts.rootDir, '.gitignore');
- const nxignore = pathPosix.join(opts.rootDir, '.nxignore');
- if ((0, node_fs_1.existsSync)(gitignore))
- this.ignore.add((0, node_fs_1.readFileSync)(gitignore).toString());
- if ((0, node_fs_1.existsSync)(nxignore))
- this.ignore.add((0, node_fs_1.readFileSync)(nxignore).toString());
this.assetGlobs = opts.assets.map((f) => {
let isGlob = false;
let pattern;
Loading
Loading