@teambit/snapping 0.0.1
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/index.d.ts +4 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/snap-cmd.d.ts +25 -0
- package/dist/snap-cmd.js +175 -0
- package/dist/snap-cmd.js.map +1 -0
- package/dist/snapping.aspect.d.ts +2 -0
- package/dist/snapping.aspect.js +24 -0
- package/dist/snapping.aspect.js.map +1 -0
- package/dist/snapping.main.runtime.d.ts +46 -0
- package/dist/snapping.main.runtime.js +643 -0
- package/dist/snapping.main.runtime.js.map +1 -0
- package/dist/tag-cmd.d.ts +30 -0
- package/dist/tag-cmd.js +302 -0
- package/dist/tag-cmd.js.map +1 -0
- package/package-tar/teambit-snapping-0.0.1.tgz +0 -0
- package/package.json +91 -0
- package/preview-1648092203429.js +1 -0
- package/tsconfig.json +34 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["snapping.main.runtime.ts"],"names":["HooksManagerInstance","HooksManager","getInstance","SnappingMain","constructor","workspace","logger","tag","tagParams","ConsumerNotFound","ids","all","exactVersion","force","scope","includeImported","persist","snapped","soft","idsHasWildcard","isAll","Boolean","validExactVersion","preHook","PRE_TAG_ALL_HOOK","PRE_TAG_HOOK","triggerHook","consumer","componentsList","ComponentsList","loader","start","newComponents","listNewComponents","bitIds","warnings","getComponentsToTag","R","isEmpty","legacyBitIds","BitIds","fromArray","isLegacy","debug","toString","Analytics","addBreadCrumb","hashData","componentFsCache","deleteAllDependenciesDataCache","components","loadComponentsForTag","throwForComponentIssues","ignoreIssues","areComponentsMissingFromScope","some","c","componentFromModel","id","hasScope","ComponentsPendingImport","taggedComponents","autoTaggedResults","publishedPackages","consumerComponents","legacyScope","tagResults","isSoftTag","postHook","POST_TAG_ALL_HOOK","POST_TAG_HOOK","setExtraData","concat","length","onDestroy","snap","resolveUnmerged","message","verbose","skipTests","skipAutoSnap","build","disableTagAndSnapPipelines","forceDeploy","Error","LanesIsDisabled","getIdsToSnap","ignoreNewestVersion","skipAutoTag","isSnap","snapResults","snappedComponents","autoSnappedResults","currentLane","getCurrentLaneId","laneName","isDefault","name","idHasWildcard","bitId","getParsedId","componentStatus","getComponentStatusById","modified","tagPendingComponents","listTagPendingComponents","filterComponentsByWildcard","loadComponents","toVersionLatest","shouldReloadComponents","componentsWithRelativePaths","componentsWithFilesNotDir","componentsWithCustomModuleResolution","forEach","component","componentMap","rootDir","hasRelativePaths","issues","getIssue","IssuesClasses","RelativeComponentsAuthored","hasCustomModuleResolutions","MissingCustomModuleResolutionLinks","trackDir","changeRootDirAndUpdateFilesAccordingly","push","toStringWithoutVersion","FailedLoadForTag","sort","clearCache","reloadedComponents","delete","issuesToIgnore","split","map","issue","trim","issueClass","Object","keys","join","componentsWithBlockingIssues","filter","shouldBlockTagging","ComponentsHaveIssues","isAllScope","softTaggedComponents","listSoftTaggedComponents","listTagPendingOfAllScope","listSnappedComponentsOnMain","snappedComponentsIds","toBitId","Promise","idWithoutVer","version","allIds","changeVersion","flat","tagPendingComponentsLatest","latestVersions","componentId","semver","valid","gt","undefined","provider","cli","community","loggerMain","createLogger","SnappingAspect","snapping","snapCmd","SnapCmd","getBaseDomain","tagCmd","TagCmd","register","WorkspaceAspect","CLIAspect","CommunityAspect","LoggerAspect","MainRuntime","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA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C,sBAA9C,C;gCAvTXnL,Y,aAwTMoL,kB;;AAWnBZ,2BAAea,UAAf,CAA0BrL,YAA1B","sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport CommunityAspect, { CommunityMain } from '@teambit/community';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport semver from 'semver';\nimport { compact } from 'lodash';\nimport { Analytics } from '@teambit/legacy/dist/analytics/analytics';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { POST_TAG_ALL_HOOK, POST_TAG_HOOK, PRE_TAG_ALL_HOOK, PRE_TAG_HOOK } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport HooksManager from '@teambit/legacy/dist/hooks';\nimport { TagParams, TagResults } from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { validateVersion } from '@teambit/legacy/dist/utils/semver-helper';\nimport { ConsumerNotFound, ComponentsHaveIssues } from '@teambit/legacy/dist/consumer/exceptions';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport tagModelComponent from '@teambit/legacy/dist/scope/component-ops/tag-model-component';\nimport { LanesIsDisabled } from '@teambit/legacy/dist/consumer/lanes/exceptions/lanes-is-disabled';\nimport { SnapResults } from '@teambit/legacy/dist/api/consumer/lib/snap';\nimport ComponentsPendingImport from '@teambit/legacy/dist/consumer/component-ops/exceptions/components-pending-import';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { FailedLoadForTag } from '@teambit/legacy/dist/consumer/component/exceptions/failed-load-for-tag';\nimport { SnapCmd } from './snap-cmd';\nimport { SnappingAspect } from './snapping.aspect';\nimport { TagCmd } from './tag-cmd';\n\nconst HooksManagerInstance = HooksManager.getInstance();\n\nexport class SnappingMain {\n constructor(private workspace: Workspace, private logger: Logger) {}\n\n /**\n * tag the given component ids or all modified/new components if \"all\" param is set.\n * tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias\n * with a valid semver to that version.\n * tag can be done only on main, not on a lane.\n */\n async tag(tagParams: TagParams): Promise<TagResults | null> {\n if (!this.workspace) throw new ConsumerNotFound();\n const { ids, all, exactVersion, force, scope, includeImported, persist, snapped, soft } = tagParams;\n const idsHasWildcard = hasWildcard(ids);\n const isAll = Boolean(all || scope || idsHasWildcard);\n const validExactVersion = validateVersion(exactVersion);\n const preHook = isAll ? PRE_TAG_ALL_HOOK : PRE_TAG_HOOK;\n HooksManagerInstance.triggerHook(preHook, tagParams);\n const consumer = this.workspace.consumer;\n const componentsList = new ComponentsList(consumer);\n loader.start('determine components to tag...');\n const newComponents = await componentsList.listNewComponents();\n const { bitIds, warnings } = await this.getComponentsToTag(\n Boolean(scope),\n exactVersion,\n includeImported,\n persist,\n force,\n ids,\n snapped\n );\n if (R.isEmpty(bitIds)) return null;\n\n const legacyBitIds = BitIds.fromArray(bitIds);\n\n if (this.workspace.isLegacy) {\n tagParams.persist = true;\n }\n this.logger.debug(`tagging the following components: ${legacyBitIds.toString()}`);\n Analytics.addBreadCrumb('tag', `tagging the following components: ${Analytics.hashData(legacyBitIds)}`);\n if (!soft) {\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n }\n const components = await this.loadComponentsForTag(legacyBitIds);\n this.throwForComponentIssues(components, tagParams.ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults, publishedPackages } = await tagModelComponent({\n ...tagParams,\n exactVersion: validExactVersion,\n ids: legacyBitIds,\n consumerComponents: components,\n scope: this.workspace.scope.legacyScope,\n consumer: this.workspace.consumer,\n });\n\n const tagResults = { taggedComponents, autoTaggedResults, isSoftTag: tagParams.soft, publishedPackages };\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.warnings = warnings;\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n tagResults.newComponents = newComponents;\n const postHook = isAll ? POST_TAG_ALL_HOOK : POST_TAG_HOOK;\n HooksManagerInstance.triggerHook(postHook, tagResults);\n Analytics.setExtraData(\n 'num_components',\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n R.concat(tagResults.taggedComponents, tagResults.autoTaggedResults, tagResults.newComponents).length\n );\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return tagResults;\n }\n\n /**\n * save the local changes of a component(s) into the scope. snap can be done on main or on a lane.\n * once a component is snapped on a lane, it becomes part of it.\n */\n async snap({\n id, // @todo: rename to \"patterns\"\n legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.\n resolveUnmerged = false,\n message = '',\n force = false,\n verbose = false,\n ignoreIssues,\n skipTests = false,\n skipAutoSnap = false,\n build,\n disableTagAndSnapPipelines = false,\n forceDeploy = false,\n }: {\n id?: string;\n legacyBitIds?: BitIds;\n resolveUnmerged?: boolean;\n message?: string;\n force?: boolean;\n verbose?: boolean;\n ignoreIssues?: string;\n build: boolean;\n skipTests?: boolean;\n skipAutoSnap?: boolean;\n disableTagAndSnapPipelines?: boolean;\n forceDeploy?: boolean;\n }): Promise<SnapResults | null> {\n if (!this.workspace) throw new ConsumerNotFound();\n if (id && legacyBitIds) throw new Error(`please pass either id or legacyBitIds, not both`);\n const consumer: Consumer = this.workspace.consumer;\n if (consumer.isLegacy) throw new LanesIsDisabled();\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents()) as BitIds;\n const ids = legacyBitIds || (await getIdsToSnap());\n if (!ids) return null;\n this.logger.debug(`snapping the following components: ${ids.toString()}`);\n await this.workspace.consumer.componentFsCache.deleteAllDependenciesDataCache();\n const components = await this.loadComponentsForTag(ids);\n this.throwForComponentIssues(components, ignoreIssues);\n const areComponentsMissingFromScope = components.some((c) => !c.componentFromModel && c.id.hasScope());\n if (areComponentsMissingFromScope) {\n throw new ComponentsPendingImport();\n }\n\n const { taggedComponents, autoTaggedResults } = await tagModelComponent({\n consumerComponents: components,\n ids,\n ignoreNewestVersion: false,\n scope: this.workspace.scope.legacyScope,\n message,\n force,\n consumer: this.workspace.consumer,\n skipTests,\n verbose,\n skipAutoTag: skipAutoSnap,\n persist: true,\n soft: false,\n build,\n resolveUnmerged,\n isSnap: true,\n disableTagAndSnapPipelines,\n forceDeploy,\n });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const snapResults: SnapResults = { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n\n snapResults.newComponents = newComponents;\n const currentLane = consumer.getCurrentLaneId();\n snapResults.laneName = currentLane.isDefault() ? null : currentLane.name;\n await consumer.onDestroy();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return snapResults;\n\n async function getIdsToSnap(): Promise<BitIds> {\n const idHasWildcard = id && hasWildcard(id);\n if (id && !idHasWildcard) {\n const bitId = consumer.getParsedId(id);\n if (!force) {\n const componentStatus = await consumer.getComponentStatusById(bitId);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (componentStatus.modified === false) return null;\n }\n return new BitIds(bitId);\n }\n const tagPendingComponents = await componentsList.listTagPendingComponents();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(tagPendingComponents)) return null;\n return idHasWildcard ? ComponentsList.filterComponentsByWildcard(tagPendingComponents, id) : tagPendingComponents;\n }\n }\n\n private async loadComponentsForTag(ids: BitIds): Promise<Component[]> {\n const { components } = await this.workspace.consumer.loadComponents(ids.toVersionLatest());\n if (this.workspace.isLegacy) {\n return components;\n }\n let shouldReloadComponents = false;\n const componentsWithRelativePaths: string[] = [];\n const componentsWithFilesNotDir: string[] = [];\n const componentsWithCustomModuleResolution: string[] = [];\n components.forEach((component) => {\n const componentMap = component.componentMap as ComponentMap;\n if (componentMap.rootDir) return;\n const hasRelativePaths = component.issues?.getIssue(IssuesClasses.RelativeComponentsAuthored);\n const hasCustomModuleResolutions = component.issues?.getIssue(IssuesClasses.MissingCustomModuleResolutionLinks);\n // leaving this because it can be helpful for users upgrade from legacy\n if (componentMap.trackDir && !hasRelativePaths) {\n componentMap.changeRootDirAndUpdateFilesAccordingly(componentMap.trackDir);\n shouldReloadComponents = true;\n return;\n }\n if (hasRelativePaths) {\n componentsWithRelativePaths.push(component.id.toStringWithoutVersion());\n }\n if (!componentMap.trackDir) {\n componentsWithFilesNotDir.push(component.id.toStringWithoutVersion());\n }\n if (hasCustomModuleResolutions) {\n componentsWithCustomModuleResolution.push(component.id.toStringWithoutVersion());\n }\n });\n if (componentsWithRelativePaths.length || componentsWithFilesNotDir.length) {\n throw new FailedLoadForTag(\n componentsWithRelativePaths.sort(),\n componentsWithFilesNotDir.sort(),\n componentsWithCustomModuleResolution.sort()\n );\n }\n if (!shouldReloadComponents) return components;\n this.workspace.clearCache();\n const { components: reloadedComponents } = await this.workspace.consumer.loadComponents(ids);\n return reloadedComponents;\n }\n\n private throwForComponentIssues(components: Component[], ignoreIssues?: string) {\n components.forEach((component) => {\n if (this.workspace.isLegacy && component.issues) {\n component.issues.delete(IssuesClasses.RelativeComponentsAuthored);\n }\n });\n if (ignoreIssues === '*') {\n // ignore all issues\n return;\n }\n const issuesToIgnore = ignoreIssues?.split(',').map((issue) => issue.trim());\n issuesToIgnore?.forEach((issue) => {\n const issueClass = IssuesClasses[issue];\n if (!issueClass) {\n throw new Error(\n `unrecognized component-issue \"${issue}\". please specify one of the following:\\n${Object.keys(\n IssuesClasses\n ).join('\\n')}`\n );\n }\n components.forEach((component) => {\n component.issues.delete(issueClass);\n });\n });\n const componentsWithBlockingIssues = components.filter((component) => component.issues?.shouldBlockTagging());\n if (!R.isEmpty(componentsWithBlockingIssues)) {\n throw new ComponentsHaveIssues(componentsWithBlockingIssues);\n }\n }\n\n private async getComponentsToTag(\n isAllScope: boolean,\n exactVersion: string | undefined,\n includeImported: boolean,\n persist: boolean,\n force: boolean,\n ids: string[],\n snapped: boolean\n ): Promise<{ bitIds: BitId[]; warnings: string[] }> {\n const warnings: string[] = [];\n const componentsList = new ComponentsList(this.workspace.consumer);\n if (persist) {\n const softTaggedComponents = componentsList.listSoftTaggedComponents();\n return { bitIds: softTaggedComponents, warnings: [] };\n }\n\n const tagPendingComponents = isAllScope\n ? await componentsList.listTagPendingOfAllScope(includeImported)\n : await componentsList.listTagPendingComponents();\n\n const snappedComponents = await componentsList.listSnappedComponentsOnMain();\n const snappedComponentsIds = snappedComponents.map((c) => c.toBitId());\n\n if (ids.length) {\n const bitIds = await Promise.all(\n ids.map(async (id) => {\n const [idWithoutVer, version] = id.split('@');\n const idHasWildcard = hasWildcard(id);\n if (idHasWildcard) {\n const allIds = ComponentsList.filterComponentsByWildcard(tagPendingComponents, idWithoutVer);\n return allIds.map((bitId) => bitId.changeVersion(version));\n }\n const bitId = this.workspace.consumer.getParsedId(idWithoutVer);\n if (!force) {\n const componentStatus = await this.workspace.consumer.getComponentStatusById(bitId);\n if (componentStatus.modified === false) return null;\n }\n return bitId.changeVersion(version);\n })\n );\n\n return { bitIds: compact(bitIds.flat()), warnings };\n }\n\n if (snapped) {\n return { bitIds: snappedComponentsIds, warnings };\n }\n\n tagPendingComponents.push(...snappedComponentsIds);\n\n if (isAllScope && exactVersion) {\n const tagPendingComponentsLatest = await this.workspace.scope.legacyScope.latestVersions(\n tagPendingComponents,\n false\n );\n tagPendingComponentsLatest.forEach((componentId) => {\n if (componentId.version && semver.valid(componentId.version) && semver.gt(componentId.version, exactVersion)) {\n warnings.push(`warning: ${componentId.toString()} has a version greater than ${exactVersion}`);\n }\n });\n }\n\n return { bitIds: tagPendingComponents.map((id) => id.changeVersion(undefined)), warnings };\n }\n\n static slots = [];\n static dependencies = [WorkspaceAspect, CLIAspect, CommunityAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([workspace, cli, community, loggerMain]: [Workspace, CLIMain, CommunityMain, LoggerMain]) {\n const logger = loggerMain.createLogger(SnappingAspect.id);\n const snapping = new SnappingMain(workspace, logger);\n const snapCmd = new SnapCmd(community.getBaseDomain(), snapping);\n const tagCmd = new TagCmd(community.getBaseDomain(), snapping);\n cli.register(tagCmd, snapCmd);\n return snapping;\n }\n}\n\nSnappingAspect.addRuntime(SnappingMain);\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { BasicTagParams } from '@teambit/legacy/dist/api/consumer/lib/tag';
|
|
3
|
+
import { SnappingMain } from './snapping.main.runtime';
|
|
4
|
+
export declare class TagCmd implements Command {
|
|
5
|
+
private snapping;
|
|
6
|
+
name: string;
|
|
7
|
+
group: string;
|
|
8
|
+
shortDescription: string;
|
|
9
|
+
description: string;
|
|
10
|
+
alias: string;
|
|
11
|
+
loader: boolean;
|
|
12
|
+
options: CommandOptions;
|
|
13
|
+
migration: boolean;
|
|
14
|
+
remoteOp: boolean;
|
|
15
|
+
constructor(docsDomain: string, snapping: SnappingMain);
|
|
16
|
+
report([id]: [string[]], { message, ver, all, editor, snapped, patch, minor, major, preRelease, force, verbose, ignoreUnresolvedDependencies, ignoreIssues, ignoreNewestVersion, skipTests, skipAutoTag, scope, build, soft, persist, disableDeployPipeline, disableTagPipeline, forceDeploy, incrementBy, }: {
|
|
17
|
+
all?: boolean | string;
|
|
18
|
+
snapped?: boolean | string;
|
|
19
|
+
ver?: string;
|
|
20
|
+
patch?: boolean;
|
|
21
|
+
minor?: boolean;
|
|
22
|
+
major?: boolean;
|
|
23
|
+
ignoreUnresolvedDependencies?: boolean;
|
|
24
|
+
ignoreIssues?: string;
|
|
25
|
+
scope?: string | boolean;
|
|
26
|
+
incrementBy?: number;
|
|
27
|
+
disableDeployPipeline?: boolean;
|
|
28
|
+
disableTagPipeline?: boolean;
|
|
29
|
+
} & Partial<BasicTagParams>): Promise<string>;
|
|
30
|
+
}
|
package/dist/tag-cmd.js
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol.description.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.array.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.promise.js");
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.TagCmd = void 0;
|
|
15
|
+
|
|
16
|
+
function _defineProperty2() {
|
|
17
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
+
|
|
19
|
+
_defineProperty2 = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _chalk() {
|
|
27
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
28
|
+
|
|
29
|
+
_chalk = function () {
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function _semver() {
|
|
37
|
+
const data = _interopRequireDefault(require("semver"));
|
|
38
|
+
|
|
39
|
+
_semver = function () {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _tag() {
|
|
47
|
+
const data = require("@teambit/legacy/dist/api/consumer/lib/tag");
|
|
48
|
+
|
|
49
|
+
_tag = function () {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _utils() {
|
|
57
|
+
const data = require("@teambit/legacy/dist/utils");
|
|
58
|
+
|
|
59
|
+
_utils = function () {
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _constants() {
|
|
67
|
+
const data = require("@teambit/legacy/dist/constants");
|
|
68
|
+
|
|
69
|
+
_constants = function () {
|
|
70
|
+
return data;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _generalError() {
|
|
77
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/error/general-error"));
|
|
78
|
+
|
|
79
|
+
_generalError = function () {
|
|
80
|
+
return data;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return data;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _featureToggle() {
|
|
87
|
+
const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
|
|
88
|
+
|
|
89
|
+
_featureToggle = function () {
|
|
90
|
+
return data;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function _componentIssues() {
|
|
97
|
+
const data = require("@teambit/component-issues");
|
|
98
|
+
|
|
99
|
+
_componentIssues = function () {
|
|
100
|
+
return data;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return data;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
class TagCmd {
|
|
107
|
+
// In case a compiler / tester is not installed
|
|
108
|
+
constructor(docsDomain, snapping) {
|
|
109
|
+
this.snapping = snapping;
|
|
110
|
+
(0, _defineProperty2().default)(this, "name", 'tag [id...]');
|
|
111
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
112
|
+
(0, _defineProperty2().default)(this, "shortDescription", 'record component changes and lock versions');
|
|
113
|
+
(0, _defineProperty2().default)(this, "description", void 0);
|
|
114
|
+
(0, _defineProperty2().default)(this, "alias", 't');
|
|
115
|
+
(0, _defineProperty2().default)(this, "loader", true);
|
|
116
|
+
(0, _defineProperty2().default)(this, "options", [['m', 'message <message>', 'log message describing the user changes'], ['a', 'all [version]', 'tag all new and modified components'], ['s', 'scope [version]', 'tag all components of the current scope'], ['', 'editor [editor]', 'EXPERIMENTAL. open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim'], ['', 'snapped [version]', 'tag components that their head is a snap (not a tag)'], ['', 'ver <version>', 'tag specified components with the given version'], ['p', 'patch', 'increment the patch version number'], ['', 'minor', 'increment the minor version number'], ['', 'major', 'increment the major version number'], ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'], ['f', 'force', 'force-tag even if tests are failing and even when component has not changed'], ['v', 'verbose', 'show specs output on failure'], ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'skip-auto-tag', 'skip auto tagging dependents'], ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'], ['', 'soft', 'do not persist. only keep note of the changes to be made'], ['', 'persist', 'persist the changes generated by --soft tag'], ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'], ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'], ['', 'force-deploy', 'run the tag pipeline although the build failed'], ['', 'increment-by <number>', '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.'], ['i', 'ignore-issues [issues]', `ignore component issues (shown in "bit status" as "issues found"), issues to ignore:
|
|
117
|
+
[${Object.keys(_componentIssues().IssuesClasses).join(', ')}]
|
|
118
|
+
to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "*".`]]);
|
|
119
|
+
(0, _defineProperty2().default)(this, "migration", true);
|
|
120
|
+
(0, _defineProperty2().default)(this, "remoteOp", true);
|
|
121
|
+
this.description = `record component changes and lock versions.
|
|
122
|
+
if component ids are entered, you can specify a version per id using "@" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major
|
|
123
|
+
https://${docsDomain}/components/tags
|
|
124
|
+
${(0, _constants().WILDCARD_HELP)('tag')}`;
|
|
125
|
+
} // eslint-disable-next-line complexity
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
async report([id = []], {
|
|
129
|
+
message = '',
|
|
130
|
+
ver,
|
|
131
|
+
all = false,
|
|
132
|
+
editor = '',
|
|
133
|
+
snapped = false,
|
|
134
|
+
patch,
|
|
135
|
+
minor,
|
|
136
|
+
major,
|
|
137
|
+
preRelease,
|
|
138
|
+
force = false,
|
|
139
|
+
verbose = false,
|
|
140
|
+
ignoreUnresolvedDependencies,
|
|
141
|
+
ignoreIssues,
|
|
142
|
+
ignoreNewestVersion = false,
|
|
143
|
+
skipTests = false,
|
|
144
|
+
skipAutoTag = false,
|
|
145
|
+
scope,
|
|
146
|
+
build,
|
|
147
|
+
soft = false,
|
|
148
|
+
persist = false,
|
|
149
|
+
disableDeployPipeline = false,
|
|
150
|
+
disableTagPipeline = false,
|
|
151
|
+
forceDeploy = false,
|
|
152
|
+
incrementBy = 1
|
|
153
|
+
}) {
|
|
154
|
+
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
|
155
|
+
if (soft) build = false;
|
|
156
|
+
|
|
157
|
+
function getVersion() {
|
|
158
|
+
if (scope && (0, _utils().isString)(scope)) return scope;
|
|
159
|
+
if (all && (0, _utils().isString)(all)) return all;
|
|
160
|
+
if (snapped && (0, _utils().isString)(snapped)) return snapped;
|
|
161
|
+
return ver;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (!id.length && !all && !snapped && !scope && !persist) {
|
|
165
|
+
throw new (_generalError().default)('missing [id]. to tag all components, please use --all flag');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (id.length && all) {
|
|
169
|
+
throw new (_generalError().default)('you can use either a specific component [id] to tag a particular component or --all flag to tag them all');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (typeof ignoreUnresolvedDependencies === 'boolean') {
|
|
173
|
+
throw new Error(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (ignoreIssues && typeof ignoreIssues === 'boolean') {
|
|
177
|
+
throw new Error(`--ignore-issues expects issues to be ignored, please run "bit tag -h" for the issues list`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (id.length === 2) {
|
|
181
|
+
const secondArg = id[1]; // previously, the synopsis of this command was `bit tag [id] [version]`, show a descriptive
|
|
182
|
+
// error when users still use it.
|
|
183
|
+
|
|
184
|
+
if (_semver().default.valid(secondArg)) {
|
|
185
|
+
throw new (_generalError().default)(`seems like you entered a version as the second arg, this is not supported anymore, please use "@" sign or --ver flag instead`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;
|
|
190
|
+
|
|
191
|
+
if (disableTagAndSnapPipelines && forceDeploy) {
|
|
192
|
+
throw new (_generalError().default)('you can use either force-deploy or disable-tag-pipeline, but not both');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (all && persist) {
|
|
196
|
+
throw new (_generalError().default)('you can use either --all or --persist, but not both');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (editor && persist) {
|
|
200
|
+
throw new (_generalError().default)('you can use either --editor or --persist, but not both');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (editor && message) {
|
|
204
|
+
throw new (_generalError().default)('you can use either --editor or --message, but not both');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const releaseFlags = [patch, minor, major, preRelease].filter(x => x);
|
|
208
|
+
|
|
209
|
+
if (releaseFlags.length > 1) {
|
|
210
|
+
throw new (_generalError().default)('you can use only one of the following - patch, minor, major, pre-release');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
let releaseType = _constants().DEFAULT_BIT_RELEASE_TYPE;
|
|
214
|
+
|
|
215
|
+
const includeImported = Boolean(scope && all);
|
|
216
|
+
if (major) releaseType = 'major';else if (minor) releaseType = 'minor';else if (patch) releaseType = 'patch';else if (preRelease) releaseType = 'prerelease';
|
|
217
|
+
const params = {
|
|
218
|
+
ids: id,
|
|
219
|
+
all: Boolean(all),
|
|
220
|
+
snapped: Boolean(snapped),
|
|
221
|
+
editor,
|
|
222
|
+
message,
|
|
223
|
+
exactVersion: getVersion(),
|
|
224
|
+
releaseType,
|
|
225
|
+
preRelease: typeof preRelease === 'string' ? preRelease : '',
|
|
226
|
+
force,
|
|
227
|
+
verbose,
|
|
228
|
+
ignoreIssues,
|
|
229
|
+
ignoreNewestVersion,
|
|
230
|
+
skipTests,
|
|
231
|
+
skipAutoTag,
|
|
232
|
+
build,
|
|
233
|
+
soft,
|
|
234
|
+
persist,
|
|
235
|
+
scope,
|
|
236
|
+
includeImported,
|
|
237
|
+
disableTagAndSnapPipelines,
|
|
238
|
+
forceDeploy,
|
|
239
|
+
incrementBy
|
|
240
|
+
};
|
|
241
|
+
const results = await this.snapping.tag(params);
|
|
242
|
+
if (!results) return _chalk().default.yellow(_tag().NOTHING_TO_TAG_MSG);
|
|
243
|
+
const {
|
|
244
|
+
taggedComponents,
|
|
245
|
+
autoTaggedResults,
|
|
246
|
+
warnings,
|
|
247
|
+
newComponents
|
|
248
|
+
} = results;
|
|
249
|
+
const changedComponents = taggedComponents.filter(component => !newComponents.searchWithoutVersion(component.id));
|
|
250
|
+
const addedComponents = taggedComponents.filter(component => newComponents.searchWithoutVersion(component.id));
|
|
251
|
+
const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;
|
|
252
|
+
const warningsOutput = warnings && warnings.length ? `${_chalk().default.yellow(warnings.join('\n'))}\n\n` : '';
|
|
253
|
+
const tagExplanationPersist = `\n(use "bit export [collection]" to push these components to a remote")
|
|
254
|
+
(use "bit untag" to unstage versions)\n`;
|
|
255
|
+
const tagExplanationSoft = `\n(use "bit tag --persist" to persist the changes")
|
|
256
|
+
(use "bit untag --soft" to remove the soft-tags)\n`;
|
|
257
|
+
const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;
|
|
258
|
+
|
|
259
|
+
const outputComponents = comps => {
|
|
260
|
+
return comps.map(component => {
|
|
261
|
+
let componentOutput = ` > ${component.id.toString()}`;
|
|
262
|
+
const autoTag = autoTaggedResults.filter(result => result.triggeredBy.searchWithoutScopeAndVersion(component.id));
|
|
263
|
+
|
|
264
|
+
if (autoTag.length) {
|
|
265
|
+
const autoTagComp = autoTag.map(a => a.component.id.toString());
|
|
266
|
+
componentOutput += `\n ${_tag().AUTO_TAGGED_MSG}:
|
|
267
|
+
${autoTagComp.join('\n ')}`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return componentOutput;
|
|
271
|
+
}).join('\n');
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const publishOutput = () => {
|
|
275
|
+
const {
|
|
276
|
+
publishedPackages
|
|
277
|
+
} = results;
|
|
278
|
+
if (!publishedPackages || !publishedPackages.length) return '';
|
|
279
|
+
const successTitle = `\n\n${_chalk().default.green(`published the following ${publishedPackages.length} component(s) successfully\n`)}`;
|
|
280
|
+
const successCompsStr = publishedPackages.join('\n');
|
|
281
|
+
const successOutput = successCompsStr ? successTitle + successCompsStr : '';
|
|
282
|
+
return successOutput;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';
|
|
286
|
+
|
|
287
|
+
const outputIfExists = (label, explanation, components) => {
|
|
288
|
+
if (!components.length) return '';
|
|
289
|
+
return `\n${_chalk().default.underline(softTagPrefix + label)}\n(${explanation})\n${outputComponents(components)}\n`;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
const newDesc = results.isSoftTag ? 'set to be tagged first version for components' : 'first version for components';
|
|
293
|
+
const changedDesc = results.isSoftTag ? 'components that set to get a version bump' : 'components that got a version bump';
|
|
294
|
+
const softTagClarification = results.isSoftTag ? _chalk().default.bold('keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag') : '';
|
|
295
|
+
return warningsOutput + _chalk().default.green(`${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`) + tagExplanation + outputIfExists('new components', newDesc, addedComponents) + outputIfExists('changed components', changedDesc, changedComponents) + publishOutput() + softTagClarification;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
exports.TagCmd = TagCmd;
|
|
301
|
+
|
|
302
|
+
//# sourceMappingURL=tag-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tag-cmd.ts"],"names":["TagCmd","constructor","docsDomain","snapping","Object","keys","IssuesClasses","join","description","report","id","message","ver","all","editor","snapped","patch","minor","major","preRelease","force","verbose","ignoreUnresolvedDependencies","ignoreIssues","ignoreNewestVersion","skipTests","skipAutoTag","scope","build","soft","persist","disableDeployPipeline","disableTagPipeline","forceDeploy","incrementBy","BUILD_ON_CI","Boolean","getVersion","length","GeneralError","Error","secondArg","semver","valid","disableTagAndSnapPipelines","releaseFlags","filter","x","releaseType","DEFAULT_BIT_RELEASE_TYPE","includeImported","params","ids","exactVersion","results","tag","chalk","yellow","NOTHING_TO_TAG_MSG","taggedComponents","autoTaggedResults","warnings","newComponents","changedComponents","component","searchWithoutVersion","addedComponents","autoTaggedCount","warningsOutput","tagExplanationPersist","tagExplanationSoft","tagExplanation","isSoftTag","outputComponents","comps","map","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutScopeAndVersion","autoTagComp","a","AUTO_TAGGED_MSG","publishOutput","publishedPackages","successTitle","green","successCompsStr","successOutput","softTagPrefix","outputIfExists","label","explanation","components","underline","newDesc","changedDesc","softTagClarification","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,MAAN,CAAgC;AA+CpB;AAEjBC,EAAAA,WAAW,CAACC,UAAD,EAA6BC,QAA7B,EAAqD;AAAA,SAAxBA,QAAwB,GAAxBA,QAAwB;AAAA,kDAhDzD,aAgDyD;AAAA,mDA/CxD,aA+CwD;AAAA,8DA9C7C,4CA8C6C;AAAA;AAAA,mDA5CxD,GA4CwD;AAAA,oDA3CvD,IA2CuD;AAAA,qDA1CtD,CACR,CAAC,GAAD,EAAM,mBAAN,EAA2B,yCAA3B,CADQ,EAER,CAAC,GAAD,EAAM,eAAN,EAAuB,qCAAvB,CAFQ,EAGR,CAAC,GAAD,EAAM,iBAAN,EAAyB,yCAAzB,CAHQ,EAIR,CACE,EADF,EAEE,iBAFF,EAGE,yHAHF,CAJQ,EASR,CAAC,EAAD,EAAK,mBAAL,EAA0B,sDAA1B,CATQ,EAUR,CAAC,EAAD,EAAK,eAAL,EAAsB,iDAAtB,CAVQ,EAWR,CAAC,GAAD,EAAM,OAAN,EAAe,oCAAf,CAXQ,EAYR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAZQ,EAaR,CAAC,EAAD,EAAK,OAAL,EAAc,oCAAd,CAbQ,EAcR,CAAC,E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AIAD,cAJA,GAKAqB,cAAc,CAAC,gBAAD,EAAmBK,OAAnB,EAA4B/B,eAA5B,CALd,GAMA0B,cAAc,CAAC,oBAAD,EAAuBM,WAAvB,EAAoCnC,iBAApC,CANd,GAOAsB,aAAa,EAPb,GAQAc,oBATF;AAWD;;AA/PoC","sourcesContent":["import chalk from 'chalk';\nimport semver, { ReleaseType } from 'semver';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport {\n TagResults,\n NOTHING_TO_TAG_MSG,\n AUTO_TAGGED_MSG,\n BasicTagParams,\n} from '@teambit/legacy/dist/api/consumer/lib/tag';\nimport { isString } from '@teambit/legacy/dist/utils';\nimport { DEFAULT_BIT_RELEASE_TYPE, WILDCARD_HELP } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { isFeatureEnabled, BUILD_ON_CI } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { SnappingMain } from './snapping.main.runtime';\n\nexport class TagCmd implements Command {\n name = 'tag [id...]';\n group = 'development';\n shortDescription = 'record component changes and lock versions';\n description: string;\n alias = 't';\n loader = true;\n options = [\n ['m', 'message <message>', 'log message describing the user changes'],\n ['a', 'all [version]', 'tag all new and modified components'],\n ['s', 'scope [version]', 'tag all components of the current scope'],\n [\n '',\n 'editor [editor]',\n 'EXPERIMENTAL. open an editor to edit the tag messages per component, optionally specify the editor-name, default to vim',\n ],\n ['', 'snapped [version]', 'tag components that their head is a snap (not a tag)'],\n ['', 'ver <version>', 'tag specified components with the given version'],\n ['p', 'patch', 'increment the patch version number'],\n ['', 'minor', 'increment the minor version number'],\n ['', 'major', 'increment the major version number'],\n ['', 'pre-release [identifier]', 'EXPERIMENTAL. increment a pre-release version (e.g. 1.0.0-dev.1)'],\n ['f', 'force', 'force-tag even if tests are failing and even when component has not changed'],\n ['v', 'verbose', 'show specs output on failure'],\n ['I', 'ignore-newest-version', 'ignore existing of newer versions (default = false)'],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n ['', 'skip-auto-tag', 'skip auto tagging dependents'],\n ['b', 'build', 'EXPERIMENTAL. not needed for now. run the pipeline build and complete the tag'],\n ['', 'soft', 'do not persist. only keep note of the changes to be made'],\n ['', 'persist', 'persist the changes generated by --soft tag'],\n ['', 'disable-deploy-pipeline', 'DEPRECATED. use --disable-tag-pipeline instead'],\n ['', 'disable-tag-pipeline', 'skip the tag pipeline to avoid publishing the components'],\n ['', 'force-deploy', 'run the tag pipeline although the build failed'],\n [\n '',\n 'increment-by <number>',\n '(default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.',\n ],\n [\n 'i',\n 'ignore-issues [issues]',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n ] as CommandOptions;\n migration = true;\n remoteOp = true; // In case a compiler / tester is not installed\n\n constructor(docsDomain: string, private snapping: SnappingMain) {\n this.description = `record component changes and lock versions.\nif component ids are entered, you can specify a version per id using \"@\" sign, e.g. bit tag foo@1.0.0 bar@minor baz@major\nhttps://${docsDomain}/components/tags\n${WILDCARD_HELP('tag')}`;\n }\n\n // eslint-disable-next-line complexity\n async report(\n [id = []]: [string[]],\n {\n message = '',\n ver,\n all = false,\n editor = '',\n snapped = false,\n patch,\n minor,\n major,\n preRelease,\n force = false,\n verbose = false,\n ignoreUnresolvedDependencies,\n ignoreIssues,\n ignoreNewestVersion = false,\n skipTests = false,\n skipAutoTag = false,\n scope,\n build,\n soft = false,\n persist = false,\n disableDeployPipeline = false,\n disableTagPipeline = false,\n forceDeploy = false,\n incrementBy = 1,\n }: {\n all?: boolean | string;\n snapped?: boolean | string;\n ver?: string;\n patch?: boolean;\n minor?: boolean;\n major?: boolean;\n ignoreUnresolvedDependencies?: boolean;\n ignoreIssues?: string;\n scope?: string | boolean;\n incrementBy?: number;\n disableDeployPipeline?: boolean;\n disableTagPipeline?: boolean;\n } & Partial<BasicTagParams>\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n if (soft) build = false;\n function getVersion(): string | undefined {\n if (scope && isString(scope)) return scope;\n if (all && isString(all)) return all;\n if (snapped && isString(snapped)) return snapped;\n return ver;\n }\n\n if (!id.length && !all && !snapped && !scope && !persist) {\n throw new GeneralError('missing [id]. to tag all components, please use --all flag');\n }\n if (id.length && all) {\n throw new GeneralError(\n 'you can use either a specific component [id] to tag a particular component or --all flag to tag them all'\n );\n }\n if (typeof ignoreUnresolvedDependencies === 'boolean') {\n throw new Error(`--ignore-unresolved-dependencies has been removed, please use --ignore-issues instead`);\n }\n if (ignoreIssues && typeof ignoreIssues === 'boolean') {\n throw new Error(`--ignore-issues expects issues to be ignored, please run \"bit tag -h\" for the issues list`);\n }\n if (id.length === 2) {\n const secondArg = id[1];\n // previously, the synopsis of this command was `bit tag [id] [version]`, show a descriptive\n // error when users still use it.\n if (semver.valid(secondArg)) {\n throw new GeneralError(\n `seems like you entered a version as the second arg, this is not supported anymore, please use \"@\" sign or --ver flag instead`\n );\n }\n }\n const disableTagAndSnapPipelines = disableTagPipeline || disableDeployPipeline;\n if (disableTagAndSnapPipelines && forceDeploy) {\n throw new GeneralError('you can use either force-deploy or disable-tag-pipeline, but not both');\n }\n if (all && persist) {\n throw new GeneralError('you can use either --all or --persist, but not both');\n }\n if (editor && persist) {\n throw new GeneralError('you can use either --editor or --persist, but not both');\n }\n if (editor && message) {\n throw new GeneralError('you can use either --editor or --message, but not both');\n }\n\n const releaseFlags = [patch, minor, major, preRelease].filter((x) => x);\n if (releaseFlags.length > 1) {\n throw new GeneralError('you can use only one of the following - patch, minor, major, pre-release');\n }\n\n let releaseType: ReleaseType = DEFAULT_BIT_RELEASE_TYPE;\n const includeImported = Boolean(scope && all);\n\n if (major) releaseType = 'major';\n else if (minor) releaseType = 'minor';\n else if (patch) releaseType = 'patch';\n else if (preRelease) releaseType = 'prerelease';\n\n const params = {\n ids: id,\n all: Boolean(all),\n snapped: Boolean(snapped),\n editor,\n message,\n exactVersion: getVersion(),\n releaseType,\n preRelease: typeof preRelease === 'string' ? preRelease : '',\n force,\n verbose,\n ignoreIssues,\n ignoreNewestVersion,\n skipTests,\n skipAutoTag,\n build,\n soft,\n persist,\n scope,\n includeImported,\n disableTagAndSnapPipelines,\n forceDeploy,\n incrementBy,\n };\n\n const results = await this.snapping.tag(params);\n if (!results) return chalk.yellow(NOTHING_TO_TAG_MSG);\n const { taggedComponents, autoTaggedResults, warnings, newComponents }: TagResults = results;\n const changedComponents = taggedComponents.filter((component) => !newComponents.searchWithoutVersion(component.id));\n const addedComponents = taggedComponents.filter((component) => newComponents.searchWithoutVersion(component.id));\n const autoTaggedCount = autoTaggedResults ? autoTaggedResults.length : 0;\n\n const warningsOutput = warnings && warnings.length ? `${chalk.yellow(warnings.join('\\n'))}\\n\\n` : '';\n const tagExplanationPersist = `\\n(use \"bit export [collection]\" to push these components to a remote\")\n(use \"bit untag\" to unstage versions)\\n`;\n const tagExplanationSoft = `\\n(use \"bit tag --persist\" to persist the changes\")\n(use \"bit untag --soft\" to remove the soft-tags)\\n`;\n\n const tagExplanation = results.isSoftTag ? tagExplanationSoft : tagExplanationPersist;\n\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoTaggedResults.filter((result) =>\n result.triggeredBy.searchWithoutScopeAndVersion(component.id)\n );\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_TAGGED_MSG}:\n ${autoTagComp.join('\\n ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n const publishOutput = () => {\n const { publishedPackages } = results;\n if (!publishedPackages || !publishedPackages.length) return '';\n const successTitle = `\\n\\n${chalk.green(\n `published the following ${publishedPackages.length} component(s) successfully\\n`\n )}`;\n const successCompsStr = publishedPackages.join('\\n');\n const successOutput = successCompsStr ? successTitle + successCompsStr : '';\n return successOutput;\n };\n\n const softTagPrefix = results.isSoftTag ? 'soft-tagged ' : '';\n const outputIfExists = (label, explanation, components) => {\n if (!components.length) return '';\n return `\\n${chalk.underline(softTagPrefix + label)}\\n(${explanation})\\n${outputComponents(components)}\\n`;\n };\n\n const newDesc = results.isSoftTag\n ? 'set to be tagged first version for components'\n : 'first version for components';\n const changedDesc = results.isSoftTag\n ? 'components that set to get a version bump'\n : 'components that got a version bump';\n const softTagClarification = results.isSoftTag\n ? chalk.bold(\n 'keep in mind that this is a soft-tag (changes recorded to be tagged), to persist the changes use --persist flag'\n )\n : '';\n return (\n warningsOutput +\n chalk.green(\n `${taggedComponents.length + autoTaggedCount} component(s) ${results.isSoftTag ? 'soft-' : ''}tagged`\n ) +\n tagExplanation +\n outputIfExists('new components', newDesc, addedComponents) +\n outputIfExists('changed components', changedDesc, changedComponents) +\n publishOutput() +\n softTagClarification\n );\n }\n}\n"]}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/snapping",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.component",
|
|
7
|
+
"name": "snapping",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"chalk": "2.4.2",
|
|
12
|
+
"@teambit/harmony": "0.2.11",
|
|
13
|
+
"lodash": "4.17.21",
|
|
14
|
+
"ramda": "0.27.1",
|
|
15
|
+
"semver": "7.3.4",
|
|
16
|
+
"@babel/runtime": "7.12.18",
|
|
17
|
+
"core-js": "^3.0.0",
|
|
18
|
+
"@teambit/bit-error": "0.0.394",
|
|
19
|
+
"@teambit/cli": "0.0.460",
|
|
20
|
+
"@teambit/component-issues": "0.0.48",
|
|
21
|
+
"@teambit/community": "0.0.8",
|
|
22
|
+
"@teambit/logger": "0.0.552",
|
|
23
|
+
"@teambit/workspace": "0.0.686"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/lodash": "4.14.165",
|
|
27
|
+
"@types/semver": "7.3.4",
|
|
28
|
+
"@types/mocha": "9.1.0",
|
|
29
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
30
|
+
"@types/jest": "^26.0.0",
|
|
31
|
+
"@types/react-dom": "^17.0.5",
|
|
32
|
+
"@types/react": "^17.0.8",
|
|
33
|
+
"@types/node": "12.20.4"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@teambit/legacy": "1.0.239",
|
|
37
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
38
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
39
|
+
},
|
|
40
|
+
"license": "Apache-2.0",
|
|
41
|
+
"bit": {
|
|
42
|
+
"bindingPrefix": "@teambit",
|
|
43
|
+
"env": {},
|
|
44
|
+
"overrides": {
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@teambit/legacy": "-",
|
|
47
|
+
"@babel/runtime": "7.12.18",
|
|
48
|
+
"core-js": "^3.0.0",
|
|
49
|
+
"react-dom": "-",
|
|
50
|
+
"react": "-"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@teambit/legacy": "-",
|
|
54
|
+
"@types/mocha": "9.1.0",
|
|
55
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
56
|
+
"@types/jest": "^26.0.0",
|
|
57
|
+
"@types/react-dom": "^17.0.5",
|
|
58
|
+
"@types/react": "^17.0.8",
|
|
59
|
+
"@types/node": "12.20.4",
|
|
60
|
+
"react-dom": "-",
|
|
61
|
+
"react": "-"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@teambit/legacy": "1.0.239",
|
|
65
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
66
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"private": false,
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=12.22.0"
|
|
73
|
+
},
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "https://github.com/teambit/bit"
|
|
77
|
+
},
|
|
78
|
+
"keywords": [
|
|
79
|
+
"bit",
|
|
80
|
+
"bit-aspect",
|
|
81
|
+
"components",
|
|
82
|
+
"collaboration",
|
|
83
|
+
"web",
|
|
84
|
+
"react",
|
|
85
|
+
"react-components",
|
|
86
|
+
"angular",
|
|
87
|
+
"angular-components",
|
|
88
|
+
"vue",
|
|
89
|
+
"vue-components"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable",
|
|
8
|
+
"ScriptHost"
|
|
9
|
+
],
|
|
10
|
+
"target": "es2015",
|
|
11
|
+
"module": "commonjs",
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"esModuleInterop": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"composite": true,
|
|
20
|
+
"emitDeclarationOnly": true,
|
|
21
|
+
"outDir": "dist",
|
|
22
|
+
"experimentalDecorators": true,
|
|
23
|
+
"emitDecoratorMetadata": true,
|
|
24
|
+
"allowSyntheticDefaultImports": true,
|
|
25
|
+
"strictPropertyInitialization": false,
|
|
26
|
+
"strict": true,
|
|
27
|
+
"noImplicitAny": false,
|
|
28
|
+
"rootDir": ".",
|
|
29
|
+
"preserveConstEnums": true
|
|
30
|
+
},
|
|
31
|
+
"exclude": [
|
|
32
|
+
"dist"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|