@teambit/component-log 1.0.750 → 1.0.751

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.
@@ -4,6 +4,7 @@ export declare class BlameCmd implements Command {
4
4
  private componentLog;
5
5
  name: string;
6
6
  description: string;
7
+ extendedDescription: string;
7
8
  group: string;
8
9
  alias: string;
9
10
  options: CommandOptions;
package/dist/blame-cmd.js CHANGED
@@ -26,7 +26,10 @@ class BlameCmd {
26
26
  constructor(componentLog) {
27
27
  this.componentLog = componentLog;
28
28
  _defineProperty(this, "name", 'blame <filepath>');
29
- _defineProperty(this, "description", 'EXPERIMENTAL. per line, show who and when was the last to modify it');
29
+ _defineProperty(this, "description", 'EXPERIMENTAL. show line-by-line authorship and modification history');
30
+ _defineProperty(this, "extendedDescription", `displays who last modified each line of a file and when the change was made.
31
+ tracks line-level changes across component versions.
32
+ shows author, date, version hash, and optionally commit messages for each line.`);
30
33
  _defineProperty(this, "group", 'version-control');
31
34
  _defineProperty(this, "alias", '');
32
35
  _defineProperty(this, "options", [['m', 'include-message', 'show the commit message']]);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BlameCmd","constructor","componentLog","name","description","report","filePath","includeMessage","results","blame","length","chalk","yellow","table","getEmptyTableWithoutStyle","forEach","hash","tag","username","date","message","lineNumber","lineContent","shortHash","substring","shortMessage","split","push","toString","exports"],"sources":["blame-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { ComponentLogMain } from './component-log.main.runtime';\nimport { getEmptyTableWithoutStyle } from './log-cmd';\n\nexport class BlameCmd implements Command {\n name = 'blame <filepath>';\n description = 'EXPERIMENTAL. per line, show who and when was the last to modify it';\n group = 'version-control';\n alias = '';\n options = [['m', 'include-message', 'show the commit message']] as CommandOptions;\n arguments = [{ name: 'filepath', description: 'file path relative to the workspace' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report([filePath]: [string], { includeMessage = false }: { includeMessage?: boolean }) {\n const results = await this.componentLog.blame(filePath);\n if (!results.length) return chalk.yellow('no results found');\n const table = getEmptyTableWithoutStyle();\n results.forEach(({ hash, tag, username, date, message, lineNumber, lineContent }) => {\n const shortHash = hash.substring(0, 9);\n const shortMessage = includeMessage ? message.split('\\n')[0] : '';\n table.push([shortHash, tag || '', username, date, shortMessage, `${lineNumber})`, lineContent]);\n });\n return table.toString();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAA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Ga,OAAO,CAACM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;MACjEb,KAAK,CAACc,IAAI,CAAC,CAACJ,SAAS,EAAEN,GAAG,IAAI,EAAE,EAAEC,QAAQ,EAAEC,IAAI,EAAEM,YAAY,EAAE,GAAGJ,UAAU,GAAG,EAAEC,WAAW,CAAC,CAAC;IACjG,CAAC,CAAC;IACF,OAAOT,KAAK,CAACe,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA7B,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BlameCmd","constructor","componentLog","name","description","report","filePath","includeMessage","results","blame","length","chalk","yellow","table","getEmptyTableWithoutStyle","forEach","hash","tag","username","date","message","lineNumber","lineContent","shortHash","substring","shortMessage","split","push","toString","exports"],"sources":["blame-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { ComponentLogMain } from './component-log.main.runtime';\nimport { getEmptyTableWithoutStyle } from './log-cmd';\n\nexport class BlameCmd implements Command {\n name = 'blame <filepath>';\n description = 'EXPERIMENTAL. show line-by-line authorship and modification history';\n extendedDescription = `displays who last modified each line of a file and when the change was made.\ntracks line-level changes across component versions.\nshows author, date, version hash, and optionally commit messages for each line.`;\n group = 'version-control';\n alias = '';\n options = [['m', 'include-message', 'show the commit message']] as CommandOptions;\n arguments = [{ name: 'filepath', description: 'file path relative to the workspace' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report([filePath]: [string], { includeMessage = false }: { includeMessage?: boolean }) {\n const results = await this.componentLog.blame(filePath);\n if (!results.length) return chalk.yellow('no results found');\n const table = getEmptyTableWithoutStyle();\n results.forEach(({ hash, tag, username, date, message, lineNumber, lineContent }) => {\n const shortHash = hash.substring(0, 9);\n const shortMessage = includeMessage ? message.split('\\n')[0] : '';\n table.push([shortHash, tag || '', username, date, shortMessage, `${lineNumber})`, lineContent]);\n });\n return table.toString();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,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AC,CAAC;IACjG,CAAC,CAAC;IACF,OAAOT,KAAK,CAACe,QAAQ,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAA7B,QAAA,GAAAA,QAAA","ignoreList":[]}
package/dist/log-cmd.js CHANGED
@@ -28,9 +28,11 @@ class LogCmd {
28
28
  constructor(componentLog) {
29
29
  this.componentLog = componentLog;
30
30
  _defineProperty(this, "name", 'log <id>');
31
- _defineProperty(this, "description", 'show components(s) version history');
31
+ _defineProperty(this, "description", 'display component version history');
32
32
  _defineProperty(this, "helpUrl", 'reference/components/navigating-history');
33
- _defineProperty(this, "extendedDescription", void 0);
33
+ _defineProperty(this, "extendedDescription", `shows chronological history of component versions including tags and snaps with metadata.
34
+ displays commit messages, authors, dates, and version information. supports both local and remote component logs.
35
+ use various format options for compact or detailed views of version history.`);
34
36
  _defineProperty(this, "group", 'version-control');
35
37
  _defineProperty(this, "alias", '');
36
38
  _defineProperty(this, "options", [['r', 'remote', 'show log of a remote component'], ['', 'parents', 'show parents and lanes data'], ['o', 'one-line', 'show each log entry in one line'], ['f', 'full-hash', 'show full hash of the snap (default to the first 9 characters for --one-line/--parents flags)'], ['m', 'full-message', 'show full message of the snap (default to the first line for --one-line/--parents flags)'], ['', 'show-hidden', 'show hidden snaps (snaps are marked as hidden typically when the following tag has the same files/config)'], ['j', 'json', 'json format']]);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliTable","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LogCmd","constructor","componentLog","name","description","report","id","remote","parents","oneLine","fullHash","fullMessage","showHidden","logOpts","isRemote","shortHash","shortMessage","logs","getLogsWithParents","join","getLogs","logOneLine","reverse","map","paintLog","json","exports","paintAuthor","email","username","c","white","log","message","date","tag","hash","deleted","deprecated","deletedStr","red","deprecatedStr","yellow","title","getEmptyTableWithoutStyle","Table","chars","top","bottom","left","mid","right","middle","style","table","push","toString"],"sources":["log-cmd.ts"],"sourcesContent":["import c from 'chalk';\nimport Table from 'cli-table';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport type { ComponentLogMain, LogOpts } from './component-log.main.runtime';\n\ntype LogFlags = {\n remote?: boolean;\n parents?: boolean;\n oneLine?: boolean;\n fullHash?: boolean;\n fullMessage?: boolean;\n showHidden?: boolean;\n};\nexport default class LogCmd implements Command {\n name = 'log <id>';\n description = 'show components(s) version history';\n helpUrl = 'reference/components/navigating-history';\n extendedDescription: string;\n group = 'version-control';\n alias = '';\n options = [\n ['r', 'remote', 'show log of a remote component'],\n ['', 'parents', 'show parents and lanes data'],\n ['o', 'one-line', 'show each log entry in one line'],\n ['f', 'full-hash', 'show full hash of the snap (default to the first 9 characters for --one-line/--parents flags)'],\n ['m', 'full-message', 'show full message of the snap (default to the first line for --one-line/--parents flags)'],\n [\n '',\n 'show-hidden',\n 'show hidden snaps (snaps are marked as hidden typically when the following tag has the same files/config)',\n ],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n remoteOp = true; // should support log against remote\n skipWorkspace = true;\n arguments = [{ name: 'id', description: 'component-id or component-name' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report(\n [id]: [string],\n { remote = false, parents = false, oneLine = false, fullHash = false, fullMessage, showHidden }: LogFlags\n ) {\n if (!parents && !oneLine) {\n fullHash = true;\n fullMessage = true;\n }\n const logOpts: LogOpts = { isRemote: remote, shortHash: !fullHash, shortMessage: !fullMessage, showHidden };\n if (parents) {\n const logs = await this.componentLog.getLogsWithParents(id, logOpts);\n return logs.join('\\n');\n }\n const logs = await this.componentLog.getLogs(id, logOpts);\n if (oneLine) {\n return logOneLine(logs.reverse());\n }\n // reverse to show from the latest to earliest\n return logs.reverse().map(paintLog).join('\\n');\n }\n\n async json(\n [id]: [string],\n { remote = false, parents = false, oneLine = false, fullHash = false, fullMessage, showHidden }: LogFlags\n ) {\n if (!parents && !oneLine) {\n fullHash = true;\n fullMessage = true;\n }\n const logOpts: LogOpts = { isRemote: remote, shortHash: !fullHash, shortMessage: !fullMessage, showHidden };\n if (parents) {\n return this.componentLog.getLogsWithParents(id, logOpts);\n }\n return this.componentLog.getLogs(id, logOpts);\n }\n}\n\nexport function paintAuthor(email: string | null | undefined, username: string | null | undefined) {\n if (email && username) {\n return c.white(`author: ${username} <${email}>\\n`);\n }\n if (email && !username) {\n return c.white(`author: <${email}>\\n`);\n }\n if (!email && username) {\n return c.white(`author: ${username}\\n`);\n }\n\n return '';\n}\n\nfunction paintLog(log: LegacyComponentLog): string {\n const { message, date, tag, hash, username, email, deleted, deprecated } = log;\n const deletedStr = deleted ? c.red(' [deleted]') : '';\n const deprecatedStr = !deleted && deprecated ? c.yellow(' [deprecated]') : '';\n const title = tag ? `tag ${tag} (${hash})${deletedStr}${deprecatedStr}\\n` : `snap ${hash}\\n`;\n return (\n c.yellow(title) +\n paintAuthor(email, username) +\n (date ? c.white(`date: ${date}\\n`) : '') +\n (message ? c.white(`\\n ${message}\\n`) : '')\n );\n}\n\n/**\n * table with no style and no borders, just to align the columns.\n */\nexport function getEmptyTableWithoutStyle() {\n return new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n });\n}\n\nfunction logOneLine(logs: LegacyComponentLog[]) {\n const table = getEmptyTableWithoutStyle();\n\n logs.map(({ hash, tag, username, date, message }) =>\n table.push([hash, tag || '', username || '', date || '', message || ''])\n );\n\n return table.toString();\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,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,GAAG,EAAE,EAAE;MACP,SAAS,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACT,WAAW,EAAE,EAAE;MACfC,MAAM,EAAE;IACV,CAAC;IACDC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE;IAAE;EACjD,CAAC,CAAC;AACJ;AAEA,SAAShC,UAAUA,CAACJ,IAA0B,EAAE;EAC9C,MAAMqC,KAAK,GAAGV,yBAAyB,CAAC,CAAC;EAEzC3B,IAAI,CAACM,GAAG,CAAC,CAAC;IAAEa,IAAI;IAAED,GAAG;IAAEN,QAAQ;IAAEK,IAAI;IAAED;EAAQ,CAAC,KAC9CqB,KAAK,CAACC,IAAI,CAAC,CAACnB,IAAI,EAAED,GAAG,IAAI,EAAE,EAAEN,QAAQ,IAAI,EAAE,EAAEK,IAAI,IAAI,EAAE,EAAED,OAAO,IAAI,EAAE,CAAC,CACzE,CAAC;EAED,OAAOqB,KAAK,CAACE,QAAQ,CAAC,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliTable","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LogCmd","constructor","componentLog","name","description","report","id","remote","parents","oneLine","fullHash","fullMessage","showHidden","logOpts","isRemote","shortHash","shortMessage","logs","getLogsWithParents","join","getLogs","logOneLine","reverse","map","paintLog","json","exports","paintAuthor","email","username","c","white","log","message","date","tag","hash","deleted","deprecated","deletedStr","red","deprecatedStr","yellow","title","getEmptyTableWithoutStyle","Table","chars","top","bottom","left","mid","right","middle","style","table","push","toString"],"sources":["log-cmd.ts"],"sourcesContent":["import c from 'chalk';\nimport Table from 'cli-table';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport type { ComponentLogMain, LogOpts } from './component-log.main.runtime';\n\ntype LogFlags = {\n remote?: boolean;\n parents?: boolean;\n oneLine?: boolean;\n fullHash?: boolean;\n fullMessage?: boolean;\n showHidden?: boolean;\n};\nexport default class LogCmd implements Command {\n name = 'log <id>';\n description = 'display component version history';\n helpUrl = 'reference/components/navigating-history';\n extendedDescription = `shows chronological history of component versions including tags and snaps with metadata.\ndisplays commit messages, authors, dates, and version information. supports both local and remote component logs.\nuse various format options for compact or detailed views of version history.`;\n group = 'version-control';\n alias = '';\n options = [\n ['r', 'remote', 'show log of a remote component'],\n ['', 'parents', 'show parents and lanes data'],\n ['o', 'one-line', 'show each log entry in one line'],\n ['f', 'full-hash', 'show full hash of the snap (default to the first 9 characters for --one-line/--parents flags)'],\n ['m', 'full-message', 'show full message of the snap (default to the first line for --one-line/--parents flags)'],\n [\n '',\n 'show-hidden',\n 'show hidden snaps (snaps are marked as hidden typically when the following tag has the same files/config)',\n ],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n remoteOp = true; // should support log against remote\n skipWorkspace = true;\n arguments = [{ name: 'id', description: 'component-id or component-name' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report(\n [id]: [string],\n { remote = false, parents = false, oneLine = false, fullHash = false, fullMessage, showHidden }: LogFlags\n ) {\n if (!parents && !oneLine) {\n fullHash = true;\n fullMessage = true;\n }\n const logOpts: LogOpts = { isRemote: remote, shortHash: !fullHash, shortMessage: !fullMessage, showHidden };\n if (parents) {\n const logs = await this.componentLog.getLogsWithParents(id, logOpts);\n return logs.join('\\n');\n }\n const logs = await this.componentLog.getLogs(id, logOpts);\n if (oneLine) {\n return logOneLine(logs.reverse());\n }\n // reverse to show from the latest to earliest\n return logs.reverse().map(paintLog).join('\\n');\n }\n\n async json(\n [id]: [string],\n { remote = false, parents = false, oneLine = false, fullHash = false, fullMessage, showHidden }: LogFlags\n ) {\n if (!parents && !oneLine) {\n fullHash = true;\n fullMessage = true;\n }\n const logOpts: LogOpts = { isRemote: remote, shortHash: !fullHash, shortMessage: !fullMessage, showHidden };\n if (parents) {\n return this.componentLog.getLogsWithParents(id, logOpts);\n }\n return this.componentLog.getLogs(id, logOpts);\n }\n}\n\nexport function paintAuthor(email: string | null | undefined, username: string | null | undefined) {\n if (email && username) {\n return c.white(`author: ${username} <${email}>\\n`);\n }\n if (email && !username) {\n return c.white(`author: <${email}>\\n`);\n }\n if (!email && username) {\n return c.white(`author: ${username}\\n`);\n }\n\n return '';\n}\n\nfunction paintLog(log: LegacyComponentLog): string {\n const { message, date, tag, hash, username, email, deleted, deprecated } = log;\n const deletedStr = deleted ? c.red(' [deleted]') : '';\n const deprecatedStr = !deleted && deprecated ? c.yellow(' [deprecated]') : '';\n const title = tag ? `tag ${tag} (${hash})${deletedStr}${deprecatedStr}\\n` : `snap ${hash}\\n`;\n return (\n c.yellow(title) +\n paintAuthor(email, username) +\n (date ? c.white(`date: ${date}\\n`) : '') +\n (message ? c.white(`\\n ${message}\\n`) : '')\n );\n}\n\n/**\n * table with no style and no borders, just to align the columns.\n */\nexport function getEmptyTableWithoutStyle() {\n return new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n });\n}\n\nfunction logOneLine(logs: LegacyComponentLog[]) {\n const table = getEmptyTableWithoutStyle();\n\n logs.map(({ hash, tag, username, date, message }) =>\n table.push([hash, tag || '', username || '', date || '', message || ''])\n );\n\n return table.toString();\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAA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M,EAAE;IACV,CAAC;IACDC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE;IAAE;EACjD,CAAC,CAAC;AACJ;AAEA,SAAShC,UAAUA,CAACJ,IAA0B,EAAE;EAC9C,MAAMqC,KAAK,GAAGV,yBAAyB,CAAC,CAAC;EAEzC3B,IAAI,CAACM,GAAG,CAAC,CAAC;IAAEa,IAAI;IAAED,GAAG;IAAEN,QAAQ;IAAEK,IAAI;IAAED;EAAQ,CAAC,KAC9CqB,KAAK,CAACC,IAAI,CAAC,CAACnB,IAAI,EAAED,GAAG,IAAI,EAAE,EAAEN,QAAQ,IAAI,EAAE,EAAEK,IAAI,IAAI,EAAE,EAAED,OAAO,IAAI,EAAE,CAAC,CACzE,CAAC;EAED,OAAOqB,KAAK,CAACE,QAAQ,CAAC,CAAC;AACzB","ignoreList":[]}
@@ -4,6 +4,7 @@ export declare class LogFileCmd implements Command {
4
4
  private componentLog;
5
5
  name: string;
6
6
  description: string;
7
+ extendedDescription: string;
7
8
  group: string;
8
9
  alias: string;
9
10
  options: CommandOptions;
@@ -26,7 +26,10 @@ class LogFileCmd {
26
26
  constructor(componentLog) {
27
27
  this.componentLog = componentLog;
28
28
  _defineProperty(this, "name", 'log-file <filepath>');
29
- _defineProperty(this, "description", 'EXPERIMENTAL. show file history');
29
+ _defineProperty(this, "description", 'EXPERIMENTAL. display history of changes to a specific file');
30
+ _defineProperty(this, "extendedDescription", `shows version history for a specific file within component versions.
31
+ tracks file-level changes across component snaps and tags.
32
+ displays file modifications, hashes, and associated commit information.`);
30
33
  _defineProperty(this, "group", 'version-control');
31
34
  _defineProperty(this, "alias", '');
32
35
  _defineProperty(this, "options", [['o', 'one-line', 'show each log entry in one line']]);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LogFileCmd","constructor","componentLog","name","description","report","filePath","oneLine","results","getFileLog","table","getEmptyTableWithoutStyle","forEach","hash","tag","username","date","message","fileHash","push","toString","output","map","email","fileDiff","title","author","paintAuthor","body","chalk","green","split","line","join","yellow","white","exports"],"sources":["log-file-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { ComponentLogMain } from './component-log.main.runtime';\nimport { getEmptyTableWithoutStyle, paintAuthor } from './log-cmd';\n\nexport class LogFileCmd implements Command {\n name = 'log-file <filepath>';\n description = 'EXPERIMENTAL. show file history';\n group = 'version-control';\n alias = '';\n options = [['o', 'one-line', 'show each log entry in one line']] as CommandOptions;\n arguments = [{ name: 'filepath', description: 'file path relative to the workspace' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report([filePath]: [string], { oneLine = false }: { oneLine?: boolean }) {\n const results = await this.componentLog.getFileLog(filePath);\n if (oneLine) {\n const table = getEmptyTableWithoutStyle();\n results.forEach(({ hash, tag, username, date, message, fileHash }) => {\n table.push([hash, tag || '', username || '', date, message, fileHash]);\n });\n return table.toString();\n }\n const output = results.map(({ hash, tag, username, email, date, message, fileDiff }) => {\n const title = tag ? `tag ${tag} (${hash})\\n` : `snap ${hash}\\n`;\n const author = paintAuthor(email, username);\n const body = (fileDiff || chalk.green('<FILE-ADDED>'))\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n');\n return (\n chalk.yellow(title) +\n author +\n (date ? chalk.white(`date: ${date}\\n`) : '') +\n (message ? chalk.white(`message: ${message}\\n\\n`) : '\\n') +\n body\n );\n });\n return output.join('\\n');\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,O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nBC,MAAM,IACLV,IAAI,GAAGa,gBAAK,CAACM,KAAK,CAAC,SAASnB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,IAC3CC,OAAO,GAAGY,gBAAK,CAACM,KAAK,CAAC,YAAYlB,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,GACzDW,IAAI;IAER,CAAC,CAAC;IACF,OAAOP,MAAM,CAACY,IAAI,CAAC,IAAI,CAAC;EAC1B;AACF;AAACG,OAAA,CAAApC,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_logCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LogFileCmd","constructor","componentLog","name","description","report","filePath","oneLine","results","getFileLog","table","getEmptyTableWithoutStyle","forEach","hash","tag","username","date","message","fileHash","push","toString","output","map","email","fileDiff","title","author","paintAuthor","body","chalk","green","split","line","join","yellow","white","exports"],"sources":["log-file-cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport type { ComponentLogMain } from './component-log.main.runtime';\nimport { getEmptyTableWithoutStyle, paintAuthor } from './log-cmd';\n\nexport class LogFileCmd implements Command {\n name = 'log-file <filepath>';\n description = 'EXPERIMENTAL. display history of changes to a specific file';\n extendedDescription = `shows version history for a specific file within component versions.\ntracks file-level changes across component snaps and tags.\ndisplays file modifications, hashes, and associated commit information.`;\n group = 'version-control';\n alias = '';\n options = [['o', 'one-line', 'show each log entry in one line']] as CommandOptions;\n arguments = [{ name: 'filepath', description: 'file path relative to the workspace' }];\n\n constructor(private componentLog: ComponentLogMain) {}\n\n async report([filePath]: [string], { oneLine = false }: { oneLine?: boolean }) {\n const results = await this.componentLog.getFileLog(filePath);\n if (oneLine) {\n const table = getEmptyTableWithoutStyle();\n results.forEach(({ hash, tag, username, date, message, fileHash }) => {\n table.push([hash, tag || '', username || '', date, message, fileHash]);\n });\n return table.toString();\n }\n const output = results.map(({ hash, tag, username, email, date, message, fileDiff }) => {\n const title = tag ? `tag ${tag} (${hash})\\n` : `snap ${hash}\\n`;\n const author = paintAuthor(email, username);\n const body = (fileDiff || chalk.green('<FILE-ADDED>'))\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n');\n return (\n chalk.yellow(title) +\n author +\n (date ? chalk.white(`date: ${date}\\n`) : '') +\n (message ? chalk.white(`message: ${message}\\n\\n`) : '\\n') +\n body\n );\n });\n return output.join('\\n');\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,C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C,CAAC;IACzB;IACA,MAAMC,MAAM,GAAGb,OAAO,CAACc,GAAG,CAAC,CAAC;MAAET,IAAI;MAAEC,GAAG;MAAEC,QAAQ;MAAEQ,KAAK;MAAEP,IAAI;MAAEC,OAAO;MAAEO;IAAS,CAAC,KAAK;MACtF,MAAMC,KAAK,GAAGX,GAAG,GAAG,OAAOA,GAAG,KAAKD,IAAI,KAAK,GAAG,QAAQA,IAAI,IAAI;MAC/D,MAAMa,MAAM,GAAG,IAAAC,qBAAW,EAACJ,KAAK,EAAER,QAAQ,CAAC;MAC3C,MAAMa,IAAI,GAAG,CAACJ,QAAQ,IAAIK,gBAAK,CAACC,KAAK,CAAC,cAAc,CAAC,EAClDC,KAAK,CAAC,IAAI,CAAC,CACXT,GAAG,CAAEU,IAAI,IAAK,SAASA,IAAI,EAAE,CAAC,CAC9BC,IAAI,CAAC,IAAI,CAAC;MACb,OACEJ,gBAAK,CAACK,MAAM,CAACT,KAAK,CAAC,GACnBC,MAAM,IACLV,IAAI,GAAGa,gBAAK,CAACM,KAAK,CAAC,SAASnB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,IAC3CC,OAAO,GAAGY,gBAAK,CAACM,KAAK,CAAC,YAAYlB,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,GACzDW,IAAI;IAER,CAAC,CAAC;IACF,OAAOP,MAAM,CAACY,IAAI,CAAC,IAAI,CAAC;EAC1B;AACF;AAACG,OAAA,CAAApC,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-log@1.0.750/dist/component-log.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-log@1.0.750/dist/component-log.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-log@1.0.751/dist/component-log.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.component_component-log@1.0.751/dist/component-log.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/component-log",
3
- "version": "1.0.750",
3
+ "version": "1.0.751",
4
4
  "homepage": "https://bit.cloud/teambit/component/component-log",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "component-log",
9
- "version": "1.0.750"
9
+ "version": "1.0.751"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -16,16 +16,16 @@
16
16
  "p-map-series": "2.1.0",
17
17
  "p-map": "4.0.0",
18
18
  "cli-table": "0.3.6",
19
- "@teambit/cli": "0.0.1272",
20
19
  "@teambit/harmony": "0.4.7",
21
20
  "@teambit/component-id": "1.2.4",
22
- "@teambit/legacy-component-log": "0.0.410",
23
- "@teambit/legacy.component-diff": "0.0.127",
24
- "@teambit/scope.remotes": "0.0.73",
25
21
  "@teambit/toolbox.path.path": "0.0.10",
26
22
  "@teambit/graph.cleargraph": "0.0.11",
27
- "@teambit/objects": "0.0.257",
28
- "@teambit/workspace": "1.0.750"
23
+ "@teambit/cli": "0.0.1273",
24
+ "@teambit/legacy-component-log": "0.0.411",
25
+ "@teambit/legacy.component-diff": "0.0.128",
26
+ "@teambit/objects": "0.0.258",
27
+ "@teambit/scope.remotes": "0.0.74",
28
+ "@teambit/workspace": "1.0.751"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/diff": "^5.2.3",