@teambit/snapping 0.0.73 → 0.0.76
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 +4 -0
- package/dist/snap-cmd.js +7 -3
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +3 -4
- package/dist/snapping.main.runtime.js +3 -15
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.d.ts +9 -1
- package/dist/tag-cmd.js +39 -9
- package/dist/tag-cmd.js.map +1 -1
- package/package-tar/teambit-snapping-0.0.76.tgz +0 -0
- package/package.json +11 -11
- /package/{preview-1654918011878.js → preview-1655263660719.js} +0 -0
- package/package-tar/teambit-snapping-0.0.73.tgz +0 -0
package/dist/snap-cmd.d.ts
CHANGED
package/dist/snap-cmd.js
CHANGED
|
@@ -75,11 +75,15 @@ class SnapCmd {
|
|
|
75
75
|
constructor(docsDomain, snapping, logger) {
|
|
76
76
|
this.snapping = snapping;
|
|
77
77
|
this.logger = logger;
|
|
78
|
-
(0, _defineProperty2().default)(this, "name", 'snap [
|
|
79
|
-
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL.
|
|
78
|
+
(0, _defineProperty2().default)(this, "name", 'snap [component-name]');
|
|
79
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. create an immutable and exportable component snapshot (no release version)');
|
|
80
80
|
(0, _defineProperty2().default)(this, "extendedDescription", void 0);
|
|
81
|
+
(0, _defineProperty2().default)(this, "arguments", [{
|
|
82
|
+
name: 'component_name',
|
|
83
|
+
description: 'component names or component ID (defaults to all components)'
|
|
84
|
+
}]);
|
|
81
85
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
82
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the
|
|
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:
|
|
83
87
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
84
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']]);
|
|
85
89
|
(0, _defineProperty2().default)(this, "loader", true);
|
package/dist/snap-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SnapCmd","constructor","docsDomain","snapping","logger","Object","keys","IssuesClasses","join","extendedDescription","WILDCARD_HELP","report","id","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","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 { WILDCARD_HELP, NOTHING_TO_SNAP_MSG, AUTO_SNAPPED_MSG } 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 [id]';\n description = 'EXPERIMENTAL. record component changes';\n extendedDescription: string;\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the user 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 [id]: 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 (id) 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 id,\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 untag\" 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.join(', ')}`;\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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,OAAN,CAAiC;EA+BtCC,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAA6DC,MAA7D,EAA6E;IAAA,KAAhDD,QAAgD,GAAhDA,QAAgD;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,8CA9BjF,WA8BiF;IAAA,qDA7B1E,wCA6B0E;IAAA;IAAA,+CA3BhF,EA2BgF;IAAA,iDA1B9E,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,EAAD,EAAK,YAAL,EAAmB,0FAAnB,CAFQ,EAGR,CAAC,EAAD,EAAK,OAAL,EAAc,2DAAd,CAHQ,EAIR,CAAC,EAAD,EAAK,YAAL,EAAmB,kDAAnB,CAJQ,EAKR,CAAC,EAAD,EAAK,gBAAL,EAAuB,+BAAvB,CALQ,EAMR,CAAC,EAAD,EAAK,uBAAL,EAA8B,wBAA9B,CANQ,EAOR,CAAC,EAAD,EAAK,cAAL,EAAqB,iEAArB,CAPQ,EAQR,CACE,GADF,EAEE,wBAFF,EAGG;AACP,GAAGC,MAAM,CAACC,IAAP,CAAYC,gCAAZ,EAA2BC,I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,OAAO,CAACH,GAAR,CAAaQ,CAAD,IAAOA,CAAC,CAACjB,SAAF,CAAY7B,EAAZ,CAAewC,QAAf,EAAnB,CAApB;UACAD,eAAe,IAAK,YAAWQ,6BAAiB,KAAIF,WAAW,CAACjD,IAAZ,CAAiB,IAAjB,CAAuB,EAA3E;QACD;;QACD,OAAO2C,eAAP;MACD,CAXI,EAYJ3C,IAZI,CAYC,IAZD,CAAP;IAaD,CAdD;;IAgBA,MAAMoD,cAAc,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,UAArB,KAAoC;MACzD,IAAI,CAACA,UAAU,CAAClB,MAAhB,EAAwB,OAAO,EAAP;MACxB,OAAQ,KAAId,gBAAA,CAAMiC,SAAN,CAAgBH,KAAhB,CAAuB,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAD,CAAa,IAAtF;IACD,CAHD;;IAIA,MAAME,OAAO,GAAG3B,QAAQ,GAAI,QAAOA,QAAS,QAApB,GAA8B,EAAtD;IAEA,OACEQ,cAAc,GACdf,gBAAA,CAAMmC,KAAN,CAAa,GAAEhC,iBAAiB,CAACW,MAAlB,GAA2BD,eAAgB,wBAAuBqB,OAAQ,EAAzF,CADA,GAEAlB,cAFA,GAGAa,cAAc,CAAC,gBAAD,EAAmB,8BAAnB,EAAmDjB,eAAnD,CAHd,GAIAiB,cAAc,CAAC,oBAAD,EAAuB,oCAAvB,EAA6DrB,iBAA7D,CALhB;EAOD;;AA1IqC"}
|
|
1
|
+
{"version":3,"names":["SnapCmd","constructor","docsDomain","snapping","logger","name","description","Object","keys","IssuesClasses","join","extendedDescription","WILDCARD_HELP","report","id","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","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 { WILDCARD_HELP, NOTHING_TO_SNAP_MSG, AUTO_SNAPPED_MSG } 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-name]';\n description = 'EXPERIMENTAL. create an immutable and exportable component snapshot (no release version)';\n extendedDescription: string;\n arguments = [\n {\n name: 'component_name',\n description: 'component names or component ID (defaults to all components)',\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 [id]: 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 (id) 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 id,\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 untag\" 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.join(', ')}`;\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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,OAAN,CAAiC;EAqCtCC,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAA6DC,MAA7D,EAA6E;IAAA,KAAhDD,QAAgD,GAAhDA,QAAgD;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,8CApCjF,uBAoCiF;IAAA,qDAnC1E,0FAmC0E;IAAA;IAAA,mDAjC5E,CACV;MACEC,IAAI,EAAE,gBADR;MAEEC,WAAW,EAAE;IAF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OAAQ,EAAzF,CADA,GAEAlB,cAFA,GAGAa,cAAc,CAAC,gBAAD,EAAmB,8BAAnB,EAAmDjB,eAAnD,CAHd,GAIAiB,cAAc,CAAC,oBAAD,EAAuB,oCAAvB,EAA6DrB,iBAA7D,CALhB;EAOD;;AAhJqC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { CommunityMain } from '@teambit/community';
|
|
3
3
|
import { Workspace } from '@teambit/workspace';
|
|
4
|
+
import { ReleaseType } from 'semver';
|
|
4
5
|
import { BitIds } from '@teambit/legacy/dist/bit-id';
|
|
5
6
|
import { TagResults, BasicTagParams } from '@teambit/legacy/dist/api/consumer/lib/tag';
|
|
6
7
|
import { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';
|
|
@@ -19,14 +20,12 @@ export declare class SnappingMain {
|
|
|
19
20
|
* with a valid semver to that version.
|
|
20
21
|
* tag can be done only on main, not on a lane.
|
|
21
22
|
*/
|
|
22
|
-
tag({ ids, message, version, editor, snapped,
|
|
23
|
+
tag({ ids, message, version, editor, snapped, releaseType, preReleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, build, unmodified, soft, persist, forceDeploy, incrementBy, disableTagAndSnapPipelines, }: {
|
|
23
24
|
ids?: string[];
|
|
24
25
|
all?: boolean | string;
|
|
25
26
|
snapped?: boolean;
|
|
26
27
|
version?: string;
|
|
27
|
-
|
|
28
|
-
minor?: boolean;
|
|
29
|
-
major?: boolean;
|
|
28
|
+
releaseType?: ReleaseType;
|
|
30
29
|
ignoreIssues?: string;
|
|
31
30
|
scope?: string | boolean;
|
|
32
31
|
incrementBy?: number;
|
|
@@ -365,10 +365,8 @@ class SnappingMain {
|
|
|
365
365
|
version,
|
|
366
366
|
editor = '',
|
|
367
367
|
snapped = false,
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
major,
|
|
371
|
-
preRelease,
|
|
368
|
+
releaseType,
|
|
369
|
+
preReleaseId,
|
|
372
370
|
ignoreIssues,
|
|
373
371
|
ignoreNewestVersion = false,
|
|
374
372
|
skipTests = false,
|
|
@@ -396,17 +394,7 @@ class SnappingMain {
|
|
|
396
394
|
throw new (_bitError().BitError)('you can use either --editor or --message, but not both');
|
|
397
395
|
}
|
|
398
396
|
|
|
399
|
-
const releaseFlags = [patch, minor, major, preRelease].filter(x => x);
|
|
400
|
-
|
|
401
|
-
if (releaseFlags.length > 1) {
|
|
402
|
-
throw new (_bitError().BitError)('you can use only one of the following - patch, minor, major, pre-release');
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
let releaseType = _constants().DEFAULT_BIT_RELEASE_TYPE;
|
|
406
|
-
|
|
407
|
-
if (major) releaseType = 'major';else if (minor) releaseType = 'minor';else if (patch) releaseType = 'patch';else if (preRelease) releaseType = 'prerelease';
|
|
408
397
|
const exactVersion = version;
|
|
409
|
-
preRelease = typeof preRelease === 'string' ? preRelease : '';
|
|
410
398
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
411
399
|
const idsHasWildcard = (0, _hasWildcard().default)(ids);
|
|
412
400
|
const isAll = Boolean(!ids.length || idsHasWildcard);
|
|
@@ -458,7 +446,7 @@ class SnappingMain {
|
|
|
458
446
|
editor,
|
|
459
447
|
exactVersion: validExactVersion,
|
|
460
448
|
releaseType,
|
|
461
|
-
|
|
449
|
+
preReleaseId,
|
|
462
450
|
consumer: this.workspace.consumer,
|
|
463
451
|
ignoreNewestVersion,
|
|
464
452
|
skipTests,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HooksManagerInstance","HooksManager","getInstance","SnappingMain","constructor","workspace","logger","issues","insights","tag","ids","message","version","editor","snapped","patch","minor","major","preRelease","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","build","unmodified","soft","persist","forceDeploy","incrementBy","disableTagAndSnapPipelines","isFeatureEnabled","BUILD_ON_CI","Boolean","BitError","releaseFlags","filter","x","length","releaseType","DEFAULT_BIT_RELEASE_TYPE","exactVersion","ConsumerNotFound","idsHasWildcard","hasWildcard","isAll","validExactVersion","validateVersion","consumer","componentsList","ComponentsList","loader","start","newComponents","listNewComponents","bitIds","warnings","getComponentsToTag","R","isEmpty","legacyBitIds","BitIds","fromArray","isLegacy","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","skipAutoSnap","Error","LanesIsDisabled","getIdsToSnap","isSnap","snapResults","snappedComponents","autoSnappedResults","currentLane","getCurrentLaneId","laneName","isDefault","name","idHasWildcard","bitId","getParsedId","componentStatus","getComponentStatusById","modified","tagPendingComponents","listPotentialTagAllWorkspace","listTagPendingComponents","filterComponentsByWildcard","loadComponents","toVersionLatest","shouldReloadComponents","componentsWithRelativePaths","componentsWithFilesNotDir","componentsWithCustomModuleResolution","forEach","component","componentMap","rootDir","hasRelativePaths","getIssue","IssuesClasses","RelativeComponentsAuthored","hasCustomModuleResolutions","MissingCustomModuleResolutionLinks","trackDir","changeRootDirAndUpdateFilesAccordingly","push","toStringWithoutVersion","FailedLoadForTag","sort","clearCache","reloadedComponents","legacyComponents","delete","issuesToIgnoreFromFlag","split","map","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","getManyByLegacy","includes","CircularDependencies","addInsightsAsComponentIssues","removeIgnoredIssuesFromComponents","componentsWithBlockingIssues","shouldBlockTagging","ComponentsHaveIssues","throwForComponent","dependenciesIds","getAllDependenciesIds","Promise","all","depId","hasVersion","modelComp","getModelComponentIfExist","loadVersion","objects","pMap","concurrency","concurrentComponentsLimit","includeUnmodified","softTaggedComponents","listSoftTaggedComponents","listSnappedComponentsOnMain","snappedComponentsIds","toBitId","idWithoutVer","allIds","changeVersion","compact","flat","tagPendingComponentsLatest","latestVersions","componentId","semver","valid","gt","undefined","provider","cli","community","loggerMain","createLogger","SnappingAspect","snapping","snapCmd","SnapCmd","getBaseDomain","tagCmd","TagCmd","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, DEFAULT_BIT_RELEASE_TYPE } 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 { 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 { LanesIsDisabled } from '@teambit/legacy/dist/consumer/lanes/exceptions/lanes-is-disabled';\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 { FailedLoadForTag } from '@teambit/legacy/dist/consumer/component/exceptions/failed-load-for-tag';\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';\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 patch,\n minor,\n major,\n preRelease,\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 patch?: boolean;\n minor?: boolean;\n major?: boolean;\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 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 let releaseType: ReleaseType = DEFAULT_BIT_RELEASE_TYPE;\n\n if (major) releaseType = 'major';\n else if (minor) releaseType = 'minor';\n else if (patch) releaseType = 'patch';\n else if (preRelease) releaseType = 'prerelease';\n\n const exactVersion = version;\n preRelease = typeof preRelease === 'string' ? preRelease : '';\n\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 if (this.workspace.isLegacy) {\n persist = true;\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 preRelease,\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 id, // @todo: rename to \"patterns\"\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 id?: 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 (id && legacyBitIds) throw new Error(`please pass either id or legacyBitIds, not both`);\n const consumer: Consumer = this.workspace.consumer;\n if (consumer.isLegacy) throw new LanesIsDisabled();\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents()) as BitIds;\n const ids = legacyBitIds || (await getIdsToSnap());\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(): Promise<BitIds | null> {\n const idHasWildcard = id && hasWildcard(id);\n if (id && !idHasWildcard) {\n const bitId = consumer.getParsedId(id);\n if (!unmodified) {\n const componentStatus = await consumer.getComponentStatusById(bitId);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (componentStatus.modified === false) return null;\n }\n return new BitIds(bitId);\n }\n const tagPendingComponents = unmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n if (R.isEmpty(tagPendingComponents)) return null;\n const bitIds = idHasWildcard\n ? ComponentsList.filterComponentsByWildcard(tagPendingComponents, id)\n : tagPendingComponents;\n return BitIds.fromArray(bitIds);\n }\n }\n\n private async loadComponentsForTag(ids: BitIds): Promise<ConsumerComponent[]> {\n const { components } = await this.workspace.consumer.loadComponents(ids.toVersionLatest());\n if (this.workspace.isLegacy) {\n return components;\n }\n let shouldReloadComponents = false;\n const componentsWithRelativePaths: string[] = [];\n const componentsWithFilesNotDir: string[] = [];\n const componentsWithCustomModuleResolution: string[] = [];\n components.forEach((component) => {\n const componentMap = component.componentMap as ComponentMap;\n if (componentMap.rootDir) return;\n const hasRelativePaths = component.issues?.getIssue(IssuesClasses.RelativeComponentsAuthored);\n const hasCustomModuleResolutions = component.issues?.getIssue(IssuesClasses.MissingCustomModuleResolutionLinks);\n // leaving this because it can be helpful for users upgrade from legacy\n if (componentMap.trackDir && !hasRelativePaths) {\n componentMap.changeRootDirAndUpdateFilesAccordingly(componentMap.trackDir);\n shouldReloadComponents = true;\n return;\n }\n if (hasRelativePaths) {\n componentsWithRelativePaths.push(component.id.toStringWithoutVersion());\n }\n if (!componentMap.trackDir) {\n componentsWithFilesNotDir.push(component.id.toStringWithoutVersion());\n }\n if (hasCustomModuleResolutions) {\n componentsWithCustomModuleResolution.push(component.id.toStringWithoutVersion());\n }\n });\n if (componentsWithRelativePaths.length || componentsWithFilesNotDir.length) {\n throw new FailedLoadForTag(\n componentsWithRelativePaths.sort(),\n componentsWithFilesNotDir.sort(),\n componentsWithCustomModuleResolution.sort()\n );\n }\n if (!shouldReloadComponents) return components;\n this.workspace.clearCache();\n const { components: reloadedComponents } = await this.workspace.consumer.loadComponents(ids);\n return reloadedComponents;\n }\n\n private async throwForComponentIssues(legacyComponents: ConsumerComponent[], ignoreIssues?: string) {\n legacyComponents.forEach((component) => {\n if (this.workspace.isLegacy && component.issues) {\n component.issues.delete(IssuesClasses.RelativeComponentsAuthored);\n }\n });\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 if (!this.workspace.isLegacy) {\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\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 if (this.workspace.isLegacy) {\n return;\n }\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 tagPendingComponents = includeUnmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n\n const snappedComponents = await componentsList.listSnappedComponentsOnMain();\n const snappedComponentsIds = snappedComponents.map((c) => c.toBitId());\n\n if (ids.length) {\n const bitIds = await Promise.all(\n ids.map(async (id) => {\n const [idWithoutVer, version] = id.split('@');\n const idHasWildcard = hasWildcard(id);\n if (idHasWildcard) {\n const allIds = ComponentsList.filterComponentsByWildcard(tagPendingComponents, idWithoutVer);\n return allIds.map((bitId) => bitId.changeVersion(version));\n }\n const bitId = this.workspace.consumer.getParsedId(idWithoutVer);\n if (!includeUnmodified) {\n const componentStatus = await this.workspace.consumer.getComponentStatusById(bitId);\n if (componentStatus.modified === false) return null;\n }\n return bitId.changeVersion(version);\n })\n );\n\n return { bitIds: compact(bitIds.flat()), warnings };\n }\n\n if (snapped) {\n return { bitIds: snappedComponentsIds, warnings };\n }\n\n tagPendingComponents.push(...snappedComponentsIds);\n\n if (includeUnmodified && exactVersion) {\n const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(\n tagPendingComponents,\n false\n );\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: tagPendingComponents.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(community.getBaseDomain(), snapping, logger);\n cli.register(tagCmd, snapCmd);\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;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;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;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;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E,EAAD,IAAQA,EAAE,CAAC8G,aAAH,CAAiBS,SAAjB,CAAjC,CAAV;MAAyE9I;IAAzE,CAAP;EACD;;EAKoB,aAAR+I,QAAQ,CAAC,CAACjM,SAAD,EAAYkM,GAAZ,EAAiBC,SAAjB,EAA4BC,UAA5B,EAAwClM,MAAxC,EAAgDC,QAAhD,CAAD,EAOlB;IACD,MAAMF,MAAM,GAAGmM,UAAU,CAACC,YAAX,CAAwBC,0BAAA,CAAe7H,EAAvC,CAAf;IACA,MAAM8H,QAAQ,GAAG,IAAIzM,YAAJ,CAAiBE,SAAjB,EAA4BC,MAA5B,EAAoCC,MAApC,EAA4CC,QAA5C,CAAjB;IACA,MAAMqM,OAAO,GAAG,KAAIC,kBAAJ,EAAYN,SAAS,CAACO,aAAV,EAAZ,EAAuCH,QAAvC,EAAiDtM,MAAjD,CAAhB;IACA,MAAM0M,MAAM,GAAG,KAAIC,gBAAJ,EAAWT,SAAS,CAACO,aAAV,EAAX,EAAsCH,QAAtC,EAAgDtM,MAAhD,CAAf;IACAiM,GAAG,CAACW,QAAJ,CAAaF,MAAb,EAAqBH,OAArB;IACA,OAAOD,QAAP;EACD;;AAhauB;;;gCAAbzM,Y,WA+YI,E;gCA/YJA,Y,kBAgZW,CAACgN,oBAAD,EAAkBC,gBAAlB,EAA6BC,oBAA7B,EAA8CC,sBAA9C,EAA4DC,iBAA5D,EAA0EC,0BAA1E,C;gCAhZXrN,Y,aAiZMsN,kB;;AAkBnBd,0BAAA,CAAee,UAAf,CAA0BvN,YAA1B;;eAEeA,Y"}
|
|
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","isLegacy","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","skipAutoSnap","Error","LanesIsDisabled","getIdsToSnap","isSnap","snapResults","snappedComponents","autoSnappedResults","currentLane","getCurrentLaneId","laneName","isDefault","name","idHasWildcard","bitId","getParsedId","componentStatus","getComponentStatusById","modified","tagPendingComponents","listPotentialTagAllWorkspace","listTagPendingComponents","filterComponentsByWildcard","loadComponents","toVersionLatest","shouldReloadComponents","componentsWithRelativePaths","componentsWithFilesNotDir","componentsWithCustomModuleResolution","forEach","component","componentMap","rootDir","hasRelativePaths","getIssue","IssuesClasses","RelativeComponentsAuthored","hasCustomModuleResolutions","MissingCustomModuleResolutionLinks","trackDir","changeRootDirAndUpdateFilesAccordingly","push","toStringWithoutVersion","FailedLoadForTag","sort","clearCache","reloadedComponents","legacyComponents","delete","issuesToIgnoreFromFlag","split","map","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","getManyByLegacy","includes","CircularDependencies","addInsightsAsComponentIssues","removeIgnoredIssuesFromComponents","componentsWithBlockingIssues","filter","shouldBlockTagging","ComponentsHaveIssues","throwForComponent","dependenciesIds","getAllDependenciesIds","Promise","all","depId","hasVersion","modelComp","getModelComponentIfExist","loadVersion","objects","pMap","concurrency","concurrentComponentsLimit","includeUnmodified","softTaggedComponents","listSoftTaggedComponents","listSnappedComponentsOnMain","snappedComponentsIds","toBitId","idWithoutVer","allIds","changeVersion","compact","flat","tagPendingComponentsLatest","latestVersions","componentId","semver","valid","gt","undefined","provider","cli","community","loggerMain","createLogger","SnappingAspect","snapping","snapCmd","SnapCmd","getBaseDomain","tagCmd","TagCmd","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 { 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 { LanesIsDisabled } from '@teambit/legacy/dist/consumer/lanes/exceptions/lanes-is-disabled';\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 { FailedLoadForTag } from '@teambit/legacy/dist/consumer/component/exceptions/failed-load-for-tag';\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';\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 if (this.workspace.isLegacy) {\n persist = true;\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 id, // @todo: rename to \"patterns\"\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 id?: 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 (id && legacyBitIds) throw new Error(`please pass either id or legacyBitIds, not both`);\n const consumer: Consumer = this.workspace.consumer;\n if (consumer.isLegacy) throw new LanesIsDisabled();\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents()) as BitIds;\n const ids = legacyBitIds || (await getIdsToSnap());\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(): Promise<BitIds | null> {\n const idHasWildcard = id && hasWildcard(id);\n if (id && !idHasWildcard) {\n const bitId = consumer.getParsedId(id);\n if (!unmodified) {\n const componentStatus = await consumer.getComponentStatusById(bitId);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (componentStatus.modified === false) return null;\n }\n return new BitIds(bitId);\n }\n const tagPendingComponents = unmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n if (R.isEmpty(tagPendingComponents)) return null;\n const bitIds = idHasWildcard\n ? ComponentsList.filterComponentsByWildcard(tagPendingComponents, id)\n : tagPendingComponents;\n return BitIds.fromArray(bitIds);\n }\n }\n\n private async loadComponentsForTag(ids: BitIds): Promise<ConsumerComponent[]> {\n const { components } = await this.workspace.consumer.loadComponents(ids.toVersionLatest());\n if (this.workspace.isLegacy) {\n return components;\n }\n let shouldReloadComponents = false;\n const componentsWithRelativePaths: string[] = [];\n const componentsWithFilesNotDir: string[] = [];\n const componentsWithCustomModuleResolution: string[] = [];\n components.forEach((component) => {\n const componentMap = component.componentMap as ComponentMap;\n if (componentMap.rootDir) return;\n const hasRelativePaths = component.issues?.getIssue(IssuesClasses.RelativeComponentsAuthored);\n const hasCustomModuleResolutions = component.issues?.getIssue(IssuesClasses.MissingCustomModuleResolutionLinks);\n // leaving this because it can be helpful for users upgrade from legacy\n if (componentMap.trackDir && !hasRelativePaths) {\n componentMap.changeRootDirAndUpdateFilesAccordingly(componentMap.trackDir);\n shouldReloadComponents = true;\n return;\n }\n if (hasRelativePaths) {\n componentsWithRelativePaths.push(component.id.toStringWithoutVersion());\n }\n if (!componentMap.trackDir) {\n componentsWithFilesNotDir.push(component.id.toStringWithoutVersion());\n }\n if (hasCustomModuleResolutions) {\n componentsWithCustomModuleResolution.push(component.id.toStringWithoutVersion());\n }\n });\n if (componentsWithRelativePaths.length || componentsWithFilesNotDir.length) {\n throw new FailedLoadForTag(\n componentsWithRelativePaths.sort(),\n componentsWithFilesNotDir.sort(),\n componentsWithCustomModuleResolution.sort()\n );\n }\n if (!shouldReloadComponents) return components;\n this.workspace.clearCache();\n const { components: reloadedComponents } = await this.workspace.consumer.loadComponents(ids);\n return reloadedComponents;\n }\n\n private async throwForComponentIssues(legacyComponents: ConsumerComponent[], ignoreIssues?: string) {\n legacyComponents.forEach((component) => {\n if (this.workspace.isLegacy && component.issues) {\n component.issues.delete(IssuesClasses.RelativeComponentsAuthored);\n }\n });\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 if (!this.workspace.isLegacy) {\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\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 if (this.workspace.isLegacy) {\n return;\n }\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 tagPendingComponents = includeUnmodified\n ? await componentsList.listPotentialTagAllWorkspace()\n : await componentsList.listTagPendingComponents();\n\n const snappedComponents = await componentsList.listSnappedComponentsOnMain();\n const snappedComponentsIds = snappedComponents.map((c) => c.toBitId());\n\n if (ids.length) {\n const bitIds = await Promise.all(\n ids.map(async (id) => {\n const [idWithoutVer, version] = id.split('@');\n const idHasWildcard = hasWildcard(id);\n if (idHasWildcard) {\n const allIds = ComponentsList.filterComponentsByWildcard(tagPendingComponents, idWithoutVer);\n return allIds.map((bitId) => bitId.changeVersion(version));\n }\n const bitId = this.workspace.consumer.getParsedId(idWithoutVer);\n if (!includeUnmodified) {\n const componentStatus = await this.workspace.consumer.getComponentStatusById(bitId);\n if (componentStatus.modified === false) return null;\n }\n return bitId.changeVersion(version);\n })\n );\n\n return { bitIds: compact(bitIds.flat()), warnings };\n }\n\n if (snapped) {\n return { bitIds: snappedComponentsIds, warnings };\n }\n\n tagPendingComponents.push(...snappedComponentsIds);\n\n if (includeUnmodified && exactVersion) {\n const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(\n tagPendingComponents,\n false\n );\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: tagPendingComponents.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(community.getBaseDomain(), snapping, logger);\n cli.register(tagCmd, snapCmd);\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;;E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ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
2
|
import { BasicTagParams } from '@teambit/legacy/dist/api/consumer/lib/tag';
|
|
3
|
+
import { ReleaseType } from 'semver';
|
|
3
4
|
import { Logger } from '@teambit/logger';
|
|
4
5
|
import { SnappingMain } from './snapping.main.runtime';
|
|
5
6
|
export declare class TagCmd implements Command {
|
|
@@ -8,6 +9,10 @@ export declare class TagCmd implements Command {
|
|
|
8
9
|
name: string;
|
|
9
10
|
group: string;
|
|
10
11
|
description: string;
|
|
12
|
+
arguments: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}[];
|
|
11
16
|
extendedDescription: string;
|
|
12
17
|
alias: string;
|
|
13
18
|
loader: boolean;
|
|
@@ -19,7 +24,7 @@ export declare class TagCmd implements Command {
|
|
|
19
24
|
description: string;
|
|
20
25
|
}[];
|
|
21
26
|
constructor(docsDomain: string, snapping: SnappingMain, logger: Logger);
|
|
22
|
-
report([id]: [string[]], { message, ver, all, editor, snapped, patch, minor, major, preRelease, force, ignoreUnresolvedDependencies, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, scope, unmodified, build, soft, persist, disableDeployPipeline, disableTagPipeline, forceDeploy, incrementBy, }: {
|
|
27
|
+
report([id]: [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, }: {
|
|
23
28
|
all?: boolean | string;
|
|
24
29
|
snapped?: boolean;
|
|
25
30
|
ver?: string;
|
|
@@ -27,6 +32,9 @@ export declare class TagCmd implements Command {
|
|
|
27
32
|
patch?: boolean;
|
|
28
33
|
minor?: boolean;
|
|
29
34
|
major?: boolean;
|
|
35
|
+
increment?: ReleaseType;
|
|
36
|
+
preRelease?: string;
|
|
37
|
+
prereleaseId?: string;
|
|
30
38
|
ignoreUnresolvedDependencies?: boolean;
|
|
31
39
|
ignoreIssues?: string;
|
|
32
40
|
scope?: string | boolean;
|
package/dist/tag-cmd.js
CHANGED
|
@@ -71,18 +71,24 @@ function _bitError() {
|
|
|
71
71
|
return data;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
const RELEASE_TYPES = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];
|
|
75
|
+
|
|
74
76
|
class TagCmd {
|
|
75
77
|
// In case a compiler / tester is not installed
|
|
76
78
|
constructor(docsDomain, snapping, logger) {
|
|
77
79
|
this.snapping = snapping;
|
|
78
80
|
this.logger = logger;
|
|
79
|
-
(0, _defineProperty2().default)(this, "name", 'tag [
|
|
81
|
+
(0, _defineProperty2().default)(this, "name", 'tag [component-names...]');
|
|
80
82
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
81
|
-
(0, _defineProperty2().default)(this, "description", '
|
|
83
|
+
(0, _defineProperty2().default)(this, "description", 'create an immutable and exportable component snapshot, tagged with a release version.');
|
|
84
|
+
(0, _defineProperty2().default)(this, "arguments", [{
|
|
85
|
+
name: 'component-names...',
|
|
86
|
+
description: 'a list of component names or component IDs (separated by space). By default, all modified are tagged.'
|
|
87
|
+
}]);
|
|
82
88
|
(0, _defineProperty2().default)(this, "extendedDescription", void 0);
|
|
83
89
|
(0, _defineProperty2().default)(this, "alias", 't');
|
|
84
90
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
85
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing
|
|
91
|
+
(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"'], ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'], ['', 'pre-release [identifier]', 'DEPRECATED. use "-l prerelease" (and --prerelease-id) instead'], ['', '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:
|
|
86
92
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
87
93
|
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']]);
|
|
88
94
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
@@ -95,7 +101,8 @@ to ignore multiple issues, separate them by a comma and wrap with quotes. to ign
|
|
|
95
101
|
if component ids are entered, you can specify a version per id using "@" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major
|
|
96
102
|
https://${docsDomain}/components/tags
|
|
97
103
|
${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
98
|
-
}
|
|
104
|
+
} // eslint-disable-next-line complexity
|
|
105
|
+
|
|
99
106
|
|
|
100
107
|
async report([id = []], {
|
|
101
108
|
message = '',
|
|
@@ -107,6 +114,8 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
107
114
|
minor,
|
|
108
115
|
major,
|
|
109
116
|
preRelease,
|
|
117
|
+
increment,
|
|
118
|
+
prereleaseId,
|
|
110
119
|
force = false,
|
|
111
120
|
ignoreUnresolvedDependencies,
|
|
112
121
|
ignoreIssues,
|
|
@@ -161,13 +170,37 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
161
170
|
if (id.length) unmodified = true;
|
|
162
171
|
}
|
|
163
172
|
|
|
173
|
+
const releaseFlags = [patch, minor, major, preRelease].filter(x => x);
|
|
174
|
+
|
|
175
|
+
if (releaseFlags.length > 1) {
|
|
176
|
+
throw new (_bitError().BitError)('you can use only one of the following - patch, minor, major, pre-release');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const getReleaseType = () => {
|
|
180
|
+
if (increment) {
|
|
181
|
+
if (!RELEASE_TYPES.includes(increment)) {
|
|
182
|
+
throw new (_bitError().BitError)(`invalid increment-level "${increment}".
|
|
183
|
+
semver allows the following options only: ${RELEASE_TYPES.join(', ')}`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return increment;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (major) return 'major';
|
|
190
|
+
if (minor) return 'minor';
|
|
191
|
+
if (patch) return 'patch';
|
|
192
|
+
if (preRelease) return 'prerelease';
|
|
193
|
+
return _constants().DEFAULT_BIT_RELEASE_TYPE;
|
|
194
|
+
};
|
|
195
|
+
|
|
164
196
|
const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;
|
|
165
197
|
const params = {
|
|
166
198
|
ids: id,
|
|
167
199
|
snapped,
|
|
168
200
|
editor,
|
|
169
201
|
message,
|
|
170
|
-
|
|
202
|
+
releaseType: getReleaseType(),
|
|
203
|
+
preReleaseId: prereleaseId || preRelease || undefined,
|
|
171
204
|
ignoreIssues,
|
|
172
205
|
ignoreNewestVersion,
|
|
173
206
|
skipTests,
|
|
@@ -179,10 +212,7 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
179
212
|
disableTagAndSnapPipelines,
|
|
180
213
|
forceDeploy,
|
|
181
214
|
incrementBy,
|
|
182
|
-
version: ver
|
|
183
|
-
patch,
|
|
184
|
-
minor,
|
|
185
|
-
major
|
|
215
|
+
version: ver
|
|
186
216
|
};
|
|
187
217
|
const results = await this.snapping.tag(params);
|
|
188
218
|
if (!results) return _chalk().default.yellow(_tag().NOTHING_TO_TAG_MSG);
|
package/dist/tag-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TagCmd","constructor","docsDomain","snapping","logger","Object","keys","IssuesClasses","join","cmd","description","extendedDescription","WILDCARD_HELP","report","id","message","ver","all","editor","snapped","patch","minor","major","preRelease","force","ignoreUnresolvedDependencies","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","unmodified","build","soft","persist","disableDeployPipeline","disableTagPipeline","forceDeploy","incrementBy","BitError","consoleWarning","length","disableTagAndSnapPipelines","params","ids","version","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","filter","component","searchWithoutVersion","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 { WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport class TagCmd implements Command {\n name = 'tag [id...]';\n group = 'development';\n description = 'record component changes and lock versions';\n extendedDescription: string;\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'log message describing the user 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 edit the tag messages per component, optionally specify the editor-name, default to vim',\n ],\n ['v', 'ver <version>', 'tag with the given version'],\n ['p', 'patch', 'increment the patch version number'],\n ['', 'minor', 'increment the minor version number'],\n ['', 'major', 'increment the major version number'],\n ['', 'snapped', 'tag components that their head is a snap (not a tag)'],\n ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'],\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(docsDomain: string, private snapping: SnappingMain, private logger: Logger) {\n this.extendedDescription = `if no ids are provided, it will tag all new and modified components.\nif component ids are entered, you can specify a version per id using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major\nhttps://${docsDomain}/components/tags\n${WILDCARD_HELP('tag')}`;\n }\n\n async report(\n [id = []]: [string[]],\n {\n message = '',\n ver,\n all = false,\n editor = '',\n snapped = false,\n patch,\n minor,\n major,\n preRelease,\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 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 (disableTagPipeline) {\n this.logger.consoleWarning(`--disable-tag-pipeline is deprecated, please use --disable-deploy-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 (id.length) unmodified = true;\n }\n\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n\n const params = {\n ids: id,\n snapped,\n editor,\n message,\n preRelease,\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 patch,\n minor,\n major,\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 untag\" to unstage versions)\\n`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the changes\")\n(use \"bit untag --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;AA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EAAwB,OAAO,EAAP;MACxB,OAAQ,KAAIO,gBAAA,CAAMyC,SAAN,CAAgBL,aAAa,GAAGE,KAAhC,CAAuC,MAAKC,WAAY,MAAKrB,gBAAgB,CAACsB,UAAD,CAAa,IAAtG;IACD,CAHD;;IAKA,MAAME,OAAO,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,CAACV,MAAjB,GAA0BmB,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;;AAhPoC"}
|
|
1
|
+
{"version":3,"names":["RELEASE_TYPES","TagCmd","constructor","docsDomain","snapping","logger","name","description","join","Object","keys","IssuesClasses","cmd","extendedDescription","WILDCARD_HELP","report","id","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","disableTagAndSnapPipelines","params","ids","releaseType","preReleaseId","undefined","version","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","component","searchWithoutVersion","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, WILDCARD_HELP } 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-names...]';\n group = 'development';\n description = 'create an immutable and exportable component snapshot, tagged with a release version.';\n arguments = [\n {\n name: 'component-names...',\n description:\n 'a list of component names or component IDs (separated by space). By default, all modified are tagged.',\n },\n ];\n extendedDescription: string;\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 ['', 'snapped', 'EXPERIMENTAL. tag components that their head is a snap (not a tag)'],\n ['', 'pre-release [identifier]', 'DEPRECATED. use \"-l prerelease\" (and --prerelease-id) instead'],\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(docsDomain: string, private snapping: SnappingMain, private logger: Logger) {\n this.extendedDescription = `if no ids are provided, it will tag all new and modified components.\nif component ids are entered, you can specify a version per id using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major\nhttps://${docsDomain}/components/tags\n${WILDCARD_HELP('tag')}`;\n }\n\n // eslint-disable-next-line complexity\n async report(\n [id = []]: [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 (disableTagPipeline) {\n this.logger.consoleWarning(`--disable-tag-pipeline is deprecated, please use --disable-deploy-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 (id.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\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n\n const params = {\n ids: id,\n snapped,\n editor,\n message,\n releaseType: getReleaseType(),\n preReleaseId: prereleaseId || preRelease || undefined,\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 untag\" to unstage versions)\\n`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the changes\")\n(use \"bit untag --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;EA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CAAa,IAAtG;IACD,CAHD;;IAKA,MAAME,OAAO,GAAG3C,OAAO,CAACkB,SAAR,GACZ,+CADY,GAEZ,8BAFJ;IAGA,MAAM0B,WAAW,GAAG5C,OAAO,CAACkB,SAAR,GAChB,2CADgB,GAEhB,oCAFJ;IAGA,MAAM2B,oBAAoB,GAAG7C,OAAO,CAACkB,SAAR,GACzBhB,gBAAA,CAAM4C,IAAN,CACE,iHADF,CADyB,GAIzB,EAJJ;IAKA,OACEhC,cAAc,GACdZ,gBAAA,CAAMgC,KAAN,CACG,GAAE7B,gBAAgB,CAACnB,MAAjB,GAA0B2B,eAAgB,iBAAgBb,OAAO,CAACkB,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,EAAoCnC,iBAApC,CANd,GAOAsB,aAAa,EAPb,GAQAc,oBATF;EAWD;;AAjRoC"}
|
|
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.76",
|
|
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.76"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
19
|
"@teambit/harmony": "0.3.3",
|
|
20
20
|
"@teambit/bit-error": "0.0.394",
|
|
21
|
-
"@teambit/issues": "0.0.
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
21
|
+
"@teambit/issues": "0.0.69",
|
|
22
|
+
"@teambit/cli": "0.0.503",
|
|
23
23
|
"@teambit/component-issues": "0.0.54",
|
|
24
|
-
"@teambit/logger": "0.0.
|
|
25
|
-
"@teambit/community": "0.0.
|
|
26
|
-
"@teambit/insights": "0.0.
|
|
27
|
-
"@teambit/workspace": "0.0.
|
|
24
|
+
"@teambit/logger": "0.0.596",
|
|
25
|
+
"@teambit/community": "0.0.51",
|
|
26
|
+
"@teambit/insights": "0.0.761",
|
|
27
|
+
"@teambit/workspace": "0.0.761"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash": "4.14.165",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@types/react-dom": "^17.0.5",
|
|
38
38
|
"@types/react": "^17.0.8",
|
|
39
39
|
"@types/node": "12.20.4",
|
|
40
|
-
"@teambit/compiler": "0.0.
|
|
40
|
+
"@teambit/compiler": "0.0.761",
|
|
41
41
|
"@teambit/component.testing.mock-components": "0.0.6",
|
|
42
42
|
"@teambit/harmony.testing.load-aspect": "0.0.6",
|
|
43
43
|
"@teambit/workspace.testing.mock-workspace": "0.0.5"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@teambit/legacy": "1.0.
|
|
46
|
+
"@teambit/legacy": "1.0.283",
|
|
47
47
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
48
48
|
"react": "^16.8.0 || ^17.0.0"
|
|
49
49
|
},
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"react": "-"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@teambit/legacy": "1.0.
|
|
74
|
+
"@teambit/legacy": "1.0.283",
|
|
75
75
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
76
76
|
"react": "^16.8.0 || ^17.0.0"
|
|
77
77
|
}
|
|
File without changes
|
|
Binary file
|