Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix slashes in inputs migrations #12444

Merged
merged 1 commit into from Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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
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
@@ -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