@ms-cloudpack/package-utilities 3.1.5 → 4.0.0

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 (55) hide show
  1. package/lib/PackageDefinitions.d.ts +21 -5
  2. package/lib/PackageDefinitions.d.ts.map +1 -1
  3. package/lib/PackageDefinitions.js +29 -17
  4. package/lib/PackageDefinitions.js.map +1 -1
  5. package/lib/addExportsMapEntry.d.ts +3 -5
  6. package/lib/addExportsMapEntry.d.ts.map +1 -1
  7. package/lib/addExportsMapEntry.js +3 -3
  8. package/lib/addExportsMapEntry.js.map +1 -1
  9. package/lib/createExportsMap.d.ts +4 -2
  10. package/lib/createExportsMap.d.ts.map +1 -1
  11. package/lib/createExportsMap.js +14 -12
  12. package/lib/createExportsMap.js.map +1 -1
  13. package/lib/createImportMap.d.ts +6 -3
  14. package/lib/createImportMap.d.ts.map +1 -1
  15. package/lib/createImportMap.js +7 -8
  16. package/lib/createImportMap.js.map +1 -1
  17. package/lib/createResolveMap/addLinkedEntryDependencies.d.ts +4 -3
  18. package/lib/createResolveMap/addLinkedEntryDependencies.d.ts.map +1 -1
  19. package/lib/createResolveMap/addLinkedEntryDependencies.js +6 -6
  20. package/lib/createResolveMap/addLinkedEntryDependencies.js.map +1 -1
  21. package/lib/createResolveMap/createResolveMap.d.ts +3 -2
  22. package/lib/createResolveMap/createResolveMap.d.ts.map +1 -1
  23. package/lib/createResolveMap/createResolveMap.js +4 -6
  24. package/lib/createResolveMap/createResolveMap.js.map +1 -1
  25. package/lib/createResolveMap/diffResolveMaps.js +1 -2
  26. package/lib/createResolveMap/diffResolveMaps.js.map +1 -1
  27. package/lib/createResolveMap/findPackagesFromPath.d.ts +6 -5
  28. package/lib/createResolveMap/findPackagesFromPath.d.ts.map +1 -1
  29. package/lib/createResolveMap/findPackagesFromPath.js +7 -7
  30. package/lib/createResolveMap/findPackagesFromPath.js.map +1 -1
  31. package/lib/createResolveMap/linkPath.d.ts +3 -2
  32. package/lib/createResolveMap/linkPath.d.ts.map +1 -1
  33. package/lib/createResolveMap/linkPath.js +11 -10
  34. package/lib/createResolveMap/linkPath.js.map +1 -1
  35. package/lib/findFileInPackage.d.ts +4 -1
  36. package/lib/findFileInPackage.d.ts.map +1 -1
  37. package/lib/findFileInPackage.js +3 -3
  38. package/lib/findFileInPackage.js.map +1 -1
  39. package/lib/findPackagePath.d.ts +3 -0
  40. package/lib/findPackagePath.d.ts.map +1 -1
  41. package/lib/findPackagePath.js +3 -3
  42. package/lib/findPackagePath.js.map +1 -1
  43. package/lib/flattenExportsMap.d.ts.map +1 -1
  44. package/lib/flattenExportsMap.js +3 -3
  45. package/lib/flattenExportsMap.js.map +1 -1
  46. package/lib/getExportsMap.d.ts +5 -3
  47. package/lib/getExportsMap.d.ts.map +1 -1
  48. package/lib/getExportsMap.js +5 -13
  49. package/lib/getExportsMap.js.map +1 -1
  50. package/lib/getVersion.d.ts +3 -1
  51. package/lib/getVersion.d.ts.map +1 -1
  52. package/lib/getVersion.js +4 -2
  53. package/lib/getVersion.js.map +1 -1
  54. package/lib/tsdoc-metadata.json +1 -1
  55. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../src/getVersion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,IAAI,OAAO,GAAG,aAAa,CAAC;IAC5B,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAE5E,IAAI,WAAW,IAAI,iBAAiB,CAAC,WAAW,CAAC,EAAE;QACjD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAE/D,gDAAgD;QAChD,OAAO,GAAI,YAAY,CAAC,eAAe,CAAiB,CAAC,OAAO,IAAI,OAAO,CAAC;KAC7E;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/bundler-types';\nimport { readJsonSync } from '@ms-cloudpack/json-utilities';\nimport { findPackageRoot } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { isExternalPackage } from './isExternalPackage.js';\n\n/**\n * Returns the version of the package which contains the import url provided.\n * @param importUrl - import.meta.url\n * @returns - the version of the package. If the package is not in node_modules, it returns \"0.0.0-local\".\n */\nexport function getVersion(importUrl: string): string {\n let version = '0.0.0-local';\n const packagePath = findPackageRoot(path.dirname(fileURLToPath(importUrl)));\n\n if (packagePath && isExternalPackage(packagePath)) {\n const packageJSONpath = path.join(packagePath, 'package.json');\n\n // eslint-disable-next-line no-restricted-syntax\n version = (readJsonSync(packageJSONpath) as PackageJson).version || version;\n }\n\n return version;\n}\n"]}
