Skip to content

Build your personal knowledge base with Trilium Notes

fix(nx): patch asset copying to ignore .gitignore

Elian Doran86dc3762b675
diff --git a/package.json b/package.json
index e455784660..b685aa1e38 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/patches/@nx__js.patch b/patches/@nx__js.patch
new file mode 100644
index 0000000000..eb9a069f5e
--- /dev/null
+++ b/patches/@nx__js.patch
@@ -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;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b8efdbdc30..56c4959d34 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -24,6 +24,9 @@ patchedDependencies:
'@ckeditor/ckeditor5-mention':
hash: 5981fb59ba35829e4dff1d39cf771000f8a8fdfa7a34b51d8af9549541f2d62d
path: patches/@ckeditor__ckeditor5-mention.patch
+ '@nx/js':
+ hash: 7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7
+ path: patches/@nx__js.patch
ckeditor5:
hash: 8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41
path: patches/ckeditor5.patch
@@ -52,7 +55,7 @@ importers:
'@nx/js':
specifier: 21.2.0
+ version: 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
'@nx/node':
specifier: 21.2.0
@@ -16850,7 +16853,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
picocolors: 1.1.1
tinyglobby: 0.2.14
tsconfig-paths: 4.2.0
@@ -16869,7 +16872,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
'@typescript-eslint/parser': 8.34.0([email protected]([email protected]))([email protected])
'@typescript-eslint/type-utils': 8.34.0([email protected]([email protected]))([email protected])
'@typescript-eslint/utils': 8.34.0([email protected]([email protected]))([email protected])
@@ -16895,7 +16898,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
eslint: 9.29.0([email protected])
semver: 7.7.2
tslib: 2.8.1
@@ -16914,7 +16917,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
tslib: 2.8.1
optionalDependencies:
@@ -16940,7 +16943,7 @@ snapshots:
'@jest/reporters': 29.7.0
'@jest/test-result': 29.7.0
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
'@phenomnomnominal/tsquery': 5.0.1([email protected])
identity-obj-proxy: 3.0.0
@@ -16966,7 +16969,7 @@ snapshots:
- typescript
- verdaccio
dependencies:
'@babel/core': 7.26.10
'@babel/plugin-proposal-decorators': 7.25.9(@babel/[email protected])
@@ -17010,7 +17013,7 @@ snapshots:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
kill-port: 1.6.1
tcp-port-used: 1.0.2
tslib: 2.8.1
@@ -17064,7 +17067,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
'@phenomnomnominal/tsquery': 5.0.1([email protected])
minimatch: 9.0.3
tslib: 2.8.1
@@ -17085,7 +17088,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
'@phenomnomnominal/tsquery': 5.0.1([email protected])
'@swc/helpers': 0.5.17
ajv: 8.17.1
@@ -17108,7 +17111,7 @@ snapshots:
dependencies:
+ '@nx/js': 21.2.0(patch_hash=7201af3a8fb4840b046e4e18cc2758fa67ee3d0cf11d0783869dc828cfc79fc7)(@babel/[email protected])(@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected]))([email protected](@swc-node/[email protected](@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected]))(@swc/[email protected](@swc/[email protected])))
detect-port: 1.6.1
http-server: 14.1.1
picocolors: 1.1.1