Skip to content

Commit

Permalink
fix(core): projects within folders that start with a . should be fo…
Browse files Browse the repository at this point in the history
…und (#18748)

(cherry picked from commit 9548714)
  • Loading branch information
AgentEnder authored and FrozenPandaz committed Aug 21, 2023
1 parent b402196 commit ea9b88c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
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

0 comments on commit ea9b88c

Please # to comment.