@teambit/envs 0.0.760 → 0.0.763
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/envs.cmd.d.ts +8 -0
- package/dist/envs.cmd.js +8 -3
- package/dist/envs.cmd.js.map +1 -1
- package/envs.cmd.tsx +10 -3
- package/package-tar/teambit-envs-0.0.763.tgz +0 -0
- package/package.json +21 -21
- package/{preview-1655177322725.js → preview-1655373564849.js} +2 -2
- package/package-tar/teambit-envs-0.0.760.tgz +0 -0
package/dist/envs.cmd.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export declare class GetEnvCmd implements Command {
|
|
|
17
17
|
private componentAspect;
|
|
18
18
|
name: string;
|
|
19
19
|
description: string;
|
|
20
|
+
arguments: {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}[];
|
|
24
|
+
examples: [{
|
|
25
|
+
cmd: 'get ui/button';
|
|
26
|
+
description: 'show information about the env configured for ui/button';
|
|
27
|
+
}];
|
|
20
28
|
options: never[];
|
|
21
29
|
group: string;
|
|
22
30
|
constructor(envs: EnvsMain, componentAspect: ComponentMain);
|
package/dist/envs.cmd.js
CHANGED
|
@@ -100,8 +100,13 @@ class GetEnvCmd {
|
|
|
100
100
|
constructor(envs, componentAspect) {
|
|
101
101
|
this.envs = envs;
|
|
102
102
|
this.componentAspect = componentAspect;
|
|
103
|
-
(0, _defineProperty2().default)(this, "name", 'get <name>');
|
|
104
|
-
(0, _defineProperty2().default)(this, "description", "show component's env
|
|
103
|
+
(0, _defineProperty2().default)(this, "name", 'get <component-name>');
|
|
104
|
+
(0, _defineProperty2().default)(this, "description", "show information about a component's env");
|
|
105
|
+
(0, _defineProperty2().default)(this, "arguments", [{
|
|
106
|
+
name: 'component-name',
|
|
107
|
+
description: "the 'component name' or 'component id' of the component its env you'd like to inspect"
|
|
108
|
+
}]);
|
|
109
|
+
(0, _defineProperty2().default)(this, "examples", void 0);
|
|
105
110
|
(0, _defineProperty2().default)(this, "options", []);
|
|
106
111
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
107
112
|
}
|
|
@@ -149,7 +154,7 @@ class EnvsCmd {
|
|
|
149
154
|
this.componentAspect = componentAspect;
|
|
150
155
|
(0, _defineProperty2().default)(this, "name", 'envs');
|
|
151
156
|
(0, _defineProperty2().default)(this, "alias", 'env');
|
|
152
|
-
(0, _defineProperty2().default)(this, "description", 'list all components envs');
|
|
157
|
+
(0, _defineProperty2().default)(this, "description", 'list all components maintained by the workspace and their corresponding envs');
|
|
153
158
|
(0, _defineProperty2().default)(this, "options", []);
|
|
154
159
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
155
160
|
(0, _defineProperty2().default)(this, "commands", []);
|
package/dist/envs.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvs","join","title","chalk","green","GetEnvCmd","showEnv","id","host","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","render","all","Promise","item","
|
|
1
|
+
{"version":3,"names":["ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvs","join","title","chalk","green","GetEnvCmd","name","description","showEnv","id","host","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","render","all","Promise","item","getHost","EnvsCmd","components","list","getTable","tableData","getDescriptor","toString","header","value","table","CLITable","fromObject","sort"],"sources":["envs.cmd.tsx"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport React from 'react';\nimport { Text, Newline } from 'ink';\nimport chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { Command } from '@teambit/cli';\nimport { ComponentMain, ComponentFactory, Component } from '@teambit/component';\nimport { EnvsMain } from './environments.main.runtime';\nimport { EnvOverview } from './components/env-overview';\n\nexport class ListEnvsCmd implements Command {\n name = 'list';\n description = 'list all envs available in the workspace';\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report() {\n const allEnvs = this.envs.getAllRegisteredEnvs().join('\\n');\n const title = chalk.green('the following envs are available in the workspace:');\n return `${title}\\n${allEnvs}`;\n }\n}\n\nexport class GetEnvCmd implements Command {\n name = 'get <component-name>';\n description = \"show information about a component's env\";\n arguments = [\n {\n name: 'component-name',\n description: \"the 'component name' or 'component id' of the component its env you'd like to inspect\",\n },\n ];\n examples: [{ cmd: 'get ui/button'; description: 'show information about the env configured for ui/button' }];\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async showEnv(id: string, host: ComponentFactory) {\n const component = await host.get(await host.resolveComponentId(id));\n if (!component) throw new Error(`component for env ${id} was not found`);\n const env = this.envs.getEnv(component);\n const envRuntime = await this.envs.createEnvironment([component]);\n const envExecutionContext = envRuntime.getEnvExecutionContext();\n const services = this.envs.getServices(env);\n const allP = services.services.map(async ([serviceId, service]) => {\n if (service.render)\n return (\n <Text>\n <Text bold underline color=\"cyan\">\n {serviceId}\n </Text>\n <Newline />\n <Newline />\n {await service.render(env, envExecutionContext)}\n </Text>\n );\n return (\n <Text key={serviceId}>\n <Text bold underline>\n {serviceId}\n </Text>\n </Text>\n );\n });\n\n const all = await Promise.all(allP);\n\n return (\n <Text>\n <EnvOverview envDef={env} />\n {all.map((item) => item)}\n </Text>\n );\n }\n\n async render([name]: [string]): Promise<JSX.Element> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n return this.showEnv(name, host);\n }\n}\n\nexport class EnvsCmd implements Command {\n name = 'envs';\n alias = 'env';\n description = 'list all components maintained by the workspace and their corresponding envs';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async render(): Promise<JSX.Element> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n const components = await host.list();\n // TODO: refactor to a react table\n return <Text>{this.getTable(components)}</Text>;\n }\n\n private getTable(components: Component[]) {\n const tableData = components.map((component) => {\n const env = this.envs.getDescriptor(component);\n return {\n component: component.id.toString(),\n env: env ? env.id : 'N/A',\n };\n });\n\n const header = [\n {\n value: 'component',\n },\n {\n value: 'env',\n },\n ];\n const table = CLITable.fromObject(header, tableData);\n table.sort();\n return table.render();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AARA;AAUO,MAAMA,WAAN,CAAqC;EAM1CC,WAAW,CAASC,IAAT,EAAiCC,eAAjC,EAAiE;IAAA,KAAxDD,IAAwD,GAAxDA,IAAwD;IAAA,KAAhCC,eAAgC,GAAhCA,eAAgC;IAAA,8CALrE,MAKqE;IAAA,qDAJ9D,0CAI8D;IAAA,iDAHlE,EAGkE;IAAA,+CAFpE,aAEoE;EAAE;;EAElE,MAANC,MAAM,GAAG;IACb,MAAMC,OAAO,GAAG,KAAKH,IAAL,CAAUI,oBAAV,GAAiCC,IAAjC,CAAsC,IAAtC,CAAhB;;IACA,MAAMC,KAAK,GAAGC,gBAAA,CAAMC,KAAN,CAAY,oDAAZ,CAAd;;IACA,OAAQ,GAAEF,KAAM,KAAIH,OAAQ,EAA5B;EACD;;AAZyC;;;;AAerC,MAAMM,SAAN,CAAmC;EAaxCV,WAAW,CAASC,IAAT,EAAiCC,eAAjC,EAAiE;IAAA,KAAxDD,IAAwD,GAAxDA,IAAwD;IAAA,KAAh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,UAAU,CAACT,GAAX,CAAgBb,SAAD,IAAe;MAC9C,MAAMI,GAAG,GAAG,KAAKnB,IAAL,CAAUyC,aAAV,CAAwB1B,SAAxB,CAAZ;MACA,OAAO;QACLA,SAAS,EAAEA,SAAS,CAACF,EAAV,CAAa6B,QAAb,EADN;QAELvB,GAAG,EAAEA,GAAG,GAAGA,GAAG,CAACN,EAAP,GAAY;MAFf,CAAP;IAID,CANiB,CAAlB;IAQA,MAAM8B,MAAM,GAAG,CACb;MACEC,KAAK,EAAE;IADT,CADa,EAIb;MACEA,KAAK,EAAE;IADT,CAJa,CAAf;;IAQA,MAAMC,KAAK,GAAGC,oBAAA,CAASC,UAAT,CAAoBJ,MAApB,EAA4BH,SAA5B,CAAd;;IACAK,KAAK,CAACG,IAAN;IACA,OAAOH,KAAK,CAACd,MAAN,EAAP;EACD;;AAvCqC"}
|
package/envs.cmd.tsx
CHANGED
|
@@ -24,8 +24,15 @@ export class ListEnvsCmd implements Command {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export class GetEnvCmd implements Command {
|
|
27
|
-
name = 'get <name>';
|
|
28
|
-
description = "show component's env
|
|
27
|
+
name = 'get <component-name>';
|
|
28
|
+
description = "show information about a component's env";
|
|
29
|
+
arguments = [
|
|
30
|
+
{
|
|
31
|
+
name: 'component-name',
|
|
32
|
+
description: "the 'component name' or 'component id' of the component its env you'd like to inspect",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
examples: [{ cmd: 'get ui/button'; description: 'show information about the env configured for ui/button' }];
|
|
29
36
|
options = [];
|
|
30
37
|
group = 'development';
|
|
31
38
|
|
|
@@ -80,7 +87,7 @@ export class GetEnvCmd implements Command {
|
|
|
80
87
|
export class EnvsCmd implements Command {
|
|
81
88
|
name = 'envs';
|
|
82
89
|
alias = 'env';
|
|
83
|
-
description = 'list all components envs';
|
|
90
|
+
description = 'list all components maintained by the workspace and their corresponding envs';
|
|
84
91
|
options = [];
|
|
85
92
|
group = 'development';
|
|
86
93
|
commands: Command[] = [];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/envs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.763",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/envs/envs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.envs",
|
|
8
8
|
"name": "envs",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.763"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
"@babel/runtime": "7.12.18",
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
19
|
"@teambit/harmony": "0.3.3",
|
|
20
|
-
"@teambit/component": "0.0.
|
|
21
|
-
"@teambit/builder": "0.0.
|
|
22
|
-
"@teambit/bundler": "0.0.
|
|
23
|
-
"@teambit/compiler": "0.0.
|
|
24
|
-
"@teambit/dependency-resolver": "0.0.
|
|
25
|
-
"@teambit/elements": "0.0.
|
|
26
|
-
"@teambit/formatter": "0.0.
|
|
27
|
-
"@teambit/isolator": "0.0.
|
|
28
|
-
"@teambit/linter": "0.0.
|
|
29
|
-
"@teambit/pkg": "0.0.
|
|
30
|
-
"@teambit/preview": "0.0.
|
|
31
|
-
"@teambit/schema": "0.0.
|
|
32
|
-
"@teambit/tester": "0.0.
|
|
33
|
-
"@teambit/webpack": "0.0.
|
|
34
|
-
"@teambit/graphql": "0.0.
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
20
|
+
"@teambit/component": "0.0.763",
|
|
21
|
+
"@teambit/builder": "0.0.763",
|
|
22
|
+
"@teambit/bundler": "0.0.763",
|
|
23
|
+
"@teambit/compiler": "0.0.763",
|
|
24
|
+
"@teambit/dependency-resolver": "0.0.763",
|
|
25
|
+
"@teambit/elements": "0.0.216",
|
|
26
|
+
"@teambit/formatter": "0.0.314",
|
|
27
|
+
"@teambit/isolator": "0.0.763",
|
|
28
|
+
"@teambit/linter": "0.0.763",
|
|
29
|
+
"@teambit/pkg": "0.0.763",
|
|
30
|
+
"@teambit/preview": "0.0.763",
|
|
31
|
+
"@teambit/schema": "0.0.763",
|
|
32
|
+
"@teambit/tester": "0.0.763",
|
|
33
|
+
"@teambit/webpack": "0.0.763",
|
|
34
|
+
"@teambit/graphql": "0.0.763",
|
|
35
|
+
"@teambit/cli": "0.0.504",
|
|
36
36
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
37
|
-
"@teambit/logger": "0.0.
|
|
37
|
+
"@teambit/logger": "0.0.597",
|
|
38
38
|
"@teambit/cli-table": "0.0.34",
|
|
39
39
|
"@teambit/bit-error": "0.0.394"
|
|
40
40
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@teambit/envs.aspect-docs.envs": "0.0.138"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@teambit/legacy": "1.0.
|
|
52
|
+
"@teambit/legacy": "1.0.284",
|
|
53
53
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
54
54
|
"react": "^16.8.0 || ^17.0.0"
|
|
55
55
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"react": "-"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@teambit/legacy": "1.0.
|
|
80
|
+
"@teambit/legacy": "1.0.284",
|
|
81
81
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
82
82
|
"react": "^16.8.0 || ^17.0.0"
|
|
83
83
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.763/dist/env.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.763/dist/envs.docs.mdx')]
|
|
Binary file
|