@teambit/lister 1.0.470 → 1.0.471
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.
@@ -25,13 +25,6 @@ function _workspace() {
|
|
25
25
|
};
|
26
26
|
return data;
|
27
27
|
}
|
28
|
-
function _loaderMessages() {
|
29
|
-
const data = require("@teambit/legacy/dist/cli/loader/loader-messages");
|
30
|
-
_loaderMessages = function () {
|
31
|
-
return data;
|
32
|
-
};
|
33
|
-
return data;
|
34
|
-
}
|
35
28
|
function _exceptions() {
|
36
29
|
const data = require("@teambit/legacy/dist/consumer/exceptions");
|
37
30
|
_exceptions = function () {
|
@@ -85,6 +78,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
85
78
|
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; }
|
86
79
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
87
80
|
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); }
|
81
|
+
const BEFORE_REMOTE_LIST = 'listing remote components';
|
82
|
+
const BEFORE_LOCAL_LIST = 'listing components';
|
88
83
|
class ListerMain {
|
89
84
|
constructor(logger, workspace) {
|
90
85
|
this.logger = logger;
|
@@ -96,7 +91,7 @@ class ListerMain {
|
|
96
91
|
includeDeleted = false
|
97
92
|
}) {
|
98
93
|
const remote = await (0, _getRemoteByName().default)(scopeName, this.workspace?.consumer);
|
99
|
-
this.logger.setStatusLine(
|
94
|
+
this.logger.setStatusLine(BEFORE_REMOTE_LIST);
|
100
95
|
const listResult = await remote.list(namespacesUsingWildcards, includeDeleted);
|
101
96
|
const results = includeDeprecated ? listResult : listResult.filter(r => !r.deprecated);
|
102
97
|
return this.sortListScopeResults(results);
|
@@ -121,7 +116,7 @@ class ListerMain {
|
|
121
116
|
if (!this.workspace) {
|
122
117
|
throw new (_exceptions().ConsumerNotFound)();
|
123
118
|
}
|
124
|
-
this.logger.setStatusLine(
|
119
|
+
this.logger.setStatusLine(BEFORE_LOCAL_LIST);
|
125
120
|
const componentsList = new (_legacy().ComponentsList)(this.workspace.consumer);
|
126
121
|
const results = await componentsList.listAll(showRemoteVersion, showAll, namespacesUsingWildcards);
|
127
122
|
return this.sortListScopeResults(results);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_exceptions","_getRemoteByName","_interopRequireDefault","_legacy","_bitError","_list","_lister","_noIdMatchWildcard","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_REMOTE_LIST","BEFORE_LOCAL_LIST","ListerMain","constructor","logger","workspace","remoteList","scopeName","namespacesUsingWildcards","includeDeprecated","includeDeleted","remote","getRemoteByName","consumer","setStatusLine","listResult","list","results","filter","deprecated","sortListScopeResults","getRemoteCompIdsByWildcards","idStr","includes","BitError","idSplit","split","rest","join","length","NoIdMatchWildcard","map","result","id","localList","showAll","showRemoteVersion","ConsumerNotFound","componentsList","ComponentsList","listAll","listScopeResults","sort","a","b","toString","localeCompare","provider","cli","loggerMain","createLogger","ListerAspect","lister","register","ListCmd","exports","CLIAspect","LoggerAspect","WorkspaceAspect","MainRuntime","addRuntime"],"sources":["lister.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { Remote } from '@teambit/legacy/dist/remotes';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { ComponentsList } from '@teambit/legacy.component-list';\nimport { BitError } from '@teambit/bit-error';\nimport { ListCmd } from './list.cmd';\nimport { ListerAspect } from './lister.aspect';\nimport { NoIdMatchWildcard } from './no-id-match-wildcard';\n\nconst BEFORE_REMOTE_LIST = 'listing remote components';\nconst BEFORE_LOCAL_LIST = 'listing components';\n\nexport type ListScopeResult = {\n id: ComponentID;\n currentlyUsedVersion?: string | null | undefined;\n remoteVersion?: string;\n deprecated?: boolean;\n removed?: boolean;\n laneReadmeOf?: string[];\n};\n\nexport class ListerMain {\n constructor(\n private logger: Logger,\n private workspace?: Workspace\n ) {}\n\n async remoteList(\n scopeName: string,\n {\n namespacesUsingWildcards,\n includeDeprecated = true,\n includeDeleted = false,\n }: {\n namespacesUsingWildcards?: string;\n includeDeprecated?: boolean;\n includeDeleted?: boolean;\n }\n ): Promise<ListScopeResult[]> {\n const remote: Remote = await getRemoteByName(scopeName, this.workspace?.consumer);\n this.logger.setStatusLine(BEFORE_REMOTE_LIST);\n const listResult = await remote.list(namespacesUsingWildcards, includeDeleted);\n const results = includeDeprecated ? listResult : listResult.filter((r) => !r.deprecated);\n return this.sortListScopeResults(results);\n }\n\n async getRemoteCompIdsByWildcards(idStr: string, includeDeprecated = true): Promise<ComponentID[]> {\n if (!idStr.includes('/')) {\n throw new BitError(`import with wildcards expects full scope-name before the wildcards, instead, got \"${idStr}\"`);\n }\n const idSplit = idStr.split('/');\n const [scopeName, ...rest] = idSplit;\n const namespacesUsingWildcards = rest.join('/');\n const listResult = await this.remoteList(scopeName, { namespacesUsingWildcards, includeDeprecated });\n if (!listResult.length) {\n throw new NoIdMatchWildcard([idStr]);\n }\n return listResult.map((result) => result.id);\n }\n\n async localList(\n showAll = false,\n showRemoteVersion = false,\n namespacesUsingWildcards?: string\n ): Promise<ListScopeResult[]> {\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n this.logger.setStatusLine(BEFORE_LOCAL_LIST);\n const componentsList = new ComponentsList(this.workspace.consumer);\n const results = await componentsList.listAll(showRemoteVersion, showAll, namespacesUsingWildcards);\n return this.sortListScopeResults(results);\n }\n\n private sortListScopeResults(listScopeResults: ListScopeResult[]): ListScopeResult[] {\n return listScopeResults.sort((a, b) => a.id.toString().localeCompare(b.id.toString()));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, LoggerAspect, WorkspaceAspect];\n static runtime = MainRuntime;\n static async provider([cli, loggerMain, workspace]: [CLIMain, LoggerMain, Workspace]) {\n const logger = loggerMain.createLogger(ListerAspect.id);\n const lister = new ListerMain(logger, workspace);\n cli.register(new ListCmd(lister));\n return lister;\n }\n}\n\nListerAspect.addRuntime(ListerMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,iBAAA;EAAA,MAAAL,IAAA,GAAAM,sBAAA,CAAAL,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA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AMD,MAAM,GAAG6C,UAAU,CAACC,YAAY,CAACC,sBAAY,CAAClB,EAAE,CAAC;IACvD,MAAMmB,MAAM,GAAG,IAAIlD,UAAU,CAACE,MAAM,EAAEC,SAAS,CAAC;IAChD2C,GAAG,CAACK,QAAQ,CAAC,KAAIC,eAAO,EAACF,MAAM,CAAC,CAAC;IACjC,OAAOA,MAAM;EACf;AACF;AAACG,OAAA,CAAArD,UAAA,GAAAA,UAAA;AAAApB,eAAA,CAlEYoB,UAAU,WAyDN,EAAE;AAAApB,eAAA,CAzDNoB,UAAU,kBA0DC,CAACsD,gBAAS,EAAEC,sBAAY,EAAEC,4BAAe,CAAC;AAAA5E,eAAA,CA1DrDoB,UAAU,aA2DJyD,kBAAW;AAS9BR,sBAAY,CAACS,UAAU,CAAC1D,UAAU,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/lister",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.471",
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/lister",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "lister",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.471"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -16,11 +16,11 @@
|
|
16
16
|
"@teambit/harmony": "0.4.6",
|
17
17
|
"@teambit/bit-error": "0.0.404",
|
18
18
|
"@teambit/component-id": "1.2.2",
|
19
|
-
"@teambit/cli": "0.0.
|
19
|
+
"@teambit/cli": "0.0.1048",
|
20
20
|
"@teambit/legacy.utils": "0.0.6",
|
21
|
-
"@teambit/legacy.component-list": "0.0.
|
22
|
-
"@teambit/logger": "0.0.
|
23
|
-
"@teambit/workspace": "1.0.
|
21
|
+
"@teambit/legacy.component-list": "0.0.49",
|
22
|
+
"@teambit/logger": "0.0.1141",
|
23
|
+
"@teambit/workspace": "1.0.471"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"@types/cli-table": "^0.3.0",
|
File without changes
|