@teambit/dependencies 1.0.176 → 1.0.178
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/artifacts/__bit_junit.xml +4 -4
- package/artifacts/schema.json +454 -304
- package/dependencies-loader/auto-detect-deps.ts +37 -17
- package/dist/dependencies-cmd.d.ts +14 -0
- package/dist/dependencies-cmd.js +23 -1
- package/dist/dependencies-cmd.js.map +1 -1
- package/dist/dependencies-loader/auto-detect-deps.js +34 -9
- package/dist/dependencies-loader/auto-detect-deps.js.map +1 -1
- package/dist/dependencies.main.runtime.d.ts +1 -0
- package/dist/dependencies.main.runtime.js +14 -1
- package/dist/dependencies.main.runtime.js.map +1 -1
- package/package.json +9 -9
- /package/dist/{preview-1709090190973.js → preview-1709263126667.js} +0 -0
|
@@ -52,6 +52,12 @@ export type DebugComponentsDependency = {
|
|
|
52
52
|
packageName?: string;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
type PushToDepsArrayOpts = {
|
|
56
|
+
fileType: FileType;
|
|
57
|
+
depDebug: DebugComponentsDependency;
|
|
58
|
+
isPeer?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
55
61
|
export class AutoDetectDeps {
|
|
56
62
|
componentId: ComponentID;
|
|
57
63
|
componentMap: ComponentMap;
|
|
@@ -348,7 +354,7 @@ export class AutoDetectDeps {
|
|
|
348
354
|
id: currentComponentsDeps.id,
|
|
349
355
|
importSource,
|
|
350
356
|
};
|
|
351
|
-
this.pushToDependenciesArray(currentComponentsDeps, fileType, depDebug);
|
|
357
|
+
this.pushToDependenciesArray(currentComponentsDeps, { fileType, depDebug });
|
|
352
358
|
}
|
|
353
359
|
return false;
|
|
354
360
|
}
|
|
@@ -399,8 +405,28 @@ export class AutoDetectDeps {
|
|
|
399
405
|
return;
|
|
400
406
|
}
|
|
401
407
|
this.addImportNonMainIssueIfNeeded(originFile, compDep);
|
|
402
|
-
const
|
|
403
|
-
|
|
408
|
+
const isPeer = compDep.packageJsonContent?.bit?.peer;
|
|
409
|
+
let peerVersionRange: string | undefined;
|
|
410
|
+
if (isPeer) {
|
|
411
|
+
const defaultPeerRange = compDep.packageJsonContent?.bit?.defaultPeerRange;
|
|
412
|
+
if (!defaultPeerRange) {
|
|
413
|
+
peerVersionRange = '*';
|
|
414
|
+
} else if (['~', '^', '>='].includes(defaultPeerRange)) {
|
|
415
|
+
if (semver.valid(compDep.concreteVersion)) {
|
|
416
|
+
peerVersionRange = `${defaultPeerRange}${compDep.concreteVersion}`;
|
|
417
|
+
} else {
|
|
418
|
+
peerVersionRange = `${defaultPeerRange}0.0.0-${compDep.concreteVersion}`;
|
|
419
|
+
}
|
|
420
|
+
} else {
|
|
421
|
+
peerVersionRange = defaultPeerRange;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
const currentComponentsDeps = new Dependency(existingId, [], compDep.name, peerVersionRange);
|
|
425
|
+
this._pushToDependenciesIfNotExist(currentComponentsDeps, {
|
|
426
|
+
fileType,
|
|
427
|
+
depDebug,
|
|
428
|
+
isPeer,
|
|
429
|
+
});
|
|
404
430
|
});
|
|
405
431
|
}
|
|
406
432
|
|
|
@@ -578,34 +604,28 @@ export class AutoDetectDeps {
|
|
|
578
604
|
this.debugDependenciesData.unidentifiedPackages = unidentifiedPackages;
|
|
579
605
|
}
|
|
580
606
|
|
|
581
|
-
private _pushToDependenciesIfNotExist(
|
|
582
|
-
dependency: Dependency,
|
|
583
|
-
fileType: FileType,
|
|
584
|
-
depDebug: DebugComponentsDependency
|
|
585
|
-
) {
|
|
607
|
+
private _pushToDependenciesIfNotExist(dependency: Dependency, opts: PushToDepsArrayOpts) {
|
|
586
608
|
const existingDependency = this.getExistingDependency(this.allDependencies.dependencies, dependency.id);
|
|
587
609
|
const existingDevDependency = this.getExistingDependency(this.allDependencies.devDependencies, dependency.id);
|
|
588
610
|
// no need to enter dev dependency to devDependencies if it exists already in dependencies
|
|
589
|
-
if (existingDependency || (existingDevDependency && fileType.isTestFile)) {
|
|
611
|
+
if (existingDependency || (existingDevDependency && opts.fileType.isTestFile)) {
|
|
590
612
|
return;
|
|
591
613
|
}
|
|
592
614
|
// at this point, either, it doesn't exist at all and should be entered.
|
|
593
615
|
// or it exists in devDependencies but now it comes from non-dev file, which should be entered
|
|
594
616
|
// as non-dev.
|
|
595
|
-
this.pushToDependenciesArray(dependency,
|
|
617
|
+
this.pushToDependenciesArray(dependency, opts);
|
|
596
618
|
}
|
|
597
619
|
|
|
598
|
-
private pushToDependenciesArray(
|
|
599
|
-
|
|
600
|
-
fileType: FileType,
|
|
601
|
-
depDebug: DebugComponentsDependency
|
|
602
|
-
) {
|
|
603
|
-
if (fileType.isTestFile) {
|
|
620
|
+
private pushToDependenciesArray(currentComponentsDeps: Dependency, opts: PushToDepsArrayOpts) {
|
|
621
|
+
if (opts.fileType.isTestFile) {
|
|
604
622
|
this.allDependencies.devDependencies.push(currentComponentsDeps);
|
|
623
|
+
} else if (opts.isPeer) {
|
|
624
|
+
this.allDependencies.peerDependencies.push(currentComponentsDeps);
|
|
605
625
|
} else {
|
|
606
626
|
this.allDependencies.dependencies.push(currentComponentsDeps);
|
|
607
627
|
}
|
|
608
|
-
this.debugDependenciesData.components.push(depDebug);
|
|
628
|
+
this.debugDependenciesData.components.push(opts.depDebug);
|
|
609
629
|
}
|
|
610
630
|
|
|
611
631
|
private getExistingDependency(dependencies: Dependency[], id: ComponentID): Dependency | null | undefined {
|
|
@@ -152,4 +152,18 @@ export declare class DependenciesCmd implements Command {
|
|
|
152
152
|
helpUrl: string;
|
|
153
153
|
report([unrecognizedSubcommand]: [string]): Promise<string>;
|
|
154
154
|
}
|
|
155
|
+
export declare class SetPeerCmd implements Command {
|
|
156
|
+
private deps;
|
|
157
|
+
name: string;
|
|
158
|
+
arguments: {
|
|
159
|
+
name: string;
|
|
160
|
+
description: string;
|
|
161
|
+
}[];
|
|
162
|
+
group: string;
|
|
163
|
+
description: string;
|
|
164
|
+
alias: string;
|
|
165
|
+
options: never[];
|
|
166
|
+
constructor(deps: DependenciesMain);
|
|
167
|
+
report([componentId, range]: [string, string]): Promise<string>;
|
|
168
|
+
}
|
|
155
169
|
export {};
|
package/dist/dependencies-cmd.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WhyCmd = exports.DependenciesUsageCmd = exports.DependenciesUnsetCmd = exports.DependenciesSetCmd = exports.DependenciesResetCmd = exports.DependenciesRemoveCmd = exports.DependenciesGetCmd = exports.DependenciesEjectCmd = exports.DependenciesDebugCmd = exports.DependenciesCmd = exports.DependenciesBlameCmd = void 0;
|
|
6
|
+
exports.WhyCmd = exports.SetPeerCmd = exports.DependenciesUsageCmd = exports.DependenciesUnsetCmd = exports.DependenciesSetCmd = exports.DependenciesResetCmd = exports.DependenciesRemoveCmd = exports.DependenciesGetCmd = exports.DependenciesEjectCmd = exports.DependenciesDebugCmd = exports.DependenciesCmd = exports.DependenciesBlameCmd = void 0;
|
|
7
7
|
function _cliTable() {
|
|
8
8
|
const data = _interopRequireDefault(require("cli-table"));
|
|
9
9
|
_cliTable = function () {
|
|
@@ -334,5 +334,27 @@ class DependenciesCmd {
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
exports.DependenciesCmd = DependenciesCmd;
|
|
337
|
+
class SetPeerCmd {
|
|
338
|
+
constructor(deps) {
|
|
339
|
+
this.deps = deps;
|
|
340
|
+
_defineProperty(this, "name", 'set-peer <component-id> <range>');
|
|
341
|
+
_defineProperty(this, "arguments", [{
|
|
342
|
+
name: 'component-id',
|
|
343
|
+
description: 'the component to set as always peer'
|
|
344
|
+
}, {
|
|
345
|
+
name: 'range',
|
|
346
|
+
description: 'the default range to use for the componnent, when added to peerDependencies'
|
|
347
|
+
}]);
|
|
348
|
+
_defineProperty(this, "group", 'info');
|
|
349
|
+
_defineProperty(this, "description", 'set a component as always peer');
|
|
350
|
+
_defineProperty(this, "alias", '');
|
|
351
|
+
_defineProperty(this, "options", []);
|
|
352
|
+
}
|
|
353
|
+
async report([componentId, range]) {
|
|
354
|
+
await this.deps.setPeer(componentId, range != null ? range.toString() : range);
|
|
355
|
+
return `${_chalk().default.green('successfully marked the component as a peer component')}`;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
exports.SetPeerCmd = SetPeerCmd;
|
|
337
359
|
|
|
338
360
|
//# sourceMappingURL=dependencies-cmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cliTable","data","_interopRequireDefault","require","_chalk","_archy","_componentTemplate","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","DependenciesGetCmd","constructor","deps","name","description","report","id","tree","scope","results","getDependencies","idWithVersion","getGraphAsTree","graph","graphAsTree","getDependenciesAsObjectTree","toString","archy","err","chalk","red","graphTree","depsInfo","getDependenciesInfo","length","toStringWithoutVersion","depsTable","generateDependenciesInfoTable","exports","DependenciesDebugCmd","debugDependencies","JSON","stringify","undefined","DependenciesSetCmd","COMPONENT_PATTERN_HELP","pattern","packages","setDepsFlags","changedComps","addedPackages","setDependency","green","bold","join","DependenciesRemoveCmd","removeDepsFlags","removeDependency","yellow","output","map","removedPackages","underline","DependenciesUnsetCmd","DependenciesResetCmd","reset","comps","DependenciesEjectCmd","eject","DependenciesBlameCmd","compName","depName","blame","table","Table","chars","top","bottom","left","mid","right","middle","style","snap","tag","author","date","message","version","push","DependenciesUsageCmd","options","deepUsageResult","usageDeep","usage","keys","compIdStr","WhyCmd","args","DependenciesCmd","unrecognizedSubcommand"],"sources":["dependencies-cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport Table from 'cli-table';\nimport chalk from 'chalk';\nimport archy from 'archy';\nimport { generateDependenciesInfoTable } from '@teambit/legacy/dist/cli/templates/component-template';\nimport { ComponentIdGraph } from '@teambit/graph';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { DependenciesMain } from './dependencies.main.runtime';\n\ntype GetDependenciesFlags = {\n tree: boolean;\n scope?: boolean;\n};\n\nexport type SetDependenciesFlags = {\n dev?: boolean;\n optional?: boolean;\n peer?: boolean;\n};\n\nexport type RemoveDependenciesFlags = SetDependenciesFlags;\n\nexport class DependenciesGetCmd implements Command {\n name = 'get <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n group = 'info';\n description = 'show direct and indirect dependencies of the given component';\n alias = '';\n options = [\n ['', 'scope', 'get the data from the scope instead of the workspace'],\n ['t', 'tree', 'EXPERIMENTAL. render dependencies as a tree, similar to \"npm ls\"'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([id]: [string], { tree = false, scope = false }: GetDependenciesFlags) {\n const results = await this.deps.getDependencies(id, scope);\n\n if (tree) {\n const idWithVersion = results.id;\n const getGraphAsTree = (graph: ComponentIdGraph) => {\n try {\n const graphAsTree = graph.getDependenciesAsObjectTree(idWithVersion.toString());\n return archy(graphAsTree);\n } catch (err: any) {\n if (err.constructor.name === 'RangeError') {\n return `${chalk.red(\n 'unable to generate a tree representation, the graph is too big or has cyclic dependencies'\n )}`;\n }\n throw err;\n }\n };\n const graphTree = getGraphAsTree(results.graph);\n return graphTree;\n }\n const depsInfo = results.graph.getDependenciesInfo(results.id);\n if (!depsInfo.length) {\n return `no dependencies found for ${results.id.toString()}.\ntry running \"bit cat-component ${results.id.toStringWithoutVersion()}\" to see whether the component/version exists locally`;\n }\n\n const depsTable = generateDependenciesInfoTable(depsInfo, results.id);\n return `${depsTable || '<none>'}`;\n }\n}\n\nexport class DependenciesDebugCmd implements Command {\n name = 'debug <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n group = 'info';\n description = 'show the immediate dependencies and how their versions were determined';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([id]: [string]) {\n const results = await this.deps.debugDependencies(id);\n return JSON.stringify(results, undefined, 4);\n }\n}\n\nexport class DependenciesSetCmd implements Command {\n name = 'set <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will be resolved to the latest',\n },\n ];\n group = 'info';\n description = 'set a dependency to component(s)';\n alias = '';\n options = [\n ['d', 'dev', 'add to the devDependencies'],\n ['o', 'optional', 'add to the optionalDependencies'],\n ['p', 'peer', 'add to the peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], setDepsFlags: SetDependenciesFlags) {\n const { changedComps, addedPackages } = await this.deps.setDependency(pattern, packages, setDepsFlags);\n\n return `${chalk.green('successfully updated dependencies')}\n${chalk.bold('changed components')}\n${changedComps.join('\\n')}\n\n${chalk.bold('added packages')}\n${JSON.stringify(addedPackages, undefined, 4)}`;\n }\n}\n\nexport class DependenciesRemoveCmd implements Command {\n name = 'remove <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will remove all lodash instances of any version',\n },\n ];\n group = 'info';\n description = 'remove a dependency to component(s)';\n alias = '';\n options = [\n ['d', 'dev', 'remove from devDependencies'],\n ['p', 'peer', 'remove from peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], removeDepsFlags: RemoveDependenciesFlags) {\n const results = await this.deps.removeDependency(pattern, packages, removeDepsFlags);\n if (!results.length) {\n return chalk.yellow('the specified component-pattern do not use the entered packages. nothing to remove');\n }\n\n const output = results\n .map(({ id, removedPackages }) => `${chalk.underline(id.toString())}\\n${removedPackages.join('\\n')}`)\n .join('\\n\\n');\n\n return `${chalk.green('successfully removed dependencies')}\\n${output}`;\n }\n}\n\nexport class DependenciesUnsetCmd implements Command {\n name = 'unset <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will remove all lodash instances of any version',\n },\n ];\n group = 'info';\n description = 'unset a dependency to component(s) that was previously set by \"bit deps set\"';\n alias = '';\n options = [\n ['d', 'dev', 'unset from devDependencies'],\n ['p', 'peer', 'unset from peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], removeDepsFlags: RemoveDependenciesFlags) {\n const results = await this.deps.removeDependency(pattern, packages, removeDepsFlags, true);\n if (!results.length) {\n return chalk.yellow('the specified component-pattern do not use the entered packages. nothing to unset');\n }\n\n const output = results\n .map(({ id, removedPackages }) => `${chalk.underline(id.toString())}\\n${removedPackages.join('\\n')}`)\n .join('\\n\\n');\n\n return `${chalk.green('successfully unset dependencies')}\\n${output}`;\n }\n}\n\nexport class DependenciesResetCmd implements Command {\n name = 'reset <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'info';\n description = 'reset dependencies to the default values (revert any previously \"bit deps set\")';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern]: [string]) {\n const results = await this.deps.reset(pattern);\n const comps = results.map((id) => id.toString());\n\n return `${chalk.green('successfully reset dependencies for the following component(s)')}\\n${comps}`;\n }\n}\n\nexport class DependenciesEjectCmd implements Command {\n name = 'eject <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'info';\n description = 'write dependencies that were previously set via \"bit deps set\" into .bitmap';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern]: [string]) {\n const results = await this.deps.eject(pattern);\n const comps = results.map((id) => id.toString());\n\n return `${chalk.green('successfully ejected dependencies for the following component(s)')}\\n${comps}`;\n }\n}\n\nexport class DependenciesBlameCmd implements Command {\n name = 'blame <component-name> <dependency-name>';\n arguments = [\n {\n name: 'dependency-name',\n description: 'package-name. for components, you can use either component-id or package-name',\n },\n ];\n group = 'info';\n description = 'EXPERIMENTAL. find out which snap/tag changed a dependency version';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([compName, depName]: [string, string]) {\n const results = await this.deps.blame(compName, depName);\n if (!results.length) {\n return chalk.yellow(`the specified component ${compName} does not use the entered dependency ${depName}`);\n }\n // table with no style and no borders, just to align the columns.\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n });\n\n results.map(({ snap, tag, author, date, message, version }) =>\n table.push([snap, tag || '', author, date, message, version])\n );\n\n return table.toString();\n }\n}\n\ntype DependenciesUsageCmdOptions = {\n depth?: number;\n};\n\nexport class DependenciesUsageCmd implements Command {\n name = 'usage <dependency-name>';\n arguments = [\n {\n name: 'dependency-name',\n description:\n 'package-name. for components, you can use either component-id or package-name. if version is specified, it will search for the exact version',\n },\n ];\n group = 'info';\n description = 'EXPERIMENTAL. find components that use the specified dependency';\n alias = '';\n options = [['', 'depth <number>', 'max display depth of the dependency graph']] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([depName]: [string], options: DependenciesUsageCmdOptions) {\n const deepUsageResult = await this.deps.usageDeep(depName, options);\n if (deepUsageResult != null) return deepUsageResult;\n const results = await this.deps.usage(depName);\n if (!Object.keys(results).length) {\n return chalk.yellow(`the specified dependency ${depName} is not used by any component`);\n }\n return Object.keys(results)\n .map((compIdStr) => `${chalk.bold(compIdStr)} (using dep in version ${results[compIdStr]})`)\n .join('\\n');\n }\n}\n\nexport class WhyCmd extends DependenciesUsageCmd {\n name = 'why <dependency-name>';\n}\n\nexport class DependenciesCmd implements Command {\n name = 'deps <sub-command>';\n alias = 'dependencies';\n description = 'manage dependencies';\n options = [];\n group = 'info';\n commands: Command[] = [];\n helpUrl = 'reference/dependencies/configuring-dependencies';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"dependencies\", please run \"bit dependencies --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwE,SAAAC,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,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,MAAMA,CAAC,CAACqF,sBAAsB,CAAW,EAAE;IAC/C,OAAOvE,gBAAK,CAACC,GAAG,CACb,IAAGsE,sBAAuB,uGAC7B,CAAC;EACH;AACF;AAAC9D,OAAA,CAAA6D,eAAA,GAAAA,eAAA"}
|
|
1
|
+
{"version":3,"names":["_cliTable","data","_interopRequireDefault","require","_chalk","_archy","_componentTemplate","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","DependenciesGetCmd","constructor","deps","name","description","report","id","tree","scope","results","getDependencies","idWithVersion","getGraphAsTree","graph","graphAsTree","getDependenciesAsObjectTree","toString","archy","err","chalk","red","graphTree","depsInfo","getDependenciesInfo","length","toStringWithoutVersion","depsTable","generateDependenciesInfoTable","exports","DependenciesDebugCmd","debugDependencies","JSON","stringify","undefined","DependenciesSetCmd","COMPONENT_PATTERN_HELP","pattern","packages","setDepsFlags","changedComps","addedPackages","setDependency","green","bold","join","DependenciesRemoveCmd","removeDepsFlags","removeDependency","yellow","output","map","removedPackages","underline","DependenciesUnsetCmd","DependenciesResetCmd","reset","comps","DependenciesEjectCmd","eject","DependenciesBlameCmd","compName","depName","blame","table","Table","chars","top","bottom","left","mid","right","middle","style","snap","tag","author","date","message","version","push","DependenciesUsageCmd","options","deepUsageResult","usageDeep","usage","keys","compIdStr","WhyCmd","args","DependenciesCmd","unrecognizedSubcommand","SetPeerCmd","componentId","range","setPeer"],"sources":["dependencies-cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { Command, CommandOptions } from '@teambit/cli';\nimport Table from 'cli-table';\nimport chalk from 'chalk';\nimport archy from 'archy';\nimport { generateDependenciesInfoTable } from '@teambit/legacy/dist/cli/templates/component-template';\nimport { ComponentIdGraph } from '@teambit/graph';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { DependenciesMain } from './dependencies.main.runtime';\n\ntype GetDependenciesFlags = {\n tree: boolean;\n scope?: boolean;\n};\n\nexport type SetDependenciesFlags = {\n dev?: boolean;\n optional?: boolean;\n peer?: boolean;\n};\n\nexport type RemoveDependenciesFlags = SetDependenciesFlags;\n\nexport class DependenciesGetCmd implements Command {\n name = 'get <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n group = 'info';\n description = 'show direct and indirect dependencies of the given component';\n alias = '';\n options = [\n ['', 'scope', 'get the data from the scope instead of the workspace'],\n ['t', 'tree', 'EXPERIMENTAL. render dependencies as a tree, similar to \"npm ls\"'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([id]: [string], { tree = false, scope = false }: GetDependenciesFlags) {\n const results = await this.deps.getDependencies(id, scope);\n\n if (tree) {\n const idWithVersion = results.id;\n const getGraphAsTree = (graph: ComponentIdGraph) => {\n try {\n const graphAsTree = graph.getDependenciesAsObjectTree(idWithVersion.toString());\n return archy(graphAsTree);\n } catch (err: any) {\n if (err.constructor.name === 'RangeError') {\n return `${chalk.red(\n 'unable to generate a tree representation, the graph is too big or has cyclic dependencies'\n )}`;\n }\n throw err;\n }\n };\n const graphTree = getGraphAsTree(results.graph);\n return graphTree;\n }\n const depsInfo = results.graph.getDependenciesInfo(results.id);\n if (!depsInfo.length) {\n return `no dependencies found for ${results.id.toString()}.\ntry running \"bit cat-component ${results.id.toStringWithoutVersion()}\" to see whether the component/version exists locally`;\n }\n\n const depsTable = generateDependenciesInfoTable(depsInfo, results.id);\n return `${depsTable || '<none>'}`;\n }\n}\n\nexport class DependenciesDebugCmd implements Command {\n name = 'debug <component-name>';\n arguments = [{ name: 'component-name', description: 'component name or component id' }];\n group = 'info';\n description = 'show the immediate dependencies and how their versions were determined';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([id]: [string]) {\n const results = await this.deps.debugDependencies(id);\n return JSON.stringify(results, undefined, 4);\n }\n}\n\nexport class DependenciesSetCmd implements Command {\n name = 'set <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will be resolved to the latest',\n },\n ];\n group = 'info';\n description = 'set a dependency to component(s)';\n alias = '';\n options = [\n ['d', 'dev', 'add to the devDependencies'],\n ['o', 'optional', 'add to the optionalDependencies'],\n ['p', 'peer', 'add to the peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], setDepsFlags: SetDependenciesFlags) {\n const { changedComps, addedPackages } = await this.deps.setDependency(pattern, packages, setDepsFlags);\n\n return `${chalk.green('successfully updated dependencies')}\n${chalk.bold('changed components')}\n${changedComps.join('\\n')}\n\n${chalk.bold('added packages')}\n${JSON.stringify(addedPackages, undefined, 4)}`;\n }\n}\n\nexport class DependenciesRemoveCmd implements Command {\n name = 'remove <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will remove all lodash instances of any version',\n },\n ];\n group = 'info';\n description = 'remove a dependency to component(s)';\n alias = '';\n options = [\n ['d', 'dev', 'remove from devDependencies'],\n ['p', 'peer', 'remove from peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], removeDepsFlags: RemoveDependenciesFlags) {\n const results = await this.deps.removeDependency(pattern, packages, removeDepsFlags);\n if (!results.length) {\n return chalk.yellow('the specified component-pattern do not use the entered packages. nothing to remove');\n }\n\n const output = results\n .map(({ id, removedPackages }) => `${chalk.underline(id.toString())}\\n${removedPackages.join('\\n')}`)\n .join('\\n\\n');\n\n return `${chalk.green('successfully removed dependencies')}\\n${output}`;\n }\n}\n\nexport class DependenciesUnsetCmd implements Command {\n name = 'unset <component-pattern> <package...>';\n arguments = [\n { name: 'component-pattern', description: COMPONENT_PATTERN_HELP },\n {\n name: 'package...',\n description:\n 'package name with or without a version, e.g. \"lodash@1.0.0\" or just \"lodash\" which will remove all lodash instances of any version',\n },\n ];\n group = 'info';\n description = 'unset a dependency to component(s) that was previously set by \"bit deps set\"';\n alias = '';\n options = [\n ['d', 'dev', 'unset from devDependencies'],\n ['p', 'peer', 'unset from peerDependencies'],\n ] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern, packages]: [string, string[]], removeDepsFlags: RemoveDependenciesFlags) {\n const results = await this.deps.removeDependency(pattern, packages, removeDepsFlags, true);\n if (!results.length) {\n return chalk.yellow('the specified component-pattern do not use the entered packages. nothing to unset');\n }\n\n const output = results\n .map(({ id, removedPackages }) => `${chalk.underline(id.toString())}\\n${removedPackages.join('\\n')}`)\n .join('\\n\\n');\n\n return `${chalk.green('successfully unset dependencies')}\\n${output}`;\n }\n}\n\nexport class DependenciesResetCmd implements Command {\n name = 'reset <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'info';\n description = 'reset dependencies to the default values (revert any previously \"bit deps set\")';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern]: [string]) {\n const results = await this.deps.reset(pattern);\n const comps = results.map((id) => id.toString());\n\n return `${chalk.green('successfully reset dependencies for the following component(s)')}\\n${comps}`;\n }\n}\n\nexport class DependenciesEjectCmd implements Command {\n name = 'eject <component-pattern>';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'info';\n description = 'write dependencies that were previously set via \"bit deps set\" into .bitmap';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([pattern]: [string]) {\n const results = await this.deps.eject(pattern);\n const comps = results.map((id) => id.toString());\n\n return `${chalk.green('successfully ejected dependencies for the following component(s)')}\\n${comps}`;\n }\n}\n\nexport class DependenciesBlameCmd implements Command {\n name = 'blame <component-name> <dependency-name>';\n arguments = [\n {\n name: 'dependency-name',\n description: 'package-name. for components, you can use either component-id or package-name',\n },\n ];\n group = 'info';\n description = 'EXPERIMENTAL. find out which snap/tag changed a dependency version';\n alias = '';\n options = [] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([compName, depName]: [string, string]) {\n const results = await this.deps.blame(compName, depName);\n if (!results.length) {\n return chalk.yellow(`the specified component ${compName} does not use the entered dependency ${depName}`);\n }\n // table with no style and no borders, just to align the columns.\n const table = new Table({\n chars: {\n top: '',\n 'top-mid': '',\n 'top-left': '',\n 'top-right': '',\n bottom: '',\n 'bottom-mid': '',\n 'bottom-left': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n right: '',\n 'right-mid': '',\n middle: ' ',\n },\n style: { 'padding-left': 0, 'padding-right': 0 },\n });\n\n results.map(({ snap, tag, author, date, message, version }) =>\n table.push([snap, tag || '', author, date, message, version])\n );\n\n return table.toString();\n }\n}\n\ntype DependenciesUsageCmdOptions = {\n depth?: number;\n};\n\nexport class DependenciesUsageCmd implements Command {\n name = 'usage <dependency-name>';\n arguments = [\n {\n name: 'dependency-name',\n description:\n 'package-name. for components, you can use either component-id or package-name. if version is specified, it will search for the exact version',\n },\n ];\n group = 'info';\n description = 'EXPERIMENTAL. find components that use the specified dependency';\n alias = '';\n options = [['', 'depth <number>', 'max display depth of the dependency graph']] as CommandOptions;\n\n constructor(private deps: DependenciesMain) {}\n\n async report([depName]: [string], options: DependenciesUsageCmdOptions) {\n const deepUsageResult = await this.deps.usageDeep(depName, options);\n if (deepUsageResult != null) return deepUsageResult;\n const results = await this.deps.usage(depName);\n if (!Object.keys(results).length) {\n return chalk.yellow(`the specified dependency ${depName} is not used by any component`);\n }\n return Object.keys(results)\n .map((compIdStr) => `${chalk.bold(compIdStr)} (using dep in version ${results[compIdStr]})`)\n .join('\\n');\n }\n}\n\nexport class WhyCmd extends DependenciesUsageCmd {\n name = 'why <dependency-name>';\n}\n\nexport class DependenciesCmd implements Command {\n name = 'deps <sub-command>';\n alias = 'dependencies';\n description = 'manage dependencies';\n options = [];\n group = 'info';\n commands: Command[] = [];\n helpUrl = 'reference/dependencies/configuring-dependencies';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"dependencies\", please run \"bit dependencies --help\" to list the subcommands`\n );\n }\n}\n\nexport class SetPeerCmd implements Command {\n name = 'set-peer <component-id> <range>';\n arguments = [\n { name: 'component-id', description: 'the component to set as always peer' },\n {\n name: 'range',\n description: 'the default range to use for the componnent, when added to peerDependencies',\n },\n ];\n group = 'info';\n description = 'set a component as always peer';\n alias = '';\n options = [];\n\n constructor(private deps: DependenciesMain) {}\n\n async report([componentId, range]: [string, string]) {\n await this.deps.setPeer(componentId, range != null ? range.toString() : range);\n return `${chalk.green('successfully marked the component as a peer component')}`;\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,Y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A,eAAA,gBACnB,cAAc;IAAAA,eAAA,sBACR,qBAAqB;IAAAA,eAAA,kBACzB,EAAE;IAAAA,eAAA,gBACJ,MAAM;IAAAA,eAAA,mBACQ,EAAE;IAAAA,eAAA,kBACd,iDAAiD;EAAA;EAE3D,MAAMyB,MAAMA,CAAC,CAACqF,sBAAsB,CAAW,EAAE;IAC/C,OAAOvE,gBAAK,CAACC,GAAG,CACb,IAAGsE,sBAAuB,uGAC7B,CAAC;EACH;AACF;AAAC9D,OAAA,CAAA6D,eAAA,GAAAA,eAAA;AAEM,MAAME,UAAU,CAAoB;EAczC1F,WAAWA,CAASC,IAAsB,EAAE;IAAA,KAAxBA,IAAsB,GAAtBA,IAAsB;IAAAtB,eAAA,eAbnC,iCAAiC;IAAAA,eAAA,oBAC5B,CACV;MAAEuB,IAAI,EAAE,cAAc;MAAEC,WAAW,EAAE;IAAsC,CAAC,EAC5E;MACED,IAAI,EAAE,OAAO;MACbC,WAAW,EAAE;IACf,CAAC,CACF;IAAAxB,eAAA,gBACO,MAAM;IAAAA,eAAA,sBACA,gCAAgC;IAAAA,eAAA,gBACtC,EAAE;IAAAA,eAAA,kBACA,EAAE;EAEiC;EAE7C,MAAMyB,MAAMA,CAAC,CAACuF,WAAW,EAAEC,KAAK,CAAmB,EAAE;IACnD,MAAM,IAAI,CAAC3F,IAAI,CAAC4F,OAAO,CAACF,WAAW,EAAEC,KAAK,IAAI,IAAI,GAAGA,KAAK,CAAC7E,QAAQ,CAAC,CAAC,GAAG6E,KAAK,CAAC;IAC9E,OAAQ,GAAE1E,gBAAK,CAACuB,KAAK,CAAC,uDAAuD,CAAE,EAAC;EAClF;AACF;AAACd,OAAA,CAAA+D,UAAA,GAAAA,UAAA"}
|
|
@@ -376,7 +376,10 @@ class AutoDetectDeps {
|
|
|
376
376
|
id: currentComponentsDeps.id,
|
|
377
377
|
importSource
|
|
378
378
|
};
|
|
379
|
-
this.pushToDependenciesArray(currentComponentsDeps,
|
|
379
|
+
this.pushToDependenciesArray(currentComponentsDeps, {
|
|
380
|
+
fileType,
|
|
381
|
+
depDebug
|
|
382
|
+
});
|
|
380
383
|
}
|
|
381
384
|
return false;
|
|
382
385
|
}
|
|
@@ -427,8 +430,28 @@ class AutoDetectDeps {
|
|
|
427
430
|
return;
|
|
428
431
|
}
|
|
429
432
|
this.addImportNonMainIssueIfNeeded(originFile, compDep);
|
|
430
|
-
const
|
|
431
|
-
|
|
433
|
+
const isPeer = compDep.packageJsonContent?.bit?.peer;
|
|
434
|
+
let peerVersionRange;
|
|
435
|
+
if (isPeer) {
|
|
436
|
+
const defaultPeerRange = compDep.packageJsonContent?.bit?.defaultPeerRange;
|
|
437
|
+
if (!defaultPeerRange) {
|
|
438
|
+
peerVersionRange = '*';
|
|
439
|
+
} else if (['~', '^', '>='].includes(defaultPeerRange)) {
|
|
440
|
+
if (_semver().default.valid(compDep.concreteVersion)) {
|
|
441
|
+
peerVersionRange = `${defaultPeerRange}${compDep.concreteVersion}`;
|
|
442
|
+
} else {
|
|
443
|
+
peerVersionRange = `${defaultPeerRange}0.0.0-${compDep.concreteVersion}`;
|
|
444
|
+
}
|
|
445
|
+
} else {
|
|
446
|
+
peerVersionRange = defaultPeerRange;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
const currentComponentsDeps = new (_dependencies().Dependency)(existingId, [], compDep.name, peerVersionRange);
|
|
450
|
+
this._pushToDependenciesIfNotExist(currentComponentsDeps, {
|
|
451
|
+
fileType,
|
|
452
|
+
depDebug,
|
|
453
|
+
isPeer
|
|
454
|
+
});
|
|
432
455
|
});
|
|
433
456
|
}
|
|
434
457
|
isPkgInWorkspacePolicies(pkgName) {
|
|
@@ -592,25 +615,27 @@ class AutoDetectDeps {
|
|
|
592
615
|
if (!unidentifiedPackages || !unidentifiedPackages.length) return;
|
|
593
616
|
this.debugDependenciesData.unidentifiedPackages = unidentifiedPackages;
|
|
594
617
|
}
|
|
595
|
-
_pushToDependenciesIfNotExist(dependency,
|
|
618
|
+
_pushToDependenciesIfNotExist(dependency, opts) {
|
|
596
619
|
const existingDependency = this.getExistingDependency(this.allDependencies.dependencies, dependency.id);
|
|
597
620
|
const existingDevDependency = this.getExistingDependency(this.allDependencies.devDependencies, dependency.id);
|
|
598
621
|
// no need to enter dev dependency to devDependencies if it exists already in dependencies
|
|
599
|
-
if (existingDependency || existingDevDependency && fileType.isTestFile) {
|
|
622
|
+
if (existingDependency || existingDevDependency && opts.fileType.isTestFile) {
|
|
600
623
|
return;
|
|
601
624
|
}
|
|
602
625
|
// at this point, either, it doesn't exist at all and should be entered.
|
|
603
626
|
// or it exists in devDependencies but now it comes from non-dev file, which should be entered
|
|
604
627
|
// as non-dev.
|
|
605
|
-
this.pushToDependenciesArray(dependency,
|
|
628
|
+
this.pushToDependenciesArray(dependency, opts);
|
|
606
629
|
}
|
|
607
|
-
pushToDependenciesArray(currentComponentsDeps,
|
|
608
|
-
if (fileType.isTestFile) {
|
|
630
|
+
pushToDependenciesArray(currentComponentsDeps, opts) {
|
|
631
|
+
if (opts.fileType.isTestFile) {
|
|
609
632
|
this.allDependencies.devDependencies.push(currentComponentsDeps);
|
|
633
|
+
} else if (opts.isPeer) {
|
|
634
|
+
this.allDependencies.peerDependencies.push(currentComponentsDeps);
|
|
610
635
|
} else {
|
|
611
636
|
this.allDependencies.dependencies.push(currentComponentsDeps);
|
|
612
637
|
}
|
|
613
|
-
this.debugDependenciesData.components.push(depDebug);
|
|
638
|
+
this.debugDependenciesData.components.push(opts.depDebug);
|
|
614
639
|
}
|
|
615
640
|
getExistingDependency(dependencies, id) {
|
|
616
641
|
return dependencies.find(d => d.id.isEqualWithoutVersion(id));
|