1
+ {"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../src/getVersion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,OAAO,GAAG,eAAe,WAAW,EAAE,CAAC;IAE3C,IAAI,WAAW,IAAI,iBAAiB,CAAC,WAAW,CAAC,EAAE;QACjD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAE/D,gDAAgD;QAChD,OAAO,GAAI,YAAY,CAAC,eAAe,CAAiB,CAAC,OAAO,IAAI,OAAO,CAAC;KAC7E;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/bundler-types';\nimport { readJsonSync } from '@ms-cloudpack/json-utilities';\nimport { findPackageRoot } from '@ms-cloudpack/path-utilities';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { isExternalPackage } from './isExternalPackage.js';\n\n/**\n * Returns the displayable version of the package which contains the import url provided. If the package\n * is a local package rather than a node_modules external package, we display the version as \"0.0.0-local\"\n * with the path following it.\n * @param importUrl - import.meta.url\n * @returns - the version of the package. If the package is not in node_modules, it returns \"0.0.0-local\".\n */\nexport function getVersion(importUrl: string): string {\n const packagePath = findPackageRoot(path.dirname(fileURLToPath(importUrl)));\n let version = `0.0.0-local ${packagePath}`;\n\n if (packagePath && isExternalPackage(packagePath)) {\n const packageJSONpath = path.join(packagePath, 'package.json');\n\n // eslint-disable-next-line no-restricted-syntax\n version = (readJsonSync(packageJSONpath) as PackageJson).version || version;\n }\n\n return version;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.0"
8
+ "packageVersion": "7.36.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/package-utilities",
3
- "version": "3.1.5",
3
+ "version": "4.0.0",
4
4
  "description": "Utilities for resolving/parsing packages and their imports.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,11 +15,11 @@
15
15
  "dependencies": {
16
16
  "@babel/parser": "^7.16.12",
17
17
  "@babel/traverse": "^7.16.10",
18
- "@ms-cloudpack/bundler-types": "^0.14.0",
19
- "@ms-cloudpack/json-utilities": "^0.0.6",
20
- "@ms-cloudpack/package-overrides": "^0.3.9",
21
- "@ms-cloudpack/path-utilities": "^2.3.0",
22
- "@ms-cloudpack/path-string-parsing": "^1.0.2",
18
+ "@ms-cloudpack/bundler-types": "^0.16.0",
19
+ "@ms-cloudpack/json-utilities": "^0.0.7",
20
+ "@ms-cloudpack/package-overrides": "^0.3.11",
21
+ "@ms-cloudpack/path-utilities": "^2.3.1",
22
+ "@ms-cloudpack/path-string-parsing": "^1.0.3",
23
23
  "fast-glob": "^3.2.12",
24
24
  "merge": "^2.1.1",
25
25
  "resolve": "^1.22.0",