bunchee 6.9.2 → 6.9.4

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/README.md CHANGED
@@ -550,6 +550,14 @@ export { readme, config, styles, content }
550
550
 
551
551
  All these imports will be bundled as string content, regardless of the original file extension.
552
552
 
553
+ ### Agent Skills
554
+
555
+ If you want to use bunchee with coding agents with skills, run:
556
+
557
+ ```sh
558
+ npx skills add huozhi/npm-skills
559
+ ```
560
+
553
561
  ### Node.js API
554
562
 
555
563
  ```ts
package/dist/bin/cli.js CHANGED
@@ -856,7 +856,7 @@ async function lint$1(cwd) {
856
856
  }
857
857
  }
858
858
 
859
- var version = "6.9.2";
859
+ var version = "6.9.4";
860
860
 
861
861
  async function writeDefaultTsconfig(tsConfigPath) {
862
862
  await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
@@ -1046,10 +1046,14 @@ function createExportCondition(exportName, sourceFile, moduleType, esmOnly = fal
1046
1046
  if (exportName === '.') {
1047
1047
  exportName = 'index';
1048
1048
  }
1049
+ const outputPathPrefix = esmOnly ? '' : 'es';
1049
1050
  if (isTsSourceFile) {
1050
- const importCondition = {
1051
- types: getDistPath('es', `${exportName}.${dtsExtensionsMap[esmExtension]}`),
1052
- default: getDistPath('es', `${exportName}.${esmExtension}`)
1051
+ const importCondition = esmOnly ? {
1052
+ types: getDistPath(outputPathPrefix, `${exportName}.${dtsExtensionsMap[esmExtension]}`),
1053
+ default: getDistPath(`${exportName}.${esmExtension}`)
1054
+ } : {
1055
+ types: getDistPath(outputPathPrefix, `${exportName}.${dtsExtensionsMap[esmExtension]}`),
1056
+ default: getDistPath(outputPathPrefix, `${exportName}.${esmExtension}`)
1053
1057
  };
1054
1058
  if (esmOnly) {
1055
1059
  return importCondition;
@@ -1081,8 +1085,9 @@ function createExportConditionPair(exportName, sourceFile, moduleType, esmOnly =
1081
1085
  // ./index.develop -> index
1082
1086
  // ./foo.react-server -> foo
1083
1087
  const fileBaseName = exportName.split('.').slice(0, 2).join('.').replace('./', '');
1088
+ const fileName = `${fileBaseName}-${specialConditionName}.mjs`;
1084
1089
  specialCondition = {
1085
- [specialConditionName]: getDistPath('es', `${fileBaseName}-${specialConditionName}.mjs`)
1090
+ [specialConditionName]: getDistPath(esmOnly ? '' : 'es', fileName)
1086
1091
  };
1087
1092
  return [
1088
1093
  normalizedExportPath,
@@ -1221,7 +1226,6 @@ async function prepare(cwd, options) {
1221
1226
  if (esmOnly) {
1222
1227
  // When esmOnly is true, mainExport is either a string or an object with types/default
1223
1228
  pkgJson.main = isUsingTs ? typeof mainExport === 'object' ? mainExport.default : mainExport : typeof mainExport === 'string' ? mainExport : mainExport.default;
1224
- pkgJson.module = isUsingTs ? typeof mainExport === 'object' ? mainExport.default : mainExport : typeof mainExport === 'string' ? mainExport : mainExport.default;
1225
1229
  if (isUsingTs && typeof mainExport === 'object') {
1226
1230
  pkgJson.types = mainExport.types;
1227
1231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "6.9.2",
3
+ "version": "6.9.4",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",
@@ -78,8 +78,7 @@
78
78
  "yargs": "^17.7.2"
79
79
  },
80
80
  "peerDependencies": {
81
- "typescript": "^4.1 || ^5.0",
82
- "@typescript/native-preview": "*"
81
+ "typescript": "^4.1 || ^5.0"
83
82
  },
84
83
  "peerDependenciesMeta": {
85
84
  "typescript": {
@@ -87,9 +86,6 @@
87
86
  },
88
87
  "@swc/helpers": {
89
88
  "optional": true
90
- },
91
- "@typescript/native-preview": {
92
- "optional": true
93
89
  }
94
90
  },
95
91
  "devDependencies": {
@@ -107,7 +103,7 @@
107
103
  "cross-env": "^7.0.3",
108
104
  "husky": "^9.0.11",
109
105
  "lint-staged": "^15.2.2",
110
- "next": "16.0.10",
106
+ "next": "16.1.1-canary.31",
111
107
  "picocolors": "^1.0.0",
112
108
  "postcss": "^8.5.4",
113
109
  "prettier": "3.4.2",