@teambit/snapping 1.0.453 → 1.0.455

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/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { SnappingAspect } from './snapping.aspect';
2
2
  export type { BitCloudUser } from './tag-model-component';
3
- export type { SnappingMain, TagResults, SnapResults } from './snapping.main.runtime';
3
+ export type { SnappingMain, TagResults, SnapResults, SnapFromScopeResults, SnapDataParsed, } from './snapping.main.runtime';
4
4
  export default SnappingAspect;
5
5
  export { SnappingAspect };
6
- export type { onTagIdTransformer } from './tag-model-component';
6
+ export { tagModelComponent, onTagIdTransformer, BasicTagParams } from './tag-model-component';
7
7
  export { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';
8
+ export { snapFromScopeOptions, inputDataDescription, SnapDataPerCompRaw, SnapFromScopeOptions, } from './snap-from-scope.cmd';
package/dist/index.js CHANGED
@@ -9,12 +9,30 @@ Object.defineProperty(exports, "AUTO_TAGGED_MSG", {
9
9
  return _tagCmd().AUTO_TAGGED_MSG;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "BasicTagParams", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _tagModelComponent().BasicTagParams;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "NOTHING_TO_TAG_MSG", {
13
19
  enumerable: true,
14
20
  get: function () {
15
21
  return _tagCmd().NOTHING_TO_TAG_MSG;
16
22
  }
17
23
  });
24
+ Object.defineProperty(exports, "SnapDataPerCompRaw", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _snapFromScope().SnapDataPerCompRaw;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "SnapFromScopeOptions", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _snapFromScope().SnapFromScopeOptions;
34
+ }
35
+ });
18
36
  Object.defineProperty(exports, "SnappingAspect", {
19
37
  enumerable: true,
20
38
  get: function () {
@@ -22,6 +40,30 @@ Object.defineProperty(exports, "SnappingAspect", {
22
40
  }
23
41
  });
24
42
  exports.default = void 0;
43
+ Object.defineProperty(exports, "inputDataDescription", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _snapFromScope().inputDataDescription;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, "onTagIdTransformer", {
50
+ enumerable: true,
51
+ get: function () {
52
+ return _tagModelComponent().onTagIdTransformer;
53
+ }
54
+ });
55
+ Object.defineProperty(exports, "snapFromScopeOptions", {
56
+ enumerable: true,
57
+ get: function () {
58
+ return _snapFromScope().snapFromScopeOptions;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "tagModelComponent", {
62
+ enumerable: true,
63
+ get: function () {
64
+ return _tagModelComponent().tagModelComponent;
65
+ }
66
+ });
25
67
  function _snapping() {
26
68
  const data = require("./snapping.aspect");
27
69
  _snapping = function () {
@@ -29,6 +71,13 @@ function _snapping() {
29
71
  };
30
72
  return data;
31
73
  }
74
+ function _tagModelComponent() {
75
+ const data = require("./tag-model-component");
76
+ _tagModelComponent = function () {
77
+ return data;
78
+ };
79
+ return data;
80
+ }
32
81
  function _tagCmd() {
33
82
  const data = require("./tag-cmd");
34
83
  _tagCmd = function () {
@@ -36,6 +85,13 @@ function _tagCmd() {
36
85
  };
37
86
  return data;
38
87
  }
88
+ function _snapFromScope() {
89
+ const data = require("./snap-from-scope.cmd");
90
+ _snapFromScope = function () {
91
+ return data;
92
+ };
93
+ return data;
94
+ }
39
95
  var _default = exports.default = _snapping().SnappingAspect;
40
96
 
41
97
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_snapping","data","require","_tagCmd","_default","exports","default","SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { BitCloudUser } from './tag-model-component';\nexport type { SnappingMain, TagResults, SnapResults } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport type { onTagIdTransformer } from './tag-model-component';\nexport { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAHjDC,0BAAc","ignoreList":[]}
1
+ {"version":3,"names":["_snapping","data","require","_tagModelComponent","_tagCmd","_snapFromScope","_default","exports","default","SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { BitCloudUser } from './tag-model-component';\nexport type {\n SnappingMain,\n TagResults,\n SnapResults,\n SnapFromScopeResults,\n SnapDataParsed,\n} from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport { tagModelComponent, onTagIdTransformer, BasicTagParams } from './tag-model-component';\nexport { AUTO_TAGGED_MSG, NOTHING_TO_TAG_MSG } from './tag-cmd';\nexport {\n snapFromScopeOptions,\n inputDataDescription,\n SnapDataPerCompRaw,\n SnapFromScopeOptions,\n} from './snap-from-scope.cmd';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAYA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,eAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,cAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAK+B,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAThBC,0BAAc","ignoreList":[]}
package/dist/snap-cmd.js CHANGED
@@ -109,7 +109,7 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
109
109
  const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;
110
110
  const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
111
111
  const snapExplanation = `\n(use "bit export" to push these components to a remote")
112
- (use "bit reset" to unstage all local versions, or "bit reset --head" to only unstage the latest local snap)`;
112
+ (use "bit reset --all" to unstage all local versions, or "bit reset --head" to only unstage the latest local snap)`;
113
113
  const compInBold = id => {
114
114
  const version = id.hasVersion() ? `@${id.version}` : '';
115
115
  return `${_chalk().default.bold(id.toStringWithoutVersion())}${version}`;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_constants","_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","globalConfig","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","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","exports"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { 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/dist/constants';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create an immutable and exportable component snapshot (non-release version)';\n extendedDescription: string;\n group = 'development';\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 ['', '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 ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private globalConfig: GlobalConfigMain\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 }: {\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 = (await this.globalConfig.getBool(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 });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName, removedComponents }: SnapResults =\n results;\n const changedComponents = snappedComponents.filter((component) => {\n return (\n !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id)\n );\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\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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,CAACC,WAAW,CAAClB,oBAAoB,CAACD,SAAS,CAACE,EAAE,CAAC,CAAC;QAC5G,IAAIe,OAAO,CAACZ,MAAM,EAAE;UAClB,MAAMe,WAAW,GAAGH,OAAO,CAACF,GAAG,CAAEM,CAAC,IAAKb,UAAU,CAACa,CAAC,CAACrB,SAAS,CAACE,EAAE,CAAC,CAAC;UAClEc,eAAe,IAAI,YAAYM,6BAAgB,KAAKF,WAAW,CAACf,MAAM;AAClF,cAAce,WAAW,CAACvD,IAAI,CAAC,gBAAgB,CAAC,EAAE;QACxC;QACA,OAAOmD,eAAe;MACxB,CAAC,CAAC,CACDnD,IAAI,CAAC,IAAI,CAAC;IACf,CAAC;IAED,MAAM0D,cAAc,GAAGA,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;MACzD,IAAI,CAACA,UAAU,CAACrB,MAAM,EAAE,OAAO,EAAE;MACjC,OAAO,KAAKhB,gBAAK,CAACsC,SAAS,CAACH,KAAK,CAAC,MAAMC,WAAW,MAAMZ,gBAAgB,CAACa,UAAU,CAAC,IAAI;IAC3F,CAAC;IACD,MAAME,OAAO,GAAGhC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;IAExD,OACE2B,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAEpB,eAAe,CAAC,GACjFoB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAEzB,iBAAiB,CAAC,GAC7F,IAAA+B,2BAAiB,EAAC,oBAAoB,EAAEhC,iBAAiB,CAAC,GAC1DS,cAAc,GACdjB,gBAAK,CAACyC,KAAK,CAAC,KAAKtC,iBAAiB,CAACa,MAAM,GAAGD,eAAe,wBAAwBwB,OAAO,EAAE,CAAC,GAC7FrB,eAAe;EAEnB;AACF;AAACwB,OAAA,CAAA5E,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_constants","_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","globalConfig","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","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","exports"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { 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/dist/constants';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create an immutable and exportable component snapshot (non-release version)';\n extendedDescription: string;\n group = 'development';\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 ['', '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 ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private globalConfig: GlobalConfigMain\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 }: {\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 = (await this.globalConfig.getBool(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 });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName, removedComponents }: SnapResults =\n results;\n const changedComponents = snappedComponents.filter((component) => {\n return (\n !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id)\n );\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\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 --all\" 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${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n snapExplanation\n );\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;AAGA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAK,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,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AAA+B,2BAAiB,EAAC,oBAAoB,EAAEhC,iBAAiB,CAAC,GAC1DS,cAAc,GACdjB,gBAAK,CAACyC,KAAK,CAAC,KAAKtC,iBAAiB,CAACa,MAAM,GAAGD,eAAe,wBAAwBwB,OAAO,EAAE,CAAC,GAC7FrB,eAAe;EAEnB;AACF;AAACwB,OAAA,CAAA5E,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -25,7 +25,7 @@ export type SnapDataPerCompRaw = {
25
25
  forkFrom?: string;
26
26
  version?: string;
27
27
  };
28
- type SnapFromScopeOptions = {
28
+ export type SnapFromScopeOptions = {
29
29
  push?: boolean;
30
30
  lane?: string;
31
31
  ignoreIssues?: string;
@@ -33,6 +33,8 @@ type SnapFromScopeOptions = {
33
33
  updateDependents?: boolean;
34
34
  tag?: boolean;
35
35
  } & BasicTagSnapParams;
36
+ export declare const inputDataDescription = "the input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n files?: Array<{path: string, content: string}>; // replace content of specified source-files. the content is base64 encoded.\n isNew?: boolean; // if it's new, it'll be generated from the given files. otherwise, it'll be fetched from the scope and updated.\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{ // new dependencies (components and packages) to add.\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[]; // component-id (for components) or package-name (for packages) to remove from the dependencies.\n forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).\n version?: string; // relevant when passing \"--tag\". optionally, specify the semver to tag. default to \"patch\".\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'";
37
+ export declare const snapFromScopeOptions: string[][];
36
38
  export declare class SnapFromScopeCmd implements Command {
37
39
  private snapping;
38
40
  private logger;
@@ -61,4 +63,3 @@ export declare class SnapFromScopeCmd implements Command {
61
63
  }>;
62
64
  private parseData;
63
65
  }
64
- export {};
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SnapFromScopeCmd = void 0;
6
+ exports.snapFromScopeOptions = exports.inputDataDescription = exports.SnapFromScopeCmd = void 0;
7
7
  function _chalk() {
8
8
  const data = _interopRequireDefault(require("chalk"));
9
9
  _chalk = function () {
@@ -25,18 +25,18 @@ function _bitError() {
25
25
  };
26
26
  return data;
27
27
  }
28
+ function _lodash() {
29
+ const data = require("lodash");
30
+ _lodash = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
28
35
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
36
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
30
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
31
38
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
32
- class SnapFromScopeCmd {
33
- constructor(snapping, logger) {
34
- this.snapping = snapping;
35
- this.logger = logger;
36
- _defineProperty(this, "name", '_snap <data>');
37
- _defineProperty(this, "description", 'snap components from a bare-scope');
38
- _defineProperty(this, "extendedDescription", `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.
39
- the input data is a stringified JSON of an array of the following object.
39
+ const inputDataDescription = exports.inputDataDescription = `the input data is a stringified JSON of an array of the following object.
40
40
  {
41
41
  componentId: string; // ids always have scope, so it's safe to parse them from string
42
42
  dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]
@@ -55,12 +55,21 @@ the input data is a stringified JSON of an array of the following object.
55
55
  forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).
56
56
  version?: string; // relevant when passing "--tag". optionally, specify the semver to tag. default to "patch".
57
57
  }
58
- an example of the final data: '[{"componentId":"ci.remote2/comp-b","message": "first snap"}]'
58
+ an example of the final data: '[{"componentId":"ci.remote2/comp-b","message": "first snap"}]'`;
59
+ const snapFromScopeOptions = exports.snapFromScopeOptions = [['', 'push', 'export the updated objects to the original scopes once done'], ['m', 'message <message>', 'log message describing the latest changes'], ['', 'lane <lane-id>', 'fetch the components from the given lane'], ['', 'build', 'run the build pipeline'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'], ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
60
+ [${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
61
+ to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['', 'tag', 'make a tag instead of a snap'], ['', 'stream', 'relevant for --json only. stream loader as json strings'], ['j', 'json', 'output as json format']];
62
+ class SnapFromScopeCmd {
63
+ constructor(snapping, logger) {
64
+ this.snapping = snapping;
65
+ this.logger = logger;
66
+ _defineProperty(this, "name", '_snap <data>');
67
+ _defineProperty(this, "description", 'snap components from a bare-scope');
68
+ _defineProperty(this, "extendedDescription", `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.
69
+ ${inputDataDescription}
59
70
  `);
60
71
  _defineProperty(this, "alias", '');
61
- _defineProperty(this, "options", [['', 'push', 'export the updated objects to the original scopes once done'], ['m', 'message <message>', 'log message describing the latest changes'], ['', 'lane <lane-id>', 'fetch the components from the given lane'], ['', 'build', 'run the build pipeline'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'], ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
62
- [${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
63
- to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['', 'update-dependents', 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace'], ['', 'tag', 'make a tag instead of a snap'], ['', 'stream', 'relevant for --json only. stream loader as json strings'], ['j', 'json', 'output as json format']]);
72
+ _defineProperty(this, "options", [...snapFromScopeOptions, ['', 'update-dependents', 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace']]);
64
73
  _defineProperty(this, "loader", true);
65
74
  _defineProperty(this, "private", true);
66
75
  }
@@ -102,9 +111,9 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
102
111
  snappedIds,
103
112
  exportedIds
104
113
  } = results;
105
- const snappedOutput = `${_chalk().default.bold('snapped components')}\n${snappedIds.join('\n')}`;
106
- const exportedOutput = exportedIds && exportedIds.length ? `\n\n${_chalk().default.bold('exported components')}\n${exportedIds.join('\n')}` : '';
107
- return `${snappedOutput}${exportedOutput}`;
114
+ const snappedOutput = snappedIds.length ? `${_chalk().default.bold('snapped components')}\n${snappedIds.join('\n')}` : '';
115
+ const exportedOutput = exportedIds && exportedIds.length ? `${_chalk().default.bold('exported components')}\n${exportedIds.join('\n')}` : '';
116
+ return (0, _lodash().compact)([snappedOutput, exportedOutput]).join('\n\n');
108
117
  }
109
118
  async json([data], {
110
119
  push = false,
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapFromScopeCmd","constructor","snapping","logger","keys","IssuesClasses","join","report","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","updateDependents","tag","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","results","snapFromScope","snappedIds","exportedIds","snappedOutput","chalk","bold","exportedOutput","length","json","code","map","id","toString","err","error","stack","dataParsed","JSON","parse","Error","Array","isArray","forEach","dataItem","componentId","files","file","path","content","Buffer","from","exports"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type FileData = { path: string; content: string; delete?: boolean };\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n files?: FileData[];\n isNew?: boolean;\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[];\n forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).\n version?: string; // relevant when passing \"--tag\". optionally, specify the semver to tag. default to \"patch\".\n};\n\ntype SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n updateDependents?: boolean;\n tag?: boolean;\n} & BasicTagSnapParams;\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\nthe input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n files?: Array<{path: string, content: string}>; // replace content of specified source-files. the content is base64 encoded.\n isNew?: boolean; // if it's new, it'll be generated from the given files. otherwise, it'll be fetched from the scope and updated.\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{ // new dependencies (components and packages) to add.\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[]; // component-id (for components) or package-name (for packages) to remove from the dependencies.\n forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).\n version?: string; // relevant when passing \"--tag\". optionally, specify the semver to tag. default to \"patch\".\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'\n`;\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'],\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 'update-dependents',\n 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace',\n ],\n ['', 'tag', 'make a tag instead of a snap'],\n ['', 'stream', 'relevant for --json only. stream loader as json strings'],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger\n ) {}\n\n async report(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n tag,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n tag,\n });\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}`;\n const exportedOutput =\n exportedIds && exportedIds.length ? `\\n\\n${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return `${snappedOutput}${exportedOutput}`;\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n tag,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n try {\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n tag,\n });\n\n return {\n code: 0,\n data: {\n exportedIds: results.exportedIds?.map((id) => id.toString()),\n snappedIds: results.snappedIds.map((id) => id.toString()),\n },\n };\n } catch (err: any) {\n this.logger.error('snap-from-scope.json, error: ', err);\n return {\n code: 1,\n error: err.message,\n stack: err.stack,\n };\n }\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n dataItem.files?.forEach((file) => {\n if (!file.path) throw new Error('expect file to have \"path\" prop');\n if (file.content) {\n file.content = Buffer.from(file.content, 'base64').toString();\n }\n });\n });\n\n return dataParsed;\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;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IA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I,CAAC;IAC/B,CAAC,CAAC,OAAO+D,GAAQ,EAAE;MACjB,MAAM,IAAIM,KAAK,CAAC,gDAAgDN,GAAG,CAAC5B,OAAO,EAAE,CAAC;IAChF;IACA,IAAI,CAACmC,KAAK,CAACC,OAAO,CAACL,UAAU,CAAC,EAAE;MAC9B,MAAM,IAAIG,KAAK,CAAC,4BAA4B,CAAC;IAC/C;IACAH,UAAU,CAACM,OAAO,CAAEC,QAAQ,IAAK;MAC/B,IAAI,CAACA,QAAQ,CAACC,WAAW,EAAE,MAAM,IAAIL,KAAK,CAAC,6CAA6C,CAAC;MACzFI,QAAQ,CAACE,KAAK,EAAEH,OAAO,CAAEI,IAAI,IAAK;QAChC,IAAI,CAACA,IAAI,CAACC,IAAI,EAAE,MAAM,IAAIR,KAAK,CAAC,iCAAiC,CAAC;QAClE,IAAIO,IAAI,CAACE,OAAO,EAAE;UAChBF,IAAI,CAACE,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACJ,IAAI,CAACE,OAAO,EAAE,QAAQ,CAAC,CAAChB,QAAQ,CAAC,CAAC;QAC/D;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAOI,UAAU;EACnB;AACF;AAACe,OAAA,CAAAvD,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_bitError","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","inputDataDescription","exports","snapFromScopeOptions","keys","IssuesClasses","join","SnapFromScopeCmd","constructor","snapping","logger","report","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","updateDependents","tag","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","results","snapFromScope","snappedIds","exportedIds","snappedOutput","length","chalk","bold","exportedOutput","compact","json","code","map","id","toString","err","error","stack","dataParsed","JSON","parse","Error","Array","isArray","forEach","dataItem","componentId","files","file","path","content","Buffer","from"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { compact } from 'lodash';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type FileData = { path: string; content: string; delete?: boolean };\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n files?: FileData[];\n isNew?: boolean;\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[];\n forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).\n version?: string; // relevant when passing \"--tag\". optionally, specify the semver to tag. default to \"patch\".\n};\n\nexport type SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n updateDependents?: boolean;\n tag?: boolean;\n} & BasicTagSnapParams;\n\nexport const inputDataDescription = `the input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // dependencies include versions. for components use component-id. e.g. [teambit.compilation/compiler@1.0.0, lodash@4.17.21]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n files?: Array<{path: string, content: string}>; // replace content of specified source-files. the content is base64 encoded.\n isNew?: boolean; // if it's new, it'll be generated from the given files. otherwise, it'll be fetched from the scope and updated.\n mainFile?: string; // relevant when isNew is true. default to \"index.ts\".\n newDependencies?: Array<{ // new dependencies (components and packages) to add.\n id: string; // component-id or package-name. e.g. \"teambit.react/react\" or \"lodash\".\n version?: string; // version of the package. e.g. \"2.0.3\". for packages, it is mandatory.\n isComponent?: boolean; // default true. if false, it's a package dependency\n type?: 'runtime' | 'dev' | 'peer'; // default \"runtime\".\n }>;\n removeDependencies?: string[]; // component-id (for components) or package-name (for packages) to remove from the dependencies.\n forkFrom?: string; // origin id to fork from. the componentId is the new id. (no need to populate isNew prop).\n version?: string; // relevant when passing \"--tag\". optionally, specify the semver to tag. default to \"patch\".\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'`;\n\nexport const snapFromScopeOptions = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline failed'],\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 ['', 'tag', 'make a tag instead of a snap'],\n ['', 'stream', 'relevant for --json only. stream loader as json strings'],\n ['j', 'json', 'output as json format'],\n];\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\n${inputDataDescription}\n`;\n alias = '';\n options = [\n ...snapFromScopeOptions,\n [\n '',\n 'update-dependents',\n 'when snapped on a lane, mark it as update-dependents so it will be skipped from the workspace',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger\n ) {}\n\n async report(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n tag,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n tag,\n });\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = snappedIds.length ? `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}` : '';\n const exportedOutput =\n exportedIds && exportedIds.length ? `${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return compact([snappedOutput, exportedOutput]).join('\\n\\n');\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n updateDependents,\n tag,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n if (updateDependents && !lane) {\n throw new BitError('update-dependents flag is only available when snapping from a lane');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n try {\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n updateDependents,\n tag,\n });\n\n return {\n code: 0,\n data: {\n exportedIds: results.exportedIds?.map((id) => id.toString()),\n snappedIds: results.snappedIds.map((id) => id.toString()),\n },\n };\n } catch (err: any) {\n this.logger.error('snap-from-scope.json, error: ', err);\n return {\n code: 1,\n error: err.message,\n stack: err.stack,\n };\n }\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n dataItem.files?.forEach((file) => {\n if (!file.path) throw new Error('expect file to have \"path\" prop');\n if (file.content) {\n file.content = Buffer.from(file.content, 'base64').toString();\n }\n });\n });\n\n return dataParsed;\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;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,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;AAAiC,SAAA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D,IAAIuE,UAAmB;IACvB,IAAI;MACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACzE,IAAI,CAAC;IAC/B,CAAC,CAAC,OAAOoE,GAAQ,EAAE;MACjB,MAAM,IAAIM,KAAK,CAAC,gDAAgDN,GAAG,CAAC7B,OAAO,EAAE,CAAC;IAChF;IACA,IAAI,CAACoC,KAAK,CAACC,OAAO,CAACL,UAAU,CAAC,EAAE;MAC9B,MAAM,IAAIG,KAAK,CAAC,4BAA4B,CAAC;IAC/C;IACAH,UAAU,CAACM,OAAO,CAAEC,QAAQ,IAAK;MAC/B,IAAI,CAACA,QAAQ,CAACC,WAAW,EAAE,MAAM,IAAIL,KAAK,CAAC,6CAA6C,CAAC;MACzFI,QAAQ,CAACE,KAAK,EAAEH,OAAO,CAAEI,IAAI,IAAK;QAChC,IAAI,CAACA,IAAI,CAACC,IAAI,EAAE,MAAM,IAAIR,KAAK,CAAC,iCAAiC,CAAC;QAClE,IAAIO,IAAI,CAACE,OAAO,EAAE;UAChBF,IAAI,CAACE,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACJ,IAAI,CAACE,OAAO,EAAE,QAAQ,CAAC,CAAChB,QAAQ,CAAC,CAAC;QAC/D;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAOI,UAAU;EACnB;AACF;AAAC3C,OAAA,CAAAK,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -24,8 +24,6 @@ import { TagDataPerCompRaw } from './tag-from-scope.cmd';
24
24
  import { SnapDataPerCompRaw, FileData } from './snap-from-scope.cmd';
25
25
  import { untagResult } from './reset-component';
26
26
  import { ApplicationMain } from '@teambit/application';
27
- import { ForkingMain } from '@teambit/forking';
28
- import { InstallMain } from '@teambit/install';
29
27
  export type TagDataPerComp = {
30
28
  componentId: ComponentID;
31
29
  dependencies: ComponentID[];
@@ -73,21 +71,19 @@ export type BasicTagResults = {
73
71
  removedComponents?: ComponentIdList;
74
72
  };
75
73
  export declare class SnappingMain {
76
- private workspace;
74
+ readonly workspace: Workspace;
77
75
  private logger;
78
76
  private issues;
79
77
  private insights;
80
- private dependencyResolver;
81
- private scope;
78
+ readonly dependencyResolver: DependencyResolverMain;
79
+ readonly scope: ScopeMain;
82
80
  private exporter;
83
- private builder;
81
+ readonly builder: BuilderMain;
84
82
  private importer;
85
83
  private deps;
86
84
  private application;
87
- private forking;
88
- private install;
89
85
  private objectsRepo;
90
- constructor(workspace: Workspace, logger: Logger, issues: IssuesMain, insights: InsightsMain, dependencyResolver: DependencyResolverMain, scope: ScopeMain, exporter: ExportMain, builder: BuilderMain, importer: ImporterMain, deps: DependenciesMain, application: ApplicationMain, forking: ForkingMain, install: InstallMain);
86
+ constructor(workspace: Workspace, logger: Logger, issues: IssuesMain, insights: InsightsMain, dependencyResolver: DependencyResolverMain, scope: ScopeMain, exporter: ExportMain, builder: BuilderMain, importer: ImporterMain, deps: DependenciesMain, application: ApplicationMain);
91
87
  /**
92
88
  * tag the given component ids or all modified/new components if "all" param is set.
93
89
  * tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias
@@ -115,13 +111,6 @@ export declare class SnappingMain {
115
111
  rebuildArtifacts?: boolean;
116
112
  ignoreLastPkgJson?: boolean;
117
113
  } & Partial<BasicTagParams>): Promise<TagResults | null>;
118
- forkAndSnap(snapDataPerCompRaw: SnapDataPerCompRaw[], params: {
119
- push?: boolean;
120
- ignoreIssues?: string;
121
- lane?: string;
122
- updateDependents?: boolean;
123
- tag?: boolean;
124
- } & Partial<BasicTagParams>): Promise<SnapFromScopeResults>;
125
114
  snapFromScope(snapDataPerCompRaw: SnapDataPerCompRaw[], params: {
126
115
  push?: boolean;
127
116
  ignoreIssues?: string;
@@ -156,7 +145,7 @@ export declare class SnappingMain {
156
145
  resetNeverExported(): Promise<ComponentID[]>;
157
146
  _addFlattenedDependenciesToComponents(components: ConsumerComponent[], rebuildDepsGraph?: boolean): Promise<void>;
158
147
  throwForDepsFromAnotherLane(components: ConsumerComponent[]): Promise<void>;
159
- private throwForVariousIssues;
148
+ throwForVariousIssues(components: Component[], ignoreIssues?: string): Promise<void>;
160
149
  private throwForDepsFromAnotherLaneForComp;
161
150
  _addFlattenedDepsGraphToComponents(components: ConsumerComponent[]): Promise<void>;
162
151
  _updateComponentsByTagResult(components: ConsumerComponent[], tagResult: LegacyOnTagResult[]): void;
@@ -187,7 +176,7 @@ export declare class SnappingMain {
187
176
  * in case it has no version, it returns the latest.
188
177
  */
189
178
  getCompIdWithExactVersionAccordingToSemver(compId: ComponentID): Promise<ComponentID>;
190
- private updateSourceFiles;
179
+ updateSourceFiles(component: Component, files: FileData[]): Promise<void>;
191
180
  updateDependenciesVersionsOfComponent(component: Component, dependencies: ComponentID[], currentBitIds: ComponentID[]): Promise<void>;
192
181
  /**
193
182
  * it does two things:
@@ -200,7 +189,7 @@ export declare class SnappingMain {
200
189
  static slots: never[];
201
190
  static dependencies: import("@teambit/harmony").Aspect[];
202
191
  static runtime: import("@teambit/harmony").RuntimeDefinition;
203
- static provider([workspace, cli, loggerMain, issues, insights, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps, application, forking, install,]: [
192
+ static provider([workspace, cli, loggerMain, issues, insights, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps, application,]: [
204
193
  Workspace,
205
194
  CLIMain,
206
195
  LoggerMain,
@@ -213,9 +202,7 @@ export declare class SnappingMain {
213
202
  ImporterMain,
214
203
  GlobalConfigMain,
215
204
  DependenciesMain,
216
- ApplicationMain,
217
- ForkingMain,
218
- InstallMain
205
+ ApplicationMain
219
206
  ]): Promise<SnappingMain>;
220
207
  }
221
208
  export default SnappingMain;