@teambit/tracker 1.0.1064 → 1.0.1066
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.
|
@@ -46,6 +46,20 @@ export declare class TrackerMain {
|
|
|
46
46
|
track(trackData: TrackData): Promise<TrackResult>;
|
|
47
47
|
trackMany(manyTrackData: ResolvedTrackData[]): Promise<ComponentID[]>;
|
|
48
48
|
addForCLI(addProps: AddProps): Promise<AddActionResults>;
|
|
49
|
+
/**
|
|
50
|
+
* best-effort early warning: if any of the just-added/created components share an id with a
|
|
51
|
+
* component that already exists on the remote scope, let the user know now — before they invest
|
|
52
|
+
* work and hit a wall at export. fully non-blocking: the remote check swallows offline / no-access
|
|
53
|
+
* / scope-not-found errors, is bounded by a timeout so a stalled remote can't delay the command,
|
|
54
|
+
* and the whole method is wrapped so it can never fail an add/create.
|
|
55
|
+
*/
|
|
56
|
+
warnAboutRemoteIdCollisions(ids: ComponentID[]): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* the remote calls have no request-level timeout of their own (and http retries for up to a
|
|
59
|
+
* minute), so a stalled remote would otherwise keep "bit add"/"bit create" waiting. race the
|
|
60
|
+
* checks against a timeout and simply skip the warning if the remote is too slow to answer.
|
|
61
|
+
*/
|
|
62
|
+
private getIdsExistingOnRemote;
|
|
49
63
|
addEnvToConfig(env: string, config: {
|
|
50
64
|
[aspectName: string]: any;
|
|
51
65
|
}): Promise<void>;
|
|
@@ -11,6 +11,20 @@ function _cli() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
+
function _toolboxPromise() {
|
|
15
|
+
const data = require("@teambit/toolbox.promise.map-pool");
|
|
16
|
+
_toolboxPromise = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _harmonyModules() {
|
|
22
|
+
const data = require("@teambit/harmony.modules.concurrency");
|
|
23
|
+
_harmonyModules = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
14
28
|
function _path() {
|
|
15
29
|
const data = _interopRequireDefault(require("path"));
|
|
16
30
|
_path = function () {
|
|
@@ -40,12 +54,19 @@ function _logger() {
|
|
|
40
54
|
return data;
|
|
41
55
|
}
|
|
42
56
|
function _legacy() {
|
|
43
|
-
const data = require("@teambit/legacy.
|
|
57
|
+
const data = require("@teambit/legacy.logger");
|
|
44
58
|
_legacy = function () {
|
|
45
59
|
return data;
|
|
46
60
|
};
|
|
47
61
|
return data;
|
|
48
62
|
}
|
|
63
|
+
function _legacy2() {
|
|
64
|
+
const data = require("@teambit/legacy.utils");
|
|
65
|
+
_legacy2 = function () {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
49
70
|
function _addCmd() {
|
|
50
71
|
const data = require("./add-cmd");
|
|
51
72
|
_addCmd = function () {
|
|
@@ -72,6 +93,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
72
93
|
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; }
|
|
73
94
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
74
95
|
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); }
|
|
96
|
+
/**
|
|
97
|
+
* upper bound for the best-effort remote collision check. it's only an early warning, so it's
|
|
98
|
+
* better to skip it than to make the user wait on an unresponsive remote.
|
|
99
|
+
*/
|
|
100
|
+
const REMOTE_COLLISION_CHECK_TIMEOUT_MS = 5000;
|
|
101
|
+
|
|
75
102
|
/**
|
|
76
103
|
* this is for "bit add", where some data, such as "componentName" are not necessarily known
|
|
77
104
|
*/
|
|
@@ -93,7 +120,7 @@ class TrackerMain {
|
|
|
93
120
|
*/
|
|
94
121
|
async track(trackData) {
|
|
95
122
|
const defaultScope = trackData.defaultScope ? await this.addOwnerToScopeName(trackData.defaultScope) : undefined;
|
|
96
|
-
const compPath = (0,
|
|
123
|
+
const compPath = (0, _legacy2().pathNormalizeToLinux)(_path().default.isAbsolute(trackData.rootDir) ? trackData.rootDir : _path().default.join(this.workspace.path, trackData.rootDir));
|
|
97
124
|
const addComponent = new (_addComponents().default)({
|
|
98
125
|
workspace: this.workspace
|
|
99
126
|
}, {
|
|
@@ -130,8 +157,67 @@ class TrackerMain {
|
|
|
130
157
|
const addComponents = new (_addComponents().default)(addContext, addProps);
|
|
131
158
|
const addResults = await addComponents.add();
|
|
132
159
|
await this.workspace.consumer.onDestroy('add');
|
|
160
|
+
await this.warnAboutRemoteIdCollisions(addResults.addedComponents.map(added => added.id));
|
|
133
161
|
return addResults;
|
|
134
162
|
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* best-effort early warning: if any of the just-added/created components share an id with a
|
|
166
|
+
* component that already exists on the remote scope, let the user know now — before they invest
|
|
167
|
+
* work and hit a wall at export. fully non-blocking: the remote check swallows offline / no-access
|
|
168
|
+
* / scope-not-found errors, is bounded by a timeout so a stalled remote can't delay the command,
|
|
169
|
+
* and the whole method is wrapped so it can never fail an add/create.
|
|
170
|
+
*/
|
|
171
|
+
async warnAboutRemoteIdCollisions(ids) {
|
|
172
|
+
// `shouldWriteToConsole` (not `isJsonFormat`) is the signal that reflects the CLI "--json" flag.
|
|
173
|
+
if (!ids.length || !_legacy().logger.shouldWriteToConsole) return;
|
|
174
|
+
// only brand-new components can "collide" with the remote. skip already-exported ones (e.g. a
|
|
175
|
+
// re-tracked imported/exported component), where remote existence is expected, not a conflict.
|
|
176
|
+
const newIds = ids.filter(id => !this.workspace.isExported(id));
|
|
177
|
+
if (!newIds.length) return;
|
|
178
|
+
try {
|
|
179
|
+
const idsOnRemote = await this.getIdsExistingOnRemote(newIds);
|
|
180
|
+
if (!idsOnRemote.length) return;
|
|
181
|
+
const list = idsOnRemote.map(id => (0, _cli().formatItem)(id.toStringWithoutVersion())).join('\n');
|
|
182
|
+
const example = idsOnRemote[0];
|
|
183
|
+
this.logger.consoleWarning(`the following newly added component(s) already exist on the remote scope with the same id:
|
|
184
|
+
${list}
|
|
185
|
+
if you meant to work on the existing component, remove your local one and run "bit import ${example.toStringWithoutVersion()}".
|
|
186
|
+
if this is a new, unrelated component, rename yours to avoid the clash, e.g. "bit rename ${example.fullName} <new-name>" (or "bit rename ${example.fullName} ${example.fullName} --scope <other-scope>" to change only the scope).`);
|
|
187
|
+
} catch (err) {
|
|
188
|
+
// never let an early-warning break "bit add" / "bit create", but keep it diagnosable.
|
|
189
|
+
this.logger.debug(`warnAboutRemoteIdCollisions: skipping the remote-collision check, got an error: ${err}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* the remote calls have no request-level timeout of their own (and http retries for up to a
|
|
195
|
+
* minute), so a stalled remote would otherwise keep "bit add"/"bit create" waiting. race the
|
|
196
|
+
* checks against a timeout and simply skip the warning if the remote is too slow to answer.
|
|
197
|
+
*/
|
|
198
|
+
async getIdsExistingOnRemote(ids) {
|
|
199
|
+
const checkAll = (async () => {
|
|
200
|
+
// resolve the remotes once (it reads the global-remotes file from disk) and reuse for all ids.
|
|
201
|
+
const remotes = await this.workspace.scope.getRemoteScopes();
|
|
202
|
+
const results = await (0, _toolboxPromise().pMapPool)(ids, async id => (await this.workspace.scope.isComponentExistsOnRemote(id, remotes)) ? id : undefined,
|
|
203
|
+
// `remote.show()` is network I/O, so bound it by the fetch limit (not the component limit).
|
|
204
|
+
{
|
|
205
|
+
concurrency: (0, _harmonyModules().concurrentFetchLimit)()
|
|
206
|
+
});
|
|
207
|
+
return results.filter(id => Boolean(id));
|
|
208
|
+
})();
|
|
209
|
+
let timer;
|
|
210
|
+
const skipIfTooSlow = new Promise(resolve => {
|
|
211
|
+
timer = setTimeout(() => resolve([]), REMOTE_COLLISION_CHECK_TIMEOUT_MS);
|
|
212
|
+
timer.unref(); // this timer should never keep the process alive on its own
|
|
213
|
+
});
|
|
214
|
+
try {
|
|
215
|
+
return await Promise.race([checkAll, skipIfTooSlow]);
|
|
216
|
+
} finally {
|
|
217
|
+
// clear the timer when the check wins the race, so no callback stays scheduled.
|
|
218
|
+
if (timer) clearTimeout(timer);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
135
221
|
async addEnvToConfig(env, config) {
|
|
136
222
|
const userEnvId = await this.workspace.resolveComponentId(env);
|
|
137
223
|
let userEnvIdWithPotentialVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_path","_interopRequireDefault","_envs","_workspace","_logger","_legacy","_addCmd","_addComponents","_interopRequireWildcard","_tracker","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","TrackerMain","constructor","workspace","logger","track","trackData","defaultScope","addOwnerToScopeName","undefined","compPath","pathNormalizeToLinux","path","isAbsolute","rootDir","join","addComponent","AddComponents","componentPaths","id","componentName","main","mainFile","override","config","result","add","addedComponent","addedComponents","files","map","relativePath","warnings","componentId","trackMany","manyTrackData","addMultipleFromResolvedTrackData","addForCLI","addProps","OutsideWorkspaceError","addContext","shouldHandleOutOfSync","env","addEnvToConfig","addComponents","addResults","consumer","onDestroy","userEnvId","resolveComponentId","userEnvIdWithPotentialVersion","resolveEnvIdWithPotentialVersionForConfig","toStringWithoutVersion","EnvsAspect","scopeName","includes","isSelfHosted","isHostedByBit","wsDefaultScope","warn","owner","split","remotes","scope","getRemoteScopes","isHub","provider","cli","loggerMain","createLogger","TrackerAspect","trackerMain","register","AddCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["tracker.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport path from 'path';\nimport type { ComponentID } from '@teambit/component-id';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { PathOsBasedRelative, PathOsBasedAbsolute, PathLinuxRelative } from '@teambit/legacy.utils';\nimport { pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport { AddCmd } from './add-cmd';\nimport type { AddActionResults, AddContext, AddProps, Warnings } from './add-components';\nimport AddComponents, { addMultipleFromResolvedTrackData } from './add-components';\nimport { TrackerAspect } from './tracker.aspect';\n\nexport type TrackResult = { files: string[]; warnings: Warnings; componentId: ComponentID };\n\n/**\n * this is for \"bit add\", where some data, such as \"componentName\" are not necessarily known\n */\nexport type TrackData = {\n rootDir: PathOsBasedRelative | PathOsBasedAbsolute; // path relative to the workspace or absolute path\n componentName?: string; // if empty, it'll be generated from the path\n mainFile?: string; // if empty, attempts will be made to guess the best candidate\n defaultScope?: string; // can be entered as part of \"bit create\" command, helpful for out-of-sync logic\n config?: { [aspectName: string]: any }; // config specific to this component, which overrides variants of workspace.jsonc\n};\n\n/**\n * this is for commands where we know all the data to enter into .bitmap, such as defaultScope, componentName and files.\n */\nexport type ResolvedTrackData = {\n rootDir: PathLinuxRelative; // path relative to the workspace\n componentName: string;\n mainFile: string;\n files: string[]; // component files relative to the component rootDir\n defaultScope: string;\n config?: { [aspectName: string]: any }; // config specific to this component, which overrides variants of workspace.jsonc\n};\n\nexport class TrackerMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n /**\n * add a new component to the .bitmap file.\n * this method only adds the records in memory but doesn't persist to the filesystem.\n * to write the .bitmap file once completed, run \"await this.bitMap.write();\"\n */\n async track(trackData: TrackData): Promise<TrackResult> {\n const defaultScope = trackData.defaultScope ? await this.addOwnerToScopeName(trackData.defaultScope) : undefined;\n const compPath = pathNormalizeToLinux(\n path.isAbsolute(trackData.rootDir) ? trackData.rootDir : path.join(this.workspace.path, trackData.rootDir)\n );\n const addComponent = new AddComponents(\n { workspace: this.workspace },\n {\n componentPaths: [compPath],\n id: trackData.componentName,\n main: trackData.mainFile,\n override: false,\n defaultScope,\n config: trackData.config,\n }\n );\n const result = await addComponent.add();\n const addedComponent = result.addedComponents[0];\n const files = addedComponent?.files.map((f) => f.relativePath) || [];\n return { files, warnings: result.warnings, componentId: result.addedComponents[0].id };\n }\n\n async trackMany(manyTrackData: ResolvedTrackData[]): Promise<ComponentID[]> {\n return addMultipleFromResolvedTrackData(this.workspace, manyTrackData);\n }\n\n async addForCLI(addProps: AddProps): Promise<AddActionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const addContext: AddContext = { workspace: this.workspace };\n addProps.shouldHandleOutOfSync = true;\n if (addProps.env) {\n const config = {};\n await this.addEnvToConfig(addProps.env, config);\n addProps.config = config;\n }\n const addComponents = new AddComponents(addContext, addProps);\n const addResults = await addComponents.add();\n await this.workspace.consumer.onDestroy('add');\n\n return addResults;\n }\n\n async addEnvToConfig(env: string, config: { [aspectName: string]: any }) {\n const userEnvId = await this.workspace.resolveComponentId(env);\n let userEnvIdWithPotentialVersion: string;\n try {\n userEnvIdWithPotentialVersion = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(userEnvId);\n } catch {\n // the env needs to be without version\n userEnvIdWithPotentialVersion = userEnvId.toStringWithoutVersion();\n }\n config[userEnvIdWithPotentialVersion] = {};\n config[EnvsAspect.id] = config[EnvsAspect.id] || {};\n config[EnvsAspect.id].env = userEnvId.toStringWithoutVersion();\n }\n\n /**\n * scopes in bit.dev are \"owner.collection\".\n * we might have the scope-name only without the owner and we need to retrieve it from the defaultScope in the\n * workspace.jsonc file.\n *\n * @param scopeName scopeName that might not have the owner part.\n * @returns full scope name\n */\n private async addOwnerToScopeName(scopeName: string): Promise<string> {\n if (scopeName.includes('.')) return scopeName; // it has owner.\n const isSelfHosted = !(await this.isHostedByBit(scopeName));\n if (isSelfHosted) return scopeName;\n const wsDefaultScope = this.workspace.defaultScope;\n if (!wsDefaultScope.includes('.')) {\n this.logger.warn(`the entered scope ${scopeName} has no owner nor the defaultScope in workspace.jsonc`);\n // it's possible that the user entered a non-exist scope just to test the command and will change it later.\n return scopeName;\n }\n const [owner] = wsDefaultScope.split('.');\n return `${owner}.${scopeName}`;\n }\n\n /**\n * whether a scope is hosted by Bit cloud.\n * otherwise, it is self-hosted\n */\n private async isHostedByBit(scopeName: string): Promise<boolean> {\n const remotes = await this.workspace.scope.getRemoteScopes();\n return remotes.isHub(scopeName);\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, loggerMain]: [CLIMain, Workspace, LoggerMain]) {\n const logger = loggerMain.createLogger(TrackerAspect.id);\n const trackerMain = new TrackerMain(workspace, logger);\n cli.register(new AddCmd(trackerMain));\n return trackerMain;\n }\n}\n\nTrackerAspect.addRuntime(TrackerMain);\n\nexport default TrackerMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,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AC,CAACC,GAAG,EAAEhE,SAAS,EAAEiE,UAAU,CAAmC,EAAE;IACpF,MAAMhE,MAAM,GAAGgE,UAAU,CAACC,YAAY,CAACC,wBAAa,CAACnD,EAAE,CAAC;IACxD,MAAMoD,WAAW,GAAG,IAAItE,WAAW,CAACE,SAAS,EAAEC,MAAM,CAAC;IACtD+D,GAAG,CAACK,QAAQ,CAAC,KAAIC,gBAAM,EAACF,WAAW,CAAC,CAAC;IACrC,OAAOA,WAAW;EACpB;AACF;AAACG,OAAA,CAAAzE,WAAA,GAAAA,WAAA;AAAAZ,eAAA,CA3GYY,WAAW,WAkGP,EAAE;AAAAZ,eAAA,CAlGNY,WAAW,kBAmGA,CAAC0E,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,CAAC;AAAAxF,eAAA,CAnGrDY,WAAW,aAoGL6E,kBAAW;AAS9BR,wBAAa,CAACS,UAAU,CAAC9E,WAAW,CAAC;AAAC,IAAA+E,QAAA,GAAAN,OAAA,CAAA9F,OAAA,GAEvBqB,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_toolboxPromise","_harmonyModules","_path","_interopRequireDefault","_envs","_workspace","_logger","_legacy","_legacy2","_addCmd","_addComponents","_interopRequireWildcard","_tracker","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","REMOTE_COLLISION_CHECK_TIMEOUT_MS","TrackerMain","constructor","workspace","logger","track","trackData","defaultScope","addOwnerToScopeName","undefined","compPath","pathNormalizeToLinux","path","isAbsolute","rootDir","join","addComponent","AddComponents","componentPaths","id","componentName","main","mainFile","override","config","result","add","addedComponent","addedComponents","files","map","relativePath","warnings","componentId","trackMany","manyTrackData","addMultipleFromResolvedTrackData","addForCLI","addProps","OutsideWorkspaceError","addContext","shouldHandleOutOfSync","env","addEnvToConfig","addComponents","addResults","consumer","onDestroy","warnAboutRemoteIdCollisions","added","ids","length","legacyLogger","shouldWriteToConsole","newIds","filter","isExported","idsOnRemote","getIdsExistingOnRemote","list","formatItem","toStringWithoutVersion","example","consoleWarning","fullName","err","debug","checkAll","remotes","scope","getRemoteScopes","results","pMapPool","isComponentExistsOnRemote","concurrency","concurrentFetchLimit","Boolean","timer","skipIfTooSlow","Promise","resolve","setTimeout","unref","race","clearTimeout","userEnvId","resolveComponentId","userEnvIdWithPotentialVersion","resolveEnvIdWithPotentialVersionForConfig","EnvsAspect","scopeName","includes","isSelfHosted","isHostedByBit","wsDefaultScope","warn","owner","split","isHub","provider","cli","loggerMain","createLogger","TrackerAspect","trackerMain","register","AddCmd","exports","CLIAspect","WorkspaceAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["tracker.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime, formatItem } from '@teambit/cli';\nimport { pMapPool } from '@teambit/toolbox.promise.map-pool';\nimport { concurrentFetchLimit } from '@teambit/harmony.modules.concurrency';\nimport path from 'path';\nimport type { ComponentID } from '@teambit/component-id';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { logger as legacyLogger } from '@teambit/legacy.logger';\nimport type { PathOsBasedRelative, PathOsBasedAbsolute, PathLinuxRelative } from '@teambit/legacy.utils';\nimport { pathNormalizeToLinux } from '@teambit/legacy.utils';\nimport { AddCmd } from './add-cmd';\nimport type { AddActionResults, AddContext, AddProps, Warnings } from './add-components';\nimport AddComponents, { addMultipleFromResolvedTrackData } from './add-components';\nimport { TrackerAspect } from './tracker.aspect';\n\nexport type TrackResult = { files: string[]; warnings: Warnings; componentId: ComponentID };\n\n/**\n * upper bound for the best-effort remote collision check. it's only an early warning, so it's\n * better to skip it than to make the user wait on an unresponsive remote.\n */\nconst REMOTE_COLLISION_CHECK_TIMEOUT_MS = 5000;\n\n/**\n * this is for \"bit add\", where some data, such as \"componentName\" are not necessarily known\n */\nexport type TrackData = {\n rootDir: PathOsBasedRelative | PathOsBasedAbsolute; // path relative to the workspace or absolute path\n componentName?: string; // if empty, it'll be generated from the path\n mainFile?: string; // if empty, attempts will be made to guess the best candidate\n defaultScope?: string; // can be entered as part of \"bit create\" command, helpful for out-of-sync logic\n config?: { [aspectName: string]: any }; // config specific to this component, which overrides variants of workspace.jsonc\n};\n\n/**\n * this is for commands where we know all the data to enter into .bitmap, such as defaultScope, componentName and files.\n */\nexport type ResolvedTrackData = {\n rootDir: PathLinuxRelative; // path relative to the workspace\n componentName: string;\n mainFile: string;\n files: string[]; // component files relative to the component rootDir\n defaultScope: string;\n config?: { [aspectName: string]: any }; // config specific to this component, which overrides variants of workspace.jsonc\n};\n\nexport class TrackerMain {\n constructor(\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n /**\n * add a new component to the .bitmap file.\n * this method only adds the records in memory but doesn't persist to the filesystem.\n * to write the .bitmap file once completed, run \"await this.bitMap.write();\"\n */\n async track(trackData: TrackData): Promise<TrackResult> {\n const defaultScope = trackData.defaultScope ? await this.addOwnerToScopeName(trackData.defaultScope) : undefined;\n const compPath = pathNormalizeToLinux(\n path.isAbsolute(trackData.rootDir) ? trackData.rootDir : path.join(this.workspace.path, trackData.rootDir)\n );\n const addComponent = new AddComponents(\n { workspace: this.workspace },\n {\n componentPaths: [compPath],\n id: trackData.componentName,\n main: trackData.mainFile,\n override: false,\n defaultScope,\n config: trackData.config,\n }\n );\n const result = await addComponent.add();\n const addedComponent = result.addedComponents[0];\n const files = addedComponent?.files.map((f) => f.relativePath) || [];\n return { files, warnings: result.warnings, componentId: result.addedComponents[0].id };\n }\n\n async trackMany(manyTrackData: ResolvedTrackData[]): Promise<ComponentID[]> {\n return addMultipleFromResolvedTrackData(this.workspace, manyTrackData);\n }\n\n async addForCLI(addProps: AddProps): Promise<AddActionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const addContext: AddContext = { workspace: this.workspace };\n addProps.shouldHandleOutOfSync = true;\n if (addProps.env) {\n const config = {};\n await this.addEnvToConfig(addProps.env, config);\n addProps.config = config;\n }\n const addComponents = new AddComponents(addContext, addProps);\n const addResults = await addComponents.add();\n await this.workspace.consumer.onDestroy('add');\n\n await this.warnAboutRemoteIdCollisions(addResults.addedComponents.map((added) => added.id));\n\n return addResults;\n }\n\n /**\n * best-effort early warning: if any of the just-added/created components share an id with a\n * component that already exists on the remote scope, let the user know now — before they invest\n * work and hit a wall at export. fully non-blocking: the remote check swallows offline / no-access\n * / scope-not-found errors, is bounded by a timeout so a stalled remote can't delay the command,\n * and the whole method is wrapped so it can never fail an add/create.\n */\n async warnAboutRemoteIdCollisions(ids: ComponentID[]): Promise<void> {\n // `shouldWriteToConsole` (not `isJsonFormat`) is the signal that reflects the CLI \"--json\" flag.\n if (!ids.length || !legacyLogger.shouldWriteToConsole) return;\n // only brand-new components can \"collide\" with the remote. skip already-exported ones (e.g. a\n // re-tracked imported/exported component), where remote existence is expected, not a conflict.\n const newIds = ids.filter((id) => !this.workspace.isExported(id));\n if (!newIds.length) return;\n try {\n const idsOnRemote = await this.getIdsExistingOnRemote(newIds);\n if (!idsOnRemote.length) return;\n const list = idsOnRemote.map((id) => formatItem(id.toStringWithoutVersion())).join('\\n');\n const example = idsOnRemote[0];\n this.logger\n .consoleWarning(`the following newly added component(s) already exist on the remote scope with the same id:\n${list}\nif you meant to work on the existing component, remove your local one and run \"bit import ${example.toStringWithoutVersion()}\".\nif this is a new, unrelated component, rename yours to avoid the clash, e.g. \"bit rename ${example.fullName} <new-name>\" (or \"bit rename ${example.fullName} ${example.fullName} --scope <other-scope>\" to change only the scope).`);\n } catch (err) {\n // never let an early-warning break \"bit add\" / \"bit create\", but keep it diagnosable.\n this.logger.debug(`warnAboutRemoteIdCollisions: skipping the remote-collision check, got an error: ${err}`);\n }\n }\n\n /**\n * the remote calls have no request-level timeout of their own (and http retries for up to a\n * minute), so a stalled remote would otherwise keep \"bit add\"/\"bit create\" waiting. race the\n * checks against a timeout and simply skip the warning if the remote is too slow to answer.\n */\n private async getIdsExistingOnRemote(ids: ComponentID[]): Promise<ComponentID[]> {\n const checkAll = (async () => {\n // resolve the remotes once (it reads the global-remotes file from disk) and reuse for all ids.\n const remotes = await this.workspace.scope.getRemoteScopes();\n const results = await pMapPool(\n ids,\n async (id) => ((await this.workspace.scope.isComponentExistsOnRemote(id, remotes)) ? id : undefined),\n // `remote.show()` is network I/O, so bound it by the fetch limit (not the component limit).\n { concurrency: concurrentFetchLimit() }\n );\n return results.filter((id): id is ComponentID => Boolean(id));\n })();\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const skipIfTooSlow = new Promise<ComponentID[]>((resolve) => {\n timer = setTimeout(() => resolve([]), REMOTE_COLLISION_CHECK_TIMEOUT_MS);\n timer.unref(); // this timer should never keep the process alive on its own\n });\n\n try {\n return await Promise.race([checkAll, skipIfTooSlow]);\n } finally {\n // clear the timer when the check wins the race, so no callback stays scheduled.\n if (timer) clearTimeout(timer);\n }\n }\n\n async addEnvToConfig(env: string, config: { [aspectName: string]: any }) {\n const userEnvId = await this.workspace.resolveComponentId(env);\n let userEnvIdWithPotentialVersion: string;\n try {\n userEnvIdWithPotentialVersion = await this.workspace.resolveEnvIdWithPotentialVersionForConfig(userEnvId);\n } catch {\n // the env needs to be without version\n userEnvIdWithPotentialVersion = userEnvId.toStringWithoutVersion();\n }\n config[userEnvIdWithPotentialVersion] = {};\n config[EnvsAspect.id] = config[EnvsAspect.id] || {};\n config[EnvsAspect.id].env = userEnvId.toStringWithoutVersion();\n }\n\n /**\n * scopes in bit.dev are \"owner.collection\".\n * we might have the scope-name only without the owner and we need to retrieve it from the defaultScope in the\n * workspace.jsonc file.\n *\n * @param scopeName scopeName that might not have the owner part.\n * @returns full scope name\n */\n private async addOwnerToScopeName(scopeName: string): Promise<string> {\n if (scopeName.includes('.')) return scopeName; // it has owner.\n const isSelfHosted = !(await this.isHostedByBit(scopeName));\n if (isSelfHosted) return scopeName;\n const wsDefaultScope = this.workspace.defaultScope;\n if (!wsDefaultScope.includes('.')) {\n this.logger.warn(`the entered scope ${scopeName} has no owner nor the defaultScope in workspace.jsonc`);\n // it's possible that the user entered a non-exist scope just to test the command and will change it later.\n return scopeName;\n }\n const [owner] = wsDefaultScope.split('.');\n return `${owner}.${scopeName}`;\n }\n\n /**\n * whether a scope is hosted by Bit cloud.\n * otherwise, it is self-hosted\n */\n private async isHostedByBit(scopeName: string): Promise<boolean> {\n const remotes = await this.workspace.scope.getRemoteScopes();\n return remotes.isHub(scopeName);\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, loggerMain]: [CLIMain, Workspace, LoggerMain]) {\n const logger = loggerMain.createLogger(TrackerAspect.id);\n const trackerMain = new TrackerMain(workspace, logger);\n cli.register(new AddCmd(trackerMain));\n return trackerMain;\n }\n}\n\nTrackerAspect.addRuntime(TrackerMain);\n\nexport default TrackerMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,KAAA,YAAA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,CAAC8B,KAAK,CAACR,SAAS,CAAC;EACjC;EAKA,aAAaS,QAAQA,CAAC,CAACC,GAAG,EAAEjG,SAAS,EAAEkG,UAAU,CAAmC,EAAE;IACpF,MAAMjG,MAAM,GAAGiG,UAAU,CAACC,YAAY,CAACC,wBAAa,CAACpF,EAAE,CAAC;IACxD,MAAMqF,WAAW,GAAG,IAAIvG,WAAW,CAACE,SAAS,EAAEC,MAAM,CAAC;IACtDgG,GAAG,CAACK,QAAQ,CAAC,KAAIC,gBAAM,EAACF,WAAW,CAAC,CAAC;IACrC,OAAOA,WAAW;EACpB;AACF;AAACG,OAAA,CAAA1G,WAAA,GAAAA,WAAA;AAAAb,eAAA,CA3KYa,WAAW,WAkKP,EAAE;AAAAb,eAAA,CAlKNa,WAAW,kBAmKA,CAAC2G,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,CAAC;AAAA1H,eAAA,CAnKrDa,WAAW,aAoKL8G,kBAAW;AAS9BR,wBAAa,CAACS,UAAU,CAAC/G,WAAW,CAAC;AAAC,IAAAgH,QAAA,GAAAN,OAAA,CAAAhI,OAAA,GAEvBsB,WAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/tracker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1066",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/tracker",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "tracker",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1066"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"string-format": "0.5.0",
|
|
20
20
|
"@teambit/bit-error": "0.0.404",
|
|
21
|
-
"@teambit/cli": "0.0.1352",
|
|
22
21
|
"@teambit/legacy.utils": "0.0.42",
|
|
23
22
|
"@teambit/component-id": "1.2.4",
|
|
24
23
|
"@teambit/legacy-bit-id": "1.1.3",
|
|
@@ -29,15 +28,18 @@
|
|
|
29
28
|
"@teambit/legacy.logger": "0.0.49",
|
|
30
29
|
"@teambit/workspace.modules.node-modules-linker": "0.0.368",
|
|
31
30
|
"@teambit/harmony": "0.4.12",
|
|
32
|
-
"@teambit/
|
|
33
|
-
"@teambit/
|
|
34
|
-
"@teambit/
|
|
31
|
+
"@teambit/harmony.modules.concurrency": "0.0.35",
|
|
32
|
+
"@teambit/toolbox.promise.map-pool": "0.0.17",
|
|
33
|
+
"@teambit/cli": "0.0.1353",
|
|
34
|
+
"@teambit/workspace": "1.0.1066",
|
|
35
|
+
"@teambit/envs": "1.0.1066",
|
|
36
|
+
"@teambit/logger": "0.0.1446"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@types/fs-extra": "9.0.7",
|
|
38
40
|
"@types/lodash": "4.14.165",
|
|
39
41
|
"@types/mocha": "9.1.0",
|
|
40
|
-
"@teambit/harmony.envs.core-aspect-env": "1.0.
|
|
42
|
+
"@teambit/harmony.envs.core-aspect-env": "1.0.2"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {},
|
|
43
45
|
"license": "Apache-2.0",
|
|
File without changes
|