@teambit/snapping 0.0.114 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snap-cmd.d.ts +2 -1
- package/dist/snap-cmd.js +3 -1
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +4 -3
- package/dist/snapping.main.runtime.js +15 -5
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.d.ts +2 -1
- package/dist/tag-cmd.js +3 -1
- package/dist/tag-cmd.js.map +1 -1
- package/package-tar/teambit-snapping-0.0.117.tgz +0 -0
- package/package.json +10 -10
- /package/{preview-1658892570025.js → preview-1659151732866.js} +0 -0
- package/package-tar/teambit-snapping-0.0.114.tgz +0 -0
package/dist/snap-cmd.d.ts
CHANGED
|
@@ -17,10 +17,11 @@ export declare class SnapCmd implements Command {
|
|
|
17
17
|
private: boolean;
|
|
18
18
|
migration: boolean;
|
|
19
19
|
constructor(docsDomain: string, snapping: SnappingMain, logger: Logger);
|
|
20
|
-
report([pattern]: string[], { message, all, force, ignoreIssues, build, skipTests, skipAutoSnap, disableSnapPipeline, forceDeploy, unmodified, }: {
|
|
20
|
+
report([pattern]: string[], { message, all, force, unmerged, ignoreIssues, build, skipTests, skipAutoSnap, disableSnapPipeline, forceDeploy, unmodified, }: {
|
|
21
21
|
message?: string;
|
|
22
22
|
all?: boolean;
|
|
23
23
|
force?: boolean;
|
|
24
|
+
unmerged?: boolean;
|
|
24
25
|
ignoreIssues?: string;
|
|
25
26
|
build?: boolean;
|
|
26
27
|
skipTests?: boolean;
|
package/dist/snap-cmd.js
CHANGED
|
@@ -83,7 +83,7 @@ class SnapCmd {
|
|
|
83
83
|
description: `${_constants().COMPONENT_PATTERN_HELP}. By default, all new and modified components are snapped.`
|
|
84
84
|
}]);
|
|
85
85
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
86
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the latest changes'], ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'], ['', 'build', 'Harmony only. run the pipeline build and complete the tag'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'skip-auto-snap', 'skip auto snapping dependents'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
86
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the latest changes'], ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'], ['', 'unmerged', 'EXPERIMENTAL. complete a merge process by snapping the unmerged components'], ['', 'build', 'Harmony only. run the pipeline build and complete the tag'], ['', 'skip-tests', 'skip running component tests during snap process'], ['', 'skip-auto-snap', 'skip auto snapping dependents'], ['', 'disable-snap-pipeline', 'skip the snap pipeline'], ['', 'force-deploy', 'Harmony only. run the deploy pipeline although the build failed'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
87
87
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
88
88
|
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['a', 'all', 'DEPRECATED (not needed anymore, it is the default now). snap all new and modified components'], ['f', 'force', 'DEPRECATED (use "--skip-tests" or "--unmodified" instead). force-snap even if tests are failing and even when component has not changed']]);
|
|
89
89
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
@@ -97,6 +97,7 @@ ${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
|
97
97
|
message = '',
|
|
98
98
|
all = false,
|
|
99
99
|
force = false,
|
|
100
|
+
unmerged = false,
|
|
100
101
|
ignoreIssues,
|
|
101
102
|
build,
|
|
102
103
|
skipTests = false,
|
|
@@ -128,6 +129,7 @@ ${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
|
128
129
|
const results = await this.snapping.snap({
|
|
129
130
|
pattern,
|
|
130
131
|
message,
|
|
132
|
+
unmerged,
|
|
131
133
|
ignoreIssues,
|
|
132
134
|
build,
|
|
133
135
|
skipTests,
|
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","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 ['', '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 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 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 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', addedCompon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AK,YAAWQ,6BAAiB,KAAIF,WAAW,CAACZ,MAAO;AACnF,cAAcY,WAAW,CAAClD,IAAZ,CAAiB,gBAAjB,CAAmC,EADrC;QAED;;QACD,OAAO4C,eAAP;MACD,CAZI,EAaJ5C,IAbI,CAaC,IAbD,CAAP;IAcD,CAfD;;IAiBA,MAAMqD,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;;AAjJqC"}
|
|
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;I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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"}
|
|
@@ -21,10 +21,11 @@ export declare class SnappingMain {
|
|
|
21
21
|
* with a valid semver to that version.
|
|
22
22
|
* tag can be done only on main, not on a lane.
|
|
23
23
|
*/
|
|
24
|
-
tag({ ids, message, version, editor, snapped, releaseType, preReleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, build, unmodified, soft, persist, forceDeploy, incrementBy, disableTagAndSnapPipelines, }: {
|
|
24
|
+
tag({ ids, message, version, editor, snapped, unmerged, releaseType, preReleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, build, unmodified, soft, persist, forceDeploy, incrementBy, disableTagAndSnapPipelines, }: {
|
|
25
25
|
ids?: string[];
|
|
26
26
|
all?: boolean | string;
|
|
27
27
|
snapped?: boolean;
|
|
28
|
+
unmerged?: boolean;
|
|
28
29
|
version?: string;
|
|
29
30
|
releaseType?: ReleaseType;
|
|
30
31
|
ignoreIssues?: string;
|
|
@@ -36,10 +37,10 @@ export declare class SnappingMain {
|
|
|
36
37
|
* once a component is snapped on a lane, it becomes part of it.
|
|
37
38
|
*/
|
|
38
39
|
snap({ pattern, legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.
|
|
39
|
-
|
|
40
|
+
unmerged, message, ignoreIssues, skipTests, skipAutoSnap, build, disableTagAndSnapPipelines, forceDeploy, unmodified, }: {
|
|
40
41
|
pattern?: string;
|
|
41
42
|
legacyBitIds?: BitIds;
|
|
42
|
-
|
|
43
|
+
unmerged?: boolean;
|
|
43
44
|
message?: string;
|
|
44
45
|
ignoreIssues?: string;
|
|
45
46
|
build: boolean;
|
|
@@ -373,6 +373,7 @@ class SnappingMain {
|
|
|
373
373
|
version,
|
|
374
374
|
editor = '',
|
|
375
375
|
snapped = false,
|
|
376
|
+
unmerged = false,
|
|
376
377
|
releaseType,
|
|
377
378
|
preReleaseId,
|
|
378
379
|
ignoreIssues,
|
|
@@ -416,7 +417,7 @@ class SnappingMain {
|
|
|
416
417
|
const {
|
|
417
418
|
bitIds,
|
|
418
419
|
warnings
|
|
419
|
-
} = await this.getComponentsToTag(unmodified, exactVersion, persist, ids, snapped);
|
|
420
|
+
} = await this.getComponentsToTag(unmodified, exactVersion, persist, ids, snapped, unmerged);
|
|
420
421
|
if (_ramda().default.isEmpty(bitIds)) return null;
|
|
421
422
|
|
|
422
423
|
const legacyBitIds = _bitId().BitIds.fromArray(bitIds);
|
|
@@ -458,7 +459,6 @@ class SnappingMain {
|
|
|
458
459
|
soft,
|
|
459
460
|
build,
|
|
460
461
|
persist,
|
|
461
|
-
resolveUnmerged: false,
|
|
462
462
|
disableTagAndSnapPipelines,
|
|
463
463
|
forceDeploy,
|
|
464
464
|
incrementBy,
|
|
@@ -494,7 +494,7 @@ class SnappingMain {
|
|
|
494
494
|
pattern,
|
|
495
495
|
legacyBitIds,
|
|
496
496
|
// @todo: change to ComponentID[]. pass only if have the ids already parsed.
|
|
497
|
-
|
|
497
|
+
unmerged,
|
|
498
498
|
message = '',
|
|
499
499
|
ignoreIssues,
|
|
500
500
|
skipTests = false,
|
|
@@ -537,7 +537,6 @@ class SnappingMain {
|
|
|
537
537
|
persist: true,
|
|
538
538
|
soft: false,
|
|
539
539
|
build,
|
|
540
|
-
resolveUnmerged,
|
|
541
540
|
isSnap: true,
|
|
542
541
|
disableTagAndSnapPipelines,
|
|
543
542
|
forceDeploy,
|
|
@@ -556,6 +555,10 @@ class SnappingMain {
|
|
|
556
555
|
return snapResults;
|
|
557
556
|
|
|
558
557
|
async function getIdsToSnap(workspace) {
|
|
558
|
+
if (unmerged) {
|
|
559
|
+
return componentsList.listDuringMergeStateComponents();
|
|
560
|
+
}
|
|
561
|
+
|
|
559
562
|
const tagPendingComponents = unmodified ? await componentsList.listPotentialTagAllWorkspace() : await componentsList.listTagPendingComponents();
|
|
560
563
|
if (_ramda().default.isEmpty(tagPendingComponents)) return null;
|
|
561
564
|
const tagPendingComponentsIds = await workspace.resolveMultipleComponentIds(tagPendingComponents); // when unmodified, we ask for all components, throw if no matching. if not unmodified and no matching, see error
|
|
@@ -720,7 +723,7 @@ there are matching among unmodified components thought. consider using --unmodif
|
|
|
720
723
|
});
|
|
721
724
|
}
|
|
722
725
|
|
|
723
|
-
async getComponentsToTag(includeUnmodified, exactVersion, persist, ids, snapped) {
|
|
726
|
+
async getComponentsToTag(includeUnmodified, exactVersion, persist, ids, snapped, unmerged) {
|
|
724
727
|
const warnings = [];
|
|
725
728
|
const componentsList = new (_componentsList().default)(this.workspace.consumer);
|
|
726
729
|
|
|
@@ -769,6 +772,13 @@ there are matching among unmodified components thought. consider using --unmodif
|
|
|
769
772
|
};
|
|
770
773
|
}
|
|
771
774
|
|
|
775
|
+
if (unmerged) {
|
|
776
|
+
return {
|
|
777
|
+
bitIds: componentsList.listDuringMergeStateComponents(),
|
|
778
|
+
warnings
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
|
|
772
782
|
tagPendingBitIds.push(...snappedComponentsIds);
|
|
773
783
|
|
|
774
784
|
if (includeUnmodified && exactVersion) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HooksManagerInstance","HooksManager","getInstance","SnappingMain","constructor","workspace","logger","issues","insights","tag","ids","message","version","editor","snapped","releaseType","preReleaseId","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","build","unmodified","soft","persist","forceDeploy","incrementBy","disableTagAndSnapPipelines","isFeatureEnabled","BUILD_ON_CI","Boolean","BitError","exactVersion","ConsumerNotFound","idsHasWildcard","hasWildcard","isAll","length","validExactVersion","validateVersion","consumer","componentsList","ComponentsList","loader","start","newComponents","listNewComponents","bitIds","warnings","getComponentsToTag","R","isEmpty","legacyBitIds","BitIds","fromArray","debug","toString","Analytics","addBreadCrumb","hashData","componentFsCache","deleteAllDependenciesDataCache","components","loadComponentsForTag","throwForLegacyDependenciesInsideHarmony","throwForComponentIssues","areComponentsMissingFromScope","some","c","componentFromModel","id","hasScope","ComponentsPendingImport","taggedComponents","autoTaggedResults","publishedPackages","tagModelComponent","consumerComponents","scope","legacyScope","resolveUnmerged","packageManagerConfigRootDir","path","tagResults","isSoftTag","postHook","POST_TAG_ALL_HOOK","POST_TAG_HOOK","triggerHook","setExtraData","concat","onDestroy","snap","pattern","skipAutoSnap","Error","getIdsToSnap","isSnap","snapResults","snappedComponents","autoSnappedResults","currentLane","getCurrentLaneId","laneName","isDefault","name","tagPendingComponents","listPotentialTagAllWorkspace","listTagPendingComponents","tagPendingComponentsIds","resolveMultipleComponentIds","shouldThrowForNoMatching","getCompIds","includes","compId","resolveComponentId","filterIdsFromPoolIdsByPattern","componentIds","allTagPending","map","_legacy","reset","componentPattern","head","force","getCurrentLaneObject","untag","removeLocalVersionsForAllComponents","candidateComponents","getComponentsWithOptionToUntag","idsMatchingPattern","idsByPattern","idsMatchingPatternBitIds","componentsToUntag","filter","modelComponent","hasWithoutVersion","toBitId","removeLocalVersionsForMultipleComponents","softUntag","softTaggedComponents","listSoftTaggedComponents","softTaggedComponentsIds","idsToRemoveSoftTags","compact","componentId","componentMap","bitMap","getComponent","ignoreScopeAndVersion","removedVersion","nextVersion","clearNextVersion","versions","results","isRealUntag","objects","result","component","updateComponentsVersions","markAsChanged","isSoftUntag","loadComponents","toVersionLatest","forEach","rootDir","legacyComponents","issuesToIgnoreFromFlag","split","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","getManyByLegacy","IssuesClasses","CircularDependencies","addInsightsAsComponentIssues","removeIgnoredIssuesFromComponents","componentsWithBlockingIssues","shouldBlockTagging","ComponentsHaveIssues","throwForComponent","dependenciesIds","getAllDependenciesIds","Promise","all","depId","hasVersion","modelComp","getModelComponentIfExist","loadVersion","isLegacy","pMap","concurrency","concurrentComponentsLimit","includeUnmodified","tagPendingBitIds","listSnappedComponentsOnMain","snappedComponentsIds","pMapSeries","idWithoutVer","idHasWildcard","allIds","changeVersion","componentStatus","getComponentStatusById","modified","flat","bitId","push","tagPendingComponentsLatest","latestVersions","semver","valid","gt","undefined","provider","cli","community","loggerMain","createLogger","SnappingAspect","snapping","snapCmd","SnapCmd","getBaseDomain","tagCmd","TagCmd","resetCmd","ResetCmd","register","WorkspaceAspect","CLIAspect","CommunityAspect","LoggerAspect","IssuesAspect","InsightsAspect","MainRuntime","addRuntime"],"sources":["snapping.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport CommunityAspect, { CommunityMain } from '@teambit/community';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport semver, { ReleaseType } from 'semver';\nimport { compact } from 'lodash';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { POST_TAG_ALL_HOOK, POST_TAG_HOOK } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport HooksManager from '@teambit/legacy/dist/hooks';\nimport pMapSeries from 'p-map-series';\nimport { TagResults, BasicTagParams } from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { validateVersion } from '@teambit/legacy/dist/utils/semver-helper';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport tagModelComponent from '@teambit/legacy/dist/scope/component-ops/tag-model-component';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport ComponentsPendingImport from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-import';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport pMap from 'p-map';\nimport { InsightsAspect, InsightsMain } from '@teambit/insights';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport {\n removeLocalVersionsForAllComponents,\n untagResult,\n getComponentsWithOptionToUntag,\n removeLocalVersionsForMultipleComponents,\n} from '@teambit/legacy/dist/scope/component-ops/untag-component';\nimport { ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport { SnapCmd } from './snap-cmd';\nimport { SnappingAspect } from './snapping.aspect';\nimport { TagCmd } from './tag-cmd';\nimport { ComponentsHaveIssues } from './components-have-issues';\nimport ResetCmd from './reset-cmd';\n\nconst HooksManagerInstance = HooksManager.getInstance();\n\nexport class SnappingMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private issues: IssuesMain,\n private insights: InsightsMain\n ) {}\n\n /**\n * tag the given component ids or all modified/new components if \"all\" param is set.\n * tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias\n * with a valid semver to that version.\n * tag can be done only on main, not on a lane.\n */\n // eslint-disable-next-line complexity\n async tag({\n ids = [],\n message = '',\n version,\n editor = '',\n snapped = false,\n releaseType,\n preReleaseId,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n build,\n unmodified = false,\n soft = false,\n persist = false,\n forceDeploy = false,\n incrementBy = 1,\n disableTagAndSnapPipelines = false,\n }: {\n ids?: string[];\n all?: boolean | string;\n snapped?: boolean;\n version?: string;\n releaseType?: ReleaseType;\n ignoreIssues?: string;\n scope?: string | boolean;\n incrementBy?: number;\n } & Partial<BasicTagParams>): Promise<TagResults | null> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n if (soft) build = false;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-tag-pipeline, but not both');\n }\n if (editor && persist) {\n throw new BitError('you can use either --editor or --persist, but not both');\n }\n if (editor && message) {\n throw new BitError('you can use either --editor or --message, but not both');\n }\n\n const exactVersion = version;\n if (!this.workspace) throw new ConsumerNotFound();\n const idsHasWildcard = hasWildcard(ids);\n const isAll = Boolean(!ids.length || idsHasWildcard);\n const validExactVersion = validateVersion(exactVersion);\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n loader.start('determine components to tag...');\n const newComponents = await componentsList.listNewComponents();\n const { bitIds, warnings } = await this.getComponentsToTag(unmodified, exactVersion, persist, ids, snapped);\n if (R.isEmpty(bitIds)) return null;\n\n const legacyBitIds = BitIds.fromArray(bitIds);\n\n this.logger.debug(`tagging the following components: ${legacyBitIds.toString()}`);\n Analytics.addBreadCrumb('tag', `tagging the following components: ${Analytics.hashData(legacyBitIds)}`);\n if (!soft) {\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n }\n const components = await this.loadComponentsForTag(legacyBitIds);\n await this.throwForLegacyDependenciesInsideHarmony(components);\n await this.throwForComponentIssues(components, ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults, publishedPackages } = await tagModelComponent({\n consumerComponents: components,\n ids: legacyBitIds,\n scope: this.workspace.scope.legacyScope,\n message,\n editor,\n exactVersion: validExactVersion,\n releaseType,\n preReleaseId,\n consumer: this.workspace.consumer,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n soft,\n build,\n persist,\n resolveUnmerged: false,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n packageManagerConfigRootDir: this.workspace.path,\n });\n\n const tagResults = { taggedComponents, autoTaggedResults, isSoftTag: soft, publishedPackages };\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.warnings = warnings;\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.newComponents = newComponents;\n const postHook = isAll ? POST_TAG_ALL_HOOK : POST_TAG_HOOK;\n HooksManagerInstance?.triggerHook(postHook, tagResults);\n Analytics.setExtraData(\n 'num_components',\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n R.concat(tagResults.taggedComponents, tagResults.autoTaggedResults, tagResults.newComponents).length\n );\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return tagResults;\n }\n\n /**\n * save the local changes of a component(s) into the scope. snap can be done on main or on a lane.\n * once a component is snapped on a lane, it becomes part of it.\n */\n async snap({\n pattern,\n legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.\n resolveUnmerged = false,\n message = '',\n ignoreIssues,\n skipTests = false,\n skipAutoSnap = false,\n build,\n disableTagAndSnapPipelines = false,\n forceDeploy = false,\n unmodified = false,\n }: {\n pattern?: string;\n legacyBitIds?: BitIds;\n resolveUnmerged?: boolean;\n message?: string;\n ignoreIssues?: string;\n build: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableTagAndSnapPipelines?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n }): Promise<SnapResults | null> {\n if (!this.workspace) throw new ConsumerNotFound();\n if (pattern && legacyBitIds) throw new Error(`please pass either pattern or legacyBitIds, not both`);\n const consumer: Consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents()) as BitIds;\n const ids = legacyBitIds || (await getIdsToSnap(this.workspace));\n if (!ids) return null;\n this.logger.debug(`snapping the following components: ${ids.toString()}`);\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n const components = await this.loadComponentsForTag(ids);\n await this.throwForLegacyDependenciesInsideHarmony(components);\n await this.throwForComponentIssues(components, ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults } = await tagModelComponent({\n consumerComponents: components,\n ids,\n ignoreNewestVersion: false,\n scope: this.workspace.scope.legacyScope,\n message,\n consumer: this.workspace.consumer,\n skipTests,\n skipAutoTag: skipAutoSnap,\n persist: true,\n soft: false,\n build,\n resolveUnmerged,\n isSnap: true,\n disableTagAndSnapPipelines,\n forceDeploy,\n packageManagerConfigRootDir: this.workspace.path,\n });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const snapResults: SnapResults = { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n\n snapResults.newComponents = newComponents;\n const currentLane = consumer.getCurrentLaneId();\n snapResults.laneName = currentLane.isDefault() ? null : currentLane.name;\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return snapResults;\n\n async function getIdsToSnap(workspace: Workspace): Promise<BitIds | null> {\n const tagPendingComponents = unmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n if (R.isEmpty(tagPendingComponents)) return null;\n const tagPendingComponentsIds = await workspace.resolveMultipleComponentIds(tagPendingComponents);\n // when unmodified, we ask for all components, throw if no matching. if not unmodified and no matching, see error\n // below, suggesting to use --unmodified flag.\n const shouldThrowForNoMatching = unmodified;\n const getCompIds = async () => {\n if (!pattern) return tagPendingComponentsIds;\n if (!pattern.includes('*') && !pattern.includes(',')) {\n const compId = await workspace.resolveComponentId(pattern);\n return [compId];\n }\n return workspace.scope.filterIdsFromPoolIdsByPattern(\n pattern,\n tagPendingComponentsIds,\n shouldThrowForNoMatching\n );\n };\n const componentIds = await getCompIds();\n if (!componentIds.length && pattern) {\n const allTagPending = await componentsList.listPotentialTagAllWorkspace();\n if (allTagPending.length) {\n throw new BitError(`unable to find matching for \"${pattern}\" pattern among modified/new components.\nthere are matching among unmodified components thought. consider using --unmodified flag if needed`);\n }\n }\n if (!componentIds.length) {\n return null;\n }\n return BitIds.fromArray(componentIds.map((c) => c._legacy));\n }\n }\n\n /**\n * remove tags/snaps that exist locally, which were not exported yet.\n * once a tag/snap is exported, it's impossible to delete it as other components may depend on it\n */\n async reset(\n componentPattern?: string,\n head?: boolean,\n force = false,\n soft = false\n ): Promise<{ results: untagResult[]; isSoftUntag: boolean }> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer = this.workspace.consumer;\n const currentLane = await consumer.getCurrentLaneObject();\n const untag = async (): Promise<untagResult[]> => {\n if (!componentPattern) {\n return removeLocalVersionsForAllComponents(consumer, currentLane, head);\n }\n const candidateComponents = await getComponentsWithOptionToUntag(consumer);\n const idsMatchingPattern = await this.workspace.idsByPattern(componentPattern);\n const idsMatchingPatternBitIds = BitIds.fromArray(idsMatchingPattern.map((id) => id._legacy));\n const componentsToUntag = candidateComponents.filter((modelComponent) =>\n idsMatchingPatternBitIds.hasWithoutVersion(modelComponent.toBitId())\n );\n return removeLocalVersionsForMultipleComponents(componentsToUntag, currentLane, head, force, consumer.scope);\n };\n const softUntag = async () => {\n const componentsList = new ComponentsList(consumer);\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n const softTaggedComponentsIds = await this.workspace.resolveMultipleComponentIds(softTaggedComponents);\n const idsToRemoveSoftTags = componentPattern\n ? this.workspace.scope.filterIdsFromPoolIdsByPattern(componentPattern, softTaggedComponentsIds)\n : softTaggedComponentsIds;\n return compact(\n idsToRemoveSoftTags.map((componentId) => {\n const componentMap = consumer.bitMap.getComponent(componentId._legacy, { ignoreScopeAndVersion: true });\n const removedVersion = componentMap.nextVersion?.version;\n if (!removedVersion) return null;\n componentMap.clearNextVersion();\n return { id: componentId._legacy, versions: [removedVersion] };\n })\n );\n };\n let results: untagResult[];\n const isRealUntag = !soft;\n if (isRealUntag) {\n results = await untag();\n await consumer.scope.objects.persist();\n const components = results.map((result) => result.component);\n await consumer.updateComponentsVersions(components as ModelComponent[]);\n } else {\n results = await softUntag();\n consumer.bitMap.markAsChanged();\n }\n\n await consumer.onDestroy();\n return { results, isSoftUntag: !isRealUntag };\n }\n\n private async loadComponentsForTag(ids: BitIds): Promise<ConsumerComponent[]> {\n const { components } = await this.workspace.consumer.loadComponents(ids.toVersionLatest());\n components.forEach((component) => {\n const componentMap = component.componentMap as ComponentMap;\n if (!componentMap.rootDir) {\n throw new Error(`unable to tag ${component.id.toString()}, the \"rootDir\" is missing in the .bitmap file`);\n }\n });\n return components;\n }\n\n private async throwForComponentIssues(legacyComponents: ConsumerComponent[], ignoreIssues?: string) {\n if (ignoreIssues === '*') {\n // ignore all issues\n return;\n }\n const issuesToIgnoreFromFlag = ignoreIssues?.split(',').map((issue) => issue.trim()) || [];\n const issuesToIgnoreFromConfig = this.issues.getIssuesToIgnoreGlobally();\n const issuesToIgnore = [...issuesToIgnoreFromFlag, ...issuesToIgnoreFromConfig];\n const components = await this.workspace.getManyByLegacy(legacyComponents);\n if (!issuesToIgnore.includes(IssuesClasses.CircularDependencies.name)) {\n await this.insights.addInsightsAsComponentIssues(components);\n }\n this.issues.removeIgnoredIssuesFromComponents(components);\n\n const componentsWithBlockingIssues = legacyComponents.filter((component) => component.issues?.shouldBlockTagging());\n if (!R.isEmpty(componentsWithBlockingIssues)) {\n throw new ComponentsHaveIssues(componentsWithBlockingIssues);\n }\n }\n\n private async throwForLegacyDependenciesInsideHarmony(components: ConsumerComponent[]) {\n const throwForComponent = async (component: ConsumerComponent) => {\n const dependenciesIds = component.getAllDependenciesIds();\n const legacyScope = this.workspace.scope.legacyScope;\n await Promise.all(\n dependenciesIds.map(async (depId) => {\n if (!depId.hasVersion()) return;\n const modelComp = await legacyScope.getModelComponentIfExist(depId);\n if (!modelComp) return;\n const version = await modelComp.loadVersion(depId.version as string, legacyScope.objects);\n if (version.isLegacy) {\n throw new Error(\n `unable tagging \"${component.id.toString()}\", its dependency \"${depId.toString()}\" is legacy`\n );\n }\n })\n );\n };\n await pMap(components, (component) => throwForComponent(component), { concurrency: concurrentComponentsLimit() });\n }\n\n private async getComponentsToTag(\n includeUnmodified: boolean,\n exactVersion: string | undefined,\n persist: boolean,\n ids: string[],\n snapped: boolean\n ): Promise<{ bitIds: BitId[]; warnings: string[] }> {\n const warnings: string[] = [];\n const componentsList = new ComponentsList(this.workspace.consumer);\n if (persist) {\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n return { bitIds: softTaggedComponents, warnings: [] };\n }\n\n const tagPendingBitIds = includeUnmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n\n const tagPendingComponentsIds = await this.workspace.resolveMultipleComponentIds(tagPendingBitIds);\n\n const snappedComponents = await componentsList.listSnappedComponentsOnMain();\n const snappedComponentsIds = snappedComponents.map((c) => c.toBitId());\n\n if (ids.length) {\n const componentIds = await pMapSeries(ids, async (id) => {\n const [idWithoutVer, version] = id.split('@');\n const idHasWildcard = hasWildcard(id);\n if (idHasWildcard) {\n const allIds = this.workspace.scope.filterIdsFromPoolIdsByPattern(idWithoutVer, tagPendingComponentsIds);\n return allIds.map((componentId) => componentId.changeVersion(version));\n }\n const componentId = await this.workspace.resolveComponentId(idWithoutVer);\n if (!includeUnmodified) {\n const componentStatus = await this.workspace.consumer.getComponentStatusById(componentId._legacy);\n if (componentStatus.modified === false) return null;\n }\n return componentId.changeVersion(version);\n });\n\n return { bitIds: compact(componentIds.flat()).map((bitId) => bitId._legacy), warnings };\n }\n\n if (snapped) {\n return { bitIds: snappedComponentsIds, warnings };\n }\n\n tagPendingBitIds.push(...snappedComponentsIds);\n\n if (includeUnmodified && exactVersion) {\n const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(tagPendingBitIds, false);\n tagPendingComponentsLatest.forEach((componentId) => {\n if (componentId.version && semver.valid(componentId.version) && semver.gt(componentId.version, exactVersion)) {\n warnings.push(`warning: ${componentId.toString()} has a version greater than ${exactVersion}`);\n }\n });\n }\n\n return { bitIds: tagPendingBitIds.map((id) => id.changeVersion(undefined)), warnings };\n }\n\n static slots = [];\n static dependencies = [WorkspaceAspect, CLIAspect, CommunityAspect, LoggerAspect, IssuesAspect, InsightsAspect];\n static runtime = MainRuntime;\n static async provider([workspace, cli, community, loggerMain, issues, insights]: [\n Workspace,\n CLIMain,\n CommunityMain,\n LoggerMain,\n IssuesMain,\n InsightsMain\n ]) {\n const logger = loggerMain.createLogger(SnappingAspect.id);\n const snapping = new SnappingMain(workspace, logger, issues, insights);\n const snapCmd = new SnapCmd(community.getBaseDomain(), snapping, logger);\n const tagCmd = new TagCmd(snapping, logger);\n const resetCmd = new ResetCmd(snapping);\n cli.register(tagCmd, snapCmd, resetCmd);\n return snapping;\n }\n}\n\nSnappingAspect.addRuntime(SnappingMain);\n\nexport default SnappingMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EA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y"}
|
|
1
|
+
{"version":3,"names":["HooksManagerInstance","HooksManager","getInstance","SnappingMain","constructor","workspace","logger","issues","insights","tag","ids","message","version","editor","snapped","unmerged","releaseType","preReleaseId","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","build","unmodified","soft","persist","forceDeploy","incrementBy","disableTagAndSnapPipelines","isFeatureEnabled","BUILD_ON_CI","Boolean","BitError","exactVersion","ConsumerNotFound","idsHasWildcard","hasWildcard","isAll","length","validExactVersion","validateVersion","consumer","componentsList","ComponentsList","loader","start","newComponents","listNewComponents","bitIds","warnings","getComponentsToTag","R","isEmpty","legacyBitIds","BitIds","fromArray","debug","toString","Analytics","addBreadCrumb","hashData","componentFsCache","deleteAllDependenciesDataCache","components","loadComponentsForTag","throwForLegacyDependenciesInsideHarmony","throwForComponentIssues","areComponentsMissingFromScope","some","c","componentFromModel","id","hasScope","ComponentsPendingImport","taggedComponents","autoTaggedResults","publishedPackages","tagModelComponent","consumerComponents","scope","legacyScope","packageManagerConfigRootDir","path","tagResults","isSoftTag","postHook","POST_TAG_ALL_HOOK","POST_TAG_HOOK","triggerHook","setExtraData","concat","onDestroy","snap","pattern","skipAutoSnap","Error","getIdsToSnap","isSnap","snapResults","snappedComponents","autoSnappedResults","currentLane","getCurrentLaneId","laneName","isDefault","name","listDuringMergeStateComponents","tagPendingComponents","listPotentialTagAllWorkspace","listTagPendingComponents","tagPendingComponentsIds","resolveMultipleComponentIds","shouldThrowForNoMatching","getCompIds","includes","compId","resolveComponentId","filterIdsFromPoolIdsByPattern","componentIds","allTagPending","map","_legacy","reset","componentPattern","head","force","getCurrentLaneObject","untag","removeLocalVersionsForAllComponents","candidateComponents","getComponentsWithOptionToUntag","idsMatchingPattern","idsByPattern","idsMatchingPatternBitIds","componentsToUntag","filter","modelComponent","hasWithoutVersion","toBitId","removeLocalVersionsForMultipleComponents","softUntag","softTaggedComponents","listSoftTaggedComponents","softTaggedComponentsIds","idsToRemoveSoftTags","compact","componentId","componentMap","bitMap","getComponent","ignoreScopeAndVersion","removedVersion","nextVersion","clearNextVersion","versions","results","isRealUntag","objects","result","component","updateComponentsVersions","markAsChanged","isSoftUntag","loadComponents","toVersionLatest","forEach","rootDir","legacyComponents","issuesToIgnoreFromFlag","split","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","getManyByLegacy","IssuesClasses","CircularDependencies","addInsightsAsComponentIssues","removeIgnoredIssuesFromComponents","componentsWithBlockingIssues","shouldBlockTagging","ComponentsHaveIssues","throwForComponent","dependenciesIds","getAllDependenciesIds","Promise","all","depId","hasVersion","modelComp","getModelComponentIfExist","loadVersion","isLegacy","pMap","concurrency","concurrentComponentsLimit","includeUnmodified","tagPendingBitIds","listSnappedComponentsOnMain","snappedComponentsIds","pMapSeries","idWithoutVer","idHasWildcard","allIds","changeVersion","componentStatus","getComponentStatusById","modified","flat","bitId","push","tagPendingComponentsLatest","latestVersions","semver","valid","gt","undefined","provider","cli","community","loggerMain","createLogger","SnappingAspect","snapping","snapCmd","SnapCmd","getBaseDomain","tagCmd","TagCmd","resetCmd","ResetCmd","register","WorkspaceAspect","CLIAspect","CommunityAspect","LoggerAspect","IssuesAspect","InsightsAspect","MainRuntime","addRuntime"],"sources":["snapping.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport CommunityAspect, { CommunityMain } from '@teambit/community';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport semver, { ReleaseType } from 'semver';\nimport { compact } from 'lodash';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { POST_TAG_ALL_HOOK, POST_TAG_HOOK } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport HooksManager from '@teambit/legacy/dist/hooks';\nimport pMapSeries from 'p-map-series';\nimport { TagResults, BasicTagParams } from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { validateVersion } from '@teambit/legacy/dist/utils/semver-helper';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport tagModelComponent from '@teambit/legacy/dist/scope/component-ops/tag-model-component';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport ComponentsPendingImport from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-import';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport pMap from 'p-map';\nimport { InsightsAspect, InsightsMain } from '@teambit/insights';\nimport { concurrentComponentsLimit } from '@teambit/legacy/dist/utils/concurrency';\nimport {\n removeLocalVersionsForAllComponents,\n untagResult,\n getComponentsWithOptionToUntag,\n removeLocalVersionsForMultipleComponents,\n} from '@teambit/legacy/dist/scope/component-ops/untag-component';\nimport { ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport { SnapCmd } from './snap-cmd';\nimport { SnappingAspect } from './snapping.aspect';\nimport { TagCmd } from './tag-cmd';\nimport { ComponentsHaveIssues } from './components-have-issues';\nimport ResetCmd from './reset-cmd';\n\nconst HooksManagerInstance = HooksManager.getInstance();\n\nexport class SnappingMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private issues: IssuesMain,\n private insights: InsightsMain\n ) {}\n\n /**\n * tag the given component ids or all modified/new components if \"all\" param is set.\n * tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias\n * with a valid semver to that version.\n * tag can be done only on main, not on a lane.\n */\n // eslint-disable-next-line complexity\n async tag({\n ids = [],\n message = '',\n version,\n editor = '',\n snapped = false,\n unmerged = false,\n releaseType,\n preReleaseId,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n build,\n unmodified = false,\n soft = false,\n persist = false,\n forceDeploy = false,\n incrementBy = 1,\n disableTagAndSnapPipelines = false,\n }: {\n ids?: string[];\n all?: boolean | string;\n snapped?: boolean;\n unmerged?: boolean;\n version?: string;\n releaseType?: ReleaseType;\n ignoreIssues?: string;\n scope?: string | boolean;\n incrementBy?: number;\n } & Partial<BasicTagParams>): Promise<TagResults | null> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n if (soft) build = false;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-tag-pipeline, but not both');\n }\n if (editor && persist) {\n throw new BitError('you can use either --editor or --persist, but not both');\n }\n if (editor && message) {\n throw new BitError('you can use either --editor or --message, but not both');\n }\n\n const exactVersion = version;\n if (!this.workspace) throw new ConsumerNotFound();\n const idsHasWildcard = hasWildcard(ids);\n const isAll = Boolean(!ids.length || idsHasWildcard);\n const validExactVersion = validateVersion(exactVersion);\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n loader.start('determine components to tag...');\n const newComponents = await componentsList.listNewComponents();\n const { bitIds, warnings } = await this.getComponentsToTag(\n unmodified,\n exactVersion,\n persist,\n ids,\n snapped,\n unmerged\n );\n if (R.isEmpty(bitIds)) return null;\n\n const legacyBitIds = BitIds.fromArray(bitIds);\n\n this.logger.debug(`tagging the following components: ${legacyBitIds.toString()}`);\n Analytics.addBreadCrumb('tag', `tagging the following components: ${Analytics.hashData(legacyBitIds)}`);\n if (!soft) {\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n }\n const components = await this.loadComponentsForTag(legacyBitIds);\n await this.throwForLegacyDependenciesInsideHarmony(components);\n await this.throwForComponentIssues(components, ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults, publishedPackages } = await tagModelComponent({\n consumerComponents: components,\n ids: legacyBitIds,\n scope: this.workspace.scope.legacyScope,\n message,\n editor,\n exactVersion: validExactVersion,\n releaseType,\n preReleaseId,\n consumer: this.workspace.consumer,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n soft,\n build,\n persist,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n packageManagerConfigRootDir: this.workspace.path,\n });\n\n const tagResults = { taggedComponents, autoTaggedResults, isSoftTag: soft, publishedPackages };\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.warnings = warnings;\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.newComponents = newComponents;\n const postHook = isAll ? POST_TAG_ALL_HOOK : POST_TAG_HOOK;\n HooksManagerInstance?.triggerHook(postHook, tagResults);\n Analytics.setExtraData(\n 'num_components',\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n R.concat(tagResults.taggedComponents, tagResults.autoTaggedResults, tagResults.newComponents).length\n );\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return tagResults;\n }\n\n /**\n * save the local changes of a component(s) into the scope. snap can be done on main or on a lane.\n * once a component is snapped on a lane, it becomes part of it.\n */\n async snap({\n pattern,\n legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.\n unmerged,\n message = '',\n ignoreIssues,\n skipTests = false,\n skipAutoSnap = false,\n build,\n disableTagAndSnapPipelines = false,\n forceDeploy = false,\n unmodified = false,\n }: {\n pattern?: string;\n legacyBitIds?: BitIds;\n unmerged?: boolean;\n message?: string;\n ignoreIssues?: string;\n build: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableTagAndSnapPipelines?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n }): Promise<SnapResults | null> {\n if (!this.workspace) throw new ConsumerNotFound();\n if (pattern && legacyBitIds) throw new Error(`please pass either pattern or legacyBitIds, not both`);\n const consumer: Consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents()) as BitIds;\n const ids = legacyBitIds || (await getIdsToSnap(this.workspace));\n if (!ids) return null;\n this.logger.debug(`snapping the following components: ${ids.toString()}`);\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n const components = await this.loadComponentsForTag(ids);\n await this.throwForLegacyDependenciesInsideHarmony(components);\n await this.throwForComponentIssues(components, ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults } = await tagModelComponent({\n consumerComponents: components,\n ids,\n ignoreNewestVersion: false,\n scope: this.workspace.scope.legacyScope,\n message,\n consumer: this.workspace.consumer,\n skipTests,\n skipAutoTag: skipAutoSnap,\n persist: true,\n soft: false,\n build,\n isSnap: true,\n disableTagAndSnapPipelines,\n forceDeploy,\n packageManagerConfigRootDir: this.workspace.path,\n });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const snapResults: SnapResults = { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n\n snapResults.newComponents = newComponents;\n const currentLane = consumer.getCurrentLaneId();\n snapResults.laneName = currentLane.isDefault() ? null : currentLane.name;\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return snapResults;\n\n async function getIdsToSnap(workspace: Workspace): Promise<BitIds | null> {\n if (unmerged) {\n return componentsList.listDuringMergeStateComponents();\n }\n const tagPendingComponents = unmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n if (R.isEmpty(tagPendingComponents)) return null;\n const tagPendingComponentsIds = await workspace.resolveMultipleComponentIds(tagPendingComponents);\n // when unmodified, we ask for all components, throw if no matching. if not unmodified and no matching, see error\n // below, suggesting to use --unmodified flag.\n const shouldThrowForNoMatching = unmodified;\n const getCompIds = async () => {\n if (!pattern) return tagPendingComponentsIds;\n if (!pattern.includes('*') && !pattern.includes(',')) {\n const compId = await workspace.resolveComponentId(pattern);\n return [compId];\n }\n return workspace.scope.filterIdsFromPoolIdsByPattern(\n pattern,\n tagPendingComponentsIds,\n shouldThrowForNoMatching\n );\n };\n const componentIds = await getCompIds();\n if (!componentIds.length && pattern) {\n const allTagPending = await componentsList.listPotentialTagAllWorkspace();\n if (allTagPending.length) {\n throw new BitError(`unable to find matching for \"${pattern}\" pattern among modified/new components.\nthere are matching among unmodified components thought. consider using --unmodified flag if needed`);\n }\n }\n if (!componentIds.length) {\n return null;\n }\n return BitIds.fromArray(componentIds.map((c) => c._legacy));\n }\n }\n\n /**\n * remove tags/snaps that exist locally, which were not exported yet.\n * once a tag/snap is exported, it's impossible to delete it as other components may depend on it\n */\n async reset(\n componentPattern?: string,\n head?: boolean,\n force = false,\n soft = false\n ): Promise<{ results: untagResult[]; isSoftUntag: boolean }> {\n if (!this.workspace) throw new ConsumerNotFound();\n const consumer = this.workspace.consumer;\n const currentLane = await consumer.getCurrentLaneObject();\n const untag = async (): Promise<untagResult[]> => {\n if (!componentPattern) {\n return removeLocalVersionsForAllComponents(consumer, currentLane, head);\n }\n const candidateComponents = await getComponentsWithOptionToUntag(consumer);\n const idsMatchingPattern = await this.workspace.idsByPattern(componentPattern);\n const idsMatchingPatternBitIds = BitIds.fromArray(idsMatchingPattern.map((id) => id._legacy));\n const componentsToUntag = candidateComponents.filter((modelComponent) =>\n idsMatchingPatternBitIds.hasWithoutVersion(modelComponent.toBitId())\n );\n return removeLocalVersionsForMultipleComponents(componentsToUntag, currentLane, head, force, consumer.scope);\n };\n const softUntag = async () => {\n const componentsList = new ComponentsList(consumer);\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n const softTaggedComponentsIds = await this.workspace.resolveMultipleComponentIds(softTaggedComponents);\n const idsToRemoveSoftTags = componentPattern\n ? this.workspace.scope.filterIdsFromPoolIdsByPattern(componentPattern, softTaggedComponentsIds)\n : softTaggedComponentsIds;\n return compact(\n idsToRemoveSoftTags.map((componentId) => {\n const componentMap = consumer.bitMap.getComponent(componentId._legacy, { ignoreScopeAndVersion: true });\n const removedVersion = componentMap.nextVersion?.version;\n if (!removedVersion) return null;\n componentMap.clearNextVersion();\n return { id: componentId._legacy, versions: [removedVersion] };\n })\n );\n };\n let results: untagResult[];\n const isRealUntag = !soft;\n if (isRealUntag) {\n results = await untag();\n await consumer.scope.objects.persist();\n const components = results.map((result) => result.component);\n await consumer.updateComponentsVersions(components as ModelComponent[]);\n } else {\n results = await softUntag();\n consumer.bitMap.markAsChanged();\n }\n\n await consumer.onDestroy();\n return { results, isSoftUntag: !isRealUntag };\n }\n\n private async loadComponentsForTag(ids: BitIds): Promise<ConsumerComponent[]> {\n const { components } = await this.workspace.consumer.loadComponents(ids.toVersionLatest());\n components.forEach((component) => {\n const componentMap = component.componentMap as ComponentMap;\n if (!componentMap.rootDir) {\n throw new Error(`unable to tag ${component.id.toString()}, the \"rootDir\" is missing in the .bitmap file`);\n }\n });\n return components;\n }\n\n private async throwForComponentIssues(legacyComponents: ConsumerComponent[], ignoreIssues?: string) {\n if (ignoreIssues === '*') {\n // ignore all issues\n return;\n }\n const issuesToIgnoreFromFlag = ignoreIssues?.split(',').map((issue) => issue.trim()) || [];\n const issuesToIgnoreFromConfig = this.issues.getIssuesToIgnoreGlobally();\n const issuesToIgnore = [...issuesToIgnoreFromFlag, ...issuesToIgnoreFromConfig];\n const components = await this.workspace.getManyByLegacy(legacyComponents);\n if (!issuesToIgnore.includes(IssuesClasses.CircularDependencies.name)) {\n await this.insights.addInsightsAsComponentIssues(components);\n }\n this.issues.removeIgnoredIssuesFromComponents(components);\n\n const componentsWithBlockingIssues = legacyComponents.filter((component) => component.issues?.shouldBlockTagging());\n if (!R.isEmpty(componentsWithBlockingIssues)) {\n throw new ComponentsHaveIssues(componentsWithBlockingIssues);\n }\n }\n\n private async throwForLegacyDependenciesInsideHarmony(components: ConsumerComponent[]) {\n const throwForComponent = async (component: ConsumerComponent) => {\n const dependenciesIds = component.getAllDependenciesIds();\n const legacyScope = this.workspace.scope.legacyScope;\n await Promise.all(\n dependenciesIds.map(async (depId) => {\n if (!depId.hasVersion()) return;\n const modelComp = await legacyScope.getModelComponentIfExist(depId);\n if (!modelComp) return;\n const version = await modelComp.loadVersion(depId.version as string, legacyScope.objects);\n if (version.isLegacy) {\n throw new Error(\n `unable tagging \"${component.id.toString()}\", its dependency \"${depId.toString()}\" is legacy`\n );\n }\n })\n );\n };\n await pMap(components, (component) => throwForComponent(component), { concurrency: concurrentComponentsLimit() });\n }\n\n private async getComponentsToTag(\n includeUnmodified: boolean,\n exactVersion: string | undefined,\n persist: boolean,\n ids: string[],\n snapped: boolean,\n unmerged: boolean\n ): Promise<{ bitIds: BitId[]; warnings: string[] }> {\n const warnings: string[] = [];\n const componentsList = new ComponentsList(this.workspace.consumer);\n if (persist) {\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n return { bitIds: softTaggedComponents, warnings: [] };\n }\n\n const tagPendingBitIds = includeUnmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n\n const tagPendingComponentsIds = await this.workspace.resolveMultipleComponentIds(tagPendingBitIds);\n\n const snappedComponents = await componentsList.listSnappedComponentsOnMain();\n const snappedComponentsIds = snappedComponents.map((c) => c.toBitId());\n\n if (ids.length) {\n const componentIds = await pMapSeries(ids, async (id) => {\n const [idWithoutVer, version] = id.split('@');\n const idHasWildcard = hasWildcard(id);\n if (idHasWildcard) {\n const allIds = this.workspace.scope.filterIdsFromPoolIdsByPattern(idWithoutVer, tagPendingComponentsIds);\n return allIds.map((componentId) => componentId.changeVersion(version));\n }\n const componentId = await this.workspace.resolveComponentId(idWithoutVer);\n if (!includeUnmodified) {\n const componentStatus = await this.workspace.consumer.getComponentStatusById(componentId._legacy);\n if (componentStatus.modified === false) return null;\n }\n return componentId.changeVersion(version);\n });\n\n return { bitIds: compact(componentIds.flat()).map((bitId) => bitId._legacy), warnings };\n }\n\n if (snapped) {\n return { bitIds: snappedComponentsIds, warnings };\n }\n\n if (unmerged) {\n return { bitIds: componentsList.listDuringMergeStateComponents(), warnings };\n }\n\n tagPendingBitIds.push(...snappedComponentsIds);\n\n if (includeUnmodified && exactVersion) {\n const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(tagPendingBitIds, false);\n tagPendingComponentsLatest.forEach((componentId) => {\n if (componentId.version && semver.valid(componentId.version) && semver.gt(componentId.version, exactVersion)) {\n warnings.push(`warning: ${componentId.toString()} has a version greater than ${exactVersion}`);\n }\n });\n }\n\n return { bitIds: tagPendingBitIds.map((id) => id.changeVersion(undefined)), warnings };\n }\n\n static slots = [];\n static dependencies = [WorkspaceAspect, CLIAspect, CommunityAspect, LoggerAspect, IssuesAspect, InsightsAspect];\n static runtime = MainRuntime;\n static async provider([workspace, cli, community, loggerMain, issues, insights]: [\n Workspace,\n CLIMain,\n CommunityMain,\n LoggerMain,\n IssuesMain,\n InsightsMain\n ]) {\n const logger = loggerMain.createLogger(SnappingAspect.id);\n const snapping = new SnappingMain(workspace, logger, issues, insights);\n const snapCmd = new SnapCmd(community.getBaseDomain(), snapping, logger);\n const tagCmd = new TagCmd(snapping, logger);\n const resetCmd = new ResetCmd(snapping);\n cli.register(tagCmd, snapCmd, resetCmd);\n return snapping;\n }\n}\n\nSnappingAspect.addRuntime(SnappingMain);\n\nexport default SnappingMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;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B;IACA,MAAM8N,MAAM,GAAG,KAAIC,gBAAJ,EAAWL,QAAX,EAAqB1N,MAArB,CAAf;IACA,MAAMgO,QAAQ,GAAG,KAAIC,mBAAJ,EAAaP,QAAb,CAAjB;IACAL,GAAG,CAACa,QAAJ,CAAaJ,MAAb,EAAqBH,OAArB,EAA8BK,QAA9B;IACA,OAAON,QAAP;EACD;;AArbuB;;;gCAAb7N,Y,WAmaI,E;gCAnaJA,Y,kBAoaW,CAACsO,oBAAD,EAAkBC,gBAAlB,EAA6BC,oBAA7B,EAA8CC,sBAA9C,EAA4DC,iBAA5D,EAA0EC,0BAA1E,C;gCApaX3O,Y,aAqaM4O,kB;;AAmBnBhB,0BAAA,CAAeiB,UAAf,CAA0B7O,YAA1B;;eAEeA,Y"}
|
package/dist/tag-cmd.d.ts
CHANGED
|
@@ -25,9 +25,10 @@ export declare class TagCmd implements Command {
|
|
|
25
25
|
description: string;
|
|
26
26
|
}[];
|
|
27
27
|
constructor(snapping: SnappingMain, logger: Logger);
|
|
28
|
-
report([patterns]: [string[]], { message, ver, all, editor, snapped, patch, minor, major, preRelease, increment, prereleaseId, force, ignoreUnresolvedDependencies, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, scope, unmodified, build, soft, persist, disableDeployPipeline, disableTagPipeline, forceDeploy, incrementBy, }: {
|
|
28
|
+
report([patterns]: [string[]], { message, ver, all, editor, snapped, unmerged, patch, minor, major, preRelease, increment, prereleaseId, force, ignoreUnresolvedDependencies, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, scope, unmodified, build, soft, persist, disableDeployPipeline, disableTagPipeline, forceDeploy, incrementBy, }: {
|
|
29
29
|
all?: boolean | string;
|
|
30
30
|
snapped?: boolean;
|
|
31
|
+
unmerged?: boolean;
|
|
31
32
|
ver?: string;
|
|
32
33
|
force?: boolean;
|
|
33
34
|
patch?: boolean;
|
package/dist/tag-cmd.js
CHANGED
|
@@ -90,7 +90,7 @@ if patterns are entered, you can specify a version per pattern using "@" sign, e
|
|
|
90
90
|
(0, _defineProperty2().default)(this, "helpUrl", 'components/tags');
|
|
91
91
|
(0, _defineProperty2().default)(this, "alias", 't');
|
|
92
92
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
93
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'a log message describing latest changes'], ['', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'], ['', 'editor [editor]', 'EXPERIMENTAL. open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).'], ['v', 'ver <version>', 'tag with the given version'], ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`], ['', 'prerelease-id <id>', 'prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")'], ['p', 'patch', 'syntactic sugar for "--increment patch"'], ['', 'minor', 'syntactic sugar for "--increment minor"'], ['', 'major', 'syntactic sugar for "--increment major"'], ['', 'pre-release [identifier]', 'syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`'], ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist', 'persist the changes generated by --soft tag'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'run the tag pipeline although the build failed'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
93
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'a log message describing latest changes'], ['', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'], ['', 'editor [editor]', 'EXPERIMENTAL. open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).'], ['v', 'ver <version>', 'tag with the given version'], ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`], ['', 'prerelease-id <id>', 'prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")'], ['p', 'patch', 'syntactic sugar for "--increment patch"'], ['', 'minor', 'syntactic sugar for "--increment minor"'], ['', 'major', 'syntactic sugar for "--increment major"'], ['', 'pre-release [identifier]', 'syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`'], ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'], ['', 'unmerged', 'EXPERIMENTAL. complete a merge process by tagging the unmerged components'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist', 'persist the changes generated by --soft tag'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'run the tag pipeline although the build failed'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
94
94
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
95
95
|
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`], ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'], ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'], ['a', 'all [version]', 'DEPRECATED (not needed anymore, it is the default now). tag all new and modified components'], ['s', 'scope [version]', 'DEPRECATED (use "--unmodified" instead). tag all components of the current scope'], ['f', 'force', 'DEPRECATED (use "--skip-tests" or "--unmodified" instead). force-tag even if tests are failing and even when component has not changed'], ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead']]);
|
|
96
96
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
@@ -108,6 +108,7 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
|
|
|
108
108
|
all = false,
|
|
109
109
|
editor = '',
|
|
110
110
|
snapped = false,
|
|
111
|
+
unmerged = false,
|
|
111
112
|
patch,
|
|
112
113
|
minor,
|
|
113
114
|
major,
|
|
@@ -207,6 +208,7 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
|
|
|
207
208
|
const params = {
|
|
208
209
|
ids: patterns,
|
|
209
210
|
snapped,
|
|
211
|
+
unmerged,
|
|
210
212
|
editor,
|
|
211
213
|
message,
|
|
212
214
|
releaseType: getReleaseType(),
|
package/dist/tag-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RELEASE_TYPES","TagCmd","constructor","snapping","logger","name","description","join","Object","keys","IssuesClasses","cmd","report","patterns","message","ver","all","editor","snapped","patch","minor","major","preRelease","increment","prereleaseId","force","ignoreUnresolvedDependencies","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","unmodified","build","soft","persist","disableDeployPipeline","disableTagPipeline","forceDeploy","incrementBy","BitError","consoleWarning","length","releaseFlags","filter","x","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","disableTagAndSnapPipelines","params","ids","releaseType","preReleaseId","version","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_TAGGED_MSG","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","softTagPrefix","outputIfExists","label","explanation","components","underline","newDesc","changedDesc","softTagClarification","bold"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n TagResults,\n NOTHING_TO_TAG_MSG,\n AUTO_TAGGED_MSG,\n BasicTagParams,\n} from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport { DEFAULT_BIT_RELEASE_TYPE } from '@teambit/legacy/dist/constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'development';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'a list of component names, IDs or patterns (separated by space). run \"bit pattern --help\" to get more data about patterns. By default, all modified are tagged.',\n },\n ];\n helpUrl = 'components/tags';\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'a log message describing latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'],\n [\n '',\n 'editor [editor]',\n 'EXPERIMENTAL. open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\n ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n ['', 'persist', 'persist the changes generated by --soft tag'],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'force-deploy', 'run the tag pipeline although the build failed'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\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 ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'],\n ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'],\n [\n 'a',\n 'all [version]',\n 'DEPRECATED (not needed anymore, it is the default now). tag all new and modified components',\n ],\n ['s', 'scope [version]', 'DEPRECATED (use \"--unmodified\" instead). tag all components of the current scope'],\n [\n 'f',\n 'force',\n 'DEPRECATED (use \"--skip-tests\" or \"--unmodified\" instead). force-tag even if tests are failing and even when component has not changed',\n ],\n ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'],\n ] as CommandOptions;\n migration = true;\n remoteOp = true; // In case a compiler / tester is not installed\n examples = [{ cmd: 'tag --ver 1.0.0', description: 'tag all components to version 1.0.0' }];\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n // eslint-disable-next-line complexity\n async report(\n [patterns = []]: [string[]],\n {\n message = '',\n ver,\n all = false,\n editor = '',\n snapped = false,\n patch,\n minor,\n major,\n preRelease,\n increment,\n prereleaseId,\n force = false,\n ignoreUnresolvedDependencies,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n scope,\n unmodified = false,\n build,\n soft = false,\n persist = false,\n disableDeployPipeline = false,\n disableTagPipeline = false,\n forceDeploy = false,\n incrementBy = 1,\n }: {\n all?: boolean | string;\n snapped?: boolean;\n ver?: string;\n force?: boolean;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n scope?: string | boolean;\n incrementBy?: number;\n disableDeployPipeline?: boolean;\n disableTagPipeline?: boolean;\n } & Partial<BasicTagParams>\n ): Promise<string> {\n if (typeof ignoreUnresolvedDependencies === 'boolean') {\n throw new BitError(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);\n }\n if (ignoreIssues && typeof ignoreIssues === 'boolean') {\n throw new BitError(`--ignore-issues expects issues to be ignored, please run \"bit tag -h\" for the issues list`);\n }\n if (disableDeployPipeline) {\n this.logger.consoleWarning(`--disable-deploy-pipeline is deprecated, please use --disable-tag-pipeline instead`);\n }\n if (!message && !persist) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your tag`\n );\n }\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit tag\" by default will tag all new and modified components. to specify a version, use --ver flag`\n );\n if (typeof all === 'string') {\n ver = all;\n }\n }\n if (scope) {\n this.logger.consoleWarning(`--scope is deprecated, use --unmodified instead`);\n unmodified = true;\n if (typeof scope === 'string') {\n ver = scope;\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 (patterns.length) unmodified = true;\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\n semver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return increment;\n }\n if (major) return 'major';\n if (minor) return 'minor';\n if (patch) return 'patch';\n if (preRelease) return 'prerelease';\n return DEFAULT_BIT_RELEASE_TYPE;\n };\n const getPreReleaseId = (): string | undefined => {\n if (prereleaseId) {\n return prereleaseId;\n }\n if (preRelease && typeof preRelease === 'string') {\n return preRelease;\n }\n return undefined;\n };\n\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n\n const params = {\n ids: patterns,\n snapped,\n editor,\n message,\n releaseType: getReleaseType(),\n preReleaseId: getPreReleaseId(),\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n build,\n soft,\n persist,\n unmodified,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n version: ver,\n };\n\n const results = await this.snapping.tag(params);\n if (!results) return chalk.yellow(NOTHING_TO_TAG_MSG);\n const { taggedComponents, autoTaggedResults, warnings, newComponents }: TagResults = results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = `\\n(use \"bit export [collection]\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the changes\")\n(use \"bit reset --soft\" to remove the soft-tags)\\n`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoTaggedResults.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_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged first version for components'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that set to get a version bump'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n 'keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n warningsOutput +\n chalk.green(\n `${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`\n ) +\n tagExplanation +\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n publishOutput() +\n softTagClarification\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA,MAAMA,aAAa,GAAG,CAAC,OAAD,EAAU,UAAV,EAAsB,OAAtB,EAA+B,UAA/B,EAA2C,OAA3C,EAAoD,UAApD,EAAgE,YAAhE,CAAtB;;AAEO,MAAMC,MAAN,CAAgC;EAkEpB;EAGjBC,WAAW,CAASC,QAAT,EAAyCC,MAAzC,EAAyD;IAAA,KAAhDD,QAAgD,GA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,CACE,iHADF,CADyB,GAIzB,EAJJ;IAKA,OACEhC,cAAc,GACdb,gBAAA,CAAMiC,KAAN,CACG,GAAE9B,gBAAgB,CAACpB,MAAjB,GAA0B6B,eAAgB,iBAAgBd,OAAO,CAACmB,SAAR,GAAoB,OAApB,GAA8B,EAAG,QADhG,CADA,GAIAD,cAJA,GAKAqB,cAAc,CAAC,gBAAD,EAAmBK,OAAnB,EAA4B/B,eAA5B,CALd,GAMA0B,cAAc,CAAC,oBAAD,EAAuBM,WAAvB,EAAoCpC,iBAApC,CANd,GAOAuB,aAAa,EAPb,GAQAc,oBATF;EAWD;;AAvRoC"}
|
|
1
|
+
{"version":3,"names":["RELEASE_TYPES","TagCmd","constructor","snapping","logger","name","description","join","Object","keys","IssuesClasses","cmd","report","patterns","message","ver","all","editor","snapped","unmerged","patch","minor","major","preRelease","increment","prereleaseId","force","ignoreUnresolvedDependencies","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","unmodified","build","soft","persist","disableDeployPipeline","disableTagPipeline","forceDeploy","incrementBy","BitError","consoleWarning","length","releaseFlags","filter","x","getReleaseType","includes","DEFAULT_BIT_RELEASE_TYPE","getPreReleaseId","undefined","disableTagAndSnapPipelines","params","ids","releaseType","preReleaseId","version","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_TAGGED_MSG","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","softTagPrefix","outputIfExists","label","explanation","components","underline","newDesc","changedDesc","softTagClarification","bold"],"sources":["tag-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n TagResults,\n NOTHING_TO_TAG_MSG,\n AUTO_TAGGED_MSG,\n BasicTagParams,\n} from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport { DEFAULT_BIT_RELEASE_TYPE } from '@teambit/legacy/dist/constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { ReleaseType } from 'semver';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\n\nconst RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];\n\nexport class TagCmd implements Command {\n name = 'tag [component-patterns...]';\n group = 'development';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n extendedDescription = `if no patterns are provided, it will tag all new and modified components.\nif patterns are entered, you can specify a version per pattern using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major`;\n arguments = [\n {\n name: 'component-patterns...',\n description:\n 'a list of component names, IDs or patterns (separated by space). run \"bit pattern --help\" to get more data about patterns. By default, all modified are tagged.',\n },\n ];\n helpUrl = 'components/tags';\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'a log message describing latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'],\n [\n '',\n 'editor [editor]',\n 'EXPERIMENTAL. open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\n ['v', 'ver <version>', 'tag with the given version'],\n ['l', 'increment <level>', `options are: [${RELEASE_TYPES.join(', ')}], default to patch`],\n ['', 'prerelease-id <id>', 'prerelease identifier (e.g. \"dev\" to get \"1.0.0-dev.1\")'],\n ['p', 'patch', 'syntactic sugar for \"--increment patch\"'],\n ['', 'minor', 'syntactic sugar for \"--increment minor\"'],\n ['', 'major', 'syntactic sugar for \"--increment major\"'],\n ['', 'pre-release [identifier]', 'syntactic sugar for \"--increment prerelease\" and `--prerelease-id <identifier>`'],\n ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'],\n ['', 'unmerged', 'EXPERIMENTAL. complete a merge process by tagging the unmerged components'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n ['', 'persist', 'persist the changes generated by --soft tag'],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'force-deploy', 'run the tag pipeline although the build failed'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\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 ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'],\n ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'],\n [\n 'a',\n 'all [version]',\n 'DEPRECATED (not needed anymore, it is the default now). tag all new and modified components',\n ],\n ['s', 'scope [version]', 'DEPRECATED (use \"--unmodified\" instead). tag all components of the current scope'],\n [\n 'f',\n 'force',\n 'DEPRECATED (use \"--skip-tests\" or \"--unmodified\" instead). force-tag even if tests are failing and even when component has not changed',\n ],\n ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'],\n ] as CommandOptions;\n migration = true;\n remoteOp = true; // In case a compiler / tester is not installed\n examples = [{ cmd: 'tag --ver 1.0.0', description: 'tag all components to version 1.0.0' }];\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n // eslint-disable-next-line complexity\n async report(\n [patterns = []]: [string[]],\n {\n message = '',\n ver,\n all = false,\n editor = '',\n snapped = false,\n unmerged = false,\n patch,\n minor,\n major,\n preRelease,\n increment,\n prereleaseId,\n force = false,\n ignoreUnresolvedDependencies,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n scope,\n unmodified = false,\n build,\n soft = false,\n persist = false,\n disableDeployPipeline = false,\n disableTagPipeline = false,\n forceDeploy = false,\n incrementBy = 1,\n }: {\n all?: boolean | string;\n snapped?: boolean;\n unmerged?: boolean;\n ver?: string;\n force?: boolean;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n increment?: ReleaseType;\n preRelease?: string;\n prereleaseId?: string;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n scope?: string | boolean;\n incrementBy?: number;\n disableDeployPipeline?: boolean;\n disableTagPipeline?: boolean;\n } & Partial<BasicTagParams>\n ): Promise<string> {\n if (typeof ignoreUnresolvedDependencies === 'boolean') {\n throw new BitError(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);\n }\n if (ignoreIssues && typeof ignoreIssues === 'boolean') {\n throw new BitError(`--ignore-issues expects issues to be ignored, please run \"bit tag -h\" for the issues list`);\n }\n if (disableDeployPipeline) {\n this.logger.consoleWarning(`--disable-deploy-pipeline is deprecated, please use --disable-tag-pipeline instead`);\n }\n if (!message && !persist) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your tag`\n );\n }\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit tag\" by default will tag all new and modified components. to specify a version, use --ver flag`\n );\n if (typeof all === 'string') {\n ver = all;\n }\n }\n if (scope) {\n this.logger.consoleWarning(`--scope is deprecated, use --unmodified instead`);\n unmodified = true;\n if (typeof scope === 'string') {\n ver = scope;\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 (patterns.length) unmodified = true;\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new BitError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n const getReleaseType = (): ReleaseType => {\n if (increment) {\n if (!RELEASE_TYPES.includes(increment)) {\n throw new BitError(`invalid increment-level \"${increment}\".\n semver allows the following options only: ${RELEASE_TYPES.join(', ')}`);\n }\n return increment;\n }\n if (major) return 'major';\n if (minor) return 'minor';\n if (patch) return 'patch';\n if (preRelease) return 'prerelease';\n return DEFAULT_BIT_RELEASE_TYPE;\n };\n const getPreReleaseId = (): string | undefined => {\n if (prereleaseId) {\n return prereleaseId;\n }\n if (preRelease && typeof preRelease === 'string') {\n return preRelease;\n }\n return undefined;\n };\n\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n\n const params = {\n ids: patterns,\n snapped,\n unmerged,\n editor,\n message,\n releaseType: getReleaseType(),\n preReleaseId: getPreReleaseId(),\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n build,\n soft,\n persist,\n unmodified,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n version: ver,\n };\n\n const results = await this.snapping.tag(params);\n if (!results) return chalk.yellow(NOTHING_TO_TAG_MSG);\n const { taggedComponents, autoTaggedResults, warnings, newComponents }: TagResults = results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = `\\n(use \"bit export [collection]\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the changes\")\n(use \"bit reset --soft\" to remove the soft-tags)\\n`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoTaggedResults.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_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged first version for components'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that set to get a version bump'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n 'keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n warningsOutput +\n chalk.green(\n `${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`\n ) +\n tagExplanation +\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n publishOutput() +\n softTagClarification\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA,MAAMA,aAAa,GAAG,CAAC,OAAD,EAAU,UAAV,EAAsB,OAAtB,EAA+B,UAA/B,EAA2C,OAA3C,EAAoD,UAApD,EAAgE,YAAhE,CAAt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,GAAG5C,OAAO,CAACmB,SAAR,GACZ,+CADY,GAEZ,8BAFJ;IAGA,MAAM0B,WAAW,GAAG7C,OAAO,CAACmB,SAAR,GAChB,2CADgB,GAEhB,oCAFJ;IAGA,MAAM2B,oBAAoB,GAAG9C,OAAO,CAACmB,SAAR,GACzBjB,gBAAA,CAAM6C,IAAN,CACE,iHADF,CADyB,GAIzB,EAJJ;IAKA,OACEhC,cAAc,GACdb,gBAAA,CAAMiC,KAAN,CACG,GAAE9B,gBAAgB,CAACpB,MAAjB,GAA0B6B,eAAgB,iBAAgBd,OAAO,CAACmB,SAAR,GAAoB,OAApB,GAA8B,EAAG,QADhG,CADA,GAIAD,cAJA,GAKAqB,cAAc,CAAC,gBAAD,EAAmBK,OAAnB,EAA4B/B,eAA5B,CALd,GAMA0B,cAAc,CAAC,oBAAD,EAAuBM,WAAvB,EAAoCpC,iBAApC,CANd,GAOAuB,aAAa,EAPb,GAQAc,oBATF;EAWD;;AA3RoC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/snapping",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/snapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "snapping",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.117"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@teambit/harmony": "0.3.3",
|
|
21
21
|
"@teambit/bit-error": "0.0.394",
|
|
22
|
-
"@teambit/issues": "0.0.
|
|
23
|
-
"@teambit/cli": "0.0.
|
|
22
|
+
"@teambit/issues": "0.0.110",
|
|
23
|
+
"@teambit/cli": "0.0.534",
|
|
24
24
|
"@teambit/component-issues": "0.0.60",
|
|
25
|
-
"@teambit/logger": "0.0.
|
|
26
|
-
"@teambit/community": "0.0.
|
|
27
|
-
"@teambit/insights": "0.0.
|
|
28
|
-
"@teambit/workspace": "0.0.
|
|
25
|
+
"@teambit/logger": "0.0.627",
|
|
26
|
+
"@teambit/community": "0.0.82",
|
|
27
|
+
"@teambit/insights": "0.0.802",
|
|
28
|
+
"@teambit/workspace": "0.0.802"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/lodash": "4.14.165",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"@types/react-dom": "^17.0.5",
|
|
39
39
|
"@types/react": "^17.0.8",
|
|
40
40
|
"@types/node": "12.20.4",
|
|
41
|
-
"@teambit/compiler": "0.0.
|
|
41
|
+
"@teambit/compiler": "0.0.802",
|
|
42
42
|
"@teambit/component.testing.mock-components": "0.0.8",
|
|
43
43
|
"@teambit/harmony.testing.load-aspect": "0.0.8",
|
|
44
44
|
"@teambit/workspace.testing.mock-workspace": "0.0.6"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@teambit/legacy": "1.0.
|
|
47
|
+
"@teambit/legacy": "1.0.316",
|
|
48
48
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
49
49
|
"react": "^16.8.0 || ^17.0.0"
|
|
50
50
|
},
|
|
File without changes
|
|
Binary file
|