Skip to content

Commit

Permalink
fix(core): repair sourcemaps that had file & plugin swapped (#26628)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8efe26c)
  • Loading branch information
MaxKless authored and FrozenPandaz committed Jun 26, 2024
1 parent 3dfdc18 commit c673392
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,60 @@ describe('project-configuration-utils', () => {
`);
}
});

it('should correctly set source maps', async () => {
const { sourceMaps } = await createProjectConfigurations(
undefined,
{},
['libs/a/project.json'],
[
new LoadedNxPlugin(fakeTargetsPlugin, 'fake-targets-plugin'),
new LoadedNxPlugin(fakeTagPlugin, 'fake-tag-plugin'),
]
);
expect(sourceMaps).toMatchInlineSnapshot(`
{
"libs/a": {
"name": [
"libs/a/project.json",
"fake-tag-plugin",
],
"root": [
"libs/a/project.json",
"fake-tag-plugin",
],
"tags": [
"libs/a/project.json",
"fake-tag-plugin",
],
"tags.fake-lib": [
"libs/a/project.json",
"fake-tag-plugin",
],
"targets": [
"libs/a/project.json",
"fake-targets-plugin",
],
"targets.build": [
"libs/a/project.json",
"fake-targets-plugin",
],
"targets.build.executor": [
"libs/a/project.json",
"fake-targets-plugin",
],
"targets.build.options": [
"libs/a/project.json",
"fake-targets-plugin",
],
"targets.build.options.command": [
"libs/a/project.json",
"fake-targets-plugin",
],
},
}
`);
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ function mergeCreateNodesResults(
> = {};

for (const result of results.flat()) {
const [file, pluginName, nodes] = result;
const [pluginName, file, nodes] = result;

const { projects: projectNodes, externalNodes: pluginExternalNodes } =
nodes;
Expand Down

0 comments on commit c673392

Please sign in to comment.