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';
|
||||
|
||||
/**
|
||||
|
||||
@ -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 { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
||||
|
||||
@ -41,9 +41,9 @@ function toObservable<T extends { success: boolean }>(
|
||||
promiseOrAsyncIterator: Promise<T> | AsyncIterableIterator<T>
|
||||
): Observable<T> {
|
||||
if (typeof (promiseOrAsyncIterator as any).then === 'function') {
|
||||
return from(promiseOrAsyncIterator as Promise<T>);
|
||||
return require('rxjs').from(promiseOrAsyncIterator as Promise<T>);
|
||||
} else {
|
||||
return new Observable((subscriber) => {
|
||||
return new (require('rxjs').Observable)((subscriber) => {
|
||||
let asyncIterator = promiseOrAsyncIterator as AsyncIterableIterator<T>;
|
||||
|
||||
function recurse(iterator: AsyncIterableIterator<T>) {
|
||||
|
||||
@ -18,7 +18,6 @@ import {
|
||||
|
||||
import * as chalk from 'chalk';
|
||||
import { logger } from '../shared/logger';
|
||||
import { eachValueFrom } from 'rxjs-for-await';
|
||||
|
||||
export interface Target {
|
||||
project: string;
|
||||
@ -257,7 +256,8 @@ async function runExecutorInternal<T extends { success: boolean }>(
|
||||
},
|
||||
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 type { ProjectGraph, NxJsonConfiguration, Task } from '@nrwl/devkit';
|
||||
import { TaskOrchestrator } from './task-orchestrator';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { extname } from 'path';
|
||||
import * as url from 'url';
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
TaskId,
|
||||
Tree,
|
||||
} from '@angular-devkit/schematics';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { fork } from 'child_process';
|
||||
import { join } from 'path';
|
||||
import { readJsonInTree } from './ast-utils';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user