@astral/pack 1.4.3 → 1.5.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.
|
@@ -46,6 +46,9 @@ const initExportsGenerator = ({ packageExports, format, lang }) => (originPackag
|
|
|
46
46
|
return packageJson;
|
|
47
47
|
}
|
|
48
48
|
const rootExports = {};
|
|
49
|
+
if (typeof rootExports === 'string') {
|
|
50
|
+
return originPackageJson;
|
|
51
|
+
}
|
|
49
52
|
if (format.includes('esm')) {
|
|
50
53
|
rootExports.module = './index.js';
|
|
51
54
|
}
|
|
@@ -57,11 +57,16 @@ exports.validateConfig = v.object({
|
|
|
57
57
|
return objectError;
|
|
58
58
|
}
|
|
59
59
|
const errors = Object.values(value)
|
|
60
|
-
.map((exportValue) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
.map((exportValue) => {
|
|
61
|
+
if (typeof exportValue === 'string') {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
return v.object({
|
|
65
|
+
require: v.string(),
|
|
66
|
+
module: v.string(),
|
|
67
|
+
types: v.string(),
|
|
68
|
+
})(exportValue);
|
|
69
|
+
})
|
|
65
70
|
.filter(Boolean);
|
|
66
71
|
return errors[0];
|
|
67
72
|
},
|
package/config/types.d.ts
CHANGED