Skip to content

Commit

Permalink
fix(core): fix slashes in inputs migrations (#12444)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Oct 7, 2022
1 parent 678bb83 commit 85a5c89
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
@@ -1,11 +1,11 @@
import {
formatFiles,
joinPathFragments,
readWorkspaceConfiguration,
Tree,
updateWorkspaceConfiguration,
} from '@nrwl/devkit';
import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils';
import { join } from 'path';

export default async function (tree: Tree) {
const workspaceConfiguration = readWorkspaceConfiguration(tree);
Expand All @@ -31,7 +31,9 @@ export default async function (tree: Tree) {

lintTargetDefaults.inputs ??= [
'default',
...(globalEslintFile ? [join('{workspaceRoot}', globalEslintFile)] : []),
...(globalEslintFile
? [joinPathFragments('{workspaceRoot}', globalEslintFile)]
: []),
];
}

Expand Down
8 changes: 5 additions & 3 deletions packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts
Expand Up @@ -6,7 +6,7 @@ import {
updateProjectConfiguration,
updateWorkspaceConfiguration,
} from '../../generators/utils/project-configuration';
import { join } from 'path';
import { joinPathFragments } from '../../utils/path';

const skippedFiles = [
'package.json', // Not to be added to filesets
Expand Down Expand Up @@ -73,15 +73,17 @@ export default async function (tree: Tree) {
const projectSpecificFileset = new Set(
project.namedInputs.projectSpecificFiles ?? []
);
projectSpecificFileset.add(join('{workspaceRoot}', files));
projectSpecificFileset.add(
joinPathFragments('{workspaceRoot}', files)
);
project.namedInputs.projectSpecificFiles = Array.from(
projectSpecificFileset
);
updateProjectConfiguration(tree, dependent, project);
}
} else {
workspaceConfiguration.namedInputs.sharedGlobals.push(
join('{workspaceRoot}', files)
joinPathFragments('{workspaceRoot}', files)
);
}
}
Expand Down
@@ -1,10 +1,10 @@
import {
formatFiles,
joinPathFragments,
readWorkspaceConfiguration,
Tree,
updateWorkspaceConfiguration,
} from '@nrwl/devkit';
import { join } from 'path';

export default async function (tree: Tree) {
const workspaceConfiguration = readWorkspaceConfiguration(tree);
Expand All @@ -17,7 +17,9 @@ export default async function (tree: Tree) {
const sharedGlobalFileset = new Set(
workspaceConfiguration.namedInputs.sharedGlobals
);
sharedGlobalFileset.add(join('{workspaceRoot}', globalBabelFile));
sharedGlobalFileset.add(
joinPathFragments('{workspaceRoot}', globalBabelFile)
);
workspaceConfiguration.namedInputs.sharedGlobals =
Array.from(sharedGlobalFileset);
}
Expand Down
@@ -1,10 +1,10 @@
import {
formatFiles,
joinPathFragments,
readWorkspaceConfiguration,
Tree,
updateWorkspaceConfiguration,
} from '@nrwl/devkit';
import { join } from 'path';

export default async function (tree: Tree) {
const workspaceConfiguration = readWorkspaceConfiguration(tree);
Expand All @@ -17,7 +17,9 @@ export default async function (tree: Tree) {
const sharedGlobalFileset = new Set(
workspaceConfiguration.namedInputs.sharedGlobals
);
sharedGlobalFileset.add(join('{workspaceRoot}', globalBabelFile));
sharedGlobalFileset.add(
joinPathFragments('{workspaceRoot}', globalBabelFile)
);
workspaceConfiguration.namedInputs.sharedGlobals =
Array.from(sharedGlobalFileset);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/web/src/migrations/update-15-0-0/add-babel-inputs.ts
@@ -1,10 +1,10 @@
import {
formatFiles,
joinPathFragments,
readWorkspaceConfiguration,
Tree,
updateWorkspaceConfiguration,
} from '@nrwl/devkit';
import { join } from 'path';

export default async function (tree: Tree) {
const workspaceConfiguration = readWorkspaceConfiguration(tree);
Expand All @@ -17,7 +17,9 @@ export default async function (tree: Tree) {
const sharedGlobalFileset = new Set(
workspaceConfiguration.namedInputs.sharedGlobals
);
sharedGlobalFileset.add(join('{workspaceRoot}', globalBabelFile));
sharedGlobalFileset.add(
joinPathFragments('{workspaceRoot}', globalBabelFile)
);
workspaceConfiguration.namedInputs.sharedGlobals =
Array.from(sharedGlobalFileset);
}
Expand Down
@@ -1,10 +1,10 @@
import {
formatFiles,
joinPathFragments,
readWorkspaceConfiguration,
Tree,
updateWorkspaceConfiguration,
} from '@nrwl/devkit';
import { join } from 'path';

export default async function (tree: Tree) {
const workspaceConfiguration = readWorkspaceConfiguration(tree);
Expand All @@ -17,7 +17,9 @@ export default async function (tree: Tree) {
const sharedGlobalFileset = new Set(
workspaceConfiguration.namedInputs.sharedGlobals
);
sharedGlobalFileset.add(join('{workspaceRoot}', globalBabelFile));
sharedGlobalFileset.add(
joinPathFragments('{workspaceRoot}', globalBabelFile)
);
workspaceConfiguration.namedInputs.sharedGlobals =
Array.from(sharedGlobalFileset);
}
Expand Down

1 comment on commit 85a5c89

@vercel
Copy link

@vercel vercel bot commented on 85a5c89 Oct 7, 2022

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
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.