bunup 0.5.11 → 0.5.13

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/plugins.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import _Bun from "bun";
2
2
 
3
- //#region packages/bunup/src/helpers/entry.d.ts
3
+ //#region src/helpers/entry.d.ts
4
4
  type ProcessableEntry = {
5
5
  fullPath: string;
6
6
  /**
@@ -15,7 +15,7 @@ type ProcessableEntry = {
15
15
  */
16
16
  outputBasePath: string;
17
17
  }; //#endregion
18
- //#region packages/bunup/src/types.d.ts
18
+ //#region src/types.d.ts
19
19
  type MaybePromise<T> = Promise<T> | T;
20
20
  type Arrayable<T> = T | T[];
21
21
  type Bun = typeof _Bun;
@@ -23,7 +23,7 @@ type BunBuildOptions = Parameters<Bun["build"]>[0];
23
23
  type BunPlugin = Exclude<BunBuildOptions["plugins"], undefined>[number];
24
24
 
25
25
  //#endregion
26
- //#region packages/bunup/src/options.d.ts
26
+ //#region src/options.d.ts
27
27
  type Loader = NonNullable<BunBuildOptions["loader"]>[string];
28
28
  type Define = BunBuildOptions["define"];
29
29
  type Sourcemap = BunBuildOptions["sourcemap"];
@@ -409,7 +409,10 @@ interface BuildOptions {
409
409
  dts: string;
410
410
  };
411
411
  } //#endregion
