@teambit/dependency-resolver 1.0.504 → 1.0.506

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.
@@ -9,7 +9,7 @@ export interface DependencyResolverWorkspaceConfig {
9
9
  * and 'librarian'. our recommendation is use 'librarian' which reduces package duplicates
10
10
  * and totally removes the need of a 'node_modules' directory in your project.
11
11
  */
12
- packageManager: string;
12
+ packageManager?: string;
13
13
  /**
14
14
  * A proxy server for out going network requests by the package manager
15
15
  * Used for both http and https requests (unless the httpsProxy is defined)
@@ -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 * 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":[]}
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":[]}
@@ -256,7 +256,6 @@ export declare class DependencyResolverMain {
256
256
  * @returns The `getPackageManager()` function returns a `PackageManager` object or `undefined`.
257
257
  */
258
258
  getPackageManager(): PackageManager | undefined;
259
- getPackageManagerName(): string;
260
259
  getVersionResolver(options?: GetVersionResolverOptions): Promise<DependencyVersionResolver>;
261
260
  /**
262
261
  * these ids should not be in the dependencyResolver policy normally.
@@ -703,11 +703,11 @@ class DependencyResolverMain {
703
703
  * get a component dependency installer.
704
704
  */
705
705
  getInstaller(options = {}) {
706
- const packageManagerName = options.packageManager || this.config.packageManager;
706
+ const packageManagerName = options.packageManager || this.packageManagerName;
707
707
  const packageManager = this.packageManagerSlot.get(packageManagerName);
708
708
  const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(_legacy().CFG_PACKAGE_MANAGER_CACHE);
709
709
  if (!packageManager) {
710
- throw new (_exceptions().PackageManagerNotFound)(this.config.packageManager);
710
+ throw new (_exceptions().PackageManagerNotFound)(this.packageManagerName);
711
711
  }
712
712
  if (cacheRootDir && !_fsExtra().default.pathExistsSync(cacheRootDir)) {
713
713
  this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);
@@ -739,17 +739,14 @@ class DependencyResolverMain {
739
739
  * @returns The `getPackageManager()` function returns a `PackageManager` object or `undefined`.
740
740
  */
741
741
  getPackageManager() {
742
- const packageManager = this.packageManagerSlot.get(this.config.packageManager);
742
+ const packageManager = this.packageManagerSlot.get(this.packageManagerName);
743
743
  return packageManager;
744
744
  }
745
- getPackageManagerName() {
746
- return this.config.packageManager;
747
- }
748
745
  async getVersionResolver(options = {}) {
749
746
  const packageManager = this.getPackageManager();
750
747
  const cacheRootDir = options.cacheRootDirectory || this.globalConfig.getSync(_legacy().CFG_PACKAGE_MANAGER_CACHE);
751
748
  if (!packageManager) {
752
- throw new (_exceptions().PackageManagerNotFound)(this.config.packageManager);
749
+ throw new (_exceptions().PackageManagerNotFound)(this.packageManagerName);
753
750
  }
754
751
  if (cacheRootDir && !_fsExtra().default.pathExistsSync(cacheRootDir)) {
755
752
  this.logger.debug(`creating package manager cache dir at ${cacheRootDir}`);
@@ -776,9 +773,8 @@ class DependencyResolverMain {
776
773
  * return the system configured package manager. by default pnpm.
777
774
  */
778
775
  getSystemPackageManager() {
779
- const defaultPm = 'teambit.dependencies/pnpm';
780
- const packageManager = this.packageManagerSlot.get(defaultPm);
781
- if (!packageManager) throw new Error(`default package manager: ${defaultPm} was not found`);
776
+ const packageManager = this.packageManagerSlot.get(_legacy().DEFAULT_HARMONY_PACKAGE_MANAGER);
777
+ if (!packageManager) throw new Error(`default package manager: ${_legacy().DEFAULT_HARMONY_PACKAGE_MANAGER} was not found`);
782
778
  return packageManager;
783
779
  }
784
780
  async getProxyConfig() {
@@ -964,7 +960,7 @@ class DependencyResolverMain {
964
960
  return res;
965
961
  }
966
962
  get packageManagerName() {
967
- return this.config.packageManager;
963
+ return this.config.packageManager ?? _legacy().DEFAULT_HARMONY_PACKAGE_MANAGER;
968
964
  }
969
965
  addToRootPolicy(entries, options) {
970
966
  const workspacePolicy = this.getWorkspacePolicyFromConfig();
@@ -1511,7 +1507,7 @@ class DependencyResolverMain {
1511
1507
  getWorkspaceDepsOfBitRoots(manifests) {
1512
1508
  const packageManager = this.getPackageManager();
1513
1509
  if (!packageManager) {
1514
- throw new (_exceptions().PackageManagerNotFound)(this.config.packageManager);
1510
+ throw new (_exceptions().PackageManagerNotFound)(this.packageManagerName);
1515
1511
  }
1516
1512
  return packageManager.getWorkspaceDepsOfBitRoots(manifests);
1517
1513
  }
@@ -1521,10 +1517,6 @@ _defineProperty(DependencyResolverMain, "runtime", _cli().MainRuntime);
1521
1517
  _defineProperty(DependencyResolverMain, "dependencies", [_envs().EnvsAspect, _logger().LoggerAspect, _config().ConfigAspect, _aspectLoader().AspectLoaderAspect, _component().ComponentAspect, _graphql().GraphqlAspect, _globalConfig().GlobalConfigAspect]);
1522
1518
  _defineProperty(DependencyResolverMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
1523
1519
  _defineProperty(DependencyResolverMain, "defaultConfig", {
1524
- /**
1525
- * default package manager.
1526
- */
1527
- packageManager: 'teambit.dependencies/pnpm',
1528
1520
  policy: {},
1529
1521
  linkCoreAspects: true
1530
1522
  });