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): projects within folders that start with a . should be found #18748

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/nx/src/generators/utils/project-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ function findCreatedProjectFiles(tree: Tree, globPatterns: string[]) {
for (const change of tree.listChanges()) {
if (change.type === 'CREATE') {
const fileName = basename(change.path);
if (globPatterns.some((pattern) => minimatch(change.path, pattern))) {
if (
globPatterns.some((pattern) =>
minimatch(change.path, pattern, { dot: true })
)
) {
createdProjectFiles.push(change.path);
} else if (fileName === 'package.json') {
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/hasher/task-hasher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class TaskHasherImpl {
const filteredFiles = outputFiles.filter(
(p) =>
p === dependentTasksOutputFiles ||
minimatch(p, dependentTasksOutputFiles)
minimatch(p, dependentTasksOutputFiles, { dot: true })
);
const hashDetails = {};
const hashes: string[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const getTouchedProjectsFromProjectGlobChanges: TouchedProjectLocator =

const touchedProjects = new Set<string>();
for (const touchedFile of touchedFiles) {
const isProjectFile = minimatch(touchedFile.file, globPattern);
const isProjectFile = minimatch(touchedFile.file, globPattern, {
dot: true,
});
if (isProjectFile) {
// If the file no longer exists on disk, then it was deleted
if (!existsSync(join(workspaceRoot, touchedFile.file))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const getImplicitlyTouchedProjects: TouchedProjectLocator = (

for (const [pattern, projects] of Object.entries(implicits)) {
const implicitDependencyWasChanged = fileChanges.some((f) =>
minimatch(f.file, pattern)
minimatch(f.file, pattern, { dot: true })
);
if (!implicitDependencyWasChanged) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function buildProjectsConfigurationsFromProjectPathsAndPlugins(
continue;
}
for (const file of projectFiles) {
if (minimatch(file, pattern)) {
if (minimatch(file, pattern, { dot: true })) {
const { projects: projectNodes, externalNodes: pluginExternalNodes } =
configurationConstructor(file, {
nxJsonConfiguration: nxJson,
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/utils/find-matching-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export const getMatchingStringsWithCache = (() => {
}
const patternCache = minimatchCache.get(pattern)!;
if (!regexCache.has(pattern)) {
const regex = minimatch.makeRe(pattern);
const regex = minimatch.makeRe(pattern, { dot: true });
if (regex) {
regexCache.set(pattern, regex);
} else {
Expand Down