@lerna-lite/init
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0
import { Command, CommandType, InitCommandOption } from '@lerna-lite/core'; | ||
export declare function factory(argv: InitCommandOption): InitCommand; | ||
export declare class InitCommand extends Command<InitCommandOption> { | ||
/** command name */ | ||
name: CommandType; | ||
@@ -6,0 +5,0 @@ exact?: boolean; |
@@ -13,3 +13,2 @@ import { Command, exec } from '@lerna-lite/core'; | ||
super(argv); | ||
/** command name */ | ||
this.name = 'init'; | ||
@@ -45,3 +44,2 @@ this.exact = false; | ||
this.logger.info('', 'Creating package.json'); | ||
// initialize with default indentation so write-pkg doesn't screw it up with tabs | ||
await writeJsonFile(join(this.project.rootPath, 'package.json'), { name: 'root', private: true }, { indent: 2 }); | ||
@@ -55,9 +53,6 @@ } | ||
if (rootPkg.dependencies?.[LERNA_CLI_PKG_NAME]) { | ||
// lerna is a dependency in the current project | ||
targetDependencies = rootPkg.dependencies; | ||
} | ||
else { | ||
// lerna is a devDependency or no dependency, yet | ||
if (!rootPkg.devDependencies) { | ||
// mutate raw JSON object | ||
rootPkg.set('devDependencies', {}); | ||
@@ -68,3 +63,2 @@ } | ||
targetDependencies[LERNA_CLI_PKG_NAME] = this.exact ? this.lernaVersion : `^${this.lernaVersion}`; | ||
// add workspace packages in package.json when `useWorkspaces` enabled | ||
if (this.options.useWorkspaces && !rootPkg.workspaces) { | ||
@@ -76,3 +70,2 @@ rootPkg.workspaces = ['packages/*']; | ||
ensureLernaConfig() { | ||
// config already defaulted to empty object in Project constructor | ||
const { config, version: projectVersion } = this.project; | ||
@@ -91,5 +84,4 @@ let version; | ||
this.logger.info('', logMessage); | ||
delete config[LERNA_CLI_PKG_NAME]; // no longer relevant | ||
delete config[LERNA_CLI_PKG_NAME]; | ||
if (this.exact) { | ||
// ensure --exact is preserved for future init commands | ||
const commandConfig = config.command || (config.command = {}); | ||
@@ -96,0 +88,0 @@ const initConfig = commandConfig.init || (commandConfig.init = {}); |
{ | ||
"name": "@lerna-lite/init", | ||
"description": "Lerna-Lite init commmand - Create a new Lerna repo or upgrade an existing repo to the current version of Lerna", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0", | ||
"files": [ | ||
@@ -46,9 +46,8 @@ "/dist" | ||
"dependencies": { | ||
"@lerna-lite/core": "2.0.0-alpha.2", | ||
"@lerna-lite/core": "2.0.0", | ||
"fs-extra": "^11.1.1", | ||
"p-map": "^4.0.0", | ||
"path": "^0.12.7", | ||
"write-json-file": "^5.0.0" | ||
}, | ||
"gitHead": "7f5fab8f47795e5f1090c60bd2cb5d76aee4dbee" | ||
"gitHead": "95237d601339ac61a74983ee379b17e04f81582b" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4
0
14019
120
+ Added@lerna-lite/core@2.0.0(transitive)
+ Addedglobby@13.2.2(transitive)
+ Addedminimatch@9.0.5(transitive)
- Removedpath@^0.12.7
- Removed@lerna-lite/core@2.0.0-alpha.2(transitive)
- Removedglobby@13.1.3(transitive)
- Removedinherits@2.0.3(transitive)
- Removedminimatch@8.0.4(transitive)
- Removedpath@0.12.7(transitive)
- Removedprocess@0.11.10(transitive)
- Removedutil@0.10.4(transitive)
Updated@lerna-lite/core@2.0.0