bunup 0.8.59 → 0.8.60

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BunupPluginError
3
- } from "./chunk-ejk2cb90.js";
3
+ } from "./chunk-nha7rah1.js";
4
4
 
5
5
  // src/plugins/utils.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-ejk2cb90.js";
3
+ } from "./chunk-nha7rah1.js";
4
4
 
5
5
  // src/cli/utils.ts
6
6
  import pc from "picocolors";
@@ -3,7 +3,7 @@ import {
3
3
  filterBunupPlugins,
4
4
  runPluginBuildDoneHooks,
5
5
  runPluginBuildStartHooks
6
- } from "./chunk-1qbeyr8g.js";
6
+ } from "./chunk-2hw0xn1d.js";
7
7
  import {
8
8
  loadPackageJson
9
9
  } from "./chunk-gh7z7s46.js";
@@ -26,7 +26,7 @@ import {
26
26
  parseErrorMessage,
27
27
  setSilent,
28
28
  silent
29
- } from "./chunk-ejk2cb90.js";
29
+ } from "./chunk-nha7rah1.js";
30
30
 
31
31
  // src/build.ts
32
32
  import path from "path";
@@ -198,9 +198,15 @@ function getResolvedDtsSplitting(buildSplitting, dtsSplitting) {
198
198
  return dtsSplitting ?? buildSplitting ?? false;
199
199
  }
200
200
  var DEFAULT_ENTRY_NAMING = "[dir]/[name].[ext]";
