Skip to content

Commit

Permalink
chore: update nx
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed Apr 25, 2024
1 parent b7ba469 commit 3079eb8
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 256 deletions.
3 changes: 3 additions & 0 deletions apps/nxls-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"targets": {
"test": {
"command": "jest --detectOpenHandles --runInBand --verbose",
"options": {
"cwd": "apps/nxls-e2e"
},
"dependsOn": [
{
"projects": "nxls",
Expand Down
3 changes: 2 additions & 1 deletion apps/nxls/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"@parcel/watcher",
"@nx/nx*",
"webpack",
"fsevents"
"fsevents",
"nx"
],
"target": "es2020",
"outputFileName": "main.js",
Expand Down
6 changes: 4 additions & 2 deletions apps/vscode/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"fsevents",
"ts-node",
"pnpapi",
"@angular-devkit/*"
"@angular-devkit/*",
"nx"
],
"bundle": true,
"thirdParty": true,
Expand Down Expand Up @@ -106,7 +107,8 @@
"pnpapi",
"webpack",
"@angular-devkit/*",
"@nx/nx*"
"@nx/nx*",
"nx"
],
"thirdParty": true,
"minify": true,
Expand Down
20 changes: 17 additions & 3 deletions libs/language-server/watcher/src/lib/native-watcher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { WatchEvent, Watcher } from 'nx/src/native';
import { lspLogger } from '@nx-console/language-server/utils';
import { normalize } from 'path';
import { workspaceDependencyPath } from '@nx-console/shared/npm';
import { join, normalize } from 'path';
import { match as minimatch } from 'minimatch';

const NX_PLUGIN_PATTERNS_TO_WATCH = [
Expand Down Expand Up @@ -35,10 +36,23 @@ export class NativeWatcher {
}

private async initWatcher() {
const native = await import('nx/src/native');
const nxWorkspaceDepPath = await workspaceDependencyPath(
this.workspacePath,
'nx'
);
if (!nxWorkspaceDepPath) {
lspLogger.log(
'Could not find the "nx" package. Native watcher will not be used. Make sure to install the workspace dependencies.'
);
return;
}

const native = await import(
join(nxWorkspaceDepPath, 'src/native/index.js')
);
this.watcher = new native.Watcher(this.workspacePath);

this.watcher.watch((err: string | null, events: WatchEvent[]) => {
this.watcher!.watch((err: string | null, events: WatchEvent[]) => {
if (err) {
lspLogger.log('Error watching files: ' + err);
} else if (
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@
"@angular/platform-browser": "17.3.1",
"@angular/platform-browser-dynamic": "17.3.1",
"@babel/core": "7.21.0",
"@nx/angular": "18.2.1",
"@nx/cypress": "18.2.1",
"@nx/devkit": "18.2.1",
"@nx/esbuild": "18.2.1",
"@nx/eslint": "18.2.1",
"@nx/eslint-plugin": "18.2.1",
"@nx/gradle": "18.2.1",
"@nx/jest": "18.2.1",
"@nx/js": "18.2.1",
"@nx/node": "18.2.1",
"@nx/storybook": "18.2.1",
"@nx/web": "18.2.1",
"@nx/webpack": "18.2.1",
"@nx/workspace": "18.2.1",
"@nx/angular": "19.0.0-beta.5",
"@nx/cypress": "19.0.0-beta.5",
"@nx/devkit": "19.0.0-beta.5",
"@nx/esbuild": "19.0.0-beta.5",
"@nx/eslint": "19.0.0-beta.5",
"@nx/eslint-plugin": "19.0.0-beta.5",
"@nx/gradle": "19.0.0-beta.5",
"@nx/jest": "19.0.0-beta.5",
"@nx/js": "19.0.0-beta.5",
"@nx/node": "19.0.0-beta.5",
"@nx/storybook": "19.0.0-beta.5",
"@nx/web": "19.0.0-beta.5",
"@nx/webpack": "19.0.0-beta.5",
"@nx/workspace": "19.0.0-beta.5",
"@schematics/angular": "17.3.1",
"@storybook/addon-essentials": "7.5.3",
"@storybook/addon-knobs": "~7.0.2",
Expand Down Expand Up @@ -125,7 +125,7 @@
"jest-preset-angular": "14.0.3",
"memfs": "^3.4.7",
"mocha": "^10.0.0",
"nx": "18.2.1",
"nx": "19.0.0-beta.5",
"ovsx": "^0.7.1",
"prettier": "2.7.1",
"prettier-plugin-tailwindcss": "^0.3.0",
Expand Down
Loading

0 comments on commit 3079eb8

Please sign in to comment.