@teambit/dependencies 1.0.667 → 1.0.668

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.
Files changed (58) hide show
  1. package/dependencies-loader/apply-overrides.ts +16 -11
  2. package/dependencies-loader/auto-detect-deps.ts +17 -26
  3. package/dependencies-loader/dependencies-data.ts +3 -2
  4. package/dependencies-loader/dependencies-loader.ts +10 -8
  5. package/dependencies-loader/dependencies-versions-resolver.ts +8 -7
  6. package/dependencies-loader/overrides-dependencies.ts +2 -2
  7. package/dist/dependencies-cmd.d.ts +3 -3
  8. package/dist/dependencies-cmd.js.map +1 -1
  9. package/dist/dependencies-loader/apply-overrides.d.ts +9 -8
  10. package/dist/dependencies-loader/apply-overrides.js.map +1 -1
  11. package/dist/dependencies-loader/auto-detect-deps.d.ts +13 -13
  12. package/dist/dependencies-loader/auto-detect-deps.js.map +1 -1
  13. package/dist/dependencies-loader/dependencies-data.d.ts +2 -2
  14. package/dist/dependencies-loader/dependencies-data.js.map +1 -1
  15. package/dist/dependencies-loader/dependencies-loader.d.ts +8 -8
  16. package/dist/dependencies-loader/dependencies-loader.js.map +1 -1
  17. package/dist/dependencies-loader/dependencies-versions-resolver.d.ts +5 -5
  18. package/dist/dependencies-loader/dependencies-versions-resolver.js.map +1 -1
  19. package/dist/dependencies-loader/overrides-dependencies.d.ts +2 -2
  20. package/dist/dependencies-loader/overrides-dependencies.js.map +1 -1
  21. package/dist/dependencies.main.runtime.d.ts +13 -13
  22. package/dist/dependencies.main.runtime.js.map +1 -1
  23. package/dist/dependencies.spec.js.map +1 -1
  24. package/dist/dependents-cmd.d.ts +2 -2
  25. package/dist/dependents-cmd.js.map +1 -1
  26. package/dist/dependents.d.ts +3 -3
  27. package/dist/dependents.js.map +1 -1
  28. package/dist/files-dependency-builder/build-tree.d.ts +1 -1
  29. package/dist/files-dependency-builder/build-tree.js.map +1 -1
  30. package/dist/files-dependency-builder/filing-cabinet/index.d.ts +1 -1
  31. package/dist/files-dependency-builder/filing-cabinet/index.js.map +1 -1
  32. package/dist/files-dependency-builder/filing-cabinet/index.spec.js.map +1 -1
  33. package/dist/files-dependency-builder/generate-tree-madge.d.ts +1 -1
  34. package/dist/files-dependency-builder/generate-tree-madge.js.map +1 -1
  35. package/dist/files-dependency-builder/missing-handler.d.ts +2 -2
  36. package/dist/files-dependency-builder/missing-handler.js.map +1 -1
  37. package/dist/files-dependency-builder/path-map.d.ts +1 -1
  38. package/dist/files-dependency-builder/path-map.js.map +1 -1
  39. package/dist/files-dependency-builder/precinct/index.d.ts +1 -1
  40. package/dist/files-dependency-builder/precinct/index.js.map +1 -1
  41. package/dist/files-dependency-builder/precinct/index.spec.js.map +1 -1
  42. package/dist/files-dependency-builder/types/dependency-tree-type.d.ts +3 -3
  43. package/dist/files-dependency-builder/types/dependency-tree-type.js.map +1 -1
  44. package/dist/resolve-pkg-data.d.ts +1 -1
  45. package/dist/resolve-pkg-data.js.map +1 -1
  46. package/dist/template.d.ts +2 -2
  47. package/dist/template.js.map +1 -1
  48. package/files-dependency-builder/build-tree.ts +8 -4
  49. package/files-dependency-builder/filing-cabinet/index.spec.ts +1 -1
  50. package/files-dependency-builder/filing-cabinet/index.ts +2 -1
  51. package/files-dependency-builder/generate-tree-madge.ts +1 -1
  52. package/files-dependency-builder/missing-handler.ts +4 -2
  53. package/files-dependency-builder/path-map.ts +1 -1
  54. package/files-dependency-builder/precinct/index.spec.ts +1 -1
  55. package/files-dependency-builder/precinct/index.ts +2 -1
  56. package/files-dependency-builder/types/dependency-tree-type.ts +3 -3
  57. package/package.json +22 -22
  58. /package/dist/{preview-1753809186996.js → preview-1753833698619.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_componentId","data","require","_path","_interopRequireDefault","_readPkgUp","_legacy","_component","_legacy2","e","__esModule","default","resolvePackageData","dependentDir","packageFullPath","packageData","fullPath","name","componentId","undefined","enrichDataFromDependent","enrichDataFromDependency","NODE_MODULES","packageJsonInfo","readPkgUp","sync","cwd","normalize","dependentPackageJson","packageJson","packageRelativePath","substring","lastIndexOf","length","packageName","resolvePackageNameByPath","packageVersion","dependencies","devDependencies","peerDependencies","dependentPackageJsonPath","path","versionUsedByDependent","packageDir","resolvePackageDirFromFilePath","packageJsonFile","PackageJsonFile","loadSync","packageInfo","packageJsonObject","packageJsonPath","join","PACKAGE_JSON","packageJsonContent","concreteVersion","version","scope","exported","ComponentID","fromObject","hasVersion","absolutePackageFilePath","indexOfLastNodeModules","pathInsideNodeModules","pathUntilNodeModules"],"sources":["resolve-pkg-data.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport path from 'path';\nimport readPkgUp from 'read-pkg-up';\nimport { PACKAGE_JSON } from '@teambit/legacy.constants';\nimport { PackageJsonFile } from '@teambit/component.sources';\nimport { PathLinuxAbsolute, PathOsBased, PathOsBasedAbsolute } from '@teambit/toolbox.path.path';\nimport { resolvePackageNameByPath } from '@teambit/legacy.utils';\n\nexport interface ResolvedPackageData {\n fullPath: PathOsBasedAbsolute; // package path\n packageJsonPath?: PathOsBased;\n packageJsonContent?: Record<string, any>;\n dependentPackageJsonPath?: PathOsBased;\n name: string; // package name\n concreteVersion?: string; // version from the package.json of the package itself\n versionUsedByDependent?: string; // version from the dependent package.json\n componentId?: ComponentID; // component id in case it's a bit component\n}\n\n/**\n * find data such as name/version/component-id from the package.json of a component and its dependent.\n * the version from the dependent may have range (such as ~ or ^).\n * the version from the dependency is an exact version.\n * for a package that is not bit-component, we're interested in the range because that's how it was\n * set in the first place and changing it to an exact version result in the component modified.\n * for a bit-component, we're interested in the exact version because this is the version that gets\n * entered into \"dependency\" field, which not supports range. (when a component is installed via\n * npm, it can be saved into the package.json with range: ^, ~).\n */\nexport function resolvePackageData(\n dependentDir: string,\n packageFullPath: PathLinuxAbsolute\n): ResolvedPackageData | undefined {\n const packageData: ResolvedPackageData = {\n fullPath: packageFullPath,\n name: '',\n componentId: undefined,\n };\n enrichDataFromDependent(packageData, dependentDir);\n enrichDataFromDependency(packageData);\n if (!packageData.name) {\n // data was not found in dependent nor in dependency\n return undefined;\n }\n return packageData;\n}\n\nfunction enrichDataFromDependent(packageData: ResolvedPackageData, dependentDir: string) {\n const NODE_MODULES = 'node_modules';\n // @todo: currently, the \"normalize\" makes sure that the package.json is valid, however, due to a\n // bug, when importing snaps not from hub, it saves them in .dependencies and generate pkg.json\n // with version that has the hash, which is invalid. later, this .dependencies will be gone.\n const packageJsonInfo = readPkgUp.sync({ cwd: dependentDir, normalize: false });\n if (!packageJsonInfo) {\n return;\n }\n const dependentPackageJson = packageJsonInfo.packageJson;\n const packageFullPath = packageData.fullPath;\n // The +1 is for the / after the node_modules, we didn't enter it into the NODE_MODULES const because it makes problems on windows\n const packageRelativePath = packageFullPath.substring(\n packageFullPath.lastIndexOf(NODE_MODULES) + NODE_MODULES.length + 1,\n packageFullPath.length\n );\n\n const packageName = resolvePackageNameByPath(packageRelativePath);\n const packageVersion =\n dependentPackageJson.dependencies?.packageName ||\n dependentPackageJson.devDependencies?.packageName ||\n dependentPackageJson.peerDependencies?.packageName;\n if (packageVersion) {\n packageData.dependentPackageJsonPath = packageJsonInfo.path;\n packageData.name = packageName;\n packageData.versionUsedByDependent = packageVersion;\n }\n}\n\nfunction enrichDataFromDependency(packageData: ResolvedPackageData) {\n // Get the package relative path to the node_modules dir\n const packageDir = resolvePackageDirFromFilePath(packageData.fullPath);\n\n // don't propagate here since loading a package.json of another folder and taking the version from it will result wrong version\n // This for example happen in the following case:\n // if you have 2 authored component which one dependent on the other\n // we will look for the package.json on the dependency but won't find it\n // if we propagate we will take the version from the root's package json which has nothing with the component version\n const packageJsonFile = PackageJsonFile.loadSync(packageDir);\n const packageInfo = packageJsonFile.packageJsonObject;\n\n // the version can be empty when creating the package.json for author, or when using custom-module-resolution\n // that's fine, we still need the component-id in this case.\n if (!packageInfo || !packageInfo.name) {\n return;\n }\n packageData.packageJsonPath = path.join(packageDir, PACKAGE_JSON);\n packageData.packageJsonContent = packageInfo;\n packageData.name = packageInfo.name;\n packageData.concreteVersion = packageInfo.version;\n if (packageInfo.componentId) {\n const scope = packageInfo.componentId.scope as string;\n if (packageInfo.exported === false) {\n // @ts-ignore\n delete packageInfo.componentId.scope;\n }\n const componentId = ComponentID.fromObject(packageInfo.componentId, scope);\n packageData.componentId = componentId;\n if (packageData.componentId.hasVersion() && packageInfo.version) {\n // if packageInfo.version is not defined, it's coming from the workspace and the package.json is auto-generated\n // during bit-link. ignore the componentId.version in this case, it's not up do date.\n // otherwise, use it, because if it's a snap, the component-version is the snap. the pkg version is 0.0.0-snap.\n packageData.concreteVersion = packageData.componentId.version;\n }\n }\n}\n\n/**\n * given the full path of a package file, returns the root dir of the package, so then we could\n * find the package.json in that directory.\n *\n * example of a normal package:\n * absolutePackageFilePath: /user/workspace/node_modules/lodash.isboolean/index.js\n * returns: /user/workspace/node_modules/lodash.isboolean\n *\n * example of a scoped package:\n * absolutePackageFilePath: /user/workspace/node_modules/@babel/core/lib/index.js\n * returns: /user/workspace/node_modules/@babel/core\n */\nfunction resolvePackageDirFromFilePath(absolutePackageFilePath: string): string {\n const NODE_MODULES = 'node_modules';\n const indexOfLastNodeModules = absolutePackageFilePath.lastIndexOf(NODE_MODULES) + NODE_MODULES.length + 1;\n const pathInsideNodeModules = absolutePackageFilePath.substring(indexOfLastNodeModules);\n const packageName = resolvePackageNameByPath(pathInsideNodeModules);\n const pathUntilNodeModules = absolutePackageFilePath.substring(0, indexOfLastNodeModules);\n return pathUntilNodeModules + packageName;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAA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W,CAACuC,eAAe,GAAGN,WAAW,CAACO,OAAO;EACjD,IAAIP,WAAW,CAAC9B,WAAW,EAAE;IAC3B,MAAMsC,KAAK,GAAGR,WAAW,CAAC9B,WAAW,CAACsC,KAAe;IACrD,IAAIR,WAAW,CAACS,QAAQ,KAAK,KAAK,EAAE;MAClC;MACA,OAAOT,WAAW,CAAC9B,WAAW,CAACsC,KAAK;IACtC;IACA,MAAMtC,WAAW,GAAGwC,0BAAW,CAACC,UAAU,CAACX,WAAW,CAAC9B,WAAW,EAAEsC,KAAK,CAAC;IAC1EzC,WAAW,CAACG,WAAW,GAAGA,WAAW;IACrC,IAAIH,WAAW,CAACG,WAAW,CAAC0C,UAAU,CAAC,CAAC,IAAIZ,WAAW,CAACO,OAAO,EAAE;MAC/D;MACA;MACA;MACAxC,WAAW,CAACuC,eAAe,GAAGvC,WAAW,CAACG,WAAW,CAACqC,OAAO;IAC/D;EACF;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASX,6BAA6BA,CAACiB,uBAA+B,EAAU;EAC9E,MAAMvC,YAAY,GAAG,cAAc;EACnC,MAAMwC,sBAAsB,GAAGD,uBAAuB,CAAC7B,WAAW,CAACV,YAAY,CAAC,GAAGA,YAAY,CAACW,MAAM,GAAG,CAAC;EAC1G,MAAM8B,qBAAqB,GAAGF,uBAAuB,CAAC9B,SAAS,CAAC+B,sBAAsB,CAAC;EACvF,MAAM5B,WAAW,GAAG,IAAAC,mCAAwB,EAAC4B,qBAAqB,CAAC;EACnE,MAAMC,oBAAoB,GAAGH,uBAAuB,CAAC9B,SAAS,CAAC,CAAC,EAAE+B,sBAAsB,CAAC;EACzF,OAAOE,oBAAoB,GAAG9B,WAAW;AAC3C","ignoreList":[]}
1
+ {"version":3,"names":["_componentId","data","require","_path","_interopRequireDefault","_readPkgUp","_legacy","_component","_legacy2","e","__esModule","default","resolvePackageData","dependentDir","packageFullPath","packageData","fullPath","name","componentId","undefined","enrichDataFromDependent","enrichDataFromDependency","NODE_MODULES","packageJsonInfo","readPkgUp","sync","cwd","normalize","dependentPackageJson","packageJson","packageRelativePath","substring","lastIndexOf","length","packageName","resolvePackageNameByPath","packageVersion","dependencies","devDependencies","peerDependencies","dependentPackageJsonPath","path","versionUsedByDependent","packageDir","resolvePackageDirFromFilePath","packageJsonFile","PackageJsonFile","loadSync","packageInfo","packageJsonObject","packageJsonPath","join","PACKAGE_JSON","packageJsonContent","concreteVersion","version","scope","exported","ComponentID","fromObject","hasVersion","absolutePackageFilePath","indexOfLastNodeModules","pathInsideNodeModules","pathUntilNodeModules"],"sources":["resolve-pkg-data.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport path from 'path';\nimport readPkgUp from 'read-pkg-up';\nimport { PACKAGE_JSON } from '@teambit/legacy.constants';\nimport { PackageJsonFile } from '@teambit/component.sources';\nimport type { PathLinuxAbsolute, PathOsBased, PathOsBasedAbsolute } from '@teambit/toolbox.path.path';\nimport { resolvePackageNameByPath } from '@teambit/legacy.utils';\n\nexport interface ResolvedPackageData {\n fullPath: PathOsBasedAbsolute; // package path\n packageJsonPath?: PathOsBased;\n packageJsonContent?: Record<string, any>;\n dependentPackageJsonPath?: PathOsBased;\n name: string; // package name\n concreteVersion?: string; // version from the package.json of the package itself\n versionUsedByDependent?: string; // version from the dependent package.json\n componentId?: ComponentID; // component id in case it's a bit component\n}\n\n/**\n * find data such as name/version/component-id from the package.json of a component and its dependent.\n * the version from the dependent may have range (such as ~ or ^).\n * the version from the dependency is an exact version.\n * for a package that is not bit-component, we're interested in the range because that's how it was\n * set in the first place and changing it to an exact version result in the component modified.\n * for a bit-component, we're interested in the exact version because this is the version that gets\n * entered into \"dependency\" field, which not supports range. (when a component is installed via\n * npm, it can be saved into the package.json with range: ^, ~).\n */\nexport function resolvePackageData(\n dependentDir: string,\n packageFullPath: PathLinuxAbsolute\n): ResolvedPackageData | undefined {\n const packageData: ResolvedPackageData = {\n fullPath: packageFullPath,\n name: '',\n componentId: undefined,\n };\n enrichDataFromDependent(packageData, dependentDir);\n enrichDataFromDependency(packageData);\n if (!packageData.name) {\n // data was not found in dependent nor in dependency\n return undefined;\n }\n return packageData;\n}\n\nfunction enrichDataFromDependent(packageData: ResolvedPackageData, dependentDir: string) {\n const NODE_MODULES = 'node_modules';\n // @todo: currently, the \"normalize\" makes sure that the package.json is valid, however, due to a\n // bug, when importing snaps not from hub, it saves them in .dependencies and generate pkg.json\n // with version that has the hash, which is invalid. later, this .dependencies will be gone.\n const packageJsonInfo = readPkgUp.sync({ cwd: dependentDir, normalize: false });\n if (!packageJsonInfo) {\n return;\n }\n const dependentPackageJson = packageJsonInfo.packageJson;\n const packageFullPath = packageData.fullPath;\n // The +1 is for the / after the node_modules, we didn't enter it into the NODE_MODULES const because it makes problems on windows\n const packageRelativePath = packageFullPath.substring(\n packageFullPath.lastIndexOf(NODE_MODULES) + NODE_MODULES.length + 1,\n packageFullPath.length\n );\n\n const packageName = resolvePackageNameByPath(packageRelativePath);\n const packageVersion =\n dependentPackageJson.dependencies?.packageName ||\n dependentPackageJson.devDependencies?.packageName ||\n dependentPackageJson.peerDependencies?.packageName;\n if (packageVersion) {\n packageData.dependentPackageJsonPath = packageJsonInfo.path;\n packageData.name = packageName;\n packageData.versionUsedByDependent = packageVersion;\n }\n}\n\nfunction enrichDataFromDependency(packageData: ResolvedPackageData) {\n // Get the package relative path to the node_modules dir\n const packageDir = resolvePackageDirFromFilePath(packageData.fullPath);\n\n // don't propagate here since loading a package.json of another folder and taking the version from it will result wrong version\n // This for example happen in the following case:\n // if you have 2 authored component which one dependent on the other\n // we will look for the package.json on the dependency but won't find it\n // if we propagate we will take the version from the root's package json which has nothing with the component version\n const packageJsonFile = PackageJsonFile.loadSync(packageDir);\n const packageInfo = packageJsonFile.packageJsonObject;\n\n // the version can be empty when creating the package.json for author, or when using custom-module-resolution\n // that's fine, we still need the component-id in this case.\n if (!packageInfo || !packageInfo.name) {\n return;\n }\n packageData.packageJsonPath = path.join(packageDir, PACKAGE_JSON);\n packageData.packageJsonContent = packageInfo;\n packageData.name = packageInfo.name;\n packageData.concreteVersion = packageInfo.version;\n if (packageInfo.componentId) {\n const scope = packageInfo.componentId.scope as string;\n if (packageInfo.exported === false) {\n // @ts-ignore\n delete packageInfo.componentId.scope;\n }\n const componentId = ComponentID.fromObject(packageInfo.componentId, scope);\n packageData.componentId = componentId;\n if (packageData.componentId.hasVersion() && packageInfo.version) {\n // if packageInfo.version is not defined, it's coming from the workspace and the package.json is auto-generated\n // during bit-link. ignore the componentId.version in this case, it's not up do date.\n // otherwise, use it, because if it's a snap, the component-version is the snap. the pkg version is 0.0.0-snap.\n packageData.concreteVersion = packageData.componentId.version;\n }\n }\n}\n\n/**\n * given the full path of a package file, returns the root dir of the package, so then we could\n * find the package.json in that directory.\n *\n * example of a normal package:\n * absolutePackageFilePath: /user/workspace/node_modules/lodash.isboolean/index.js\n * returns: /user/workspace/node_modules/lodash.isboolean\n *\n * example of a scoped package:\n * absolutePackageFilePath: /user/workspace/node_modules/@babel/core/lib/index.js\n * returns: /user/workspace/node_modules/@babel/core\n */\nfunction resolvePackageDirFromFilePath(absolutePackageFilePath: string): string {\n const NODE_MODULES = 'node_modules';\n const indexOfLastNodeModules = absolutePackageFilePath.lastIndexOf(NODE_MODULES) + NODE_MODULES.length + 1;\n const pathInsideNodeModules = absolutePackageFilePath.substring(indexOfLastNodeModules);\n const packageName = resolvePackageNameByPath(pathInsideNodeModules);\n const pathUntilNodeModules = absolutePackageFilePath.substring(0, indexOfLastNodeModules);\n return pathUntilNodeModules + packageName;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IA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AAW,CAACE,IAAI,GAAG+B,WAAW,CAAC/B,IAAI;EACnCF,WAAW,CAACuC,eAAe,GAAGN,WAAW,CAACO,OAAO;EACjD,IAAIP,WAAW,CAAC9B,WAAW,EAAE;IAC3B,MAAMsC,KAAK,GAAGR,WAAW,CAAC9B,WAAW,CAACsC,KAAe;IACrD,IAAIR,WAAW,CAACS,QAAQ,KAAK,KAAK,EAAE;MAClC;MACA,OAAOT,WAAW,CAAC9B,WAAW,CAACsC,KAAK;IACtC;IACA,MAAMtC,WAAW,GAAGwC,0BAAW,CAACC,UAAU,CAACX,WAAW,CAAC9B,WAAW,EAAEsC,KAAK,CAAC;IAC1EzC,WAAW,CAACG,WAAW,GAAGA,WAAW;IACrC,IAAIH,WAAW,CAACG,WAAW,CAAC0C,UAAU,CAAC,CAAC,IAAIZ,WAAW,CAACO,OAAO,EAAE;MAC/D;MACA;MACA;MACAxC,WAAW,CAACuC,eAAe,GAAGvC,WAAW,CAACG,WAAW,CAACqC,OAAO;IAC/D;EACF;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASX,6BAA6BA,CAACiB,uBAA+B,EAAU;EAC9E,MAAMvC,YAAY,GAAG,cAAc;EACnC,MAAMwC,sBAAsB,GAAGD,uBAAuB,CAAC7B,WAAW,CAACV,YAAY,CAAC,GAAGA,YAAY,CAACW,MAAM,GAAG,CAAC;EAC1G,MAAM8B,qBAAqB,GAAGF,uBAAuB,CAAC9B,SAAS,CAAC+B,sBAAsB,CAAC;EACvF,MAAM5B,WAAW,GAAG,IAAAC,mCAAwB,EAAC4B,qBAAqB,CAAC;EACnE,MAAMC,oBAAoB,GAAGH,uBAAuB,CAAC9B,SAAS,CAAC,CAAC,EAAE+B,sBAAsB,CAAC;EACzF,OAAOE,oBAAoB,GAAG9B,WAAW;AAC3C","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ComponentID } from '@teambit/component-id';
2
- import { DependenciesInfo } from '@teambit/legacy.dependency-graph';
1
+ import type { ComponentID } from '@teambit/component-id';
2
+ import type { DependenciesInfo } from '@teambit/legacy.dependency-graph';
3
3
  export declare function generateDependenciesInfoTable(dependenciesInfo: DependenciesInfo[], id: ComponentID): string;
4
4
  export declare function generateDependentsInfoTable(dependentsInfo: DependenciesInfo[], id: ComponentID): string;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_table","e","__esModule","default","getAllDependenciesRows","dependenciesInfoArray","id","map","dependency","row","push","toString","depth","parent","dependencyType","generateDependenciesInfoTable","dependenciesInfo","length","dependenciesHeader","c","cyan","allDependenciesRows","dependenciesTable","table","concat","bold","generateDependentsInfoTable","dependentsInfo","dependentsHeader","dependentsTable"],"sources":["template.ts"],"sourcesContent":["import c from 'chalk';\nimport { table } from 'table';\nimport { ComponentID } from '@teambit/component-id';\nimport { DependenciesInfo } from '@teambit/legacy.dependency-graph';\n\nfunction getAllDependenciesRows(dependenciesInfoArray: DependenciesInfo[], id: ComponentID): Array<string[]> {\n return dependenciesInfoArray.map((dependency: DependenciesInfo) => {\n const row: string[] = [];\n row.push(dependency.id.toString());\n row.push(dependency.depth.toString());\n row.push(dependency.parent === id.toString() ? '<self>' : dependency.parent);\n row.push(dependency.dependencyType);\n return row;\n });\n}\n\nexport function generateDependenciesInfoTable(dependenciesInfo: DependenciesInfo[], id: ComponentID) {\n if (!dependenciesInfo.length) {\n return '';\n }\n\n const dependenciesHeader: string[][] = [];\n dependenciesHeader.push([\n c.cyan('Dependency ID'),\n c.cyan('Depth'),\n c.cyan('Immediate Dependent'),\n c.cyan('Dependency type'),\n ]);\n const allDependenciesRows = getAllDependenciesRows(dependenciesInfo, id);\n\n const dependenciesTable = table(dependenciesHeader.concat(allDependenciesRows));\n return `\\n${c.bold('Dependencies Details')}\\n${dependenciesTable}`;\n}\n\nexport function generateDependentsInfoTable(dependentsInfo: DependenciesInfo[], id: ComponentID) {\n if (!dependentsInfo.length) {\n return '';\n }\n const dependentsHeader: string[][] = [];\n dependentsHeader.push([\n c.cyan('Dependent ID'),\n c.cyan('Depth'),\n c.cyan('Immediate Dependency'),\n c.cyan('Dependent type'),\n ]);\n const allDependenciesRows = getAllDependenciesRows(dependentsInfo, id);\n const dependentsTable = table(dependentsHeader.concat(allDependenciesRows));\n return `\\n${c.bold('Dependents Details')}\\n${dependentsTable}`;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8B,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI9B,SAASG,sBAAsBA,CAACC,qBAAyC,EAAEC,EAAe,EAAmB;EAC3G,OAAOD,qBAAqB,CAACE,GAAG,CAAEC,UAA4B,IAAK;IACjE,MAAMC,GAAa,GAAG,EAAE;IACxBA,GAAG,CAACC,IAAI,CAACF,UAAU,CAACF,EAAE,CAACK,QAAQ,CAAC,CAAC,CAAC;IAClCF,GAAG,CAACC,IAAI,CAACF,UAAU,CAACI,KAAK,CAACD,QAAQ,CAAC,CAAC,CAAC;IACrCF,GAAG,CAACC,IAAI,CAACF,UAAU,CAACK,MAAM,KAAKP,EAAE,CAACK,QAAQ,CAAC,CAAC,GAAG,QAAQ,GAAGH,UAAU,CAACK,MAAM,CAAC;IAC5EJ,GAAG,CAACC,IAAI,CAACF,UAAU,CAACM,cAAc,CAAC;IACnC,OAAOL,GAAG;EACZ,CAAC,CAAC;AACJ;AAEO,SAASM,6BAA6BA,CAACC,gBAAoC,EAAEV,EAAe,EAAE;EACnG,IAA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3,"names":["_chalk","data","_interopRequireDefault","require","_table","e","__esModule","default","getAllDependenciesRows","dependenciesInfoArray","id","map","dependency","row","push","toString","depth","parent","dependencyType","generateDependenciesInfoTable","dependenciesInfo","length","dependenciesHeader","c","cyan","allDependenciesRows","dependenciesTable","table","concat","bold","generateDependentsInfoTable","dependentsInfo","dependentsHeader","dependentsTable"],"sources":["template.ts"],"sourcesContent":["import c from 'chalk';\nimport { table } from 'table';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { DependenciesInfo } from '@teambit/legacy.dependency-graph';\n\nfunction getAllDependenciesRows(dependenciesInfoArray: DependenciesInfo[], id: ComponentID): Array<string[]> {\n return dependenciesInfoArray.map((dependency: DependenciesInfo) => {\n const row: string[] = [];\n row.push(dependency.id.toString());\n row.push(dependency.depth.toString());\n row.push(dependency.parent === id.toString() ? '<self>' : dependency.parent);\n row.push(dependency.dependencyType);\n return row;\n });\n}\n\nexport function generateDependenciesInfoTable(dependenciesInfo: DependenciesInfo[], id: ComponentID) {\n if (!dependenciesInfo.length) {\n return '';\n }\n\n const dependenciesHeader: string[][] = [];\n dependenciesHeader.push([\n c.cyan('Dependency ID'),\n c.cyan('Depth'),\n c.cyan('Immediate Dependent'),\n c.cyan('Dependency type'),\n ]);\n const allDependenciesRows = getAllDependenciesRows(dependenciesInfo, id);\n\n const dependenciesTable = table(dependenciesHeader.concat(allDependenciesRows));\n return `\\n${c.bold('Dependencies Details')}\\n${dependenciesTable}`;\n}\n\nexport function generateDependentsInfoTable(dependentsInfo: DependenciesInfo[], id: ComponentID) {\n if (!dependentsInfo.length) {\n return '';\n }\n const dependentsHeader: string[][] = [];\n dependentsHeader.push([\n c.cyan('Dependent ID'),\n c.cyan('Depth'),\n c.cyan('Immediate Dependency'),\n c.cyan('Dependent type'),\n ]);\n const allDependenciesRows = getAllDependenciesRows(dependentsInfo, id);\n const dependentsTable = table(dependentsHeader.concat(allDependenciesRows));\n return `\\n${c.bold('Dependents Details')}\\n${dependentsTable}`;\n}\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ACC,IAAI,CAAC,qBAAqB,CAAC,EAC7BD,gBAAC,CAACC,IAAI,CAAC,iBAAiB,CAAC,CAC1B,CAAC;EACF,MAAMC,mBAAmB,GAAGjB,sBAAsB,CAACY,gBAAgB,EAAEV,EAAE,CAAC;EAExE,MAAMgB,iBAAiB,GAAG,IAAAC,cAAK,EAACL,kBAAkB,CAACM,MAAM,CAACH,mBAAmB,CAAC,CAAC;EAC/E,OAAO,KAAKF,gBAAC,CAACM,IAAI,CAAC,sBAAsB,CAAC,KAAKH,iBAAiB,EAAE;AACpE;AAEO,SAASI,2BAA2BA,CAACC,cAAkC,EAAErB,EAAe,EAAE;EAC/F,IAAI,CAACqB,cAAc,CAACV,MAAM,EAAE;IAC1B,OAAO,EAAE;EACX;EACA,MAAMW,gBAA4B,GAAG,EAAE;EACvCA,gBAAgB,CAAClB,IAAI,CAAC,CACpBS,gBAAC,CAACC,IAAI,CAAC,cAAc,CAAC,EACtBD,gBAAC,CAACC,IAAI,CAAC,OAAO,CAAC,EACfD,gBAAC,CAACC,IAAI,CAAC,sBAAsB,CAAC,EAC9BD,gBAAC,CAACC,IAAI,CAAC,gBAAgB,CAAC,CACzB,CAAC;EACF,MAAMC,mBAAmB,GAAGjB,sBAAsB,CAACuB,cAAc,EAAErB,EAAE,CAAC;EACtE,MAAMuB,eAAe,GAAG,IAAAN,cAAK,EAACK,gBAAgB,CAACJ,MAAM,CAACH,mBAAmB,CAAC,CAAC;EAC3E,OAAO,KAAKF,gBAAC,CAACM,IAAI,CAAC,oBAAoB,CAAC,KAAKI,eAAe,EAAE;AAChE","ignoreList":[]}
@@ -1,10 +1,14 @@
1
1
  import { clone, isEmpty, set } from 'lodash';
2
2
  import path from 'path';
3
3
  import { resolvePackageData } from '../resolve-pkg-data';
4
- import generateTree, { MadgeTree } from './generate-tree-madge';
5
- import { FoundPackages, MissingGroupItem, MissingHandler } from './missing-handler';
6
- import { convertPathMapToRelativePaths, PathMapItem } from './path-map';
7
- import { DependencyTreeParams, FileObject, DependenciesTree, DependenciesTreeItem } from './types/dependency-tree-type';
4
+ import type { MadgeTree } from './generate-tree-madge';
5
+ import generateTree from './generate-tree-madge';
6
+ import type { FoundPackages, MissingGroupItem } from './missing-handler';
7
+ import { MissingHandler } from './missing-handler';
8
+ import type { PathMapItem } from './path-map';
9
+ import { convertPathMapToRelativePaths } from './path-map';
10
+ import type { DependencyTreeParams, FileObject, DependenciesTree } from './types/dependency-tree-type';
11
+ import { DependenciesTreeItem } from './types/dependency-tree-type';
8
12
 
9
13
  /**
10
14
  * Gets a list of dependencies and group them by types (files, components, packages)
@@ -5,7 +5,7 @@ import path from 'path';
5
5
  import rewire from 'rewire';
6
6
  import sinon from 'sinon';
7
7
 
8
- import { DependencyDetector } from '../detector-hook';
8
+ import type { DependencyDetector } from '../detector-hook';
9
9
 
10
10
  const UNIT_TEST_DIR = path.join(BIT_TEMP_ROOT, 'unit-test');
11
11
 
@@ -10,7 +10,8 @@ import stylusLookup from 'stylus-lookup';
10
10
  import { lookupJavaScript, lookupTypeScript } from '@teambit/typescript.deps-lookups.lookup-typescript';
11
11
  import { lookupStyling } from '@teambit/styling.deps-lookups.lookup-styling';
12
12
 
13
- import { DependencyDetector, DetectorHook } from '../detector-hook';
13
+ import type { DependencyDetector } from '../detector-hook';
14
+ import { DetectorHook } from '../detector-hook';
14
15
 
15
16
  const debug = require('debug')('cabinet');
16
17
 
@@ -5,7 +5,7 @@ import os from 'os';
5
5
  import path from 'path';
6
6
 
7
7
  import dependencyTree from './dependency-tree';
8
- import { PathLinuxRelative } from '@teambit/toolbox.path.path';
8
+ import type { PathLinuxRelative } from '@teambit/toolbox.path.path';
9
9
 
10
10
  /**
11
11
  * Check if running on Windows.
@@ -1,6 +1,8 @@
1
1
  import { resolvePackageNameByPath, resolvePackagePath } from '@teambit/legacy.utils';
2
- import { ResolvedPackageData, resolvePackageData } from '../resolve-pkg-data';
3
- import { processPath, Missing } from './generate-tree-madge';
2
+ import type { ResolvedPackageData } from '../resolve-pkg-data';
3
+ import { resolvePackageData } from '../resolve-pkg-data';
4
+ import type { Missing } from './generate-tree-madge';
5
+ import { processPath } from './generate-tree-madge';
4
6
  import { groupBy } from 'lodash';
5
7
 
6
8
  export type MissingGroupItem = { originFile: string; packages?: string[]; files?: string[] };
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { clone } from 'lodash';
9
9
  import { processPath } from './generate-tree-madge';
10
- import { Specifier } from '@teambit/legacy.consumer-component';
10
+ import type { Specifier } from '@teambit/legacy.consumer-component';
11
11
 
12
12
  export type PathMapDependency = {
13
13
  importSource: string; // dependency path as it has been received from dependency-tree lib
@@ -1,4 +1,4 @@
1
- import { DependencyDetector } from '../detector-hook';
1
+ import type { DependencyDetector } from '../detector-hook';
2
2
 
3
3
  const assert = require('assert');
4
4
  const path = require('path');
@@ -20,7 +20,8 @@ import detectiveSass from '@teambit/styling.deps-detectors.detective-sass';
20
20
  import detectiveScss from '@teambit/styling.deps-detectors.detective-scss';
21
21
  import detectiveTypeScript from '@teambit/typescript.deps-detectors.detective-typescript';
22
22
 
23
- import { DependencyDetector, DetectorHook } from '../detector-hook';
23
+ import type { DependencyDetector } from '../detector-hook';
24
+ import { DetectorHook } from '../detector-hook';
24
25
 
25
26
  /**
26
27
  * The file info object.
@@ -1,6 +1,6 @@
1
- import { ImportSpecifier } from '@teambit/legacy.consumer-component';
2
- import { ResolvedPackageData } from '../../resolve-pkg-data';
3
- import { DependencyDetector } from '../detector-hook';
1
+ import type { ImportSpecifier } from '@teambit/legacy.consumer-component';
2
+ import type { ResolvedPackageData } from '../../resolve-pkg-data';
3
+ import type { DependencyDetector } from '../detector-hook';
4
4
  import { isEmpty } from 'lodash';
5
5
 
6
6
  export type FileObject = {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/dependencies",
3
- "version": "1.0.667",
3
+ "version": "1.0.668",
4
4
  "homepage": "https://bit.cloud/teambit/dependencies/dependencies",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.dependencies",
8
8
  "name": "dependencies",
9
- "version": "1.0.667"
9
+ "version": "1.0.668"
10
10
  },
11
11
  "dependencies": {
12
12
  "archy": "1.0.0",
@@ -29,22 +29,13 @@
29
29
  "@teambit/legacy.constants": "0.0.13",
30
30
  "@teambit/harmony": "0.4.7",
31
31
  "@teambit/component-id": "1.2.4",
32
- "@teambit/component-package-version": "0.0.439",
33
- "@teambit/legacy.consumer-component": "0.0.58",
34
32
  "@teambit/bit-error": "0.0.404",
35
- "@teambit/legacy.dependency-graph": "0.0.60",
36
- "@teambit/component.sources": "0.0.109",
37
33
  "@teambit/legacy.utils": "0.0.22",
38
34
  "@teambit/toolbox.path.path": "0.0.8",
39
35
  "@teambit/component-issues": "0.0.160",
40
- "@teambit/legacy.bit-map": "0.0.114",
41
- "@teambit/legacy.consumer-config": "0.0.57",
42
- "@teambit/legacy.consumer": "0.0.57",
43
36
  "@teambit/component-version": "1.0.4",
44
37
  "@teambit/legacy.logger": "0.0.22",
45
38
  "@teambit/toolbox.fs.extension-getter": "0.0.5",
46
- "@teambit/legacy.extension-data": "0.0.59",
47
- "@teambit/toolbox.fs.last-modified": "0.0.5",
48
39
  "@teambit/styling.deps-lookups.lookup-styling": "0.0.4",
49
40
  "@teambit/typescript.deps-lookups.lookup-typescript": "0.0.2",
50
41
  "@teambit/node.deps-detectors.detective-es6": "0.0.6",
@@ -53,14 +44,23 @@
53
44
  "@teambit/styling.deps-detectors.detective-sass": "0.0.9",
54
45
  "@teambit/styling.deps-detectors.detective-scss": "0.0.9",
55
46
  "@teambit/typescript.deps-detectors.detective-typescript": "0.0.9",
56
- "@teambit/cli": "0.0.1244",
57
- "@teambit/graph": "1.0.667",
58
- "@teambit/workspace": "1.0.667",
59
- "@teambit/aspect-loader": "1.0.667",
60
- "@teambit/dependency-resolver": "1.0.667",
61
- "@teambit/dev-files": "1.0.667",
62
- "@teambit/logger": "0.0.1337",
63
- "@teambit/scope": "1.0.667"
47
+ "@teambit/cli": "0.0.1245",
48
+ "@teambit/graph": "1.0.668",
49
+ "@teambit/workspace": "1.0.668",
50
+ "@teambit/aspect-loader": "1.0.668",
51
+ "@teambit/component-package-version": "0.0.440",
52
+ "@teambit/dependency-resolver": "1.0.668",
53
+ "@teambit/dev-files": "1.0.668",
54
+ "@teambit/legacy.consumer-component": "0.0.59",
55
+ "@teambit/logger": "0.0.1338",
56
+ "@teambit/scope": "1.0.668",
57
+ "@teambit/legacy.dependency-graph": "0.0.61",
58
+ "@teambit/component.sources": "0.0.110",
59
+ "@teambit/legacy.bit-map": "0.0.115",
60
+ "@teambit/legacy.consumer-config": "0.0.58",
61
+ "@teambit/legacy.consumer": "0.0.58",
62
+ "@teambit/legacy.extension-data": "0.0.60",
63
+ "@teambit/toolbox.fs.last-modified": "0.0.6"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/cli-table": "^0.3.0",
@@ -70,11 +70,11 @@
70
70
  "rewire": "7.0.0",
71
71
  "sinon": "17.0.1",
72
72
  "@types/mocha": "9.1.0",
73
- "@teambit/component.testing.mock-components": "0.0.321",
74
- "@teambit/harmony.testing.load-aspect": "0.0.316",
75
73
  "@teambit/defender.fs.global-bit-temp-dir": "0.0.1",
76
74
  "@teambit/harmony.envs.core-aspect-env": "0.0.72",
77
- "@teambit/workspace.testing.mock-workspace": "0.0.100"
75
+ "@teambit/component.testing.mock-components": "0.0.322",
76
+ "@teambit/harmony.testing.load-aspect": "0.0.317",
77
+ "@teambit/workspace.testing.mock-workspace": "0.0.101"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "chai": "5.2.1",