File tree 1 file changed +5
-23
lines changed 1 file changed +5
-23
lines changed Original file line number Diff line number Diff line change 13
13
const path = require ( 'path' ) ;
14
14
const fs = require ( 'fs' ) ;
15
15
16
- const Command = require ( '@lerna/command' ) ;
17
-
18
- /**
19
- * A dummy command to get filtered packages
20
- */
21
- class NopCommand extends Command {
22
- get requiresGit ( ) {
23
- return false ;
24
- }
25
-
26
- initialize ( ) {
27
- // No-op
28
- }
29
-
30
- execute ( ) {
31
- // No-op
32
- }
33
- }
16
+ const Project = require ( '@lerna/project' ) ;
34
17
35
18
async function updateTemplateDeps ( ) {
36
- const cmd = new NopCommand ( { _ : [ ] , loglevel : 'silent' } ) ;
37
-
38
- await cmd ; // Execute the command
19
+ const project = new Project ( process . cwd ( ) ) ;
20
+ const packages = await project . getPackages ( ) ;
39
21
40
- const pkgs = cmd . filteredPackages . filter ( pkg => ! pkg . private ) . map ( pkg => ( {
22
+ const pkgs = packages . filter ( pkg => ! pkg . private ) . map ( pkg => ( {
41
23
name : pkg . name ,
42
24
version : pkg . version ,
43
25
} ) ) ;
@@ -47,7 +29,7 @@ async function updateTemplateDeps() {
47
29
lbModules [ p . name ] = '^' + p . version ;
48
30
}
49
31
50
- const rootPath = cmd . project . rootPath ;
32
+ const rootPath = project . rootPath ;
51
33
52
34
// Load dependencies from `packages/build/package.json`
53
35
const buildDeps = require ( path . join ( rootPath , 'packages/build/package.json' ) )
You can’t perform that action at this time.
0 commit comments