201
- function getResolvedNaming(fmt, packageType) {
201
+ function getDefaultChunkNaming(name) {
202
+ return `shared/${name ?? "chunk"}-[hash].[ext]`;
203
+ }
204
+ function getResolvedNaming(fmt, packageType, name) {
202
205
  const replaceExt = (pattern) => pattern.replace(".[ext]", getDefaultOutputExtension(fmt, packageType));
203
- return replaceExt(DEFAULT_ENTRY_NAMING);
206
+ return {
207
+ entry: replaceExt(DEFAULT_ENTRY_NAMING),
208
+ chunk: replaceExt(getDefaultChunkNaming(name))
209
+ };
204
210
  }
205
211
  function getResolvedEnv(env) {
206
212
  return typeof env === "string" ? env : undefined;
@@ -275,7 +281,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
275
281
  const result = await Bun.build({
276
282
  entrypoints: entrypoints.map((file) => `${rootDir}/${file}`),
277
283
  format: fmt,
278
- naming: getResolvedNaming(fmt, packageType),
284
+ naming: getResolvedNaming(fmt, packageType, options.name),
279
285
  splitting: getResolvedSplitting(options.splitting, fmt),
280
286
  bytecode: getResolvedBytecode(options.bytecode, fmt),
281
287
  define: getResolvedDefine(options.define, options.env),
@@ -334,6 +340,9 @@ async function build(partialOptions, rootDir = process.cwd()) {
334
340
  cwd: rootDir,
335
341
  preferredTsConfigPath: options.preferredTsconfigPath,
336
342
  splitting: getResolvedDtsSplitting(options.splitting, splitting),
343
+ naming: {
344
+ chunk: getDefaultChunkNaming(options.name)
345
+ },
337
346
  ...dtsOptions
338
347
  });
339
348
  if (dtsResult.errors.length && !silent) {
@@ -341,7 +350,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
341
350
  }
342
351
  for (const fmt of options.format) {
343
352
  for (const file of dtsResult.files) {
344
- const dtsExtension = getDefaultDtsExtention(fmt, packageType);
353
+ const dtsExtension = getDefaultDtsExtention(fmt, packageType, file.kind);
345
354
  const relativePathToOutputDir = cleanPath(`${file.pathInfo.outputPathWithoutExtension}${dtsExtension}`);
346
355
  const relativePathToRootDir = cleanPath(`${options.outDir}/${relativePathToOutputDir}`);
347
356
  if (file.kind === "entry-point") {
@@ -367,7 +367,9 @@ function getDefaultOutputExtension(format, packageType) {
367
367
  return ".global.js";
368
368
  }
369
369
  }
370
- function getDefaultDtsExtention(format, packageType) {
370
+ function getDefaultDtsExtention(format, packageType, kind) {
371
+ if (kind === "chunk")
372
+ return ".d.ts";
371
373
  switch (format) {
372
374
  case "esm":
373
375
  return isModulePackage(packageType) ? ".d.ts" : ".d.mts";
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-gh7z7s46.js";
5
5
  import {
6
6
  displayBunupGradientArt
7
- } from "./chunk-j2cdjdgv.js";
7
+ } from "./chunk-b5fbznhk.js";
8
8
  import {
9
9
  formatListWithAnd,
10
10
  link
11
- } from "./chunk-ejk2cb90.js";
11
+ } from "./chunk-nha7rah1.js";
12
12
 
13
13
  // src/cli/init.ts
14
14
  import fs from "fs";
@@ -1,11 +1,11 @@
1
1
  // @bun
2
2
  import {
3
3
  displayBunupGradientArt
4
- } from "./chunk-j2cdjdgv.js";
4
+ } from "./chunk-b5fbznhk.js";
5
5
  import {
6
6
  link,
7
7
  pathExistsSync
8
- } from "./chunk-ejk2cb90.js";
8
+ } from "./chunk-nha7rah1.js";
9
9
 
10
10
  // src/cli/new.ts
11
11
  import { renameSync } from "fs";
package/dist/cli/index.js CHANGED
@@ -3,8 +3,8 @@
3
3
  import {
4
4
  build,
5
5
  createBuildOptions
6
- } from "../chunk-0575rhy8.js";
7
- import"../chunk-1qbeyr8g.js";
6
+ } from "../chunk-nbap2x28.js";
7
+ import"../chunk-2hw0xn1d.js";
8
8
  import {
9
9
  processLoadedConfigs
10
10
  } from "../chunk-gh7z7s46.js";
@@ -21,14 +21,14 @@ import {
21
21
  logger,
22
22
  parseErrorMessage,
23
23
  setSilent
24
- } from "../chunk-ejk2cb90.js";
24
+ } from "../chunk-nha7rah1.js";
25
25
 
26
26
  // src/cli/index.ts
27
27
  import { loadConfig } from "coffi";
28
28
  import pc3 from "picocolors";
29
29
  import { exec } from "tinyexec";
30
30
  // package.json
31
- var version = "0.8.59";
31
+ var version = "0.8.60";
32
32
 
33
33
  // src/watch.ts
34
34
  import path from "path";
@@ -482,12 +482,12 @@ var parseCliOptions = (argv) => {
482
482
  async function main(args = Bun.argv.slice(2)) {
483
483
  const cliOptions = parseCliOptions(args);
484
484
  if (cliOptions.new) {
485
- const { newProject } = await import("../chunk-ytm2nm1m.js");
485
+ const { newProject } = await import("../chunk-yqvr1jcz.js");
486
486
  await newProject();
487
487
  return;
488
488
  }
489
489
  if (cliOptions.init) {
490
- const { init } = await import("../chunk-0k59ad98.js");
490
+ const { init } = await import("../chunk-rf24zdyp.js");
491
491
  await init();
492
492
  return;
493
493
  }
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./chunk-0575rhy8.js";
5
- import"./chunk-1qbeyr8g.js";
4
+ } from "./chunk-nbap2x28.js";
5
+ import"./chunk-2hw0xn1d.js";
6
6
  import"./chunk-gh7z7s46.js";
7
- import"./chunk-ejk2cb90.js";
7
+ import"./chunk-nha7rah1.js";
8
8
  // src/define.ts
9
9
  function defineConfig(options) {
10
10
  return options;
package/dist/plugins.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getPackageForPlugin
4
- } from "./chunk-1qbeyr8g.js";
4
+ } from "./chunk-2hw0xn1d.js";
5
5
  import {
6
6
  CSS_RE,
7
7
  JS_DTS_RE,
@@ -9,7 +9,7 @@ import {
9
9
  cleanPath,
10
10
  isDirectoryPath,
11
11
  logger
12
- } from "./chunk-ejk2cb90.js";
12
+ } from "./chunk-nha7rah1.js";
13
13
 
14
14
  // src/plugins/built-in/copy.ts
15
15
  import { basename, join } from "path";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bunup",
3
3
  "description": "⚡ A blazing-fast build tool for your libraries built with Bun.",
4
- "version": "0.8.59",
4
+ "version": "0.8.60",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -53,7 +53,7 @@
53
53
  "picocolors": "^1.1.1",
54
54
  "replace-in-file": "^8.3.0",
55
55
  "tinyexec": "^1.0.1",
56
- "typeroll": "^0.6.16"
56
+ "typeroll": "^0.6.17"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/types": "^7.27.7",