@teambit/snapping 0.0.196 → 0.0.198
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/components-have-issues.js +0 -23
- package/dist/components-have-issues.js.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/reset-cmd.js +0 -24
- package/dist/reset-cmd.js.map +1 -1
- package/dist/snap-cmd.js +0 -35
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.aspect.js +0 -5
- package/dist/snapping.aspect.js.map +1 -1
- package/dist/snapping.main.runtime.js +19 -235
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/snapping.spec.js +4 -33
- package/dist/snapping.spec.js.map +1 -1
- package/dist/tag-cmd.js +3 -52
- package/dist/tag-cmd.js.map +1 -1
- package/dist/tag-from-scope.cmd.js +3 -45
- package/dist/tag-from-scope.cmd.js.map +1 -1
- package/dist/tag-model-component.js +18 -128
- package/dist/tag-model-component.js.map +1 -1
- package/package-tar/teambit-snapping-0.0.198.tgz +0 -0
- package/package.json +10 -10
- /package/{preview-1666409808293.js → preview-1666582798766.js} +0 -0
- package/package-tar/teambit-snapping-0.0.196.tgz +0 -0
|
@@ -1,66 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.flat.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.array.unscopables.flat.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.ComponentsHaveIssues = void 0;
|
|
13
|
-
|
|
14
10
|
function _bitError() {
|
|
15
11
|
const data = require("@teambit/bit-error");
|
|
16
|
-
|
|
17
12
|
_bitError = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _issues() {
|
|
25
18
|
const data = _interopRequireDefault(require("@teambit/issues"));
|
|
26
|
-
|
|
27
19
|
_issues = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _componentIssuesTemplate() {
|
|
35
25
|
const data = require("@teambit/legacy/dist/cli/templates/component-issues-template");
|
|
36
|
-
|
|
37
26
|
_componentIssuesTemplate = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _chalk() {
|
|
45
32
|
const data = _interopRequireDefault(require("chalk"));
|
|
46
|
-
|
|
47
33
|
_chalk = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _lodash() {
|
|
55
39
|
const data = require("lodash");
|
|
56
|
-
|
|
57
40
|
_lodash = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
class ComponentsHaveIssues extends _bitError().BitError {
|
|
65
46
|
constructor(components) {
|
|
66
47
|
components.forEach(component => {
|
|
@@ -81,16 +62,12 @@ while highly not recommended, it's possible to ignore issues in two ways:
|
|
|
81
62
|
}
|
|
82
63
|
`);
|
|
83
64
|
}
|
|
84
|
-
|
|
85
65
|
}
|
|
86
|
-
|
|
87
66
|
exports.ComponentsHaveIssues = ComponentsHaveIssues;
|
|
88
|
-
|
|
89
67
|
function componentIssuesTemplate(components) {
|
|
90
68
|
function format(component) {
|
|
91
69
|
return `${_chalk().default.underline(_chalk().default.cyan(component.id.toString()))}\n${(0, _componentIssuesTemplate().formatIssues)(component)}`;
|
|
92
70
|
}
|
|
93
|
-
|
|
94
71
|
const result = `\n${components.map(format).join('\n')}`;
|
|
95
72
|
return result;
|
|
96
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentsHaveIssues","BitError","constructor","components","forEach","component","issues","filterNonTagBlocking","allIssueNames","uniq","map","comp","getAllIssueNames","flat","issuesColored","componentIssuesTemplate","join","IssuesAspect","id","issue","format","chalk","underline","cyan","toString","formatIssues","result"],"sources":["components-have-issues.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport IssuesAspect from '@teambit/issues';\nimport { formatIssues } from '@teambit/legacy/dist/cli/templates/component-issues-template';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\n\nexport class ComponentsHaveIssues extends BitError {\n constructor(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.issues = component.issues.filterNonTagBlocking();\n });\n const allIssueNames = uniq(components.map((comp) => comp.issues.getAllIssueNames()).flat());\n const issuesColored = componentIssuesTemplate(components);\n super(`error: issues found with the following components\n${issuesColored}\n\nto get the list of component-issues names and suggestions how to resolve them, run \"bit component-issues\".\n\nwhile highly not recommended, it's possible to ignore issues in two ways:\n1) temporarily ignore for this tag/snap command by entering \"--ignore-issues\" flag, e.g. \\`bit tag --ignore-issues \"${allIssueNames.join(\n ', '\n )}\" \\`\n2) ignore the issue completely by configuring it in the workspace.jsonc file. e.g:\n\"${IssuesAspect.id}\": {\n \"ignoreIssues\": [${allIssueNames.map((issue) => `\"${issue}\"`).join(', ')}]\n}\n`);\n }\n}\n\nfunction componentIssuesTemplate(components: ConsumerComponent[]) {\n function format(component: ConsumerComponent) {\n return `${chalk.underline(chalk.cyan(component.id.toString()))}\\n${formatIssues(component)}`;\n }\n\n const result = `\\n${components.map(format).join('\\n')}`;\n return result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ComponentsHaveIssues","BitError","constructor","components","forEach","component","issues","filterNonTagBlocking","allIssueNames","uniq","map","comp","getAllIssueNames","flat","issuesColored","componentIssuesTemplate","join","IssuesAspect","id","issue","format","chalk","underline","cyan","toString","formatIssues","result"],"sources":["components-have-issues.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport IssuesAspect from '@teambit/issues';\nimport { formatIssues } from '@teambit/legacy/dist/cli/templates/component-issues-template';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\n\nexport class ComponentsHaveIssues extends BitError {\n constructor(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.issues = component.issues.filterNonTagBlocking();\n });\n const allIssueNames = uniq(components.map((comp) => comp.issues.getAllIssueNames()).flat());\n const issuesColored = componentIssuesTemplate(components);\n super(`error: issues found with the following components\n${issuesColored}\n\nto get the list of component-issues names and suggestions how to resolve them, run \"bit component-issues\".\n\nwhile highly not recommended, it's possible to ignore issues in two ways:\n1) temporarily ignore for this tag/snap command by entering \"--ignore-issues\" flag, e.g. \\`bit tag --ignore-issues \"${allIssueNames.join(\n ', '\n )}\" \\`\n2) ignore the issue completely by configuring it in the workspace.jsonc file. e.g:\n\"${IssuesAspect.id}\": {\n \"ignoreIssues\": [${allIssueNames.map((issue) => `\"${issue}\"`).join(', ')}]\n}\n`);\n }\n}\n\nfunction componentIssuesTemplate(components: ConsumerComponent[]) {\n function format(component: ConsumerComponent) {\n return `${chalk.underline(chalk.cyan(component.id.toString()))}\\n${formatIssues(component)}`;\n }\n\n const result = `\\n${components.map(format).join('\\n')}`;\n return result;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAW,CAACC,UAA+B,EAAE;IAC3CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChCA,SAAS,CAACC,MAAM,GAAGD,SAAS,CAACC,MAAM,CAACC,oBAAoB,EAAE;IAC5D,CAAC,CAAC;IACF,MAAMC,aAAa,GAAG,IAAAC,cAAI,EAACN,UAAU,CAACO,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,MAAM,CAACM,gBAAgB,EAAE,CAAC,CAACC,IAAI,EAAE,CAAC;IAC3F,MAAMC,aAAa,GAAGC,uBAAuB,CAACZ,UAAU,CAAC;IACzD,KAAK,CAAE;AACX,EAAEW,aAAc;AAChB;AACA;AACA;AACA;AACA,sHAAsHN,aAAa,CAACQ,IAAI,CAClI,IAAI,CACJ;AACN;AACA,GAAGC,iBAAY,CAACC,EAAG;AACnB,qBAAqBV,aAAa,CAACE,GAAG,CAAES,KAAK,IAAM,IAAGA,KAAM,GAAE,CAAC,CAACH,IAAI,CAAC,IAAI,CAAE;AAC3E;AACA,CAAC,CAAC;EACA;AACF;AAAC;AAED,SAASD,uBAAuB,CAACZ,UAA+B,EAAE;EAChE,SAASiB,MAAM,CAACf,SAA4B,EAAE;IAC5C,OAAQ,GAAEgB,gBAAK,CAACC,SAAS,CAACD,gBAAK,CAACE,IAAI,CAAClB,SAAS,CAACa,EAAE,CAACM,QAAQ,EAAE,CAAC,CAAE,KAAI,IAAAC,uCAAY,EAACpB,SAAS,CAAE,EAAC;EAC9F;EAEA,MAAMqB,MAAM,GAAI,KAAIvB,UAAU,CAACO,GAAG,CAACU,MAAM,CAAC,CAACJ,IAAI,CAAC,IAAI,CAAE,EAAC;EACvD,OAAOU,MAAM;AACf"}
|
package/dist/index.js
CHANGED
|
@@ -10,19 +10,14 @@ Object.defineProperty(exports, "SnappingAspect", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
exports.default = void 0;
|
|
13
|
-
|
|
14
13
|
function _snapping() {
|
|
15
14
|
const data = require("./snapping.aspect");
|
|
16
|
-
|
|
17
15
|
_snapping = function () {
|
|
18
16
|
return data;
|
|
19
17
|
};
|
|
20
|
-
|
|
21
18
|
return data;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
var _default = _snapping().SnappingAspect;
|
|
25
|
-
|
|
26
21
|
exports.default = _default;
|
|
27
22
|
|
|
28
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { SnappingMain } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport type { onTagIdTransformer } from './tag-model-component';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport type { SnappingMain } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport type { onTagIdTransformer } from './tag-model-component';\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAmD,eAGpCA,0BAAc;AAAA"}
|
package/dist/reset-cmd.js
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.default = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _bitError() {
|
|
25
18
|
const data = require("@teambit/bit-error");
|
|
26
|
-
|
|
27
19
|
_bitError = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _chalk() {
|
|
35
25
|
const data = _interopRequireDefault(require("chalk"));
|
|
36
|
-
|
|
37
26
|
_chalk = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _constants() {
|
|
45
32
|
const data = require("@teambit/legacy/dist/constants");
|
|
46
|
-
|
|
47
33
|
_constants = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
class ResetCmd {
|
|
55
39
|
constructor(snapping) {
|
|
56
40
|
this.snapping = snapping;
|
|
@@ -70,7 +54,6 @@ class ResetCmd {
|
|
|
70
54
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
71
55
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
72
56
|
}
|
|
73
|
-
|
|
74
57
|
async report([pattern], {
|
|
75
58
|
all = false,
|
|
76
59
|
head = false,
|
|
@@ -80,31 +63,24 @@ class ResetCmd {
|
|
|
80
63
|
if (!pattern && !all) {
|
|
81
64
|
throw new (_bitError().BitError)('please specify a component-pattern or use --all flag');
|
|
82
65
|
}
|
|
83
|
-
|
|
84
66
|
if (pattern && all) {
|
|
85
67
|
throw new (_bitError().BitError)('please specify either a component-pattern or --all flag, not both');
|
|
86
68
|
}
|
|
87
|
-
|
|
88
69
|
if (soft && head) {
|
|
89
70
|
throw new (_bitError().BitError)('please specify either --soft or --head flag, not both');
|
|
90
71
|
}
|
|
91
|
-
|
|
92
72
|
const {
|
|
93
73
|
results,
|
|
94
74
|
isSoftUntag
|
|
95
75
|
} = await this.snapping.reset(pattern, head, force, soft);
|
|
96
76
|
const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidate for tagging anymore)' : 'untagged';
|
|
97
|
-
|
|
98
77
|
const title = _chalk().default.green(`${results.length} component(s) were ${titleSuffix}:\n`);
|
|
99
|
-
|
|
100
78
|
const components = results.map(result => {
|
|
101
79
|
return `${_chalk().default.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;
|
|
102
80
|
});
|
|
103
81
|
return title + components.join('\n');
|
|
104
82
|
}
|
|
105
|
-
|
|
106
83
|
}
|
|
107
|
-
|
|
108
84
|
exports.default = ResetCmd;
|
|
109
85
|
|
|
110
86
|
//# sourceMappingURL=reset-cmd.js.map
|
package/dist/reset-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResetCmd","constructor","snapping","name","description","COMPONENT_PATTERN_HELP","BASE_DOCS_DOMAIN","report","pattern","all","head","force","soft","BitError","results","isSoftUntag","reset","titleSuffix","title","chalk","green","length","components","map","result","cyan","id","toStringWithoutVersion","versions","join"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BASE_DOCS_DOMAIN, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert tagged or snapped versions for component(s)';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'component-version',\n description: 'the version to untag (semver for tags. hash for snaps)',\n },\n ];\n group = 'development';\n extendedDescription = `https://${BASE_DOCS_DOMAIN}/components/tags#undoing-a-tag`;\n alias = '';\n options = [\n ['a', 'all', 'revert tag/snap for all tagged/snapped components'],\n ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'],\n ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'],\n [\n 'f',\n 'force',\n 'revert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n\n constructor(private snapping: SnappingMain) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n head = false,\n force = false,\n soft = false,\n }: { all?: boolean; head?: boolean; force?: boolean; soft?: boolean }\n ) {\n if (!pattern && !all) {\n throw new BitError('please specify a component-pattern or use --all flag');\n }\n if (pattern && all) {\n throw new BitError('please specify either a component-pattern or --all flag, not both');\n }\n if (soft && head) {\n throw new BitError('please specify either --soft or --head flag, not both');\n }\n const { results, isSoftUntag } = await this.snapping.reset(pattern, head, force, soft);\n const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidate for tagging anymore)' : 'untagged';\n const title = chalk.green(`${results.length} component(s) were ${titleSuffix}:\\n`);\n const components = results.map((result) => {\n return `${chalk.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;\n });\n return title + components.join('\\n');\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ResetCmd","constructor","snapping","name","description","COMPONENT_PATTERN_HELP","BASE_DOCS_DOMAIN","report","pattern","all","head","force","soft","BitError","results","isSoftUntag","reset","titleSuffix","title","chalk","green","length","components","map","result","cyan","id","toStringWithoutVersion","versions","join"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BASE_DOCS_DOMAIN, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert tagged or snapped versions for component(s)';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'component-version',\n description: 'the version to untag (semver for tags. hash for snaps)',\n },\n ];\n group = 'development';\n extendedDescription = `https://${BASE_DOCS_DOMAIN}/components/tags#undoing-a-tag`;\n alias = '';\n options = [\n ['a', 'all', 'revert tag/snap for all tagged/snapped components'],\n ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'],\n ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'],\n [\n 'f',\n 'force',\n 'revert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n\n constructor(private snapping: SnappingMain) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n head = false,\n force = false,\n soft = false,\n }: { all?: boolean; head?: boolean; force?: boolean; soft?: boolean }\n ) {\n if (!pattern && !all) {\n throw new BitError('please specify a component-pattern or use --all flag');\n }\n if (pattern && all) {\n throw new BitError('please specify either a component-pattern or --all flag, not both');\n }\n if (soft && head) {\n throw new BitError('please specify either --soft or --head flag, not both');\n }\n const { results, isSoftUntag } = await this.snapping.reset(pattern, head, force, soft);\n const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidate for tagging anymore)' : 'untagged';\n const title = chalk.green(`${results.length} component(s) were ${titleSuffix}:\\n`);\n const components = results.map((result) => {\n return `${chalk.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;\n });\n return title + components.join('\\n');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGe,MAAMA,QAAQ,CAAoB;EA6B/CC,WAAW,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,8CA5BnC,2BAA2B;IAAA,qDACpB,oDAAoD;IAAA,mDACtD,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,EACD;MAC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AAK,CAACM,IAAI,CAACD,MAAM,CAACE,EAAE,CAACC,sBAAsB,EAAE,CAAE,iBAAgBH,MAAM,CAACI,QAAQ,CAACC,IAAI,CAAC,IAAI,CAAE,EAAC;IACvG,CAAC,CAAC;IACF,OAAOX,KAAK,GAAGI,UAAU,CAACO,IAAI,CAAC,IAAI,CAAC;EACtC;AACF;AAAC"}
|
package/dist/snap-cmd.js
CHANGED
|
@@ -1,76 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.promise.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.SnapCmd = void 0;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _chalk() {
|
|
25
18
|
const data = _interopRequireDefault(require("chalk"));
|
|
26
|
-
|
|
27
19
|
_chalk = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _componentIssues() {
|
|
35
25
|
const data = require("@teambit/component-issues");
|
|
36
|
-
|
|
37
26
|
_componentIssues = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
function _featureToggle() {
|
|
45
32
|
const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
|
|
46
|
-
|
|
47
33
|
_featureToggle = function () {
|
|
48
34
|
return data;
|
|
49
35
|
};
|
|
50
|
-
|
|
51
36
|
return data;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
function _constants() {
|
|
55
39
|
const data = require("@teambit/legacy/dist/constants");
|
|
56
|
-
|
|
57
40
|
_constants = function () {
|
|
58
41
|
return data;
|
|
59
42
|
};
|
|
60
|
-
|
|
61
43
|
return data;
|
|
62
44
|
}
|
|
63
|
-
|
|
64
45
|
function _bitError() {
|
|
65
46
|
const data = require("@teambit/bit-error");
|
|
66
|
-
|
|
67
47
|
_bitError = function () {
|
|
68
48
|
return data;
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
return data;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
class SnapCmd {
|
|
75
53
|
constructor(docsDomain, snapping, logger) {
|
|
76
54
|
this.snapping = snapping;
|
|
@@ -92,7 +70,6 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
|
|
|
92
70
|
this.extendedDescription = `https://${docsDomain}/components/snaps
|
|
93
71
|
${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
94
72
|
}
|
|
95
|
-
|
|
96
73
|
async report([pattern], {
|
|
97
74
|
message = '',
|
|
98
75
|
all = false,
|
|
@@ -108,24 +85,19 @@ ${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
|
108
85
|
}) {
|
|
109
86
|
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
|
110
87
|
const disableTagAndSnapPipelines = disableSnapPipeline;
|
|
111
|
-
|
|
112
88
|
if (disableTagAndSnapPipelines && forceDeploy) {
|
|
113
89
|
throw new (_bitError().BitError)('you can use either force-deploy or disable-snap-pipeline, but not both');
|
|
114
90
|
}
|
|
115
|
-
|
|
116
91
|
if (all) {
|
|
117
92
|
this.logger.consoleWarning(`--all is deprecated, please omit it. "bit snap" by default will snap all new and modified components`);
|
|
118
93
|
}
|
|
119
|
-
|
|
120
94
|
if (force) {
|
|
121
95
|
this.logger.consoleWarning(`--force is deprecated, use either --skip-tests or --unmodified depending on the use case`);
|
|
122
96
|
if (pattern) unmodified = true;
|
|
123
97
|
}
|
|
124
|
-
|
|
125
98
|
if (!message) {
|
|
126
99
|
this.logger.consoleWarning(`--message will be mandatory in the next few releases. make sure to add a message with your snap`);
|
|
127
100
|
}
|
|
128
|
-
|
|
129
101
|
const results = await this.snapping.snap({
|
|
130
102
|
pattern,
|
|
131
103
|
message,
|
|
@@ -152,33 +124,26 @@ ${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
|
152
124
|
const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
|
|
153
125
|
const tagExplanation = `\n(use "bit export" to push these components to a remote")
|
|
154
126
|
(use "bit reset" to unstage versions)\n`;
|
|
155
|
-
|
|
156
127
|
const outputComponents = comps => {
|
|
157
128
|
return comps.map(component => {
|
|
158
129
|
let componentOutput = ` > ${component.id.toString()}`;
|
|
159
130
|
const autoTag = autoSnappedResults.filter(result => result.triggeredBy.searchWithoutScopeAndVersion(component.id));
|
|
160
|
-
|
|
161
131
|
if (autoTag.length) {
|
|
162
132
|
const autoTagComp = autoTag.map(a => a.component.id.toString());
|
|
163
133
|
componentOutput += `\n ${_constants().AUTO_SNAPPED_MSG} (${autoTagComp.length} total):
|
|
164
134
|
${autoTagComp.join('\n ')}`;
|
|
165
135
|
}
|
|
166
|
-
|
|
167
136
|
return componentOutput;
|
|
168
137
|
}).join('\n');
|
|
169
138
|
};
|
|
170
|
-
|
|
171
139
|
const outputIfExists = (label, explanation, components) => {
|
|
172
140
|
if (!components.length) return '';
|
|
173
141
|
return `\n${_chalk().default.underline(label)}\n(${explanation})\n${outputComponents(components)}\n`;
|
|
174
142
|
};
|
|
175
|
-
|
|
176
143
|
const laneStr = laneName ? ` on "${laneName}" lane` : '';
|
|
177
144
|
return warningsOutput + _chalk().default.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) + tagExplanation + outputIfExists('new components', 'first version for components', addedComponents) + outputIfExists('changed components', 'components that got a version bump', changedComponents);
|
|
178
145
|
}
|
|
179
|
-
|
|
180
146
|
}
|
|
181
|
-
|
|
182
147
|
exports.SnapCmd = SnapCmd;
|
|
183
148
|
|
|
184
149
|
//# sourceMappingURL=snap-cmd.js.map
|
package/dist/snap-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SnapCmd","constructor","docsDomain","snapping","logger","name","description","COMPONENT_PATTERN_HELP","Object","keys","IssuesClasses","join","extendedDescription","WILDCARD_HELP","report","pattern","message","all","force","unmerged","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","unmodified","isFeatureEnabled","BUILD_ON_CI","Boolean","disableTagAndSnapPipelines","BitError","consoleWarning","results","snap","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","warningsOutput","tagExplanation","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","green"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport {\n WILDCARD_HELP,\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n} from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'EXPERIMENTAL. create an immutable and exportable component snapshot (no release version)';\n extendedDescription: string;\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are snapped.`,\n },\n ];\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'EXPERIMENTAL. complete a merge process by snapping the unmerged components'],\n ['', 'build', 'Harmony only. run the pipeline build and complete the tag'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'],\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 ['a', 'all', 'DEPRECATED (not needed anymore, it is the default now). snap all new and modified components'],\n [\n 'f',\n 'force',\n 'DEPRECATED (use \"--skip-tests\" or \"--unmodified\" instead). force-snap even if tests are failing and even when component has not changed',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(docsDomain: string, private snapping: SnappingMain, private logger: Logger) {\n this.extendedDescription = `https://${docsDomain}/components/snaps\n${WILDCARD_HELP('snap')}`;\n }\n\n async report(\n [pattern]: string[],\n {\n message = '',\n all = false,\n force = false,\n unmerged = false,\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n unmodified = false,\n }: {\n message?: string;\n all?: boolean;\n force?: boolean;\n unmerged?: boolean;\n ignoreIssues?: string;\n build?: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-snap-pipeline, but not both');\n }\n\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit snap\" by default will snap all new and modified components`\n );\n }\n if (force) {\n this.logger.consoleWarning(\n `--force is deprecated, use either --skip-tests or --unmodified depending on the use case`\n );\n if (pattern) unmodified = true;\n }\n if (!message) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n forceDeploy,\n unmodified,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName }: SnapResults = results;\n const changedComponents = snappedComponents.filter(\n (component) => !newComponents.searchWithoutVersion(component.id)\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 tagExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\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 warningsOutput +\n chalk.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n tagExplanation +\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,OAAN,CAAiC;EAsCtCC,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAA6DC,MAA7D,EAA6E;IAAA,KAAhDD,QAAgD,GAAhDA,QAAgD;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,8CArCjF,0BAqCiF;IAAA,qDApC1E,0FAoC0E;IAAA;IAAA,mDAlC5E,CACV;MACEC,IAAI,EAAE,mBADR;MAEEC,WAAW,EAAG,GAAEC,mCAAuB;IAFzC,CADU,CAkC4E;IAAA,+CA5BhF,EA4BgF;IAAA,iDA3B9E,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,2CAA3B,CADQ,EAER,CAAC,EAAD,EAAK,YAAL,EAAmB,0FAAnB,CAFQ,EAGR,CAAC,EAAD,EAAK,UAAL,EAAiB,4EAAjB,CAHQ,EAIR,CAAC,EAAD,EAAK,OAAL,EAAc,2DAAd,CAJQ,EAKR,CAAC,EAAD,EAAK,YAAL,EAAmB,kDAAnB,CALQ,EAMR,CAAC,EAAD,EAAK,gBAAL,EAAuB,+BAAvB,CANQ,EAOR,CAAC,EAAD,EAAK,uBAAL,EAA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,kBAAkB,CAACK,MAAnB,CAA2Be,MAAD,IACxCA,MAAM,CAACC,WAAP,CAAmBC,4BAAnB,CAAgDhB,SAAS,CAACE,EAA1D,CADc,CAAhB;;QAGA,IAAIW,OAAO,CAACR,MAAZ,EAAoB;UAClB,MAAMY,WAAW,GAAGJ,OAAO,CAACH,GAAR,CAAaQ,CAAD,IAAOA,CAAC,CAAClB,SAAF,CAAYE,EAAZ,CAAeU,QAAf,EAAnB,CAApB;UACAD,eAAe,IAAK,YAAWQ,6BAAiB,KAAIF,WAAW,CAACZ,MAAO;AACnF,cAAcY,WAAW,CAACnD,IAAZ,CAAiB,gBAAjB,CAAmC,EADrC;QAED;;QACD,OAAO6C,eAAP;MACD,CAZI,EAaJ7C,IAbI,CAaC,IAbD,CAAP;IAcD,CAfD;;IAiBA,MAAMsD,cAAc,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,UAArB,KAAoC;MACzD,IAAI,CAACA,UAAU,CAAClB,MAAhB,EAAwB,OAAO,EAAP;MACxB,OAAQ,KAAIf,gBAAA,CAAMkC,SAAN,CAAgBH,KAAhB,CAAuB,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAD,CAAa,IAAtF;IACD,CAHD;;IAIA,MAAME,OAAO,GAAG5B,QAAQ,GAAI,QAAOA,QAAS,QAApB,GAA8B,EAAtD;IAEA,OACES,cAAc,GACdhB,gBAAA,CAAMoC,KAAN,CAAa,GAAEjC,iBAAiB,CAACY,MAAlB,GAA2BD,eAAgB,wBAAuBqB,OAAQ,EAAzF,CADA,GAEAlB,cAFA,GAGAa,cAAc,CAAC,gBAAD,EAAmB,8BAAnB,EAAmDjB,eAAnD,CAHd,GAIAiB,cAAc,CAAC,oBAAD,EAAuB,oCAAvB,EAA6DtB,iBAA7D,CALhB;EAOD;;AArJqC"}
|
|
1
|
+
{"version":3,"names":["SnapCmd","constructor","docsDomain","snapping","logger","name","description","COMPONENT_PATTERN_HELP","Object","keys","IssuesClasses","join","extendedDescription","WILDCARD_HELP","report","pattern","message","all","force","unmerged","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","unmodified","isFeatureEnabled","BUILD_ON_CI","Boolean","disableTagAndSnapPipelines","BitError","consoleWarning","results","snap","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","warningsOutput","tagExplanation","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","green"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport {\n WILDCARD_HELP,\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n} from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'EXPERIMENTAL. create an immutable and exportable component snapshot (no release version)';\n extendedDescription: string;\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are snapped.`,\n },\n ];\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'EXPERIMENTAL. complete a merge process by snapping the unmerged components'],\n ['', 'build', 'Harmony only. run the pipeline build and complete the tag'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'],\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 ['a', 'all', 'DEPRECATED (not needed anymore, it is the default now). snap all new and modified components'],\n [\n 'f',\n 'force',\n 'DEPRECATED (use \"--skip-tests\" or \"--unmodified\" instead). force-snap even if tests are failing and even when component has not changed',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(docsDomain: string, private snapping: SnappingMain, private logger: Logger) {\n this.extendedDescription = `https://${docsDomain}/components/snaps\n${WILDCARD_HELP('snap')}`;\n }\n\n async report(\n [pattern]: string[],\n {\n message = '',\n all = false,\n force = false,\n unmerged = false,\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n unmodified = false,\n }: {\n message?: string;\n all?: boolean;\n force?: boolean;\n unmerged?: boolean;\n ignoreIssues?: string;\n build?: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-snap-pipeline, but not both');\n }\n\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit snap\" by default will snap all new and modified components`\n );\n }\n if (force) {\n this.logger.consoleWarning(\n `--force is deprecated, use either --skip-tests or --unmodified depending on the use case`\n );\n if (pattern) unmodified = true;\n }\n if (!message) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n forceDeploy,\n unmodified,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName }: SnapResults = results;\n const changedComponents = snappedComponents.filter(\n (component) => !newComponents.searchWithoutVersion(component.id)\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 tagExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\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 warningsOutput +\n chalk.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n tagExplanation +\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents)\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;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I,CAAC;IACf,CAAC;IAED,MAAMsD,cAAc,GAAG,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;MACzD,IAAI,CAACA,UAAU,CAAClB,MAAM,EAAE,OAAO,EAAE;MACjC,OAAQ,KAAIf,gBAAK,CAACkC,SAAS,CAACH,KAAK,CAAE,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAU,CAAE,IAAG;IAC3F,CAAC;IACD,MAAME,OAAO,GAAG5B,QAAQ,GAAI,QAAOA,QAAS,QAAO,GAAG,EAAE;IAExD,OACES,cAAc,GACdhB,gBAAK,CAACoC,KAAK,CAAE,GAAEjC,iBAAiB,CAACY,MAAM,GAAGD,eAAgB,wBAAuBqB,OAAQ,EAAC,CAAC,GAC3FlB,cAAc,GACda,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAEjB,eAAe,CAAC,GACjFiB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAEtB,iBAAiB,CAAC;EAEjG;AACF;AAAC"}
|
package/dist/snapping.aspect.js
CHANGED
|
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SnappingAspect = void 0;
|
|
7
|
-
|
|
8
7
|
function _harmony() {
|
|
9
8
|
const data = require("@teambit/harmony");
|
|
10
|
-
|
|
11
9
|
_harmony = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const SnappingAspect = _harmony().Aspect.create({
|
|
19
15
|
id: 'teambit.component/snapping'
|
|
20
16
|
});
|
|
21
|
-
|
|
22
17
|
exports.SnappingAspect = SnappingAspect;
|
|
23
18
|
|
|
24
19
|
//# sourceMappingURL=snapping.aspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SnappingAspect","Aspect","create","id"],"sources":["snapping.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SnappingAspect = Aspect.create({\n id: 'teambit.component/snapping',\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SnappingAspect","Aspect","create","id"],"sources":["snapping.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SnappingAspect = Aspect.create({\n id: 'teambit.component/snapping',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,cAAc,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|