@teambit/cli 0.0.1249 → 0.0.1250
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.main.runtime.js
CHANGED
|
@@ -32,27 +32,6 @@ function _commandGroups() {
|
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
|
-
function _hostInitializer() {
|
|
36
|
-
const data = require("@teambit/host-initializer");
|
|
37
|
-
_hostInitializer = function () {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
function _legacy2() {
|
|
43
|
-
const data = require("@teambit/legacy.consumer");
|
|
44
|
-
_legacy2 = function () {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
function _workspaceModules() {
|
|
50
|
-
const data = require("@teambit/workspace.modules.workspace-locator");
|
|
51
|
-
_workspaceModules = function () {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
35
|
function _logger() {
|
|
57
36
|
const data = require("@teambit/logger");
|
|
58
37
|
_logger = function () {
|
|
@@ -264,7 +243,6 @@ class CLIMain {
|
|
|
264
243
|
static async provider([loggerMain], config, [commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot]) {
|
|
265
244
|
const logger = loggerMain.createLogger(_cli().CLIAspect.id);
|
|
266
245
|
const cliMain = new CLIMain(commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot, logger);
|
|
267
|
-
await ensureWorkspaceAndScope();
|
|
268
246
|
const cliGenerateCmd = new (_cli2().CliGenerateCmd)(cliMain);
|
|
269
247
|
const cliCmd = new (_cli2().CliCmd)(cliMain);
|
|
270
248
|
const helpCmd = new (_help().HelpCmd)(cliMain);
|
|
@@ -278,25 +256,6 @@ _defineProperty(CLIMain, "dependencies", [_logger().LoggerAspect]);
|
|
|
278
256
|
_defineProperty(CLIMain, "runtime", _cli().MainRuntime);
|
|
279
257
|
_defineProperty(CLIMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
280
258
|
_cli().CLIAspect.addRuntime(CLIMain);
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* kind of a hack.
|
|
284
|
-
* in the legacy, this is running at the beginning and it take care of issues when Bit files are missing,
|
|
285
|
-
* such as ".bit".
|
|
286
|
-
* (to make this process better, you can easily remove it and run the e2e-tests. you'll see some failing)
|
|
287
|
-
*/
|
|
288
|
-
async function ensureWorkspaceAndScope() {
|
|
289
|
-
try {
|
|
290
|
-
await (0, _legacy2().loadConsumerIfExist)();
|
|
291
|
-
} catch {
|
|
292
|
-
const potentialWsPath = process.cwd();
|
|
293
|
-
const consumerInfo = await (0, _workspaceModules().getWorkspaceInfo)(potentialWsPath);
|
|
294
|
-
if (consumerInfo && !consumerInfo.hasScope && consumerInfo.hasBitMap && consumerInfo.hasWorkspaceConfig) {
|
|
295
|
-
await _hostInitializer().HostInitializerMain.init(potentialWsPath);
|
|
296
|
-
}
|
|
297
|
-
// do nothing. it could fail for example with ScopeNotFound error, which is taken care of in "bit init".
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
259
|
function isFullUrl(url) {
|
|
301
260
|
return url.startsWith('http://') || url.startsWith('https://');
|
|
302
261
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","_legacy","_pMapSeries","_interopRequireDefault","_commandGroups","_hostInitializer","_legacy2","_workspaceModules","_logger","_lodash","_cli","_getCommandId","_cliParser","_completion","_cli2","_help","_version","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CLIMain","constructor","commandsSlot","onStartSlot","onCommandStartSlot","onBeforeExitSlot","logger","clone","groups","register","commands","forEach","command","setDefaults","cmd","unregister","commandName","toArray","aspectId","filteredCommands","filter","getCommandId","name","map","set","values","flat","getCommand","find","getCommandByNameOrAlias","alias","registerGroup","description","consoleWarning","registerOnStart","onStartFn","registerOnCommandStart","onCommandStartFn","registerOnBeforeExit","onBeforeExitFn","legacyLogger","registerOnBeforeExitFn","run","hasWorkspace","invokeOnStart","CliParser","CLIParser","commandRunner","parse","runCommand","onStartFns","foundCmd","findCommandByArgv","currentCommandName","process","argv","pMapSeries","onStart","extendedDescription","group","options","private","trim","loader","undefined","loadAspects","helpUrl","isFullUrl","provider","loggerMain","config","createLogger","CLIAspect","id","cliMain","ensureWorkspaceAndScope","cliGenerateCmd","CliGenerateCmd","cliCmd","CliCmd","helpCmd","HelpCmd","push","CompletionCmd","VersionCmd","exports","LoggerAspect","MainRuntime","Slot","withType","addRuntime","loadConsumerIfExist","potentialWsPath","cwd","consumerInfo","getWorkspaceInfo","hasScope","hasBitMap","hasWorkspaceConfig","HostInitializerMain","init","url","startsWith"],"sources":["cli.main.runtime.ts"],"sourcesContent":["import type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { logger as legacyLogger } from '@teambit/legacy.logger';\nimport type { CLIArgs, Flags, Command } from './command';\nimport pMapSeries from 'p-map-series';\nimport type { GroupsType } from './command-groups';\nimport { groups } from './command-groups';\nimport { HostInitializerMain } from '@teambit/host-initializer';\nimport { loadConsumerIfExist } from '@teambit/legacy.consumer';\nimport { getWorkspaceInfo } from '@teambit/workspace.modules.workspace-locator';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { clone } from 'lodash';\nimport { CLIAspect, MainRuntime } from './cli.aspect';\nimport { getCommandId } from './get-command-id';\nimport { CLIParser, findCommandByArgv } from './cli-parser';\nimport { CompletionCmd } from './completion.cmd';\nimport { CliCmd, CliGenerateCmd } from './cli.cmd';\nimport { HelpCmd } from './help.cmd';\nimport { VersionCmd } from './version.cmd';\n\nexport type CommandList = Array<Command>;\nexport type OnStart = (hasWorkspace: boolean, currentCommand: string, commandObject?: Command) => Promise<void>;\nexport type OnCommandStart = (commandName: string, args: CLIArgs, flags: Flags) => Promise<void>;\nexport type OnBeforeExitFn = () => Promise<void>;\n\nexport type OnStartSlot = SlotRegistry<OnStart>;\nexport type OnCommandStartSlot = SlotRegistry<OnCommandStart>;\nexport type CommandsSlot = SlotRegistry<CommandList>;\nexport type OnBeforeExitSlot = SlotRegistry<OnBeforeExitFn>;\n\nexport class CLIMain {\n public groups: GroupsType = clone(groups); // if it's not cloned, it is cached across loadBit() instances\n constructor(\n private commandsSlot: CommandsSlot,\n private onStartSlot: OnStartSlot,\n readonly onCommandStartSlot: OnCommandStartSlot,\n private onBeforeExitSlot: OnBeforeExitSlot,\n private logger: Logger\n ) {}\n\n /**\n * registers a new command in to the CLI.\n */\n register(...commands: CommandList) {\n commands.forEach((command) => {\n this.setDefaults(command);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n command.commands!.forEach((cmd) => this.setDefaults(cmd));\n });\n this.commandsSlot.register(commands);\n }\n\n /**\n * helpful for having the same command name in different environments (e.g. legacy and non-legacy).\n * for example `cli.unregister('tag');` removes the \"bit tag\" command.\n */\n unregister(commandName: string) {\n this.commandsSlot.toArray().forEach(([aspectId, commands]) => {\n const filteredCommands = commands.filter((command) => {\n return getCommandId(command.name) !== commandName;\n });\n this.commandsSlot.map.set(aspectId, filteredCommands);\n });\n }\n\n /**\n * list of all registered commands. (legacy and new).\n */\n get commands(): CommandList {\n return this.commandsSlot.values().flat();\n }\n\n /**\n * get an instance of a registered command. (useful for aspects to modify and extend existing commands)\n */\n getCommand(name: string): Command | undefined {\n return this.commands.find((command) => getCommandId(command.name) === name);\n }\n\n getCommandByNameOrAlias(name: string): Command | undefined {\n const command = this.getCommand(name);\n if (command) return command;\n return this.commands.find((cmd) => cmd.alias === name);\n }\n\n /**\n * when running `bit help`, commands are grouped by categories.\n * this method helps registering a new group by providing its name and a description.\n * the name is what needs to be assigned to the `group` property of the Command interface.\n * the description is what shown in the `bit help` output.\n */\n registerGroup(name: string, description: string) {\n if (this.groups[name]) {\n this.logger.consoleWarning(`CLI group \"${name}\" is already registered`);\n } else {\n this.groups[name] = description;\n }\n }\n\n /**\n * onStart is when bootstrapping the CLI. (it happens before onCommandStart)\n */\n registerOnStart(onStartFn: OnStart) {\n this.onStartSlot.register(onStartFn);\n return this;\n }\n\n /**\n * onCommandStart is when a command is about to start and we have the command object and the parsed args and flags\n * already. (it happens after onStart)\n */\n registerOnCommandStart(onCommandStartFn: OnCommandStart) {\n this.onCommandStartSlot.register(onCommandStartFn);\n return this;\n }\n\n /**\n * This will register a function to be called before the process exits.\n * This will run only for \"regular\" exits\n * e.g.\n * yes - command run and finished successfully\n * yes - command run and failed gracefully (code 1)\n * not SIGKILL (kill -9)\n * not SIGINT (Ctrl+C)\n * not SIGTERM (kill)\n * not uncaughtException\n * not unhandledRejection\n *\n * @param onBeforeExitFn\n * @returns\n */\n registerOnBeforeExit(onBeforeExitFn: OnBeforeExitFn) {\n this.onBeforeExitSlot.register(onBeforeExitFn);\n legacyLogger.registerOnBeforeExitFn(onBeforeExitFn);\n return this;\n }\n\n /**\n * execute commands registered to this aspect.\n */\n async run(hasWorkspace: boolean) {\n await this.invokeOnStart(hasWorkspace);\n const CliParser = new CLIParser(this.commands, this.groups, this.onCommandStartSlot);\n const commandRunner = await CliParser.parse();\n await commandRunner.runCommand();\n }\n\n private async invokeOnStart(hasWorkspace: boolean) {\n const onStartFns = this.onStartSlot.values();\n const foundCmd = findCommandByArgv(this.commands);\n const currentCommandName = process.argv[2];\n await pMapSeries(onStartFns, (onStart) => onStart(hasWorkspace, currentCommandName, foundCmd));\n }\n\n private setDefaults(command: Command) {\n command.alias = command.alias || '';\n command.description = command.description || '';\n command.extendedDescription = command.extendedDescription || '';\n command.group = command.group || 'ungrouped';\n command.options = command.options || [];\n command.private = command.private || false;\n command.commands = command.commands || [];\n command.name = command.name.trim();\n if (command.loader === undefined) {\n command.loader = true;\n }\n if (command.loadAspects === undefined) {\n command.loadAspects = true;\n }\n if (command.helpUrl && !isFullUrl(command.helpUrl)) {\n command.helpUrl = `https://bit.dev/${command.helpUrl}`;\n }\n }\n\n static dependencies = [LoggerAspect];\n static runtime = MainRuntime;\n static slots = [\n Slot.withType<CommandList>(),\n Slot.withType<OnStart>(),\n Slot.withType<OnCommandStart>(),\n Slot.withType<OnBeforeExitFn>(),\n ];\n\n static async provider(\n [loggerMain]: [LoggerMain],\n config,\n [commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot]: [\n CommandsSlot,\n OnStartSlot,\n OnCommandStartSlot,\n OnBeforeExitSlot,\n ]\n ) {\n const logger = loggerMain.createLogger(CLIAspect.id);\n const cliMain = new CLIMain(commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot, logger);\n await ensureWorkspaceAndScope();\n const cliGenerateCmd = new CliGenerateCmd(cliMain);\n const cliCmd = new CliCmd(cliMain);\n const helpCmd = new HelpCmd(cliMain);\n cliCmd.commands.push(cliGenerateCmd);\n cliMain.register(new CompletionCmd(), cliCmd, helpCmd, new VersionCmd());\n return cliMain;\n }\n}\n\nCLIAspect.addRuntime(CLIMain);\n\n/**\n * kind of a hack.\n * in the legacy, this is running at the beginning and it take care of issues when Bit files are missing,\n * such as \".bit\".\n * (to make this process better, you can easily remove it and run the e2e-tests. you'll see some failing)\n */\nasync function ensureWorkspaceAndScope() {\n try {\n await loadConsumerIfExist();\n } catch {\n const potentialWsPath = process.cwd();\n const consumerInfo = await getWorkspaceInfo(potentialWsPath);\n if (consumerInfo && !consumerInfo.hasScope && consumerInfo.hasBitMap && consumerInfo.hasWorkspaceConfig) {\n await HostInitializerMain.init(potentialWsPath);\n }\n // do nothing. it could fail for example with ScopeNotFound error, which is taken care of in \"bit init\".\n }\n}\n\nfunction isFullUrl(url: string) {\n return url.startsWith('http://') || url.startsWith('https://');\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,I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;IACjD;IACA;EACF;AACF;AAEA,SAASzB,SAASA,CAACkC,GAAW,EAAE;EAC9B,OAAOA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,IAAID,GAAG,CAACC,UAAU,CAAC,UAAU,CAAC;AAChE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","_legacy","_pMapSeries","_interopRequireDefault","_commandGroups","_logger","_lodash","_cli","_getCommandId","_cliParser","_completion","_cli2","_help","_version","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CLIMain","constructor","commandsSlot","onStartSlot","onCommandStartSlot","onBeforeExitSlot","logger","clone","groups","register","commands","forEach","command","setDefaults","cmd","unregister","commandName","toArray","aspectId","filteredCommands","filter","getCommandId","name","map","set","values","flat","getCommand","find","getCommandByNameOrAlias","alias","registerGroup","description","consoleWarning","registerOnStart","onStartFn","registerOnCommandStart","onCommandStartFn","registerOnBeforeExit","onBeforeExitFn","legacyLogger","registerOnBeforeExitFn","run","hasWorkspace","invokeOnStart","CliParser","CLIParser","commandRunner","parse","runCommand","onStartFns","foundCmd","findCommandByArgv","currentCommandName","process","argv","pMapSeries","onStart","extendedDescription","group","options","private","trim","loader","undefined","loadAspects","helpUrl","isFullUrl","provider","loggerMain","config","createLogger","CLIAspect","id","cliMain","cliGenerateCmd","CliGenerateCmd","cliCmd","CliCmd","helpCmd","HelpCmd","push","CompletionCmd","VersionCmd","exports","LoggerAspect","MainRuntime","Slot","withType","addRuntime","url","startsWith"],"sources":["cli.main.runtime.ts"],"sourcesContent":["import type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { logger as legacyLogger } from '@teambit/legacy.logger';\nimport type { CLIArgs, Flags, Command } from './command';\nimport pMapSeries from 'p-map-series';\nimport type { GroupsType } from './command-groups';\nimport { groups } from './command-groups';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { clone } from 'lodash';\nimport { CLIAspect, MainRuntime } from './cli.aspect';\nimport { getCommandId } from './get-command-id';\nimport { CLIParser, findCommandByArgv } from './cli-parser';\nimport { CompletionCmd } from './completion.cmd';\nimport { CliCmd, CliGenerateCmd } from './cli.cmd';\nimport { HelpCmd } from './help.cmd';\nimport { VersionCmd } from './version.cmd';\n\nexport type CommandList = Array<Command>;\nexport type OnStart = (hasWorkspace: boolean, currentCommand: string, commandObject?: Command) => Promise<void>;\nexport type OnCommandStart = (commandName: string, args: CLIArgs, flags: Flags) => Promise<void>;\nexport type OnBeforeExitFn = () => Promise<void>;\n\nexport type OnStartSlot = SlotRegistry<OnStart>;\nexport type OnCommandStartSlot = SlotRegistry<OnCommandStart>;\nexport type CommandsSlot = SlotRegistry<CommandList>;\nexport type OnBeforeExitSlot = SlotRegistry<OnBeforeExitFn>;\n\nexport class CLIMain {\n public groups: GroupsType = clone(groups); // if it's not cloned, it is cached across loadBit() instances\n constructor(\n private commandsSlot: CommandsSlot,\n private onStartSlot: OnStartSlot,\n readonly onCommandStartSlot: OnCommandStartSlot,\n private onBeforeExitSlot: OnBeforeExitSlot,\n private logger: Logger\n ) {}\n\n /**\n * registers a new command in to the CLI.\n */\n register(...commands: CommandList) {\n commands.forEach((command) => {\n this.setDefaults(command);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n command.commands!.forEach((cmd) => this.setDefaults(cmd));\n });\n this.commandsSlot.register(commands);\n }\n\n /**\n * helpful for having the same command name in different environments (e.g. legacy and non-legacy).\n * for example `cli.unregister('tag');` removes the \"bit tag\" command.\n */\n unregister(commandName: string) {\n this.commandsSlot.toArray().forEach(([aspectId, commands]) => {\n const filteredCommands = commands.filter((command) => {\n return getCommandId(command.name) !== commandName;\n });\n this.commandsSlot.map.set(aspectId, filteredCommands);\n });\n }\n\n /**\n * list of all registered commands. (legacy and new).\n */\n get commands(): CommandList {\n return this.commandsSlot.values().flat();\n }\n\n /**\n * get an instance of a registered command. (useful for aspects to modify and extend existing commands)\n */\n getCommand(name: string): Command | undefined {\n return this.commands.find((command) => getCommandId(command.name) === name);\n }\n\n getCommandByNameOrAlias(name: string): Command | undefined {\n const command = this.getCommand(name);\n if (command) return command;\n return this.commands.find((cmd) => cmd.alias === name);\n }\n\n /**\n * when running `bit help`, commands are grouped by categories.\n * this method helps registering a new group by providing its name and a description.\n * the name is what needs to be assigned to the `group` property of the Command interface.\n * the description is what shown in the `bit help` output.\n */\n registerGroup(name: string, description: string) {\n if (this.groups[name]) {\n this.logger.consoleWarning(`CLI group \"${name}\" is already registered`);\n } else {\n this.groups[name] = description;\n }\n }\n\n /**\n * onStart is when bootstrapping the CLI. (it happens before onCommandStart)\n */\n registerOnStart(onStartFn: OnStart) {\n this.onStartSlot.register(onStartFn);\n return this;\n }\n\n /**\n * onCommandStart is when a command is about to start and we have the command object and the parsed args and flags\n * already. (it happens after onStart)\n */\n registerOnCommandStart(onCommandStartFn: OnCommandStart) {\n this.onCommandStartSlot.register(onCommandStartFn);\n return this;\n }\n\n /**\n * This will register a function to be called before the process exits.\n * This will run only for \"regular\" exits\n * e.g.\n * yes - command run and finished successfully\n * yes - command run and failed gracefully (code 1)\n * not SIGKILL (kill -9)\n * not SIGINT (Ctrl+C)\n * not SIGTERM (kill)\n * not uncaughtException\n * not unhandledRejection\n *\n * @param onBeforeExitFn\n * @returns\n */\n registerOnBeforeExit(onBeforeExitFn: OnBeforeExitFn) {\n this.onBeforeExitSlot.register(onBeforeExitFn);\n legacyLogger.registerOnBeforeExitFn(onBeforeExitFn);\n return this;\n }\n\n /**\n * execute commands registered to this aspect.\n */\n async run(hasWorkspace: boolean) {\n await this.invokeOnStart(hasWorkspace);\n const CliParser = new CLIParser(this.commands, this.groups, this.onCommandStartSlot);\n const commandRunner = await CliParser.parse();\n await commandRunner.runCommand();\n }\n\n private async invokeOnStart(hasWorkspace: boolean) {\n const onStartFns = this.onStartSlot.values();\n const foundCmd = findCommandByArgv(this.commands);\n const currentCommandName = process.argv[2];\n await pMapSeries(onStartFns, (onStart) => onStart(hasWorkspace, currentCommandName, foundCmd));\n }\n\n private setDefaults(command: Command) {\n command.alias = command.alias || '';\n command.description = command.description || '';\n command.extendedDescription = command.extendedDescription || '';\n command.group = command.group || 'ungrouped';\n command.options = command.options || [];\n command.private = command.private || false;\n command.commands = command.commands || [];\n command.name = command.name.trim();\n if (command.loader === undefined) {\n command.loader = true;\n }\n if (command.loadAspects === undefined) {\n command.loadAspects = true;\n }\n if (command.helpUrl && !isFullUrl(command.helpUrl)) {\n command.helpUrl = `https://bit.dev/${command.helpUrl}`;\n }\n }\n\n static dependencies = [LoggerAspect];\n static runtime = MainRuntime;\n static slots = [\n Slot.withType<CommandList>(),\n Slot.withType<OnStart>(),\n Slot.withType<OnCommandStart>(),\n Slot.withType<OnBeforeExitFn>(),\n ];\n\n static async provider(\n [loggerMain]: [LoggerMain],\n config,\n [commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot]: [\n CommandsSlot,\n OnStartSlot,\n OnCommandStartSlot,\n OnBeforeExitSlot,\n ]\n ) {\n const logger = loggerMain.createLogger(CLIAspect.id);\n const cliMain = new CLIMain(commandsSlot, onStartSlot, onCommandStartSlot, onBeforeExitSlot, logger);\n const cliGenerateCmd = new CliGenerateCmd(cliMain);\n const cliCmd = new CliCmd(cliMain);\n const helpCmd = new HelpCmd(cliMain);\n cliCmd.commands.push(cliGenerateCmd);\n cliMain.register(new CompletionCmd(), cliCmd, helpCmd, new VersionCmd());\n return cliMain;\n }\n}\n\nCLIAspect.addRuntime(CLIMain);\n\nfunction isFullUrl(url: string) {\n return url.startsWith('http://') || url.startsWith('https://');\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAA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jJjBkB,OAAO,WAkJH,CACbuF,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAU,CAAC,EACxBD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAC/BD,eAAI,CAACC,QAAQ,CAAiB,CAAC,CAChC;AAuBHhB,gBAAS,CAACiB,UAAU,CAACzF,OAAO,CAAC;AAE7B,SAASmE,SAASA,CAACuB,GAAW,EAAE;EAC9B,OAAOA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,IAAID,GAAG,CAACC,UAAU,CAAC,UAAU,CAAC;AAChE","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_cli@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_cli@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_cli@0.0.1250/dist/cli.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_cli@0.0.1250/dist/cli.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1250",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/cli",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "cli",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.1250"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -20,13 +20,11 @@
|
|
|
20
20
|
"@teambit/legacy.logger": "0.0.24",
|
|
21
21
|
"@teambit/harmony": "0.4.7",
|
|
22
22
|
"@teambit/bit.get-bit-version": "0.0.6",
|
|
23
|
-
"@teambit/workspace.modules.workspace-locator": "0.0.15",
|
|
24
23
|
"@teambit/legacy.analytics": "0.0.77",
|
|
25
24
|
"@teambit/legacy.constants": "0.0.14",
|
|
26
25
|
"@teambit/bit-error": "0.0.404",
|
|
27
26
|
"@teambit/legacy.cli.error": "0.0.24",
|
|
28
|
-
"@teambit/
|
|
29
|
-
"@teambit/logger": "0.0.1342"
|
|
27
|
+
"@teambit/logger": "0.0.1343"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@types/didyoumean": "1.2.0",
|