@teambit/dependency-resolver 1.0.216 → 1.0.218

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.
@@ -1,5 +1,5 @@
1
1
  import { uniqBy, property } from 'lodash';
2
- import { SNAP_VERSION_PREFIX } from '@teambit/component-package-version';
2
+ import { SNAP_VERSION_PREFIX, snapToSemver } from '@teambit/component-package-version';
3
3
  import { Dependency, DependencyLifecycleType, SerializedDependency, SemverVersion, PackageName } from './dependency';
4
4
  import { KEY_NAME_BY_LIFECYCLE_TYPE } from './constants';
5
5
  import { ComponentDependency } from './component-dependency';
@@ -148,7 +148,7 @@ export class DependencyList {
148
148
  : KEY_NAME_BY_LIFECYCLE_TYPE[dep.lifecycle];
149
149
  const entry = dep.toManifest();
150
150
  if (entry) {
151
- manifest[keyName][entry.packageName] = entry.version;
151
+ manifest[keyName][entry.packageName] = snapToSemver(entry.version);
152
152
  if (dep.optional && dep.lifecycle === 'peer') {
153
153
  manifest.peerDependenciesMeta[entry.packageName] = { optional: true };
154
154
  }
@@ -136,7 +136,7 @@ class DependencyList {
136
136
  const keyName = dep.optional && dep.lifecycle === 'runtime' ? 'optionalDependencies' : _constants().KEY_NAME_BY_LIFECYCLE_TYPE[dep.lifecycle];
137
137
  const entry = dep.toManifest();
138
138
  if (entry) {
139
- manifest[keyName][entry.packageName] = entry.version;
139
+ manifest[keyName][entry.packageName] = (0, _componentPackageVersion().snapToSemver)(entry.version);
140
140
  if (dep.optional && dep.lifecycle === 'peer') {
141
141
  manifest.peerDependenciesMeta[entry.packageName] = {
142
142
  optional: true
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","data","require","_componentPackageVersion","_constants","_componentDependency","DependencyList","constructor","_dependencies","uniqDeps","dependencies","sort","sorted","a","b","id","findDependency","componentIdStr","opts","ignoreVersion","find","dep","componentIdStrWithoutVersion","removeVersion","findByPkgNameOrCompId","version","findByVariousStrategies","found","getPackageName","startsWith","compDeps","toTypeArray","foundByName","filter","componentId","fullName","length","Error","undefined","SNAP_VERSION_PREFIX","replace","forEach","predicate","map","filtered","fromArray","filterHidden","hidden","typeName","list","type","byTypeName","byLifecycle","lifecycle","serialize","serialized","getComponentDependencies","ComponentDependency","toDependenciesManifest","manifest","optionalDependencies","devDependencies","peerDependencies","peerDependenciesMeta","keyName","optional","KEY_NAME_BY_LIFECYCLE_TYPE","entry","toManifest","packageName","merge","lists","res","deps","reduce","acc","curr","concat","exports","uniq","uniqBy","property","split"],"sources":["dependency-list.ts"],"sourcesContent":["import { uniqBy, property } from 'lodash';\nimport { SNAP_VERSION_PREFIX } from '@teambit/component-package-version';\nimport { Dependency, DependencyLifecycleType, SerializedDependency, SemverVersion, PackageName } from './dependency';\nimport { KEY_NAME_BY_LIFECYCLE_TYPE } from './constants';\nimport { ComponentDependency } from './component-dependency';\n\nexport type LifecycleDependenciesManifest = Record<PackageName, SemverVersion>;\n\nexport interface DependenciesManifest {\n dependencies?: LifecycleDependenciesManifest;\n optionalDependencies?: LifecycleDependenciesManifest;\n devDependencies?: LifecycleDependenciesManifest;\n peerDependencies?: LifecycleDependenciesManifest;\n peerDependenciesMeta?: PeerDependenciesMeta;\n}\n\nexport interface PeerDependenciesMeta {\n [peerName: string]: PeerDependencyMeta;\n}\n\nexport interface PeerDependencyMeta {\n optional: true;\n}\n\nexport type FindDependencyOptions = {\n ignoreVersion?: boolean;\n};\nexport class DependencyList {\n constructor(private _dependencies: Array<Dependency>) {\n this._dependencies = uniqDeps(_dependencies);\n }\n // constructor(private _dependencies: Dependency[]){}\n\n get dependencies(): Dependency[] {\n return this._dependencies;\n }\n\n sort(): DependencyList {\n const sorted = this.dependencies.sort((a, b) => {\n if (a.id < b.id) {\n return -1;\n }\n if (a.id > b.id) {\n return 1;\n }\n return 0;\n });\n return new DependencyList(sorted);\n }\n\n /**\n * @param componentIdStr complete string include the scope and the version\n */\n findDependency(componentIdStr: string, opts: FindDependencyOptions = {}): Dependency | undefined {\n const ignoreVersion = opts.ignoreVersion;\n if (!ignoreVersion) {\n return this.dependencies.find((dep) => dep.id === componentIdStr);\n }\n const componentIdStrWithoutVersion = removeVersion(componentIdStr);\n return this.dependencies.find((dep) => removeVersion(dep.id) === componentIdStrWithoutVersion);\n }\n\n findByPkgNameOrCompId(id: string, version?: string): Dependency | undefined {\n const findByVariousStrategies = () => {\n // try by full-id or package-name\n const found = this.dependencies.find(\n (dep) => dep.id === id || dep.getPackageName?.() === id || dep.id.startsWith(`${id}@`)\n );\n if (found) return found;\n const compDeps = this.toTypeArray<ComponentDependency>('component');\n\n // try by component-name\n const foundByName = compDeps.filter((dep) => dep.componentId.fullName === id);\n if (foundByName.length > 1) {\n throw new Error(\n `found multiple dependencies with the same component-name \"${id}\", please specify the full component-id`\n );\n }\n if (foundByName.length === 1) return foundByName[0];\n return undefined;\n };\n const found = findByVariousStrategies();\n if (!found) return undefined;\n if (version) {\n // because the version for snaps is stored in deps as the hash without the prefix of \"0.0.0-\"\"\n if (version.startsWith(SNAP_VERSION_PREFIX) && found.version === version.replace(SNAP_VERSION_PREFIX, ''))\n return found;\n return found.version === version ? found : undefined;\n }\n return found;\n }\n\n forEach(predicate: (dep: Dependency, index?: number) => void): void {\n this.dependencies.forEach(predicate);\n }\n\n map(predicate: (dep: Dependency, index?: number) => any) {\n return this.dependencies.map(predicate);\n }\n\n filter(predicate: (dep: Dependency, index?: number) => boolean): DependencyList {\n const filtered = this.dependencies.filter(predicate);\n return DependencyList.fromArray(filtered);\n }\n\n filterHidden(): DependencyList {\n return this.filter((dep) => !dep.hidden);\n }\n\n toTypeArray<T extends Dependency>(typeName: string): T[] {\n const list: T[] = this.dependencies.filter((dep) => dep.type === typeName) as any as T[];\n return list;\n }\n\n byTypeName(typeName: string): DependencyList {\n const filtered = this.dependencies.filter((dep) => dep.type === typeName);\n return DependencyList.fromArray(filtered);\n }\n\n byLifecycle(lifecycle: DependencyLifecycleType): DependencyList {\n const filtered = this.dependencies.filter((dep) => dep.lifecycle === lifecycle);\n return DependencyList.fromArray(filtered);\n }\n\n serialize(): SerializedDependency[] {\n const serialized = this.dependencies.map((dep) => {\n return dep.serialize();\n });\n return serialized;\n }\n\n getComponentDependencies(): ComponentDependency[] {\n return this.dependencies.filter((dep) => dep instanceof ComponentDependency) as ComponentDependency[];\n }\n\n toDependenciesManifest(): Required<DependenciesManifest> {\n const manifest: Required<DependenciesManifest> = {\n dependencies: {},\n optionalDependencies: {},\n devDependencies: {},\n peerDependencies: {},\n peerDependenciesMeta: {},\n };\n this.forEach((dep) => {\n const keyName =\n dep.optional && dep.lifecycle === 'runtime'\n ? 'optionalDependencies'\n : KEY_NAME_BY_LIFECYCLE_TYPE[dep.lifecycle];\n const entry = dep.toManifest();\n if (entry) {\n manifest[keyName][entry.packageName] = entry.version;\n if (dep.optional && dep.lifecycle === 'peer') {\n manifest.peerDependenciesMeta[entry.packageName] = { optional: true };\n }\n }\n });\n return manifest;\n }\n\n static merge(lists: DependencyList[]): DependencyList {\n const res: Dependency[] = [];\n const deps = lists.reduce((acc, curr) => {\n acc = acc.concat(curr.dependencies);\n return acc;\n }, res);\n return new DependencyList(deps);\n }\n\n static fromArray(dependencies: Array<Dependency>) {\n return new DependencyList(dependencies);\n }\n}\n\nfunction uniqDeps(dependencies: Array<Dependency>): Array<Dependency> {\n const uniq = uniqBy(dependencies, property('id'));\n return uniq;\n}\n\nfunction removeVersion(id: string): string {\n if (id.startsWith('@')) return id.split('@')[1]; // scoped package\n return id.split('@')[0];\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,yBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,wBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAA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E,YAAY,CAAC;MACnC,OAAOiE,GAAG;IACZ,CAAC,EAAEH,GAAG,CAAC;IACP,OAAO,IAAIlE,cAAc,CAACmE,IAAI,CAAC;EACjC;EAEA,OAAO5B,SAASA,CAACnC,YAA+B,EAAE;IAChD,OAAO,IAAIJ,cAAc,CAACI,YAAY,CAAC;EACzC;AACF;AAACoE,OAAA,CAAAxE,cAAA,GAAAA,cAAA;AAED,SAASG,QAAQA,CAACC,YAA+B,EAAqB;EACpE,MAAMqE,IAAI,GAAG,IAAAC,gBAAM,EAACtE,YAAY,EAAE,IAAAuE,kBAAQ,EAAC,IAAI,CAAC,CAAC;EACjD,OAAOF,IAAI;AACb;AAEA,SAASxD,aAAaA,CAACR,EAAU,EAAU;EACzC,IAAIA,EAAE,CAACc,UAAU,CAAC,GAAG,CAAC,EAAE,OAAOd,EAAE,CAACmE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACjD,OAAOnE,EAAE,CAACmE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["_lodash","data","require","_componentPackageVersion","_constants","_componentDependency","DependencyList","constructor","_dependencies","uniqDeps","dependencies","sort","sorted","a","b","id","findDependency","componentIdStr","opts","ignoreVersion","find","dep","componentIdStrWithoutVersion","removeVersion","findByPkgNameOrCompId","version","findByVariousStrategies","found","getPackageName","startsWith","compDeps","toTypeArray","foundByName","filter","componentId","fullName","length","Error","undefined","SNAP_VERSION_PREFIX","replace","forEach","predicate","map","filtered","fromArray","filterHidden","hidden","typeName","list","type","byTypeName","byLifecycle","lifecycle","serialize","serialized","getComponentDependencies","ComponentDependency","toDependenciesManifest","manifest","optionalDependencies","devDependencies","peerDependencies","peerDependenciesMeta","keyName","optional","KEY_NAME_BY_LIFECYCLE_TYPE","entry","toManifest","packageName","snapToSemver","merge","lists","res","deps","reduce","acc","curr","concat","exports","uniq","uniqBy","property","split"],"sources":["dependency-list.ts"],"sourcesContent":["import { uniqBy, property } from 'lodash';\nimport { SNAP_VERSION_PREFIX, snapToSemver } from '@teambit/component-package-version';\nimport { Dependency, DependencyLifecycleType, SerializedDependency, SemverVersion, PackageName } from './dependency';\nimport { KEY_NAME_BY_LIFECYCLE_TYPE } from './constants';\nimport { ComponentDependency } from './component-dependency';\n\nexport type LifecycleDependenciesManifest = Record<PackageName, SemverVersion>;\n\nexport interface DependenciesManifest {\n dependencies?: LifecycleDependenciesManifest;\n optionalDependencies?: LifecycleDependenciesManifest;\n devDependencies?: LifecycleDependenciesManifest;\n peerDependencies?: LifecycleDependenciesManifest;\n peerDependenciesMeta?: PeerDependenciesMeta;\n}\n\nexport interface PeerDependenciesMeta {\n [peerName: string]: PeerDependencyMeta;\n}\n\nexport interface PeerDependencyMeta {\n optional: true;\n}\n\nexport type FindDependencyOptions = {\n ignoreVersion?: boolean;\n};\nexport class DependencyList {\n constructor(private _dependencies: Array<Dependency>) {\n this._dependencies = uniqDeps(_dependencies);\n }\n // constructor(private _dependencies: Dependency[]){}\n\n get dependencies(): Dependency[] {\n return this._dependencies;\n }\n\n sort(): DependencyList {\n const sorted = this.dependencies.sort((a, b) => {\n if (a.id < b.id) {\n return -1;\n }\n if (a.id > b.id) {\n return 1;\n }\n return 0;\n });\n return new DependencyList(sorted);\n }\n\n /**\n * @param componentIdStr complete string include the scope and the version\n */\n findDependency(componentIdStr: string, opts: FindDependencyOptions = {}): Dependency | undefined {\n const ignoreVersion = opts.ignoreVersion;\n if (!ignoreVersion) {\n return this.dependencies.find((dep) => dep.id === componentIdStr);\n }\n const componentIdStrWithoutVersion = removeVersion(componentIdStr);\n return this.dependencies.find((dep) => removeVersion(dep.id) === componentIdStrWithoutVersion);\n }\n\n findByPkgNameOrCompId(id: string, version?: string): Dependency | undefined {\n const findByVariousStrategies = () => {\n // try by full-id or package-name\n const found = this.dependencies.find(\n (dep) => dep.id === id || dep.getPackageName?.() === id || dep.id.startsWith(`${id}@`)\n );\n if (found) return found;\n const compDeps = this.toTypeArray<ComponentDependency>('component');\n\n // try by component-name\n const foundByName = compDeps.filter((dep) => dep.componentId.fullName === id);\n if (foundByName.length > 1) {\n throw new Error(\n `found multiple dependencies with the same component-name \"${id}\", please specify the full component-id`\n );\n }\n if (foundByName.length === 1) return foundByName[0];\n return undefined;\n };\n const found = findByVariousStrategies();\n if (!found) return undefined;\n if (version) {\n // because the version for snaps is stored in deps as the hash without the prefix of \"0.0.0-\"\"\n if (version.startsWith(SNAP_VERSION_PREFIX) && found.version === version.replace(SNAP_VERSION_PREFIX, ''))\n return found;\n return found.version === version ? found : undefined;\n }\n return found;\n }\n\n forEach(predicate: (dep: Dependency, index?: number) => void): void {\n this.dependencies.forEach(predicate);\n }\n\n map(predicate: (dep: Dependency, index?: number) => any) {\n return this.dependencies.map(predicate);\n }\n\n filter(predicate: (dep: Dependency, index?: number) => boolean): DependencyList {\n const filtered = this.dependencies.filter(predicate);\n return DependencyList.fromArray(filtered);\n }\n\n filterHidden(): DependencyList {\n return this.filter((dep) => !dep.hidden);\n }\n\n toTypeArray<T extends Dependency>(typeName: string): T[] {\n const list: T[] = this.dependencies.filter((dep) => dep.type === typeName) as any as T[];\n return list;\n }\n\n byTypeName(typeName: string): DependencyList {\n const filtered = this.dependencies.filter((dep) => dep.type === typeName);\n return DependencyList.fromArray(filtered);\n }\n\n byLifecycle(lifecycle: DependencyLifecycleType): DependencyList {\n const filtered = this.dependencies.filter((dep) => dep.lifecycle === lifecycle);\n return DependencyList.fromArray(filtered);\n }\n\n serialize(): SerializedDependency[] {\n const serialized = this.dependencies.map((dep) => {\n return dep.serialize();\n });\n return serialized;\n }\n\n getComponentDependencies(): ComponentDependency[] {\n return this.dependencies.filter((dep) => dep instanceof ComponentDependency) as ComponentDependency[];\n }\n\n toDependenciesManifest(): Required<DependenciesManifest> {\n const manifest: Required<DependenciesManifest> = {\n dependencies: {},\n optionalDependencies: {},\n devDependencies: {},\n peerDependencies: {},\n peerDependenciesMeta: {},\n };\n this.forEach((dep) => {\n const keyName =\n dep.optional && dep.lifecycle === 'runtime'\n ? 'optionalDependencies'\n : KEY_NAME_BY_LIFECYCLE_TYPE[dep.lifecycle];\n const entry = dep.toManifest();\n if (entry) {\n manifest[keyName][entry.packageName] = snapToSemver(entry.version);\n if (dep.optional && dep.lifecycle === 'peer') {\n manifest.peerDependenciesMeta[entry.packageName] = { optional: true };\n }\n }\n });\n return manifest;\n }\n\n static merge(lists: DependencyList[]): DependencyList {\n const res: Dependency[] = [];\n const deps = lists.reduce((acc, curr) => {\n acc = acc.concat(curr.dependencies);\n return acc;\n }, res);\n return new DependencyList(deps);\n }\n\n static fromArray(dependencies: Array<Dependency>) {\n return new DependencyList(dependencies);\n }\n}\n\nfunction uniqDeps(dependencies: Array<Dependency>): Array<Dependency> {\n const uniq = uniqBy(dependencies, property('id'));\n return uniq;\n}\n\nfunction removeVersion(id: string): string {\n if (id.startsWith('@')) return id.split('@')[1]; // scoped package\n return id.split('@')[0];\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,yBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,wBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,qBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,oBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAuBO,MAAMK,cAAc,CAAC;EAC1BC,WAAWA,CAASC,aAAgC,EAAE;IAAA,KAAlCA,aAAgC,GAAhCA,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AAqB;EACpE,MAAMsE,IAAI,GAAG,IAAAC,gBAAM,EAACvE,YAAY,EAAE,IAAAwE,kBAAQ,EAAC,IAAI,CAAC,CAAC;EACjD,OAAOF,IAAI;AACb;AAEA,SAASzD,aAAaA,CAACR,EAAU,EAAU;EACzC,IAAIA,EAAE,CAACc,UAAU,CAAC,GAAG,CAAC,EAAE,OAAOd,EAAE,CAACoE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACjD,OAAOpE,EAAE,CAACoE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzB","ignoreList":[]}
@@ -96,6 +96,11 @@ export interface DependencyResolverWorkspaceConfig {
96
96
  * you can use this option to exclusively hoist the phantom dependencies (recommended).
97
97
  */
98
98
  hoistPatterns?: string[];
99
+ /**
100
+ * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules
101
+ * even if they are found in the root node_modules
102
+ */
103
+ hoistInjectedDependencies?: boolean;
99
104
  /**
100
105
  * Tells pnpm to automatically install peer dependencies. It is true by default.
101
106
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["dependency-resolver-workspace-config.ts"],"sourcesContent":["import { PeerDependencyRules } from '@pnpm/types';\nimport { WorkspacePolicyConfigObject } from './policy';\nimport { PackageImportMethod } from './package-manager';\n\nexport type NodeLinker = 'hoisted' | 'isolated';\n\nexport interface DependencyResolverWorkspaceConfig {\n policy: WorkspacePolicyConfigObject;\n /**\n * choose the package manager for Bit to use. you can choose between 'npm', 'yarn', 'pnpm'\n * and 'librarian'. our recommendation is use 'librarian' which reduces package duplicates\n * and totally removes the need of a 'node_modules' directory in your project.\n */\n packageManager: string;\n\n /**\n * A proxy server for out going network requests by the package manager\n * Used for both http and https requests (unless the httpsProxy is defined)\n */\n proxy?: string;\n\n /**\n * A proxy server for outgoing https requests by the package manager (fallback to proxy server if not defined)\n * Use this in case you want different proxy for http and https requests.\n */\n httpsProxy?: string;\n\n /**\n * A path to a file containing one or multiple Certificate Authority signing certificates.\n * allows for multiple CA's, as well as for the CA information to be stored in a file on disk.\n */\n ca?: string;\n\n /**\n * Whether or not to do SSL key validation when making requests to the registry via https\n */\n strictSsl?: string;\n\n /**\n * A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it \"Base-64 encoded X.509 (.CER)\") with newlines replaced by the string \"\\n\". For example:\n * cert=\"-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----\"\n * It is not the path to a certificate file (and there is no \"certfile\" option).\n */\n cert?: string;\n\n /**\n * A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string \"\\n\". For example:\n * key=\"-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----\"\n * It is not the path to a key file (and there is no \"keyfile\" option).\n */\n key?: string;\n\n /**\n * A comma-separated string of domain extensions that a proxy should not be used for.\n */\n noProxy?: string;\n\n /**\n * The IP address of the local interface to use when making connections to the npm registry.\n */\n localAddress?: string;\n\n /**\n * How many times to retry if Bit fails to fetch from the registry.\n */\n fetchRetries?: number;\n\n /*\n * The exponential factor for retry backoff.\n */\n fetchRetryFactor?: number;\n\n /*\n * The minimum (base) timeout for retrying requests.\n */\n fetchRetryMintimeout?: number;\n\n /*\n * The maximum fallback timeout to ensure the retry factor does not make requests too long.\n */\n fetchRetryMaxtimeout?: number;\n\n /*\n * The maximum amount of time (in milliseconds) to wait for HTTP requests to complete.\n */\n fetchTimeout?: number;\n\n /*\n * The maximum number of connections to use per origin (protocol/host/port combination).\n */\n maxSockets?: number;\n\n /*\n * Controls the maximum number of HTTP(S) requests to process simultaneously.\n */\n networkConcurrency?: number;\n\n /*\n * Set the prefix to use when adding dependency to workspace.jsonc via bit install\n * to lock version to exact version you can use empty string (default)\n */\n savePrefix?: string;\n\n /*\n * in case you want to disable this proxy set this config to false\n *\n */\n installFromBitDevRegistry?: boolean;\n\n /*\n * map of extra arguments to pass to the configured package manager upon the installation\n * of dependencies.\n */\n packageManagerArgs?: string[];\n\n /*\n * This field allows to instruct the package manager to override any dependency in the dependency graph.\n * This is useful to enforce all your packages to use a single version of a dependency, backport a fix,\n * or replace a dependency with a fork.\n */\n overrides?: Record<string, string>;\n\n /**\n * This is similar to overrides, but will only affect installation in capsules.\n * In case overrides is configured and this not, the regular overrides will affect capsules as well.\n * in case both configured, capsulesOverrides will be used for capsules, and overrides will affect the workspace.\n */\n capsulesOverrides?: Record<string, string>;\n\n /*\n * Defines what linker should be used for installing Node.js packages.\n * Supported values are hoisted and isolated.\n */\n nodeLinker?: NodeLinker;\n\n /*\n * Controls the way packages are imported from the store.\n */\n packageImportMethod?: PackageImportMethod;\n\n /*\n * Use and cache the results of (pre/post)install hooks.\n */\n sideEffectsCache?: boolean;\n\n /*\n * The list of components that should be installed in isolation from the workspace.\n * The component's package names should be used in this list, not their component IDs.\n */\n rootComponents?: boolean;\n\n /*\n * The node version to use when checking a package's engines setting.\n */\n nodeVersion?: string;\n\n /*\n * Refuse to install any package that claims to not be compatible with the current Node.js version.\n */\n engineStrict?: boolean;\n\n /*\n * Rules to mute specific peer dependeny warnings.\n */\n peerDependencyRules?: PeerDependencyRules;\n\n /*\n * This setting is \"true\" by default and tells bit to link core aspects to the node_modules of the workspace.\n * It only makes sense to set this to \"false\" in a workspace in which core aspects are actually developed.\n */\n linkCoreAspects?: boolean;\n\n /**\n * When false, Bit will create a shared node_modules directory for all components in a capsule.\n */\n isolatedCapsules?: boolean;\n\n /*\n * Ignore the builds of specific dependencies. The \"preinstall\", \"install\", and \"postinstall\" scripts\n * of the listed packages will not be executed during installation.\n */\n neverBuiltDependencies?: string[];\n\n /**\n * If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.\n */\n preferOffline?: boolean;\n\n /**\n * When true, components in capsules are symlinked into their own node_modules.\n */\n capsuleSelfReference?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["dependency-resolver-workspace-config.ts"],"sourcesContent":["import { PeerDependencyRules } from '@pnpm/types';\nimport { WorkspacePolicyConfigObject } from './policy';\nimport { PackageImportMethod } from './package-manager';\n\nexport type NodeLinker = 'hoisted' | 'isolated';\n\nexport interface DependencyResolverWorkspaceConfig {\n policy: WorkspacePolicyConfigObject;\n /**\n * choose the package manager for Bit to use. you can choose between 'npm', 'yarn', 'pnpm'\n * and 'librarian'. our recommendation is use 'librarian' which reduces package duplicates\n * and totally removes the need of a 'node_modules' directory in your project.\n */\n packageManager: string;\n\n /**\n * A proxy server for out going network requests by the package manager\n * Used for both http and https requests (unless the httpsProxy is defined)\n */\n proxy?: string;\n\n /**\n * A proxy server for outgoing https requests by the package manager (fallback to proxy server if not defined)\n * Use this in case you want different proxy for http and https requests.\n */\n httpsProxy?: string;\n\n /**\n * A path to a file containing one or multiple Certificate Authority signing certificates.\n * allows for multiple CA's, as well as for the CA information to be stored in a file on disk.\n */\n ca?: string;\n\n /**\n * Whether or not to do SSL key validation when making requests to the registry via https\n */\n strictSsl?: string;\n\n /**\n * A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it \"Base-64 encoded X.509 (.CER)\") with newlines replaced by the string \"\\n\". For example:\n * cert=\"-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----\"\n * It is not the path to a certificate file (and there is no \"certfile\" option).\n */\n cert?: string;\n\n /**\n * A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string \"\\n\". For example:\n * key=\"-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----\"\n * It is not the path to a key file (and there is no \"keyfile\" option).\n */\n key?: string;\n\n /**\n * A comma-separated string of domain extensions that a proxy should not be used for.\n */\n noProxy?: string;\n\n /**\n * The IP address of the local interface to use when making connections to the npm registry.\n */\n localAddress?: string;\n\n /**\n * How many times to retry if Bit fails to fetch from the registry.\n */\n fetchRetries?: number;\n\n /*\n * The exponential factor for retry backoff.\n */\n fetchRetryFactor?: number;\n\n /*\n * The minimum (base) timeout for retrying requests.\n */\n fetchRetryMintimeout?: number;\n\n /*\n * The maximum fallback timeout to ensure the retry factor does not make requests too long.\n */\n fetchRetryMaxtimeout?: number;\n\n /*\n * The maximum amount of time (in milliseconds) to wait for HTTP requests to complete.\n */\n fetchTimeout?: number;\n\n /*\n * The maximum number of connections to use per origin (protocol/host/port combination).\n */\n maxSockets?: number;\n\n /*\n * Controls the maximum number of HTTP(S) requests to process simultaneously.\n */\n networkConcurrency?: number;\n\n /*\n * Set the prefix to use when adding dependency to workspace.jsonc via bit install\n * to lock version to exact version you can use empty string (default)\n */\n savePrefix?: string;\n\n /*\n * in case you want to disable this proxy set this config to false\n *\n */\n installFromBitDevRegistry?: boolean;\n\n /*\n * map of extra arguments to pass to the configured package manager upon the installation\n * of dependencies.\n */\n packageManagerArgs?: string[];\n\n /*\n * This field allows to instruct the package manager to override any dependency in the dependency graph.\n * This is useful to enforce all your packages to use a single version of a dependency, backport a fix,\n * or replace a dependency with a fork.\n */\n overrides?: Record<string, string>;\n\n /**\n * This is similar to overrides, but will only affect installation in capsules.\n * In case overrides is configured and this not, the regular overrides will affect capsules as well.\n * in case both configured, capsulesOverrides will be used for capsules, and overrides will affect the workspace.\n */\n capsulesOverrides?: Record<string, string>;\n\n /*\n * Defines what linker should be used for installing Node.js packages.\n * Supported values are hoisted and isolated.\n */\n nodeLinker?: NodeLinker;\n\n /*\n * Controls the way packages are imported from the store.\n */\n packageImportMethod?: PackageImportMethod;\n\n /*\n * Use and cache the results of (pre/post)install hooks.\n */\n sideEffectsCache?: boolean;\n\n /*\n * The list of components that should be installed in isolation from the workspace.\n * The component's package names should be used in this list, not their component IDs.\n */\n rootComponents?: boolean;\n\n /*\n * The node version to use when checking a package's engines setting.\n */\n nodeVersion?: string;\n\n /*\n * Refuse to install any package that claims to not be compatible with the current Node.js version.\n */\n engineStrict?: boolean;\n\n /*\n * Rules to mute specific peer dependeny warnings.\n */\n peerDependencyRules?: PeerDependencyRules;\n\n /*\n * This setting is \"true\" by default and tells bit to link core aspects to the node_modules of the workspace.\n * It only makes sense to set this to \"false\" in a workspace in which core aspects are actually developed.\n */\n linkCoreAspects?: boolean;\n\n /**\n * When false, Bit will create a shared node_modules directory for all components in a capsule.\n */\n isolatedCapsules?: boolean;\n\n /*\n * Ignore the builds of specific dependencies. The \"preinstall\", \"install\", and \"postinstall\" scripts\n * of the listed packages will not be executed during installation.\n */\n neverBuiltDependencies?: string[];\n\n /**\n * If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.\n */\n preferOffline?: boolean;\n\n /**\n * When true, components in capsules are symlinked into their own node_modules.\n */\n capsuleSelfReference?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules\n * even if they are found in the root node_modules\n */\n hoistInjectedDependencies?: boolean;\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -71,6 +71,11 @@ export type PackageManagerInstallOptions = {
71
71
  * you can use this option to exclusively hoist the phantom dependencies (recommended).
72
72
  */
73
73
  hoistPatterns?: string[];
74
+ /**
75
+ * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules
76
+ * even if they are found in the root node_modules
77
+ */
78
+ hoistInjectedDependencies?: boolean;
74
79
  /**
75
80
  * Tells pnpm to automatically install peer dependencies. It is true by default.
76
81
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_core","data","require"],"sources":["package-manager.ts"],"sourcesContent":["import { PeerDependencyIssuesByProjects } from '@pnpm/core';\nimport { PeerDependencyRules, ProjectManifest } from '@pnpm/types';\nimport { ComponentMap } from '@teambit/component';\nimport { Registries } from './registry';\nimport { DepsFilterFn } from './manifest';\nimport { NetworkConfig, ProxyConfig } from './dependency-resolver.main.runtime';\n\nexport { PeerDependencyIssuesByProjects };\n\nexport type PackageImportMethod = 'auto' | 'hardlink' | 'copy' | 'clone';\n\nexport type PackageManagerInstallOptions = {\n cacheRootDir?: string;\n /**\n * decide whether to dedup dependencies.\n */\n dedupe?: boolean;\n\n copyPeerToRuntimeOnRoot?: boolean;\n\n copyPeerToRuntimeOnComponents?: boolean;\n\n excludeLinksFromLockfile?: boolean;\n\n installPeersFromEnvs?: boolean;\n\n dependencyFilterFn?: DepsFilterFn;\n\n overrides?: Record<string, string>;\n\n lockfileOnly?: boolean;\n\n nodeLinker?: 'hoisted' | 'isolated';\n\n packageManagerConfigRootDir?: string;\n\n packageImportMethod?: PackageImportMethod;\n\n rootComponents?: boolean;\n\n rootComponentsForCapsules?: boolean;\n\n useNesting?: boolean;\n\n keepExistingModulesDir?: boolean;\n\n sideEffectsCache?: boolean;\n\n engineStrict?: boolean;\n\n nodeVersion?: string;\n\n peerDependencyRules?: PeerDependencyRules;\n\n includeOptionalDeps?: boolean;\n\n updateAll?: boolean;\n\n hidePackageManagerOutput?: boolean;\n\n pruneNodeModules?: boolean;\n\n hasRootComponents?: boolean;\n\n neverBuiltDependencies?: string[];\n\n preferOffline?: boolean;\n\n nmSelfReferences?: boolean;\n\n /**\n * e.g. when running `bit install` through the web or the IDE, not from the CLI.\n */\n optimizeReportForNonTerminal?: boolean;\n\n /**\n * Sets the frequency of updating the progress output in milliseconds.\n * E.g., if this is set to 1000, then the progress will be updated every second.\n */\n throttleProgress?: number;\n\n hideProgressPrefix?: boolean;\n\n hideLifecycleOutput?: boolean;\n\n /**\n * Do installation using lockfile only. Ignore the component manifests.\n */\n ignorePackageManifest?: boolean;\n\n /**\n * When enabled, installation by the package manager will be skipped\n * but all the options will be calculated and the rebuild function will be returned.\n * We use this option for a performance optimization in Ripple CI.\n */\n dryRun?: boolean;\n\n dedupeInjectedDeps?: boolean;\n\n /**\n * When this is set to true, pnpm will hoist workspace packages to node_modules/.pnpm/node_modules.\n * This is something we need in capsules.\n */\n hoistWorkspacePackages?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n};\n\nexport type PackageManagerGetPeerDependencyIssuesOptions = PackageManagerInstallOptions;\n\nexport type ResolvedPackageVersion = {\n packageName: string;\n version: string | null;\n wantedRange?: string;\n isSemver: boolean;\n resolvedVia?: string;\n};\n\nexport type PackageManagerResolveRemoteVersionOptions = {\n rootDir: string;\n cacheRootDir?: string;\n packageManagerConfigRootDir?: string;\n // fetchToCache?: boolean;\n // update?: boolean;\n};\n\nexport interface InstallationContext {\n rootDir: string;\n manifests: Record<string, ProjectManifest>;\n componentDirectoryMap: ComponentMap<string>;\n}\n\nexport interface PackageManager {\n /**\n * Name of the package manager\n */\n name: string;\n /**\n * install dependencies\n * @param componentDirectoryMap\n */\n install(\n context: InstallationContext,\n options: PackageManagerInstallOptions\n ): Promise<{ dependenciesChanged: boolean }>;\n\n pruneModules?(rootDir: string): Promise<void>;\n\n resolveRemoteVersion(\n packageName: string,\n options: PackageManagerResolveRemoteVersionOptions\n ): Promise<ResolvedPackageVersion>;\n\n getPeerDependencyIssues?(\n rootDir: string,\n manifests: Record<string, ProjectManifest>,\n options: PackageManagerGetPeerDependencyIssuesOptions\n ): Promise<PeerDependencyIssuesByProjects>;\n\n getInjectedDirs?(rootDir: string, componentDir: string, packageName: string): Promise<string[]>;\n\n getRegistries?(): Promise<Registries>;\n\n getProxyConfig?(): Promise<ProxyConfig>;\n\n getNetworkConfig?(): Promise<NetworkConfig>;\n\n /**\n * Specify if the package manager can be run with deduping on existing worksapce (which already contains root dependencies)\n * again, with a different context.\n * If the package manager is not capable of doing so, we want to disable the deduping.\n */\n supportsDedupingOnExistingRoot?: () => boolean;\n\n /**\n * Returns \"dependencies\" entries for \".bit_roots\".\n * These entries tell the package manager from where to the local components should be installed.\n */\n getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string>;\n\n findUsages?(depName: string, opts: { lockfileDir: string; depth?: number }): Promise<string>;\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_core","data","require"],"sources":["package-manager.ts"],"sourcesContent":["import { PeerDependencyIssuesByProjects } from '@pnpm/core';\nimport { PeerDependencyRules, ProjectManifest } from '@pnpm/types';\nimport { ComponentMap } from '@teambit/component';\nimport { Registries } from './registry';\nimport { DepsFilterFn } from './manifest';\nimport { NetworkConfig, ProxyConfig } from './dependency-resolver.main.runtime';\n\nexport { PeerDependencyIssuesByProjects };\n\nexport type PackageImportMethod = 'auto' | 'hardlink' | 'copy' | 'clone';\n\nexport type PackageManagerInstallOptions = {\n cacheRootDir?: string;\n /**\n * decide whether to dedup dependencies.\n */\n dedupe?: boolean;\n\n copyPeerToRuntimeOnRoot?: boolean;\n\n copyPeerToRuntimeOnComponents?: boolean;\n\n excludeLinksFromLockfile?: boolean;\n\n installPeersFromEnvs?: boolean;\n\n dependencyFilterFn?: DepsFilterFn;\n\n overrides?: Record<string, string>;\n\n lockfileOnly?: boolean;\n\n nodeLinker?: 'hoisted' | 'isolated';\n\n packageManagerConfigRootDir?: string;\n\n packageImportMethod?: PackageImportMethod;\n\n rootComponents?: boolean;\n\n rootComponentsForCapsules?: boolean;\n\n useNesting?: boolean;\n\n keepExistingModulesDir?: boolean;\n\n sideEffectsCache?: boolean;\n\n engineStrict?: boolean;\n\n nodeVersion?: string;\n\n peerDependencyRules?: PeerDependencyRules;\n\n includeOptionalDeps?: boolean;\n\n updateAll?: boolean;\n\n hidePackageManagerOutput?: boolean;\n\n pruneNodeModules?: boolean;\n\n hasRootComponents?: boolean;\n\n neverBuiltDependencies?: string[];\n\n preferOffline?: boolean;\n\n nmSelfReferences?: boolean;\n\n /**\n * e.g. when running `bit install` through the web or the IDE, not from the CLI.\n */\n optimizeReportForNonTerminal?: boolean;\n\n /**\n * Sets the frequency of updating the progress output in milliseconds.\n * E.g., if this is set to 1000, then the progress will be updated every second.\n */\n throttleProgress?: number;\n\n hideProgressPrefix?: boolean;\n\n hideLifecycleOutput?: boolean;\n\n /**\n * Do installation using lockfile only. Ignore the component manifests.\n */\n ignorePackageManifest?: boolean;\n\n /**\n * When enabled, installation by the package manager will be skipped\n * but all the options will be calculated and the rebuild function will be returned.\n * We use this option for a performance optimization in Ripple CI.\n */\n dryRun?: boolean;\n\n dedupeInjectedDeps?: boolean;\n\n /**\n * When this is set to true, pnpm will hoist workspace packages to node_modules/.pnpm/node_modules.\n * This is something we need in capsules.\n */\n hoistWorkspacePackages?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules\n * even if they are found in the root node_modules\n */\n hoistInjectedDependencies?: boolean;\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n};\n\nexport type PackageManagerGetPeerDependencyIssuesOptions = PackageManagerInstallOptions;\n\nexport type ResolvedPackageVersion = {\n packageName: string;\n version: string | null;\n wantedRange?: string;\n isSemver: boolean;\n resolvedVia?: string;\n};\n\nexport type PackageManagerResolveRemoteVersionOptions = {\n rootDir: string;\n cacheRootDir?: string;\n packageManagerConfigRootDir?: string;\n // fetchToCache?: boolean;\n // update?: boolean;\n};\n\nexport interface InstallationContext {\n rootDir: string;\n manifests: Record<string, ProjectManifest>;\n componentDirectoryMap: ComponentMap<string>;\n}\n\nexport interface PackageManager {\n /**\n * Name of the package manager\n */\n name: string;\n /**\n * install dependencies\n * @param componentDirectoryMap\n */\n install(\n context: InstallationContext,\n options: PackageManagerInstallOptions\n ): Promise<{ dependenciesChanged: boolean }>;\n\n pruneModules?(rootDir: string): Promise<void>;\n\n resolveRemoteVersion(\n packageName: string,\n options: PackageManagerResolveRemoteVersionOptions\n ): Promise<ResolvedPackageVersion>;\n\n getPeerDependencyIssues?(\n rootDir: string,\n manifests: Record<string, ProjectManifest>,\n options: PackageManagerGetPeerDependencyIssuesOptions\n ): Promise<PeerDependencyIssuesByProjects>;\n\n getInjectedDirs?(rootDir: string, componentDir: string, packageName: string): Promise<string[]>;\n\n getRegistries?(): Promise<Registries>;\n\n getProxyConfig?(): Promise<ProxyConfig>;\n\n getNetworkConfig?(): Promise<NetworkConfig>;\n\n /**\n * Specify if the package manager can be run with deduping on existing worksapce (which already contains root dependencies)\n * again, with a different context.\n * If the package manager is not capable of doing so, we want to disable the deduping.\n */\n supportsDedupingOnExistingRoot?: () => boolean;\n\n /**\n * Returns \"dependencies\" entries for \".bit_roots\".\n * These entries tell the package manager from where to the local components should be installed.\n */\n getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string>;\n\n findUsages?(depName: string, opts: { lockfileDir: string; depth?: number }): Promise<string>;\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_dependency-resolver@1.0.216/dist/dependency-resolver.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_dependency-resolver@1.0.216/dist/dependency-resolver.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_dependency-resolver@1.0.218/dist/dependency-resolver.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_dependency-resolver@1.0.218/dist/dependency-resolver.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/dependency-resolver",
3
- "version": "1.0.216",
3
+ "version": "1.0.218",
4
4
  "homepage": "https://bit.cloud/teambit/dependencies/dependency-resolver",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.dependencies",
8
8
  "name": "dependency-resolver",
9
- "version": "1.0.216"
9
+ "version": "1.0.218"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -34,19 +34,19 @@
34
34
  "@teambit/legacy-bit-id": "1.1.1",
35
35
  "@teambit/toolbox.object.sorter": "0.0.2",
36
36
  "@teambit/component-version": "1.0.3",
37
- "@teambit/component": "1.0.216",
38
- "@teambit/envs": "1.0.216",
39
- "@teambit/aspect-loader": "1.0.216",
37
+ "@teambit/component": "1.0.218",
38
+ "@teambit/envs": "1.0.218",
39
+ "@teambit/aspect-loader": "1.0.218",
40
40
  "@teambit/logger": "0.0.951",
41
- "@teambit/graphql": "1.0.216",
42
- "@teambit/bit": "1.6.109",
41
+ "@teambit/graphql": "1.0.218",
42
+ "@teambit/bit": "1.6.111",
43
43
  "@teambit/cli": "0.0.858",
44
- "@teambit/config": "0.0.967",
44
+ "@teambit/config": "0.0.969",
45
45
  "@teambit/global-config": "0.0.861",
46
46
  "@teambit/harmony.modules.requireable-component": "0.0.497",
47
- "@teambit/snapping": "1.0.216",
47
+ "@teambit/snapping": "1.0.218",
48
48
  "@teambit/workspace.modules.node-modules-linker": "0.0.166",
49
- "@teambit/isolator": "1.0.216",
49
+ "@teambit/isolator": "1.0.218",
50
50
  "@teambit/toolbox.fs.link-or-symlink": "0.0.1",
51
51
  "@teambit/component-issues": "0.0.142",
52
52
  "@teambit/component-package-version": "0.0.433"