@teambit/snapping 1.0.226 → 1.0.228
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 +2 -2
- package/artifacts/schema.json +185 -649
- package/package.json +18 -18
- package/tsconfig.json +46 -1
- package/dist/components-have-issues.d.ts +0 -5
- package/dist/flattened-edges.d.ts +0 -65
- package/dist/generate-comp-from-scope.d.ts +0 -26
- package/dist/index.d.ts +0 -6
- package/dist/reset-cmd.d.ts +0 -24
- package/dist/reset-component.d.ts +0 -16
- package/dist/snap-cmd.d.ts +0 -32
- package/dist/snap-distance-cmd.d.ts +0 -14
- package/dist/snap-from-scope.cmd.d.ts +0 -52
- package/dist/snapping.aspect.d.ts +0 -2
- package/dist/snapping.main.runtime.d.ts +0 -195
- package/dist/snapping.spec.d.ts +0 -1
- package/dist/tag-cmd.d.ts +0 -48
- package/dist/tag-from-scope.cmd.d.ts +0 -41
- package/dist/tag-model-component.d.ts +0 -61
- /package/dist/{preview-1712632644937.js → preview-1712805335812.js} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/snapping",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.228",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/snapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "snapping",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.228"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
22
|
"@teambit/component-version": "1.0.3",
|
|
23
23
|
"@teambit/lane-id": "0.0.311",
|
|
24
|
-
"@teambit/issues": "1.0.
|
|
25
|
-
"@teambit/graph": "1.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/scope": "1.0.
|
|
28
|
-
"@teambit/component": "1.0.
|
|
29
|
-
"@teambit/dependencies": "1.0.
|
|
30
|
-
"@teambit/dependency-resolver": "1.0.
|
|
31
|
-
"@teambit/cli": "0.0.
|
|
24
|
+
"@teambit/issues": "1.0.228",
|
|
25
|
+
"@teambit/graph": "1.0.228",
|
|
26
|
+
"@teambit/logger": "0.0.954",
|
|
27
|
+
"@teambit/scope": "1.0.228",
|
|
28
|
+
"@teambit/component": "1.0.228",
|
|
29
|
+
"@teambit/dependencies": "1.0.228",
|
|
30
|
+
"@teambit/dependency-resolver": "1.0.228",
|
|
31
|
+
"@teambit/cli": "0.0.861",
|
|
32
32
|
"@teambit/component-issues": "0.0.143",
|
|
33
|
-
"@teambit/global-config": "0.0.
|
|
34
|
-
"@teambit/builder": "1.0.
|
|
35
|
-
"@teambit/export": "1.0.
|
|
36
|
-
"@teambit/importer": "1.0.
|
|
37
|
-
"@teambit/insights": "1.0.
|
|
38
|
-
"@teambit/workspace": "1.0.
|
|
33
|
+
"@teambit/global-config": "0.0.864",
|
|
34
|
+
"@teambit/builder": "1.0.228",
|
|
35
|
+
"@teambit/export": "1.0.228",
|
|
36
|
+
"@teambit/importer": "1.0.228",
|
|
37
|
+
"@teambit/insights": "1.0.228",
|
|
38
|
+
"@teambit/workspace": "1.0.228",
|
|
39
39
|
"@teambit/workspace.modules.node-modules-linker": "0.0.167"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"fs-extra": "10.0.0",
|
|
48
48
|
"@types/uuid": "8.3.4",
|
|
49
49
|
"@types/mocha": "9.1.0",
|
|
50
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
51
|
-
"@teambit/compiler": "1.0.
|
|
50
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.30",
|
|
51
|
+
"@teambit/compiler": "1.0.228",
|
|
52
52
|
"@teambit/component.testing.mock-components": "0.0.195",
|
|
53
53
|
"@teambit/harmony.testing.load-aspect": "0.0.190",
|
|
54
54
|
"@teambit/workspace.testing.mock-workspace": "0.0.27"
|
package/tsconfig.json
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"emitDeclarationOnly": true,
|
|
21
21
|
"strict": true,
|
|
22
22
|
"strictPropertyInitialization": false,
|
|
23
|
-
"noImplicitAny": false
|
|
23
|
+
"noImplicitAny": false,
|
|
24
|
+
"composite": true
|
|
24
25
|
},
|
|
25
26
|
"exclude": [
|
|
26
27
|
"artifacts",
|
|
@@ -35,5 +36,49 @@
|
|
|
35
36
|
"include": [
|
|
36
37
|
"**/*",
|
|
37
38
|
"**/*.json"
|
|
39
|
+
],
|
|
40
|
+
"references": [
|
|
41
|
+
{
|
|
42
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_issues@1.0.228"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@1.0.228"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.954"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.228"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.228"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_dependencies@1.0.228"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.861"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_global-config@0.0.864"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.228"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_export@1.0.228"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_importer@1.0.228"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.explorer_insights@1.0.228"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.228"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compilation_compiler@1.0.228"
|
|
82
|
+
}
|
|
38
83
|
]
|
|
39
84
|
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Graph } from '@teambit/graph.cleargraph';
|
|
2
|
-
import { DepEdgeType } from '@teambit/graph';
|
|
3
|
-
import { ScopeMain } from '@teambit/scope';
|
|
4
|
-
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
|
|
5
|
-
import { Lane } from '@teambit/legacy/dist/scope/models';
|
|
6
|
-
import { ComponentID } from '@teambit/component-id';
|
|
7
|
-
import { Logger } from '@teambit/logger';
|
|
8
|
-
/**
|
|
9
|
-
* the goal of this class is to determine the graph dependencies of a given set of components with minimal effort.
|
|
10
|
-
* it takes advantage of the fact that we save the dependency graph in the `Version` object and tries to reuse it.
|
|
11
|
-
*
|
|
12
|
-
* to optimize it as much as possible, we do it in 4 steps. each step we check whether the graph has missing ids,
|
|
13
|
-
* and if so, continue to the next step.
|
|
14
|
-
*
|
|
15
|
-
* * * First step * * *
|
|
16
|
-
* we have two groups in this graph.
|
|
17
|
-
* 1. components that are now versioned (this.consumerComponents). they have the new version (which is not in the scope yet).
|
|
18
|
-
* 2. component that are not part of the current snap/tag.
|
|
19
|
-
* it's not possible that this group has new components that never been into the scope, otherwise the tag/snap is failing.
|
|
20
|
-
* so we know we can always find the version-object of these components in the scope or import them.
|
|
21
|
-
*
|
|
22
|
-
* given the above. we can simply get the first level of dependencies of the first group.
|
|
23
|
-
* start the graph by adding them all as nodes and edges.
|
|
24
|
-
*
|
|
25
|
-
* this dependencies array may contain components from the first group. we can filter them out. (we don't care about
|
|
26
|
-
* them, they're part of the graph already)
|
|
27
|
-
* we're left with the dependencies that are part of the second group. there are the `missingFromGraph`.
|
|
28
|
-
*
|
|
29
|
-
* * * Second step * * *
|
|
30
|
-
* instead of import these components, we can more efficiently get their previous version from the scope.
|
|
31
|
-
* it must be already in the scope because these are the components we load in the first place.
|
|
32
|
-
* chances are that 99% of the dependencies of the current components objects are identical to the previous version.
|
|
33
|
-
* by adding the flattenedEdges of the previous versions we can probably finish the graph without importing a single
|
|
34
|
-
* component. It's ok that this graph of previous versions has ids that are not relevant to this graph. for example, if
|
|
35
|
-
* we now tag bar@0.0.2, this graph will have bar@0.0.1 although it's not relevant. it's ok, because finally we don't
|
|
36
|
-
* use this graph as a whole. we only pick a component and get its sub-graph, so all irrelevant ids are ignored.
|
|
37
|
-
*
|
|
38
|
-
* * * Third step * * *
|
|
39
|
-
* in case the graph above wasn't enough. we can import the missing components and get their flattenedEdges.
|
|
40
|
-
* all components that were snapped/tagged since around 0.0.8000 have the flattenedEdges saved in the version.
|
|
41
|
-
* older components don't have them and that's why the last step is needed.
|
|
42
|
-
*
|
|
43
|
-
* * * Fourth step * * *
|
|
44
|
-
* this is the worst scenario. we have some old dependencies without flattenedEdges, we have to import them with
|
|
45
|
-
* all their flattened dependencies.
|
|
46
|
-
* once we have all these objects we can iterate them and add them to the graph.
|
|
47
|
-
*/
|
|
48
|
-
export declare class FlattenedEdgesGetter {
|
|
49
|
-
private scope;
|
|
50
|
-
private consumerComponents;
|
|
51
|
-
private logger;
|
|
52
|
-
private lane?;
|
|
53
|
-
private graph;
|
|
54
|
-
private missingFromGraph;
|
|
55
|
-
constructor(scope: ScopeMain, consumerComponents: ConsumerComponent[], logger: Logger, lane?: Lane | undefined);
|
|
56
|
-
buildGraph(): Promise<Graph<ComponentID, DepEdgeType>>;
|
|
57
|
-
populateFlattenedAndEdgesForComp(component: ConsumerComponent): void;
|
|
58
|
-
private importMissingAndAddToGraph;
|
|
59
|
-
private addPreviousGraphs;
|
|
60
|
-
private addComponentsWithMissingFlattenedEdges;
|
|
61
|
-
private addFlattenedEdgesToGraph;
|
|
62
|
-
private populateMissingFromGraph;
|
|
63
|
-
private buildTheFirstLevel;
|
|
64
|
-
private addEdges;
|
|
65
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { ScopeMain } from '@teambit/scope';
|
|
3
|
-
import { Component } from '@teambit/component';
|
|
4
|
-
import { DependenciesMain } from '@teambit/dependencies';
|
|
5
|
-
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
6
|
-
import { FileData } from './snap-from-scope.cmd';
|
|
7
|
-
import type { SnappingMain, SnapDataParsed } from './snapping.main.runtime';
|
|
8
|
-
export type CompData = {
|
|
9
|
-
componentId: ComponentID;
|
|
10
|
-
dependencies: string[];
|
|
11
|
-
aspects: Record<string, any> | undefined;
|
|
12
|
-
message: string | undefined;
|
|
13
|
-
files: FileData[] | undefined;
|
|
14
|
-
mainFile?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* normally new components are created from a workspace. the files are in the filesystem and the ConsumerComponent
|
|
18
|
-
* object is created from the files.
|
|
19
|
-
* here, we need to create the ConsumerComponent object "on the fly". we don't have workspace, only scope. the files
|
|
20
|
-
* are in-memory (we got them from snap-from-scope command).
|
|
21
|
-
* the way how it is done is by creating a minimal ConsumerComponent object, then convert `Version` object from it,
|
|
22
|
-
* write the version and files into the scope as objects, so then it's possible to load Component object using the
|
|
23
|
-
* ConsumerComponent.
|
|
24
|
-
*/
|
|
25
|
-
export declare function generateCompFromScope(scope: ScopeMain, compData: CompData, snapping: SnappingMain): Promise<Component>;
|
|
26
|
-
export declare function addDeps(component: Component, snapData: SnapDataParsed, scope: ScopeMain, deps: DependenciesMain, depsResolver: DependencyResolverMain): Promise<void>;
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SnappingAspect } from './snapping.aspect';
|
|
2
|
-
export type { BitCloudUser } from './tag-model-component';
|
|
3
|
-
export type { SnappingMain, TagResults, SnapResults } from './snapping.main.runtime';
|
|
4
|
-
export default SnappingAspect;
|
|
5
|
-
export { SnappingAspect };
|
|
6
|
-
export type { onTagIdTransformer } from './tag-model-component';
|
package/dist/reset-cmd.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { SnappingMain } from './snapping.main.runtime';
|
|
3
|
-
export default class ResetCmd implements Command {
|
|
4
|
-
private snapping;
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
arguments: {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
}[];
|
|
11
|
-
group: string;
|
|
12
|
-
extendedDescription: string;
|
|
13
|
-
alias: string;
|
|
14
|
-
options: CommandOptions;
|
|
15
|
-
loader: boolean;
|
|
16
|
-
constructor(snapping: SnappingMain);
|
|
17
|
-
report([pattern]: [string], { all, head, force, soft, neverExported, }: {
|
|
18
|
-
all?: boolean;
|
|
19
|
-
head?: boolean;
|
|
20
|
-
force?: boolean;
|
|
21
|
-
soft?: boolean;
|
|
22
|
-
neverExported?: boolean;
|
|
23
|
-
}): Promise<string>;
|
|
24
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { Scope } from '@teambit/legacy/dist/scope';
|
|
3
|
-
import { Consumer } from '@teambit/legacy/dist/consumer';
|
|
4
|
-
import { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';
|
|
5
|
-
export type untagResult = {
|
|
6
|
-
id: ComponentID;
|
|
7
|
-
versions: string[];
|
|
8
|
-
component?: ModelComponent;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* If head is false, remove all local versions.
|
|
12
|
-
*/
|
|
13
|
-
export declare function removeLocalVersion(scope: Scope, id: ComponentID, lane: Lane | null, head?: boolean, force?: boolean): Promise<untagResult>;
|
|
14
|
-
export declare function removeLocalVersionsForAllComponents(consumer: Consumer, lane: Lane | null, head?: boolean): Promise<untagResult[]>;
|
|
15
|
-
export declare function removeLocalVersionsForMultipleComponents(componentsToUntag: ModelComponent[], lane: Lane | null, head?: boolean, force: boolean, scope: Scope): Promise<untagResult[]>;
|
|
16
|
-
export declare function getComponentsWithOptionToUntag(consumer: Consumer): Promise<ModelComponent[]>;
|
package/dist/snap-cmd.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { GlobalConfigMain } from '@teambit/global-config';
|
|
2
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
3
|
-
import { Logger } from '@teambit/logger';
|
|
4
|
-
import { SnappingMain } from './snapping.main.runtime';
|
|
5
|
-
import { BasicTagSnapParams } from './tag-model-component';
|
|
6
|
-
export declare class SnapCmd implements Command {
|
|
7
|
-
private snapping;
|
|
8
|
-
private logger;
|
|
9
|
-
private globalConfig;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
extendedDescription: string;
|
|
13
|
-
group: string;
|
|
14
|
-
arguments: {
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
}[];
|
|
18
|
-
helpUrl: string;
|
|
19
|
-
alias: string;
|
|
20
|
-
options: CommandOptions;
|
|
21
|
-
loader: boolean;
|
|
22
|
-
constructor(snapping: SnappingMain, logger: Logger, globalConfig: GlobalConfigMain);
|
|
23
|
-
report([pattern]: string[], { message, unmerged, editor, ignoreIssues, build, skipTests, skipTasks, skipAutoSnap, disableSnapPipeline, ignoreBuildErrors, rebuildDepsGraph, unmodified, failFast, }: {
|
|
24
|
-
unmerged?: boolean;
|
|
25
|
-
editor?: string;
|
|
26
|
-
ignoreIssues?: string;
|
|
27
|
-
skipAutoSnap?: boolean;
|
|
28
|
-
disableSnapPipeline?: boolean;
|
|
29
|
-
unmodified?: boolean;
|
|
30
|
-
failFast?: boolean;
|
|
31
|
-
} & BasicTagSnapParams): Promise<string>;
|
|
32
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ScopeMain } from '@teambit/scope';
|
|
2
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
3
|
-
export declare class SnapDistanceCmd implements Command {
|
|
4
|
-
private scope;
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
extendedDescription: string;
|
|
8
|
-
alias: string;
|
|
9
|
-
options: CommandOptions;
|
|
10
|
-
loader: boolean;
|
|
11
|
-
private: boolean;
|
|
12
|
-
constructor(scope: ScopeMain);
|
|
13
|
-
report([id, sourceSnap, targetSnap]: [string, string, string]): Promise<string>;
|
|
14
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { Logger } from '@teambit/logger';
|
|
3
|
-
import { SnappingMain } from './snapping.main.runtime';
|
|
4
|
-
import { BasicTagSnapParams } from './tag-model-component';
|
|
5
|
-
export type FileData = {
|
|
6
|
-
path: string;
|
|
7
|
-
content: string;
|
|
8
|
-
delete?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type SnapDataPerCompRaw = {
|
|
11
|
-
componentId: string;
|
|
12
|
-
dependencies?: string[];
|
|
13
|
-
aspects?: Record<string, any>;
|
|
14
|
-
message?: string;
|
|
15
|
-
files?: FileData[];
|
|
16
|
-
isNew?: boolean;
|
|
17
|
-
mainFile?: string;
|
|
18
|
-
newDependencies?: Array<{
|
|
19
|
-
id: string;
|
|
20
|
-
version?: string;
|
|
21
|
-
isComponent?: boolean;
|
|
22
|
-
type?: 'runtime' | 'dev' | 'peer';
|
|
23
|
-
}>;
|
|
24
|
-
removeDependencies?: string[];
|
|
25
|
-
};
|
|
26
|
-
type SnapFromScopeOptions = {
|
|
27
|
-
push?: boolean;
|
|
28
|
-
lane?: string;
|
|
29
|
-
ignoreIssues?: string;
|
|
30
|
-
disableSnapPipeline?: boolean;
|
|
31
|
-
forceDeploy?: boolean;
|
|
32
|
-
updateDependents?: boolean;
|
|
33
|
-
} & BasicTagSnapParams;
|
|
34
|
-
export declare class SnapFromScopeCmd implements Command {
|
|
35
|
-
private snapping;
|
|
36
|
-
private logger;
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
|
-
extendedDescription: string;
|
|
40
|
-
alias: string;
|
|
41
|
-
options: CommandOptions;
|
|
42
|
-
loader: boolean;
|
|
43
|
-
private: boolean;
|
|
44
|
-
constructor(snapping: SnappingMain, logger: Logger);
|
|
45
|
-
report([data]: [string], options: SnapFromScopeOptions): Promise<string>;
|
|
46
|
-
json([data]: [string], { push, message, lane, ignoreIssues, build, skipTests, disableSnapPipeline, ignoreBuildErrors, rebuildDepsGraph, forceDeploy, updateDependents, }: SnapFromScopeOptions): Promise<{
|
|
47
|
-
exportedIds: string[] | undefined;
|
|
48
|
-
snappedIds: string[];
|
|
49
|
-
}>;
|
|
50
|
-
private parseData;
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { CLIMain } from '@teambit/cli';
|
|
2
|
-
import { LegacyOnTagResult } from '@teambit/legacy/dist/scope/scope';
|
|
3
|
-
import { Workspace } from '@teambit/workspace';
|
|
4
|
-
import { ReleaseType } from 'semver';
|
|
5
|
-
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
6
|
-
import { Logger, LoggerMain } from '@teambit/logger';
|
|
7
|
-
import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
8
|
-
import { InsightsMain } from '@teambit/insights';
|
|
9
|
-
import { ScopeMain } from '@teambit/scope';
|
|
10
|
-
import { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';
|
|
11
|
-
import { IssuesMain } from '@teambit/issues';
|
|
12
|
-
import { Component } from '@teambit/component';
|
|
13
|
-
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
14
|
-
import { BuilderMain } from '@teambit/builder';
|
|
15
|
-
import { ImporterMain } from '@teambit/importer';
|
|
16
|
-
import { ExportMain } from '@teambit/export';
|
|
17
|
-
import { BitObject } from '@teambit/legacy/dist/scope/objects';
|
|
18
|
-
import { GlobalConfigMain } from '@teambit/global-config';
|
|
19
|
-
import { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';
|
|
20
|
-
import { DependenciesMain } from '@teambit/dependencies';
|
|
21
|
-
import Version, { Log } from '@teambit/legacy/dist/scope/models/version';
|
|
22
|
-
import { BasicTagParams, BasicTagSnapParams } from './tag-model-component';
|
|
23
|
-
import { TagDataPerCompRaw } from './tag-from-scope.cmd';
|
|
24
|
-
import { SnapDataPerCompRaw, FileData } from './snap-from-scope.cmd';
|
|
25
|
-
import { untagResult } from './reset-component';
|
|
26
|
-
export type TagDataPerComp = {
|
|
27
|
-
componentId: ComponentID;
|
|
28
|
-
dependencies: ComponentID[];
|
|
29
|
-
versionToTag?: string;
|
|
30
|
-
prereleaseId?: string;
|
|
31
|
-
message?: string;
|
|
32
|
-
isNew?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export type SnapDataParsed = {
|
|
35
|
-
componentId: ComponentID;
|
|
36
|
-
dependencies: string[];
|
|
37
|
-
aspects?: Record<string, any>;
|
|
38
|
-
message?: string;
|
|
39
|
-
files?: FileData[];
|
|
40
|
-
isNew?: boolean;
|
|
41
|
-
newDependencies?: {
|
|
42
|
-
id: string;
|
|
43
|
-
version?: string;
|
|
44
|
-
isComponent: boolean;
|
|
45
|
-
type: 'runtime' | 'dev' | 'peer';
|
|
46
|
-
}[];
|
|
47
|
-
removeDependencies?: string[];
|
|
48
|
-
};
|
|
49
|
-
export type SnapResults = BasicTagResults & {
|
|
50
|
-
snappedComponents: ConsumerComponent[];
|
|
51
|
-
autoSnappedResults: AutoTagResult[];
|
|
52
|
-
laneName: string | null;
|
|
53
|
-
};
|
|
54
|
-
export type SnapFromScopeResults = {
|
|
55
|
-
snappedIds: ComponentID[];
|
|
56
|
-
exportedIds?: ComponentID[];
|
|
57
|
-
snappedComponents: ConsumerComponent[];
|
|
58
|
-
};
|
|
59
|
-
export type TagResults = BasicTagResults & {
|
|
60
|
-
taggedComponents: ConsumerComponent[];
|
|
61
|
-
autoTaggedResults: AutoTagResult[];
|
|
62
|
-
isSoftTag: boolean;
|
|
63
|
-
publishedPackages: string[];
|
|
64
|
-
};
|
|
65
|
-
export type BasicTagResults = {
|
|
66
|
-
warnings: string[];
|
|
67
|
-
newComponents: ComponentIdList;
|
|
68
|
-
removedComponents?: ComponentIdList;
|
|
69
|
-
};
|
|
70
|
-
export declare class SnappingMain {
|
|
71
|
-
private workspace;
|
|
72
|
-
private logger;
|
|
73
|
-
private issues;
|
|
74
|
-
private insights;
|
|
75
|
-
private dependencyResolver;
|
|
76
|
-
private scope;
|
|
77
|
-
private exporter;
|
|
78
|
-
private builder;
|
|
79
|
-
private importer;
|
|
80
|
-
private deps;
|
|
81
|
-
private objectsRepo;
|
|
82
|
-
constructor(workspace: Workspace, logger: Logger, issues: IssuesMain, insights: InsightsMain, dependencyResolver: DependencyResolverMain, scope: ScopeMain, exporter: ExportMain, builder: BuilderMain, importer: ImporterMain, deps: DependenciesMain);
|
|
83
|
-
/**
|
|
84
|
-
* tag the given component ids or all modified/new components if "all" param is set.
|
|
85
|
-
* tag is a similar operation as a snap, which saves the changes into the local scope, but it also creates an alias
|
|
86
|
-
* with a valid semver to that version.
|
|
87
|
-
* tag can be done only on main, not on a lane.
|
|
88
|
-
*/
|
|
89
|
-
tag({ ids, message, version, editor, snapped, unmerged, releaseType, preReleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, build, unmodified, soft, persist, ignoreBuildErrors, rebuildDepsGraph, incrementBy, disableTagAndSnapPipelines, failFast, }: {
|
|
90
|
-
ids?: string[];
|
|
91
|
-
all?: boolean | string;
|
|
92
|
-
snapped?: boolean;
|
|
93
|
-
unmerged?: boolean;
|
|
94
|
-
version?: string;
|
|
95
|
-
releaseType?: ReleaseType;
|
|
96
|
-
ignoreIssues?: string;
|
|
97
|
-
scope?: string | boolean;
|
|
98
|
-
incrementBy?: number;
|
|
99
|
-
failFast?: boolean;
|
|
100
|
-
} & Partial<BasicTagParams>): Promise<TagResults | null>;
|
|
101
|
-
tagFromScope(tagDataPerCompRaw: TagDataPerCompRaw[], params: {
|
|
102
|
-
push?: boolean;
|
|
103
|
-
version?: string;
|
|
104
|
-
releaseType?: ReleaseType;
|
|
105
|
-
ignoreIssues?: string;
|
|
106
|
-
incrementBy?: number;
|
|
107
|
-
rebuildArtifacts?: boolean;
|
|
108
|
-
} & Partial<BasicTagParams>): Promise<TagResults | null>;
|
|
109
|
-
snapFromScope(snapDataPerCompRaw: SnapDataPerCompRaw[], params: {
|
|
110
|
-
push?: boolean;
|
|
111
|
-
ignoreIssues?: string;
|
|
112
|
-
lane?: string;
|
|
113
|
-
updateDependents?: boolean;
|
|
114
|
-
} & Partial<BasicTagParams>): Promise<SnapFromScopeResults>;
|
|
115
|
-
/**
|
|
116
|
-
* save the local changes of a component(s) into the scope. snap can be done on main or on a lane.
|
|
117
|
-
* once a component is snapped on a lane, it becomes part of it.
|
|
118
|
-
*/
|
|
119
|
-
snap({ pattern, legacyBitIds, // @todo: change to ComponentID[]. pass only if have the ids already parsed.
|
|
120
|
-
unmerged, editor, message, ignoreIssues, skipTests, skipTasks, skipAutoSnap, build, disableTagAndSnapPipelines, ignoreBuildErrors, rebuildDepsGraph, unmodified, exitOnFirstFailedTask, }: Partial<BasicTagSnapParams> & {
|
|
121
|
-
pattern?: string;
|
|
122
|
-
legacyBitIds?: ComponentIdList;
|
|
123
|
-
unmerged?: boolean;
|
|
124
|
-
editor?: string;
|
|
125
|
-
ignoreIssues?: string;
|
|
126
|
-
skipAutoSnap?: boolean;
|
|
127
|
-
disableTagAndSnapPipelines?: boolean;
|
|
128
|
-
unmodified?: boolean;
|
|
129
|
-
exitOnFirstFailedTask?: boolean;
|
|
130
|
-
}): Promise<SnapResults | null>;
|
|
131
|
-
/**
|
|
132
|
-
* remove tags/snaps that exist locally, which were not exported yet.
|
|
133
|
-
* once a tag/snap is exported, it's impossible to delete it as other components may depend on it
|
|
134
|
-
*/
|
|
135
|
-
reset(componentPattern?: string, head?: boolean, force?: boolean, soft?: boolean): Promise<{
|
|
136
|
-
results: untagResult[];
|
|
137
|
-
isSoftUntag: boolean;
|
|
138
|
-
}>;
|
|
139
|
-
resetNeverExported(): Promise<ComponentID[]>;
|
|
140
|
-
_addFlattenedDependenciesToComponents(components: ConsumerComponent[], rebuildDepsGraph?: boolean): Promise<void>;
|
|
141
|
-
throwForDepsFromAnotherLane(components: ConsumerComponent[]): Promise<void>;
|
|
142
|
-
private throwForVariousIssues;
|
|
143
|
-
private throwForDepsFromAnotherLaneForComp;
|
|
144
|
-
_addFlattenedDepsGraphToComponents(components: ConsumerComponent[]): Promise<void>;
|
|
145
|
-
_updateComponentsByTagResult(components: ConsumerComponent[], tagResult: LegacyOnTagResult[]): void;
|
|
146
|
-
_getPublishedPackages(components: ConsumerComponent[]): string[];
|
|
147
|
-
_addCompToObjects({ source, lane, shouldValidateVersion, updateDependentsOnLane, }: {
|
|
148
|
-
source: ConsumerComponent;
|
|
149
|
-
lane: Lane | null;
|
|
150
|
-
shouldValidateVersion?: boolean;
|
|
151
|
-
updateDependentsOnLane?: boolean;
|
|
152
|
-
}): Promise<{
|
|
153
|
-
component: ModelComponent;
|
|
154
|
-
version: Version;
|
|
155
|
-
}>;
|
|
156
|
-
_addCompFromScopeToObjects(source: ConsumerComponent, lane: Lane | null, updateDependentsOnLane?: boolean): Promise<{
|
|
157
|
-
component: ModelComponent;
|
|
158
|
-
version: Version;
|
|
159
|
-
}>;
|
|
160
|
-
_enrichComp(consumerComponent: ConsumerComponent, modifiedLog?: Log): Promise<ConsumerComponent>;
|
|
161
|
-
_getObjectsToEnrichComp(consumerComponent: ConsumerComponent, modifiedLog?: Log): Promise<BitObject[]>;
|
|
162
|
-
private transformArtifactsFromVinylToSource;
|
|
163
|
-
private loadComponentsForTagOrSnap;
|
|
164
|
-
private throwForComponentIssues;
|
|
165
|
-
private throwForPendingImport;
|
|
166
|
-
private throwForLegacyDependenciesInsideHarmony;
|
|
167
|
-
/**
|
|
168
|
-
* the compId.version can be a range (e.g. "^1.0.0"), in which case, it finds the component in the local scope and
|
|
169
|
-
* resolves the latest version that falls under the range.
|
|
170
|
-
* in case the version has no range, it returns the same compId.
|
|
171
|
-
* in case it has no version, it returns the latest.
|
|
172
|
-
*/
|
|
173
|
-
getCompIdWithExactVersionAccordingToSemver(compId: ComponentID): Promise<ComponentID>;
|
|
174
|
-
private updateSourceFiles;
|
|
175
|
-
updateDependenciesVersionsOfComponent(component: Component, dependencies: ComponentID[], currentBitIds: ComponentID[]): Promise<void>;
|
|
176
|
-
private getComponentsToTag;
|
|
177
|
-
static slots: never[];
|
|
178
|
-
static dependencies: import("@teambit/harmony").Aspect[];
|
|
179
|
-
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
180
|
-
static provider([workspace, cli, loggerMain, issues, insights, dependencyResolver, scope, exporter, builder, importer, globalConfig, deps,]: [
|
|
181
|
-
Workspace,
|
|
182
|
-
CLIMain,
|
|
183
|
-
LoggerMain,
|
|
184
|
-
IssuesMain,
|
|
185
|
-
InsightsMain,
|
|
186
|
-
DependencyResolverMain,
|
|
187
|
-
ScopeMain,
|
|
188
|
-
ExportMain,
|
|
189
|
-
BuilderMain,
|
|
190
|
-
ImporterMain,
|
|
191
|
-
GlobalConfigMain,
|
|
192
|
-
DependenciesMain
|
|
193
|
-
]): Promise<SnappingMain>;
|
|
194
|
-
}
|
|
195
|
-
export default SnappingMain;
|
package/dist/snapping.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tag-cmd.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ComponentIdList } from '@teambit/component-id';
|
|
2
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
3
|
-
import { GlobalConfigMain } from '@teambit/global-config';
|
|
4
|
-
import { ReleaseType } from 'semver';
|
|
5
|
-
import { Logger } from '@teambit/logger';
|
|
6
|
-
import { SnappingMain } from './snapping.main.runtime';
|
|
7
|
-
import { BasicTagParams } from './tag-model-component';
|
|
8
|
-
export declare class TagCmd implements Command {
|
|
9
|
-
private snapping;
|
|
10
|
-
private logger;
|
|
11
|
-
private globalConfig;
|
|
12
|
-
name: string;
|
|
13
|
-
group: string;
|
|
14
|
-
description: string;
|
|
15
|
-
extendedDescription: string;
|
|
16
|
-
arguments: {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
}[];
|
|
20
|
-
helpUrl: string;
|
|
21
|
-
alias: string;
|
|
22
|
-
loader: boolean;
|
|
23
|
-
options: CommandOptions;
|
|
24
|
-
remoteOp: boolean;
|
|
25
|
-
examples: {
|
|
26
|
-
cmd: string;
|
|
27
|
-
description: string;
|
|
28
|
-
}[];
|
|
29
|
-
constructor(snapping: SnappingMain, logger: Logger, globalConfig: GlobalConfigMain);
|
|
30
|
-
report([patterns]: [string[]], { message, ver, editor, snapped, unmerged, patch, minor, major, preRelease, increment, prereleaseId, ignoreIssues, ignoreNewestVersion, skipTests, skipTasks, skipAutoTag, unmodified, build, soft, persist, disableTagPipeline, forceDeploy, ignoreBuildErrors, rebuildDepsGraph, failFast, incrementBy, }: {
|
|
31
|
-
snapped?: boolean;
|
|
32
|
-
unmerged?: boolean;
|
|
33
|
-
ver?: string;
|
|
34
|
-
patch?: boolean;
|
|
35
|
-
minor?: boolean;
|
|
36
|
-
major?: boolean;
|
|
37
|
-
increment?: ReleaseType;
|
|
38
|
-
preRelease?: string;
|
|
39
|
-
prereleaseId?: string;
|
|
40
|
-
ignoreUnresolvedDependencies?: boolean;
|
|
41
|
-
ignoreIssues?: string;
|
|
42
|
-
incrementBy?: number;
|
|
43
|
-
failFast?: boolean;
|
|
44
|
-
disableTagPipeline?: boolean;
|
|
45
|
-
forceDeploy?: boolean;
|
|
46
|
-
} & Partial<BasicTagParams>): Promise<string>;
|
|
47
|
-
}
|
|
48
|
-
export declare function outputIdsIfExists(label: string, ids?: ComponentIdList): string;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { ReleaseType } from 'semver';
|
|
3
|
-
import { Logger } from '@teambit/logger';
|
|
4
|
-
import { SnappingMain } from './snapping.main.runtime';
|
|
5
|
-
import { BasicTagParams } from './tag-model-component';
|
|
6
|
-
export type TagDataPerCompRaw = {
|
|
7
|
-
componentId: string;
|
|
8
|
-
dependencies?: string[];
|
|
9
|
-
versionToTag?: string;
|
|
10
|
-
prereleaseId?: string;
|
|
11
|
-
message?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare class TagFromScopeCmd implements Command {
|
|
14
|
-
private snapping;
|
|
15
|
-
private logger;
|
|
16
|
-
name: string;
|
|
17
|
-
group: string;
|
|
18
|
-
private: boolean;
|
|
19
|
-
description: string;
|
|
20
|
-
extendedDescription: string;
|
|
21
|
-
alias: string;
|
|
22
|
-
loader: boolean;
|
|
23
|
-
options: CommandOptions;
|
|
24
|
-
remoteOp: boolean;
|
|
25
|
-
constructor(snapping: SnappingMain, logger: Logger);
|
|
26
|
-
report([data]: [string], { push, message, ver, patch, minor, major, preRelease, increment, prereleaseId, ignoreIssues, ignoreNewestVersion, skipTests, disableTagPipeline, ignoreBuildErrors, rebuildArtifacts, rebuildDepsGraph, incrementBy, }: {
|
|
27
|
-
push?: boolean;
|
|
28
|
-
ver?: string;
|
|
29
|
-
patch?: boolean;
|
|
30
|
-
minor?: boolean;
|
|
31
|
-
major?: boolean;
|
|
32
|
-
increment?: ReleaseType;
|
|
33
|
-
preRelease?: string;
|
|
34
|
-
prereleaseId?: string;
|
|
35
|
-
ignoreIssues?: string;
|
|
36
|
-
incrementBy?: number;
|
|
37
|
-
rebuildArtifacts?: boolean;
|
|
38
|
-
disableTagPipeline?: boolean;
|
|
39
|
-
} & Partial<BasicTagParams>): Promise<string>;
|
|
40
|
-
private parseData;
|
|
41
|
-
}
|