@teambit/snapping 0.0.428 → 0.0.430

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.
@@ -1 +1 @@
1
- {"version":3,"names":["ComponentsHaveIssues","BitError","constructor","components","forEach","component","issues","filterNonTagBlocking","allIssueNames","uniq","map","comp","getAllIssueNames","flat","issuesColored","componentIssuesTemplate","join","IssuesAspect","id","issue","format","chalk","underline","cyan","toString","formatIssues","result"],"sources":["components-have-issues.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport IssuesAspect from '@teambit/issues';\nimport { formatIssues } from '@teambit/legacy/dist/cli/templates/component-issues-template';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\n\nexport class ComponentsHaveIssues extends BitError {\n constructor(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.issues = component.issues.filterNonTagBlocking();\n });\n const allIssueNames = uniq(components.map((comp) => comp.issues.getAllIssueNames()).flat());\n const issuesColored = componentIssuesTemplate(components);\n super(`error: issues found with the following components\n${issuesColored}\n\nto get the list of component-issues names and suggestions how to resolve them, run \"bit component-issues\".\n\nwhile highly not recommended, it's possible to ignore issues in two ways:\n1) temporarily ignore for this tag/snap command by entering \"--ignore-issues\" flag, e.g. \\`bit tag --ignore-issues \"${allIssueNames.join(\n ', '\n )}\" \\`\n2) ignore the issue completely by configuring it in the workspace.jsonc file. e.g:\n\"${IssuesAspect.id}\": {\n \"ignoreIssues\": [${allIssueNames.map((issue) => `\"${issue}\"`).join(', ')}]\n}\n`);\n }\n}\n\nfunction componentIssuesTemplate(components: ConsumerComponent[]) {\n function format(component: ConsumerComponent) {\n return `${chalk.underline(chalk.cyan(component.id.toString()))}\\n${formatIssues(component)}`;\n }\n\n const result = `\\n${components.map(format).join('\\n')}`;\n return result;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA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OAAOU,MAAM;AACf"}
1
+ {"version":3,"names":["_bitError","data","require","_issues","_interopRequireDefault","_componentIssuesTemplate","_chalk","_lodash","ComponentsHaveIssues","BitError","constructor","components","forEach","component","issues","filterNonTagBlocking","allIssueNames","uniq","map","comp","getAllIssueNames","flat","issuesColored","componentIssuesTemplate","join","IssuesAspect","id","issue","exports","format","chalk","underline","cyan","toString","formatIssues","result"],"sources":["components-have-issues.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport IssuesAspect from '@teambit/issues';\nimport { formatIssues } from '@teambit/legacy/dist/cli/templates/component-issues-template';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\n\nexport class ComponentsHaveIssues extends BitError {\n constructor(components: ConsumerComponent[]) {\n components.forEach((component) => {\n component.issues = component.issues.filterNonTagBlocking();\n });\n const allIssueNames = uniq(components.map((comp) => comp.issues.getAllIssueNames()).flat());\n const issuesColored = componentIssuesTemplate(components);\n super(`error: issues found with the following components\n${issuesColored}\n\nto get the list of component-issues names and suggestions how to resolve them, run \"bit component-issues\".\n\nwhile highly not recommended, it's possible to ignore issues in two ways:\n1) temporarily ignore for this tag/snap command by entering \"--ignore-issues\" flag, e.g. \\`bit tag --ignore-issues \"${allIssueNames.join(\n ', '\n )}\" \\`\n2) ignore the issue completely by configuring it in the workspace.jsonc file. e.g:\n\"${IssuesAspect.id}\": {\n \"ignoreIssues\": [${allIssueNames.map((issue) => `\"${issue}\"`).join(', ')}]\n}\n`);\n }\n}\n\nfunction componentIssuesTemplate(components: ConsumerComponent[]) {\n function format(component: ConsumerComponent) {\n return `${chalk.underline(chalk.cyan(component.id.toString()))}\\n${formatIssues(component)}`;\n }\n\n const result = `\\n${components.map(format).join('\\n')}`;\n return result;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;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CAACH,IAAI,CAAC,IAAI,CAAE;AAC3E;AACA,CAAC,CAAC;EACA;AACF;AAACI,OAAA,CAAApB,oBAAA,GAAAA,oBAAA;AAED,SAASe,uBAAuBA,CAACZ,UAA+B,EAAE;EAChE,SAASkB,MAAMA,CAAChB,SAA4B,EAAE;IAC5C,OAAQ,GAAEiB,gBAAK,CAACC,SAAS,CAACD,gBAAK,CAACE,IAAI,CAACnB,SAAS,CAACa,EAAE,CAACO,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAI,IAAAC,uCAAY,EAACrB,SAAS,CAAE,EAAC;EAC9F;EAEA,MAAMsB,MAAM,GAAI,KAAIxB,UAAU,CAACO,GAAG,CAACW,MAAM,CAAC,CAACL,IAAI,CAAC,IAAI,CAAE,EAAC;EACvD,OAAOW,MAAM;AACf"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["SnappingAspect"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport { getBitCloudUsername, getBitCloudUser, BitCloudUser, getBasicLog } from './tag-model-component';\nexport type { SnappingMain, TagResults, SnapResults } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport type { onTagIdTransformer } from './tag-model-component';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwG,eAEzFA,0BAAc;AAAA"}
1
+ {"version":3,"names":["_snapping","data","require","_tagModelComponent","_default","SnappingAspect","exports","default"],"sources":["index.ts"],"sourcesContent":["import { SnappingAspect } from './snapping.aspect';\n\nexport { getBitCloudUsername, getBitCloudUser, BitCloudUser, getBasicLog } from './tag-model-component';\nexport type { SnappingMain, TagResults, SnapResults } from './snapping.main.runtime';\nexport default SnappingAspect;\nexport { SnappingAspect };\nexport type { onTagIdTransformer } from './tag-model-component';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwG,IAAAG,QAAA,GAEzFC,0BAAc;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["ResetCmd","constructor","snapping","name","description","COMPONENT_PATTERN_HELP","BASE_DOCS_DOMAIN","report","pattern","all","head","force","soft","BitError","results","isSoftUntag","reset","titleSuffix","title","chalk","green","length","components","map","result","cyan","id","toStringWithoutVersion","versions","join"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BASE_DOCS_DOMAIN, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert tagged or snapped versions for component(s)';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'component-version',\n description: 'the version to untag (semver for tags. hash for snaps)',\n },\n ];\n group = 'development';\n extendedDescription = `https://${BASE_DOCS_DOMAIN}/components/tags#undoing-a-tag`;\n alias = '';\n options = [\n ['a', 'all', 'revert tag/snap for all tagged/snapped components'],\n ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'],\n ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'],\n [\n 'f',\n 'force',\n 'revert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n\n constructor(private snapping: SnappingMain) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n head = false,\n force = false,\n soft = false,\n }: { all?: boolean; head?: boolean; force?: boolean; soft?: boolean }\n ) {\n if (!pattern && !all) {\n throw new BitError('please specify a component-pattern or use --all flag');\n }\n if (pattern && all) {\n throw new BitError('please specify either a component-pattern or --all flag, not both');\n }\n if (soft && head) {\n throw new BitError('please specify either --soft or --head flag, not both');\n }\n const { results, isSoftUntag } = await this.snapping.reset(pattern, head, force, soft);\n const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidate for tagging anymore)' : 'untagged';\n const title = chalk.green(`${results.length} component(s) were ${titleSuffix}:\\n`);\n const components = results.map((result) => {\n return `${chalk.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;\n });\n return title + components.join('\\n');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGe,MAAMA,QAAQ,CAAoB;EA6B/CC,WAAW,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,8CA5BnC,2BAA2B;IAAA,qDACpB,oDAAoD;IAAA,mDACtD,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,EACD;MACEF,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,+CACO,aAAa;IAAA,6DACE,WAAUE,6BAAiB,gCAA+B;IAAA,+CACzE,EAAE;IAAA,iDACA,CACR,CAAC,GAAG,EAAE,KAAK,EAAE,mDAAmD,CAAC,EACjE,CAAC,EAAE,EAAE,MAAM,EAAE,+EAA+E,CAAC,EAC7F,CAAC,EAAE,EAAE,MAAM,EAAE,4DAA4D,CAAC,EAC1E,CACE,GAAG,EACH,OAAO,EACP,uGAAuG,CACxG,CACF;IAAA,gDACQ,IAAI;IAAA,mDACD,IAAI;EAE6B;EAE7C,MAAMC,MAAM,CACV,CAACC,OAAO,CAAW,EACnB;IACEC,GAAG,GAAG,KAAK;IACXC,IAAI,GAAG,KAAK;IACZC,KAAK,GAAG,KAAK;IACbC,IAAI,GAAG;EAC2D,CAAC,EACrE;IACA,IAAI,CAACJ,OAAO,IAAI,CAACC,GAAG,EAAE;MACpB,MAAM,KAAII,oBAAQ,EAAC,sDAAsD,CAAC;IAC5E;IACA,IAAIL,OAAO,IAAIC,GAAG,EAAE;MAClB,MAAM,KAAII,oBAAQ,EAAC,mEAAmE,CAAC;IACzF;IACA,IAAID,IAAI,IAAIF,IAAI,EAAE;MAChB,MAAM,KAAIG,oBAAQ,EAAC,uDAAuD,CAAC;IAC7E;IACA,MAAM;MAAEC,OAAO;MAAEC;IAAY,CAAC,GAAG,MAAM,IAAI,CAACb,QAAQ,CAACc,KAAK,CAACR,OAAO,EAAEE,IAAI,EAAEC,KAAK,EAAEC,IAAI,CAAC;IACtF,MAAMK,WAAW,GAAGF,WAAW,GAAG,uDAAuD,GAAG,UAAU;IACtG,MAAMG,KAAK,GAAGC,gBAAK,CAACC,KAAK,CAAE,GAAEN,OAAO,CAACO,MAAO,sBAAqBJ,WAAY,KAAI,CAAC;IAClF,MAAMK,UAAU,GAAGR,OAAO,CAACS,GAAG,CAAEC,MAAM,IAAK;MACzC,OAAQ,GAAEL,gBAAK,CAACM,IAAI,CAACD,MAAM,CAACE,EAAE,CAACC,sBAAsB,EAAE,CAAE,iBAAgBH,MAAM,CAACI,QAAQ,CAACC,IAAI,CAAC,IAAI,CAAE,EAAC;IACvG,CAAC,CAAC;IACF,OAAOX,KAAK,GAAGI,UAAU,CAACO,IAAI,CAAC,IAAI,CAAC;EACtC;AACF;AAAC"}
1
+ {"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","_constants","ResetCmd","constructor","snapping","_defineProperty2","default","name","description","COMPONENT_PATTERN_HELP","BASE_DOCS_DOMAIN","report","pattern","all","head","force","soft","BitError","results","isSoftUntag","reset","titleSuffix","title","chalk","green","length","components","map","result","cyan","id","toStringWithoutVersion","versions","join","exports"],"sources":["reset-cmd.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BASE_DOCS_DOMAIN, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport default class ResetCmd implements Command {\n name = 'reset [component-pattern]';\n description = 'revert tagged or snapped versions for component(s)';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n {\n name: 'component-version',\n description: 'the version to untag (semver for tags. hash for snaps)',\n },\n ];\n group = 'development';\n extendedDescription = `https://${BASE_DOCS_DOMAIN}/components/tags#undoing-a-tag`;\n alias = '';\n options = [\n ['a', 'all', 'revert tag/snap for all tagged/snapped components'],\n ['', 'head', 'revert the head tag/snap only (by default, all local tags/snaps are reverted)'],\n ['', 'soft', 'revert only soft-tags (components tagged with --soft flag)'],\n [\n 'f',\n 'force',\n 'revert the tag even if used as a dependency. WARNING: components that depend on this tag will corrupt',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n\n constructor(private snapping: SnappingMain) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n head = false,\n force = false,\n soft = false,\n }: { all?: boolean; head?: boolean; force?: boolean; soft?: boolean }\n ) {\n if (!pattern && !all) {\n throw new BitError('please specify a component-pattern or use --all flag');\n }\n if (pattern && all) {\n throw new BitError('please specify either a component-pattern or --all flag, not both');\n }\n if (soft && head) {\n throw new BitError('please specify either --soft or --head flag, not both');\n }\n const { results, isSoftUntag } = await this.snapping.reset(pattern, head, force, soft);\n const titleSuffix = isSoftUntag ? 'soft-untagged (are not candidate for tagging anymore)' : 'untagged';\n const title = chalk.green(`${results.length} component(s) were ${titleSuffix}:\\n`);\n const components = results.map((result) => {\n return `${chalk.cyan(result.id.toStringWithoutVersion())}. version(s): ${result.versions.join(', ')}`;\n });\n return title + components.join('\\n');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,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;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGe,MAAMK,QAAQ,CAAoB;EA6B/CC,WAAWA,CAASC,QAAsB,EAAE;IAAA,KAAxBA,QAAsB,GAAtBA,QAAsB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBA5BnC,2BAA2B;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBACpB,oDAAoD;IAAA,IAAAD,gBAAA,GAAAC,OAAA,qBACtD,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,EACD;MACEF,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,IAAAH,gBAAA,GAAAC,OAAA,iBACO,aAAa;IAAA,IAAAD,gBAAA,GAAAC,OAAA,+BACE,WAAUI,6BAAiB,gCAA+B;IAAA,IAAAL,gBAAA,GAAAC,OAAA,iBACzE,EAAE;IAAA,IAAAD,gBAAA,GAAAC,OAAA,mBACA,CACR,CAAC,GAAG,EAAE,KAAK,EAAE,mDAAmD,CAAC,EACjE,CAAC,EAAE,EAAE,MAAM,EAAE,+EAA+E,CAAC,EAC7F,CAAC,EAAE,EAAE,MA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AC;EACtC;AACF;AAACC,OAAA,CAAA5B,OAAA,GAAAJ,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["SnapCmd","constructor","snapping","logger","name","description","COMPONENT_PATTERN_HELP","Object","keys","IssuesClasses","join","report","pattern","message","all","force","unmerged","editor","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","ignoreBuildErrors","unmodified","failFast","isFeatureEnabled","BUILD_ON_CI","Boolean","disableTagAndSnapPipelines","consoleWarning","BitError","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","warningsOutput","snapExplanation","compInBold","version","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","green","outputIdsIfExists"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\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 { NOTHING_TO_SNAP_MSG, AUTO_SNAPPED_MSG, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create an immutable and exportable component snapshot (no release version)';\n extendedDescription: string;\n group = 'development';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are snapped.`,\n },\n ];\n helpUrl = 'docs/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'not needed for now. run the build pipeline in case the feature-flag build-on-ci is enabled'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\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', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline 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 '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependent failed)',\n ],\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 migration = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n all = false,\n force = false,\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n ignoreBuildErrors = false,\n unmodified = false,\n failFast = false,\n }: {\n all?: boolean;\n force?: boolean;\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit snap\" by default will snap all new and modified components`\n );\n }\n if (force) {\n this.logger.consoleWarning(\n `--force is deprecated, use either --skip-tests or --unmodified depending on the use case`\n );\n if (pattern) unmodified = true;\n }\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap`\n );\n }\n if (forceDeploy) {\n this.logger.consoleWarning(`--force-deploy is deprecated, use --ignore-build-errors instead`);\n ignoreBuildErrors = true;\n }\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-error or disable-snap-pipeline, but not both');\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n unmodified,\n exitOnFirstFailedTask: failFast,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName, removedComponents }: SnapResults =\n 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 snapExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n\n const compInBold = (id: BitId) => {\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) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\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 warningsOutput +\n chalk.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n snapExplanation +\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 );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,OAAO,CAAoB;EAkDtCC,WAAW,CAASC,QAAsB,EAAUC,MAAc,EAAE;IAAA,KAAhDD,QAAsB,GAAtBA,QAAsB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,8CAjD3D,0BAA0B;IAAA,qDACnB,4EAA4E;IAAA;IAAA,+CAElF,aAAa;IAAA,mDACT,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAG,GAAEC,mCAAuB;IACzC,CAAC,CACF;IAAA,iDACS,uBAAuB;IAA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,KAAIF,WAAW,CAAChB,MAAO;AACnF,cAAcgB,WAAW,CAAC1D,IAAI,CAAC,gBAAgB,CAAE,EAAC;QACxC;QACA,OAAOqD,eAAe;MACxB,CAAC,CAAC,CACDrD,IAAI,CAAC,IAAI,CAAC;IACf,CAAC;IAED,MAAM6D,cAAc,GAAG,CAACC,KAAK,EAAEC,WAAW,EAAEC,UAAU,KAAK;MACzD,IAAI,CAACA,UAAU,CAACtB,MAAM,EAAE,OAAO,EAAE;MACjC,OAAQ,KAAIhB,gBAAK,CAACuC,SAAS,CAACH,KAAK,CAAE,MAAKC,WAAY,MAAKb,gBAAgB,CAACc,UAAU,CAAE,IAAG;IAC3F,CAAC;IACD,MAAME,OAAO,GAAGjC,QAAQ,GAAI,QAAOA,QAAS,QAAO,GAAG,EAAE;IAExD,OACEU,cAAc,GACdjB,gBAAK,CAACyC,KAAK,CAAE,GAAEtC,iBAAiB,CAACa,MAAM,GAAGD,eAAgB,wBAAuByB,OAAQ,EAAC,CAAC,GAC3FtB,eAAe,GACfiB,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAErB,eAAe,CAAC,GACjFqB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAE1B,iBAAiB,CAAC,GAC7F,IAAAiC,2BAAiB,EAAC,oBAAoB,EAAElC,iBAAiB,CAAC;EAE9D;AACF;AAAC"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_featureToggle","_constants","_bitError","_tagCmd","SnapCmd","constructor","snapping","logger","_defineProperty2","default","name","description","COMPONENT_PATTERN_HELP","Object","keys","IssuesClasses","join","report","pattern","message","all","force","unmerged","editor","ignoreIssues","build","skipTests","skipAutoSnap","disableSnapPipeline","forceDeploy","ignoreBuildErrors","unmodified","failFast","isFeatureEnabled","BUILD_ON_CI","Boolean","disableTagAndSnapPipelines","consoleWarning","BitError","results","snap","exitOnFirstFailedTask","chalk","yellow","NOTHING_TO_SNAP_MSG","snappedComponents","autoSnappedResults","warnings","newComponents","laneName","removedComponents","changedComponents","filter","component","searchWithoutVersion","id","addedComponents","autoTaggedCount","length","warningsOutput","snapExplanation","compInBold","version","hasVersion","bold","toStringWithoutVersion","outputComponents","comps","map","componentOutput","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","green","outputIdsIfExists","exports"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\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 { NOTHING_TO_SNAP_MSG, AUTO_SNAPPED_MSG, COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain, SnapResults } from './snapping.main.runtime';\nimport { outputIdsIfExists } from './tag-cmd';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport class SnapCmd implements Command {\n name = 'snap [component-pattern]';\n description = 'create an immutable and exportable component snapshot (no release version)';\n extendedDescription: string;\n group = 'development';\n arguments = [\n {\n name: 'component-pattern',\n description: `${COMPONENT_PATTERN_HELP}. By default, all new and modified components are snapped.`,\n },\n ];\n helpUrl = 'docs/components/snaps';\n alias = '';\n options = [\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'unmodified', 'include unmodified components (by default, only new and modified components are snapped)'],\n ['', 'unmerged', 'complete a merge process by snapping the unmerged components'],\n ['b', 'build', 'not needed for now. run the build pipeline in case the feature-flag build-on-ci is enabled'],\n [\n '',\n 'editor [editor]',\n 'open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).',\n ],\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', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline 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 '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependent failed)',\n ],\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 migration = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report(\n [pattern]: string[],\n {\n message = '',\n all = false,\n force = false,\n unmerged = false,\n editor = '',\n ignoreIssues,\n build,\n skipTests = false,\n skipAutoSnap = false,\n disableSnapPipeline = false,\n forceDeploy = false,\n ignoreBuildErrors = false,\n unmodified = false,\n failFast = false,\n }: {\n all?: boolean;\n force?: boolean;\n unmerged?: boolean;\n editor?: string;\n ignoreIssues?: string;\n skipAutoSnap?: boolean;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n unmodified?: boolean;\n failFast?: boolean;\n } & BasicTagSnapParams\n ) {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (all) {\n this.logger.consoleWarning(\n `--all is deprecated, please omit it. \"bit snap\" by default will snap all new and modified components`\n );\n }\n if (force) {\n this.logger.consoleWarning(\n `--force is deprecated, use either --skip-tests or --unmodified depending on the use case`\n );\n if (pattern) unmodified = true;\n }\n if (!message && !editor) {\n this.logger.consoleWarning(\n `--message will be mandatory in the next few releases. make sure to add a message with your snap`\n );\n }\n if (forceDeploy) {\n this.logger.consoleWarning(`--force-deploy is deprecated, use --ignore-build-errors instead`);\n ignoreBuildErrors = true;\n }\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-error or disable-snap-pipeline, but not both');\n }\n\n const results = await this.snapping.snap({\n pattern,\n message,\n unmerged,\n editor,\n ignoreIssues,\n build,\n skipTests,\n skipAutoSnap,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n unmodified,\n exitOnFirstFailedTask: failFast,\n });\n\n if (!results) return chalk.yellow(NOTHING_TO_SNAP_MSG);\n const { snappedComponents, autoSnappedResults, warnings, newComponents, laneName, removedComponents }: SnapResults =\n 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 snapExplanation = `\\n(use \"bit export\" to push these components to a remote\")\n(use \"bit reset\" to unstage versions)\\n`;\n\n const compInBold = (id: BitId) => {\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) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\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 warningsOutput +\n chalk.green(`${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n snapExplanation +\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 );\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,eAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAMQ,OAAO,CAAoB;EAkDtCC,WAAWA,CAASC,QAAsB,EAAUC,MAAc,EAAE;IAAA,KAAhDD,QAAsB,GAAtBA,QAAsB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,IAAAC,gBAAA,GAAAC,OAAA,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,oBAAoB,EAAElC,iBAAiB,CAAC;EAE9D;AACF;AAACmC,OAAA,CAAAjF,OAAA,GAAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["SnapFromScopeCmd","constructor","snapping","logger","Object","keys","IssuesClasses","join","report","data","options","results","json","snappedIds","exportedIds","snappedOutput","chalk","bold","exportedOutput","length","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","forceDeploy","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","snapFromScope","dataParsed","JSON","parse","err","Error","Array","isArray","forEach","dataItem","componentId"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n};\n\ntype SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n} & BasicTagSnapParams;\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\nthe input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // e.g. [teambit/compiler@1.0.0, teambit/tester@1.0.0]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'\n`;\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'force-deploy', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline 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 ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report([data]: [string], options: SnapFromScopeOptions) {\n const results = await this.json([data], options);\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}`;\n const exportedOutput =\n exportedIds && exportedIds.length ? `\\n\\n${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return `${snappedOutput}${exportedOutput}`;\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n forceDeploy = false,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (forceDeploy) {\n ignoreBuildErrors = true;\n }\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n });\n\n return results;\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n });\n return dataParsed;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAoBO,MAAMA,gBAAgB,CAAoB;EAoC/CC,WAAW,CAASC,QAAsB,EAAUC,MAAc,EAAE;IAAA,KAAhDD,QAAsB,GAAtBA,QAAsB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,8CAnC3D,cAAc;IAAA,qDACP,mCAAmC;IAAA,6DAC1B;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;IAAA,+CACS,EAAE;IAAA,iDACA,CACR,CAAC,EAAE,EAAE,MAAM,EAAE,6DAA6D,CAAC,EAC3E,CAAC,GAAG,EAAE,mBAAmB,EAAE,2CAA2C,CAAC,EACvE,CAAC,EAAE,EAAE,gBAAgB,EAAE,0CAA0C,CAAC,EAClE,CAAC,EAAE,EAAE,OAAO,EAAE,wBAAwB,CAAC,EACvC,CAAC,EAAE,EAAE,YAAY,EAAE,kDAAkD,CAAC,EACtE,CAAC,EAAE,EAAE,uBAAuB,EAAE,wBAAwB,CAAC,EACvD,CAAC,EAAE,EAAE,cAAc,EAAE,8CAA8C,CAAC,EACpE,CAAC,EAAE,EAAE,qBAAqB,EAAE,0DAA0D,CAAC,EACvF,CACE,GAAG,EACH,wBAAwB,EACvB;AACP,GAAGC,MAAM,CAACC,IAAI,CAACC,gCAAa,CAAC,CAACC,IAAI,CAAC,IAAI,CAAE;AACzC,6GAA6G,CACxG,EACD,CAAC,GA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,QAAQ,CAAC+B,aAAa,CAACF,kBAAkB,EAAE;MACpEX,IAAI;MACJC,OAAO;MACPC,IAAI;MACJC,YAAY;MACZC,KAAK;MACLC,SAAS;MACTI,0BAA0B;MAC1BF;IACF,CAAC,CAAC;IAEF,OAAOhB,OAAO;EAChB;EACQqB,SAAS,CAACvB,IAAY,EAAwB;IACpD,IAAIyB,UAAmB;IACvB,IAAI;MACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CAAC3B,IAAI,CAAC;IAC/B,CAAC,CAAC,OAAO4B,GAAQ,EAAE;MACjB,MAAM,IAAIC,KAAK,CAAE,gDAA+CD,GAAG,CAAChB,OAAQ,EAAC,CAAC;IAChF;IACA,IAAI,CAACkB,KAAK,CAACC,OAAO,CAACN,UAAU,CAAC,EAAE;MAC9B,MAAM,IAAII,KAAK,CAAC,4BAA4B,CAAC;IAC/C;IACAJ,UAAU,CAACO,OAAO,CAAEC,QAAQ,IAAK;MAC/B,IAAI,CAACA,QAAQ,CAACC,WAAW,EAAE,MAAM,IAAIL,KAAK,CAAC,6CAA6C,CAAC;IAC3F,CAAC,CAAC;IACF,OAAOJ,UAAU;EACnB;AACF;AAAC"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_bitError","SnapFromScopeCmd","constructor","snapping","logger","_defineProperty2","default","Object","keys","IssuesClasses","join","report","options","results","json","snappedIds","exportedIds","snappedOutput","chalk","bold","exportedOutput","length","push","message","lane","ignoreIssues","build","skipTests","disableSnapPipeline","ignoreBuildErrors","forceDeploy","disableTagAndSnapPipelines","BitError","snapDataPerCompRaw","parseData","snapFromScope","dataParsed","JSON","parse","err","Error","Array","isArray","forEach","dataItem","componentId","exports"],"sources":["snap-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger } from '@teambit/logger';\nimport { SnappingMain } from './snapping.main.runtime';\nimport { BasicTagSnapParams } from './tag-model-component';\n\nexport type SnapDataPerCompRaw = {\n componentId: string;\n dependencies?: string[];\n aspects?: Record<string, any>;\n message?: string;\n};\n\ntype SnapFromScopeOptions = {\n push?: boolean;\n lane?: string;\n ignoreIssues?: string;\n disableSnapPipeline?: boolean;\n forceDeploy?: boolean;\n} & BasicTagSnapParams;\n\nexport class SnapFromScopeCmd implements Command {\n name = '_snap <data>';\n description = 'snap components from a bare-scope';\n extendedDescription = `this command should be running from a new bare scope, it first imports the components it needs and then processes the snap.\nthe input data is a stringified JSON of an array of the following object.\n{\n componentId: string; // ids always have scope, so it's safe to parse them from string\n dependencies?: string[]; // e.g. [teambit/compiler@1.0.0, teambit/tester@1.0.0]\n aspects?: Record<string,any> // e.g. { \"teambit.react/react\": {}, \"teambit.envs/envs\": { \"env\": \"teambit.react/react\" } }\n message?: string; // tag-message.\n}\nan example of the final data: '[{\"componentId\":\"ci.remote2/comp-b\",\"message\": \"first snap\"}]'\n`;\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['m', 'message <message>', 'log message describing the latest changes'],\n ['', 'lane <lane-id>', 'fetch the components from the given lane'],\n ['', 'build', 'run the build pipeline'],\n ['', 'skip-tests', 'skip running component tests during snap process'],\n ['', 'disable-snap-pipeline', 'skip the snap pipeline'],\n ['', 'force-deploy', 'DEPRECATED. use --ignore-build-error instead'],\n ['', 'ignore-build-errors', 'run the snap pipeline although the build pipeline 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 ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private snapping: SnappingMain, private logger: Logger) {}\n\n async report([data]: [string], options: SnapFromScopeOptions) {\n const results = await this.json([data], options);\n\n const { snappedIds, exportedIds } = results;\n\n const snappedOutput = `${chalk.bold('snapped components')}\\n${snappedIds.join('\\n')}`;\n const exportedOutput =\n exportedIds && exportedIds.length ? `\\n\\n${chalk.bold('exported components')}\\n${exportedIds.join('\\n')}` : '';\n\n return `${snappedOutput}${exportedOutput}`;\n }\n async json(\n [data]: [string],\n {\n push = false,\n message = '',\n lane,\n ignoreIssues,\n build = false,\n skipTests = false,\n disableSnapPipeline = false,\n ignoreBuildErrors = false,\n forceDeploy = false,\n }: SnapFromScopeOptions\n ) {\n const disableTagAndSnapPipelines = disableSnapPipeline;\n if (forceDeploy) {\n ignoreBuildErrors = true;\n }\n if (disableTagAndSnapPipelines && ignoreBuildErrors) {\n throw new BitError('you can use either ignore-build-errors or disable-snap-pipeline, but not both');\n }\n\n const snapDataPerCompRaw = this.parseData(data);\n\n const results = await this.snapping.snapFromScope(snapDataPerCompRaw, {\n push,\n message,\n lane,\n ignoreIssues,\n build,\n skipTests,\n disableTagAndSnapPipelines,\n ignoreBuildErrors,\n });\n\n return results;\n }\n private parseData(data: string): SnapDataPerCompRaw[] {\n let dataParsed: unknown;\n try {\n dataParsed = JSON.parse(data);\n } catch (err: any) {\n throw new Error(`failed parsing the data entered as JSON. err ${err.message}`);\n }\n if (!Array.isArray(dataParsed)) {\n throw new Error('expect data to be an array');\n }\n dataParsed.forEach((dataItem) => {\n if (!dataItem.componentId) throw new Error('expect data item to have \"componentId\" prop');\n });\n return dataParsed;\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;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;E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;MACpEX,IAAI;MACJC,OAAO;MACPC,IAAI;MACJC,YAAY;MACZC,KAAK;MACLC,SAAS;MACTI,0BAA0B;MAC1BF;IACF,CAAC,CAAC;IAEF,OAAOhB,OAAO;EAChB;EACQqB,SAASA,CAACtC,IAAY,EAAwB;IACpD,IAAIwC,UAAmB;IACvB,IAAI;MACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CAAC1C,IAAI,CAAC;IAC/B,CAAC,CAAC,OAAO2C,GAAQ,EAAE;MACjB,MAAM,IAAIC,KAAK,CAAE,gDAA+CD,GAAG,CAAChB,OAAQ,EAAC,CAAC;IAChF;IACA,IAAI,CAACkB,KAAK,CAACC,OAAO,CAACN,UAAU,CAAC,EAAE;MAC9B,MAAM,IAAII,KAAK,CAAC,4BAA4B,CAAC;IAC/C;IACAJ,UAAU,CAACO,OAAO,CAAEC,QAAQ,IAAK;MAC/B,IAAI,CAACA,QAAQ,CAACC,WAAW,EAAE,MAAM,IAAIL,KAAK,CAAC,6CAA6C,CAAC;IAC3F,CAAC,CAAC;IACF,OAAOJ,UAAU;EACnB;AACF;AAACU,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["SnappingAspect","Aspect","create","id"],"sources":["snapping.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SnappingAspect = Aspect.create({\n id: 'teambit.component/snapping',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,cAAc,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
1
+ {"version":3,"names":["_harmony","data","require","SnappingAspect","Aspect","create","id","exports"],"sources":["snapping.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const SnappingAspect = Aspect.create({\n id: 'teambit.component/snapping',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,cAAc,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC1CC,EAAE,EAAE;AACN,CAAC,CAAC;AAACC,OAAA,CAAAJ,cAAA,GAAAA,cAAA"}