@sanity/pkg-utils 4.3.1 → 4.4.1

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": "4.3.1",
3
+ "version": "4.4.1",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@babel/core": "^7.24.0",
64
64
  "@babel/types": "^7.24.0",
65
- "@microsoft/api-extractor": "^7.42.1",
65
+ "@microsoft/api-extractor": "^7.42.3",
66
66
  "@microsoft/tsdoc-config": "^0.16.2",
67
67
  "@rollup/plugin-alias": "^5.1.0",
68
68
  "@rollup/plugin-babel": "^6.0.4",
@@ -92,7 +92,7 @@
92
92
  "pretty-bytes": "^5.6.0",
93
93
  "prompts": "^2.4.2",
94
94
  "rimraf": "^4.4.1",
95
- "rollup": "^4.12.0",
95
+ "rollup": "^4.12.1",
96
96
  "rollup-plugin-esbuild": "^6.1.1",
97
97
  "rxjs": "^7.8.1",
98
98
  "treeify": "^1.1.0",
@@ -112,8 +112,8 @@
112
112
  "@types/rimraf": "^3.0.2",
113
113
  "@types/treeify": "^1.0.3",
114
114
  "@types/uuid": "^9.0.8",
115
- "@typescript-eslint/eslint-plugin": "^7.1.0",
116
- "@typescript-eslint/parser": "^7.1.0",
115
+ "@typescript-eslint/eslint-plugin": "^7.1.1",
116
+ "@typescript-eslint/parser": "^7.1.1",
117
117
  "browserslist-to-esbuild": "2.1.1",
118
118
  "commitizen": "^4.3.0",
119
119
  "cpx": "^1.5.0",
@@ -127,13 +127,13 @@
127
127
  "lint-staged": "^15.0.2",
128
128
  "npm-run-all2": "^6.1.2",
129
129
  "outdent": "^0.8.0",
130
- "recast": "^0.23.4",
130
+ "recast": "^0.23.5",
131
131
  "rollup-plugin-visualizer": "^5.12.0",
132
132
  "ts-node": "^10.9.2",
133
133
  "typescript": "^5.3.3",
134
134
  "vitest": "^1.3.1",
135
135
  "vitest-github-actions-reporter": "^0.11.1",
136
- "@sanity/pkg-utils": "4.3.1"
136
+ "@sanity/pkg-utils": "4.4.1"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "typescript": "^4.7 || ^5"
@@ -22,7 +22,7 @@ export async function loadPkgWithReporting(options: {
22
22
  const _exports = Object.entries(pkg.exports)
23
23
 
24
24
  for (const [expPath, exp] of _exports) {
25
- if (typeof exp === 'string') {
25
+ if (typeof exp === 'string' || 'svelte' in exp) {
26
26
  continue
27
27
  }
28
28
 
@@ -43,6 +43,8 @@ export function parseExports(options: {
43
43
  errors.push('package.json: `exports["./package.json"] must be "./package.json".')
44
44
  }
45
45
  }
46
+ } else if (isRecord(exportEntry) && 'svelte' in exportEntry) {
47
+ // @TODO should we report a warning or a debug message here about a detected svelte export that is ignored?
46
48
  } else if (isRecord(exportEntry)) {
47
49
  if (exportPath === '.') {
48
50
  if (
@@ -33,6 +33,11 @@ export interface PackageJSON {
33
33
  require?: string
34
34
  default: string
35
35
  }
36
+ | {
37
+ types?: string
38
+ svelte: string
39
+ default?: string
40
+ }
36
41
  >
37
42
  main?: string
38
43
  browser?: Record<string, string>
@@ -43,6 +43,11 @@ const pkgSchema = z.object({
43
43
  require: z.optional(z.string()),
44
44
  default: z.string(),
45
45
  }),
46
+ z.object({
47
+ types: z.optional(z.string()),
48
+ svelte: z.string(),
49
+ default: z.optional(z.string()),
50
+ }),
46
51
  ]),
47
52
  ),
48
53
  ),