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)
  • Loading branch information
AgentEnder committed Aug 21, 2023
1 parent 4a25576 commit 9548714
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
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
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
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
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
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
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

1 comment on commit 9548714

@vercel
Copy link

@vercel vercel bot commented on 9548714 Aug 21, 2023

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

Please sign in to comment.