@teambit/snapping 1.0.454 → 1.0.456

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":[]}
@@ -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;E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ASA,CAAChD,IAAY,EAAwB;IACpD,IAAIkE,UAAmB;IACvB,IAAI;MACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACpE,IAAI,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,IA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CAAC7B,OAAO;QAClB+B,KAAK,EAAEF,GAAG,CAACE;MACb,CAAC;IACH;EACF;EACQlB,SAASA,CAACpD,IAAY,EAAwB;IACpD,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;