cleanup(misc): avoid importing rxjs in the core path
This commit is contained in:
parent
27a665c6c3
commit
bc4ec52f53
@ -1,4 +1,4 @@
|
|||||||
import { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import { first, toArray } from 'rxjs/operators';
|
import { first, toArray } from 'rxjs/operators';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { from, Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { Executor, ExecutorContext } from '@nrwl/tao/src/shared/workspace';
|
import type { Executor, ExecutorContext } from '@nrwl/tao/src/shared/workspace';
|
||||||
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
||||||
|
|
||||||
@ -41,9 +41,9 @@ function toObservable<T extends { success: boolean }>(
|
|||||||
promiseOrAsyncIterator: Promise<T> | AsyncIterableIterator<T>
|
promiseOrAsyncIterator: Promise<T> | AsyncIterableIterator<T>
|
||||||
): Observable<T> {
|
): Observable<T> {
|
||||||
if (typeof (promiseOrAsyncIterator as any).then === 'function') {
|
if (typeof (promiseOrAsyncIterator as any).then === 'function') {
|
||||||
return from(promiseOrAsyncIterator as Promise<T>);
|
return require('rxjs').from(promiseOrAsyncIterator as Promise<T>);
|
||||||
} else {
|
} else {
|
||||||
return new Observable((subscriber) => {
|
return new (require('rxjs').Observable)((subscriber) => {
|
||||||
let asyncIterator = promiseOrAsyncIterator as AsyncIterableIterator<T>;
|
let asyncIterator = promiseOrAsyncIterator as AsyncIterableIterator<T>;
|
||||||
|
|
||||||
function recurse(iterator: AsyncIterableIterator<T>) {
|
function recurse(iterator: AsyncIterableIterator<T>) {
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import {
|
|||||||
|
|
||||||
import * as chalk from 'chalk';
|
import * as chalk from 'chalk';
|
||||||
import { logger } from '../shared/logger';
|
import { logger } from '../shared/logger';
|
||||||
import { eachValueFrom } from 'rxjs-for-await';
|
|
||||||
|
|
||||||
export interface Target {
|
export interface Target {
|
||||||
project: string;
|
project: string;
|
||||||
@ -257,7 +256,8 @@ async function runExecutorInternal<T extends { success: boolean }>(
|
|||||||
},
|
},
|
||||||
isVerbose
|
isVerbose
|
||||||
);
|
);
|
||||||
return eachValueFrom<T>(observable as any);
|
const { eachValueFrom } = require('rxjs-for-await');
|
||||||
|
return eachValueFrom(observable as any);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { TaskCompleteEvent, TasksRunner } from './tasks-runner';
|
import { TaskCompleteEvent, TasksRunner } from './tasks-runner';
|
||||||
import type { ProjectGraph, NxJsonConfiguration, Task } from '@nrwl/devkit';
|
import type { ProjectGraph, NxJsonConfiguration, Task } from '@nrwl/devkit';
|
||||||
import { TaskOrchestrator } from './task-orchestrator';
|
import { TaskOrchestrator } from './task-orchestrator';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
|
|
||||||
import { extname } from 'path';
|
import { extname } from 'path';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
TaskId,
|
TaskId,
|
||||||
Tree,
|
Tree,
|
||||||
} from '@angular-devkit/schematics';
|
} from '@angular-devkit/schematics';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { fork } from 'child_process';
|
import { fork } from 'child_process';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { readJsonInTree } from './ast-utils';
|
import { readJsonInTree } from './ast-utils';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user