bunchee 6.1.1 → 6.1.3

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/dist/bin/cli.js CHANGED
@@ -642,7 +642,7 @@ function lint$1(pkg) {
642
642
  }
643
643
  }
644
644
 
645
- var version = "6.1.1";
645
+ var version = "6.1.3";
646
646
 
647
647
  async function writeDefaultTsconfig(tsConfigPath) {
648
648
  await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
@@ -1035,8 +1035,9 @@ function logOutputState(stats) {
1035
1035
  // Logging shared in debug mode
1036
1036
  if (isPrivateExportPath(exportName)) {
1037
1037
  if (index === 0 && process.env.DEBUG) {
1038
- const sizePadding = ' '.repeat(Math.max(maxFilenameLength, 'File'.length) - 'private shared'.length);
1039
- console.log(pc.dim(normalizeExportName(exportName)), filenamePadding, pc.dim('private shared'), sizePadding, pc.dim(prettiedSize));
1038
+ const label = '(chunk)';
1039
+ const sizePadding = ' '.repeat(Math.max(maxFilenameLength, 'File'.length) - label.length);
1040
+ console.log(pc.dim(normalizeExportName(exportName)), filenamePadding, pc.dim(label), sizePadding, pc.dim(prettiedSize));
1040
1041
  }
1041
1042
  return;
1042
1043
  }
package/dist/index.js CHANGED
@@ -886,14 +886,26 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
886
886
  // Map private shared files to the dist directory
887
887
  // e.g. ./_utils.ts -> ./dist/_utils.js
888
888
  // TODO: improve the logic to only generate the required files, not all possible files
889
+ const isTs = isTypescriptFile(file);
890
+ const typesInfos = [
891
+ [
892
+ posixRelativify(path.posix.join('./dist', exportPath + (isEsmPkg ? '.d.ts' : '.d.mts'))),
893
+ condPart + 'import.types'
894
+ ],
895
+ [
896
+ posixRelativify(path.posix.join('./dist', exportPath + (isEsmPkg ? '.d.cts' : '.d.ts'))),
897
+ condPart + 'require.types'
898
+ ]
899
+ ];
889
900
  const privateExportInfo = [
901
+ ...isTs ? typesInfos : [],
890
902
  [
891
903
  posixRelativify(path.posix.join('./dist', exportPath + (isEsmPkg ? '.js' : '.mjs'))),
892
- condPart + 'import'
904
+ condPart + 'import.default'
893
905
  ],
894
906
  [
895
907
  posixRelativify(path.posix.join('./dist', exportPath + (isEsmPkg ? '.cjs' : '.js'))),
896
- condPart + 'require'
908
+ condPart + 'require.default'
897
909
  ]
898
910
  ];
899
911
  const exportsInfo = parsedExportsInfo.get(normalizedExportPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "6.1.1",
3
+ "version": "6.1.3",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",