@sanity/pkg-utils 6.0.2 → 6.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/pkg-utils",
3
- "version": "6.0.2",
3
+ "version": "6.1.0",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -132,10 +132,10 @@
132
132
  "rollup-plugin-visualizer": "^5.12.0",
133
133
  "semver": "^7.6.0",
134
134
  "ts-node": "^10.9.2",
135
- "typescript": "5.4.2",
135
+ "typescript": "5.4.4",
136
136
  "vitest": "^1.4.0",
137
137
  "vitest-github-actions-reporter": "^0.11.1",
138
- "@sanity/pkg-utils": "6.0.2"
138
+ "@sanity/pkg-utils": "6.1.0"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "typescript": "5.4.x"
@@ -21,9 +21,21 @@ export function parseExports(options: {
21
21
  require: pkg.main && pkg.browser[pkg.main],
22
22
  import: pkg.module && pkg.browser[pkg.module],
23
23
  },
24
- require: pkg.main,
25
- import: pkg.module,
26
- default: pkg.module || pkg.main || '',
24
+ require: legacyExports
25
+ ? pkg.main
26
+ : typeof pkg.exports?.['.'] === 'object' && 'require' in pkg.exports['.']
27
+ ? pkg.exports['.'].require
28
+ : '',
29
+ import: legacyExports
30
+ ? pkg.module
31
+ : typeof pkg.exports?.['.'] === 'object' && 'import' in pkg.exports['.']
32
+ ? pkg.exports['.'].import
33
+ : '',
34
+ default: legacyExports
35
+ ? pkg.module || pkg.main || ''
36
+ : typeof pkg.exports?.['.'] === 'object' && 'default' in pkg.exports['.']
37
+ ? pkg.exports['.'].default || ''
38
+ : pkg.module || pkg.main || '',
27
39
  }
28
40
 
29
41
  const extraExports: (PkgExport & {_path: string})[] = []