@teambit/harmony.modules.requireable-component 0.0.445 → 0.0.446

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.
@@ -4,7 +4,8 @@ declare type RequireFunc = () => any;
4
4
  export declare class RequireableComponent {
5
5
  readonly component: Component;
6
6
  readonly requireFunc: RequireFunc;
7
- constructor(component: Component, requireFunc: RequireFunc);
7
+ readonly capsule?: Capsule;
8
+ constructor(component: Component, requireFunc: RequireFunc, capsule?: Capsule);
8
9
  require(): Promise<any>;
9
10
  static fromCapsule(capsule: Capsule): RequireableComponent;
10
11
  }
@@ -11,9 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RequireableComponent = void 0;
13
13
  class RequireableComponent {
14
- constructor(component, requireFunc) {
14
+ constructor(component, requireFunc, capsule) {
15
15
  this.component = component;
16
16
  this.requireFunc = requireFunc;
17
+ this.capsule = capsule;
17
18
  }
18
19
  require() {
19
20
  return __awaiter(this, void 0, void 0, function* () {
@@ -24,7 +25,7 @@ class RequireableComponent {
24
25
  static fromCapsule(capsule) {
25
26
  // eslint-disable-next-line global-require, import/no-dynamic-require
26
27
  const requireFunc = () => require(capsule.wrkDir);
27
- return new RequireableComponent(capsule.component, requireFunc);
28
+ return new RequireableComponent(capsule.component, requireFunc, capsule);
28
29
  }
29
30
  }
30
31
  exports.RequireableComponent = RequireableComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"requireable-component.js","sourceRoot":"","sources":["../requireable-component.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,MAAa,oBAAoB;IAC/B,YAAqB,SAAoB,EAAW,WAAwB;QAAvD,cAAS,GAAT,SAAS,CAAW;QAAW,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAE1E,OAAO;;YACX,qEAAqE;YACrE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;KAAA;IAED,MAAM,CAAC,WAAW,CAAC,OAAgB;QACjC,qEAAqE;QACrE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;CACF;AAbD,oDAaC"}
1
+ {"version":3,"file":"requireable-component.js","sourceRoot":"","sources":["../requireable-component.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,MAAa,oBAAoB;IAC/B,YAAqB,SAAoB,EAAW,WAAwB,EAAW,OAAiB;QAAnF,cAAS,GAAT,SAAS,CAAW;QAAW,gBAAW,GAAX,WAAW,CAAa;QAAW,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAEtG,OAAO;;YACX,qEAAqE;YACrE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;KAAA;IAED,MAAM,CAAC,WAAW,CAAC,OAAgB;QACjC,qEAAqE;QACrE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,IAAI,oBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF;AAbD,oDAaC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/harmony.modules.requireable-component",
3
- "version": "0.0.445",
3
+ "version": "0.0.446",
4
4
  "homepage": "https://bit.dev/teambit/harmony/modules/requireable-component",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "modules/requireable-component",
9
- "version": "0.0.445"
9
+ "version": "0.0.446"
10
10
  },
11
11
  "dependencies": {},
12
12
  "devDependencies": {
@@ -16,7 +16,7 @@
16
16
  "@types/jest": "26.0.20"
17
17
  },
18
18
  "peerDependencies": {
19
- "@teambit/legacy": "1.0.161"
19
+ "@teambit/legacy": "1.0.162"
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "bit": {
@@ -34,7 +34,7 @@
34
34
  "@types/jest": "26.0.20"
35
35
  },
36
36
  "peerDependencies": {
37
- "@teambit/legacy": "1.0.161"
37
+ "@teambit/legacy": "1.0.162"
38
38
  }
39
39
  }
40
40
  },
@@ -4,7 +4,7 @@ import { Capsule } from '@teambit/isolator';
4
4
  type RequireFunc = () => any;
5
5
 
6
6
  export class RequireableComponent {
7
- constructor(readonly component: Component, readonly requireFunc: RequireFunc) {}
7
+ constructor(readonly component: Component, readonly requireFunc: RequireFunc, readonly capsule?: Capsule) {}
8
8
 
9
9
  async require() {
10
10
  // eslint-disable-next-line global-require, import/no-dynamic-require
@@ -14,6 +14,6 @@ export class RequireableComponent {
14
14
  static fromCapsule(capsule: Capsule) {
15
15
  // eslint-disable-next-line global-require, import/no-dynamic-require
16
16
  const requireFunc = () => require(capsule.wrkDir);
17
- return new RequireableComponent(capsule.component, requireFunc);
17
+ return new RequireableComponent(capsule.component, requireFunc, capsule);
18
18
  }
19
19
  }