@teambit/scope 1.0.225 → 1.0.227
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 +1 -1
- package/artifacts/preview/teambit_scope_scope-preview.js +1 -1
- package/artifacts/schema.json +435 -1844
- package/dist/{preview-1712546198033.js → preview-1712719054377.js} +2 -2
- package/package.json +26 -26
- package/tsconfig.json +55 -1
- package/dist/clear-cache-action.d.ts +0 -7
- package/dist/exceptions/component-not-found.d.ts +0 -9
- package/dist/exceptions/index.d.ts +0 -2
- package/dist/exceptions/no-id-match-pattern.d.ts +0 -4
- package/dist/get-scope-options.d.ts +0 -19
- package/dist/index.d.ts +0 -10
- package/dist/routes/action.route.d.ts +0 -10
- package/dist/routes/delete.route.d.ts +0 -10
- package/dist/routes/fetch.route.d.ts +0 -12
- package/dist/routes/index.d.ts +0 -4
- package/dist/routes/put.route.d.ts +0 -11
- package/dist/scope-aspects-loader.d.ts +0 -91
- package/dist/scope-cmd.d.ts +0 -10
- package/dist/scope-component-loader.d.ts +0 -36
- package/dist/scope.aspect.d.ts +0 -3
- package/dist/scope.composition.d.ts +0 -1
- package/dist/scope.graphql.d.ts +0 -37
- package/dist/scope.main.runtime.d.ts +0 -404
- package/dist/scope.ui-root.d.ts +0 -25
- package/dist/scope.ui.drawer.d.ts +0 -18
- package/dist/scope.ui.runtime.d.ts +0 -210
- package/dist/staged-config.d.ts +0 -29
- package/dist/types.d.ts +0 -10
- package/dist/ui/menu/index.d.ts +0 -1
- package/dist/ui/menu/menu.d.ts +0 -10
- package/dist/ui/scope-overview/index.d.ts +0 -1
- package/dist/ui/scope-overview/scope-overview.d.ts +0 -31
- package/dist/ui/scope.d.ts +0 -30
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import { GlobalConfigMain } from '@teambit/global-config';
|
|
2
|
-
import { Graph } from '@teambit/graph.cleargraph';
|
|
3
|
-
import type { AspectLoaderMain } from '@teambit/aspect-loader';
|
|
4
|
-
import { RawBuilderData } from '@teambit/builder';
|
|
5
|
-
import { AspectDefinition } from '@teambit/aspect-loader';
|
|
6
|
-
import { CLIMain } from '@teambit/cli';
|
|
7
|
-
import type { AspectData, ComponentMain, ComponentMap, ResolveAspectsOptions } from '@teambit/component';
|
|
8
|
-
import { Component, ComponentFactory, Snap, State } from '@teambit/component';
|
|
9
|
-
import type { GraphqlMain } from '@teambit/graphql';
|
|
10
|
-
import { Harmony, SlotRegistry } from '@teambit/harmony';
|
|
11
|
-
import { IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';
|
|
12
|
-
import { LoggerMain, Logger } from '@teambit/logger';
|
|
13
|
-
import { ExpressMain } from '@teambit/express';
|
|
14
|
-
import type { UiMain } from '@teambit/ui';
|
|
15
|
-
import { ComponentIdList, ComponentID } from '@teambit/component-id';
|
|
16
|
-
import { ModelComponent, Lane, Version } from '@teambit/legacy/dist/scope/models';
|
|
17
|
-
import LegacyScope, { LegacyOnTagResult } from '@teambit/legacy/dist/scope/scope';
|
|
18
|
-
import { LegacyComponentLog as ComponentLog } from '@teambit/legacy-component-log';
|
|
19
|
-
import { PersistOptions } from '@teambit/legacy/dist/scope/types';
|
|
20
|
-
import { DependencyResolverMain, NodeLinker } from '@teambit/dependency-resolver';
|
|
21
|
-
import { Remotes } from '@teambit/legacy/dist/remotes';
|
|
22
|
-
import { CompIdGraph } from '@teambit/graph';
|
|
23
|
-
import { Types } from '@teambit/legacy/dist/scope/object-registrar';
|
|
24
|
-
import { FETCH_OPTIONS } from '@teambit/legacy/dist/api/scope/lib/fetch';
|
|
25
|
-
import { ObjectList } from '@teambit/legacy/dist/scope/objects/object-list';
|
|
26
|
-
import { RequireableComponent } from '@teambit/harmony.modules.requireable-component';
|
|
27
|
-
import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
|
|
28
|
-
import { AuthData } from '@teambit/legacy/dist/scope/network/http/http';
|
|
29
|
-
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
|
|
30
|
-
import { BitId } from '@teambit/legacy-bit-id';
|
|
31
|
-
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';
|
|
32
|
-
import { EnvsMain } from '@teambit/envs';
|
|
33
|
-
import { DepEdge } from '@teambit/legacy/dist/scope/models/version';
|
|
34
|
-
import { ScopeComponentLoader } from './scope-component-loader';
|
|
35
|
-
import { StagedConfig } from './staged-config';
|
|
36
|
-
import { ScopeAspectsLoader, ScopeLoadAspectsOptions } from './scope-aspects-loader';
|
|
37
|
-
type RemoteEventMetadata = {
|
|
38
|
-
auth?: AuthData;
|
|
39
|
-
headers?: {};
|
|
40
|
-
};
|
|
41
|
-
type RemoteEvent<Data> = (data: Data, metadata: RemoteEventMetadata, errors?: Array<string | Error>) => Promise<void>;
|
|
42
|
-
type OnPostPutData = {
|
|
43
|
-
ids: ComponentID[];
|
|
44
|
-
lanes: Lane[];
|
|
45
|
-
};
|
|
46
|
-
type OnPostDeleteData = {
|
|
47
|
-
ids: ComponentID[];
|
|
48
|
-
};
|
|
49
|
-
type OnPreFetchObjectData = {
|
|
50
|
-
ids: string[];
|
|
51
|
-
fetchOptions: FETCH_OPTIONS;
|
|
52
|
-
};
|
|
53
|
-
type OnPostPut = RemoteEvent<OnPostPutData>;
|
|
54
|
-
type OnPostExport = RemoteEvent<OnPostPutData>;
|
|
55
|
-
type OnPostDelete = RemoteEvent<OnPostDeleteData>;
|
|
56
|
-
type OnPostObjectsPersist = RemoteEvent<undefined>;
|
|
57
|
-
type OnPreFetchObjects = RemoteEvent<OnPreFetchObjectData>;
|
|
58
|
-
type OnCompAspectReCalc = (component: Component) => Promise<AspectData | undefined>;
|
|
59
|
-
export type OnPostPutSlot = SlotRegistry<OnPostPut>;
|
|
60
|
-
export type OnPostDeleteSlot = SlotRegistry<OnPostDelete>;
|
|
61
|
-
export type OnPostExportSlot = SlotRegistry<OnPostExport>;
|
|
62
|
-
export type OnPostObjectsPersistSlot = SlotRegistry<OnPostObjectsPersist>;
|
|
63
|
-
export type OnPreFetchObjectsSlot = SlotRegistry<OnPreFetchObjects>;
|
|
64
|
-
export type OnCompAspectReCalcSlot = SlotRegistry<OnCompAspectReCalc>;
|
|
65
|
-
export type LoadOptions = {
|
|
66
|
-
/**
|
|
67
|
-
* In case the component we are loading is app, whether to load it as app (in a scope aspects capsule)
|
|
68
|
-
*/
|
|
69
|
-
loadApps?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* In case the component we are loading is env, whether to load it as env (in a scope aspects capsule)
|
|
72
|
-
*/
|
|
73
|
-
loadEnvs?: boolean;
|
|
74
|
-
};
|
|
75
|
-
export type ScopeConfig = {
|
|
76
|
-
httpTimeOut: number;
|
|
77
|
-
description?: string;
|
|
78
|
-
icon?: string;
|
|
79
|
-
backgroundIconColor?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Set a different package manager for the aspects capsules
|
|
82
|
-
*/
|
|
83
|
-
aspectsPackageManager?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Set a different node linker for the aspects capsules
|
|
86
|
-
*/
|
|
87
|
-
aspectsNodeLinker?: NodeLinker;
|
|
88
|
-
};
|
|
89
|
-
export declare class ScopeMain implements ComponentFactory {
|
|
90
|
-
/**
|
|
91
|
-
* private reference to the instance of Harmony.
|
|
92
|
-
*/
|
|
93
|
-
private harmony;
|
|
94
|
-
/**
|
|
95
|
-
* legacy scope
|
|
96
|
-
*/
|
|
97
|
-
readonly legacyScope: LegacyScope;
|
|
98
|
-
/**
|
|
99
|
-
* component extension.
|
|
100
|
-
*/
|
|
101
|
-
readonly componentExtension: ComponentMain;
|
|
102
|
-
/**
|
|
103
|
-
* slot registry for subscribing to build
|
|
104
|
-
*/
|
|
105
|
-
readonly config: ScopeConfig;
|
|
106
|
-
private postPutSlot;
|
|
107
|
-
private postDeleteSlot;
|
|
108
|
-
private postExportSlot;
|
|
109
|
-
private postObjectsPersist;
|
|
110
|
-
preFetchObjects: OnPreFetchObjectsSlot;
|
|
111
|
-
private OnCompAspectReCalcSlot;
|
|
112
|
-
private isolator;
|
|
113
|
-
private aspectLoader;
|
|
114
|
-
private logger;
|
|
115
|
-
private envs;
|
|
116
|
-
private dependencyResolver;
|
|
117
|
-
private globalConfig;
|
|
118
|
-
componentLoader: ScopeComponentLoader;
|
|
119
|
-
constructor(
|
|
120
|
-
/**
|
|
121
|
-
* private reference to the instance of Harmony.
|
|
122
|
-
*/
|
|
123
|
-
harmony: Harmony,
|
|
124
|
-
/**
|
|
125
|
-
* legacy scope
|
|
126
|
-
*/
|
|
127
|
-
legacyScope: LegacyScope,
|
|
128
|
-
/**
|
|
129
|
-
* component extension.
|
|
130
|
-
*/
|
|
131
|
-
componentExtension: ComponentMain,
|
|
132
|
-
/**
|
|
133
|
-
* slot registry for subscribing to build
|
|
134
|
-
*/
|
|
135
|
-
config: ScopeConfig, postPutSlot: OnPostPutSlot, postDeleteSlot: OnPostDeleteSlot, postExportSlot: OnPostExportSlot, postObjectsPersist: OnPostObjectsPersistSlot, preFetchObjects: OnPreFetchObjectsSlot, OnCompAspectReCalcSlot: OnCompAspectReCalcSlot, isolator: IsolatorMain, aspectLoader: AspectLoaderMain, logger: Logger, envs: EnvsMain, dependencyResolver: DependencyResolverMain, globalConfig: GlobalConfigMain);
|
|
136
|
-
priority?: boolean | undefined;
|
|
137
|
-
localAspects: string[];
|
|
138
|
-
/**
|
|
139
|
-
* name of the scope
|
|
140
|
-
*/
|
|
141
|
-
get name(): string;
|
|
142
|
-
get icon(): string | undefined;
|
|
143
|
-
get backgroundIconColor(): string | undefined;
|
|
144
|
-
get description(): string | undefined;
|
|
145
|
-
get path(): string;
|
|
146
|
-
get isLegacy(): boolean;
|
|
147
|
-
get isGlobalScope(): boolean;
|
|
148
|
-
get aspectsPackageManager(): string | undefined;
|
|
149
|
-
get aspectsNodeLinker(): NodeLinker | undefined;
|
|
150
|
-
reloadAspectsWithNewVersion(components: ConsumerComponent[]): Promise<void>;
|
|
151
|
-
loadAspects(ids: string[], throwOnError?: boolean | undefined, neededFor?: string | undefined, lane?: Lane, opts?: ScopeLoadAspectsOptions): Promise<string[]>;
|
|
152
|
-
resolveAspects(runtimeName?: string | undefined, componentIds?: ComponentID[] | undefined, opts?: ResolveAspectsOptions | undefined): Promise<AspectDefinition[]>;
|
|
153
|
-
getResolvedAspects(components: Component[], opts?: {
|
|
154
|
-
skipIfExists?: boolean;
|
|
155
|
-
packageManagerConfigRootDir?: string;
|
|
156
|
-
workspaceName?: string;
|
|
157
|
-
}): Promise<RequireableComponent[]>;
|
|
158
|
-
executeOnCompAspectReCalcSlot(component: Component): Promise<Component>;
|
|
159
|
-
getDependencies(component: Component): import("@teambit/dependency-resolver").DependencyList;
|
|
160
|
-
private upsertExtensionData;
|
|
161
|
-
private getDataEntry;
|
|
162
|
-
getIsolateAspectsOpts(opts?: {
|
|
163
|
-
skipIfExists?: boolean;
|
|
164
|
-
packageManagerConfigRootDir?: string;
|
|
165
|
-
workspaceName?: string;
|
|
166
|
-
}): IsolateComponentsOptions;
|
|
167
|
-
getAspectCapsulePath(): string;
|
|
168
|
-
shouldUseHashForCapsules(): boolean;
|
|
169
|
-
getManyByLegacy(components: ConsumerComponent[]): Promise<Component[]>;
|
|
170
|
-
getScopeAspectsLoader(): ScopeAspectsLoader;
|
|
171
|
-
clearCache(): Promise<void>;
|
|
172
|
-
builderDataMapToLegacyOnTagResults(builderDataComponentMap: ComponentMap<RawBuilderData>): LegacyOnTagResult[];
|
|
173
|
-
/**
|
|
174
|
-
* register to the post-export slot.
|
|
175
|
-
*/
|
|
176
|
-
onPostPut(postPutFn: OnPostPut): this;
|
|
177
|
-
/**
|
|
178
|
-
* register to the post-delete slot.
|
|
179
|
-
*/
|
|
180
|
-
onPostDelete(postDeleteFn: OnPostDelete): this;
|
|
181
|
-
/**
|
|
182
|
-
* register to the post-export slot.
|
|
183
|
-
*/
|
|
184
|
-
registerOnPostExport(postExportFn: OnPostExport): this;
|
|
185
|
-
registerOnPreFetchObjects(preFetchObjectsFn: OnPreFetchObjects): this;
|
|
186
|
-
registerOnCompAspectReCalc(compAspectReCalcSlotFn: OnCompAspectReCalc): void;
|
|
187
|
-
registerOnPostObjectsPersist(postObjectsPersistFn: OnPostObjectsPersist): this;
|
|
188
|
-
/**
|
|
189
|
-
* Will fetch a list of components into the current scope.
|
|
190
|
-
* This will only fetch the object and won't write the files to the actual FS
|
|
191
|
-
*/
|
|
192
|
-
fetch(ids: ComponentIdList): void;
|
|
193
|
-
/**
|
|
194
|
-
* This function will get a component and sealed it's current state into the scope
|
|
195
|
-
*
|
|
196
|
-
* @param {Component[]} components A list of components to seal with specific persist options (such as message and version number)
|
|
197
|
-
* @param {PersistOptions} persistGeneralOptions General persistence options such as verbose
|
|
198
|
-
*/
|
|
199
|
-
persist(components: Component[], options: PersistOptions): void;
|
|
200
|
-
delete({ ids, force, lanes }: {
|
|
201
|
-
ids: string[];
|
|
202
|
-
force: boolean;
|
|
203
|
-
lanes: boolean;
|
|
204
|
-
}, headers?: Record<string, any>): Promise<import("@teambit/legacy/dist/scope/removed-components").RemovedObjectSerialized>;
|
|
205
|
-
isExported(id: ComponentID): boolean;
|
|
206
|
-
/**
|
|
207
|
-
* for long-running processes, such as `bit start` or `bit watch`, it's important to keep the following data up to date:
|
|
208
|
-
* 1. scope-index (.bit/index.json file).
|
|
209
|
-
* 2. remote-refs (.bit/refs/*).
|
|
210
|
-
* it's possible that other commands (e.g. `bit import`) modified these files, while these processes are running.
|
|
211
|
-
* Because these data are kept in memory, they're not up to date anymore.
|
|
212
|
-
*/
|
|
213
|
-
watchScopeInternalFiles(): Promise<void>;
|
|
214
|
-
toObjectList(types: Types): Promise<ObjectList>;
|
|
215
|
-
private toJs;
|
|
216
|
-
getGraph(ids?: ComponentID[]): Promise<Graph<Component, string>>;
|
|
217
|
-
getGraphIds(ids?: ComponentID[]): Promise<CompIdGraph>;
|
|
218
|
-
getFlattenedEdges(id: ComponentID): Promise<DepEdge[] | undefined>;
|
|
219
|
-
private getSavedGraphOfComponentIfExist;
|
|
220
|
-
/**
|
|
221
|
-
* import components into the scope.
|
|
222
|
-
*/
|
|
223
|
-
import(ids: ComponentID[], { useCache, reFetchUnBuiltVersion, preferDependencyGraph, lane, reason, }?: {
|
|
224
|
-
/**
|
|
225
|
-
* if the component exists locally, don't go to the server to search for updates.
|
|
226
|
-
*/
|
|
227
|
-
useCache?: boolean;
|
|
228
|
-
/**
|
|
229
|
-
* if the Version objects exists locally, but its `buildStatus` is Pending or Failed, reach the remote to find
|
|
230
|
-
* whether the version was already built there.
|
|
231
|
-
*/
|
|
232
|
-
reFetchUnBuiltVersion?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* if the component is on a lane, provide the lane object. the component will be fetched from the lane-scope and
|
|
235
|
-
* not from the component-scope.
|
|
236
|
-
*/
|
|
237
|
-
lane?: Lane;
|
|
238
|
-
/**
|
|
239
|
-
* if an external is missing and the remote has it with the dependency graph, don't fetch all its dependencies
|
|
240
|
-
*/
|
|
241
|
-
preferDependencyGraph?: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* reason why this import is needed (to show in the terminal)
|
|
244
|
-
*/
|
|
245
|
-
reason?: string;
|
|
246
|
-
}): Promise<void>;
|
|
247
|
-
get(id: ComponentID, useCache?: boolean, importIfMissing?: boolean): Promise<Component | undefined>;
|
|
248
|
-
getFromConsumerComponent(consumerComponent: ConsumerComponent): Promise<Component>;
|
|
249
|
-
/**
|
|
250
|
-
* get a component from a remote without importing it
|
|
251
|
-
*/
|
|
252
|
-
getRemoteComponent(id: ComponentID): Promise<Component>;
|
|
253
|
-
/**
|
|
254
|
-
* get a component from a remote without importing it
|
|
255
|
-
*/
|
|
256
|
-
getManyRemoteComponents(ids: ComponentID[]): Promise<Component[]>;
|
|
257
|
-
/**
|
|
258
|
-
* list all components in the scope.
|
|
259
|
-
*/
|
|
260
|
-
list(filter?: {
|
|
261
|
-
offset: number;
|
|
262
|
-
limit: number;
|
|
263
|
-
namespaces?: string[];
|
|
264
|
-
}, includeCache?: boolean, includeFromLanes?: boolean, includeDeleted?: boolean): Promise<Component[]>;
|
|
265
|
-
/**
|
|
266
|
-
* for now, list of invalid components are mostly useful for the workspace.
|
|
267
|
-
* in the future, this can return components that failed to load in the scope due to objects file
|
|
268
|
-
* corruption or similar issues.
|
|
269
|
-
*/
|
|
270
|
-
listInvalid(): Promise<never[]>;
|
|
271
|
-
/**
|
|
272
|
-
* get ids of all scope components.
|
|
273
|
-
* @param includeCache whether or not include components that their scope-name is different than the current scope-name
|
|
274
|
-
*/
|
|
275
|
-
listIds(includeCache?: boolean, includeFromLanes?: boolean, patterns?: string[]): Promise<ComponentID[]>;
|
|
276
|
-
/**
|
|
277
|
-
* Check if a specific id exist in the scope
|
|
278
|
-
* @param componentId
|
|
279
|
-
*/
|
|
280
|
-
hasId(componentId: ComponentID, includeCache?: boolean): Promise<boolean>;
|
|
281
|
-
hasIdNested(componentId: ComponentID, includeCache?: boolean): Promise<boolean>;
|
|
282
|
-
/**
|
|
283
|
-
* determine whether a component exists in the scope.
|
|
284
|
-
*/
|
|
285
|
-
exists(modelComponent: ModelComponent): boolean;
|
|
286
|
-
getMany(ids: ComponentID[], throwIfNotExist?: boolean): Promise<Component[]>;
|
|
287
|
-
/**
|
|
288
|
-
* important! you probably want to use `getMany`, which returns the components from the scope.
|
|
289
|
-
* this method loads all aspects of the loaded components. (which hurts performance)
|
|
290
|
-
*/
|
|
291
|
-
loadMany(ids: ComponentID[], lane?: Lane, opts?: LoadOptions): Promise<Component[]>;
|
|
292
|
-
loadManyCompsAspects(components: Component[], lane?: Lane): Promise<Component[]>;
|
|
293
|
-
/**
|
|
294
|
-
* get a component and throw an exception if not found.
|
|
295
|
-
* @param id component id
|
|
296
|
-
*/
|
|
297
|
-
getOrThrow(id: ComponentID): Promise<Component>;
|
|
298
|
-
/**
|
|
299
|
-
* returns a specific state of a component.
|
|
300
|
-
* @param id component ID.
|
|
301
|
-
* @param hash state hash.
|
|
302
|
-
*/
|
|
303
|
-
getState(id: ComponentID, hash: string): Promise<State>;
|
|
304
|
-
getSnap(id: ComponentID, hash: string): Promise<Snap>;
|
|
305
|
-
/**
|
|
306
|
-
* get component log sorted by the timestamp in ascending order (from the earliest to the latest)
|
|
307
|
-
*/
|
|
308
|
-
getLogs(id: ComponentID, shortHash?: boolean, startsFrom?: string): Promise<ComponentLog[]>;
|
|
309
|
-
getStagedConfig(): Promise<StagedConfig>;
|
|
310
|
-
/**
|
|
311
|
-
* wether a component is soft-removed.
|
|
312
|
-
* the version is required as it can be removed on a lane. in which case, the version is the head in the lane.
|
|
313
|
-
*/
|
|
314
|
-
isComponentRemoved(id: ComponentID): Promise<Boolean>;
|
|
315
|
-
/**
|
|
316
|
-
* resolve a component ID.
|
|
317
|
-
* @param id component ID.
|
|
318
|
-
*/
|
|
319
|
-
resolveComponentId(id: string | BitId | ComponentID): Promise<ComponentID>;
|
|
320
|
-
private resolveComponentIdFromBitId;
|
|
321
|
-
resolveMultipleComponentIds(ids: Array<string | ComponentID | ComponentID>): Promise<ComponentID[]>;
|
|
322
|
-
/**
|
|
323
|
-
* @deprecated use `this.idsByPattern` instead for consistency, which supports also negation and list of patterns.
|
|
324
|
-
*/
|
|
325
|
-
byPattern(patterns: string[], scope?: string): Promise<Component[]>;
|
|
326
|
-
/**
|
|
327
|
-
* get component-ids matching the given pattern. a pattern can have multiple patterns separated by a comma.
|
|
328
|
-
* it uses multimatch (https://www.npmjs.com/package/multimatch) package for the matching algorithm, which supports
|
|
329
|
-
* (among others) negate character "!" to exclude ids. See the package page for more supported characters.
|
|
330
|
-
*/
|
|
331
|
-
idsByPattern(pattern: string, throwForNoMatch?: boolean): Promise<ComponentID[]>;
|
|
332
|
-
filterIdsFromPoolIdsByPattern(pattern: string, ids: ComponentID[], throwForNoMatch?: boolean, filterByStateFunc?: (state: any, poolIds: ComponentID[]) => Promise<ComponentID[]>): Promise<ComponentID[]>;
|
|
333
|
-
getSnapDistance(id: ComponentID, throws?: boolean): Promise<SnapsDistance>;
|
|
334
|
-
/**
|
|
335
|
-
* get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps
|
|
336
|
-
* @param componentId
|
|
337
|
-
* @param sourceHead head on the source lane. leave empty if the source is main
|
|
338
|
-
* @param targetHead head on the target lane. leave empty if the target is main
|
|
339
|
-
* @returns
|
|
340
|
-
*/
|
|
341
|
-
getSnapsDistanceBetweenTwoSnaps(componentId: ComponentID, sourceHead?: string, targetHead?: string, throws?: boolean): Promise<SnapsDistance>;
|
|
342
|
-
getExactVersionBySemverRange(id: ComponentID, range: string): Promise<string | undefined>;
|
|
343
|
-
resumeExport(exportId: string, remotes: string[]): Promise<string[]>;
|
|
344
|
-
/**
|
|
345
|
-
* @deprecated use `this.resolveComponentId` instead.
|
|
346
|
-
*/
|
|
347
|
-
resolveId(id: string): Promise<ComponentID>;
|
|
348
|
-
_legacyRemotes(): Promise<Remotes>;
|
|
349
|
-
/**
|
|
350
|
-
* list all component ids from a remote-scope
|
|
351
|
-
*/
|
|
352
|
-
listRemoteScope(scopeName: string): Promise<ComponentID[]>;
|
|
353
|
-
getLegacyMinimal(id: ComponentID): Promise<ConsumerComponent | undefined>;
|
|
354
|
-
/**
|
|
355
|
-
* ModelComponent is of type `BitObject` which gets saved into the local scope as an object file.
|
|
356
|
-
* It has data about the tags and the component head. It doesn't have any data about the source-files/artifacts etc.
|
|
357
|
-
*/
|
|
358
|
-
getBitObjectModelComponent(id: ComponentID, throwIfNotExist?: boolean): Promise<ModelComponent | undefined>;
|
|
359
|
-
/**
|
|
360
|
-
* Version BitObject holds the data of the source files and build artifacts of a specific snap/tag.
|
|
361
|
-
*/
|
|
362
|
-
getBitObjectVersion(modelComponent: ModelComponent, version: string, throwIfNotExist?: boolean): Promise<Version | undefined>;
|
|
363
|
-
getBitObjectVersionById(id: ComponentID, throwIfNotExist?: boolean): Promise<Version | undefined>;
|
|
364
|
-
/**
|
|
365
|
-
* get a component and load its aspect
|
|
366
|
-
*/
|
|
367
|
-
load(id: ComponentID, lane?: Lane, opts?: LoadOptions): Promise<Component | undefined>;
|
|
368
|
-
loadCompAspects(component: Component, lane?: Lane, opts?: LoadOptions): Promise<Component>;
|
|
369
|
-
loadComponentsAspect(component: Component): Promise<void>;
|
|
370
|
-
addAspectsFromConfigObject(component: Component, configObject: Record<string, any>): Promise<void>;
|
|
371
|
-
createAspectListFromExtensionDataList(extensionDataList: ExtensionDataList): Promise<import("@teambit/component").AspectList>;
|
|
372
|
-
private extensionDataEntryToAspectEntry;
|
|
373
|
-
getLastMergedPath(): string;
|
|
374
|
-
isModified(): Promise<boolean>;
|
|
375
|
-
write(): Promise<void>;
|
|
376
|
-
/**
|
|
377
|
-
* declare the slots of scope extension.
|
|
378
|
-
*/
|
|
379
|
-
static slots: (((registerFn: () => string) => SlotRegistry<OnPostPut>) | ((registerFn: () => string) => SlotRegistry<OnPostObjectsPersist>) | ((registerFn: () => string) => SlotRegistry<OnPreFetchObjects>) | ((registerFn: () => string) => SlotRegistry<OnCompAspectReCalc>))[];
|
|
380
|
-
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
381
|
-
static dependencies: import("@teambit/harmony").Aspect[];
|
|
382
|
-
static defaultConfig: ScopeConfig;
|
|
383
|
-
static provider([componentExt, ui, graphql, cli, isolator, aspectLoader, express, loggerMain, envs, depsResolver, globalConfig]: [
|
|
384
|
-
ComponentMain,
|
|
385
|
-
UiMain,
|
|
386
|
-
GraphqlMain,
|
|
387
|
-
CLIMain,
|
|
388
|
-
IsolatorMain,
|
|
389
|
-
AspectLoaderMain,
|
|
390
|
-
ExpressMain,
|
|
391
|
-
LoggerMain,
|
|
392
|
-
EnvsMain,
|
|
393
|
-
DependencyResolverMain,
|
|
394
|
-
GlobalConfigMain
|
|
395
|
-
], config: ScopeConfig, [postPutSlot, postDeleteSlot, postExportSlot, postObjectsPersistSlot, preFetchObjectsSlot, OnCompAspectReCalcSlot,]: [
|
|
396
|
-
OnPostPutSlot,
|
|
397
|
-
OnPostDeleteSlot,
|
|
398
|
-
OnPostExportSlot,
|
|
399
|
-
OnPostObjectsPersistSlot,
|
|
400
|
-
OnPreFetchObjectsSlot,
|
|
401
|
-
OnCompAspectReCalcSlot
|
|
402
|
-
], harmony: Harmony): Promise<ScopeMain | undefined>;
|
|
403
|
-
}
|
|
404
|
-
export {};
|
package/dist/scope.ui-root.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ResolveAspectsOptions } from '@teambit/component';
|
|
2
|
-
import { ComponentID } from '@teambit/component-id';
|
|
3
|
-
import { UIRoot } from '@teambit/ui';
|
|
4
|
-
import type { ScopeMain } from './scope.main.runtime';
|
|
5
|
-
export declare class ScopeUIRoot implements UIRoot {
|
|
6
|
-
/**
|
|
7
|
-
* scope extension.
|
|
8
|
-
*/
|
|
9
|
-
private scope;
|
|
10
|
-
constructor(
|
|
11
|
-
/**
|
|
12
|
-
* scope extension.
|
|
13
|
-
*/
|
|
14
|
-
scope: ScopeMain);
|
|
15
|
-
get name(): string;
|
|
16
|
-
get path(): string;
|
|
17
|
-
get configFile(): string;
|
|
18
|
-
get devServers(): Promise<never[]>;
|
|
19
|
-
buildOptions: {
|
|
20
|
-
ssr: boolean;
|
|
21
|
-
prebundle: boolean;
|
|
22
|
-
};
|
|
23
|
-
resolveAspects(runtime: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions): Promise<import("@teambit/aspect-loader").AspectDefinition[]>;
|
|
24
|
-
resolvePattern(): Promise<never[]>;
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ComponentsDrawer, ComponentFiltersSlot, DrawerWidgetSlot } from '@teambit/component.ui.component-drawer';
|
|
2
|
-
import { ComponentModel } from '@teambit/component';
|
|
3
|
-
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
4
|
-
import { SidebarSlot } from './scope.ui.runtime';
|
|
5
|
-
export type ScopeDrawerProps = {
|
|
6
|
-
treeWidgets: SidebarSlot;
|
|
7
|
-
filtersSlot: ComponentFiltersSlot;
|
|
8
|
-
drawerWidgetSlot: DrawerWidgetSlot;
|
|
9
|
-
assumeScopeInUrl?: boolean;
|
|
10
|
-
overrideUseComponents?: () => {
|
|
11
|
-
components: ComponentModel[];
|
|
12
|
-
};
|
|
13
|
-
overrideUseLanes?: () => {
|
|
14
|
-
lanesModel?: LanesModel;
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const scopeDrawer: ({ treeWidgets, filtersSlot, drawerWidgetSlot, assumeScopeInUrl, overrideUseComponents, overrideUseLanes: useLanesFromProps, }: ScopeDrawerProps) => ComponentsDrawer;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import type { ComponentUI, ComponentModel } from '@teambit/component';
|
|
2
|
-
import { SlotRegistry } from '@teambit/harmony';
|
|
3
|
-
import type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
4
|
-
import { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';
|
|
5
|
-
import { ComponentTreeNode } from '@teambit/component-tree';
|
|
6
|
-
import { UIRootUI as UIRoot, UiUI } from '@teambit/ui';
|
|
7
|
-
import React, { ComponentType, ReactNode } from 'react';
|
|
8
|
-
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
9
|
-
import { RouteProps } from 'react-router-dom';
|
|
10
|
-
import { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';
|
|
11
|
-
import { CommandBarUI } from '@teambit/command-bar';
|
|
12
|
-
import { ScopeModel } from '@teambit/scope.models.scope-model';
|
|
13
|
-
import { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';
|
|
14
|
-
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
15
|
-
import { DrawerWidgetSlot, ComponentFiltersSlot } from '@teambit/component.ui.component-drawer';
|
|
16
|
-
import { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
17
|
-
import { ComponentUrlResolver } from '@teambit/component.modules.component-url';
|
|
18
|
-
import { GetScopeOptions } from './get-scope-options';
|
|
19
|
-
export type ScopeBadge = ComponentType;
|
|
20
|
-
export type ScopeBadgeSlot = SlotRegistry<ScopeBadge[]>;
|
|
21
|
-
export type ContextSlot = SlotRegistry<ScopeContextType[]>;
|
|
22
|
-
export type ScopeContextType = ComponentType<{
|
|
23
|
-
scope: ScopeModel;
|
|
24
|
-
children: ReactNode;
|
|
25
|
-
}>;
|
|
26
|
-
export type SidebarSlot = SlotRegistry<ComponentTreeNode>;
|
|
27
|
-
export type ScopeOverview = ComponentType;
|
|
28
|
-
export type ScopeOverviewSlot = SlotRegistry<ScopeOverview>;
|
|
29
|
-
export type Corner = ComponentType;
|
|
30
|
-
export type CornerSlot = SlotRegistry<Corner>;
|
|
31
|
-
export type OverviewLine = ComponentType;
|
|
32
|
-
export type OverviewLineSlot = SlotRegistry<OverviewLine[]>;
|
|
33
|
-
export type ScopeUIConfig = {
|
|
34
|
-
showGallery: boolean;
|
|
35
|
-
useBoxAction?: string;
|
|
36
|
-
useBoxIcon?: string;
|
|
37
|
-
};
|
|
38
|
-
export declare class ScopeUI {
|
|
39
|
-
/**
|
|
40
|
-
* route slot.
|
|
41
|
-
*/
|
|
42
|
-
private routeSlot;
|
|
43
|
-
/**
|
|
44
|
-
* component ui extension.
|
|
45
|
-
*/
|
|
46
|
-
private componentUi;
|
|
47
|
-
/**
|
|
48
|
-
* menu slot
|
|
49
|
-
*/
|
|
50
|
-
private menuSlot;
|
|
51
|
-
private sidebar;
|
|
52
|
-
private sidebarSlot;
|
|
53
|
-
private commandBarUI;
|
|
54
|
-
private scopeBadgeSlot;
|
|
55
|
-
private menuWidgetSlot;
|
|
56
|
-
/**
|
|
57
|
-
* sidebar link slot
|
|
58
|
-
*/
|
|
59
|
-
private sidebarItemSlot;
|
|
60
|
-
/**
|
|
61
|
-
* main dropdown item slot
|
|
62
|
-
*/
|
|
63
|
-
private menuItemSlot;
|
|
64
|
-
/**
|
|
65
|
-
* corner slot
|
|
66
|
-
*/
|
|
67
|
-
private cornerSlot;
|
|
68
|
-
/**
|
|
69
|
-
* overview line slot to add new lines beneath the overview section
|
|
70
|
-
*/
|
|
71
|
-
private overviewSlot;
|
|
72
|
-
/**
|
|
73
|
-
* add a new context to ui
|
|
74
|
-
*/
|
|
75
|
-
private contextSlot;
|
|
76
|
-
private drawerWidgetSlot;
|
|
77
|
-
private drawerComponentsFiltersSlot;
|
|
78
|
-
constructor(
|
|
79
|
-
/**
|
|
80
|
-
* route slot.
|
|
81
|
-
*/
|
|
82
|
-
routeSlot: RouteSlot,
|
|
83
|
-
/**
|
|
84
|
-
* component ui extension.
|
|
85
|
-
*/
|
|
86
|
-
componentUi: ComponentUI,
|
|
87
|
-
/**
|
|
88
|
-
* menu slot
|
|
89
|
-
*/
|
|
90
|
-
menuSlot: RouteSlot, sidebar: SidebarUI, sidebarSlot: SidebarSlot, commandBarUI: CommandBarUI, scopeBadgeSlot: ScopeBadgeSlot, menuWidgetSlot: MenuWidgetSlot,
|
|
91
|
-
/**
|
|
92
|
-
* sidebar link slot
|
|
93
|
-
*/
|
|
94
|
-
sidebarItemSlot: SidebarItemSlot,
|
|
95
|
-
/**
|
|
96
|
-
* main dropdown item slot
|
|
97
|
-
*/
|
|
98
|
-
menuItemSlot: MenuItemSlot,
|
|
99
|
-
/**
|
|
100
|
-
* corner slot
|
|
101
|
-
*/
|
|
102
|
-
cornerSlot: CornerSlot,
|
|
103
|
-
/**
|
|
104
|
-
* overview line slot to add new lines beneath the overview section
|
|
105
|
-
*/
|
|
106
|
-
overviewSlot: OverviewLineSlot,
|
|
107
|
-
/**
|
|
108
|
-
* add a new context to ui
|
|
109
|
-
*/
|
|
110
|
-
contextSlot: ContextSlot, drawerWidgetSlot: DrawerWidgetSlot, drawerComponentsFiltersSlot: ComponentFiltersSlot);
|
|
111
|
-
private setSidebarToggle;
|
|
112
|
-
/**
|
|
113
|
-
* register a new badge into the scope overview.
|
|
114
|
-
*/
|
|
115
|
-
registerBadge(...badges: ScopeBadge[]): this;
|
|
116
|
-
getScope(options: GetScopeOptions): import("react/jsx-runtime").JSX.Element;
|
|
117
|
-
/**
|
|
118
|
-
* register a new line beneath the scope overview section.
|
|
119
|
-
*/
|
|
120
|
-
registerOverviewLine(...lines: OverviewLine[]): this;
|
|
121
|
-
/**
|
|
122
|
-
* register a route to the scope.
|
|
123
|
-
*/
|
|
124
|
-
registerRoutes(routes: RouteProps[]): this;
|
|
125
|
-
registerMenuRoutes: (routes: RouteProps[]) => this;
|
|
126
|
-
private applyMenuRoutes;
|
|
127
|
-
getScopeMenu(): import("react/jsx-runtime").JSX.Element;
|
|
128
|
-
private registerExplicitRoutes;
|
|
129
|
-
registerMenuWidget(...menuItems: MenuWidget[]): void;
|
|
130
|
-
registerCorner(corner: Corner): void;
|
|
131
|
-
private componentUrlFunc;
|
|
132
|
-
registerComponentUrl(func: ComponentUrlResolver): void;
|
|
133
|
-
/**
|
|
134
|
-
* register a scope overview.
|
|
135
|
-
*/
|
|
136
|
-
replaceOverview(): void;
|
|
137
|
-
/**
|
|
138
|
-
* register description.
|
|
139
|
-
*/
|
|
140
|
-
replaceDescription(): void;
|
|
141
|
-
/**
|
|
142
|
-
* register metadata section.
|
|
143
|
-
*/
|
|
144
|
-
replaceMetadataSection(): void;
|
|
145
|
-
/**
|
|
146
|
-
* register a metadata item.
|
|
147
|
-
*/
|
|
148
|
-
registerMetadataItem(): void;
|
|
149
|
-
replaceComponentGrid(): void;
|
|
150
|
-
/**
|
|
151
|
-
* register metadata.
|
|
152
|
-
*/
|
|
153
|
-
registerMetadata(): void;
|
|
154
|
-
/**
|
|
155
|
-
* add a new context to the scope.
|
|
156
|
-
*/
|
|
157
|
-
addContext(...context: ScopeContextType[]): this;
|
|
158
|
-
private getContext;
|
|
159
|
-
registerMenuItem: (menuItems: MenuItem[]) => void;
|
|
160
|
-
/**
|
|
161
|
-
* register a sidebar Widget for the scope
|
|
162
|
-
*/
|
|
163
|
-
registerSidebarWidget: (componentTreeNodes: ComponentTreeNode[]) => this;
|
|
164
|
-
/**
|
|
165
|
-
* register a sidebar link to the section above the drawers
|
|
166
|
-
*/
|
|
167
|
-
registerSidebarLink: (...links: SidebarItem[]) => void;
|
|
168
|
-
registerDrawers: (...drawer: DrawerType[]) => this;
|
|
169
|
-
/**
|
|
170
|
-
* register component filters
|
|
171
|
-
*/
|
|
172
|
-
registerDrawerComponentFilters: (filters: ComponentFilters) => void;
|
|
173
|
-
registerDrawerWidgets: (widgets: ReactNode[]) => void;
|
|
174
|
-
registerDefaultDrawers(assumeScopeInUrl?: boolean, overrideUseComponents?: () => {
|
|
175
|
-
components: ComponentModel[];
|
|
176
|
-
}, overrideUseLanes?: () => {
|
|
177
|
-
lanesModel: LanesModel;
|
|
178
|
-
}): void;
|
|
179
|
-
getDefaultDrawer(assumeScopeInUrl?: boolean, overrideUseComponents?: () => {
|
|
180
|
-
components: ComponentModel[];
|
|
181
|
-
}, overrideUseLanes?: () => {
|
|
182
|
-
lanesModel: LanesModel;
|
|
183
|
-
}): import("@teambit/component.ui.component-drawer").ComponentsDrawer;
|
|
184
|
-
uiRoot(): UIRoot;
|
|
185
|
-
listSidebarLinks(): (React.ComponentClass<{}, any> | React.FunctionComponent<{}>)[];
|
|
186
|
-
/** registers available components */
|
|
187
|
-
setComponents: (components: ComponentModel[]) => void;
|
|
188
|
-
private menuItems;
|
|
189
|
-
static dependencies: import("@teambit/harmony").Aspect[];
|
|
190
|
-
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
191
|
-
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<ComponentTreeNode>) | ((registerFn: () => string) => SlotRegistry<DrawerWidgetSlot>) | ((registerFn: () => string) => SlotRegistry<ScopeBadge>) | ((registerFn: () => string) => SlotRegistry<MenuWidget[]>) | ((registerFn: () => string) => SlotRegistry<CornerSlot>))[];
|
|
192
|
-
static defaultConfig: {
|
|
193
|
-
showGallery: boolean;
|
|
194
|
-
};
|
|
195
|
-
static provider([ui, componentUi, sidebar, commandBarUI]: [UiUI, ComponentUI, SidebarUI, CommandBarUI], config: ScopeUIConfig, [routeSlot, menuSlot, sidebarSlot, scopeBadgeSlot, menuWidgetSlot, menuItemSlot, sidebarItemSlot, cornerSlot, overviewSlot, contextSlot, drawerWidgetSlot, componentFiltersSlot,]: [
|
|
196
|
-
RouteSlot,
|
|
197
|
-
RouteSlot,
|
|
198
|
-
SidebarSlot,
|
|
199
|
-
ScopeBadgeSlot,
|
|
200
|
-
MenuWidgetSlot,
|
|
201
|
-
MenuItemSlot,
|
|
202
|
-
SidebarItemSlot,
|
|
203
|
-
CornerSlot,
|
|
204
|
-
OverviewLineSlot,
|
|
205
|
-
ContextSlot,
|
|
206
|
-
DrawerWidgetSlot,
|
|
207
|
-
ComponentFiltersSlot
|
|
208
|
-
]): Promise<ScopeUI>;
|
|
209
|
-
}
|
|
210
|
-
export default ScopeUI;
|
package/dist/staged-config.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ComponentID, ComponentIdObj } from '@teambit/component-id';
|
|
2
|
-
import { LaneId } from '@teambit/lane-id';
|
|
3
|
-
import { Logger } from '@teambit/logger';
|
|
4
|
-
type Config = Record<string, any> | undefined;
|
|
5
|
-
type ComponentConfig = {
|
|
6
|
-
id: ComponentID;
|
|
7
|
-
config: Config;
|
|
8
|
-
};
|
|
9
|
-
type ComponentConfigObj = {
|
|
10
|
-
id: ComponentIdObj;
|
|
11
|
-
config: Config;
|
|
12
|
-
};
|
|
13
|
-
export declare class StagedConfig {
|
|
14
|
-
readonly filePath: string;
|
|
15
|
-
private componentsConfig;
|
|
16
|
-
private logger;
|
|
17
|
-
hasChanged: boolean;
|
|
18
|
-
constructor(filePath: string, componentsConfig: ComponentConfig[], logger: Logger);
|
|
19
|
-
static load(scopePath: string, logger: Logger, laneId?: LaneId): Promise<StagedConfig>;
|
|
20
|
-
toObject(): ComponentConfigObj[];
|
|
21
|
-
write(): Promise<void>;
|
|
22
|
-
getConfigPerId(id: ComponentID): Config;
|
|
23
|
-
getAll(): ComponentConfig[];
|
|
24
|
-
isEmpty(): boolean;
|
|
25
|
-
deleteFile(): Promise<void>;
|
|
26
|
-
addComponentConfig(id: ComponentID, config: Config): void;
|
|
27
|
-
removeComponentConfig(id: ComponentID): void;
|
|
28
|
-
}
|
|
29
|
-
export {};
|