File tree Expand file tree Collapse file tree 2 files changed +18
-25
lines changed Expand file tree Collapse file tree 2 files changed +18
-25
lines changed Original file line number Diff line number Diff line change 1+ import { readJsonFile } from '@nx/devkit' ;
2+ import { join } from 'node:path' ;
3+ import type { PackageJson } from 'nx/src/utils/package-json' ;
4+
5+ const workspaceRoot = join ( __dirname , '../../' ) ;
6+ const projectsFolder = join ( __dirname , '../../../' ) ;
7+
8+ export const cpNxPluginVersion = ( ) => loadPackageJson ( workspaceRoot ) . version ;
9+ export const cpModelVersion = ( ) =>
10+ loadPackageJson ( join ( projectsFolder , 'cli' ) ) . version ;
11+ export const cpUtilsVersion = ( ) =>
12+ loadPackageJson ( join ( projectsFolder , 'utils' ) ) . version ;
13+ export const cpCliVersion = ( ) =>
14+ loadPackageJson ( join ( projectsFolder , 'models' ) ) . version ;
15+
16+ function loadPackageJson ( folderPath : string ) {
17+ return readJsonFile < PackageJson > ( join ( folderPath , 'package.json' ) ) ;
18+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments