Repository: lerna/lerna

Issue #1886: Feature: lerna remove
Created: 2019-01-23T09:40:33Z
Removes dependency from packages, the inverse of @lerna/add
Currently there's no way to remove a dependency from a lerna package,
the closest way we can do is to manually remove from package.json, lerna clean --yes --scope=xxx + lerna bootstrap --scope=xxx.
This command provides the remove dependency feature. Just like npm uninstall or yarn remove.

Duplicate issue #2742: feat: support custom command like `@lerna/remove`
Created: 2020-10-20T10:56:50Z
I saw the source code:

  
    
      lerna/core/lerna/index.js
    
    
        Lines 5 to 47
      in
      f6e7a13
    
  
  
    

        
          
           const addCmd = require("@lerna/add/command"); 
        

        
          
           const bootstrapCmd = require("@lerna/bootstrap/command"); 
        

        
          
           const changedCmd = require("@lerna/changed/command"); 
        

        
          
           const cleanCmd = require("@lerna/clean/command"); 
        

        
          
           const createCmd = require("@lerna/create/command"); 
        

        
          
           const diffCmd = require("@lerna/diff/command"); 
        

        
          
           const execCmd = require("@lerna/exec/command"); 
        

        
          
           const importCmd = require("@lerna/import/command"); 
        

        
          
           const infoCmd = require("@lerna/info/command"); 
        

        
          
           const initCmd = require("@lerna/init/command"); 
        

        
          
           const linkCmd = require("@lerna/link/command"); 
        

        
          
           const listCmd = require("@lerna/list/command"); 
        

        
          
           const publishCmd = require("@lerna/publish/command"); 
        

        
          
           const runCmd = require("@lerna/run/command"); 
        

        
          
           const versionCmd = require("@lerna/version/command"); 
        

        
          
            
        

        
          
           const pkg = require("./package.json"); 
        

        
          
            
        

        
          
           module.exports = main; 
        

        
          
            
        

        
          
           function main(argv) { 
        

        
          
             const context = { 
        

        
          
               lernaVersion: pkg.version, 
        

        
          
             }; 
        

        
          
            
        

        
          
             return cli() 
        

        
          
               .command(addCmd) 
        

        
          
               .command(bootstrapCmd) 
        

        
          
               .command(changedCmd) 
        

        
          
               .command(cleanCmd) 
        

        
          
               .command(createCmd) 
        

        
          
               .command(diffCmd) 
        

        
          
               .command(execCmd) 
        

        
          
               .command(importCmd) 
        

        
          
               .command(infoCmd) 
        

        
          
               .command(initCmd) 
        

        
          
               .command(linkCmd) 
        

        
          
               .command(listCmd) 
        

        
          
               .command(publishCmd) 
        

        
          
               .command(runCmd) 
        

        
          
               .command(versionCmd) 
        

        
          
               .parse(argv, context); 
        

        
          
           } 
        
    
  


I hope lerna supports to extend custom command like @lerna/remove and more.

lerna.json

{
   "moreCommand": ["@lerna/remove/command"]
}

Closing comment (2020-10-25T09:09:36Z): Duplicate of #1886