@teambit/workspace 1.0.106 → 1.0.108
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/aspects-merger.ts +319 -0
- package/bit-map.ts +277 -0
- package/build-graph-from-fs.ts +188 -0
- package/build-graph-ids-from-fs.ts +216 -0
- package/capsule.cmd.ts +217 -0
- package/constants.ts +1 -0
- package/dist/aspects-merger.js +13 -22
- package/dist/aspects-merger.js.map +1 -1
- package/dist/bit-map.d.ts +1 -1
- package/dist/build-graph-from-fs.d.ts +2 -2
- package/dist/build-graph-from-fs.js +1 -2
- package/dist/build-graph-from-fs.js.map +1 -1
- package/dist/build-graph-ids-from-fs.js +1 -1
- package/dist/build-graph-ids-from-fs.js.map +1 -1
- package/dist/capsule.cmd.d.ts +2 -2
- package/dist/capsule.cmd.js +1 -2
- package/dist/capsule.cmd.js.map +1 -1
- package/dist/component-config-file/component-config-file.d.ts +2 -2
- package/dist/component-tree.widget.d.ts +2 -2
- package/dist/eject-conf.cmd.d.ts +2 -2
- package/dist/envs-subcommands/envs-replace.cmd.d.ts +1 -1
- package/dist/envs-subcommands/envs-set.cmd.d.ts +1 -1
- package/dist/envs-subcommands/envs-unset.cmd.d.ts +1 -1
- package/dist/envs-subcommands/envs-update.cmd.d.ts +1 -1
- package/dist/filter.d.ts +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/merge-conflict-file.d.ts +1 -1
- package/dist/merge-conflict-file.js +1 -2
- package/dist/merge-conflict-file.js.map +1 -1
- package/dist/on-component-events.d.ts +6 -6
- package/dist/{preview-1703505948637.js → preview-1703647408454.js} +2 -2
- package/dist/scope-subcommands/scope-set.cmd.d.ts +1 -1
- package/dist/ui/workspace/use-workspace.d.ts +8 -8
- package/dist/ui/workspace/use-workspace.js +7 -18
- package/dist/ui/workspace/use-workspace.js.map +1 -1
- package/dist/ui/workspace/workspace-model.d.ts +3 -3
- package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +2 -2
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +1 -2
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace-provider.d.ts +3 -3
- package/dist/ui/workspace/workspace.d.ts +3 -3
- package/dist/workspace-aspects-loader.d.ts +3 -3
- package/dist/workspace-aspects-loader.js +7 -11
- package/dist/workspace-aspects-loader.js.map +1 -1
- package/dist/workspace-component/comp-files.d.ts +3 -3
- package/dist/workspace-component/component-status.d.ts +3 -3
- package/dist/workspace-component/workspace-component-loader.d.ts +5 -5
- package/dist/workspace-component/workspace-component-loader.js +31 -28
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/dist/workspace.composition.d.ts +2 -2
- package/dist/workspace.d.ts +6 -6
- package/dist/workspace.graphql.d.ts +2 -2
- package/dist/workspace.graphql.js +2 -4
- package/dist/workspace.graphql.js.map +1 -1
- package/dist/workspace.js +16 -23
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.provider.d.ts +12 -12
- package/dist/workspace.provider.js +8 -11
- package/dist/workspace.provider.js.map +1 -1
- package/dist/workspace.ui.drawer.d.ts +1 -1
- package/dist/workspace.ui.drawer.js +5 -6
- package/dist/workspace.ui.drawer.js.map +1 -1
- package/dist/workspace.ui.runtime.d.ts +1 -1
- package/dist/workspace.ui.runtime.js +2 -8
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/eject-conf.cmd.ts +57 -0
- package/filter.ts +139 -0
- package/index.ts +22 -0
- package/merge-conflict-file.ts +129 -0
- package/on-component-events.ts +24 -0
- package/package.json +39 -46
- package/pattern.cmd.ts +53 -0
- package/tsconfig.json +16 -21
- package/types/asset.d.ts +15 -3
- package/types.ts +71 -0
- package/use.cmd.ts +25 -0
- package/workspace-aspects-loader.ts +885 -0
- package/workspace-component/workspace-component-loader.ts +25 -16
- package/workspace-section.ts +14 -0
- package/workspace.aspect.ts +9 -0
- package/workspace.graphql.ts +133 -0
- package/workspace.main.runtime.ts +56 -0
- package/workspace.provider.ts +282 -0
- package/workspace.ts +2014 -0
- package/workspace.ui-root.ts +65 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BundlerMain } from '@teambit/bundler';
|
|
2
|
+
import { Component, ComponentID, ResolveAspectsOptions } from '@teambit/component';
|
|
3
|
+
import { UIRoot } from '@teambit/ui';
|
|
4
|
+
import { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';
|
|
5
|
+
import { PathOsBased } from '@teambit/legacy/dist/utils/path';
|
|
6
|
+
|
|
7
|
+
import { Workspace } from './workspace';
|
|
8
|
+
|
|
9
|
+
export class WorkspaceUIRoot implements UIRoot {
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* workspace extension.
|
|
13
|
+
*/
|
|
14
|
+
private workspace: Workspace,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* bundler extension
|
|
18
|
+
*/
|
|
19
|
+
private bundler: BundlerMain
|
|
20
|
+
) {}
|
|
21
|
+
|
|
22
|
+
priority = true;
|
|
23
|
+
|
|
24
|
+
get name() {
|
|
25
|
+
return this.workspace.name;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get path() {
|
|
29
|
+
return this.workspace.path;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get configFile() {
|
|
33
|
+
return 'workspace.json';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
buildOptions = {
|
|
37
|
+
ssr: false,
|
|
38
|
+
launchBrowserOnStart: true,
|
|
39
|
+
prebundle: true,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
async resolveAspects(runtimeName: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions) {
|
|
43
|
+
return this.workspace.resolveAspects(runtimeName, componentIds, opts);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// TODO: @gilad please implement with variants.
|
|
47
|
+
resolvePattern(pattern: string): Promise<Component[]> {
|
|
48
|
+
return this.workspace.byPattern(pattern);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getConfig() {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* proxy to `workspace.componentDir()`
|
|
57
|
+
*/
|
|
58
|
+
componentDir(
|
|
59
|
+
componentId: ComponentID,
|
|
60
|
+
bitMapOptions?: GetBitMapComponentOptions,
|
|
61
|
+
options = { relative: false }
|
|
62
|
+
): PathOsBased {
|
|
63
|
+
return this.workspace.componentDir(componentId, bitMapOptions, options);
|
|
64
|
+
}
|
|
65
|
+
}
|