@teambit/pkg 0.0.591 → 0.0.595

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export type { PkgMain, PackageJsonProps } from './pkg.main.runtime';
2
- export { PackageDependency, PackageDependencyFactory } from './package-dependency';
3
- export { PkgAspect } from './pkg.aspect';
2
+ export type { PackageDependency, PackageDependencyFactory } from './package-dependency';
3
+ export { PkgAspect as default, PkgAspect } from './pkg.aspect';
4
+ export { PkgUI } from './pkg.ui.runtime';
package/dist/index.js CHANGED
@@ -3,39 +3,39 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "PackageDependency", {
6
+ Object.defineProperty(exports, "PkgAspect", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _packageDependency().PackageDependency;
9
+ return _pkg().PkgAspect;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "PackageDependencyFactory", {
12
+ Object.defineProperty(exports, "PkgUI", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _packageDependency().PackageDependencyFactory;
15
+ return _pkgUi().PkgUI;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "PkgAspect", {
18
+ Object.defineProperty(exports, "default", {
19
19
  enumerable: true,
20
20
  get: function () {
21
21
  return _pkg().PkgAspect;
22
22
  }
23
23
  });
24
24
 
25
- function _packageDependency() {
26
- const data = require("./package-dependency");
25
+ function _pkg() {
26
+ const data = require("./pkg.aspect");
27
27
 
28
- _packageDependency = function () {
28
+ _pkg = function () {
29
29
  return data;
30
30
  };
31
31
 
32
32
  return data;
33
33
  }
34
34
 
35
- function _pkg() {
36
- const data = require("./pkg.aspect");
35
+ function _pkgUi() {
36
+ const data = require("./pkg.ui.runtime");
37
37
 
38
- _pkg = function () {
38
+ _pkgUi = function () {
39
39
  return data;
40
40
  };
41
41
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export type { PkgMain, PackageJsonProps } from './pkg.main.runtime';\nexport { PackageDependency, PackageDependencyFactory } from './package-dependency';\nexport { PkgAspect } from './pkg.aspect';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export type { PkgMain, PackageJsonProps } from './pkg.main.runtime';\nexport type { PackageDependency, PackageDependencyFactory } from './package-dependency';\nexport { PkgAspect as default, PkgAspect } from './pkg.aspect';\nexport { PkgUI } from './pkg.ui.runtime';\n"]}
@@ -0,0 +1,8 @@
1
+ import { ComponentUI } from '@teambit/component';
2
+ export declare class PkgUI {
3
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
4
+ static dependencies: import("@teambit/harmony").Aspect[];
5
+ static provider([componentUI]: [ComponentUI]): Promise<PkgUI>;
6
+ private npmConsumeMethod;
7
+ }
8
+ export default PkgUI;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ require("core-js/modules/es.array.iterator.js");
6
+
7
+ require("core-js/modules/es.promise.js");
8
+
9
+ require("core-js/modules/es.regexp.exec.js");
10
+
11
+ Object.defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+ exports.default = exports.PkgUI = void 0;
15
+
16
+ function _defineProperty2() {
17
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
+
19
+ _defineProperty2 = function () {
20
+ return data;
21
+ };
22
+
23
+ return data;
24
+ }
25
+
26
+ function _react() {
27
+ const data = _interopRequireDefault(require("react"));
28
+
29
+ _react = function () {
30
+ return data;
31
+ };
32
+
33
+ return data;
34
+ }
35
+
36
+ function _ui() {
37
+ const data = require("@teambit/ui");
38
+
39
+ _ui = function () {
40
+ return data;
41
+ };
42
+
43
+ return data;
44
+ }
45
+
46
+ function _uiFoundationUiUseBox() {
47
+ const data = require("@teambit/ui-foundation.ui.use-box.menu");
48
+
49
+ _uiFoundationUiUseBox = function () {
50
+ return data;
51
+ };
52
+
53
+ return data;
54
+ }
55
+
56
+ function _component() {
57
+ const data = _interopRequireDefault(require("@teambit/component"));
58
+
59
+ _component = function () {
60
+ return data;
61
+ };
62
+
63
+ return data;
64
+ }
65
+
66
+ function _pkg() {
67
+ const data = require("./pkg.aspect");
68
+
69
+ _pkg = function () {
70
+ return data;
71
+ };
72
+
73
+ return data;
74
+ }
75
+
76
+ class PkgUI {
77
+ constructor() {
78
+ (0, _defineProperty2().default)(this, "npmConsumeMethod", comp => {
79
+ const registry = comp.packageName.split('/')[0];
80
+ const packageVersion = comp.version === comp.latest ? '' : `@${comp.version}`;
81
+ return {
82
+ Title: /*#__PURE__*/_react().default.createElement("img", {
83
+ style: {
84
+ width: '30px'
85
+ },
86
+ src: "http://static.bit.dev/brands/logo-npm-new.svg"
87
+ }),
88
+ Component: /*#__PURE__*/_react().default.createElement(_uiFoundationUiUseBox().Install, {
89
+ config: `npm config set '${registry}:registry' https://node.bit.dev`,
90
+ componentName: comp.id.name,
91
+ packageManager: "npm",
92
+ copyString: `npm i ${comp.packageName}${packageVersion}`,
93
+ registryName: registry
94
+ }),
95
+ order: 10
96
+ };
97
+ });
98
+ }
99
+
100
+ static async provider([componentUI]) {
101
+ const pkg = new PkgUI();
102
+ componentUI.registerConsumeMethod(pkg.npmConsumeMethod);
103
+ return pkg;
104
+ }
105
+
106
+ }
107
+
108
+ exports.PkgUI = PkgUI;
109
+ (0, _defineProperty2().default)(PkgUI, "runtime", _ui().UIRuntime);
110
+ (0, _defineProperty2().default)(PkgUI, "dependencies", [_component().default]);
111
+ var _default = PkgUI;
112
+ exports.default = _default;
113
+
114
+ _pkg().PkgAspect.addRuntime(PkgUI);
115
+
116
+ //# sourceMappingURL=pkg.ui.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["pkg.ui.runtime.tsx"],"names":["PkgUI","comp","registry","packageName","split","packageVersion","version","latest","Title","width","Component","id","name","order","provider","componentUI","pkg","registerConsumeMethod","npmConsumeMethod","UIRuntime","ComponentAspect","PkgAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,KAAN,CAAY;AAAA;AAAA,8DAW0BC,IAAD,IAAU;AAClD,YAAMC,QAAQ,GAAGD,IAAI,CAACE,WAAL,CAAiBC,KAAjB,CAAuB,GAAvB,EAA4B,CAA5B,CAAjB;AACA,YAAMC,cAAc,GAAGJ,IAAI,CAACK,OAAL,KAAiBL,IAAI,CAACM,MAAtB,GAA+B,EAA/B,GAAqC,IAAGN,IAAI,CAACK,OAAQ,EAA5E;AACA,aAAO;AACLE,QAAAA,KAAK,eAAE;AAAK,UAAA,KAAK,EAAE;AAAEC,YAAAA,KAAK,EAAE;AAAT,WAAZ;AAA+B,UAAA,GAAG,EAAC;AAAnC,UADF;AAELC,QAAAA,SAAS,eACP,+BAAC,+BAAD;AACE,UAAA,MAAM,EAAG,mBAAkBR,QAAS,iCADtC;AAEE,UAAA,aAAa,EAAED,IAAI,CAACU,EAAL,CAAQC,IAFzB;AAGE,UAAA,cAAc,EAAC,KAHjB;AAIE,UAAA,UAAU,EAAG,SAAQX,IAAI,CAACE,WAAY,GAAEE,cAAe,EAJzD;AAKE,UAAA,YAAY,EAAEH;AALhB,UAHG;AAWLW,QAAAA,KAAK,EAAE;AAXF,OAAP;AAaD,KA3BgB;AAAA;;AAKI,eAARC,QAAQ,CAAC,CAACC,WAAD,CAAD,EAA+B;AAClD,UAAMC,GAAG,GAAG,IAAIhB,KAAJ,EAAZ;AACAe,IAAAA,WAAW,CAACE,qBAAZ,CAAkCD,GAAG,CAACE,gBAAtC;AACA,WAAOF,GAAP;AACD;;AATgB;;;gCAANhB,K,aACMmB,e;gCADNnB,K,kBAGW,CAACoB,oBAAD,C;eA2BTpB,K;;;AAEfqB,iBAAUC,UAAV,CAAqBtB,KAArB","sourcesContent":["import React from 'react';\nimport { UIRuntime } from '@teambit/ui';\nimport { Install } from '@teambit/ui-foundation.ui.use-box.menu';\nimport ComponentAspect, { ComponentUI, ConsumePlugin } from '@teambit/component';\nimport { PkgAspect } from './pkg.aspect';\n\nexport class PkgUI {\n static runtime = UIRuntime;\n\n static dependencies = [ComponentAspect];\n\n static async provider([componentUI]: [ComponentUI]) {\n const pkg = new PkgUI();\n componentUI.registerConsumeMethod(pkg.npmConsumeMethod);\n return pkg;\n }\n\n private npmConsumeMethod: ConsumePlugin = (comp) => {\n const registry = comp.packageName.split('/')[0];\n const packageVersion = comp.version === comp.latest ? '' : `@${comp.version}`;\n return {\n Title: <img style={{ width: '30px' }} src=\"http://static.bit.dev/brands/logo-npm-new.svg\" />,\n Component: (\n <Install\n config={`npm config set '${registry}:registry' https://node.bit.dev`}\n componentName={comp.id.name}\n packageManager=\"npm\"\n copyString={`npm i ${comp.packageName}${packageVersion}`}\n registryName={registry}\n />\n ),\n order: 10,\n };\n };\n}\n\nexport default PkgUI;\n\nPkgAspect.addRuntime(PkgUI);\n"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/pkg",
3
- "version": "0.0.591",
3
+ "version": "0.0.595",
4
4
  "homepage": "https://bit.dev/teambit/pkg/pkg",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.pkg",
8
8
  "name": "pkg",
9
- "version": "0.0.591"
9
+ "version": "0.0.595"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -22,20 +22,22 @@
22
22
  "p-map-series": "2.1.0",
23
23
  "@babel/runtime": "7.12.18",
24
24
  "core-js": "^3.0.0",
25
- "@teambit/cli": "0.0.406",
26
- "@teambit/builder": "0.0.591",
27
- "@teambit/logger": "0.0.494",
28
- "@teambit/component": "0.0.591",
29
- "@teambit/express": "0.0.498",
30
- "@teambit/isolator": "0.0.591",
31
- "@teambit/scope": "0.0.591",
32
- "@teambit/graphql": "0.0.591",
33
- "@teambit/bit-error": "0.0.392",
34
- "@teambit/dependency-resolver": "0.0.591",
35
- "@teambit/envs": "0.0.591",
36
- "@teambit/workspace": "0.0.591",
37
- "@teambit/compiler": "0.0.591",
38
- "@teambit/legacy-bit-id": "0.0.395"
25
+ "@teambit/cli": "0.0.409",
26
+ "@teambit/builder": "0.0.595",
27
+ "@teambit/logger": "0.0.497",
28
+ "@teambit/component": "0.0.595",
29
+ "@teambit/express": "0.0.501",
30
+ "@teambit/isolator": "0.0.595",
31
+ "@teambit/scope": "0.0.595",
32
+ "@teambit/graphql": "0.0.595",
33
+ "@teambit/bit-error": "0.0.394",
34
+ "@teambit/dependency-resolver": "0.0.595",
35
+ "@teambit/envs": "0.0.595",
36
+ "@teambit/workspace": "0.0.595",
37
+ "@teambit/ui-foundation.ui.use-box.menu": "0.0.107",
38
+ "@teambit/ui": "0.0.595",
39
+ "@teambit/compiler": "0.0.595",
40
+ "@teambit/legacy-bit-id": "0.0.397"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@types/mime": "2.0.3",
@@ -47,10 +49,10 @@
47
49
  "@types/jest": "^26.0.0",
48
50
  "@types/react-dom": "^17.0.5",
49
51
  "@types/node": "12.20.4",
50
- "@teambit/pkg.aspect-docs.pkg": "0.0.128"
52
+ "@teambit/pkg.aspect-docs.pkg": "0.0.130"
51
53
  },
52
54
  "peerDependencies": {
53
- "@teambit/legacy": "1.0.192",
55
+ "@teambit/legacy": "1.0.196",
54
56
  "react-dom": "^16.8.0 || ^17.0.0",
55
57
  "react": "^16.8.0 || ^17.0.0"
56
58
  },
@@ -78,7 +80,7 @@
78
80
  "react": "-"
79
81
  },
80
82
  "peerDependencies": {
81
- "@teambit/legacy": "1.0.192",
83
+ "@teambit/legacy": "1.0.196",
82
84
  "react-dom": "^16.8.0 || ^17.0.0",
83
85
  "react": "^16.8.0 || ^17.0.0"
84
86
  }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { UIRuntime } from '@teambit/ui';
3
+ import { Install } from '@teambit/ui-foundation.ui.use-box.menu';
4
+ import ComponentAspect, { ComponentUI, ConsumePlugin } from '@teambit/component';
5
+ import { PkgAspect } from './pkg.aspect';
6
+
7
+ export class PkgUI {
8
+ static runtime = UIRuntime;
9
+
10
+ static dependencies = [ComponentAspect];
11
+
12
+ static async provider([componentUI]: [ComponentUI]) {
13
+ const pkg = new PkgUI();
14
+ componentUI.registerConsumeMethod(pkg.npmConsumeMethod);
15
+ return pkg;
16
+ }
17
+
18
+ private npmConsumeMethod: ConsumePlugin = (comp) => {
19
+ const registry = comp.packageName.split('/')[0];
20
+ const packageVersion = comp.version === comp.latest ? '' : `@${comp.version}`;
21
+ return {
22
+ Title: <img style={{ width: '30px' }} src="http://static.bit.dev/brands/logo-npm-new.svg" />,
23
+ Component: (
24
+ <Install
25
+ config={`npm config set '${registry}:registry' https://node.bit.dev`}
26
+ componentName={comp.id.name}
27
+ packageManager="npm"
28
+ copyString={`npm i ${comp.packageName}${packageVersion}`}
29
+ registryName={registry}
30
+ />
31
+ ),
32
+ order: 10,
33
+ };
34
+ };
35
+ }
36
+
37
+ export default PkgUI;
38
+
39
+ PkgAspect.addRuntime(PkgUI);
Binary file