diff --git a/apps/vscode/src/main.ts b/apps/vscode/src/main.ts index 27550cd3cc..657e13dc37 100644 --- a/apps/vscode/src/main.ts +++ b/apps/vscode/src/main.ts @@ -54,7 +54,6 @@ import { } from '@nx-console/vscode/json-schema'; import { enableTypeScriptPlugin } from '@nx-console/typescript-plugin'; import { NxConversion } from '@nx-console/vscode/nx-conversion'; -import { nxVersion } from '@nx-console/vscode/nx-workspace'; let runTargetTreeView: TreeView; let nxProjectTreeView: TreeView; @@ -113,7 +112,13 @@ export async function activate(c: ExtensionContext) { context.subscriptions.push( runTargetTreeView, revealWebViewPanelCommand, - manuallySelectWorkspaceDefinitionCommand + manuallySelectWorkspaceDefinitionCommand, + commands.registerCommand('nxConsole.refreshWorkspace', async () => { + const { nxWorkspace } = await import('@nx-console/vscode/nx-workspace'); + nxWorkspace(true); + commands.executeCommand('nxConsole.refreshNxProjectsTree'); + commands.executeCommand('nxConsole.refreshRunTargetTree'); + }) ); // registers itself as a CodeLensProvider and watches config to dispose/re-register @@ -269,6 +274,9 @@ async function setWorkspace(workspacePath: string) { } else if (!isNxWorkspace && isAngularWorkspace) { workspaceType = 'angular'; } + + const { nxVersion } = await import('@nx-console/vscode/nx-workspace'); + WorkspaceConfigurationStore.instance.set('workspaceType', workspaceType); WorkspaceConfigurationStore.instance.set('nxVersion', await nxVersion()); @@ -330,10 +338,12 @@ function registerWorkspaceFileWatcher( const workspaceDir = dirname(workspaceJsonPath); workspaceFileWatcher = watchFile( - new RelativePattern(workspaceDir, '**/{workspace,angular,project}.json'), + new RelativePattern( + workspaceDir, + '**/{workspace,angular,project,nx,package}.json' + ), () => { - commands.executeCommand('nxConsole.refreshNxProjectsTree'); - commands.executeCommand('nxConsole.refreshRunTargetTree'); + commands.executeCommand('nxConsole.refreshWorkspace'); } ); diff --git a/apps/vscode/src/package.json b/apps/vscode/src/package.json index 2975e06806..c87cf1090a 100644 --- a/apps/vscode/src/package.json +++ b/apps/vscode/src/package.json @@ -97,9 +97,14 @@ ], "view/title": [ { - "command": "nxConsole.refreshNxProjectsTree", + "command": "nxConsole.refreshWorkspace", "when": "view == nxProjects", "group": "navigation" + }, + { + "command": "nxConsole.refreshWorkspace", + "when": "view == nxRunTarget", + "group": "navigation" } ], "view/item/context": [ @@ -328,8 +333,8 @@ }, "commands": [ { - "command": "nxConsole.refreshNxProjectsTree", - "title": "Refresh Projects", + "command": "nxConsole.refreshWorkspace", + "title": "Refresh Workspace", "category": "Nx", "icon": "$(refresh)" }, diff --git a/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.ts b/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.ts index b672cae82c..219a9ba793 100644 --- a/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.ts +++ b/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.ts @@ -19,11 +19,18 @@ import { switchMap, startWith, scan, - debounceTime, + debounce, filter, shareReplay, } from 'rxjs/operators'; -import { BehaviorSubject, Observable, fromEvent, merge, of } from 'rxjs'; +import { + BehaviorSubject, + Observable, + fromEvent, + merge, + of, + interval, +} from 'rxjs'; import { Option } from '@nx-console/schema'; import { getOptionItems } from '../field-items/field-items.pipe'; @@ -90,7 +97,11 @@ export class AutocompleteComponent implements OnInit, ControlValueAccessor { fromEvent(this._elementRef.nativeElement, 'focusout').pipe( map(() => false) ) - ).pipe(startWith(false), debounceTime(300), shareReplay(1)); + ).pipe( + startWith(false), + debounce(() => interval(300)), + shareReplay(1) + ); this.visibleOptions = this._options$.pipe( switchMap((options) => diff --git a/libs/vscode/json-schema/src/lib/project-json-schema.ts b/libs/vscode/json-schema/src/lib/project-json-schema.ts index 339f1c0af8..0b2bf4d8ef 100644 --- a/libs/vscode/json-schema/src/lib/project-json-schema.ts +++ b/libs/vscode/json-schema/src/lib/project-json-schema.ts @@ -1,7 +1,7 @@ import { CollectionInfo } from '@nx-console/schema'; import { getExecutors, watchFile } from '@nx-console/server'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; -import { verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { join } from 'path'; import * as vscode from 'vscode'; @@ -36,7 +36,7 @@ export class ProjectJsonSchema { clearPackageJsonCache = false ) { const filePath = vscode.Uri.joinPath(extensionUri, 'project-schema.json'); - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const collections = await getExecutors( workspacePath, json.projects, diff --git a/libs/vscode/json-schema/src/lib/workspace-json-schema.ts b/libs/vscode/json-schema/src/lib/workspace-json-schema.ts index 8950e7eeaa..1c3a5a8ad2 100644 --- a/libs/vscode/json-schema/src/lib/workspace-json-schema.ts +++ b/libs/vscode/json-schema/src/lib/workspace-json-schema.ts @@ -1,7 +1,7 @@ import { CollectionInfo } from '@nx-console/schema'; import { getExecutors, watchFile } from '@nx-console/server'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; -import { verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { dirname, join } from 'path'; import * as vscode from 'vscode'; @@ -36,7 +36,7 @@ export class WorkspaceJsonSchema { clearPackageJsonCache = false ) { const filePath = vscode.Uri.joinPath(extensionUri, 'workspace-schema.json'); - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const collections = await getExecutors( workspacePath, json.projects, diff --git a/libs/vscode/nx-project-view/src/lib/nx-project-tree-provider.ts b/libs/vscode/nx-project-view/src/lib/nx-project-tree-provider.ts index fceae2dede..132575da34 100644 --- a/libs/vscode/nx-project-view/src/lib/nx-project-tree-provider.ts +++ b/libs/vscode/nx-project-view/src/lib/nx-project-tree-provider.ts @@ -193,12 +193,6 @@ export class NxProjectTreeProvider extends AbstractTreeProvider { - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const commands = Object.values(json.projects).reduce((acc, project) => { for (const target of Object.keys(project.targets ?? {})) { acc.add(target); diff --git a/libs/vscode/nx-run-target-view/src/lib/run-target-tree-provider.ts b/libs/vscode/nx-run-target-view/src/lib/run-target-tree-provider.ts index 13fe03e698..ea1030b3b3 100644 --- a/libs/vscode/nx-run-target-view/src/lib/run-target-tree-provider.ts +++ b/libs/vscode/nx-run-target-view/src/lib/run-target-tree-provider.ts @@ -86,12 +86,6 @@ export class RunTargetTreeProvider extends AbstractTreeProvider< } private refreshRunTargetTree = async () => { - const workspacePath = WorkspaceConfigurationStore.instance.get( - 'nxWorkspacePath', - '' - ); - clearJsonCache(workspacePath); - this.refresh(); }; } diff --git a/libs/vscode/nx-workspace/src/index.ts b/libs/vscode/nx-workspace/src/index.ts index ba0baca1d9..a3f9375dda 100644 --- a/libs/vscode/nx-workspace/src/index.ts +++ b/libs/vscode/nx-workspace/src/index.ts @@ -1,7 +1,7 @@ export * from './lib/find-workspace-json-target'; export * from './lib/reveal-workspace-json'; export * from './lib/workspace-codelens-provider'; -export * from './lib/verify-workspace'; +export * from './lib/nx-workspace'; export * from './lib/get-nx-config'; export * from './lib/get-nx-workspace-config'; export * from './lib/nx-version'; diff --git a/libs/vscode/nx-workspace/src/lib/get-nx-config.ts b/libs/vscode/nx-workspace/src/lib/get-nx-config.ts index 27c5b52401..e1025f2794 100644 --- a/libs/vscode/nx-workspace/src/lib/get-nx-config.ts +++ b/libs/vscode/nx-workspace/src/lib/get-nx-config.ts @@ -1,5 +1,5 @@ import { cacheJson, readAndCacheJsonFile } from '@nx-console/server'; -import { NxJsonConfiguration } from '@nrwl/devkit'; +import type { NxJsonConfiguration } from '@nrwl/devkit'; import { join } from 'path'; import { getNxWorkspacePackageFileUtils } from './get-nx-workspace-package'; import { stat } from 'fs/promises'; diff --git a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts index 9978bf5082..0050c8611d 100644 --- a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts +++ b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-config.ts @@ -1,4 +1,4 @@ -import { +import type { NxJsonConfiguration, WorkspaceJsonConfiguration, ProjectGraph, @@ -61,21 +61,9 @@ export async function getNxWorkspaceConfig( } if (version < 13) { - projectGraph = (nxProjectGraph as any).readCurrentProjectGraph(); + projectGraph = (nxProjectGraph as any).createProjectGraph(); } else { - projectGraph = nxProjectGraph.readCachedProjectGraph(); - } - - // Projects can become out of sync if we don't use Nx directly to create projects. This is the case for package.json projects - if ( - !projectGraph || - projectsOutOfSync(workspaceConfiguration, projectGraph) - ) { - if (version < 13) { - projectGraph = (nxProjectGraph as any).createProjectGraph(); - } else { - projectGraph = await nxProjectGraph.createProjectGraphAsync(); - } + projectGraph = await nxProjectGraph.createProjectGraphAsync(); } } catch { //noop @@ -150,12 +138,3 @@ function addProjectTargets( } } } - -function projectsOutOfSync( - workspaceConfiguration: WorkspaceJsonConfiguration, - projectGraph: ProjectGraph -): boolean { - const workspaceProjects = Object.keys(workspaceConfiguration.projects); - const projectGraphProjects = Object.keys(projectGraph.nodes); - return workspaceProjects.length != projectGraphProjects.length; -} diff --git a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-package.ts b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-package.ts index ed4bff7c4c..a69d1f8244 100644 --- a/libs/vscode/nx-workspace/src/lib/get-nx-workspace-package.ts +++ b/libs/vscode/nx-workspace/src/lib/get-nx-workspace-package.ts @@ -1,8 +1,8 @@ import { workspaceDependencyPath } from '@nx-console/npm'; import { fileExists, getOutputChannel } from '@nx-console/server'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; -import * as NxFileUtils from 'nx/src/project-graph/file-utils'; -import * as NxProjectGraph from 'nx/src/project-graph/project-graph'; +import type * as NxFileUtils from 'nx/src/project-graph/file-utils'; +import type * as NxProjectGraph from 'nx/src/project-graph/project-graph'; import { platform } from 'os'; import { join } from 'path'; @@ -32,7 +32,8 @@ export async function getNxProjectGraph(): Promise { ); } - return getNxPackage(importPath, NxProjectGraph, RESOLVED_PROJECTGRAPH_IMPORT); + const nxProjectGraph = await import('nx/src/project-graph/project-graph'); + return getNxPackage(importPath, nxProjectGraph, RESOLVED_PROJECTGRAPH_IMPORT); } /** @@ -62,7 +63,8 @@ export async function getNxWorkspacePackageFileUtils(): Promise< ); } - return getNxPackage(importPath, NxFileUtils, RESOLVED_FILEUTILS_IMPORT); + const nxFileUtils = await import('nx/src/project-graph/file-utils'); + return getNxPackage(importPath, nxFileUtils, RESOLVED_FILEUTILS_IMPORT); } async function getNxPackage( diff --git a/libs/vscode/nx-workspace/src/lib/verify-workspace.spec.ts b/libs/vscode/nx-workspace/src/lib/nx-workspace.spec.ts similarity index 94% rename from libs/vscode/nx-workspace/src/lib/verify-workspace.spec.ts rename to libs/vscode/nx-workspace/src/lib/nx-workspace.spec.ts index a5c78b8e5a..105caaef75 100644 --- a/libs/vscode/nx-workspace/src/lib/verify-workspace.spec.ts +++ b/libs/vscode/nx-workspace/src/lib/nx-workspace.spec.ts @@ -1,12 +1,7 @@ -import { verifyWorkspace } from './verify-workspace'; +import { nxWorkspace } from './nx-workspace'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; import * as server from '@nx-console/server'; -import { - cacheJson, - getOutputChannel, - getTelemetry, - fileExists, -} from '@nx-console/server'; +import { getOutputChannel, getTelemetry, fileExists } from '@nx-console/server'; import { mocked } from 'ts-jest/utils'; import type { NxJsonConfiguration, @@ -85,7 +80,7 @@ xdescribe('verifyWorkspace', () => { // act const { validWorkspaceJson, json, workspaceType, configurationFilePath } = - await verifyWorkspace(); + await nxWorkspace(); // assert expect(mockStoreInstanceGetFn).toHaveBeenCalledWith( @@ -113,7 +108,7 @@ xdescribe('verifyWorkspace', () => { }); // act const { validWorkspaceJson, json, workspaceType, configurationFilePath } = - await verifyWorkspace(); + await nxWorkspace(); // assert expect(mockStoreInstanceGetFn).toHaveBeenCalledWith( @@ -138,7 +133,7 @@ xdescribe('verifyWorkspace', () => { .mockResolvedValue('Show Error'); // act - const result = await verifyWorkspace(); + const result = await nxWorkspace(); // assert @@ -171,7 +166,7 @@ xdescribe('verifyWorkspace', () => { // act const { json: { projects }, - } = await verifyWorkspace(); + } = await nxWorkspace(); const [project1, project2, project3] = Object.keys(projects); const [sorted1, sorted2, sorted3] = Object.keys(sortedProject); diff --git a/libs/vscode/nx-workspace/src/lib/verify-workspace.ts b/libs/vscode/nx-workspace/src/lib/nx-workspace.ts similarity index 63% rename from libs/vscode/nx-workspace/src/lib/verify-workspace.ts rename to libs/vscode/nx-workspace/src/lib/nx-workspace.ts index 80e53b9648..454fa0b933 100644 --- a/libs/vscode/nx-workspace/src/lib/verify-workspace.ts +++ b/libs/vscode/nx-workspace/src/lib/nx-workspace.ts @@ -1,18 +1,26 @@ -import { NxJsonConfiguration, WorkspaceJsonConfiguration } from '@nrwl/devkit'; +import type { + NxJsonConfiguration, + WorkspaceJsonConfiguration, +} from '@nrwl/devkit'; import { fileExists, getOutputChannel, getTelemetry, - readAndCacheJsonFile, toWorkspaceFormat, } from '@nx-console/server'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; import { join } from 'path'; -import { window } from 'vscode'; import { - getNxWorkspaceConfig, - NxWorkspaceConfiguration, -} from './get-nx-workspace-config'; + firstValueFrom, + from, + iif, + of, + ReplaySubject, + switchMap, + tap, +} from 'rxjs'; +import { window } from 'vscode'; +import { getNxWorkspaceConfig } from './get-nx-workspace-config'; interface Workspace { validWorkspaceJson: boolean; @@ -22,7 +30,40 @@ interface Workspace { workspacePath: string; } -export async function verifyWorkspace(): Promise { +const enum Status { + not_started, + in_progress, + cached, +} + +let cachedReplay = new ReplaySubject(); +let status: Status = Status.not_started; + +export async function nxWorkspace(reset?: boolean): Promise { + if (reset) { + status = Status.not_started; + cachedReplay = new ReplaySubject(); + } + + return firstValueFrom( + iif( + () => status === Status.not_started, + of({}).pipe( + tap(() => { + status = Status.in_progress; + }), + switchMap(() => from(_workspace())), + tap((workspace) => { + cachedReplay.next(workspace); + status = Status.cached; + }) + ), + cachedReplay + ) + ); +} + +async function _workspace(): Promise { const workspacePath = WorkspaceConfigurationStore.instance.get( 'nxWorkspacePath', '' diff --git a/libs/vscode/nx-workspace/src/lib/workspace-codelens-provider.ts b/libs/vscode/nx-workspace/src/lib/workspace-codelens-provider.ts index 07a2236b30..a4c50b676b 100644 --- a/libs/vscode/nx-workspace/src/lib/workspace-codelens-provider.ts +++ b/libs/vscode/nx-workspace/src/lib/workspace-codelens-provider.ts @@ -11,7 +11,7 @@ import { workspace, } from 'vscode'; import { TextDocument } from 'vscode'; -import { verifyWorkspace } from './verify-workspace'; +import { nxWorkspace } from './nx-workspace'; import { getProjectLocations, ProjectLocations, @@ -71,7 +71,7 @@ export class WorkspaceCodeLensProvider implements CodeLensProvider { const lens: CodeLens[] = []; let projectName = ''; - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); if (document.uri.path.endsWith('project.json')) { for (const [key, project] of Object.entries(json.projects)) { @@ -87,7 +87,7 @@ export class WorkspaceCodeLensProvider implements CodeLensProvider { } const projectLocations = getProjectLocations(document, projectName); - const { validWorkspaceJson, workspaceType } = await verifyWorkspace(); + const { validWorkspaceJson, workspaceType } = await nxWorkspace(); if (!validWorkspaceJson) { return; } diff --git a/libs/vscode/tasks/src/lib/cli-task-commands.ts b/libs/vscode/tasks/src/lib/cli-task-commands.ts index bbf4c22064..cebdd0bb77 100644 --- a/libs/vscode/tasks/src/lib/cli-task-commands.ts +++ b/libs/vscode/tasks/src/lib/cli-task-commands.ts @@ -1,6 +1,6 @@ import { commands, ExtensionContext, window, Uri } from 'vscode'; -import { nxVersion, verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { nxVersion, nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { verifyBuilderDefinition } from '@nx-console/vscode/verify'; import { RunTargetTreeItem } from '@nx-console/vscode/nx-run-target-view'; import { CliTaskProvider } from './cli-task-provider'; @@ -221,7 +221,7 @@ async function selectCliCommandAndShowUi( ); return; } - const { validWorkspaceJson, configurationFilePath } = await verifyWorkspace(); + const { validWorkspaceJson, configurationFilePath } = await nxWorkspace(); if (!validWorkspaceJson) { window.showErrorMessage('Invalid configuration file'); return; @@ -254,7 +254,7 @@ async function selectCliCommandAndPromptForFlags( } else if (!askForFlags) { flags = []; } - const { validWorkspaceJson, json, workspaceType } = await verifyWorkspace(); + const { validWorkspaceJson, json, workspaceType } = await nxWorkspace(); if (!projectName) { const selection = validWorkspaceJson @@ -339,7 +339,7 @@ function surroundWithQuotesIfHasWhiteSpace(target: string): string { async function selectGeneratorAndPromptForFlags() { const { validWorkspaceJson, workspaceType, workspacePath } = - await verifyWorkspace(); + await nxWorkspace(); if (!validWorkspaceJson) { return; @@ -414,7 +414,7 @@ async function selectCliTarget(targets: string[]): Promise { } async function getTargetNames(): Promise { - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const commands = Object.values(json.projects).reduce((acc, project) => { for (const target of Object.keys(project.targets ?? {})) { acc.add(target); @@ -427,7 +427,7 @@ async function getTargetNames(): Promise { async function getProjectsWithTargetName( targetName: string ): Promise { - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const projects = []; for (const [projectName, project] of Object.entries(json.projects)) { const targets = project.targets ?? {}; diff --git a/libs/vscode/tasks/src/lib/cli-task-provider.ts b/libs/vscode/tasks/src/lib/cli-task-provider.ts index 1b7adb3ee1..e06b60f0e7 100644 --- a/libs/vscode/tasks/src/lib/cli-task-provider.ts +++ b/libs/vscode/tasks/src/lib/cli-task-provider.ts @@ -6,7 +6,7 @@ import { import { getTelemetry } from '@nx-console/server'; import { WorkspaceConfigurationStore } from '@nx-console/vscode/configuration'; import { NxConversion } from '@nx-console/vscode/nx-conversion'; -import { verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { isAbsolute, join, relative } from 'path'; import { ProviderResult, @@ -121,7 +121,7 @@ export class CliTaskProvider implements TaskProvider { if (json) { return json.projects; } else { - const result = await verifyWorkspace(); + const result = await nxWorkspace(); if (!result.validWorkspaceJson || !result.json) { return {}; } else { diff --git a/libs/vscode/tasks/src/lib/nx-task-commands.ts b/libs/vscode/tasks/src/lib/nx-task-commands.ts index acd3ec64f5..d62a05c1a5 100644 --- a/libs/vscode/tasks/src/lib/nx-task-commands.ts +++ b/libs/vscode/tasks/src/lib/nx-task-commands.ts @@ -3,7 +3,7 @@ import { commands, ExtensionContext, window, tasks } from 'vscode'; import { CliTaskProvider } from './cli-task-provider'; import { selectFlags } from './select-flags'; -import { verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { getTelemetry } from '@nx-console/server'; import { NxTask } from './nx-task'; @@ -47,7 +47,7 @@ export function registerNxCommands( } async function promptForTarget(): Promise { - const { validWorkspaceJson, json } = await verifyWorkspace(); + const { validWorkspaceJson, json } = await nxWorkspace(); if (!validWorkspaceJson || !json) { return; @@ -386,7 +386,7 @@ async function promptForMigrate() { async function validProjectsForTarget( target: string ): Promise { - const { validWorkspaceJson, json } = await verifyWorkspace(); + const { validWorkspaceJson, json } = await nxWorkspace(); if (!validWorkspaceJson || !json) { return; diff --git a/libs/vscode/tasks/src/lib/select-generator.ts b/libs/vscode/tasks/src/lib/select-generator.ts index 0d4adaae37..f907b68344 100644 --- a/libs/vscode/tasks/src/lib/select-generator.ts +++ b/libs/vscode/tasks/src/lib/select-generator.ts @@ -9,12 +9,12 @@ import { normalizeSchema, readAndCacheJsonFile, } from '@nx-console/server'; -import { getNxConfig, verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { getNxConfig, nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { dirname } from 'path'; import { QuickPickItem, window } from 'vscode'; async function readWorkspaceJsonDefaults(workspacePath: string): Promise { - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); let defaults = json.generators; @@ -83,7 +83,7 @@ export async function selectGenerator( generator: Generator; collectionPath: string; } - const { json } = await verifyWorkspace(); + const { json } = await nxWorkspace(); const generators = await getGenerators(workspacePath, json.projects); let generatorsQuickPicks = generators .filter((collection) => !!collection.data) diff --git a/libs/vscode/webview/src/lib/get-task-execution-schema.ts b/libs/vscode/webview/src/lib/get-task-execution-schema.ts index 296b912bb9..e6d4f8bf69 100644 --- a/libs/vscode/webview/src/lib/get-task-execution-schema.ts +++ b/libs/vscode/webview/src/lib/get-task-execution-schema.ts @@ -4,7 +4,7 @@ import { getTelemetry, readTargetDef, } from '@nx-console/server'; -import { getNxConfig, verifyWorkspace } from '@nx-console/vscode/nx-workspace'; +import { getNxConfig, nxWorkspace } from '@nx-console/vscode/nx-workspace'; import { verifyBuilderDefinition } from '@nx-console/vscode/verify'; import { Uri, window } from 'vscode'; import { @@ -25,7 +25,7 @@ export async function getTaskExecutionSchema( if (!cliTaskProvider.getWorkspacePath()) { return; } - const { validWorkspaceJson, json, workspaceType } = await verifyWorkspace(); + const { validWorkspaceJson, json, workspaceType } = await nxWorkspace(); if (!validWorkspaceJson) { return; diff --git a/package.json b/package.json index 72a2b2c70c..e7b6adb784 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "ovsx": "^0.3.0", "prettier": "2.6.1", "rimraf": "^3.0.2", - "rxjs": "6.5.5", + "rxjs": "~7.5.5", "standard-version": "^9.1.1", "ts-jest": "27.1.4", "tslib": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 534b9231bf..01adf5059d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16070,13 +16070,6 @@ rxjs-for-await@0.0.2: resolved "https://registry.yarnpkg.com/rxjs-for-await/-/rxjs-for-await-0.0.2.tgz#26598a1d6167147cc192172970e7eed4e620384b" integrity sha512-IJ8R/ZCFMHOcDIqoABs82jal00VrZx8Xkgfe7TOKoaRPAW5nH/VFlG23bXpeGdrmtqI9UobFPgUKgCuFc7Lncw== -rxjs@6.5.5: - version "6.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" - integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== - dependencies: - tslib "^1.9.0" - rxjs@6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" @@ -16098,6 +16091,13 @@ rxjs@^7.2.0: dependencies: tslib "~2.1.0" +rxjs@~7.5.5: + version "7.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" + integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== + dependencies: + tslib "^2.1.0" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -17647,6 +17647,11 @@ tslib@^2.0.0, tslib@^2.0.3, tslib@~2.1.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== +tslib@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"