@teambit/envs 0.0.658 → 0.0.659

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.
@@ -1 +1 @@
1
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.658/dist/envs.docs.mdx')]
1
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@0.0.659/dist/envs.docs.mdx')]
@@ -126,7 +126,7 @@ class Runtime {
126
126
  };
127
127
  } catch (err) {
128
128
  this.logger.error(err.message, err);
129
- this.logger.consoleFailure(`service ${service.name} env ${env.id} has failed. ${err.message}`);
129
+ this.logger.consoleFailure(`service "${service.name}" of env "${env.id}" has failed. error: ${err.message}`);
130
130
  errors.push(err);
131
131
  return {
132
132
  env,
@@ -1 +1 @@
1
- {"version":3,"sources":["runtime.ts"],"names":["Runtime","constructor","runtimeEnvs","logger","runEnv","envRuntimeId","service","options","envRuntime","find","runtime","id","ComponentID","fromString","withoutVersion","_legacy","toStringWithoutVersion","EnvNotFoundInRuntime","run","runOnce","Error","envsExecutionContext","getEnvExecutionContext","serviceResult","map","env","ExecutionContext","runtimes","errors","contexts","data","err","error","message","consoleFailure","name","push","EnvsExecutionResult"],"mappings":";;;;;;;;;;;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;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQO,MAAMA,OAAN,CAAc;AACnBC,EAAAA,WAAW;AACT;AACJ;AACA;AACaC,EAAAA,WAJA,EAMDC,MANC,EAOT;AAAA,SAHSD,WAGT,GAHSA,WAGT;AAAA,SADQC,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M,IAAIE,KAAJ,CAAU,0DAAV,CAAN;AAClB,UAAMQ,MAAe,GAAG,EAAxB;AACA,UAAMC,QAAwB,GAAG,MAAM,2BAAUF,QAAQ,IAAI,KAAKzB,WAA3B,EAAwC,MAAOuB,GAAP,IAAe;AAC5F,UAAI;AACF;AACA,cAAMF,aAAa,GAAG,MAAMjB,OAAO,CAACY,GAAR,CAAY,KAAIQ,2BAAJ,EAAqB,IAArB,EAA2BD,GAA3B,CAAZ,EAA6ClB,OAA7C,CAA5B;AAEA,eAAO;AACLkB,UAAAA,GADK;AAELK,UAAAA,IAAI,EAAEP;AAFD,SAAP;AAID,OARD,CAQE,OAAOQ,GAAP,EAAiB;AACjB,aAAK5B,MAAL,CAAY6B,KAAZ,CAAkBD,GAAG,CAACE,OAAtB,EAA+BF,GAA/B;AACA,aAAK5B,MAAL,CAAY+B,cAAZ,CAA4B,WAAU5B,OAAO,CAAC6B,IAAK,QAAOV,GAAG,CAACd,EAAG,gBAAeoB,GAAG,CAACE,OAAQ,EAA5F;AACAL,QAAAA,MAAM,CAACQ,IAAP,CAAYL,GAAZ;AACA,eAAO;AACLN,UAAAA,GADK;AAELO,UAAAA,KAAK,EAAED;AAFF,SAAP;AAID;AACF,KAlBsC,CAAvC;AAoBA,WAAO,KAAIM,0CAAJ,EAAwBR,QAAxB,CAAP;AACD;;AAhFkB","sourcesContent":["import { Logger } from '@teambit/logger';\nimport { ComponentID } from '@teambit/component';\nimport mapSeries from 'p-map-series';\nimport { EnvNotFoundInRuntime } from '../exceptions';\nimport { ExecutionContext } from '../context';\nimport { EnvService, ServiceExecutionResult } from '../services';\nimport { EnvRuntime } from './env-runtime';\nimport { EnvsExecutionResult } from './envs-execution-result';\n\nexport interface EnvResult<T extends ServiceExecutionResult> {\n env: EnvRuntime;\n data?: T;\n error?: Error;\n}\n\nexport class Runtime {\n constructor(\n /**\n * runtime instances of the environments.\n */\n readonly runtimeEnvs: EnvRuntime[],\n\n private logger: Logger\n ) {}\n\n /**\n * execute a service on a specific env.\n */\n runEnv<T>(\n envRuntimeId: string,\n service: EnvService<T>,\n options?: { [key: string]: any }\n ): Promise<EnvsExecutionResult<T>> {\n const envRuntime = this.runtimeEnvs.find((runtime) => {\n const id = ComponentID.fromString(runtime.id);\n const withoutVersion = id._legacy.toStringWithoutVersion();\n return withoutVersion === envRuntimeId;\n });\n if (!envRuntime) throw new EnvNotFoundInRuntime(envRuntimeId);\n return this.run(service, options, [envRuntime]);\n }\n\n /**\n * execute a service once for all environments.\n */\n async runOnce<T>(service: EnvService<T>, options?: { [key: string]: any }): Promise<any> {\n if (!service.runOnce) throw new Error('a service must implement `runOnce()` in order to be executed');\n const envsExecutionContext = this.getEnvExecutionContext();\n const serviceResult = await service.runOnce(envsExecutionContext, options);\n return serviceResult;\n }\n\n getEnvExecutionContext(): ExecutionContext[] {\n const envsExecutionContext = this.runtimeEnvs.map((env) => new ExecutionContext(this, env));\n return envsExecutionContext;\n }\n\n /**\n * execute a service on each one of the environments.\n */\n async run<T>(\n /**\n * environment service to execute.\n */\n service: EnvService<T>,\n\n /**\n * options to proxy to the service upon execution.\n */\n options?: { [key: string]: any },\n runtimes?: EnvRuntime[]\n ): Promise<EnvsExecutionResult<T>> {\n if (!service.run) throw new Error('a service must implement `run()` in order to be executed');\n const errors: Error[] = [];\n const contexts: EnvResult<T>[] = await mapSeries(runtimes || this.runtimeEnvs, async (env) => {\n try {\n // @ts-ignore\n const serviceResult = await service.run(new ExecutionContext(this, env), options);\n\n return {\n env,\n data: serviceResult,\n };\n } catch (err: any) {\n this.logger.error(err.message, err);\n this.logger.consoleFailure(`service ${service.name} env ${env.id} has failed. ${err.message}`);\n errors.push(err);\n return {\n env,\n error: err,\n };\n }\n });\n\n return new EnvsExecutionResult(contexts);\n }\n}\n"]}
1
+ {"version":3,"sources":["runtime.ts"],"names":["Runtime","constructor","runtimeEnvs","logger","runEnv","envRuntimeId","service","options","envRuntime","find","runtime","id","ComponentID","fromString","withoutVersion","_legacy","toStringWithoutVersion","EnvNotFoundInRuntime","run","runOnce","Error","envsExecutionContext","getEnvExecutionContext","serviceResult","map","env","ExecutionContext","runtimes","errors","contexts","data","err","error","message","consoleFailure","name","push","EnvsExecutionResult"],"mappings":";;;;;;;;;;;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;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQO,MAAMA,OAAN,CAAc;AACnBC,EAAAA,WAAW;AACT;AACJ;AACA;AACaC,EAAAA,WAJA,EAMDC,MANC,EAOT;AAAA,SAHSD,WAGT,GAHSA,WAGT;AAAA,SADQC,MACR,GADQA,MACR;AAAE;AAEJ;AACF;AACA;;;AACEC,EAAAA,MAAM,CACJC,YADI,EAEJC,OAFI,EAGJC,OAHI,EAI6B;AACjC,UAAMC,UAAU,GAAG,KAAKN,WAAL,CAAiBO,IAAjB,CAAuBC,OAAD,IAAa;AACpD,YAAMC,EAAE,GAAGC,yBAAYC,UAAZ,CAAuBH,OAAO,CAACC,EAA/B,CAAX;;AACA,YAAMG,cAAc,GAAGH,EAAE,CAACI,OAAH,CAAWC,sBAAX,EAAvB;;AACA,aAAOF,cAAc,KAAKT,YAA1B;AACD,KAJkB,CAAnB;AAKA,QAAI,CAACG,UAAL,EAAiB,MAAM,KAAIS,kCAAJ,EAAyBZ,YAAzB,CAAN;AACjB,WAAO,KAAKa,GAAL,CAASZ,OAAT,EAAkBC,OAAlB,EAA2B,CAACC,UAAD,CAA3B,CAAP;AACD;AAED;AACF;AACA;;;AACe,QAAPW,OAAO,CAAIb,OAAJ,EAA4BC,OAA5B,EAA4E;AACvF,QAAI,CAACD,OAAO,CAACa,OAAb,EAAsB,MAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACtB,UAAMC,oBAAo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ELO,UAAAA,KAAK,EAAED;AAFF,SAAP;AAID;AACF,KAlBsC,CAAvC;AAoBA,WAAO,KAAIM,0CAAJ,EAAwBR,QAAxB,CAAP;AACD;;AAhFkB","sourcesContent":["import { Logger } from '@teambit/logger';\nimport { ComponentID } from '@teambit/component';\nimport mapSeries from 'p-map-series';\nimport { EnvNotFoundInRuntime } from '../exceptions';\nimport { ExecutionContext } from '../context';\nimport { EnvService, ServiceExecutionResult } from '../services';\nimport { EnvRuntime } from './env-runtime';\nimport { EnvsExecutionResult } from './envs-execution-result';\n\nexport interface EnvResult<T extends ServiceExecutionResult> {\n env: EnvRuntime;\n data?: T;\n error?: Error;\n}\n\nexport class Runtime {\n constructor(\n /**\n * runtime instances of the environments.\n */\n readonly runtimeEnvs: EnvRuntime[],\n\n private logger: Logger\n ) {}\n\n /**\n * execute a service on a specific env.\n */\n runEnv<T>(\n envRuntimeId: string,\n service: EnvService<T>,\n options?: { [key: string]: any }\n ): Promise<EnvsExecutionResult<T>> {\n const envRuntime = this.runtimeEnvs.find((runtime) => {\n const id = ComponentID.fromString(runtime.id);\n const withoutVersion = id._legacy.toStringWithoutVersion();\n return withoutVersion === envRuntimeId;\n });\n if (!envRuntime) throw new EnvNotFoundInRuntime(envRuntimeId);\n return this.run(service, options, [envRuntime]);\n }\n\n /**\n * execute a service once for all environments.\n */\n async runOnce<T>(service: EnvService<T>, options?: { [key: string]: any }): Promise<any> {\n if (!service.runOnce) throw new Error('a service must implement `runOnce()` in order to be executed');\n const envsExecutionContext = this.getEnvExecutionContext();\n const serviceResult = await service.runOnce(envsExecutionContext, options);\n return serviceResult;\n }\n\n getEnvExecutionContext(): ExecutionContext[] {\n const envsExecutionContext = this.runtimeEnvs.map((env) => new ExecutionContext(this, env));\n return envsExecutionContext;\n }\n\n /**\n * execute a service on each one of the environments.\n */\n async run<T>(\n /**\n * environment service to execute.\n */\n service: EnvService<T>,\n\n /**\n * options to proxy to the service upon execution.\n */\n options?: { [key: string]: any },\n runtimes?: EnvRuntime[]\n ): Promise<EnvsExecutionResult<T>> {\n if (!service.run) throw new Error('a service must implement `run()` in order to be executed');\n const errors: Error[] = [];\n const contexts: EnvResult<T>[] = await mapSeries(runtimes || this.runtimeEnvs, async (env) => {\n try {\n // @ts-ignore\n const serviceResult = await service.run(new ExecutionContext(this, env), options);\n\n return {\n env,\n data: serviceResult,\n };\n } catch (err: any) {\n this.logger.error(err.message, err);\n this.logger.consoleFailure(`service \"${service.name}\" of env \"${env.id}\" has failed. error: ${err.message}`);\n errors.push(err);\n return {\n env,\n error: err,\n };\n }\n });\n\n return new EnvsExecutionResult(contexts);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/envs",
3
- "version": "0.0.658",
3
+ "version": "0.0.659",
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.658"
9
+ "version": "0.0.659"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
@@ -16,23 +16,23 @@
16
16
  "p-map-series": "2.1.0",
17
17
  "@babel/runtime": "7.12.18",
18
18
  "core-js": "^3.0.0",
19
- "@teambit/component": "0.0.658",
20
- "@teambit/builder": "0.0.658",
21
- "@teambit/bundler": "0.0.658",
22
- "@teambit/compiler": "0.0.658",
23
- "@teambit/dependency-resolver": "0.0.658",
24
- "@teambit/elements": "0.0.111",
25
- "@teambit/formatter": "0.0.209",
26
- "@teambit/isolator": "0.0.658",
27
- "@teambit/linter": "0.0.658",
28
- "@teambit/pkg": "0.0.658",
29
- "@teambit/preview": "0.0.658",
30
- "@teambit/schema": "0.0.658",
31
- "@teambit/tester": "0.0.658",
32
- "@teambit/webpack": "0.0.658",
33
- "@teambit/graphql": "0.0.658",
34
- "@teambit/cli": "0.0.448",
35
- "@teambit/logger": "0.0.538",
19
+ "@teambit/component": "0.0.659",
20
+ "@teambit/builder": "0.0.659",
21
+ "@teambit/bundler": "0.0.659",
22
+ "@teambit/compiler": "0.0.659",
23
+ "@teambit/dependency-resolver": "0.0.659",
24
+ "@teambit/elements": "0.0.112",
25
+ "@teambit/formatter": "0.0.210",
26
+ "@teambit/isolator": "0.0.659",
27
+ "@teambit/linter": "0.0.659",
28
+ "@teambit/pkg": "0.0.659",
29
+ "@teambit/preview": "0.0.659",
30
+ "@teambit/schema": "0.0.659",
31
+ "@teambit/tester": "0.0.659",
32
+ "@teambit/webpack": "0.0.659",
33
+ "@teambit/graphql": "0.0.659",
34
+ "@teambit/cli": "0.0.449",
35
+ "@teambit/logger": "0.0.539",
36
36
  "@teambit/cli-table": "0.0.33",
37
37
  "@teambit/bit-error": "0.0.394"
38
38
  },
@@ -47,7 +47,7 @@
47
47
  "@teambit/envs.aspect-docs.envs": "0.0.132"
48
48
  },
49
49
  "peerDependencies": {
50
- "@teambit/legacy": "1.0.227",
50
+ "@teambit/legacy": "1.0.228",
51
51
  "react-dom": "^16.8.0 || ^17.0.0",
52
52
  "react": "^16.8.0 || ^17.0.0"
53
53
  },
@@ -75,7 +75,7 @@
75
75
  "react": "-"
76
76
  },
77
77
  "peerDependencies": {
78
- "@teambit/legacy": "1.0.227",
78
+ "@teambit/legacy": "1.0.228",
79
79
  "react-dom": "^16.8.0 || ^17.0.0",
80
80
  "react": "^16.8.0 || ^17.0.0"
81
81
  }
@@ -83,7 +83,7 @@ export class Runtime {
83
83
  };
84
84
  } catch (err: any) {
85
85
  this.logger.error(err.message, err);
86
- this.logger.consoleFailure(`service ${service.name} env ${env.id} has failed. ${err.message}`);
86
+ this.logger.consoleFailure(`service "${service.name}" of env "${env.id}" has failed. error: ${err.message}`);
87
87
  errors.push(err);
88
88
  return {
89
89
  env,