@teambit/pkg 0.0.1079 → 0.0.1081
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/pkg.ui.runtime.js +17 -8
- package/dist/pkg.ui.runtime.js.map +1 -1
- package/dist/{preview-1686886045563.js → preview-1687058340034.js} +2 -2
- package/package-tar/teambit-pkg-0.0.1081.tgz +0 -0
- package/package.json +14 -14
- package/pkg.ui.runtime.tsx +17 -7
- package/package-tar/teambit-pkg-0.0.1079.tgz +0 -0
package/dist/pkg.ui.runtime.js
CHANGED
|
@@ -58,9 +58,17 @@ class PkgUI {
|
|
|
58
58
|
}
|
|
59
59
|
constructor(compUI) {
|
|
60
60
|
this.compUI = compUI;
|
|
61
|
-
(0, _defineProperty2().default)(this, "npmConsumeMethod",
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
(0, _defineProperty2().default)(this, "npmConsumeMethod", ({
|
|
62
|
+
packageName: packageNameFromProps,
|
|
63
|
+
latest: latestFromProps,
|
|
64
|
+
id: componentId,
|
|
65
|
+
options,
|
|
66
|
+
componentModel
|
|
67
|
+
}) => {
|
|
68
|
+
const packageName = (componentModel === null || componentModel === void 0 ? void 0 : componentModel.packageName) || packageNameFromProps;
|
|
69
|
+
const latest = (componentModel === null || componentModel === void 0 ? void 0 : componentModel.latest) || latestFromProps;
|
|
70
|
+
const registry = packageName.split('/')[0];
|
|
71
|
+
const packageVersion = componentId.version === latest ? '' : `@${this.compUI.formatToInstallableVersion(componentId.version)}`;
|
|
64
72
|
return {
|
|
65
73
|
Title: /*#__PURE__*/_react().default.createElement("img", {
|
|
66
74
|
style: {
|
|
@@ -68,13 +76,14 @@ class PkgUI {
|
|
|
68
76
|
},
|
|
69
77
|
src: "https://static.bit.dev/brands/logo-npm-new.svg"
|
|
70
78
|
}),
|
|
71
|
-
Component: /*#__PURE__*/_react().default.createElement(_uiFoundationUiUseBox().Install, {
|
|
79
|
+
Component: !(options !== null && options !== void 0 && options.hide) ? /*#__PURE__*/_react().default.createElement(_uiFoundationUiUseBox().Install, {
|
|
72
80
|
config: `npm config set '${registry}:registry' https://node.bit.cloud`,
|
|
73
|
-
componentName:
|
|
81
|
+
componentName: componentId.name,
|
|
74
82
|
packageManager: "npm",
|
|
75
|
-
copyString: `npm i ${
|
|
76
|
-
registryName: registry
|
|
77
|
-
|
|
83
|
+
copyString: `npm i ${packageName}${packageVersion}`,
|
|
84
|
+
registryName: registry,
|
|
85
|
+
isInstallable: !(options !== null && options !== void 0 && options.disableInstall)
|
|
86
|
+
}) : null,
|
|
78
87
|
order: 10
|
|
79
88
|
};
|
|
80
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PkgUI","provider","componentUI","pkg","registerConsumeMethod","npmConsumeMethod","constructor","compUI","
|
|
1
|
+
{"version":3,"names":["PkgUI","provider","componentUI","pkg","registerConsumeMethod","npmConsumeMethod","constructor","compUI","packageName","packageNameFromProps","latest","latestFromProps","id","componentId","options","componentModel","registry","split","packageVersion","version","formatToInstallableVersion","Title","width","Component","hide","name","disableInstall","order","UIRuntime","ComponentAspect","PkgAspect","addRuntime"],"sources":["pkg.ui.runtime.tsx"],"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(componentUI);\n componentUI.registerConsumeMethod(pkg.npmConsumeMethod);\n return pkg;\n }\n\n constructor(private compUI: ComponentUI) {}\n\n private npmConsumeMethod: ConsumePlugin = ({\n packageName: packageNameFromProps,\n latest: latestFromProps,\n id: componentId,\n options,\n componentModel,\n }) => {\n const packageName = componentModel?.packageName || packageNameFromProps;\n const latest = componentModel?.latest || latestFromProps;\n\n const registry = packageName.split('/')[0];\n\n const packageVersion =\n componentId.version === latest ? '' : `@${this.compUI.formatToInstallableVersion(componentId.version)}`;\n\n return {\n Title: <img style={{ width: '30px' }} src=\"https://static.bit.dev/brands/logo-npm-new.svg\" />,\n Component: !options?.hide ? (\n <Install\n config={`npm config set '${registry}:registry' https://node.bit.cloud`}\n componentName={componentId.name}\n packageManager=\"npm\"\n copyString={`npm i ${packageName}${packageVersion}`}\n registryName={registry}\n isInstallable={!options?.disableInstall}\n />\n ) : null,\n order: 10,\n };\n };\n}\n\nexport default PkgUI;\n\nPkgAspect.addRuntime(PkgUI);\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,KAAK,CAAC;EAKjB,aAAaC,QAAQ,CAAC,CAACC,WAAW,CAAgB,EAAE;IAClD,MAAMC,GAAG,GAAG,IAAIH,KAAK,CAACE,WAAW,CAAC;IAClCA,WAAW,CAACE,qBAAqB,CAACD,GAAG,CAACE,gBAAgB,CAAC;IACvD,OAAOF,GAAG;EACZ;EAEAG,WAAW,CAASC,MAAmB,EAAE;IAAA,KAArBA,MAAmB,GAAnBA,MAAmB;IAAA,0DAEG,CAAC;MACzCC,WAAW,EAAEC,oBAAoB;MACjCC,MAAM,EAAEC,eAAe;MACvBC,EAAE,EAAEC,WAAW;MACfC,OAAO;MACPC;IACF,CAAC,KAAK;MACJ,MAAMP,WAAW,GAAG,CAAAO,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEP,WAAW,KAAIC,oBAAoB;MACvE,MAAMC,MAAM,GAAG,CAAAK,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEL,MAAM,KAAIC,eAAe;MAExD,MAAMK,QAAQ,GAAGR,WAAW,CAACS,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;MAE1C,MAAMC,cAAc,GAClBL,WAAW,CAACM,OAAO,KAAKT,MAAM,GAAG,EAAE,GAAI,IAAG,IAAI,CAACH,MAAM,CAACa,0BAA0B,CAACP,WAAW,CAACM,OAAO,CAAE,EAAC;MAEzG,OAAO;QACLE,KAAK,eAAE;UAAK,KAAK,EAAE;YAAEC,KAAK,EAAE;UAAO,CAAE;UAAC,GAAG,EAAC;QAAgD,EAAG;QAC7FC,SAAS,EAAE,EAACT,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEU,IAAI,iBACvB,+BAAC,+BAAO;UACN,MAAM,EAAG,mBAAkBR,QAAS,mCAAmC;UACvE,aAAa,EAAEH,WAAW,CAACY,IAAK;UAChC,cAAc,EAAC,KAAK;UACpB,UAAU,EAAG,SAAQjB,WAAY,GAAEU,cAAe,EAAE;UACpD,YAAY,EAAEF,QAAS;UACvB,aAAa,EAAE,EAACF,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEY,cAAc;QAAC,EACxC,GACA,IAAI;QACRC,KAAK,EAAE;MACT,CAAC;IACH,CAAC;EA/ByC;AAgC5C;AAAC;AAAA,gCA3CY3B,KAAK,aACC4B,eAAS;AAAA,gCADf5B,KAAK,kBAGM,CAAC6B,oBAAe,CAAC;AAAA,eA0C1B7B,KAAK;AAAA;AAEpB8B,gBAAS,CAACC,UAAU,CAAC/B,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@0.0.1081/dist/pkg.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pkg_pkg@0.0.1081/dist/pkg.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/pkg",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1081",
|
|
4
4
|
"homepage": "https://bit.cloud/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.
|
|
9
|
+
"version": "0.0.1081"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"@babel/runtime": "7.20.0",
|
|
24
24
|
"@teambit/harmony": "0.4.6",
|
|
25
25
|
"@teambit/cli": "0.0.727",
|
|
26
|
-
"@teambit/builder": "0.0.
|
|
26
|
+
"@teambit/builder": "0.0.1081",
|
|
27
27
|
"@teambit/logger": "0.0.820",
|
|
28
|
-
"@teambit/typescript": "0.0.
|
|
29
|
-
"@teambit/envs": "0.0.
|
|
30
|
-
"@teambit/component": "0.0.
|
|
28
|
+
"@teambit/typescript": "0.0.1081",
|
|
29
|
+
"@teambit/envs": "0.0.1081",
|
|
30
|
+
"@teambit/component": "0.0.1081",
|
|
31
31
|
"@teambit/express": "0.0.825",
|
|
32
|
-
"@teambit/isolator": "0.0.
|
|
33
|
-
"@teambit/scope": "0.0.
|
|
34
|
-
"@teambit/graphql": "0.0.
|
|
32
|
+
"@teambit/isolator": "0.0.1081",
|
|
33
|
+
"@teambit/scope": "0.0.1081",
|
|
34
|
+
"@teambit/graphql": "0.0.1081",
|
|
35
35
|
"@teambit/bit-error": "0.0.402",
|
|
36
36
|
"@teambit/component-issues": "0.0.92",
|
|
37
37
|
"@teambit/component-package-version": "0.0.422",
|
|
38
|
-
"@teambit/dependency-resolver": "0.0.
|
|
38
|
+
"@teambit/dependency-resolver": "0.0.1081",
|
|
39
39
|
"@teambit/workspace.modules.node-modules-linker": "0.0.71",
|
|
40
|
-
"@teambit/workspace": "0.0.
|
|
41
|
-
"@teambit/ui-foundation.ui.use-box.menu": "0.0.
|
|
42
|
-
"@teambit/ui": "0.0.
|
|
43
|
-
"@teambit/compiler": "0.0.
|
|
40
|
+
"@teambit/workspace": "0.0.1081",
|
|
41
|
+
"@teambit/ui-foundation.ui.use-box.menu": "0.0.135",
|
|
42
|
+
"@teambit/ui": "0.0.1081",
|
|
43
|
+
"@teambit/compiler": "0.0.1081"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/mime": "2.0.3",
|
package/pkg.ui.runtime.tsx
CHANGED
|
@@ -17,23 +17,33 @@ export class PkgUI {
|
|
|
17
17
|
|
|
18
18
|
constructor(private compUI: ComponentUI) {}
|
|
19
19
|
|
|
20
|
-
private npmConsumeMethod: ConsumePlugin = (
|
|
21
|
-
|
|
20
|
+
private npmConsumeMethod: ConsumePlugin = ({
|
|
21
|
+
packageName: packageNameFromProps,
|
|
22
|
+
latest: latestFromProps,
|
|
23
|
+
id: componentId,
|
|
24
|
+
options,
|
|
25
|
+
componentModel,
|
|
26
|
+
}) => {
|
|
27
|
+
const packageName = componentModel?.packageName || packageNameFromProps;
|
|
28
|
+
const latest = componentModel?.latest || latestFromProps;
|
|
29
|
+
|
|
30
|
+
const registry = packageName.split('/')[0];
|
|
22
31
|
|
|
23
32
|
const packageVersion =
|
|
24
|
-
|
|
33
|
+
componentId.version === latest ? '' : `@${this.compUI.formatToInstallableVersion(componentId.version)}`;
|
|
25
34
|
|
|
26
35
|
return {
|
|
27
36
|
Title: <img style={{ width: '30px' }} src="https://static.bit.dev/brands/logo-npm-new.svg" />,
|
|
28
|
-
Component: (
|
|
37
|
+
Component: !options?.hide ? (
|
|
29
38
|
<Install
|
|
30
39
|
config={`npm config set '${registry}:registry' https://node.bit.cloud`}
|
|
31
|
-
componentName={
|
|
40
|
+
componentName={componentId.name}
|
|
32
41
|
packageManager="npm"
|
|
33
|
-
copyString={`npm i ${
|
|
42
|
+
copyString={`npm i ${packageName}${packageVersion}`}
|
|
34
43
|
registryName={registry}
|
|
44
|
+
isInstallable={!options?.disableInstall}
|
|
35
45
|
/>
|
|
36
|
-
),
|
|
46
|
+
) : null,
|
|
37
47
|
order: 10,
|
|
38
48
|
};
|
|
39
49
|
};
|
|
Binary file
|