@lerna-lite/core
Advanced tools
Comparing version 3.10.1 to 3.11.0
@@ -10,2 +10,6 @@ import { CyclicPackageGraphNode } from './lib/cyclic-package-graph-node.js'; | ||
addDependents(filteredPackages: Package[]): Package[]; | ||
readWorkspaceCatalogConfig(): { | ||
catalog: any; | ||
catalogs: any; | ||
}; | ||
extendList(packageList: Package[], nodeProp: 'localDependencies' | 'localDependents'): Package[]; | ||
@@ -12,0 +16,0 @@ collapseCycles(rejectCycles?: boolean): Set<CyclicPackageGraphNode>; |
@@ -0,2 +1,5 @@ | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import npa from 'npm-package-arg'; | ||
import { parse } from 'yaml'; | ||
import { CyclicPackageGraphNode } from './lib/cyclic-package-graph-node.js'; | ||
@@ -29,2 +32,3 @@ import { PackageGraphNode } from './lib/package-graph-node.js'; | ||
} | ||
const { catalog, catalogs } = this.readWorkspaceCatalogConfig(); | ||
this.forEach((currentNode, currentName) => { | ||
@@ -40,2 +44,13 @@ const graphDependencies = graphType === 'dependencies' | ||
} | ||
const isCatalogSpec = /^catalog:/.test(spec); | ||
if (isCatalogSpec) { | ||
spec = spec.replace(/^catalog:/, ''); | ||
const catalogVersion = spec === '' || spec === 'default' ? catalog[depName] : catalogs[spec]?.[depName]; | ||
if (catalogVersion) { | ||
spec = catalogVersion; | ||
} | ||
else { | ||
console.warn(`Warning: No version found in ${spec || 'default'} catalog for ${depName}`); | ||
} | ||
} | ||
const isWorkspaceSpec = /^workspace:/.test(spec); | ||
@@ -80,2 +95,12 @@ let fullWorkspaceSpec; | ||
} | ||
readWorkspaceCatalogConfig() { | ||
const workspaceConfigPath = path.join(process.cwd(), 'pnpm-workspace.yaml'); | ||
const { catalog = {}, catalogs = {} } = fs.existsSync(workspaceConfigPath) | ||
? parse(fs.readFileSync(workspaceConfigPath, 'utf8')) | ||
: {}; | ||
return { | ||
catalog, | ||
catalogs, | ||
}; | ||
} | ||
extendList(packageList, nodeProp) { | ||
@@ -82,0 +107,0 @@ const search = new Set(packageList.map(({ name }) => this.get(name))); |
{ | ||
"name": "@lerna-lite/core", | ||
"description": "Lerna-Lite core implementation module", | ||
"version": "3.10.1", | ||
"version": "3.11.0", | ||
"publishConfig": { | ||
@@ -22,3 +22,3 @@ "access": "public" | ||
"type": "git", | ||
"url": "https://github.com/lerna-lite/lerna-lite.git", | ||
"url": "git+https://github.com/lerna-lite/lerna-lite.git", | ||
"directory": "packages/core" | ||
@@ -33,6 +33,6 @@ }, | ||
"dependencies": { | ||
"@inquirer/expand": "^4.0.2", | ||
"@inquirer/input": "^4.0.2", | ||
"@inquirer/select": "^4.0.2", | ||
"@lerna-lite/npmlog": "3.10.1", | ||
"@inquirer/expand": "^4.0.4", | ||
"@inquirer/input": "^4.1.1", | ||
"@inquirer/select": "^4.0.4", | ||
"@lerna-lite/npmlog": "3.11.0", | ||
"@npmcli/run-script": "^8.1.0", | ||
@@ -46,3 +46,3 @@ "clone-deep": "^4.0.1", | ||
"glob-parent": "^6.0.2", | ||
"is-ci": "^3.0.1", | ||
"is-ci": "^4.1.0", | ||
"json5": "^2.2.3", | ||
@@ -53,3 +53,3 @@ "load-json-file": "^7.0.1", | ||
"npm-package-arg": "^11.0.3", | ||
"p-map": "^7.0.2", | ||
"p-map": "^7.0.3", | ||
"p-queue": "^8.0.1", | ||
@@ -64,3 +64,4 @@ "resolve-from": "^5.0.0", | ||
"write-json-file": "^6.0.0", | ||
"write-package": "^7.1.0" | ||
"write-package": "^7.1.0", | ||
"yaml": "2.7.0" | ||
}, | ||
@@ -71,3 +72,3 @@ "funding": { | ||
}, | ||
"gitHead": "a91533e4b898d24e4ae844a74e74fd210d9ec716" | ||
"gitHead": "2cf5915b05caeb82aa5d60cc9ca21df0892c183b" | ||
} |
Sorry, the diff of this file is not supported yet
244704
3493
30
+ Addedyaml@2.7.0
+ Added@lerna-lite/npmlog@3.11.0(transitive)
+ Addedci-info@4.1.0(transitive)
+ Addedis-ci@4.1.0(transitive)
+ Addedyaml@2.7.0(transitive)
- Removed@lerna-lite/npmlog@3.10.1(transitive)
- Removedci-info@3.9.0(transitive)
- Removedis-ci@3.0.1(transitive)
Updated@inquirer/expand@^4.0.4
Updated@inquirer/input@^4.1.1
Updated@inquirer/select@^4.0.4
Updated@lerna-lite/npmlog@3.11.0
Updatedis-ci@^4.1.0
Updatedp-map@^7.0.3