Skip to content

Commit

Permalink
fix(core): merge package.json plugins and updated project.json plugin… (
Browse files Browse the repository at this point in the history
#26952)

… using v2

## Current Behavior
<!-- This is the behavior we have today -->

The `package.json` handling is split between before and after plugins so
it's confusing. Also, `package.json` nodes will get overwritten by
plugins while others won't.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `package.json` handling is merged. Also, the `package.json` nodes
will always overwrite plugins as intended.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
FrozenPandaz authored Jul 16, 2024
1 parent 1a94296 commit 51f5fe4
Show file tree
Hide file tree
Showing 17 changed files with 393 additions and 465 deletions.
2 changes: 1 addition & 1 deletion packages/jest/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
clearRequireCache,
loadConfigFile,
} from '@nx/devkit/src/utils/config-utils';
import { getGlobPatternsFromPackageManagerWorkspaces } from 'nx/src/plugins/package-json-workspaces';
import { getGlobPatternsFromPackageManagerWorkspaces } from 'nx/src/plugins/package-json';
import { combineGlobPatterns } from 'nx/src/utils/globs';
import { minimatch } from 'minimatch';
import { hashObject } from 'nx/src/devkit-internals';
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/plugins/package-json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NxPluginV2 } from '../src/project-graph/plugins';
import { workspaceRoot } from '../src/utils/workspace-root';
import { createNodeFromPackageJson } from '../src/plugins/package-json-workspaces';
import { createNodeFromPackageJson } from '../src/plugins/package-json';

const plugin: NxPluginV2 = {
name: 'nx-all-package-jsons-plugin',
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/generators/utils/project-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { basename, join, relative } from 'path';
import {
buildProjectConfigurationFromPackageJson,
getGlobPatternsFromPackageManagerWorkspaces,
} from '../../plugins/package-json-workspaces';
} from '../../plugins/package-json';
import { buildProjectFromProjectJson } from '../../plugins/project-json/build-nodes/project-json';
import { renamePropertyWithStableKeys } from '../../adapter/angular-json';
import {
Expand Down
2 changes: 0 additions & 2 deletions packages/nx/src/plugins/package-json-workspaces/index.ts

This file was deleted.

Loading

0 comments on commit 51f5fe4

Please sign in to comment.