@teambit/snapping 1.0.487 → 1.0.488
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/artifacts/__bit_junit.xml +12 -8
- package/artifacts/schema.json +1491 -1431
- package/dist/flattened-edges.d.ts +2 -2
- package/dist/flattened-edges.js.map +1 -1
- package/dist/generate-comp-from-scope.js +16 -31
- package/dist/generate-comp-from-scope.js.map +1 -1
- package/dist/get-flattened-dependencies.d.ts +32 -0
- package/dist/get-flattened-dependencies.js +190 -0
- package/dist/get-flattened-dependencies.js.map +1 -0
- package/dist/message-per-component.d.ts +17 -0
- package/dist/message-per-component.js +204 -0
- package/dist/message-per-component.js.map +1 -0
- package/dist/message-per-component.spec.d.ts +1 -0
- package/dist/message-per-component.spec.js +63 -0
- package/dist/message-per-component.spec.js.map +1 -0
- package/dist/reset-cmd.js +5 -5
- package/dist/reset-cmd.js.map +1 -1
- package/dist/reset-component.d.ts +3 -3
- package/dist/reset-component.js +8 -9
- package/dist/reset-component.js.map +1 -1
- package/dist/snap-cmd.js +7 -7
- package/dist/snap-cmd.js.map +1 -1
- package/dist/snapping.main.runtime.d.ts +4 -8
- package/dist/snapping.main.runtime.js +50 -64
- package/dist/snapping.main.runtime.js.map +1 -1
- package/dist/snapping.spec.js +5 -5
- package/dist/snapping.spec.js.map +1 -1
- package/dist/tag-cmd.js +6 -6
- package/dist/tag-cmd.js.map +1 -1
- package/dist/tag-model-component.d.ts +3 -4
- package/dist/tag-model-component.js +26 -40
- package/dist/tag-model-component.js.map +1 -1
- package/package.json +48 -36
- /package/dist/{preview-1733714450424.js → preview-1733830651067.js} +0 -0
package/dist/snap-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_componentIssues","_constants","_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","globalConfig","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","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","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","outputIdsIfExists","green","exports"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { 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/dist/constants';\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 (non-release version)';\n extendedDescription: string;\n group = 'development';\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 ['', '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 ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private globalConfig: GlobalConfigMain\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 }: {\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 = (await this.globalConfig.getBool(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 });\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((component) => {\n return (\n !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id)\n );\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 --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${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n snapExplanation\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;AAGA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,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,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,U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ACdjB,gBAAK,CAACyC,KAAK,CAAC,KAAKtC,iBAAiB,CAACa,MAAM,GAAGD,eAAe,wBAAwBwB,OAAO,EAAE,CAAC,GAC7FrB,eAAe;EAEnB;AACF;AAACwB,OAAA,CAAA5E,OAAA,GAAAA,OAAA","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","globalConfig","name","description","COMPONENT_PATTERN_HELP","keys","IssuesClasses","join","report","pattern","message","unmerged","editor","ignoreIssues","build","skipTests","skipTasks","skipAutoSnap","disableSnapPipeline","ignoreBuildErrors","rebuildDepsGraph","unmodified","failFast","getBool","CFG_FORCE_LOCAL_BUILD","Boolean","disableTagAndSnapPipelines","consoleWarning","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","autoTagComp","a","AUTO_SNAPPED_MSG","outputIfExists","label","explanation","components","underline","laneStr","outputIdsIfExists","green","exports"],"sources":["snap-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { ComponentID } from '@teambit/component-id';\nimport { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { 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 { 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 (non-release version)';\n extendedDescription: string;\n group = 'development';\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 ['', '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 ] as CommandOptions;\n loader = true;\n\n constructor(\n private snapping: SnappingMain,\n private logger: Logger,\n private globalConfig: GlobalConfigMain\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 }: {\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 = (await this.globalConfig.getBool(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 });\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((component) => {\n return (\n !newComponents.searchWithoutVersion(component.id) && !removedComponents?.searchWithoutVersion(component.id)\n );\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 --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${snappedComponents.length + autoTaggedCount} component(s) snapped${laneStr}`) +\n snapExplanation\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;AAGA,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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,gBAAgB,CAACa,UAAU,CAAC,IAAI;IAC3F,CAAC;IACD,MAAME,OAAO,GAAGhC,QAAQ,GAAG,QAAQA,QAAQ,QAAQ,GAAG,EAAE;IAExD,OACE2B,cAAc,CAAC,gBAAgB,EAAE,8BAA8B,EAAEpB,eAAe,CAAC,GACjFoB,cAAc,CAAC,oBAAoB,EAAE,oCAAoC,EAAEzB,iBAAiB,CAAC,GAC7F,IAAA+B,2BAAiB,EAAC,oBAAoB,EAAEhC,iBAAiB,CAAC,GAC1DS,cAAc,GACdjB,gBAAK,CAACyC,KAAK,CAAC,KAAKtC,iBAAiB,CAACa,MAAM,GAAGD,eAAe,wBAAwBwB,OAAO,EAAE,CAAC,GAC7FrB,eAAe;EAEnB;AACF;AAACwB,OAAA,CAAA5E,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
|
-
import { LegacyOnTagResult } from '@teambit/legacy
|
|
3
|
-
import { Workspace } from '@teambit/workspace';
|
|
2
|
+
import { LegacyOnTagResult } from '@teambit/legacy.scope';
|
|
3
|
+
import { Workspace, AutoTagResult } from '@teambit/workspace';
|
|
4
4
|
import { ReleaseType } from 'semver';
|
|
5
5
|
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
6
6
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
7
|
-
import ConsumerComponent from '@teambit/legacy
|
|
7
|
+
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
8
8
|
import { InsightsMain } from '@teambit/insights';
|
|
9
9
|
import { ScopeMain } from '@teambit/scope';
|
|
10
|
-
import { Lane, ModelComponent } from '@teambit/
|
|
10
|
+
import { BitObject, Lane, ModelComponent, Version, Log, AddVersionOpts } from '@teambit/scope.objects';
|
|
11
11
|
import { IssuesMain } from '@teambit/issues';
|
|
12
12
|
import { Component } from '@teambit/component';
|
|
13
13
|
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
14
14
|
import { BuilderMain } from '@teambit/builder';
|
|
15
15
|
import { ImporterMain } from '@teambit/importer';
|
|
16
16
|
import { ExportMain } from '@teambit/export';
|
|
17
|
-
import { BitObject } from '@teambit/legacy/dist/scope/objects';
|
|
18
17
|
import { GlobalConfigMain } from '@teambit/global-config';
|
|
19
|
-
import { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';
|
|
20
18
|
import { DependenciesMain } from '@teambit/dependencies';
|
|
21
|
-
import Version, { Log } from '@teambit/legacy/dist/scope/models/version';
|
|
22
19
|
import { BasicTagParams, BasicTagSnapParams } from './tag-model-component';
|
|
23
20
|
import { TagDataPerCompRaw } from './tag-from-scope.cmd';
|
|
24
21
|
import { SnapDataPerCompRaw, FileData } from './snap-from-scope.cmd';
|
|
25
22
|
import { ResetResult } from './reset-component';
|
|
26
23
|
import { ApplicationMain } from '@teambit/application';
|
|
27
24
|
import { RemoveMain } from '@teambit/remove';
|
|
28
|
-
import { AddVersionOpts } from '@teambit/legacy/dist/scope/models/model-component';
|
|
29
25
|
export type PackageIntegritiesByPublishedPackages = Map<string, string | undefined>;
|
|
30
26
|
export type TagDataPerComp = {
|
|
31
27
|
componentId: ComponentID;
|
|
@@ -25,8 +25,15 @@ function _fsExtra() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
+
function _legacy() {
|
|
29
|
+
const data = require("@teambit/legacy.scope");
|
|
30
|
+
_legacy = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
28
35
|
function _getFlattenedDependencies() {
|
|
29
|
-
const data = require("
|
|
36
|
+
const data = require("./get-flattened-dependencies");
|
|
30
37
|
_getFlattenedDependencies = function () {
|
|
31
38
|
return data;
|
|
32
39
|
};
|
|
@@ -60,30 +67,30 @@ function _componentId() {
|
|
|
60
67
|
};
|
|
61
68
|
return data;
|
|
62
69
|
}
|
|
63
|
-
function
|
|
64
|
-
const data = require("@teambit/legacy
|
|
65
|
-
|
|
70
|
+
function _legacy2() {
|
|
71
|
+
const data = require("@teambit/legacy.constants");
|
|
72
|
+
_legacy2 = function () {
|
|
66
73
|
return data;
|
|
67
74
|
};
|
|
68
75
|
return data;
|
|
69
76
|
}
|
|
70
|
-
function
|
|
71
|
-
const data = require("@teambit/legacy.
|
|
72
|
-
|
|
77
|
+
function _legacy3() {
|
|
78
|
+
const data = require("@teambit/legacy.consumer");
|
|
79
|
+
_legacy3 = function () {
|
|
73
80
|
return data;
|
|
74
81
|
};
|
|
75
82
|
return data;
|
|
76
83
|
}
|
|
77
|
-
function
|
|
78
|
-
const data =
|
|
79
|
-
|
|
84
|
+
function _legacy4() {
|
|
85
|
+
const data = require("@teambit/legacy.component-list");
|
|
86
|
+
_legacy4 = function () {
|
|
80
87
|
return data;
|
|
81
88
|
};
|
|
82
89
|
return data;
|
|
83
90
|
}
|
|
84
|
-
function
|
|
85
|
-
const data = _interopRequireDefault(require("
|
|
86
|
-
|
|
91
|
+
function _pMapSeries() {
|
|
92
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
|
93
|
+
_pMapSeries = function () {
|
|
87
94
|
return data;
|
|
88
95
|
};
|
|
89
96
|
return data;
|
|
@@ -137,6 +144,13 @@ function _scope() {
|
|
|
137
144
|
};
|
|
138
145
|
return data;
|
|
139
146
|
}
|
|
147
|
+
function _scope2() {
|
|
148
|
+
const data = require("@teambit/scope.objects");
|
|
149
|
+
_scope2 = function () {
|
|
150
|
+
return data;
|
|
151
|
+
};
|
|
152
|
+
return data;
|
|
153
|
+
}
|
|
140
154
|
function _issues() {
|
|
141
155
|
const data = require("@teambit/issues");
|
|
142
156
|
_issues = function () {
|
|
@@ -151,9 +165,9 @@ function _dependencyResolver() {
|
|
|
151
165
|
};
|
|
152
166
|
return data;
|
|
153
167
|
}
|
|
154
|
-
function
|
|
168
|
+
function _legacy5() {
|
|
155
169
|
const data = require("@teambit/legacy.extension-data");
|
|
156
|
-
|
|
170
|
+
_legacy5 = function () {
|
|
157
171
|
return data;
|
|
158
172
|
};
|
|
159
173
|
return data;
|
|
@@ -186,13 +200,6 @@ function _export() {
|
|
|
186
200
|
};
|
|
187
201
|
return data;
|
|
188
202
|
}
|
|
189
|
-
function _unmergedComponents() {
|
|
190
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/lanes/unmerged-components"));
|
|
191
|
-
_unmergedComponents = function () {
|
|
192
|
-
return data;
|
|
193
|
-
};
|
|
194
|
-
return data;
|
|
195
|
-
}
|
|
196
203
|
function _componentVersion() {
|
|
197
204
|
const data = require("@teambit/component-version");
|
|
198
205
|
_componentVersion = function () {
|
|
@@ -200,13 +207,6 @@ function _componentVersion() {
|
|
|
200
207
|
};
|
|
201
208
|
return data;
|
|
202
209
|
}
|
|
203
|
-
function _objects() {
|
|
204
|
-
const data = require("@teambit/legacy/dist/scope/objects");
|
|
205
|
-
_objects = function () {
|
|
206
|
-
return data;
|
|
207
|
-
};
|
|
208
|
-
return data;
|
|
209
|
-
}
|
|
210
210
|
function _globalConfig() {
|
|
211
211
|
const data = require("@teambit/global-config");
|
|
212
212
|
_globalConfig = function () {
|
|
@@ -221,13 +221,6 @@ function _component() {
|
|
|
221
221
|
};
|
|
222
222
|
return data;
|
|
223
223
|
}
|
|
224
|
-
function _exceptions() {
|
|
225
|
-
const data = require("@teambit/legacy/dist/scope/exceptions");
|
|
226
|
-
_exceptions = function () {
|
|
227
|
-
return data;
|
|
228
|
-
};
|
|
229
|
-
return data;
|
|
230
|
-
}
|
|
231
224
|
function _dependencies() {
|
|
232
225
|
const data = require("@teambit/dependencies");
|
|
233
226
|
_dependencies = function () {
|
|
@@ -235,13 +228,6 @@ function _dependencies() {
|
|
|
235
228
|
};
|
|
236
229
|
return data;
|
|
237
230
|
}
|
|
238
|
-
function _version() {
|
|
239
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/models/version"));
|
|
240
|
-
_version = function () {
|
|
241
|
-
return data;
|
|
242
|
-
};
|
|
243
|
-
return data;
|
|
244
|
-
}
|
|
245
231
|
function _snapCmd() {
|
|
246
232
|
const data = require("./snap-cmd");
|
|
247
233
|
_snapCmd = function () {
|
|
@@ -326,9 +312,9 @@ function _application() {
|
|
|
326
312
|
};
|
|
327
313
|
return data;
|
|
328
314
|
}
|
|
329
|
-
function
|
|
315
|
+
function _legacy6() {
|
|
330
316
|
const data = require("@teambit/legacy.scope-api");
|
|
331
|
-
|
|
317
|
+
_legacy6 = function () {
|
|
332
318
|
return data;
|
|
333
319
|
};
|
|
334
320
|
return data;
|
|
@@ -413,7 +399,7 @@ class SnappingMain {
|
|
|
413
399
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
414
400
|
const validExactVersion = (0, _pkgModules().validateVersion)(exactVersion);
|
|
415
401
|
const consumer = this.workspace.consumer;
|
|
416
|
-
const componentsList = new (
|
|
402
|
+
const componentsList = new (_legacy4().ComponentsList)(consumer);
|
|
417
403
|
this.logger.setStatusLine('determine components to tag...');
|
|
418
404
|
const newComponents = await componentsList.listNewComponents();
|
|
419
405
|
const {
|
|
@@ -493,7 +479,7 @@ class SnappingMain {
|
|
|
493
479
|
await this.scope.import(componentIds, {
|
|
494
480
|
reason: 'of the seeders to tag'
|
|
495
481
|
});
|
|
496
|
-
const deps = (0, _lodash().compact)(tagDataPerComp.map(t => t.dependencies).flat()).map(dep => dep.changeVersion(
|
|
482
|
+
const deps = (0, _lodash().compact)(tagDataPerComp.map(t => t.dependencies).flat()).map(dep => dep.changeVersion(_legacy2().LATEST));
|
|
497
483
|
const additionalComponentIdsToFetch = await Promise.all(componentIds.map(async id => {
|
|
498
484
|
if (!id.hasVersion()) return null;
|
|
499
485
|
const modelComp = await this.scope.getBitObjectModelComponent(id);
|
|
@@ -504,7 +490,7 @@ class SnappingMain {
|
|
|
504
490
|
throw new (_bitError().BitError)(`unable to tag "${id.toString()}", this version is older than the head ${modelComp.head.toString()}.
|
|
505
491
|
if you're willing to lose the history from the head to the specified version, use --ignore-newest-version flag`);
|
|
506
492
|
}
|
|
507
|
-
return id.changeVersion(
|
|
493
|
+
return id.changeVersion(_legacy2().LATEST);
|
|
508
494
|
}));
|
|
509
495
|
|
|
510
496
|
// import deps to be able to resolve semver
|
|
@@ -530,7 +516,7 @@ if you're willing to lose the history from the head to the specified version, us
|
|
|
530
516
|
const consumerComponents = components.map(c => c.state._consumer);
|
|
531
517
|
const shouldUsePopulateArtifactsFrom = components.every(comp => {
|
|
532
518
|
if (!comp.buildStatus) throw new Error(`tag-from-scope expect ${comp.id.toString()} to have buildStatus`);
|
|
533
|
-
return comp.buildStatus ===
|
|
519
|
+
return comp.buildStatus === _legacy2().BuildStatus.Succeed && !params.rebuildArtifacts;
|
|
534
520
|
});
|
|
535
521
|
const results = await (0, _tagModelComponent().tagModelComponent)(_objectSpread(_objectSpread({}, params), {}, {
|
|
536
522
|
components,
|
|
@@ -585,7 +571,7 @@ if you're willing to lose the history from the head to the specified version, us
|
|
|
585
571
|
try {
|
|
586
572
|
lane = await this.importer.importLaneObject(laneId);
|
|
587
573
|
} catch (err) {
|
|
588
|
-
if (err.constructor.name !==
|
|
574
|
+
if (err.constructor.name !== _legacy6().LaneNotFound.name) throw err;
|
|
589
575
|
// if the lane is not found, it's probably because it's new. create a new lane.
|
|
590
576
|
lane = await (0, _lanesModules().createLaneInScope)(laneId.name, this.scope, laneId.scope);
|
|
591
577
|
// it's important to set the lane as new in scope.json. otherwise, later, when importing and the lane is loaded
|
|
@@ -623,7 +609,7 @@ if you're willing to lose the history from the head to the specified version, us
|
|
|
623
609
|
|
|
624
610
|
const componentIds = (0, _lodash().compact)(snapDataPerComp.map(t => t.isNew ? null : t.componentId));
|
|
625
611
|
const allCompIds = snapDataPerComp.map(s => s.componentId);
|
|
626
|
-
const componentIdsLatest = componentIds.map(id => id.changeVersion(
|
|
612
|
+
const componentIdsLatest = componentIds.map(id => id.changeVersion(_legacy2().LATEST));
|
|
627
613
|
const newCompsData = (0, _lodash().compact)(snapDataPerComp.map(t => t.isNew ? t : null));
|
|
628
614
|
const newComponents = await Promise.all(newCompsData.map(newComp => (0, _generateCompFromScope().generateCompFromScope)(this.scope, newComp, this)));
|
|
629
615
|
await this.scope.import(componentIdsLatest, {
|
|
@@ -753,7 +739,7 @@ if you're willing to lose the history from the head to the specified version, us
|
|
|
753
739
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
754
740
|
if (pattern && legacyBitIds) throw new Error(`please pass either pattern or legacyBitIds, not both`);
|
|
755
741
|
const consumer = this.workspace.consumer;
|
|
756
|
-
const componentsList = new (
|
|
742
|
+
const componentsList = new (_legacy4().ComponentsList)(consumer);
|
|
757
743
|
const newComponents = await componentsList.listNewComponents();
|
|
758
744
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
759
745
|
const self = this;
|
|
@@ -889,8 +875,8 @@ in case you're unsure about the pattern syntax, use "bit pattern [--help]"`);
|
|
|
889
875
|
}
|
|
890
876
|
async resetNeverExported() {
|
|
891
877
|
const notExported = this.workspace.consumer.getNotExportedIds();
|
|
892
|
-
const hashes = notExported.map(id =>
|
|
893
|
-
await this.scope.legacyScope.objects.deleteObjectsFromFS(hashes.map(h =>
|
|
878
|
+
const hashes = notExported.map(id => _scope2().BitObject.makeHash(id.fullName));
|
|
879
|
+
await this.scope.legacyScope.objects.deleteObjectsFromFS(hashes.map(h => _scope2().Ref.from(h)));
|
|
894
880
|
notExported.map(id => this.workspace.consumer.bitMap.updateComponentId(id.changeVersion(undefined)));
|
|
895
881
|
await this.workspace.bitMap.write(`reset (never-exported)`);
|
|
896
882
|
return notExported;
|
|
@@ -982,7 +968,7 @@ in case you're unsure about the pattern syntax, use "bit pattern [--help]"`);
|
|
|
982
968
|
isPartOfHistory = lane ? await this.scope.legacyScope.isPartOfLaneHistoryOrMain(dep.id, lane) : await this.scope.legacyScope.isPartOfMainHistory(dep.id);
|
|
983
969
|
} catch (err) {
|
|
984
970
|
if (throwForMissingObjects) throw err;
|
|
985
|
-
if (err instanceof
|
|
971
|
+
if (err instanceof _legacy().VersionNotFound || err instanceof _legacy().ComponentNotFound || err instanceof _legacy().HeadNotFound || err instanceof _legacy().ParentNotFound) {
|
|
986
972
|
missingDeps.push(dep.id);
|
|
987
973
|
return;
|
|
988
974
|
}
|
|
@@ -1070,7 +1056,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1070
1056
|
tagResult.forEach(result => {
|
|
1071
1057
|
const matchingComponent = components.find(c => c.id.isEqual(result.id));
|
|
1072
1058
|
if (matchingComponent) {
|
|
1073
|
-
const existingBuilder = matchingComponent.extensions.findCoreExtension(
|
|
1059
|
+
const existingBuilder = matchingComponent.extensions.findCoreExtension(_legacy2().Extensions.builder);
|
|
1074
1060
|
if (existingBuilder) existingBuilder.data = result.builderData.data;else matchingComponent.extensions.push(result.builderData);
|
|
1075
1061
|
}
|
|
1076
1062
|
});
|
|
@@ -1078,8 +1064,8 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1078
1064
|
_getPublishedPackages(components) {
|
|
1079
1065
|
const publishedPackages = new Map();
|
|
1080
1066
|
for (const comp of components) {
|
|
1081
|
-
const builderExt = comp.extensions.findCoreExtension(
|
|
1082
|
-
const pkgData = builderExt?.data?.aspectsData?.find(a => a.aspectId ===
|
|
1067
|
+
const builderExt = comp.extensions.findCoreExtension(_legacy2().Extensions.builder);
|
|
1068
|
+
const pkgData = builderExt?.data?.aspectsData?.find(a => a.aspectId === _legacy2().Extensions.pkg);
|
|
1083
1069
|
if (pkgData?.data?.publishedPackage != null) {
|
|
1084
1070
|
publishedPackages.set(pkgData.data.publishedPackage, pkgData.data.integrity);
|
|
1085
1071
|
}
|
|
@@ -1105,7 +1091,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1105
1091
|
}
|
|
1106
1092
|
if (unmergedComponent.unrelated === true) {
|
|
1107
1093
|
// backward compatibility
|
|
1108
|
-
const unrelatedHead =
|
|
1094
|
+
const unrelatedHead = _scope2().Ref.from(source.previouslyUsedVersion);
|
|
1109
1095
|
version.setUnrelated({
|
|
1110
1096
|
head: unrelatedHead,
|
|
1111
1097
|
laneId: unmergedComponent.laneId
|
|
@@ -1123,7 +1109,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1123
1109
|
// this is adding a second parent to the version. the order is important. the first parent is coming from the current-lane.
|
|
1124
1110
|
version.addParent(unmergedComponent.head);
|
|
1125
1111
|
this.logger.debug(`sources.addSource, unmerged component "${component.name}". adding a parent ${unmergedComponent.head.hash}`);
|
|
1126
|
-
version.log.message = version.log.message ||
|
|
1112
|
+
version.log.message = version.log.message || _legacy().UnmergedComponents.buildSnapMessage(unmergedComponent);
|
|
1127
1113
|
}
|
|
1128
1114
|
this.scope.legacyScope.objects.unmergedComponents.removeComponent(component.toComponentId());
|
|
1129
1115
|
}
|
|
@@ -1187,7 +1173,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1187
1173
|
version.extensions = consumerComponent.extensions;
|
|
1188
1174
|
version.buildStatus = consumerComponent.buildStatus;
|
|
1189
1175
|
const artifactObjects = artifacts.map(file => file.source);
|
|
1190
|
-
const dependenciesGraph =
|
|
1176
|
+
const dependenciesGraph = _scope2().Version.dependenciesGraphToSource(consumerComponent.dependenciesGraph);
|
|
1191
1177
|
version.dependenciesGraphRef = dependenciesGraph ? dependenciesGraph.hash() : undefined;
|
|
1192
1178
|
const result = [version, ...artifactObjects];
|
|
1193
1179
|
if (dependenciesGraph) result.push(dependenciesGraph);
|
|
@@ -1217,7 +1203,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1217
1203
|
throwForPendingImport(components) {
|
|
1218
1204
|
const componentsMissingFromScope = components.filter(c => !c.componentFromModel && this.scope.isExported(c.id)).map(c => c.id.toString());
|
|
1219
1205
|
if (componentsMissingFromScope.length) {
|
|
1220
|
-
throw new (
|
|
1206
|
+
throw new (_legacy3().ComponentsPendingImport)(componentsMissingFromScope);
|
|
1221
1207
|
}
|
|
1222
1208
|
}
|
|
1223
1209
|
async throwForLegacyDependenciesInsideHarmony(components) {
|
|
@@ -1338,7 +1324,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1338
1324
|
Object.assign(existingExtension.data, data);
|
|
1339
1325
|
return;
|
|
1340
1326
|
}
|
|
1341
|
-
const extension = new (
|
|
1327
|
+
const extension = new (_legacy5().ExtensionDataEntry)(undefined, undefined, extId, undefined, data);
|
|
1342
1328
|
component.config.extensions.push(extension);
|
|
1343
1329
|
}
|
|
1344
1330
|
async getTagPendingComponentsIds(includeUnmodified = false) {
|
|
@@ -1352,7 +1338,7 @@ another option, in case this dependency is not in main yet is to remove all refe
|
|
|
1352
1338
|
}
|
|
1353
1339
|
async getComponentsToTag(includeUnmodified, exactVersion, persist, ids, snapped, unmerged) {
|
|
1354
1340
|
const warnings = [];
|
|
1355
|
-
const componentsList = new (
|
|
1341
|
+
const componentsList = new (_legacy4().ComponentsList)(this.workspace.consumer);
|
|
1356
1342
|
if (persist) {
|
|
1357
1343
|
const softTaggedComponents = this.workspace.filter.bySoftTagged();
|
|
1358
1344
|
return {
|