@teambit/snapping 1.0.834 → 1.0.836
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/reset-cmd.d.ts
CHANGED
|
@@ -14,11 +14,13 @@ export default class ResetCmd implements Command {
|
|
|
14
14
|
options: CommandOptions;
|
|
15
15
|
loader: boolean;
|
|
16
16
|
constructor(snapping: SnappingMain);
|
|
17
|
-
report([pattern]: [string], { all, head, force, soft, neverExported, }: {
|
|
17
|
+
report([pattern]: [string], { all, head, force, soft, silent, neverExported, }: {
|
|
18
18
|
all?: boolean;
|
|
19
19
|
head?: boolean;
|
|
20
20
|
force?: boolean;
|
|
21
21
|
soft?: boolean;
|
|
22
|
+
silent?: boolean;
|
|
22
23
|
neverExported?: boolean;
|
|
23
24
|
}): Promise<string>;
|
|
25
|
+
private promptForResetAll;
|
|
24
26
|
}
|
package/dist/reset-cmd.js
CHANGED
|
@@ -18,6 +18,13 @@ function _chalk() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _yesno() {
|
|
22
|
+
const data = _interopRequireDefault(require("yesno"));
|
|
23
|
+
_yesno = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
function _legacy() {
|
|
22
29
|
const data = require("@teambit/legacy.constants");
|
|
23
30
|
_legacy = function () {
|
|
@@ -40,10 +47,11 @@ class ResetCmd {
|
|
|
40
47
|
}]);
|
|
41
48
|
_defineProperty(this, "group", 'version-control');
|
|
42
49
|
_defineProperty(this, "extendedDescription", `removes local component versions (tags/snaps) that haven't been exported yet.
|
|
43
|
-
|
|
50
|
+
if no component-pattern is provided, resets all components (with confirmation prompt).
|
|
51
|
+
by default reverts all local versions of each component. use --head to revert only the latest version.
|
|
44
52
|
useful for undoing mistakes before exporting. exported versions cannot be reset.`);
|
|
45
53
|
_defineProperty(this, "alias", '');
|
|
46
|
-
_defineProperty(this, "options", [['a', 'all', '
|
|
54
|
+
_defineProperty(this, "options", [['a', 'all', 'DEPRECATED. this is now the default behavior when no component-pattern is provided'], ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'], ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'], ['f', 'force', "revert the tag even if it's used as a dependency. WARNING: components that depend on this tag will be corrupted"], ['', 'never-exported', 'reset only components that were never exported'], ['s', 'silent', 'skip confirmation when resetting all components']]);
|
|
47
55
|
_defineProperty(this, "loader", true);
|
|
48
56
|
}
|
|
49
57
|
async report([pattern], {
|
|
@@ -51,21 +59,20 @@ useful for undoing mistakes before exporting. exported versions cannot be reset.
|
|
|
51
59
|
head = false,
|
|
52
60
|
force = false,
|
|
53
61
|
soft = false,
|
|
62
|
+
silent = false,
|
|
54
63
|
neverExported = false
|
|
55
64
|
}) {
|
|
56
65
|
if (neverExported) {
|
|
57
66
|
const compIds = await this.snapping.resetNeverExported();
|
|
58
67
|
return _chalk().default.green(`successfully reset the following never-exported components:\n${compIds.join('\n')}`);
|
|
59
68
|
}
|
|
60
|
-
if (!pattern && !all) {
|
|
61
|
-
throw new (_bitError().BitError)('please specify a component-pattern or use --all flag');
|
|
62
|
-
}
|
|
63
|
-
if (pattern && all) {
|
|
64
|
-
throw new (_bitError().BitError)('please specify either a component-pattern or --all flag, not both');
|
|
65
|
-
}
|
|
66
69
|
if (soft && head) {
|
|
67
70
|
throw new (_bitError().BitError)('please specify either --soft or --head flag, not both');
|
|
68
71
|
}
|
|
72
|
+
// if no pattern provided, reset all components (with confirmation unless --silent or --all)
|
|
73
|
+
if (!pattern && !silent && !all) {
|
|
74
|
+
await this.promptForResetAll();
|
|
75
|
+
}
|
|
69
76
|
const {
|
|
70
77
|
results,
|
|
71
78
|
isSoftUntag
|
|
@@ -77,6 +84,15 @@ useful for undoing mistakes before exporting. exported versions cannot be reset.
|
|
|
77
84
|
});
|
|
78
85
|
return title + components.join('\n');
|
|
79
86
|
}
|
|
87
|
+
async promptForResetAll() {
|
|
88
|
+
this.snapping.logger.clearStatusLine();
|
|
89
|
+
const ok = await (0, _yesno().default)({
|
|
90
|
+
question: `${_chalk().default.bold('This will reset all local tags/snaps for all components. Would you like to proceed? [yes(y)/no(n)]')}`
|
|
91
|
+
});
|
|
92
|
+
if (!ok) {
|
|
93
|
+
throw new (_bitError().BitError)('the operation has been canceled');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
exports.default = ResetCmd;
|
|
82
98
|
|
package/dist/reset-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ResetCmd","constructor","snapping","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","head","force","soft","neverExported","compIds","resetNeverExported","chalk","green","join","BitError","results","isSoftUntag","reset","titleSuffix","title","length","components","map","result","cyan","id","toStringWithoutVersion","versions","exports"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert local tags and snaps to previous versions';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'version-control';\n extendedDescription = `removes local component versions (tags/snaps) that haven't been exported yet.\nby default reverts all local versions. use --head to revert only the latest version.\nuseful for undoing mistakes before exporting. exported versions cannot be reset.`;\n alias = '';\n options = [\n ['a', 'all', '
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","_yesno","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ResetCmd","constructor","snapping","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","head","force","soft","silent","neverExported","compIds","resetNeverExported","chalk","green","join","BitError","promptForResetAll","results","isSoftUntag","reset","titleSuffix","title","length","components","map","result","cyan","id","toStringWithoutVersion","versions","logger","clearStatusLine","ok","yesno","question","bold","exports"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert local tags and snaps to previous versions';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'version-control';\n extendedDescription = `removes local component versions (tags/snaps) that haven't been exported yet.\nif no component-pattern is provided, resets all components (with confirmation prompt).\nby default reverts all local versions of each component. use --head to revert only the latest version.\nuseful for undoing mistakes before exporting. exported versions cannot be reset.`;\n alias = '';\n options = [\n ['a', 'all', 'DEPRECATED. this is now the default behavior when no component-pattern is provided'],\n ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'],\n ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'],\n [\n 'f',\n 'force',\n \"revert the tag even if it's used as a dependency. WARNING: components that depend on this tag will be corrupted\",\n ],\n ['', 'never-exported', 'reset only components that were never exported'],\n ['s', 'silent', 'skip confirmation when resetting all components'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private snapping: SnappingMain) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n head = false,\n force = false,\n soft = false,\n silent = false,\n neverExported = false,\n }: { all?: boolean; head?: boolean; force?: boolean; soft?: boolean; silent?: boolean; neverExported?: boolean }\n ) {\n if (neverExported) {\n const compIds = await this.snapping.resetNeverExported();\n return chalk.green(`successfully reset the following never-exported components:\\n${compIds.join('\\n')}`);\n }\n if (soft && head) {\n throw new BitError('please specify either --soft or --head flag, not both');\n }\n // if no pattern provided, reset all components (with confirmation unless --silent or --all)\n if (!pattern && !silent && !all) {\n await this.promptForResetAll();\n }\n const { results, isSoftUntag } = await this.snapping.reset(pattern, head, force, soft);\n const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidates for tagging any more)' : 'reset';\n const title = chalk.green(`${results.length} component(s) were ${titleSuffix}:\\n`);\n const components = results.map((result) => {\n return `${chalk.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;\n });\n return title + components.join('\\n');\n }\n\n private async promptForResetAll() {\n this.snapping.logger.clearStatusLine();\n const ok = await yesno({\n question: `${chalk.bold('This will reset all local tags/snaps for all components. Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,C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MAAM,IAAK;MACzC,OAAO,GAAGb,gBAAK,CAACc,IAAI,CAACD,MAAM,CAACE,EAAE,CAACC,sBAAsB,CAAC,CAAC,CAAC,iBAAiBH,MAAM,CAACI,QAAQ,CAACf,IAAI,CAAC,IAAI,CAAC,EAAE;IACvG,CAAC,CAAC;IACF,OAAOO,KAAK,GAAGE,UAAU,CAACT,IAAI,CAAC,IAAI,CAAC;EACtC;EAEA,MAAcE,iBAAiBA,CAAA,EAAG;IAChC,IAAI,CAAClB,QAAQ,CAACgC,MAAM,CAACC,eAAe,CAAC,CAAC;IACtC,MAAMC,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE,GAAGtB,gBAAK,CAACuB,IAAI,CAAC,oGAAoG,CAAC;IAC/H,CAAC,CAAC;IACF,IAAI,CAACH,EAAE,EAAE;MACP,MAAM,KAAIjB,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACqB,OAAA,CAAA3D,OAAA,GAAAmB,QAAA","ignoreList":[]}
|
package/dist/snap-cmd.js
CHANGED
|
@@ -123,7 +123,7 @@ function snapResultOutput(results) {
|
|
|
123
123
|
const totalCount = totalComponentsCount ?? snappedComponents.length + autoTaggedCount;
|
|
124
124
|
const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
|
|
125
125
|
const snapExplanation = `\n(use "bit export" to push these components to a remote")
|
|
126
|
-
(use "bit reset
|
|
126
|
+
(use "bit reset" to unstage all local versions, or "bit reset --head" to only unstage the latest local snap)`;
|
|
127
127
|
const compInBold = id => {
|
|
128
128
|
const version = id.hasVersion() ? `@${id.version}` : '';
|
|
129
129
|
return `${_chalk().default.bold(id.toStringWithoutVersion())}${version}`;
|
package/dist/snap-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_legacy","_tagCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","detachHead","loose","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snapResultOutput","exports","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","totalComponentsCount","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","totalCount","warningsOutput","snapExplanation","compInBold","version","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","outputIdsIfExists","green"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport {\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport type { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport type { BasicTagSnapParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create immutable component snapshots for development versions';\n extendedDescription = `creates snapshots with hash-based versions for development and testing. snapshots are immutable and exportable.\nby default snaps only new and modified components. use for development iterations before creating semantic version tags.\nsnapshots maintain component history and enable collaboration without formal releases.`;\n group = 'version-control';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, only new and modified components are snapped (add --unmodified to snap all components in the workspace).`,\n },\n ];\n helpUrl = 'reference/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'snap message describing the latest changes - will appear in component history log'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the snap'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a snap message per component. optionally specify the editor-name (defaults to vim).',\n ],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n [\n '',\n 'disable-snap-pipeline',\n 'skip the snap pipeline. this will for instance skip packing and publishing component version for install, and app deployment',\n ],\n ['', 'ignore-build-errors', 'proceed to snap pipeline even when build pipeline fails'],\n ['', 'loose', 'allow snap --build to succeed even if tasks like tests or lint fail'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, snap it without changing the head',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipTasks,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n unmodified = false,\n failFast = false,\n detachHead,\n loose = false,\n }: {\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap, will be displayed in the version history`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipTasks,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n unmodified,\n exitOnFirstFailedTask: failFast,\n detachHead,\n loose,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n return snapResultOutput(results);\n }\n}\n\nexport function snapResultOutput(results: SnapResults): string {\n const {\n snappedComponents,\n autoSnappedResults,\n warnings,\n newComponents,\n laneName,\n removedComponents,\n totalComponentsCount,\n }: SnapResults = results;\n const changedComponents = snappedComponents.filter((component) => {\n return !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id);\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\n const totalCount = totalComponentsCount ?? snappedComponents.length + autoTaggedCount;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const snapExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset --all\" to unstage all local versions, or \"bit reset --head\" to only unstage the latest local snap)`;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_SNAPPED_MSG} (${autoTagComp.length} total):\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n const laneStr = laneName ? ` on \"${laneName}\" lane` : '';\n\n return (\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n warningsOutput +\n chalk.green(`\\n${totalCount} component(s) snapped${laneStr}`) +\n snapExplanation\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAK,QAAA;EAAA,M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,WAAW,GAAGH,OAAO,CAACF,GAAG,CAAEM,CAAC,IAAKb,UAAU,CAACa,CAAC,CAACtB,SAAS,CAACE,EAAE,CAAC,CAAC;QAClEe,eAAe,IAAI,YAAYM,0BAAgB,KAAKF,WAAW,CAAChB,MAAM;AAChF,YAAYgB,WAAW,CAAC7D,IAAI,CAAC,gBAAgB,CAAC,EAAE;MACxC;MACA,OAAOyD,eAAe;IACxB,CAAC,CAAC,CACDzD,IAAI,CAAC,IAAI,CAAC;EACf,CAAC;EAED,MAAMgE,cAAc,GAAGA,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;IACzD,IAAI,CAACA,UAAU,CAACtB,MAAM,EAAE,OAAO,EAAE;IACjC,OAAO,KAAKnB,gBAAK,CAAC0C,SAAS,CAACH,KAAK,CAAC,MAAMC,WAAW,MAAMZ,gBAAgB,CAACa,UAAU,CAAC,IAAI;EAC3F,CAAC;EACD,MAAME,OAAO,GAAGlC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;EAExD,OACE6B,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAErB,eAAe,CAAC,GACjFqB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAE1B,iBAAiB,CAAC,GAC7F,IAAAgC,2BAAiB,EAAC,oBAAoB,EAAElC,iBAAiB,CAAC,GAC1DW,cAAc,GACdrB,gBAAK,CAAC6C,KAAK,CAAC,KAAKzB,UAAU,wBAAwBuB,OAAO,EAAE,CAAC,GAC7DrB,eAAe;AAEnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_legacy","_tagCmd","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SnapCmd","constructor","snapping","logger","configStore","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","detachHead","loose","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snapResultOutput","exports","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","totalComponentsCount","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","totalCount","warningsOutput","snapExplanation","compInBold","version","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","outputIdsIfExists","green"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport {\n NOTHING_TO_SNAP_MSG,\n AUTO_SNAPPED_MSG,\n COMPONENT_PATTERN_HELP,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport type { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport type { BasicTagSnapParams } from './version-maker';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create immutable component snapshots for development versions';\n extendedDescription = `creates snapshots with hash-based versions for development and testing. snapshots are immutable and exportable.\nby default snaps only new and modified components. use for development iterations before creating semantic version tags.\nsnapshots maintain component history and enable collaboration without formal releases.`;\n group = 'version-control';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, only new and modified components are snapped (add --unmodified to snap all components in the workspace).`,\n },\n ];\n helpUrl = 'reference/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'snap message describing the latest changes - will appear in component history log'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'locally run the build pipeline (i.e. not via rippleCI) and complete the snap'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a snap message per component. optionally specify the editor-name (defaults to vim).',\n ],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'skip-auto-snap', 'skip auto snapping dependents'],\n [\n '',\n 'disable-snap-pipeline',\n 'skip the snap pipeline. this will for instance skip packing and publishing component version for install, and app deployment',\n ],\n ['', 'ignore-build-errors', 'proceed to snap pipeline even when build pipeline fails'],\n ['', 'loose', 'allow snap --build to succeed even if tasks like tests or lint fail'],\n ['', 'rebuild-deps-graph', 'do not reuse the saved dependencies graph, instead build it from scratch'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n [\n '',\n 'detach-head',\n 'UNSUPPORTED YET. in case a component is checked out to an older version, snap it without changing the head',\n ],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipTasks,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n rebuildDepsGraph,\n unmodified = false,\n failFast = false,\n detachHead,\n loose = false,\n }: {\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap, will be displayed in the version history`\n );\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipTasks,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n rebuildDepsGraph,\n unmodified,\n exitOnFirstFailedTask: failFast,\n detachHead,\n loose,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n return snapResultOutput(results);\n }\n}\n\nexport function snapResultOutput(results: SnapResults): string {\n const {\n snappedComponents,\n autoSnappedResults,\n warnings,\n newComponents,\n laneName,\n removedComponents,\n totalComponentsCount,\n }: SnapResults = results;\n const changedComponents = snappedComponents.filter((component) => {\n return !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id);\n });\n const addedComponents = snappedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoSnappedResults ? autoSnappedResults.length : 0;\n const totalCount = totalComponentsCount ?? snappedComponents.length + autoTaggedCount;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const snapExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage all local versions, or \"bit reset --head\" to only unstage the latest local snap)`;\n\n const compInBold = (id: ComponentID) => {\n const version = id.hasVersion() ? `@${id.version}` : '';\n return `${chalk.bold(id.toStringWithoutVersion())}${version}`;\n };\n\n const outputComponents = (comps: ConsumerComponent[]) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${compInBold(component.id)}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => compInBold(a.component.id));\n componentOutput += `\\n ${AUTO_SNAPPED_MSG} (${autoTagComp.length} total):\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n const laneStr = laneName ? ` on \"${laneName}\" lane` : '';\n\n return (\n outputIfExists('new components', 'first version for components', addedComponents) +\n outputIfExists('changed components', 'components that got a version bump', changedComponents) +\n outputIdsIfExists('removed components', removedComponents) +\n warningsOutput +\n chalk.green(`\\n${totalCount} component(s) snapped${laneStr}`) +\n snapExplanation\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GA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F,YAAYgB,WAAW,CAAC7D,IAAI,CAAC,gBAAgB,CAAC,EAAE;MACxC;MACA,OAAOyD,eAAe;IACxB,CAAC,CAAC,CACDzD,IAAI,CAAC,IAAI,CAAC;EACf,CAAC;EAED,MAAMgE,cAAc,GAAGA,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;IACzD,IAAI,CAACA,UAAU,CAACtB,MAAM,EAAE,OAAO,EAAE;IACjC,OAAO,KAAKnB,gBAAK,CAAC0C,SAAS,CAACH,KAAK,CAAC,MAAMC,WAAW,MAAMZ,gBAAgB,CAACa,UAAU,CAAC,IAAI;EAC3F,CAAC;EACD,MAAME,OAAO,GAAGlC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;EAExD,OACE6B,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAErB,eAAe,CAAC,GACjFqB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAE1B,iBAAiB,CAAC,GAC7F,IAAAgC,2BAAiB,EAAC,oBAAoB,EAAElC,iBAAiB,CAAC,GAC1DW,cAAc,GACdrB,gBAAK,CAAC6C,KAAK,CAAC,KAAKzB,UAAU,wBAAwBuB,OAAO,EAAE,CAAC,GAC7DrB,eAAe;AAEnB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/snapping",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.836",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/snapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "snapping",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.836"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphlib": "2.1.8",
|
|
@@ -15,51 +15,52 @@
|
|
|
15
15
|
"fs-extra": "10.0.0",
|
|
16
16
|
"open-editor": "3.0.0",
|
|
17
17
|
"chalk": "4.1.2",
|
|
18
|
+
"yesno": "0.4.0",
|
|
18
19
|
"p-map": "4.0.0",
|
|
19
20
|
"semver": "7.7.1",
|
|
20
21
|
"uuid": "8.3.2",
|
|
21
22
|
"@teambit/bit-error": "0.0.404",
|
|
22
23
|
"@teambit/component-id": "1.2.4",
|
|
23
24
|
"@teambit/graph.cleargraph": "0.0.11",
|
|
24
|
-
"@teambit/toolbox.promise.map-pool": "0.0.10",
|
|
25
|
-
"@teambit/legacy-bit-id": "1.1.3",
|
|
26
|
-
"@teambit/legacy.logger": "0.0.31",
|
|
27
|
-
"@teambit/legacy.loader": "0.0.14",
|
|
28
|
-
"@teambit/legacy.constants": "0.0.20",
|
|
29
|
-
"@teambit/component-issues": "0.0.166",
|
|
30
|
-
"@teambit/harmony": "0.4.7",
|
|
31
|
-
"@teambit/component-version": "1.0.4",
|
|
32
|
-
"@teambit/harmony.modules.concurrency": "0.0.21",
|
|
33
|
-
"@teambit/lane-id": "0.0.312",
|
|
34
|
-
"@teambit/pkg.modules.semver-helper": "0.0.18",
|
|
35
|
-
"@teambit/toolbox.crypto.sha1": "0.0.11",
|
|
36
|
-
"@teambit/graph": "1.0.834",
|
|
37
25
|
"@teambit/legacy.consumer-component": "0.0.91",
|
|
38
26
|
"@teambit/logger": "0.0.1383",
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/scope": "1.0.834",
|
|
27
|
+
"@teambit/toolbox.promise.map-pool": "0.0.10",
|
|
41
28
|
"@teambit/component.sources": "0.0.142",
|
|
42
|
-
"@teambit/component": "1.0.834",
|
|
43
|
-
"@teambit/dependencies": "1.0.834",
|
|
44
|
-
"@teambit/dependency-resolver": "1.0.834",
|
|
45
29
|
"@teambit/legacy.consumer-config": "0.0.90",
|
|
46
30
|
"@teambit/legacy.extension-data": "0.0.92",
|
|
31
|
+
"@teambit/legacy-bit-id": "1.1.3",
|
|
32
|
+
"@teambit/legacy.logger": "0.0.31",
|
|
47
33
|
"@teambit/legacy.scope": "0.0.90",
|
|
34
|
+
"@teambit/legacy.loader": "0.0.14",
|
|
48
35
|
"@teambit/cli": "0.0.1290",
|
|
36
|
+
"@teambit/legacy.constants": "0.0.20",
|
|
49
37
|
"@teambit/legacy.component-list": "0.0.144",
|
|
50
38
|
"@teambit/legacy.consumer": "0.0.90",
|
|
51
39
|
"@teambit/legacy.dependency-graph": "0.0.93",
|
|
52
|
-
"@teambit/
|
|
53
|
-
"@teambit/workspace": "1.0.834",
|
|
40
|
+
"@teambit/component-issues": "0.0.166",
|
|
54
41
|
"@teambit/config-store": "0.0.170",
|
|
55
|
-
"@teambit/
|
|
56
|
-
"@teambit/
|
|
57
|
-
"@teambit/
|
|
58
|
-
"@teambit/
|
|
42
|
+
"@teambit/harmony": "0.4.7",
|
|
43
|
+
"@teambit/component-version": "1.0.4",
|
|
44
|
+
"@teambit/harmony.modules.concurrency": "0.0.21",
|
|
45
|
+
"@teambit/lane-id": "0.0.312",
|
|
59
46
|
"@teambit/lanes.modules.create-lane": "0.0.124",
|
|
60
47
|
"@teambit/legacy.scope-api": "0.0.145",
|
|
48
|
+
"@teambit/pkg.modules.semver-helper": "0.0.18",
|
|
61
49
|
"@teambit/harmony.modules.get-basic-log": "0.0.91",
|
|
62
|
-
"@teambit/
|
|
50
|
+
"@teambit/toolbox.crypto.sha1": "0.0.11",
|
|
51
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.319",
|
|
52
|
+
"@teambit/graph": "1.0.836",
|
|
53
|
+
"@teambit/objects": "0.0.343",
|
|
54
|
+
"@teambit/scope": "1.0.836",
|
|
55
|
+
"@teambit/component": "1.0.836",
|
|
56
|
+
"@teambit/dependencies": "1.0.836",
|
|
57
|
+
"@teambit/dependency-resolver": "1.0.836",
|
|
58
|
+
"@teambit/remove": "1.0.836",
|
|
59
|
+
"@teambit/workspace": "1.0.836",
|
|
60
|
+
"@teambit/application": "1.0.836",
|
|
61
|
+
"@teambit/builder": "1.0.836",
|
|
62
|
+
"@teambit/export": "1.0.836",
|
|
63
|
+
"@teambit/importer": "1.0.836"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"@types/graphlib": "2.1.7",
|
|
@@ -68,12 +69,12 @@
|
|
|
68
69
|
"@types/semver": "7.5.8",
|
|
69
70
|
"@types/uuid": "8.3.4",
|
|
70
71
|
"@types/mocha": "9.1.0",
|
|
71
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.80",
|
|
72
|
-
"@teambit/compiler": "1.0.834",
|
|
73
72
|
"@teambit/component.testing.mock-components": "0.0.357",
|
|
74
73
|
"@teambit/harmony.testing.load-aspect": "0.0.352",
|
|
75
|
-
"@teambit/
|
|
76
|
-
"@teambit/
|
|
74
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.80",
|
|
75
|
+
"@teambit/compiler": "1.0.836",
|
|
76
|
+
"@teambit/issues": "1.0.836",
|
|
77
|
+
"@teambit/workspace.testing.mock-workspace": "0.0.149"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
79
80
|
"chai": "5.2.1",
|
|
File without changes
|