Skip to content

Commit

Permalink
cleanup(core): remove async flag from signature of buildProjectsConfi…
Browse files Browse the repository at this point in the history
…gurationsFromProjectPathsAndPlugins (#20228)
  • Loading branch information
AgentEnder authored Nov 17, 2023
1 parent 2a5d541 commit 30d94f7
Show file tree
Hide file tree
Showing 58 changed files with 451 additions and 318 deletions.
9 changes: 0 additions & 9 deletions docs/generated/devkit/CreateNodesAsync.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/generated/devkit/CreateNodesFunction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Type alias: CreateNodesFunction<T\>

Ƭ **CreateNodesFunction**<`T`\>: (`projectConfigurationFile`: `string`, `options`: `T` \| `undefined`, `context`: [`CreateNodesContext`](../../devkit/documents/CreateNodesContext)) => [`CreateNodesResult`](../../devkit/documents/CreateNodesResult)
Ƭ **CreateNodesFunction**<`T`\>: (`projectConfigurationFile`: `string`, `options`: `T` \| `undefined`, `context`: [`CreateNodesContext`](../../devkit/documents/CreateNodesContext)) => [`CreateNodesResult`](../../devkit/documents/CreateNodesResult) \| `Promise`<[`CreateNodesResult`](../../devkit/documents/CreateNodesResult)\>

#### Type parameters

Expand All @@ -10,7 +10,7 @@

#### Type declaration

▸ (`projectConfigurationFile`, `options`, `context`): [`CreateNodesResult`](../../devkit/documents/CreateNodesResult)
▸ (`projectConfigurationFile`, `options`, `context`): [`CreateNodesResult`](../../devkit/documents/CreateNodesResult) \| `Promise`<[`CreateNodesResult`](../../devkit/documents/CreateNodesResult)\>

A function which parses a configuration file into a set of nodes.
Used for creating nodes for the [ProjectGraph](../../devkit/documents/ProjectGraph)
Expand All @@ -25,4 +25,4 @@ Used for creating nodes for the [ProjectGraph](../../devkit/documents/ProjectGra

##### Returns

[`CreateNodesResult`](../../devkit/documents/CreateNodesResult)
[`CreateNodesResult`](../../devkit/documents/CreateNodesResult) \| `Promise`<[`CreateNodesResult`](../../devkit/documents/CreateNodesResult)\>
13 changes: 6 additions & 7 deletions docs/generated/devkit/NxPluginV2.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Type alias: NxPluginV2<TOptions, TCreateNodes\>
# Type alias: NxPluginV2<TOptions\>

Ƭ **NxPluginV2**<`TOptions`, `TCreateNodes`\>: `Object`
Ƭ **NxPluginV2**<`TOptions`\>: `Object`

A plugin for Nx which creates nodes and dependencies for the [ProjectGraph](../../devkit/documents/ProjectGraph)

#### Type parameters

| Name | Type |
| :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `TOptions` | `unknown` |
| `TCreateNodes` | extends [`CreateNodes`](../../devkit/documents/CreateNodes)<`TOptions`\> \| [`CreateNodesAsync`](../../devkit/documents/CreateNodesAsync)<`TOptions`\> = [`CreateNodes`](../../devkit/documents/CreateNodes)<`TOptions`\> \| [`CreateNodesAsync`](../../devkit/documents/CreateNodesAsync)<`TOptions`\> |
| Name | Type |
| :--------- | :-------- |
| `TOptions` | `unknown` |

#### Type declaration

| Name | Type | Description |
| :-------------------- | :----------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| `createDependencies?` | [`CreateDependencies`](../../devkit/documents/CreateDependencies)<`TOptions`\> | Provides a function to analyze files to create dependencies for the [ProjectGraph](../../devkit/documents/ProjectGraph) |
| `createNodes?` | `TCreateNodes` | Provides a file pattern and function that retrieves configuration info from those files. e.g. { '\*_/_.csproj': buildProjectsFromCsProjFile } |
| `createNodes?` | [`CreateNodes`](../../devkit/documents/CreateNodes) | Provides a file pattern and function that retrieves configuration info from those files. e.g. { '\*_/_.csproj': buildProjectsFromCsProjFile } |
| `name` | `string` | - |
1 change: 0 additions & 1 deletion docs/generated/devkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ It only uses language primitives and immutable objects

- [CreateDependencies](../../devkit/documents/CreateDependencies)
- [CreateNodes](../../devkit/documents/CreateNodes)
- [CreateNodesAsync](../../devkit/documents/CreateNodesAsync)
- [CreateNodesFunction](../../devkit/documents/CreateNodesFunction)
- [CustomHasher](../../devkit/documents/CustomHasher)
- [DynamicDependency](../../devkit/documents/DynamicDependency)
Expand Down
1 change: 0 additions & 1 deletion docs/generated/packages/devkit/documents/nx_devkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ It only uses language primitives and immutable objects

- [CreateDependencies](../../devkit/documents/CreateDependencies)
- [CreateNodes](../../devkit/documents/CreateNodes)
- [CreateNodesAsync](../../devkit/documents/CreateNodesAsync)
- [CreateNodesFunction](../../devkit/documents/CreateNodesFunction)
- [CustomHasher](../../devkit/documents/CustomHasher)
- [DynamicDependency](../../devkit/documents/DynamicDependency)
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/recipes/plugins/project-graph-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ A simplified version of Nx's built-in `project.json` plugin is shown below, whic
export const createNodes: CreateNodes = [
'**/project.json',
(projectConfigurationFile: string, opts, context: CreateNodesContext) => {
const projectConfiguration = readJson(projectConfigurationFile);
const projectConfiguration = readJsonFile(projectConfigurationFile);
const root = dirname(projectConfigurationFile);

return {
Expand Down
2 changes: 1 addition & 1 deletion graph/client/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"],
"lib": ["DOM", "es2019"]
"lib": ["DOM", "es2022"]
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
Expand Down
1 change: 1 addition & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ module.exports = {
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html'],
maxWorkers: 1,
testEnvironment: 'node',
};
1 change: 0 additions & 1 deletion nx-dev/models-document/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export default {
displayName: 'nx-dev-models-document',
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
Expand Down
1 change: 0 additions & 1 deletion nx-dev/models-menu/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export default {
displayName: 'nx-dev-models-menu',
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
Expand Down
1 change: 0 additions & 1 deletion nx-dev/models-package/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export default {
displayName: 'nx-dev-models-package',
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
Expand Down
1 change: 1 addition & 0 deletions nx-dev/ui-sponsor-card/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default {
coverageDirectory: '../../coverage/nx-dev/ui-sponsor-card',
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
preset: '../../jest.preset.js',
testEnvironment: 'jsdom',
};
1 change: 0 additions & 1 deletion nx-dev/util-ai/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export default {
displayName: 'nx-dev-util-ai',
preset: '../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
Expand Down
1 change: 0 additions & 1 deletion packages/angular/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'angular',
testEnvironment: 'node',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
};
1 change: 0 additions & 1 deletion packages/create-nx-plugin/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'create-nx-plugin',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/create-nx-workspace/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'create-nx-workspace',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/cypress/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'cypress',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('add-nx-cypress-plugin migration', () => {
})
);
updateProjectConfiguration(tree, 'e2e', {
name: 'e2e',
root: 'e2e',
targets: {
e2e: {
Expand Down
1 change: 0 additions & 1 deletion packages/detox/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
globals: {},
displayName: 'react-native',
testEnvironment: 'node',
verbose: true,
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/devkit/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'cli',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
TargetConfiguration,
} from 'nx/src/config/workspace-json-project-json';
import type { Tree } from 'nx/src/generators/tree';
import type { CreateNodes, CreateNodesAsync } from 'nx/src/utils/nx-plugin';
import type { CreateNodes } from 'nx/src/utils/nx-plugin';
import { requireNx } from '../../nx';
const {
readNxJson,
Expand All @@ -19,7 +19,7 @@ export async function replaceProjectConfigurationsWithPlugin<T = unknown>(
tree: Tree,
rootMappings: Map<string, string>,
pluginPath: string,
createNodes: CreateNodes<T> | CreateNodesAsync<T>,
createNodes: CreateNodes<T>,
pluginOptions: T
): Promise<void> {
const nxJson = readNxJson(tree);
Expand Down
1 change: 0 additions & 1 deletion packages/esbuild/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'esbuild',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/eslint-plugin/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'packages-eslint-plugin',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/eslint/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'eslint',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/expo/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
globals: {},
displayName: 'expo',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/express/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'express',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/jest/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'jest',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/js/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'js',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/nest/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'nest',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/next/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'next',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/node/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'node',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
1 change: 0 additions & 1 deletion packages/nx/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export default {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
globals: {},
displayName: 'nx',
testEnvironment: 'node',
preset: '../../jest.preset.js',
};
Loading

1 comment on commit 30d94f7

@vercel
Copy link

@vercel vercel bot commented on 30d94f7 Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.