Skip to content

Commit

Permalink
cleanup(core): remove the indirection left after inlining tao into nx
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Mar 23, 2022
1 parent 2f85238 commit b562f5e
Show file tree
Hide file tree
Showing 369 changed files with 3,590 additions and 4,148 deletions.
2 changes: 1 addition & 1 deletion dep-graph/client/src/app/fetch-project-graph-service.ts
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import { ProjectGraphService } from './interfaces';

export class FetchProjectGraphService implements ProjectGraphService {
Expand Down
2 changes: 1 addition & 1 deletion dep-graph/client/src/app/hooks/use-environment-config.ts
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import { useRef } from 'react';
import { AppConfig } from '../interfaces';

Expand Down
2 changes: 1 addition & 1 deletion dep-graph/client/src/app/interfaces.ts
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';

export interface ProjectGraphList {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion dep-graph/client/src/app/local-project-graph-service.ts
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import { ProjectGraphService } from './interfaces';

export class LocalProjectGraphService implements ProjectGraphService {
Expand Down
1 change: 1 addition & 0 deletions dep-graph/client/src/app/machines/selectors.ts
@@ -1,3 +1,4 @@
// nx-ignore-next-line
import type { ProjectGraphProjectNode } from '@nrwl/devkit';
import { DepGraphSelector } from '../hooks/use-dep-graph-selector';
import { WorkspaceLayout } from '../interfaces';
Expand Down
3 changes: 2 additions & 1 deletion dep-graph/client/src/app/mock-project-graph-service.ts
@@ -1,9 +1,10 @@
// nx-ignore-next-line
import type {
ProjectGraphDependency,
ProjectGraphProjectNode,
} from '@nrwl/devkit';
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import { ProjectGraphService } from '../app/interfaces';

export class MockProjectGraphService implements ProjectGraphService {
Expand Down
2 changes: 1 addition & 1 deletion dep-graph/client/src/app/shell.tsx
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import Tippy from '@tippyjs/react';
import { useEffect, useState } from 'react';
import DebuggerPanel from './debugger-panel';
Expand Down
1 change: 1 addition & 0 deletions dep-graph/client/src/app/sidebar/project-list.tsx
@@ -1,3 +1,4 @@
// nx-ignore-next-line
import type { ProjectGraphNode } from '@nrwl/devkit';
import { useDepGraphService } from '../hooks/use-dep-graph';
import { useDepGraphSelector } from '../hooks/use-dep-graph-selector';
Expand Down
1 change: 1 addition & 0 deletions dep-graph/client/src/app/util-cytoscape/edge.ts
@@ -1,3 +1,4 @@
// nx-ignore-next-line
import type { ProjectGraphDependency } from '@nrwl/devkit';
import * as cy from 'cytoscape';

Expand Down
1 change: 1 addition & 0 deletions dep-graph/client/src/app/util-cytoscape/project-node.ts
@@ -1,3 +1,4 @@
// nx-ignore-next-line
import type { ProjectGraphProjectNode } from '@nrwl/devkit';
import * as cy from 'cytoscape';
import { parseParentDirectoriesFromPilePath } from '../util';
Expand Down
1 change: 1 addition & 0 deletions dep-graph/client/src/app/util.ts
@@ -1,3 +1,4 @@
// nx-ignore-next-line
import { ProjectGraphDependency } from '@nrwl/devkit';

export function trimBackSlash(value: string): string {
Expand Down
2 changes: 1 addition & 1 deletion dep-graph/client/src/globals.d.ts
@@ -1,5 +1,5 @@
// nx-ignore-next-line
import type { DepGraphClientResponse } from '@nrwl/workspace/src/command-line/dep-graph';
import type { DepGraphClientResponse } from 'nx/src/command-line/dep-graph';
import { AppConfig } from './app/interfaces';

export declare global {
Expand Down
195 changes: 195 additions & 0 deletions docs/generated/api-nx-devkit/index.md
Expand Up @@ -23,6 +23,14 @@ It only uses language primitives and immutable objects

- [ProjectGraphBuilder](../../nx-devkit/index#projectgraphbuilder)

### Utils Classes

- [Hasher](../../nx-devkit/index#hasher)

### Workspace Classes

- [Workspaces](../../nx-devkit/index#workspaces)

### Commands Interfaces

- [Target](../../nx-devkit/index#target)
Expand All @@ -49,6 +57,7 @@ It only uses language primitives and immutable objects

### Utils Interfaces

- [Hash](../../nx-devkit/index#hash)
- [JsonParseOptions](../../nx-devkit/index#jsonparseoptions)
- [JsonSerializeOptions](../../nx-devkit/index#jsonserializeoptions)
- [StringDeletion](../../nx-devkit/index#stringdeletion)
Expand Down Expand Up @@ -102,16 +111,25 @@ It only uses language primitives and immutable objects

- [logger](../../nx-devkit/index#logger)

### Utils Variables

- [appRootPath](../../nx-devkit/index#approotpath)
- [cacheDir](../../nx-devkit/index#cachedir)
- [output](../../nx-devkit/index#output)
- [workspaceRoot](../../nx-devkit/index#workspaceroot)

### Functions

- [addDependenciesToPackageJson](../../nx-devkit/index#adddependenciestopackagejson)
- [addProjectConfiguration](../../nx-devkit/index#addprojectconfiguration)
- [applyChangesToString](../../nx-devkit/index#applychangestostring)
- [convertNxExecutor](../../nx-devkit/index#convertnxexecutor)
- [convertNxGenerator](../../nx-devkit/index#convertnxgenerator)
- [createProjectGraphAsync](../../nx-devkit/index#createprojectgraphasync)
- [detectPackageManager](../../nx-devkit/index#detectpackagemanager)
- [formatFiles](../../nx-devkit/index#formatfiles)
- [generateFiles](../../nx-devkit/index#generatefiles)
- [getOutputsForTargetAndConfiguration](../../nx-devkit/index#getoutputsfortargetandconfiguration)
- [getPackageManagerCommand](../../nx-devkit/index#getpackagemanagercommand)
- [getPackageManagerVersion](../../nx-devkit/index#getpackagemanagerversion)
- [getProjects](../../nx-devkit/index#getprojects)
Expand All @@ -126,13 +144,16 @@ It only uses language primitives and immutable objects
- [offsetFromRoot](../../nx-devkit/index#offsetfromroot)
- [parseJson](../../nx-devkit/index#parsejson)
- [parseTargetString](../../nx-devkit/index#parsetargetstring)
- [readCachedProjectGraph](../../nx-devkit/index#readcachedprojectgraph)
- [readJson](../../nx-devkit/index#readjson)
- [readJsonFile](../../nx-devkit/index#readjsonfile)
- [readNxJson](../../nx-devkit/index#readnxjson)
- [readProjectConfiguration](../../nx-devkit/index#readprojectconfiguration)
- [readTargetOptions](../../nx-devkit/index#readtargetoptions)
- [readWorkspaceConfiguration](../../nx-devkit/index#readworkspaceconfiguration)
- [removeDependenciesFromPackageJson](../../nx-devkit/index#removedependenciesfrompackagejson)
- [removeProjectConfiguration](../../nx-devkit/index#removeprojectconfiguration)
- [reverse](../../nx-devkit/index#reverse)
- [runExecutor](../../nx-devkit/index#runexecutor)
- [serializeJson](../../nx-devkit/index#serializejson)
- [stripIndents](../../nx-devkit/index#stripindents)
Expand All @@ -144,6 +165,7 @@ It only uses language primitives and immutable objects
- [updateTsConfigsToJs](../../nx-devkit/index#updatetsconfigstojs)
- [updateWorkspaceConfiguration](../../nx-devkit/index#updateworkspaceconfiguration)
- [visitNotIgnoredFiles](../../nx-devkit/index#visitnotignoredfiles)
- [workspaceLayout](../../nx-devkit/index#workspacelayout)
- [writeJson](../../nx-devkit/index#writejson)
- [writeJsonFile](../../nx-devkit/index#writejsonfile)

Expand All @@ -167,6 +189,22 @@ It only uses language primitives and immutable objects

**ProjectGraphBuilder**: `Object`

---

## Utils Classes

### Hasher

**Hasher**: `Object`

---

## Workspace Classes

### Workspaces

**Workspaces**: `Object`

## Commands Interfaces

### Target
Expand Down Expand Up @@ -269,6 +307,12 @@ A plugin for Nx

## Utils Interfaces

### Hash

**Hash**: `Object`

---

### JsonParseOptions

**JsonParseOptions**: `Object`
Expand Down Expand Up @@ -581,6 +625,32 @@ Implementation of a target of a project that handles multiple projects to be bat
| `log` | (...`s`: `any`[]) => `void` |
| `warn` | (`s`: `any`) => `void` |

---

## Utils Variables

### appRootPath

**appRootPath**: `string`

---

### cacheDir

**cacheDir**: `string`

---

### output

**output**: `CLIOutput`

---

### workspaceRoot

**workspaceRoot**: `string` = `appRootPath`

## Functions

### addDependenciesToPackageJson
Expand Down Expand Up @@ -754,6 +824,38 @@ Convert an Nx Generator into an Angular Devkit Schematic

---

### createProjectGraphAsync

**createProjectGraphAsync**(): `Promise`<[`ProjectGraph`](../../nx-devkit/index#projectgraph)\>

Computes and returns a ProjectGraph.

Nx will compute the graph either in a daemon process or in the current process.

Nx will compute it in the current process if:

- The process is running in CI (CI env variable is to true or other common variables used by CI providers are set).
- It is running in the docker container.
- The daemon process is disabled because of the previous error when starting the daemon.
- `NX_DAEMON` is set to `false`.
- `useDaemon` is set to false in `nx.json`

`NX_DAEMON` env variable takes precedence:

- If it is set to true, the daemon will always be used.
- If it is set to false, the graph will always be computed in the current process.

Tip: If you want to debug project graph creation, run your command with NX_DAEMON=false.

Nx uses two layers of caching: the information about explicit dependencies stored on the disk and the information
stored in the daemon process. To reset both run: `nx reset`.

#### Returns

`Promise`<[`ProjectGraph`](../../nx-devkit/index#projectgraph)\>

---

### detectPackageManager

**detectPackageManager**(`dir?`): [`PackageManager`](../../nx-devkit/index#packagemanager)
Expand Down Expand Up @@ -831,6 +933,25 @@ doesn't get confused about incorrect TypeScript files.

---

### getOutputsForTargetAndConfiguration

**getOutputsForTargetAndConfiguration**(`task`, `node`): `any`

Returns the list of outputs that will be cached.

#### Parameters

| Name | Type | Description |
| :----- | :--------------------------------------------------------------------------------- | :-------------------------------------------------------- |
| `task` | `Pick`<[`Task`](../../nx-devkit/index#task), `"target"` \| `"overrides"`\> | target + overrides |
| `node` | [`ProjectGraphProjectNode`](../../nx-devkit/index#projectgraphprojectnode)<`any`\> | ProjectGraphProjectNode object that the task runs against |

#### Returns

`any`

---

### getPackageManagerCommand

**getPackageManagerCommand**(`packageManager?`): `PackageManagerCommands`
Expand Down Expand Up @@ -1008,6 +1129,8 @@ Normalized path fragments and joins them

**moveFilesToNewDirectory**(`tree`, `oldDir`, `newDir`): `void`

Analogous to cp -r oldDir newDir

#### Parameters

| Name | Type |
Expand Down Expand Up @@ -1151,6 +1274,20 @@ parseTargetString('proj:test:production'); // returns { project: "proj", target:

---

### readCachedProjectGraph

**readCachedProjectGraph**(): [`ProjectGraph`](../../nx-devkit/index#projectgraph)

Synchronously reads the latest cached copy of the workspace's ProjectGraph.

**`throws`** {Error} if there is no cached ProjectGraph to read from

#### Returns

[`ProjectGraph`](../../nx-devkit/index#projectgraph)

---

### readJson

**readJson**<`T`\>(`tree`, `path`, `options?`): `T`
Expand Down Expand Up @@ -1204,6 +1341,26 @@ Object the JSON content of the file represents

---

### readNxJson

**readNxJson**(`path?`): [`NxJsonConfiguration`](../../nx-devkit/index#nxjsonconfiguration)

Returns the contents of nx.json.

If nx.json extends another config file, it will be inlined here.

#### Parameters

| Name | Type |
| :----- | :------- |
| `path` | `string` |

#### Returns

[`NxJsonConfiguration`](../../nx-devkit/index#nxjsonconfiguration)

---

### readProjectConfiguration

**readProjectConfiguration**(`tree`, `projectName`): [`ProjectConfiguration`](../../nx-devkit/index#projectconfiguration)
Expand Down Expand Up @@ -1328,6 +1485,27 @@ The utility will update either file.

---

### reverse

**reverse**(`graph`): [`ProjectGraph`](../../nx-devkit/index#projectgraph)

Returns a new project graph where all the edges are reversed.

For instance, if project A depends on B, in the reversed graph
B will depend on A.

#### Parameters

| Name | Type |
| :------ | :----------------------------------------------------------- |
| `graph` | [`ProjectGraph`](../../nx-devkit/index#projectgraph)<`any`\> |

#### Returns

[`ProjectGraph`](../../nx-devkit/index#projectgraph)

---

### runExecutor

**runExecutor**<`T`\>(`targetDescription`, `options`, `context`): `Promise`<`AsyncIterableIterator`<`T`\>\>
Expand Down Expand Up @@ -1607,6 +1785,23 @@ Utility to act on all files in a tree that are not ignored by git.

---

### workspaceLayout

**workspaceLayout**(): `Object`

Returns information about where apps and libs will be created.

#### Returns

`Object`

| Name | Type |
| :-------- | :------- |
| `appsDir` | `string` |
| `libsDir` | `string` |

---

### writeJson

**writeJson**<`T`\>(`tree`, `path`, `value`, `options?`): `void`
Expand Down

0 comments on commit b562f5e

Please sign in to comment.