@teambit/snapping 1.0.922 → 1.0.924

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/snap-cmd.js CHANGED
@@ -19,6 +19,13 @@ function _componentIssues() {
19
19
  };
20
20
  return data;
21
21
  }
22
+ function _cli() {
23
+ const data = require("@teambit/cli");
24
+ _cli = function () {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
22
29
  function _legacy() {
23
30
  const data = require("@teambit/legacy.constants");
24
31
  _legacy = function () {
@@ -119,33 +126,29 @@ function snapResultOutput(results) {
119
126
  return !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id);
120
127
  });
121
128
  const addedComponents = snappedComponents.filter(component => newComponents.searchWithoutVersion(component.id));
122
- const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;
123
- const totalCount = totalComponentsCount ?? snappedComponents.length + autoTaggedCount;
124
- const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
125
- const snapExplanation = `\n(use "bit export" to push these components to a remote")
126
- (use "bit reset" to unstage all local versions, or "bit reset --head" to only unstage the latest local snap)`;
129
+ const autoSnappedCount = autoSnappedResults ? autoSnappedResults.length : 0;
130
+ const totalCount = totalComponentsCount ?? snappedComponents.length + autoSnappedCount;
127
131
  const compInBold = id => {
128
132
  const version = id.hasVersion() ? `@${id.version}` : '';
129
133
  return `${_chalk().default.bold(id.toStringWithoutVersion())}${version}`;
130
134
  };
131
- const outputComponents = comps => {
132
- return comps.map(component => {
133
- let componentOutput = ` > ${compInBold(component.id)}`;
134
- const autoTag = autoSnappedResults.filter(result => result.triggeredBy.searchWithoutVersion(component.id));
135
- if (autoTag.length) {
136
- const autoTagComp = autoTag.map(a => compInBold(a.component.id));
137
- componentOutput += `\n ${_legacy().AUTO_SNAPPED_MSG} (${autoTagComp.length} total):
138
- ${autoTagComp.join('\n ')}`;
139
- }
140
- return componentOutput;
141
- }).join('\n');
142
- };
143
- const outputIfExists = (label, explanation, components) => {
144
- if (!components.length) return '';
145
- return `\n${_chalk().default.underline(label)}\n(${explanation})\n${outputComponents(components)}\n`;
135
+ const formatComp = component => {
136
+ let output = (0, _cli().formatItem)(compInBold(component.id));
137
+ const autoSnap = autoSnappedResults.filter(result => result.triggeredBy.searchWithoutVersion(component.id));
138
+ if (autoSnap.length) {
139
+ const autoSnapComp = autoSnap.map(a => compInBold(a.component.id));
140
+ output += `\n ${_legacy().AUTO_SNAPPED_MSG} (${autoSnapComp.length} total):\n ${autoSnapComp.join('\n ')}`;
141
+ }
142
+ return output;
146
143
  };
144
+ const newSection = (0, _cli().formatSection)('new components', 'first version for components', addedComponents.map(formatComp));
145
+ const changedSection = (0, _cli().formatSection)('changed components', 'components that got a version bump', changedComponents.map(formatComp));
146
+ const removedSection = (0, _tagCmd().outputIdsIfExists)('removed components', removedComponents);
147
+ const warningsSection = warnings && warnings.length ? warnings.map(w => `${_cli().warnSymbol} ${_chalk().default.yellow(w)}`).join('\n') : '';
147
148
  const laneStr = laneName ? ` on "${laneName}" lane` : '';
148
- return outputIfExists('new components', 'first version for components', addedComponents) + outputIfExists('changed components', 'components that got a version bump', changedComponents) + (0, _tagCmd().outputIdsIfExists)('removed components', removedComponents) + warningsOutput + _chalk().default.green(`\n${totalCount} component(s) snapped${laneStr}`) + snapExplanation;
149
+ const summary = (0, _cli().formatSuccessSummary)(`${totalCount} component(s) snapped${laneStr}`);
150
+ const snapExplanation = (0, _cli().formatHint)('(use "bit export" to push these components to a remote)\n(use "bit reset" to unstage all local versions, or "bit reset --head" to only unstage the latest local snap)');
151
+ return (0, _cli().joinSections)([newSection, changedSection, removedSection, warningsSection, `${summary}\n${snapExplanation}`]);
149
152
  }
150
153
 
151
154
  //# sourceMappingURL=snap-cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_legacy","_tagCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","detachHead","loose","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snapResultOutput","exports","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","totalComponentsCount","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","totalCount","warningsOutput","snapExplanation","compInBold","version","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","outputIdsIfExists","green"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport {\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport type { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport type { BasicTagSnapParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create immutable component snapshots for development versions';\n extendedDescription = `creates snapshots with hash-based versions for development and testing. snapshots are immutable and exportable.\nby default snaps only new and modified components. use for development iterations before creating semantic version tags.\nsnapshots maintain component history and enable collaboration without formal releases.`;\n group = 'version-control';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, only new and modified components are snapped (add --unmodified to snap all components in the workspace).`,\n },\n ];\n helpUrl = 'reference/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'snap message describing the latest changes - will appear in component history log'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the snap'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a snap message per component. optionally specify the editor-name (defaults to vim).',\n ],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n [\n '',\n 'disable-snap-pipeline',\n 'skip the snap pipeline. this will for instance skip packing and publishing component version for install, and app deployment',\n ],\n ['', 'ignore-build-errors', 'proceed to snap pipeline even when build pipeline fails'],\n ['', 'loose', 'allow snap --build to succeed even if tasks like tests or lint fail'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, snap it without changing the head',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipTasks,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n unmodified = false,\n failFast = false,\n detachHead,\n loose = false,\n }: {\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap, will be displayed in the version history`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipTasks,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n unmodified,\n exitOnFirstFailedTask: failFast,\n detachHead,\n loose,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n return snapResultOutput(results);\n }\n}\n\nexport function snapResultOutput(results: SnapResults): string {\n const {\n snappedComponents,\n autoSnappedResults,\n warnings,\n newComponents,\n laneName,\n removedComponents,\n totalComponentsCount,\n }: SnapResults = results;\n const changedComponents = snappedComponents.filter((component) => {\n return !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id);\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\n const totalCount = totalComponentsCount ?? snappedComponents.length + autoTaggedCount;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const snapExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage all local versions, or \"bit reset --head\" to only unstage the latest local snap)`;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_SNAPPED_MSG} (${autoTagComp.length} total):\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n const laneStr = laneName ? ` on \"${laneName}\" lane` : '';\n\n return (\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n warningsOutput +\n chalk.green(`\\n${totalCount} component(s) snapped${laneStr}`) +\n snapExplanation\n );\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;AAGA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAK,QAAA;EAAA,MAAA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AW,GAAGH,OAAO,CAACF,GAAG,CAAEM,CAAC,IAAKb,UAAU,CAACa,CAAC,CAACtB,SAAS,CAACE,EAAE,CAAC,CAAC;QAClEe,eAAe,IAAI,YAAYM,0BAAgB,KAAKF,WAAW,CAAChB,MAAM;AAChF,YAAYgB,WAAW,CAAC7D,IAAI,CAAC,gBAAgB,CAAC,EAAE;MACxC;MACA,OAAOyD,eAAe;IACxB,CAAC,CAAC,CACDzD,IAAI,CAAC,IAAI,CAAC;EACf,CAAC;EAED,MAAMgE,cAAc,GAAGA,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;IACzD,IAAI,CAACA,UAAU,CAACtB,MAAM,EAAE,OAAO,EAAE;IACjC,OAAO,KAAKnB,gBAAK,CAAC0C,SAAS,CAACH,KAAK,CAAC,MAAMC,WAAW,MAAMZ,gBAAgB,CAACa,UAAU,CAAC,IAAI;EAC3F,CAAC;EACD,MAAME,OAAO,GAAGlC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;EAExD,OACE6B,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAErB,eAAe,CAAC,GACjFqB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAE1B,iBAAiB,CAAC,GAC7F,IAAAgC,2BAAiB,EAAC,oBAAoB,EAAElC,iBAAiB,CAAC,GAC1DW,cAAc,GACdrB,gBAAK,CAAC6C,KAAK,CAAC,KAAKzB,UAAU,wBAAwBuB,OAAO,EAAE,CAAC,GAC7DrB,eAAe;AAEnB","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_cli","_legacy","_tagCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","detachHead","loose","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snapResultOutput","exports","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","totalComponentsCount","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoSnappedCount","length","totalCount","compInBold","version","hasVersion","bold","toStringWithoutVersion","formatComp","output","formatItem","autoSnap","result","triggeredBy","autoSnapComp","map","a","AUTO_SNAPPED_MSG","newSection","formatSection","changedSection","removedSection","outputIdsIfExists","warningsSection","w","warnSymbol","laneStr","summary","formatSuccessSummary","snapExplanation","formatHint","joinSections"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { formatItem, formatSection, formatHint, formatSuccessSummary, warnSymbol, joinSections } from '@teambit/cli';\nimport {\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport type { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport type { BasicTagSnapParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create immutable component snapshots for development versions';\n extendedDescription = `creates snapshots with hash-based versions for development and testing. snapshots are immutable and exportable.\nby default snaps only new and modified components. use for development iterations before creating semantic version tags.\nsnapshots maintain component history and enable collaboration without formal releases.`;\n group = 'version-control';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, only new and modified components are snapped (add --unmodified to snap all components in the workspace).`,\n },\n ];\n helpUrl = 'reference/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'snap message describing the latest changes - will appear in component history log'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the snap'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a snap message per component. optionally specify the editor-name (defaults to vim).',\n ],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n [\n '',\n 'disable-snap-pipeline',\n 'skip the snap pipeline. this will for instance skip packing and publishing component version for install, and app deployment',\n ],\n ['', 'ignore-build-errors', 'proceed to snap pipeline even when build pipeline fails'],\n ['', 'loose', 'allow snap --build to succeed even if tasks like tests or lint fail'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, snap it without changing the head',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipTasks,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n unmodified = false,\n failFast = false,\n detachHead,\n loose = false,\n }: {\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap, will be displayed in the version history`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipTasks,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n unmodified,\n exitOnFirstFailedTask: failFast,\n detachHead,\n loose,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n return snapResultOutput(results);\n }\n}\n\nexport function snapResultOutput(results: SnapResults): string {\n const {\n snappedComponents,\n autoSnappedResults,\n warnings,\n newComponents,\n laneName,\n removedComponents,\n totalComponentsCount,\n }: SnapResults = results;\n const changedComponents = snappedComponents.filter((component) => {\n return !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id);\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoSnappedCount = autoSnappedResults ? autoSnappedResults.length : 0;\n const totalCount = totalComponentsCount ?? snappedComponents.length + autoSnappedCount;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const formatComp = (component: ConsumerComponent): string => {\n let output = formatItem(compInBold(component.id));\n const autoSnap = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoSnap.length) {\n const autoSnapComp = autoSnap.map((a) => compInBold(a.component.id));\n output += `\\n ${AUTO_SNAPPED_MSG} (${autoSnapComp.length} total):\\n ${autoSnapComp.join('\\n ')}`;\n }\n return output;\n };\n\n const newSection = formatSection('new components', 'first version for components', addedComponents.map(formatComp));\n const changedSection = formatSection(\n 'changed components',\n 'components that got a version bump',\n changedComponents.map(formatComp)\n );\n const removedSection = outputIdsIfExists('removed components', removedComponents);\n\n const warningsSection =\n warnings && warnings.length ? warnings.map((w) => `${warnSymbol} ${chalk.yellow(w)}`).join('\\n') : '';\n\n const laneStr = laneName ? ` on \"${laneName}\" lane` : '';\n const summary = formatSuccessSummary(`${totalCount} component(s) snapped${laneStr}`);\n const snapExplanation = formatHint(\n '(use \"bit export\" to push these components to a remote)\\n(use \"bit reset\" to unstage all local versions, or \"bit reset --head\" to only unstage the latest local snap)'\n );\n\n return joinSections([newSection, changedSection, removedSection, warningsSection, `${summary}\\n${snapExplanation}`]);\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;AAGA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAM,QAAA;EAAA,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qD,MAAM;EACf,CAAC;EAED,MAAMS,UAAU,GAAG,IAAAC,oBAAa,EAAC,gBAAgB,EAAE,8BAA8B,EAAEpB,eAAe,CAACgB,GAAG,CAACP,UAAU,CAAC,CAAC;EACnH,MAAMY,cAAc,GAAG,IAAAD,oBAAa,EAClC,oBAAoB,EACpB,oCAAoC,EACpCzB,iBAAiB,CAACqB,GAAG,CAACP,UAAU,CAClC,CAAC;EACD,MAAMa,cAAc,GAAG,IAAAC,2BAAiB,EAAC,oBAAoB,EAAE9B,iBAAiB,CAAC;EAEjF,MAAM+B,eAAe,GACnBlC,QAAQ,IAAIA,QAAQ,CAACY,MAAM,GAAGZ,QAAQ,CAAC0B,GAAG,CAAES,CAAC,IAAK,GAAGC,iBAAU,IAAI3C,gBAAK,CAACC,MAAM,CAACyC,CAAC,CAAC,EAAE,CAAC,CAACpE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;EAEvG,MAAMsE,OAAO,GAAGnC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;EACxD,MAAMoC,OAAO,GAAG,IAAAC,2BAAoB,EAAC,GAAG1B,UAAU,wBAAwBwB,OAAO,EAAE,CAAC;EACpF,MAAMG,eAAe,GAAG,IAAAC,iBAAU,EAChC,uKACF,CAAC;EAED,OAAO,IAAAC,mBAAY,EAAC,CAACb,UAAU,EAAEE,cAAc,EAAEC,cAAc,EAAEE,eAAe,EAAE,GAAGI,OAAO,KAAKE,eAAe,EAAE,CAAC,CAAC;AACtH","ignoreList":[]}
@@ -132,6 +132,7 @@ export declare class SnappingMain {
132
132
  stagedConfig?: import("@teambit/scope").StagedConfig;
133
133
  removedComponents?: ComponentIdList;
134
134
  totalComponentsCount?: number;
135
+ batchId: string;
135
136
  }>;
136
137
  private addAspectsFromConfigObject;
137
138
  snapFromScope(snapDataPerCompRaw: SnapDataPerCompRaw[], params: {
@@ -184,11 +185,12 @@ export declare class SnappingMain {
184
185
  * used externally. don't make it private.
185
186
  */
186
187
  _getPublishedPackages(components: ConsumerComponent[]): PackageIntegritiesByPublishedPackages;
187
- _addCompToObjects({ source, lane, shouldValidateVersion, addVersionOpts, }: {
188
+ _addCompToObjects({ source, lane, shouldValidateVersion, addVersionOpts, batchId, }: {
188
189
  source: ConsumerComponent;
189
190
  lane?: Lane;
190
191
  shouldValidateVersion?: boolean;
191
192
  addVersionOpts?: AddVersionOpts;
193
+ batchId?: string;
192
194
  }): Promise<{
193
195
  component: ModelComponent;
194
196
  version: Version;
@@ -1030,13 +1030,17 @@ another option, in case this dependency is not in main yet is to remove all refe
1030
1030
  source,
1031
1031
  lane,
1032
1032
  shouldValidateVersion = false,
1033
- addVersionOpts
1033
+ addVersionOpts,
1034
+ batchId
1034
1035
  }) {
1035
1036
  const {
1036
1037
  addedVersionStr,
1037
1038
  component,
1038
1039
  version
1039
1040
  } = await this._addCompFromScopeToObjects(source, lane, addVersionOpts);
1041
+ if (batchId) {
1042
+ version.batchId = batchId;
1043
+ }
1040
1044
  const unmergedComponent = this.scope.legacyScope.objects.unmergedComponents.getEntry(component.toComponentId());
1041
1045
  if (unmergedComponent) {
1042
1046
  if (unmergedComponent.unrelated) {