## Current Behavior
When a package has a subpath pattern like the following:
```json
{
"exports": {
"./*": {
"types": "./dist/lib/*/index.d.ts",
"import": "./dist/lib/*/index.js",
"default": "./dist/lib/*/index.js"
}
}
}
```
When constructing the graph the project is not picked as a dependency of
others projects that import from the package using a path that matches
that subpath pattern. This is currently happening because the current
resolution is wrongly using `minimatch` to match those patterns instead
of the [Node.js spec for resolving subpath
patterns](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification).
## Expected Behavior
Subpath patterns should be processed after the [Node.js
spec](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification)
and the graph should pick up dependencies when used.
## Related Issue(s)
Fixes #30342
@nx/devkit
The Nx Devkit is the underlying technology used to customize Nx to support different technologies and custom use-cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.
As with most things in Nx, the core of Nx Devkit is very simple. It only uses language primitives and immutable objects (the tree being the only exception).
Table of contents
Enumerations
Classes
Interfaces
- CreateDependenciesContext
- CreateNodesContext
- CreateNodesContextV2
- CreateNodesResult
- DefaultTasksRunnerOptions
- ExecutorContext
- ExecutorsJson
- FileChange
- FileData
- FileMap
- GeneratorsJson
- GraphJson
- Hash
- HasherContext
- ImplicitJsonSubsetDependency
- JsonParseOptions
- JsonSerializeOptions
- MigrationsJson
- NxAffectedConfig
- NxJsonConfiguration
- ProjectConfiguration
- ProjectFileMap
- ProjectGraph
- ProjectGraphDependency
- ProjectGraphExternalNode
- ProjectGraphProjectNode
- ProjectsConfigurations
- RemoteCache
- StringDeletion
- StringInsertion
- Target
- TargetConfiguration
- TargetDependencyConfig
- Task
- TaskGraph
- TaskHasher
- TaskResult
- Tree
- Workspace
Type Aliases
- AsyncIteratorExecutor
- CreateDependencies
- CreateMetadata
- CreateMetadataContext
- CreateNodes
- CreateNodesFunction
- CreateNodesFunctionV2
- CreateNodesResultV2
- CreateNodesV2
- CustomHasher
- DynamicDependency
- Executor
- ExpandedPluginConfiguration
- Generator
- GeneratorCallback
- Hasher
- ImplicitDependency
- ImplicitDependencyEntry
- NxPlugin
- NxPluginV2
- PackageManager
- PluginConfiguration
- PostTasksExecution
- PostTasksExecutionContext
- PreTasksExecution
- PreTasksExecutionContext
- ProjectType
- ProjectsMetadata
- PromiseExecutor
- RawProjectGraphDependency
- StaticDependency
- StringChange
- TargetDefaults
- TaskGraphExecutor
- TaskResults
- ToJSOptions
- WorkspaceJsonConfiguration
Variables
- NX_VERSION: string
- cacheDir: string
- logger: Object
- output: CLIOutput
- workspaceRoot: string
Functions
- addDependenciesToPackageJson
- addProjectConfiguration
- applyChangesToString
- convertNxExecutor
- convertNxGenerator
- createNodesFromFiles
- createProjectFileMapUsingProjectGraph
- createProjectGraphAsync
- defaultTasksRunner
- detectPackageManager
- ensurePackage
- extractLayoutDirectory
- formatFiles
- generateFiles
- getOutputsForTargetAndConfiguration
- getPackageManagerCommand
- getPackageManagerVersion
- getProjects
- getWorkspaceLayout
- glob
- globAsync
- hashArray
- installPackagesTask
- isDaemonEnabled
- isWorkspacesEnabled
- joinPathFragments
- moveFilesToNewDirectory
- names
- normalizePath
- offsetFromRoot
- parseJson
- parseTargetString
- readCachedProjectGraph
- readJson
- readJsonFile
- readNxJson
- readProjectConfiguration
- readProjectsConfigurationFromProjectGraph
- readTargetOptions
- removeDependenciesFromPackageJson
- removeProjectConfiguration
- reverse
- runExecutor
- runTasksInSerial
- serializeJson
- stripIndents
- stripJsonComments
- targetToTargetString
- toJS
- updateJson
- updateNxJson
- updateProjectConfiguration
- updateTsConfigsToJs
- validateDependency
- visitNotIgnoredFiles
- workspaceLayout
- writeJson
- writeJsonFile