@teambit/snapping 0.0.22 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snap-cmd.d.ts +2 -2
- package/dist/snap-cmd.js +16 -15
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +5 -6
- package/dist/snapping.main.runtime.js +15 -55
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/tag-cmd.d.ts +3 -2
- package/dist/tag-cmd.js +36 -8
- package/dist/tag-cmd.js.map +1 -1
- package/package-tar/teambit-snapping-0.0.25.tgz +0 -0
- package/package.json +11 -11
- /package/{preview-1649733938651.js → preview-1650252279523.js} +0 -0
- package/package-tar/teambit-snapping-0.0.22.tgz +0 -0
package/dist/snap-cmd.d.ts
CHANGED
|
@@ -10,16 +10,16 @@ export declare class SnapCmd implements Command {
|
|
|
10
10
|
private: boolean;
|
|
11
11
|
migration: boolean;
|
|
12
12
|
constructor(docsDomain: string, snapping: SnappingMain);
|
|
13
|
-
report([id]: string[], { message, all, force,
|
|
13
|
+
report([id]: string[], { message, all, force, ignoreIssues, build, skipTests, skipAutoSnap, disableSnapPipeline, forceDeploy, unmodified, }: {
|
|
14
14
|
message?: string;
|
|
15
15
|
all?: boolean;
|
|
16
16
|
force?: boolean;
|
|
17
|
-
verbose?: boolean;
|
|
18
17
|
ignoreIssues?: string;
|
|
19
18
|
build?: boolean;
|
|
20
19
|
skipTests?: boolean;
|
|
21
20
|
skipAutoSnap?: boolean;
|
|
22
21
|
disableSnapPipeline?: boolean;
|
|
23
22
|
forceDeploy?: boolean;
|
|
23
|
+
unmodified?: boolean;
|
|
24
24
|
}): Promise<string>;
|
|
25
25
|
}
|
package/dist/snap-cmd.js
CHANGED
|
@@ -79,9 +79,9 @@ class SnapCmd {
|
|
|
79
79
|
(0, _defineProperty2().default)(this, "name", 'snap [id]');
|
|
80
80
|
(0, _defineProperty2().default)(this, "description", void 0);
|
|
81
81
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
82
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['
|
|
82
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user 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
83
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
84
|
-
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`]]);
|
|
84
|
+
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
85
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
86
86
|
(0, _defineProperty2().default)(this, "private", true);
|
|
87
87
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
@@ -94,41 +94,42 @@ ${(0, _constants().WILDCARD_HELP)('snap')}`;
|
|
|
94
94
|
message = '',
|
|
95
95
|
all = false,
|
|
96
96
|
force = false,
|
|
97
|
-
verbose = false,
|
|
98
97
|
ignoreIssues,
|
|
99
98
|
build,
|
|
100
99
|
skipTests = false,
|
|
101
100
|
skipAutoSnap = false,
|
|
102
101
|
disableSnapPipeline = false,
|
|
103
|
-
forceDeploy = false
|
|
102
|
+
forceDeploy = false,
|
|
103
|
+
unmodified = false
|
|
104
104
|
}) {
|
|
105
105
|
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
|
106
|
+
const disableTagAndSnapPipelines = disableSnapPipeline;
|
|
106
107
|
|
|
107
|
-
if (
|
|
108
|
-
throw new (_bitError().BitError)('
|
|
108
|
+
if (disableTagAndSnapPipelines && forceDeploy) {
|
|
109
|
+
throw new (_bitError().BitError)('you can use either force-deploy or disable-snap-pipeline, but not both');
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
if (
|
|
112
|
-
|
|
112
|
+
if (all) {
|
|
113
|
+
// eslint-disable-next-line no-console
|
|
114
|
+
console.warn(_chalk().default.yellow(`--all is deprecated, please omit it. "bit snap" by default will snap all new and modified components`));
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
if (force) {
|
|
118
|
+
// eslint-disable-next-line no-console
|
|
119
|
+
console.warn(_chalk().default.yellow(`--force is deprecated, use either --skip-tests or --unmodified depending on the use case`));
|
|
120
|
+
if (id) unmodified = true;
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
const results = await this.snapping.snap({
|
|
122
124
|
id,
|
|
123
125
|
message,
|
|
124
|
-
force,
|
|
125
|
-
verbose,
|
|
126
126
|
ignoreIssues,
|
|
127
127
|
build,
|
|
128
128
|
skipTests,
|
|
129
129
|
skipAutoSnap,
|
|
130
130
|
disableTagAndSnapPipelines,
|
|
131
|
-
forceDeploy
|
|
131
|
+
forceDeploy,
|
|
132
|
+
unmodified
|
|
132
133
|
});
|
|
133
134
|
if (!results) return _chalk().default.yellow(_constants().NOTHING_TO_SNAP_MSG);
|
|
134
135
|
const {
|
package/dist/snap-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["snap-cmd.ts"],"names":["SnapCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","report","id","message","all","force","verbose","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","BUILD_ON_CI","Boolean","BitError","disableTagAndSnapPipelines","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIO,MAAMA,OAAN,CAAiC;AA0BtCC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDAzBzD,WAyByD;AAAA;AAAA,mDAvBxD,EAuBwD;AAAA,qDAtBtD,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,GAAD,EAAM,KAAN,EAAa,sCAAb,CAFQ,EAGR,CAAC,GAAD,EAAM,OAAN,EAAe,8EAAf,CAHQ,EAIR,CAAC,GAAD,EAAM,SAAN,EAAiB,8BAAjB,CAJQ,EAKR,CAAC,EAAD,EAAK,OAAL,EAAc,2DAAd,CALQ,EAMR,CAAC,EAAD,EAAK,YAAL,EAAmB,kDAAnB,CANQ,EAOR,CAAC,EAAD,EAAK,gBAAL,EAAuB,+BAAvB,CAPQ,EAQR,CAAC,EAAD,EAAK,uBAAL,EAA8B,wBAA9B,CARQ,EASR,CAAC,EAAD,EAAK,cAAL,EAAqB,iEAArB,CATQ,EAUR,CACE,GADF,EAEE,wBAFF,EAGG;AACP,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EAAoB;AAClB,gBAAMY,WAAW,GAAGJ,OAAO,CAACH,GAAR,CAAaQ,CAAD,IAAOA,CAAC,CAACjB,SAAF,CAAY3B,EAAZ,CAAesC,QAAf,EAAnB,CAApB;AACAD,UAAAA,eAAe,IAAK,YAAWQ,6BAAiB,KAAIF,WAAW,CAAC9C,IAAZ,CAAiB,IAAjB,CAAuB,EAA3E;AACD;;AACD,eAAOwC,eAAP;AACD,OAXI,EAYJxC,IAZI,CAYC,IAZD,CAAP;AAaD,KAdD;;AAgBA,UAAMiD,cAAc,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,UAArB,KAAoC;AACzD,UAAI,CAACA,UAAU,CAAClB,MAAhB,EAAwB,OAAO,EAAP;AACxB,aAAQ,KAAId,iBAAMiC,SAAN,CAAgBH,KAAhB,CAAuB,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAD,CAAa,IAAtF;AACD,KAHD;;AAIA,UAAME,OAAO,GAAG3B,QAAQ,GAAI,QAAOA,QAAS,QAApB,GAA8B,EAAtD;AAEA,WACEQ,cAAc,GACdf,iBAAMmC,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;AAOD;;AA9HqC","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 { 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: string;\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the user changes'],\n ['a', 'all', 'snap all new and modified components'],\n ['f', 'force', 'force-snap even if tests are failing and even when component has not changed'],\n ['v', 'verbose', 'show specs output on failure'],\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 ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(docsDomain: string, private snapping: SnappingMain) {\n this.description = `record component changes.\nhttps://${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 verbose = false,\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n }: {\n message?: string;\n all?: boolean;\n force?: boolean;\n verbose?: boolean;\n ignoreIssues?: string;\n build?: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n }\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n if (!id && !all) {\n throw new BitError('missing [id]. to snap all components, please use --all flag');\n }\n if (id && all) {\n throw new BitError(\n 'you can use either a specific component [id] to snap a particular component or --all flag to snap them all'\n );\n }\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 const results = await this.snapping.snap({\n id,\n message,\n force,\n verbose,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n forceDeploy,\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"]}
|
|
1
|
+
{"version":3,"sources":["snap-cmd.ts"],"names":["SnapCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","report","id","message","all","force","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","unmodified","BUILD_ON_CI","Boolean","disableTagAndSnapPipelines","BitError","console","warn","chalk","yellow","results","snap","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIO,MAAMA,OAAN,CAAiC;AA8BtCC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDA7BzD,WA6ByD;AAAA;AAAA,mDA3BxD,EA2BwD;AAAA,qDA1BtD,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,IA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AP,CAAmBC,4BAAnB,CAAgDf,SAAS,CAAC7B,EAA1D,CADc,CAAhB;;AAGA,YAAIyC,OAAO,CAACR,MAAZ,EAAoB;AAClB,gBAAMY,WAAW,GAAGJ,OAAO,CAACH,GAAR,CAAaQ,CAAD,IAAOA,CAAC,CAACjB,SAAF,CAAY7B,EAAZ,CAAewC,QAAf,EAAnB,CAApB;AACAD,UAAAA,eAAe,IAAK,YAAWQ,6BAAiB,KAAIF,WAAW,CAAChD,IAAZ,CAAiB,IAAjB,CAAuB,EAA3E;AACD;;AACD,eAAO0C,eAAP;AACD,OAXI,EAYJ1C,IAZI,CAYC,IAZD,CAAP;AAaD,KAdD;;AAgBA,UAAMmD,cAAc,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,UAArB,KAAoC;AACzD,UAAI,CAACA,UAAU,CAAClB,MAAhB,EAAwB,OAAO,EAAP;AACxB,aAAQ,KAAIhB,iBAAMmC,SAAN,CAAgBH,KAAhB,CAAuB,MAAKC,WAAY,MAAKd,gBAAgB,CAACe,UAAD,CAAa,IAAtF;AACD,KAHD;;AAIA,UAAME,OAAO,GAAG3B,QAAQ,GAAI,QAAOA,QAAS,QAApB,GAA8B,EAAtD;AAEA,WACEQ,cAAc,GACdjB,iBAAMqC,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;AAOD;;AAxIqC","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 { 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: 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) {\n this.description = `record component changes.\nhttps://${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 if (all) {\n // eslint-disable-next-line no-console\n console.warn(\n chalk.yellow(\n `--all is deprecated, please omit it. \"bit snap\" by default will snap all new and modified components`\n )\n );\n }\n if (force) {\n // eslint-disable-next-line no-console\n console.warn(\n chalk.yellow(`--force is deprecated, use either --skip-tests or --unmodified depending on the use case`)\n );\n if (id) unmodified = true;\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"]}
|
|
@@ -19,11 +19,11 @@ export declare class SnappingMain {
|
|
|
19
19
|
* with a valid semver to that version.
|
|
20
20
|
* tag can be done only on main, not on a lane.
|
|
21
21
|
*/
|
|
22
|
-
tag({ ids, message,
|
|
22
|
+
tag({ ids, message, version, editor, snapped, patch, minor, major, preRelease, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, build, unmodified, soft, persist, forceDeploy, incrementBy, disableTagAndSnapPipelines, }: {
|
|
23
23
|
ids?: string[];
|
|
24
24
|
all?: boolean | string;
|
|
25
|
-
snapped?: boolean
|
|
26
|
-
|
|
25
|
+
snapped?: boolean;
|
|
26
|
+
version?: string;
|
|
27
27
|
patch?: boolean;
|
|
28
28
|
minor?: boolean;
|
|
29
29
|
major?: boolean;
|
|
@@ -37,19 +37,18 @@ export declare class SnappingMain {
|
|
|
37
37
|
*/
|
|
38
38
|
snap({ id, // @todo: rename to "patterns"
|
|
39
39
|
legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.
|
|
40
|
-
resolveUnmerged, message,
|
|
40
|
+
resolveUnmerged, message, ignoreIssues, skipTests, skipAutoSnap, build, disableTagAndSnapPipelines, forceDeploy, unmodified, }: {
|
|
41
41
|
id?: string;
|
|
42
42
|
legacyBitIds?: BitIds;
|
|
43
43
|
resolveUnmerged?: boolean;
|
|
44
44
|
message?: string;
|
|
45
|
-
force?: boolean;
|
|
46
|
-
verbose?: boolean;
|
|
47
45
|
ignoreIssues?: string;
|
|
48
46
|
build: boolean;
|
|
49
47
|
skipTests?: boolean;
|
|
50
48
|
skipAutoSnap?: boolean;
|
|
51
49
|
disableTagAndSnapPipelines?: boolean;
|
|
52
50
|
forceDeploy?: boolean;
|
|
51
|
+
unmodified?: boolean;
|
|
53
52
|
}): Promise<SnapResults | null>;
|
|
54
53
|
private loadComponentsForTag;
|
|
55
54
|
private throwForComponentIssues;
|
|
@@ -41,16 +41,6 @@ function _cli() {
|
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function _utils() {
|
|
45
|
-
const data = require("@teambit/legacy/dist/utils");
|
|
46
|
-
|
|
47
|
-
_utils = function () {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
44
|
function _featureToggle() {
|
|
55
45
|
const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
|
|
56
46
|
|
|
@@ -372,22 +362,19 @@ class SnappingMain {
|
|
|
372
362
|
async tag({
|
|
373
363
|
ids = [],
|
|
374
364
|
message = '',
|
|
375
|
-
|
|
376
|
-
all = false,
|
|
365
|
+
version,
|
|
377
366
|
editor = '',
|
|
378
367
|
snapped = false,
|
|
379
368
|
patch,
|
|
380
369
|
minor,
|
|
381
370
|
major,
|
|
382
371
|
preRelease,
|
|
383
|
-
force = false,
|
|
384
|
-
verbose = false,
|
|
385
372
|
ignoreIssues,
|
|
386
373
|
ignoreNewestVersion = false,
|
|
387
374
|
skipTests = false,
|
|
388
375
|
skipAutoTag = false,
|
|
389
|
-
scope,
|
|
390
376
|
build,
|
|
377
|
+
unmodified = false,
|
|
391
378
|
soft = false,
|
|
392
379
|
persist = false,
|
|
393
380
|
forceDeploy = false,
|
|
@@ -397,29 +384,10 @@ class SnappingMain {
|
|
|
397
384
|
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
|
398
385
|
if (soft) build = false;
|
|
399
386
|
|
|
400
|
-
function getVersion() {
|
|
401
|
-
if (scope && (0, _utils().isString)(scope)) return scope;
|
|
402
|
-
if (all && (0, _utils().isString)(all)) return all;
|
|
403
|
-
if (snapped && (0, _utils().isString)(snapped)) return snapped;
|
|
404
|
-
return ver;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
if (!ids.length && !all && !snapped && !scope && !persist) {
|
|
408
|
-
throw new (_bitError().BitError)('missing [id]. to tag all components, please use --all flag');
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
if (ids.length && all) {
|
|
412
|
-
throw new (_bitError().BitError)('you can use either a specific component [id] to tag a particular component or --all flag to tag them all');
|
|
413
|
-
}
|
|
414
|
-
|
|
415
387
|
if (disableTagAndSnapPipelines && forceDeploy) {
|
|
416
388
|
throw new (_bitError().BitError)('you can use either force-deploy or disable-tag-pipeline, but not both');
|
|
417
389
|
}
|
|
418
390
|
|
|
419
|
-
if (all && persist) {
|
|
420
|
-
throw new (_bitError().BitError)('you can use either --all or --persist, but not both');
|
|
421
|
-
}
|
|
422
|
-
|
|
423
391
|
if (editor && persist) {
|
|
424
392
|
throw new (_bitError().BitError)('you can use either --editor or --persist, but not both');
|
|
425
393
|
}
|
|
@@ -436,15 +404,12 @@ class SnappingMain {
|
|
|
436
404
|
|
|
437
405
|
let releaseType = _constants().DEFAULT_BIT_RELEASE_TYPE;
|
|
438
406
|
|
|
439
|
-
const includeImported = Boolean(scope && all);
|
|
440
407
|
if (major) releaseType = 'major';else if (minor) releaseType = 'minor';else if (patch) releaseType = 'patch';else if (preRelease) releaseType = 'prerelease';
|
|
441
|
-
const exactVersion =
|
|
442
|
-
all = Boolean(all);
|
|
443
|
-
snapped = Boolean(snapped);
|
|
408
|
+
const exactVersion = version;
|
|
444
409
|
preRelease = typeof preRelease === 'string' ? preRelease : '';
|
|
445
410
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
446
411
|
const idsHasWildcard = (0, _hasWildcard().default)(ids);
|
|
447
|
-
const isAll = Boolean(
|
|
412
|
+
const isAll = Boolean(!ids.length || idsHasWildcard);
|
|
448
413
|
const validExactVersion = (0, _semverHelper().validateVersion)(exactVersion);
|
|
449
414
|
const consumer = this.workspace.consumer;
|
|
450
415
|
const componentsList = new (_componentsList().default)(consumer);
|
|
@@ -455,7 +420,7 @@ class SnappingMain {
|
|
|
455
420
|
const {
|
|
456
421
|
bitIds,
|
|
457
422
|
warnings
|
|
458
|
-
} = await this.getComponentsToTag(
|
|
423
|
+
} = await this.getComponentsToTag(unmodified, exactVersion, persist, ids, snapped);
|
|
459
424
|
if (_ramda().default.isEmpty(bitIds)) return null;
|
|
460
425
|
|
|
461
426
|
const legacyBitIds = _bitId().BitIds.fromArray(bitIds);
|
|
@@ -494,11 +459,9 @@ class SnappingMain {
|
|
|
494
459
|
exactVersion: validExactVersion,
|
|
495
460
|
releaseType,
|
|
496
461
|
preRelease,
|
|
497
|
-
force,
|
|
498
462
|
consumer: this.workspace.consumer,
|
|
499
463
|
ignoreNewestVersion,
|
|
500
464
|
skipTests,
|
|
501
|
-
verbose,
|
|
502
465
|
skipAutoTag,
|
|
503
466
|
soft,
|
|
504
467
|
build,
|
|
@@ -541,14 +504,13 @@ class SnappingMain {
|
|
|
541
504
|
// @todo: change to ComponentID[]. pass only if have the ids already parsed.
|
|
542
505
|
resolveUnmerged = false,
|
|
543
506
|
message = '',
|
|
544
|
-
force = false,
|
|
545
|
-
verbose = false,
|
|
546
507
|
ignoreIssues,
|
|
547
508
|
skipTests = false,
|
|
548
509
|
skipAutoSnap = false,
|
|
549
510
|
build,
|
|
550
511
|
disableTagAndSnapPipelines = false,
|
|
551
|
-
forceDeploy = false
|
|
512
|
+
forceDeploy = false,
|
|
513
|
+
unmodified = false
|
|
552
514
|
}) {
|
|
553
515
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
554
516
|
if (id && legacyBitIds) throw new Error(`please pass either id or legacyBitIds, not both`);
|
|
@@ -578,10 +540,8 @@ class SnappingMain {
|
|
|
578
540
|
ignoreNewestVersion: false,
|
|
579
541
|
scope: this.workspace.scope.legacyScope,
|
|
580
542
|
message,
|
|
581
|
-
force,
|
|
582
543
|
consumer: this.workspace.consumer,
|
|
583
544
|
skipTests,
|
|
584
|
-
verbose,
|
|
585
545
|
skipAutoTag: skipAutoSnap,
|
|
586
546
|
persist: true,
|
|
587
547
|
soft: false,
|
|
@@ -609,7 +569,7 @@ class SnappingMain {
|
|
|
609
569
|
if (id && !idHasWildcard) {
|
|
610
570
|
const bitId = consumer.getParsedId(id);
|
|
611
571
|
|
|
612
|
-
if (!
|
|
572
|
+
if (!unmodified) {
|
|
613
573
|
const componentStatus = await consumer.getComponentStatusById(bitId); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
614
574
|
|
|
615
575
|
if (componentStatus.modified === false) return null;
|
|
@@ -618,10 +578,10 @@ class SnappingMain {
|
|
|
618
578
|
return new (_bitId().BitIds)(bitId);
|
|
619
579
|
}
|
|
620
580
|
|
|
621
|
-
const tagPendingComponents = await componentsList.
|
|
622
|
-
|
|
581
|
+
const tagPendingComponents = unmodified ? await componentsList.listPotentialTagAllWorkspace() : await componentsList.listTagPendingComponents();
|
|
623
582
|
if (_ramda().default.isEmpty(tagPendingComponents)) return null;
|
|
624
|
-
|
|
583
|
+
const bitIds = idHasWildcard ? _componentsList().default.filterComponentsByWildcard(tagPendingComponents, id) : tagPendingComponents;
|
|
584
|
+
return _bitId().BitIds.fromArray(bitIds);
|
|
625
585
|
}
|
|
626
586
|
}
|
|
627
587
|
|
|
@@ -739,7 +699,7 @@ class SnappingMain {
|
|
|
739
699
|
});
|
|
740
700
|
}
|
|
741
701
|
|
|
742
|
-
async getComponentsToTag(
|
|
702
|
+
async getComponentsToTag(includeUnmodified, exactVersion, persist, ids, snapped) {
|
|
743
703
|
const warnings = [];
|
|
744
704
|
const componentsList = new (_componentsList().default)(this.workspace.consumer);
|
|
745
705
|
|
|
@@ -751,7 +711,7 @@ class SnappingMain {
|
|
|
751
711
|
};
|
|
752
712
|
}
|
|
753
713
|
|
|
754
|
-
const tagPendingComponents =
|
|
714
|
+
const tagPendingComponents = includeUnmodified ? await componentsList.listPotentialTagAllWorkspace() : await componentsList.listTagPendingComponents();
|
|
755
715
|
const snappedComponents = await componentsList.listSnappedComponentsOnMain();
|
|
756
716
|
const snappedComponentsIds = snappedComponents.map(c => c.toBitId());
|
|
757
717
|
|
|
@@ -768,7 +728,7 @@ class SnappingMain {
|
|
|
768
728
|
|
|
769
729
|
const bitId = this.workspace.consumer.getParsedId(idWithoutVer);
|
|
770
730
|
|
|
771
|
-
if (!
|
|
731
|
+
if (!includeUnmodified) {
|
|
772
732
|
const componentStatus = await this.workspace.consumer.getComponentStatusById(bitId);
|
|
773
733
|
if (componentStatus.modified === false) return null;
|
|
774
734
|
}
|
|
@@ -790,7 +750,7 @@ class SnappingMain {
|
|
|
790
750
|
|
|
791
751
|
tagPendingComponents.push(...snappedComponentsIds);
|
|
792
752
|
|
|
793
|
-
if (
|
|
753
|
+
if (includeUnmodified && exactVersion) {
|
|
794
754
|
const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(tagPendingComponents, false);
|
|
795
755
|
tagPendingComponentsLatest.forEach(componentId => {
|
|
796
756
|
if (componentId.version && _semver().default.valid(componentId.version) && _semver().default.gt(componentId.version, exactVersion)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["snapping.main.runtime.ts"],"names":["HooksManagerInstance","HooksManager","getInstance","SnappingMain","constructor","workspace","logger","issues","insights","tag","ids","message","ver","all","editor","snapped","patch","minor","major","preRelease","force","verbose","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","build","soft","persist","forceDeploy","incrementBy","disableTagAndSnapPipelines","BUILD_ON_CI","Boolean","getVersion","length","BitError","releaseFlags","filter","x","releaseType","DEFAULT_BIT_RELEASE_TYPE","includeImported","exactVersion","ConsumerNotFound","idsHasWildcard","isAll","validExactVersion","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","consumerComponents","legacyScope","resolveUnmerged","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","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","depId","hasVersion","modelComp","getModelComponentIfExist","version","loadVersion","objects","concurrency","isAllScope","softTaggedComponents","listSoftTaggedComponents","listTagPendingOfAllScope","listSnappedComponentsOnMain","snappedComponentsIds","toBitId","idWithoutVer","allIds","changeVersion","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","InsightsAsp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a,EAA5F;AACD;AACF,OAJD;AAKD;;AAED,WAAO;AAAEY,MAAAA,MAAM,EAAE8D,oBAAoB,CAAC+B,GAArB,CAA0BrE,EAAD,IAAQA,EAAE,CAACwG,aAAH,CAAiBQ,SAAjB,CAAjC,CAAV;AAAyEvI,MAAAA;AAAzE,KAAP;AACD;;AAKoB,eAARwI,QAAQ,CAAC,CAAC5L,SAAD,EAAY6L,GAAZ,EAAiBC,SAAjB,EAA4BC,UAA5B,EAAwC7L,MAAxC,EAAgDC,QAAhD,CAAD,EAOlB;AACD,UAAMF,MAAM,GAAG8L,UAAU,CAACC,YAAX,CAAwBC,2BAAetH,EAAvC,CAAf;AACA,UAAMuH,QAAQ,GAAG,IAAIpM,YAAJ,CAAiBE,SAAjB,EAA4BC,MAA5B,EAAoCC,MAApC,EAA4CC,QAA5C,CAAjB;AACA,UAAMgM,OAAO,GAAG,KAAIC,kBAAJ,EAAYN,SAAS,CAACO,aAAV,EAAZ,EAAuCH,QAAvC,CAAhB;AACA,UAAMI,MAAM,GAAG,KAAIC,gBAAJ,EAAWT,SAAS,CAACO,aAAV,EAAX,EAAsCH,QAAtC,CAAf;AACAL,IAAAA,GAAG,CAACW,QAAJ,CAAaF,MAAb,EAAqBH,OAArB;AACA,WAAOD,QAAP;AACD;;AAlcuB;;;gCAAbpM,Y,WAibI,E;gCAjbJA,Y,kBAkbW,CAAC2M,oBAAD,EAAkBC,gBAAlB,EAA6BC,oBAA7B,EAA8CC,sBAA9C,EAA4DC,iBAA5D,EAA0EC,0BAA1E,C;gCAlbXhN,Y,aAmbMiN,kB;;AAkBnBd,2BAAee,UAAf,CAA0BlN,YAA1B;;eAEeA,Y","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { isString } from '@teambit/legacy/dist/utils';\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 ver,\n all = false,\n editor = '',\n snapped = false,\n patch,\n minor,\n major,\n preRelease,\n force = false,\n verbose = false,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n scope,\n build,\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 | string;\n ver?: 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 function getVersion(): string | undefined {\n if (scope && isString(scope)) return scope;\n if (all && isString(all)) return all;\n if (snapped && isString(snapped)) return snapped;\n return ver;\n }\n\n if (!ids.length && !all && !snapped && !scope && !persist) {\n throw new BitError('missing [id]. to tag all components, please use --all flag');\n }\n if (ids.length && all) {\n throw new BitError(\n 'you can use either a specific component [id] to tag a particular component or --all flag to tag them all'\n );\n }\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new BitError('you can use either force-deploy or disable-tag-pipeline, but not both');\n }\n if (all && persist) {\n throw new BitError('you can use either --all or --persist, 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 const includeImported = Boolean(scope && all);\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 = getVersion();\n all = Boolean(all);\n snapped = Boolean(snapped);\n preRelease = typeof preRelease === 'string' ? preRelease : '';\n\n if (!this.workspace) throw new ConsumerNotFound();\n const idsHasWildcard = hasWildcard(ids);\n const isAll = Boolean(all || scope || idsHasWildcard);\n const validExactVersion = validateVersion(exactVersion);\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n loader.start('determine components to tag...');\n const newComponents = await componentsList.listNewComponents();\n const { bitIds, warnings } = await this.getComponentsToTag(\n Boolean(scope),\n exactVersion,\n includeImported,\n persist,\n force,\n ids,\n snapped\n );\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 force,\n consumer: this.workspace.consumer,\n ignoreNewestVersion,\n skipTests,\n verbose,\n skipAutoTag,\n soft,\n build,\n persist,\n resolveUnmerged: false,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\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 force = false,\n verbose = false,\n ignoreIssues,\n skipTests = false,\n skipAutoSnap = false,\n build,\n disableTagAndSnapPipelines = false,\n forceDeploy = false,\n }: {\n id?: string;\n legacyBitIds?: BitIds;\n resolveUnmerged?: boolean;\n message?: string;\n force?: boolean;\n verbose?: boolean;\n ignoreIssues?: string;\n build: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableTagAndSnapPipelines?: boolean;\n forceDeploy?: 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 force,\n consumer: this.workspace.consumer,\n skipTests,\n verbose,\n skipAutoTag: skipAutoSnap,\n persist: true,\n soft: false,\n build,\n resolveUnmerged,\n isSnap: true,\n disableTagAndSnapPipelines,\n forceDeploy,\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> {\n const idHasWildcard = id && hasWildcard(id);\n if (id && !idHasWildcard) {\n const bitId = consumer.getParsedId(id);\n if (!force) {\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 = await componentsList.listTagPendingComponents();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(tagPendingComponents)) return null;\n return idHasWildcard ? ComponentsList.filterComponentsByWildcard(tagPendingComponents, id) : tagPendingComponents;\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 isAllScope: boolean,\n exactVersion: string | undefined,\n includeImported: boolean,\n persist: boolean,\n force: 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 = isAllScope\n ? await componentsList.listTagPendingOfAllScope(includeImported)\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 (!force) {\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 (isAllScope && 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);\n const tagCmd = new TagCmd(community.getBaseDomain(), snapping);\n cli.register(tagCmd, snapCmd);\n return snapping;\n }\n}\n\nSnappingAspect.addRuntime(SnappingMain);\n\nexport default SnappingMain;\n"]}
|
|
1
|
+
{"version":3,"sources":["snapping.main.runtime.ts"],"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","BUILD_ON_CI","Boolean","BitError","releaseFlags","filter","x","length","releaseType","DEFAULT_BIT_RELEASE_TYPE","exactVersion","ConsumerNotFound","idsHasWildcard","isAll","validExactVersion","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","consumerComponents","scope","legacyScope","resolveUnmerged","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","concurrency","includeUnmodified","softTaggedComponents","listSoftTaggedComponents","listSnappedComponentsOnMain","snappedComponentsIds","toBitId","idWithoutVer","allIds","changeVersion","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA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,SAAS,CAACO,aAAV,EAAZ,EAAuCH,QAAvC,CAAhB;AACA,UAAMI,MAAM,GAAG,KAAIC,gBAAJ,EAAWT,SAAS,CAACO,aAAV,EAAX,EAAsCH,QAAtC,CAAf;AACAL,IAAAA,GAAG,CAACW,QAAJ,CAAaF,MAAb,EAAqBH,OAArB;AACA,WAAOD,QAAP;AACD;;AA9ZuB;;;gCAAbhM,Y,WA6YI,E;gCA7YJA,Y,kBA8YW,CAACuM,oBAAD,EAAkBC,gBAAlB,EAA6BC,oBAA7B,EAA8CC,sBAA9C,EAA4DC,iBAA5D,EAA0EC,0BAA1E,C;gCA9YX5M,Y,aA+YM6M,kB;;AAkBnBd,2BAAee,UAAf,CAA0B9M,YAA1B;;eAEeA,Y","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 });\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 });\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);\n const tagCmd = new TagCmd(community.getBaseDomain(), snapping);\n cli.register(tagCmd, snapCmd);\n return snapping;\n }\n}\n\nSnappingAspect.addRuntime(SnappingMain);\n\nexport default SnappingMain;\n"]}
|
package/dist/tag-cmd.d.ts
CHANGED
|
@@ -13,10 +13,11 @@ export declare class TagCmd implements Command {
|
|
|
13
13
|
migration: boolean;
|
|
14
14
|
remoteOp: boolean;
|
|
15
15
|
constructor(docsDomain: string, snapping: SnappingMain);
|
|
16
|
-
report([id]: [string[]], { message, ver, all, editor, snapped, patch, minor, major, preRelease, force,
|
|
16
|
+
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, }: {
|
|
17
17
|
all?: boolean | string;
|
|
18
|
-
snapped?: boolean
|
|
18
|
+
snapped?: boolean;
|
|
19
19
|
ver?: string;
|
|
20
|
+
force?: boolean;
|
|
20
21
|
patch?: boolean;
|
|
21
22
|
minor?: boolean;
|
|
22
23
|
major?: boolean;
|
package/dist/tag-cmd.js
CHANGED
|
@@ -73,12 +73,13 @@ class TagCmd {
|
|
|
73
73
|
(0, _defineProperty2().default)(this, "description", void 0);
|
|
74
74
|
(0, _defineProperty2().default)(this, "alias", 't');
|
|
75
75
|
(0, _defineProperty2().default)(this, "loader", true);
|
|
76
|
-
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['
|
|
76
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['', 'unmodified', 'include unmodified components (by default, only new and modified components are tagged)'], ['', 'editor [editor]', 'EXPERIMENTAL. open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim'], ['v', 'ver <version>', 'tag with the given version'], ['p', 'patch', 'increment the patch version number'], ['', 'minor', 'increment the minor version number'], ['', 'major', 'increment the major version number'], ['', 'snapped', 'tag components that their head is a snap (not a tag)'], ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'], ['', '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:
|
|
77
77
|
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
78
|
-
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`]]);
|
|
78
|
+
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']]);
|
|
79
79
|
(0, _defineProperty2().default)(this, "migration", true);
|
|
80
80
|
(0, _defineProperty2().default)(this, "remoteOp", true);
|
|
81
81
|
this.description = `record component changes and lock versions.
|
|
82
|
+
if no ids are provided, it will tag all new and modified components.
|
|
82
83
|
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
|
|
83
84
|
https://${docsDomain}/components/tags
|
|
84
85
|
${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
@@ -95,13 +96,13 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
95
96
|
major,
|
|
96
97
|
preRelease,
|
|
97
98
|
force = false,
|
|
98
|
-
verbose = false,
|
|
99
99
|
ignoreUnresolvedDependencies,
|
|
100
100
|
ignoreIssues,
|
|
101
101
|
ignoreNewestVersion = false,
|
|
102
102
|
skipTests = false,
|
|
103
103
|
skipAutoTag = false,
|
|
104
104
|
scope,
|
|
105
|
+
unmodified = false,
|
|
105
106
|
build,
|
|
106
107
|
soft = false,
|
|
107
108
|
persist = false,
|
|
@@ -118,16 +119,43 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
118
119
|
throw new Error(`--ignore-issues expects issues to be ignored, please run "bit tag -h" for the issues list`);
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
if (disableTagPipeline) {
|
|
123
|
+
// eslint-disable-next-line no-console
|
|
124
|
+
console.warn(_chalk().default.yellow(`--disable-tag-pipeline is deprecated, please use --disable-deploy-pipeline instead`));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (all) {
|
|
128
|
+
// eslint-disable-next-line no-console
|
|
129
|
+
console.warn(_chalk().default.yellow(`--all is deprecated, please omit it. "bit tag" by default will tag all new and modified components. to specify a version, use --ver flag`));
|
|
130
|
+
|
|
131
|
+
if (typeof all === 'string') {
|
|
132
|
+
ver = all;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (scope) {
|
|
137
|
+
// eslint-disable-next-line no-console
|
|
138
|
+
console.warn(_chalk().default.yellow(`--scope is deprecated, use --unmodified instead`));
|
|
139
|
+
unmodified = true;
|
|
140
|
+
|
|
141
|
+
if (typeof scope === 'string') {
|
|
142
|
+
ver = scope;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (force) {
|
|
147
|
+
// eslint-disable-next-line no-console
|
|
148
|
+
console.warn(_chalk().default.yellow(`--force is deprecated, use either --skip-tests or --unmodified depending on the use case`));
|
|
149
|
+
if (id.length) unmodified = true;
|
|
150
|
+
}
|
|
151
|
+
|
|
121
152
|
const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;
|
|
122
153
|
const params = {
|
|
123
154
|
ids: id,
|
|
124
|
-
all,
|
|
125
155
|
snapped,
|
|
126
156
|
editor,
|
|
127
157
|
message,
|
|
128
158
|
preRelease,
|
|
129
|
-
force,
|
|
130
|
-
verbose,
|
|
131
159
|
ignoreIssues,
|
|
132
160
|
ignoreNewestVersion,
|
|
133
161
|
skipTests,
|
|
@@ -135,11 +163,11 @@ ${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
|
135
163
|
build,
|
|
136
164
|
soft,
|
|
137
165
|
persist,
|
|
138
|
-
|
|
166
|
+
unmodified,
|
|
139
167
|
disableTagAndSnapPipelines,
|
|
140
168
|
forceDeploy,
|
|
141
169
|
incrementBy,
|
|
142
|
-
ver,
|
|
170
|
+
version: ver,
|
|
143
171
|
patch,
|
|
144
172
|
minor,
|
|
145
173
|
major
|
package/dist/tag-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tag-cmd.ts"],"names":["TagCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","report","id","message","ver","all","editor","snapped","patch","minor","major","preRelease","force","verbose","ignoreUnresolvedDependencies","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","build","soft","persist","disableDeployPipeline","disableTagPipeline","forceDeploy","incrementBy","Error","disableTagAndSnapPipelines","params","ids","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","filter","component","searchWithoutVersion","addedComponents","autoTaggedCount","length","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,MAAN,CAAgC;AA+CpB;AAEjBC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDAhDzD,aAgDyD;AAAA,mDA/CxD,aA+CwD;AAAA,8DA9C7C,4CA8C6C;AAAA;AAAA,mDA5CxD,GA4CwD;AAAA,oDA3CvD,IA2CuD;AAAA,qDA1CtD,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,GAAD,EAAM,eAAN,EAAuB,qCAAvB,CAFQ,EAGR,CAAC,GAAD,EAAM,iBAAN,EAAyB,yCAAzB,CAHQ,EAIR,CACE,EADF,EAEE,iBAFF,EAGE,yHAHF,CAJQ,EASR,CAAC,EAAD,EAAK,mBAAL,EAA0B,sDAA1B,CATQ,EAUR,CAAC,EAAD,EAAK,eAAL,EAAsB,iDAAtB,CAVQ,EAWR,CAAC,GAAD,EAAM,OAAN,EAAe,oCAAf,CAXQ,EAYR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAZQ,EAaR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAbQ,EAcR,CAAC,EAAD,EAAK,0BAAL,EAAiC,kEAAjC,CAdQ,EAeR,CAAC,GAAD,EAAM,OAAN,EAAe,6EAAf,CAfQ,EAgBR,CAAC,GAAD,EAAM,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AAM0B,WAAW,GAAG9C,OAAO,CAACoB,SAAR,GAChB,2CADgB,GAEhB,oCAFJ;AAGA,UAAM2B,oBAAoB,GAAG/C,OAAO,CAACoB,SAAR,GACzBlB,iBAAM8C,IAAN,CACE,iHADF,CADyB,GAIzB,EAJJ;AAKA,WACEhC,cAAc,GACdd,iBAAMkC,KAAN,CACG,GAAE/B,gBAAgB,CAACU,MAAjB,GAA0BD,eAAgB,iBAAgBd,OAAO,CAACoB,SAAR,GAAoB,OAApB,GAA8B,EAAG,QADhG,CADA,GAIAD,cAJA,GAKAqB,cAAc,CAAC,gBAAD,EAAmBK,OAAnB,EAA4BhC,eAA5B,CALd,GAMA2B,cAAc,CAAC,oBAAD,EAAuBM,WAAvB,EAAoCrC,iBAApC,CANd,GAOAwB,aAAa,EAPb,GAQAc,oBATF;AAWD;;AA3MoC","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 { SnappingMain } from './snapping.main.runtime';\n\nexport class TagCmd implements Command {\n name = 'tag [id...]';\n group = 'development';\n shortDescription = 'record component changes and lock versions';\n description: string;\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'log message describing the user changes'],\n ['a', 'all [version]', 'tag all new and modified components'],\n ['s', 'scope [version]', 'tag all components of the current scope'],\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 ['', 'snapped [version]', 'tag components that their head is a snap (not a tag)'],\n ['', 'ver <version>', 'tag specified components 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 ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'],\n ['f', 'force', 'force-tag even if tests are failing and even when component has not changed'],\n ['v', 'verbose', 'show specs output on failure'],\n ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'],\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-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'],\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 ] as CommandOptions;\n migration = true;\n remoteOp = true; // In case a compiler / tester is not installed\n\n constructor(docsDomain: string, private snapping: SnappingMain) {\n this.description = `record component changes and lock versions.\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 verbose = false,\n ignoreUnresolvedDependencies,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n scope,\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 | string;\n ver?: string;\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 Error(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);\n }\n if (ignoreIssues && typeof ignoreIssues === 'boolean') {\n throw new Error(`--ignore-issues expects issues to be ignored, please run \"bit tag -h\" for the issues list`);\n }\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n\n const params = {\n ids: id,\n all,\n snapped,\n editor,\n message,\n preRelease,\n force,\n verbose,\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n build,\n soft,\n persist,\n scope,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n 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"]}
|
|
1
|
+
{"version":3,"sources":["tag-cmd.ts"],"names":["TagCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","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","Error","console","warn","chalk","yellow","length","disableTagAndSnapPipelines","params","ids","version","results","tag","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,MAAN,CAAgC;AAuDpB;AAEjBC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDAxDzD,aAwDyD;AAAA,mDAvDxD,aAuDwD;AAAA,8DAtD7C,4CAsD6C;AAAA;AAAA,mDApDxD,GAoDwD;AAAA,oDAnDvD,IAmDuD;AAAA,qDAlDtD,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,EAAD,EAAK,YAAL,EAAmB,yFAAnB,CAFQ,EAGR,CACE,EADF,EAEE,iBAFF,EAGE,yHAHF,CAHQ,EAQR,CAAC,GAAD,EAAM,eAAN,EAAuB,4BAAvB,CARQ,EASR,CAAC,GAAD,EAAM,OAAN,EAAe,oCAAf,CATQ,EAUR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAVQ,EAWR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAXQ,EAYR,CAAC,EAAD,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B,cAAc,CAAC,gBAAD,EAAmBK,OAAnB,EAA4B/B,eAA5B,CALd,GAMA0B,cAAc,CAAC,oBAAD,EAAuBM,WAAvB,EAAoCpC,iBAApC,CANd,GAOAuB,aAAa,EAPb,GAQAc,oBATF;AAWD;;AAjPoC","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 { SnappingMain } from './snapping.main.runtime';\n\nexport class TagCmd implements Command {\n name = 'tag [id...]';\n group = 'development';\n shortDescription = 'record component changes and lock versions';\n description: 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\n constructor(docsDomain: string, private snapping: SnappingMain) {\n this.description = `record component changes and lock versions.\nif 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 Error(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);\n }\n if (ignoreIssues && typeof ignoreIssues === 'boolean') {\n throw new Error(`--ignore-issues expects issues to be ignored, please run \"bit tag -h\" for the issues list`);\n }\n if (disableTagPipeline) {\n // eslint-disable-next-line no-console\n console.warn(chalk.yellow(`--disable-tag-pipeline is deprecated, please use --disable-deploy-pipeline instead`));\n }\n if (all) {\n // eslint-disable-next-line no-console\n console.warn(\n chalk.yellow(\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 );\n if (typeof all === 'string') {\n ver = all;\n }\n }\n if (scope) {\n // eslint-disable-next-line no-console\n console.warn(chalk.yellow(`--scope is deprecated, use --unmodified instead`));\n unmodified = true;\n if (typeof scope === 'string') {\n ver = scope;\n }\n }\n if (force) {\n // eslint-disable-next-line no-console\n console.warn(\n chalk.yellow(`--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"]}
|
|
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.25",
|
|
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.25"
|
|
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.18",
|
|
22
|
+
"@teambit/cli": "0.0.472",
|
|
23
23
|
"@teambit/component-issues": "0.0.50",
|
|
24
|
-
"@teambit/community": "0.0.
|
|
25
|
-
"@teambit/insights": "0.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/workspace": "0.0.
|
|
24
|
+
"@teambit/community": "0.0.20",
|
|
25
|
+
"@teambit/insights": "0.0.710",
|
|
26
|
+
"@teambit/logger": "0.0.564",
|
|
27
|
+
"@teambit/workspace": "0.0.710"
|
|
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.710",
|
|
41
41
|
"@teambit/component.testing.mock-components": "0.0.5",
|
|
42
42
|
"@teambit/harmony.testing.load-aspect": "0.0.5",
|
|
43
43
|
"@teambit/workspace.testing.mock-workspace": "0.0.4"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@teambit/legacy": "1.0.
|
|
46
|
+
"@teambit/legacy": "1.0.251",
|
|
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.251",
|
|
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
|