@teambit/global-config 0.0.0-0aeb43f50dd9c05b19fa26e7cf7bde05588cf852
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/esm.mjs +6 -0
- package/dist/global-config.aspect.d.ts +3 -0
- package/dist/global-config.aspect.js +20 -0
- package/dist/global-config.aspect.js.map +1 -0
- package/dist/global-config.composition.d.ts +1 -0
- package/dist/global-config.composition.js +29 -0
- package/dist/global-config.composition.js.map +1 -0
- package/dist/global-config.docs.md +7 -0
- package/dist/global-config.main.runtime.d.ts +55 -0
- package/dist/global-config.main.runtime.js +150 -0
- package/dist/global-config.main.runtime.js.map +1 -0
- package/dist/globals.cmd.d.ts +20 -0
- package/dist/globals.cmd.js +59 -0
- package/dist/globals.cmd.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1752165283597.js +7 -0
- package/dist/remote-cmd.d.ts +48 -0
- package/dist/remote-cmd.js +124 -0
- package/dist/remote-cmd.js.map +1 -0
- package/dist/remote.d.ts +4 -0
- package/dist/remote.js +81 -0
- package/dist/remote.js.map +1 -0
- package/dist/system.cmd.d.ts +29 -0
- package/dist/system.cmd.js +86 -0
- package/dist/system.cmd.js.map +1 -0
- package/esm.mjs +6 -0
- package/global-config.composition.tsx +7 -0
- package/global-config.docs.md +7 -0
- package/package.json +67 -0
- package/types/asset.d.ts +41 -0
- package/types/style.d.ts +42 -0
package/dist/esm.mjs
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = exports.GlobalConfigAspect = void 0;
|
7
|
+
function _harmony() {
|
8
|
+
const data = require("@teambit/harmony");
|
9
|
+
_harmony = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
const GlobalConfigAspect = exports.GlobalConfigAspect = _harmony().Aspect.create({
|
15
|
+
id: 'teambit.harmony/global-config',
|
16
|
+
dependencies: []
|
17
|
+
});
|
18
|
+
var _default = exports.default = GlobalConfigAspect;
|
19
|
+
|
20
|
+
//# sourceMappingURL=global-config.aspect.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","GlobalConfigAspect","exports","Aspect","create","id","dependencies","_default","default"],"sources":["global-config.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const GlobalConfigAspect = Aspect.create({\n id: 'teambit.harmony/global-config',\n dependencies: [],\n});\n\nexport default GlobalConfigAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC9CC,EAAE,EAAE,+BAA+B;EACnCC,YAAY,EAAE;AAChB,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEYP,kBAAkB","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Logo = void 0;
|
7
|
+
function _react() {
|
8
|
+
const data = _interopRequireDefault(require("react"));
|
9
|
+
_react = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
|
+
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
16
|
+
style: {
|
17
|
+
height: '100%',
|
18
|
+
display: 'flex',
|
19
|
+
justifyContent: 'center'
|
20
|
+
}
|
21
|
+
}, /*#__PURE__*/_react().default.createElement("img", {
|
22
|
+
style: {
|
23
|
+
width: 70
|
24
|
+
},
|
25
|
+
src: "https://static.bit.dev/extensions-icons/global-config.svg"
|
26
|
+
}));
|
27
|
+
exports.Logo = Logo;
|
28
|
+
|
29
|
+
//# sourceMappingURL=global-config.composition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["global-config.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/global-config.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAA2D,CAAE,CACzF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
2
|
+
import { ConfigStoreMain } from '@teambit/config-store';
|
3
|
+
export declare class GlobalConfigMain {
|
4
|
+
private configStore;
|
5
|
+
constructor(configStore: ConfigStoreMain);
|
6
|
+
/**
|
7
|
+
* @deprecated use ConfigStore.getConfig instead.
|
8
|
+
*/
|
9
|
+
get(key: string): Promise<string | undefined>;
|
10
|
+
/**
|
11
|
+
* @deprecated use ConfigStore.getConfigBoolean instead.
|
12
|
+
*/
|
13
|
+
getBool(key: string): Promise<boolean | undefined>;
|
14
|
+
/**
|
15
|
+
* @deprecated use ConfigStore.getConfig instead.
|
16
|
+
*/
|
17
|
+
getSync(key: string): string | undefined;
|
18
|
+
/**
|
19
|
+
* @deprecated use ConfigStore.listConfig instead.
|
20
|
+
*/
|
21
|
+
list(): Promise<Record<string, string>>;
|
22
|
+
/**
|
23
|
+
* @deprecated use ConfigStore.listConfig instead.
|
24
|
+
*/
|
25
|
+
listSync(): Record<string, string>;
|
26
|
+
/**
|
27
|
+
* @deprecated use ConfigStore.setConfig instead.
|
28
|
+
*/
|
29
|
+
set(key: string, val: string): Promise<void>;
|
30
|
+
/**
|
31
|
+
* @deprecated use ConfigStore.setConfig instead.
|
32
|
+
*/
|
33
|
+
setSync(key: string, val: string): void;
|
34
|
+
/**
|
35
|
+
* @deprecated use ConfigStore.delConfig instead.
|
36
|
+
*/
|
37
|
+
del(key: string): Promise<void>;
|
38
|
+
/**
|
39
|
+
* @deprecated use ConfigStore.delConfig instead.
|
40
|
+
*/
|
41
|
+
delSync(key: string): void;
|
42
|
+
getGlobalCapsulesBaseDir(): string;
|
43
|
+
invalidateCache(): void;
|
44
|
+
getKnownGlobalDirs(): {
|
45
|
+
'Global Dir': string;
|
46
|
+
'Log file': string;
|
47
|
+
'Global Scope Dir': string;
|
48
|
+
'Config Dir': string;
|
49
|
+
'Capsules Dir': string;
|
50
|
+
};
|
51
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
52
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
53
|
+
static slots: never[];
|
54
|
+
static provider([cli, configStore]: [CLIMain, ConfigStoreMain]): Promise<GlobalConfigMain>;
|
55
|
+
}
|
@@ -0,0 +1,150 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GlobalConfigMain = void 0;
|
7
|
+
function _cli() {
|
8
|
+
const data = require("@teambit/cli");
|
9
|
+
_cli = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
function _legacy() {
|
15
|
+
const data = require("@teambit/legacy.constants");
|
16
|
+
_legacy = function () {
|
17
|
+
return data;
|
18
|
+
};
|
19
|
+
return data;
|
20
|
+
}
|
21
|
+
function _globalConfig() {
|
22
|
+
const data = require("./global-config.aspect");
|
23
|
+
_globalConfig = function () {
|
24
|
+
return data;
|
25
|
+
};
|
26
|
+
return data;
|
27
|
+
}
|
28
|
+
function _globals() {
|
29
|
+
const data = require("./globals.cmd");
|
30
|
+
_globals = function () {
|
31
|
+
return data;
|
32
|
+
};
|
33
|
+
return data;
|
34
|
+
}
|
35
|
+
function _system() {
|
36
|
+
const data = require("./system.cmd");
|
37
|
+
_system = function () {
|
38
|
+
return data;
|
39
|
+
};
|
40
|
+
return data;
|
41
|
+
}
|
42
|
+
function _remoteCmd() {
|
43
|
+
const data = require("./remote-cmd");
|
44
|
+
_remoteCmd = function () {
|
45
|
+
return data;
|
46
|
+
};
|
47
|
+
return data;
|
48
|
+
}
|
49
|
+
function _configStore() {
|
50
|
+
const data = require("@teambit/config-store");
|
51
|
+
_configStore = function () {
|
52
|
+
return data;
|
53
|
+
};
|
54
|
+
return data;
|
55
|
+
}
|
56
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
57
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
58
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
59
|
+
class GlobalConfigMain {
|
60
|
+
constructor(configStore) {
|
61
|
+
this.configStore = configStore;
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @deprecated use ConfigStore.getConfig instead.
|
66
|
+
*/
|
67
|
+
async get(key) {
|
68
|
+
return this.configStore.getConfig(key);
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @deprecated use ConfigStore.getConfigBoolean instead.
|
73
|
+
*/
|
74
|
+
async getBool(key) {
|
75
|
+
return this.configStore.getConfigBoolean(key);
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* @deprecated use ConfigStore.getConfig instead.
|
80
|
+
*/
|
81
|
+
getSync(key) {
|
82
|
+
return this.configStore.getConfig(key);
|
83
|
+
}
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @deprecated use ConfigStore.listConfig instead.
|
87
|
+
*/
|
88
|
+
async list() {
|
89
|
+
return this.configStore.listConfig();
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* @deprecated use ConfigStore.listConfig instead.
|
93
|
+
*/
|
94
|
+
listSync() {
|
95
|
+
return this.configStore.listConfig();
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* @deprecated use ConfigStore.setConfig instead.
|
99
|
+
*/
|
100
|
+
async set(key, val) {
|
101
|
+
await this.configStore.setConfig(key, val);
|
102
|
+
}
|
103
|
+
/**
|
104
|
+
* @deprecated use ConfigStore.setConfig instead.
|
105
|
+
*/
|
106
|
+
setSync(key, val) {
|
107
|
+
return (0, _configStore().setGlobalConfig)(key, val);
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* @deprecated use ConfigStore.delConfig instead.
|
111
|
+
*/
|
112
|
+
async del(key) {
|
113
|
+
await this.configStore.delConfig(key);
|
114
|
+
}
|
115
|
+
/**
|
116
|
+
* @deprecated use ConfigStore.delConfig instead.
|
117
|
+
*/
|
118
|
+
delSync(key) {
|
119
|
+
return (0, _configStore().delGlobalConfig)(key);
|
120
|
+
}
|
121
|
+
getGlobalCapsulesBaseDir() {
|
122
|
+
return this.getSync(_legacy().CFG_CAPSULES_ROOT_BASE_DIR) || _legacy().GLOBALS_DEFAULT_CAPSULES;
|
123
|
+
}
|
124
|
+
invalidateCache() {
|
125
|
+
this.configStore.invalidateCache();
|
126
|
+
}
|
127
|
+
getKnownGlobalDirs() {
|
128
|
+
return {
|
129
|
+
'Global Dir': _legacy().CACHE_ROOT,
|
130
|
+
'Log file': _legacy().DEBUG_LOG,
|
131
|
+
'Global Scope Dir': _legacy().GLOBAL_SCOPE,
|
132
|
+
'Config Dir': _legacy().GLOBAL_CONFIG,
|
133
|
+
'Capsules Dir': this.getGlobalCapsulesBaseDir()
|
134
|
+
};
|
135
|
+
}
|
136
|
+
static async provider([cli, configStore]) {
|
137
|
+
const globalConfig = new GlobalConfigMain(configStore);
|
138
|
+
const systemCmd = new (_system().SystemCmd)();
|
139
|
+
systemCmd.commands = [new (_system().SystemLogCmd)(), new (_system().SystemTailLogCmd)()];
|
140
|
+
cli.register(new (_globals().GlobalsCmd)(globalConfig), systemCmd, new (_remoteCmd().RemoteCmd)());
|
141
|
+
return globalConfig;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
exports.GlobalConfigMain = GlobalConfigMain;
|
145
|
+
_defineProperty(GlobalConfigMain, "runtime", _cli().MainRuntime);
|
146
|
+
_defineProperty(GlobalConfigMain, "dependencies", [_cli().CLIAspect, _configStore().ConfigStoreAspect]);
|
147
|
+
_defineProperty(GlobalConfigMain, "slots", []);
|
148
|
+
_globalConfig().GlobalConfigAspect.addRuntime(GlobalConfigMain);
|
149
|
+
|
150
|
+
//# sourceMappingURL=global-config.main.runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_legacy","_globalConfig","_globals","_system","_remoteCmd","_configStore","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GlobalConfigMain","constructor","configStore","get","key","getConfig","getBool","getConfigBoolean","getSync","list","listConfig","listSync","set","val","setConfig","setSync","setGlobalConfig","del","delConfig","delSync","delGlobalConfig","getGlobalCapsulesBaseDir","CFG_CAPSULES_ROOT_BASE_DIR","GLOBALS_DEFAULT_CAPSULES","invalidateCache","getKnownGlobalDirs","CACHE_ROOT","DEBUG_LOG","GLOBAL_SCOPE","GLOBAL_CONFIG","provider","cli","globalConfig","systemCmd","SystemCmd","commands","SystemLogCmd","SystemTailLogCmd","register","GlobalsCmd","RemoteCmd","exports","MainRuntime","CLIAspect","ConfigStoreAspect","GlobalConfigAspect","addRuntime"],"sources":["global-config.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport {\n CACHE_ROOT,\n DEBUG_LOG,\n GLOBAL_SCOPE,\n GLOBAL_CONFIG,\n CFG_CAPSULES_ROOT_BASE_DIR,\n GLOBALS_DEFAULT_CAPSULES,\n} from '@teambit/legacy.constants';\nimport { GlobalConfigAspect } from './global-config.aspect';\nimport { GlobalsCmd } from './globals.cmd';\nimport { SystemCmd, SystemLogCmd, SystemTailLogCmd } from './system.cmd';\nimport { RemoteCmd } from './remote-cmd';\nimport { ConfigStoreAspect, ConfigStoreMain, setGlobalConfig, delGlobalConfig } from '@teambit/config-store';\n\nexport class GlobalConfigMain {\n constructor(private configStore: ConfigStoreMain) {}\n\n /**\n * @deprecated use ConfigStore.getConfig instead.\n */\n async get(key: string): Promise<string | undefined> {\n return this.configStore.getConfig(key);\n }\n\n /**\n * @deprecated use ConfigStore.getConfigBoolean instead.\n */\n async getBool(key: string): Promise<boolean | undefined> {\n return this.configStore.getConfigBoolean(key);\n }\n\n /**\n * @deprecated use ConfigStore.getConfig instead.\n */\n getSync(key: string): string | undefined {\n return this.configStore.getConfig(key);\n }\n\n /**\n * @deprecated use ConfigStore.listConfig instead.\n */\n async list(): Promise<Record<string, string>> {\n return this.configStore.listConfig();\n }\n /**\n * @deprecated use ConfigStore.listConfig instead.\n */\n listSync(): Record<string, string> {\n return this.configStore.listConfig();\n }\n /**\n * @deprecated use ConfigStore.setConfig instead.\n */\n async set(key: string, val: string): Promise<void> {\n await this.configStore.setConfig(key, val);\n }\n /**\n * @deprecated use ConfigStore.setConfig instead.\n */\n setSync(key: string, val: string) {\n return setGlobalConfig(key, val);\n }\n/**\n * @deprecated use ConfigStore.delConfig instead.\n */\n async del(key: string): Promise<void> {\n await this.configStore.delConfig(key);\n }\n/**\n * @deprecated use ConfigStore.delConfig instead.\n */\n delSync(key: string) {\n return delGlobalConfig(key);\n }\n\n getGlobalCapsulesBaseDir() {\n return this.getSync(CFG_CAPSULES_ROOT_BASE_DIR) || GLOBALS_DEFAULT_CAPSULES;\n }\n\n invalidateCache() {\n this.configStore.invalidateCache();\n }\n\n getKnownGlobalDirs() {\n return {\n 'Global Dir': CACHE_ROOT,\n 'Log file': DEBUG_LOG,\n 'Global Scope Dir': GLOBAL_SCOPE,\n 'Config Dir': GLOBAL_CONFIG,\n 'Capsules Dir': this.getGlobalCapsulesBaseDir(),\n };\n }\n static runtime = MainRuntime;\n static dependencies = [CLIAspect, ConfigStoreAspect];\n static slots = [];\n static async provider([cli, configStore]: [CLIMain, ConfigStoreMain]) {\n const globalConfig = new GlobalConfigMain(configStore);\n const systemCmd = new SystemCmd();\n systemCmd.commands = [new SystemLogCmd(), new SystemTailLogCmd()];\n cli.register(new GlobalsCmd(globalConfig), systemCmd, new RemoteCmd());\n return globalConfig;\n }\n}\n\nGlobalConfigAspect.addRuntime(GlobalConfigMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAA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C,gBAAS,EAAEC,gCAAiB,CAAC;AAAA/D,eAAA,CA/EzCmB,gBAAgB,WAgFZ,EAAE;AAUnB6C,kCAAkB,CAACC,UAAU,CAAC9C,gBAAgB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
import { GlobalConfigMain } from './global-config.main.runtime';
|
3
|
+
export declare class GlobalsCmd implements Command {
|
4
|
+
private globalConfig;
|
5
|
+
name: string;
|
6
|
+
description: string;
|
7
|
+
group: string;
|
8
|
+
helpUrl: string;
|
9
|
+
alias: string;
|
10
|
+
options: CommandOptions;
|
11
|
+
constructor(globalConfig: GlobalConfigMain);
|
12
|
+
report(): Promise<string>;
|
13
|
+
json(): Promise<{
|
14
|
+
'Global Dir': string;
|
15
|
+
'Log file': string;
|
16
|
+
'Global Scope Dir': string;
|
17
|
+
'Config Dir': string;
|
18
|
+
'Capsules Dir': string;
|
19
|
+
}>;
|
20
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GlobalsCmd = void 0;
|
7
|
+
function _chalk() {
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
9
|
+
_chalk = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
function _padRight() {
|
15
|
+
const data = _interopRequireDefault(require("pad-right"));
|
16
|
+
_padRight = function () {
|
17
|
+
return data;
|
18
|
+
};
|
19
|
+
return data;
|
20
|
+
}
|
21
|
+
function _legacy() {
|
22
|
+
const data = require("@teambit/legacy.constants");
|
23
|
+
_legacy = function () {
|
24
|
+
return data;
|
25
|
+
};
|
26
|
+
return data;
|
27
|
+
}
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
29
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
30
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
31
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-next-line max-classes-per-file
|
32
|
+
class GlobalsCmd {
|
33
|
+
constructor(globalConfig) {
|
34
|
+
this.globalConfig = globalConfig;
|
35
|
+
_defineProperty(this, "name", 'globals');
|
36
|
+
_defineProperty(this, "description", `list all globals`);
|
37
|
+
_defineProperty(this, "group", 'system');
|
38
|
+
_defineProperty(this, "helpUrl", 'reference/config/config-files');
|
39
|
+
_defineProperty(this, "alias", '');
|
40
|
+
_defineProperty(this, "options", [['j', 'json', 'json format']]);
|
41
|
+
}
|
42
|
+
async report() {
|
43
|
+
const list = await this.json();
|
44
|
+
const leftCol = Object.keys(list);
|
45
|
+
const padMax = Math.max(...leftCol.map(c => c.length)) + 1;
|
46
|
+
const values = Object.keys(list).map(key => {
|
47
|
+
const keyPadded = (0, _padRight().default)(key, padMax, ' ');
|
48
|
+
return `${_chalk().default.green(keyPadded)} ${list[key]}`;
|
49
|
+
}).join('\n');
|
50
|
+
const title = `the following globals are used by Bit. to change the global root dir, use "${_legacy().CACHE_GLOBALS_ENV}" env variable`;
|
51
|
+
return `${title}\n\n${values}`;
|
52
|
+
}
|
53
|
+
async json() {
|
54
|
+
return this.globalConfig.getKnownGlobalDirs();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
exports.GlobalsCmd = GlobalsCmd;
|
58
|
+
|
59
|
+
//# sourceMappingURL=globals.cmd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_padRight","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GlobalsCmd","constructor","globalConfig","report","list","json","leftCol","keys","padMax","Math","max","map","c","length","values","key","keyPadded","padRight","chalk","green","join","title","CACHE_GLOBALS_ENV","getKnownGlobalDirs","exports"],"sources":["globals.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport padRight from 'pad-right';\nimport { CACHE_GLOBALS_ENV } from '@teambit/legacy.constants';\nimport { GlobalConfigMain } from './global-config.main.runtime';\n\nexport class GlobalsCmd implements Command {\n name = 'globals';\n description = `list all globals`;\n group = 'system';\n helpUrl = 'reference/config/config-files';\n alias = '';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(private globalConfig: GlobalConfigMain) {}\n\n async report() {\n const list = await this.json();\n const leftCol = Object.keys(list);\n const padMax = Math.max(...leftCol.map((c) => c.length)) + 1;\n const values = Object.keys(list)\n .map((key) => {\n const keyPadded = padRight(key, padMax, ' ');\n return `${chalk.green(keyPadded)} ${list[key]}`;\n })\n .join('\\n');\n\n const title = `the following globals are used by Bit. to change the global root dir, use \"${CACHE_GLOBALS_ENV}\" env variable`;\n\n return `${title}\\n\\n${values}`;\n }\n\n async json() {\n return this.globalConfig.getKnownGlobalDirs();\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,I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;EAErD,MAAMqB,MAAMA,CAAA,EAAG;IACb,MAAMC,IAAI,GAAG,MAAM,IAAI,CAACC,IAAI,CAAC,CAAC;IAC9B,MAAMC,OAAO,GAAGpB,MAAM,CAACqB,IAAI,CAACH,IAAI,CAAC;IACjC,MAAMI,MAAM,GAAGC,IAAI,CAACC,GAAG,CAAC,GAAGJ,OAAO,CAACK,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,CAAC,CAAC,GAAG,CAAC;IAC5D,MAAMC,MAAM,GAAG5B,MAAM,CAACqB,IAAI,CAACH,IAAI,CAAC,CAC7BO,GAAG,CAAEI,GAAG,IAAK;MACZ,MAAMC,SAAS,GAAG,IAAAC,mBAAQ,EAACF,GAAG,EAAEP,MAAM,EAAE,GAAG,CAAC;MAC5C,OAAO,GAAGU,gBAAK,CAACC,KAAK,CAACH,SAAS,CAAC,IAAIZ,IAAI,CAACW,GAAG,CAAC,EAAE;IACjD,CAAC,CAAC,CACDK,IAAI,CAAC,IAAI,CAAC;IAEb,MAAMC,KAAK,GAAG,8EAA8EC,2BAAiB,gBAAgB;IAE7H,OAAO,GAAGD,KAAK,OAAOP,MAAM,EAAE;EAChC;EAEA,MAAMT,IAAIA,CAAA,EAAG;IACX,OAAO,IAAI,CAACH,YAAY,CAACqB,kBAAkB,CAAC,CAAC;EAC/C;AACF;AAACC,OAAA,CAAAxB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "GlobalConfigAspect", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _globalConfig().GlobalConfigAspect;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
exports.default = void 0;
|
13
|
+
function _globalConfig() {
|
14
|
+
const data = require("./global-config.aspect");
|
15
|
+
_globalConfig = function () {
|
16
|
+
return data;
|
17
|
+
};
|
18
|
+
return data;
|
19
|
+
}
|
20
|
+
var _default = exports.default = _globalConfig().GlobalConfigAspect;
|
21
|
+
|
22
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_globalConfig","data","require","_default","exports","default","GlobalConfigAspect"],"sources":["index.ts"],"sourcesContent":["import { GlobalConfigAspect } from './global-config.aspect';\n\nexport type { GlobalConfigMain } from './global-config.main.runtime';\nexport { GlobalConfigAspect };\nexport default GlobalConfigAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAI7CC,kCAAkB","ignoreList":[]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_global-config@0aeb43f50dd9c05b19fa26e7cf7bde05588cf852/dist/global-config.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_global-config@0aeb43f50dd9c05b19fa26e7cf7bde05588cf852/dist/global-config.docs.md';
|
3
|
+
|
4
|
+
export const compositions = [compositions_0];
|
5
|
+
export const overview = [overview_0];
|
6
|
+
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
declare class RemoteAdd implements Command {
|
3
|
+
name: string;
|
4
|
+
description: string;
|
5
|
+
extendedDescription: string;
|
6
|
+
alias: string;
|
7
|
+
loadAspects: boolean;
|
8
|
+
options: CommandOptions;
|
9
|
+
report([url]: [string], { global }: {
|
10
|
+
global: boolean;
|
11
|
+
}): Promise<string>;
|
12
|
+
}
|
13
|
+
declare class RemoteRm implements Command {
|
14
|
+
name: string;
|
15
|
+
description: string;
|
16
|
+
alias: string;
|
17
|
+
loadAspects: boolean;
|
18
|
+
options: CommandOptions;
|
19
|
+
report([name]: [string], { global }: {
|
20
|
+
global: boolean;
|
21
|
+
}): Promise<string>;
|
22
|
+
}
|
23
|
+
export declare class RemoteList implements Command {
|
24
|
+
name: string;
|
25
|
+
description: string;
|
26
|
+
group: string;
|
27
|
+
helpUrl: string;
|
28
|
+
alias: string;
|
29
|
+
loadAspects: boolean;
|
30
|
+
options: CommandOptions;
|
31
|
+
report(args: string[], { global }: {
|
32
|
+
global: boolean;
|
33
|
+
}): Promise<string>;
|
34
|
+
}
|
35
|
+
export declare class RemoteCmd implements Command {
|
36
|
+
name: string;
|
37
|
+
description: string;
|
38
|
+
group: string;
|
39
|
+
helpUrl: string;
|
40
|
+
alias: string;
|
41
|
+
loadAspects: boolean;
|
42
|
+
options: CommandOptions;
|
43
|
+
commands: (RemoteAdd | RemoteRm | RemoteList)[];
|
44
|
+
report(args: string[], { global }: {
|
45
|
+
global: boolean;
|
46
|
+
}): Promise<string>;
|
47
|
+
}
|
48
|
+
export {};
|
@@ -0,0 +1,124 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.RemoteList = exports.RemoteCmd = void 0;
|
7
|
+
function _chalk() {
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
9
|
+
_chalk = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
function _cliTable() {
|
15
|
+
const data = _interopRequireDefault(require("cli-table"));
|
16
|
+
_cliTable = function () {
|
17
|
+
return data;
|
18
|
+
};
|
19
|
+
return data;
|
20
|
+
}
|
21
|
+
function _lodash() {
|
22
|
+
const data = require("lodash");
|
23
|
+
_lodash = function () {
|
24
|
+
return data;
|
25
|
+
};
|
26
|
+
return data;
|
27
|
+
}
|
28
|
+
function _remote() {
|
29
|
+
const data = require("./remote");
|
30
|
+
_remote = function () {
|
31
|
+
return data;
|
32
|
+
};
|
33
|
+
return data;
|
34
|
+
}
|
35
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
36
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
38
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint max-classes-per-file: 0 */
|
39
|
+
class RemoteAdd {
|
40
|
+
constructor() {
|
41
|
+
_defineProperty(this, "name", 'add <url>');
|
42
|
+
_defineProperty(this, "description", 'add a bare-scope as a remote');
|
43
|
+
_defineProperty(this, "extendedDescription", `supported protocols are [file, http].
|
44
|
+
for example: "http://localhost:3000", "file:///tmp/local-scope"`);
|
45
|
+
_defineProperty(this, "alias", '');
|
46
|
+
_defineProperty(this, "loadAspects", false);
|
47
|
+
_defineProperty(this, "options", [['g', 'global', 'configure a remote bit scope']]);
|
48
|
+
}
|
49
|
+
async report([url], {
|
50
|
+
global
|
51
|
+
}) {
|
52
|
+
const {
|
53
|
+
name,
|
54
|
+
host
|
55
|
+
} = await (0, _remote().add)(url, global);
|
56
|
+
return _chalk().default.green(`added remote scope '${_chalk().default.bold(name)}' with host '${_chalk().default.bold(host)}'`);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
class RemoteRm {
|
60
|
+
constructor() {
|
61
|
+
_defineProperty(this, "name", 'del <name>');
|
62
|
+
_defineProperty(this, "description", 'remove a tracked bit remote');
|
63
|
+
_defineProperty(this, "alias", '');
|
64
|
+
_defineProperty(this, "loadAspects", false);
|
65
|
+
_defineProperty(this, "options", [['g', 'global', 'remove a globally configured remote scope']]);
|
66
|
+
}
|
67
|
+
async report([name], {
|
68
|
+
global
|
69
|
+
}) {
|
70
|
+
await (0, _remote().remove)(name, global);
|
71
|
+
return _chalk().default.green(`successfully removed remote ${_chalk().default.bold(name)}`);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
class RemoteList {
|
75
|
+
constructor() {
|
76
|
+
_defineProperty(this, "name", 'list');
|
77
|
+
_defineProperty(this, "description", 'list all configured remotes');
|
78
|
+
_defineProperty(this, "group", 'collaborate');
|
79
|
+
_defineProperty(this, "helpUrl", 'reference/scope/remote-scopes');
|
80
|
+
_defineProperty(this, "alias", '');
|
81
|
+
_defineProperty(this, "loadAspects", false);
|
82
|
+
_defineProperty(this, "options", [['g', 'global', 'see globally configured remotes']]);
|
83
|
+
}
|
84
|
+
async report(args, {
|
85
|
+
global
|
86
|
+
}) {
|
87
|
+
const remotes = await (0, _remote().list)(global);
|
88
|
+
if ((0, _lodash().isEmpty)(remotes)) return _chalk().default.red('no configured remotes found in scope');
|
89
|
+
const table = new (_cliTable().default)({
|
90
|
+
head: ['scope name', 'host'],
|
91
|
+
style: {
|
92
|
+
head: ['cyan']
|
93
|
+
}
|
94
|
+
});
|
95
|
+
(0, _lodash().forEach)(remotes, (host, name) => {
|
96
|
+
table.push([name, host]);
|
97
|
+
});
|
98
|
+
return table.toString();
|
99
|
+
}
|
100
|
+
}
|
101
|
+
exports.RemoteList = RemoteList;
|
102
|
+
class RemoteCmd {
|
103
|
+
constructor() {
|
104
|
+
_defineProperty(this, "name", 'remote');
|
105
|
+
_defineProperty(this, "description", 'manage set of tracked bit scope(s)');
|
106
|
+
_defineProperty(this, "group", 'collaborate');
|
107
|
+
_defineProperty(this, "helpUrl", 'reference/scope/remote-scopes');
|
108
|
+
_defineProperty(this, "alias", '');
|
109
|
+
_defineProperty(this, "loadAspects", false);
|
110
|
+
_defineProperty(this, "options", [['g', 'global', 'see globally configured remotes']]);
|
111
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
112
|
+
_defineProperty(this, "commands", [new RemoteAdd(), new RemoteRm(), new RemoteList()]);
|
113
|
+
}
|
114
|
+
async report(args, {
|
115
|
+
global
|
116
|
+
}) {
|
117
|
+
return new RemoteList().report(args, {
|
118
|
+
global
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
exports.RemoteCmd = RemoteCmd;
|
123
|
+
|
124
|
+
//# sourceMappingURL=remote-cmd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cliTable","_lodash","_remote","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoteAdd","constructor","report","url","global","name","host","add","chalk","green","bold","RemoteRm","remove","RemoteList","args","remotes","list","isEmpty","red","table","Table","head","style","forEach","push","toString","exports","RemoteCmd"],"sources":["remote-cmd.ts"],"sourcesContent":["/* eslint max-classes-per-file: 0 */\n\nimport chalk from 'chalk';\nimport Table from 'cli-table';\nimport { forEach, isEmpty } from 'lodash';\nimport { add, list, remove } from './remote';\nimport { Command, CommandOptions } from '@teambit/cli';\n\nclass RemoteAdd implements Command {\n name = 'add <url>';\n description = 'add a bare-scope as a remote';\n extendedDescription = `supported protocols are [file, http].\nfor example: \"http://localhost:3000\", \"file:///tmp/local-scope\"`;\n alias = '';\n loadAspects = false;\n options = [['g', 'global', 'configure a remote bit scope']] as CommandOptions;\n\n async report([url]: [string], { global }: { global: boolean }) {\n const { name, host }: { name: string; host: string } = await add(url, global);\n return chalk.green(`added remote scope '${chalk.bold(name)}' with host '${chalk.bold(host)}'`);\n }\n}\n\nclass RemoteRm implements Command {\n name = 'del <name>';\n description = 'remove a tracked bit remote';\n alias = '';\n loadAspects = false;\n options = [['g', 'global', 'remove a globally configured remote scope']] as CommandOptions;\n\n async report([name]: [string], { global }: { global: boolean }) {\n await remove(name, global);\n return chalk.green(`successfully removed remote ${chalk.bold(name)}`);\n }\n}\n\nexport class RemoteList implements Command {\n name = 'list';\n description = 'list all configured remotes';\n group = 'collaborate';\n helpUrl = 'reference/scope/remote-scopes';\n alias = '';\n loadAspects = false;\n options = [['g', 'global', 'see globally configured remotes']] as CommandOptions;\n\n async report(args: string[], { global }: { global: boolean }) {\n const remotes: { [key: string]: string } = await list(global);\n if (isEmpty(remotes)) return chalk.red('no configured remotes found in scope');\n\n const table = new Table({ head: ['scope name', 'host'], style: { head: ['cyan'] } });\n forEach(remotes, (host, name) => {\n table.push([name, host]);\n });\n\n return table.toString();\n }\n}\n\nexport class RemoteCmd implements Command {\n name = 'remote';\n description = 'manage set of tracked bit scope(s)';\n group = 'collaborate';\n helpUrl = 'reference/scope/remote-scopes';\n alias = '';\n loadAspects = false;\n options = [['g', 'global', 'see globally configured remotes']] as CommandOptions;\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n commands = [new RemoteAdd(), new RemoteRm(), new RemoteList()];\n\n async report(args: string[], { global }: { global: boolean }) {\n return new RemoteList().report(args, { global });\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;E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81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.add = add;
|
7
|
+
exports.list = list;
|
8
|
+
exports.remove = remove;
|
9
|
+
function _bitError() {
|
10
|
+
const data = require("@teambit/bit-error");
|
11
|
+
_bitError = function () {
|
12
|
+
return data;
|
13
|
+
};
|
14
|
+
return data;
|
15
|
+
}
|
16
|
+
function _scope() {
|
17
|
+
const data = require("@teambit/scope.remotes");
|
18
|
+
_scope = function () {
|
19
|
+
return data;
|
20
|
+
};
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
function _legacy() {
|
24
|
+
const data = require("@teambit/legacy.scope");
|
25
|
+
_legacy = function () {
|
26
|
+
return data;
|
27
|
+
};
|
28
|
+
return data;
|
29
|
+
}
|
30
|
+
function buildRemote(url) {
|
31
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
32
|
+
return new (_scope().Remote)(url);
|
33
|
+
}
|
34
|
+
async function add(url, global) {
|
35
|
+
const remote = buildRemote(url);
|
36
|
+
return remote.scope().then(scopeDesc => {
|
37
|
+
remote.name = scopeDesc.name;
|
38
|
+
if (global) {
|
39
|
+
return _scope().GlobalRemotes.load().then(globalRemotes => {
|
40
|
+
return globalRemotes.addRemote(remote).write().then(() => remote);
|
41
|
+
});
|
42
|
+
}
|
43
|
+
|
44
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
45
|
+
return (0, _legacy().loadScope)().then(scope => {
|
46
|
+
return scope.scopeJson.addRemote(remote).write().then(() => remote);
|
47
|
+
});
|
48
|
+
});
|
49
|
+
}
|
50
|
+
async function remove(name, global) {
|
51
|
+
if (global) {
|
52
|
+
const globalRemotes = await _scope().GlobalRemotes.load();
|
53
|
+
const hasRemoved = globalRemotes.rmRemote(name);
|
54
|
+
if (!hasRemoved) {
|
55
|
+
throw new (_bitError().BitError)(`remote "${name}" was not found globally, to remove a local remote, please omit the "--global" flag`);
|
56
|
+
}
|
57
|
+
await globalRemotes.write();
|
58
|
+
return name;
|
59
|
+
}
|
60
|
+
|
61
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
62
|
+
const scope = await (0, _legacy().loadScope)();
|
63
|
+
const hasRemoved = scope.scopeJson.rmRemote(name);
|
64
|
+
if (!hasRemoved) {
|
65
|
+
throw new (_bitError().BitError)(`remote "${name}" was not found locally, to remove a global remote, please use "--global" flag`);
|
66
|
+
}
|
67
|
+
await scope.scopeJson.write();
|
68
|
+
return name;
|
69
|
+
}
|
70
|
+
async function list(global) {
|
71
|
+
if (global) {
|
72
|
+
return _scope().GlobalRemotes.load().then(globalRemotes => globalRemotes.toPlainObject());
|
73
|
+
}
|
74
|
+
|
75
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
76
|
+
return (0, _legacy().loadScope)().then(scope => {
|
77
|
+
return (0, _scope().getScopeRemotes)(scope).then(remotes => remotes.toPlainObject());
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
//# sourceMappingURL=remote.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","_scope","_legacy","buildRemote","url","Remote","add","global","remote","scope","then","scopeDesc","name","GlobalRemotes","load","globalRemotes","addRemote","write","loadScope","scopeJson","remove","hasRemoved","rmRemote","BitError","list","toPlainObject","getScopeRemotes","remotes"],"sources":["remote.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { Remote, getScopeRemotes, GlobalRemotes } from '@teambit/scope.remotes';\nimport { loadScope } from '@teambit/legacy.scope';\n\nfunction buildRemote(url: string): Remote {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return new Remote(url);\n}\n\nexport async function add(url: string, global: boolean) {\n const remote = buildRemote(url);\n return remote.scope().then((scopeDesc) => {\n remote.name = scopeDesc.name;\n\n if (global) {\n return GlobalRemotes.load().then((globalRemotes) => {\n return globalRemotes\n .addRemote(remote)\n .write()\n .then(() => remote);\n });\n }\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return loadScope().then((scope) => {\n return scope.scopeJson\n .addRemote(remote)\n .write()\n .then(() => remote);\n });\n });\n}\n\nexport async function remove(name: string, global: boolean) {\n if (global) {\n const globalRemotes = await GlobalRemotes.load();\n const hasRemoved = globalRemotes.rmRemote(name);\n if (!hasRemoved) {\n throw new BitError(\n `remote \"${name}\" was not found globally, to remove a local remote, please omit the \"--global\" flag`\n );\n }\n await globalRemotes.write();\n return name;\n }\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const scope = await loadScope();\n const hasRemoved = scope.scopeJson.rmRemote(name);\n if (!hasRemoved) {\n throw new BitError(`remote \"${name}\" was not found locally, to remove a global remote, please use \"--global\" flag`);\n }\n await scope.scopeJson.write();\n return name;\n}\n\nexport async function list(global: boolean) {\n if (global) {\n return GlobalRemotes.load().then((globalRemotes) => globalRemotes.toPlainObject());\n }\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return loadScope().then((scope) => {\n return getScopeRemotes(scope).then((remotes) => remotes.toPlainObject());\n });\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAASI,WAAWA,CAAC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AAGZ,KAAK,CAACU,SAAS,CAACG,QAAQ,CAACV,IAAI,CAAC;EACjD,IAAI,CAACS,UAAU,EAAE;IACf,MAAM,KAAIE,oBAAQ,EAAC,WAAWX,IAAI,gFAAgF,CAAC;EACrH;EACA,MAAMH,KAAK,CAACU,SAAS,CAACF,KAAK,CAAC,CAAC;EAC7B,OAAOL,IAAI;AACb;AAEO,eAAeY,IAAIA,CAACjB,MAAe,EAAE;EAC1C,IAAIA,MAAM,EAAE;IACV,OAAOM,sBAAa,CAACC,IAAI,CAAC,CAAC,CAACJ,IAAI,CAAEK,aAAa,IAAKA,aAAa,CAACU,aAAa,CAAC,CAAC,CAAC;EACpF;;EAEA;EACA,OAAO,IAAAP,mBAAS,EAAC,CAAC,CAACR,IAAI,CAAED,KAAK,IAAK;IACjC,OAAO,IAAAiB,wBAAe,EAACjB,KAAK,CAAC,CAACC,IAAI,CAAEiB,OAAO,IAAKA,OAAO,CAACF,aAAa,CAAC,CAAC,CAAC;EAC1E,CAAC,CAAC;AACJ","ignoreList":[]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
2
|
+
export declare class SystemCmd implements Command {
|
3
|
+
name: string;
|
4
|
+
description: string;
|
5
|
+
group: string;
|
6
|
+
alias: string;
|
7
|
+
options: CommandOptions;
|
8
|
+
commands: Command[];
|
9
|
+
report([unrecognizedSubcommand]: [string]): Promise<string>;
|
10
|
+
}
|
11
|
+
export declare class SystemLogCmd implements Command {
|
12
|
+
name: string;
|
13
|
+
description: string;
|
14
|
+
group: string;
|
15
|
+
alias: string;
|
16
|
+
loader: boolean;
|
17
|
+
options: CommandOptions;
|
18
|
+
report(): Promise<string>;
|
19
|
+
}
|
20
|
+
export declare class SystemTailLogCmd implements Command {
|
21
|
+
name: string;
|
22
|
+
description: string;
|
23
|
+
extendedDescription: string;
|
24
|
+
group: string;
|
25
|
+
alias: string;
|
26
|
+
loader: boolean;
|
27
|
+
options: CommandOptions;
|
28
|
+
wait(): Promise<void>;
|
29
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.SystemTailLogCmd = exports.SystemLogCmd = exports.SystemCmd = void 0;
|
7
|
+
function _fsExtra() {
|
8
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
9
|
+
_fsExtra = function () {
|
10
|
+
return data;
|
11
|
+
};
|
12
|
+
return data;
|
13
|
+
}
|
14
|
+
function _chalk() {
|
15
|
+
const data = _interopRequireDefault(require("chalk"));
|
16
|
+
_chalk = function () {
|
17
|
+
return data;
|
18
|
+
};
|
19
|
+
return data;
|
20
|
+
}
|
21
|
+
function _child_process() {
|
22
|
+
const data = _interopRequireDefault(require("child_process"));
|
23
|
+
_child_process = function () {
|
24
|
+
return data;
|
25
|
+
};
|
26
|
+
return data;
|
27
|
+
}
|
28
|
+
function _legacy() {
|
29
|
+
const data = require("@teambit/legacy.constants");
|
30
|
+
_legacy = function () {
|
31
|
+
return data;
|
32
|
+
};
|
33
|
+
return data;
|
34
|
+
}
|
35
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
36
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
38
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-next-line max-classes-per-file
|
39
|
+
class SystemCmd {
|
40
|
+
constructor() {
|
41
|
+
_defineProperty(this, "name", 'system <sub-command>');
|
42
|
+
_defineProperty(this, "description", `system operations`);
|
43
|
+
_defineProperty(this, "group", 'system');
|
44
|
+
_defineProperty(this, "alias", '');
|
45
|
+
_defineProperty(this, "options", []);
|
46
|
+
_defineProperty(this, "commands", []);
|
47
|
+
}
|
48
|
+
async report([unrecognizedSubcommand]) {
|
49
|
+
return _chalk().default.red(`"${unrecognizedSubcommand}" is not a subcommand of "system", please run "bit system --help" to list the subcommands`);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
exports.SystemCmd = SystemCmd;
|
53
|
+
class SystemLogCmd {
|
54
|
+
constructor() {
|
55
|
+
_defineProperty(this, "name", 'log');
|
56
|
+
_defineProperty(this, "description", `print debug.log to the screen`);
|
57
|
+
_defineProperty(this, "group", 'system');
|
58
|
+
_defineProperty(this, "alias", '');
|
59
|
+
_defineProperty(this, "loader", false);
|
60
|
+
_defineProperty(this, "options", []);
|
61
|
+
}
|
62
|
+
async report() {
|
63
|
+
const logFile = _fsExtra().default.readFileSync(_legacy().DEBUG_LOG, 'utf8');
|
64
|
+
return logFile;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
exports.SystemLogCmd = SystemLogCmd;
|
68
|
+
class SystemTailLogCmd {
|
69
|
+
constructor() {
|
70
|
+
_defineProperty(this, "name", 'tail-log');
|
71
|
+
_defineProperty(this, "description", `print the log file to the screen as it is being written`);
|
72
|
+
_defineProperty(this, "extendedDescription", 'similar to linux "tail -f" command');
|
73
|
+
_defineProperty(this, "group", 'system');
|
74
|
+
_defineProperty(this, "alias", '');
|
75
|
+
_defineProperty(this, "loader", false);
|
76
|
+
_defineProperty(this, "options", []);
|
77
|
+
}
|
78
|
+
async wait() {
|
79
|
+
_child_process().default.execSync(`tail -f ${_legacy().DEBUG_LOG}`, {
|
80
|
+
stdio: 'inherit'
|
81
|
+
});
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.SystemTailLogCmd = SystemTailLogCmd;
|
85
|
+
|
86
|
+
//# sourceMappingURL=system.cmd.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_chalk","_child_process","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SystemCmd","constructor","report","unrecognizedSubcommand","chalk","red","exports","SystemLogCmd","logFile","fs","readFileSync","DEBUG_LOG","SystemTailLogCmd","wait","cp","execSync","stdio"],"sources":["system.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport fs from 'fs-extra';\nimport chalk from 'chalk';\nimport cp from 'child_process';\nimport { DEBUG_LOG } from '@teambit/legacy.constants';\n\nexport class SystemCmd implements Command {\n name = 'system <sub-command>';\n description = `system operations`;\n group = 'system';\n alias = '';\n options = [] as CommandOptions;\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"system\", please run \"bit system --help\" to list the subcommands`\n );\n }\n}\n\nexport class SystemLogCmd implements Command {\n name = 'log';\n description = `print debug.log to the screen`;\n group = 'system';\n alias = '';\n loader = false;\n options = [] as CommandOptions;\n\n async report() {\n const logFile = fs.readFileSync(DEBUG_LOG, 'utf8');\n return logFile;\n }\n}\n\nexport class SystemTailLogCmd implements Command {\n name = 'tail-log';\n description = `print the log file to the screen as it is being written`;\n extendedDescription = 'similar to linux \"tail -f\" command';\n group = 'system';\n alias = '';\n loader = false;\n options = [] as CommandOptions;\n\n async wait() {\n cp.execSync(`tail -f ${DEBUG_LOG}`, { stdio: 'inherit' });\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAA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name": "@teambit/global-config",
|
3
|
+
"version": "0.0.0-0aeb43f50dd9c05b19fa26e7cf7bde05588cf852",
|
4
|
+
"homepage": "https://bit.cloud/teambit/harmony/global-config",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"componentId": {
|
7
|
+
"scope": "teambit.harmony",
|
8
|
+
"name": "global-config",
|
9
|
+
"version": "0aeb43f50dd9c05b19fa26e7cf7bde05588cf852"
|
10
|
+
},
|
11
|
+
"dependencies": {
|
12
|
+
"chalk": "4.1.2",
|
13
|
+
"pad-right": "0.2.2",
|
14
|
+
"cli-table": "0.3.6",
|
15
|
+
"lodash": "4.17.21",
|
16
|
+
"fs-extra": "10.0.0",
|
17
|
+
"@teambit/harmony": "0.4.7",
|
18
|
+
"@teambit/bit-error": "0.0.404",
|
19
|
+
"@teambit/cli": "0.0.0-387ca83bd6d05e8441bf8d4e938b4a402307cc6b",
|
20
|
+
"@teambit/config-store": "0.0.0-819156c3462a42b79825dda6f6cf8cffc5c1fb54",
|
21
|
+
"@teambit/legacy.constants": "0.0.12",
|
22
|
+
"@teambit/legacy.scope": "0.0.54",
|
23
|
+
"@teambit/scope.remotes": "0.0.54"
|
24
|
+
},
|
25
|
+
"devDependencies": {
|
26
|
+
"@types/cli-table": "^0.3.0",
|
27
|
+
"@types/lodash": "4.14.165",
|
28
|
+
"@types/fs-extra": "9.0.7",
|
29
|
+
"@types/mocha": "9.1.0",
|
30
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.69"
|
31
|
+
},
|
32
|
+
"peerDependencies": {
|
33
|
+
"react": "^17.0.0 || ^18.0.0",
|
34
|
+
"@types/react": "^17.0.73"
|
35
|
+
},
|
36
|
+
"license": "Apache-2.0",
|
37
|
+
"optionalDependencies": {},
|
38
|
+
"peerDependenciesMeta": {},
|
39
|
+
"exports": {
|
40
|
+
".": {
|
41
|
+
"node": {
|
42
|
+
"require": "./dist/index.js",
|
43
|
+
"import": "./dist/esm.mjs"
|
44
|
+
},
|
45
|
+
"default": "./dist/index.js"
|
46
|
+
},
|
47
|
+
"./dist/*": "./dist/*",
|
48
|
+
"./artifacts/*": "./artifacts/*",
|
49
|
+
"./*": "./*.ts"
|
50
|
+
},
|
51
|
+
"private": false,
|
52
|
+
"engines": {
|
53
|
+
"node": ">=16.0.0"
|
54
|
+
},
|
55
|
+
"repository": {
|
56
|
+
"type": "git",
|
57
|
+
"url": "https://github.com/teambit/bit"
|
58
|
+
},
|
59
|
+
"keywords": [
|
60
|
+
"bit",
|
61
|
+
"bit-aspect",
|
62
|
+
"bit-core-aspect",
|
63
|
+
"components",
|
64
|
+
"collaboration",
|
65
|
+
"web"
|
66
|
+
]
|
67
|
+
}
|
package/types/asset.d.ts
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
declare module '*.png' {
|
2
|
+
const value: any;
|
3
|
+
export = value;
|
4
|
+
}
|
5
|
+
declare module '*.svg' {
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
7
|
+
|
8
|
+
export const ReactComponent: FunctionComponent<
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
10
|
+
>;
|
11
|
+
const src: string;
|
12
|
+
export default src;
|
13
|
+
}
|
14
|
+
declare module '*.jpg' {
|
15
|
+
const value: any;
|
16
|
+
export = value;
|
17
|
+
}
|
18
|
+
declare module '*.jpeg' {
|
19
|
+
const value: any;
|
20
|
+
export = value;
|
21
|
+
}
|
22
|
+
declare module '*.gif' {
|
23
|
+
const value: any;
|
24
|
+
export = value;
|
25
|
+
}
|
26
|
+
declare module '*.bmp' {
|
27
|
+
const value: any;
|
28
|
+
export = value;
|
29
|
+
}
|
30
|
+
declare module '*.otf' {
|
31
|
+
const value: any;
|
32
|
+
export = value;
|
33
|
+
}
|
34
|
+
declare module '*.woff' {
|
35
|
+
const value: any;
|
36
|
+
export = value;
|
37
|
+
}
|
38
|
+
declare module '*.woff2' {
|
39
|
+
const value: any;
|
40
|
+
export = value;
|
41
|
+
}
|
package/types/style.d.ts
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
declare module '*.module.css' {
|
2
|
+
const classes: { readonly [key: string]: string };
|
3
|
+
export default classes;
|
4
|
+
}
|
5
|
+
declare module '*.module.scss' {
|
6
|
+
const classes: { readonly [key: string]: string };
|
7
|
+
export default classes;
|
8
|
+
}
|
9
|
+
declare module '*.module.sass' {
|
10
|
+
const classes: { readonly [key: string]: string };
|
11
|
+
export default classes;
|
12
|
+
}
|
13
|
+
|
14
|
+
declare module '*.module.less' {
|
15
|
+
const classes: { readonly [key: string]: string };
|
16
|
+
export default classes;
|
17
|
+
}
|
18
|
+
|
19
|
+
declare module '*.less' {
|
20
|
+
const classes: { readonly [key: string]: string };
|
21
|
+
export default classes;
|
22
|
+
}
|
23
|
+
|
24
|
+
declare module '*.css' {
|
25
|
+
const classes: { readonly [key: string]: string };
|
26
|
+
export default classes;
|
27
|
+
}
|
28
|
+
|
29
|
+
declare module '*.sass' {
|
30
|
+
const classes: { readonly [key: string]: string };
|
31
|
+
export default classes;
|
32
|
+
}
|
33
|
+
|
34
|
+
declare module '*.scss' {
|
35
|
+
const classes: { readonly [key: string]: string };
|
36
|
+
export default classes;
|
37
|
+
}
|
38
|
+
|
39
|
+
declare module '*.mdx' {
|
40
|
+
const component: any;
|
41
|
+
export default component;
|
42
|
+
}
|