Skip to content

Commit ea9b88c

Browse files
AgentEnderFrozenPandaz
authored andcommittedAug 21, 2023
fix(core): projects within folders that start with a . should be found (#18748)
(cherry picked from commit 9548714)
1 parent b402196 commit ea9b88c

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed
 

‎packages/nx/src/generators/utils/project-configuration.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ function findCreatedProjectFiles(tree: Tree, globPatterns: string[]) {
252252
for (const change of tree.listChanges()) {
253253
if (change.type === 'CREATE') {
254254
const fileName = basename(change.path);
255-
if (globPatterns.some((pattern) => minimatch(change.path, pattern))) {
255+
if (
256+
globPatterns.some((pattern) =>
257+
minimatch(change.path, pattern, { dot: true })
258+
)
259+
) {
256260
createdProjectFiles.push(change.path);
257261
} else if (fileName === 'package.json') {
258262
try {

‎packages/nx/src/hasher/task-hasher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ class TaskHasherImpl {
408408
const filteredFiles = outputFiles.filter(
409409
(p) =>
410410
p === dependentTasksOutputFiles ||
411-
minimatch(p, dependentTasksOutputFiles)
411+
minimatch(p, dependentTasksOutputFiles, { dot: true })
412412
);
413413
const hashDetails = {};
414414
const hashes: string[] = [];

‎packages/nx/src/project-graph/affected/locators/project-glob-changes.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export const getTouchedProjectsFromProjectGlobChanges: TouchedProjectLocator =
2323

2424
const touchedProjects = new Set<string>();
2525
for (const touchedFile of touchedFiles) {
26-
const isProjectFile = minimatch(touchedFile.file, globPattern);
26+
const isProjectFile = minimatch(touchedFile.file, globPattern, {
27+
dot: true,
28+
});
2729
if (isProjectFile) {
2830
// If the file no longer exists on disk, then it was deleted
2931
if (!existsSync(join(workspaceRoot, touchedFile.file))) {

‎packages/nx/src/project-graph/affected/locators/workspace-projects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getImplicitlyTouchedProjects: TouchedProjectLocator = (
4949

5050
for (const [pattern, projects] of Object.entries(implicits)) {
5151
const implicitDependencyWasChanged = fileChanges.some((f) =>
52-
minimatch(f.file, pattern)
52+
minimatch(f.file, pattern, { dot: true })
5353
);
5454
if (!implicitDependencyWasChanged) {
5555
continue;

‎packages/nx/src/project-graph/utils/project-configuration-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function buildProjectsConfigurationsFromProjectPathsAndPlugins(
103103
continue;
104104
}
105105
for (const file of projectFiles) {
106-
if (minimatch(file, pattern)) {
106+
if (minimatch(file, pattern, { dot: true })) {
107107
const { projects: projectNodes, externalNodes: pluginExternalNodes } =
108108
configurationConstructor(file, {
109109
nxJsonConfiguration: nxJson,

‎packages/nx/src/utils/find-matching-projects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export const getMatchingStringsWithCache = (() => {
245245
}
246246
const patternCache = minimatchCache.get(pattern)!;
247247
if (!regexCache.has(pattern)) {
248-
const regex = minimatch.makeRe(pattern);
248+
const regex = minimatch.makeRe(pattern, { dot: true });
249249
if (regex) {
250250
regexCache.set(pattern, regex);
251251
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.