412
- //#region packages/bunup/src/plugins/types.d.ts
412
+ //#region src/plugins/types.d.ts
413
+ /**
414
+ * Represents a Bun plugin that can be used with Bunup
415
+ */
413
416
  type BunupBunPlugin = {
414
417
  /** Identifies this as a native Bun plugin */
415
418
  type: "bun";
@@ -418,6 +421,9 @@ type BunupBunPlugin = {
418
421
  /** The actual Bun plugin implementation */
419
422
  plugin: BunPlugin;
420
423
  };
424
+ /**
425
+ * Represents the output of a build operation
426
+ */
421
427
  type BuildOutput = {
422
428
  /** Array of generated files with their paths and contents */
423
429
  files: Array<{
@@ -427,12 +433,18 @@ type BuildOutput = {
427
433
  relativePathToRootDir: string;
428
434
  }>;
429
435
  };
436
+ /**
437
+ * Context provided to build hooks
438
+ */
430
439
  type BuildContext = {
431
440
  /** The build options that were used */
432
441
  options: BuildOptions;
433
442
  /** The output of the build */
434
443
  output: BuildOutput;
435
444
  };
445
+ /**
446
+ * Hooks that can be implemented by Bunup plugins
447
+ */
436
448
  type BunupPluginHooks = {
437
449
  /**
438
450
  * Called when a build is successfully completed
@@ -445,6 +457,9 @@ type BunupPluginHooks = {
445
457
  */
446
458
  onBuildStart?: (options: BuildOptions) => MaybePromise<void>;
447
459
  };
460
+ /**
461
+ * Represents a Bunup-specific plugin
462
+ */
448
463
  type BunupPlugin = {
449
464
  /** Identifies this as a Bunup-specific plugin */
450
465
  type: "bunup";
@@ -453,10 +468,13 @@ type BunupPlugin = {
453
468
  /** The hooks implemented by this plugin */
454
469
  hooks: BunupPluginHooks;
455
470
  };
471
+ /**
472
+ * Union type representing all supported plugin types
473
+ */
456
474
  type Plugin = BunupBunPlugin | BunupPlugin;
457
475
 
458
476
  //#endregion
459
- //#region packages/bunup/src/plugins/built-in/report.d.ts
477
+ //#region src/plugins/built-in/report.d.ts
460
478
  type ReportPluginOptions = {
461
479
  /**
462
480
  * The maximum bundle size in bytes.
@@ -470,6 +488,10 @@ type ReportPluginOptions = {
470
488
  */
471
489
  gzip?: boolean;
472
490
  };
491
+ /**
492
+ * A plugin that logs a report of the bundle size.
493
+ * @param options - The options for the report plugin.
494
+ */
473
495
  declare function report(options?: ReportPluginOptions): BunupPlugin;
474
496
 
475
497
  //#endregion
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.5.11",
4
+ "version": "0.5.13",
5
5
  "license": "MIT",
6
6
  "author": "Arshad Yaseen <m@arshadyaseen.com> (https://arshadyaseen.com)",
7
7
  "maintainers": [
@@ -18,35 +18,48 @@
18
18
  "funding": "https://github.com/sponsors/arshad-yaseen",
19
19
  "homepage": "https://bunup.dev",
20
20
  "keywords": ["bun", "bunup", "bun-bundler"],
21
- "files": ["dist"],
22
- "dependencies": {
23
- "chokidar": "^4.0.3",
24
- "coffi": "^0.1.26",
25
- "oxc-resolver": "^5.0.1",
26
- "oxc-transform": "^0.58.1",
27
- "rolldown": "1.0.0-beta.7",
28
- "rolldown-plugin-dts": "^0.9.4",
29
- "tinyexec": "^1.0.1",
30
- "ts-import-resolver": "^0.1.15"
31
- },
32
- "peerDependencies": {
33
- "typescript": ">=4.5.0"
34
- },
35
- "main": "./dist/index.js",
21
+ "type": "module",
22
+ "files": ["dist", "bin"],
23
+ "main": "./dist/index.cjs",
36
24
  "module": "./dist/index.js",
37
25
  "types": "./dist/index.d.ts",
38
26
  "exports": {
39
27
  ".": {
40
28
  "types": "./dist/index.d.ts",
41
- "default": "./dist/index.js"
29
+ "require": "./dist/index.cjs",
30
+ "import": "./dist/index.js"
42
31
  },
43
32
  "./plugins": {
44
33
  "types": "./dist/plugins.d.ts",
45
- "default": "./dist/plugins.js"
34
+ "require": "./dist/plugins.cjs",
35
+ "import": "./dist/plugins.js"
46
36
  }
47
37
  },
48
38
  "bin": {
49
- "bunup": "./dist/cli.js"
39
+ "bunup": "bin/bunup.mjs"
40
+ },
41
+ "dependencies": {
42
+ "@clack/prompts": "^0.10.1",
43
+ "chokidar": "^4.0.3",
44
+ "coffi": "^0.1.28",
45
+ "oxc-resolver": "^7.0.1",
46
+ "oxc-transform": "^0.67.0",
47
+ "package-manager-detector": "^1.2.0",
48
+ "rolldown": "1.0.0-beta.7",
49
+ "rolldown-plugin-dts": "^0.9.7",
50
+ "tinyexec": "^1.0.1",
51
+ "ts-import-resolver": "^0.1.16"
52
+ },
53
+ "devDependencies": {
54
+ "@biomejs/biome": "^1.9.4",
55
+ "@types/bun": "^1.2.5",
56
+ "bumpp": "^10.1.0",
57
+ "husky": "^9.1.7",
58
+ "lint-staged": "^15.5.1",
59
+ "typescript": "^5.8.3"
60
+ },
61
+ "peerDependencies": {
62
+ "typescript": ">=4.5.0"
50
63
  },
51
64
  "peerDependenciesMeta": {
52
65
  "typescript": {
@@ -54,9 +67,25 @@
54
67
  }
55
68
  },
56
69
  "scripts": {
57
- "npm-publish": "bun publish --access public --no-git-checks",
58
- "prepack": "cp ../../LICENSE .",
59
- "postpack": "rm LICENSE"
70
+ "benchmark": "bun run --cwd benchmarks benchmark",
71
+ "build": "bunx bunup@latest",
72
+ "build:docs": "bun run --cwd docs build",
73
+ "dev": "bunx bunup@latest --watch",
74
+ "dev:docs": "bun run --cwd docs dev",
75
+ "format": "biome format .",
76
+ "format:fix": "biome format --write .",
77
+ "lint": "biome check .",
78
+ "lint:fix": "biome check --write .",
79
+ "prepare": "husky",
80
+ "publish:ci": "bun publish --access public --no-git-checks",
81
+ "release": "bumpp",
82
+ "test": "bun test",
83
+ "test-build": "bun run --cwd tests build",
84
+ "tsc": "tsc --noEmit"
85
+ },
86
+ "lint-staged": {
87
+ "*": "bun run format:fix && git add .",
88
+ "src/**/*.(m|c)?(j|t)s": "bun run tsc"
60
89
  },
61
- "type": "module"
90
+ "workspaces": ["docs", "tests", "benchmarks"]
62
91
  }