robuild 0.1.4 → 0.1.5

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
@@ -97,21 +97,21 @@ Visit our documentation site for detailed guides, API reference, and examples.
97
97
  <!-- coverage-start -->
98
98
  | File | Stmts | Branch | Funcs | Lines |
99
99
  |------|-------|--------|-------|-------|
100
- | **All files** | **30.90%** | **64.07%** | **51.02%** | **30.90%** |
101
- | src/build.ts | 70.93% | 55.56% | 100.00% | 70.93% |
102
- | src/builders | 58.78% | 57.38% | 41.18% | 58.78% |
103
- | src/config | 19.62% | 65.00% | 46.67% | 19.62% |
104
- | src/config.ts | 0.00% | 100.00% | 100.00% | 0.00% |
105
- | src/core | 63.86% | 90.91% | 50.00% | 63.86% |
106
- | src/deprecated | 0.00% | 100.00% | 100.00% | 0.00% |
100
+ | **All files** | **45.60%** | **40.43%** | **45.72%** | **45.78%** |
101
+ | src/build.ts | 84.15% | 67.74% | 100.00% | 83.54% |
102
+ | src/builders | 79.83% | 71.76% | 85.19% | 79.83% |
103
+ | src/config | 42.31% | 26.21% | 56.67% | 42.06% |
104
+ | src/config.ts | 0.00% | 0.00% | 0.00% | 0.00% |
105
+ | src/core | 67.74% | 57.14% | 63.16% | 67.74% |
106
+ | src/deprecated | 0.00% | 0.00% | 0.00% | 0.00% |
107
107
  | src/index.ts | 0.00% | 0.00% | 0.00% | 0.00% |
108
- | src/plugins | 13.62% | 68.75% | 47.37% | 13.62% |
109
- | src/plugins/builtin | 7.65% | 92.31% | 23.33% | 7.65% |
110
- | src/plugins/extras | 0.00% | 100.00% | 100.00% | 0.00% |
111
- | src/transforms | 16.94% | 78.95% | 66.67% | 16.94% |
112
- | src/types.ts | 0.00% | 100.00% | 100.00% | 0.00% |
113
- | src/utils | 75.87% | 62.50% | 77.27% | 75.87% |
114
- | src/watch.ts | 4.24% | 0.00% | 0.00% | 4.24% |
108
+ | src/plugins | 7.50% | 8.33% | 18.42% | 7.63% |
109
+ | src/plugins/builtin | 16.46% | 18.03% | 23.08% | 16.51% |
110
+ | src/plugins/extras | 0.00% | 0.00% | 0.00% | 0.00% |
111
+ | src/transforms | 71.43% | 63.77% | 81.82% | 71.27% |
112
+ | src/types.ts | 0.00% | 0.00% | 0.00% | 0.00% |
113
+ | src/utils | 73.87% | 61.17% | 95.65% | 73.87% |
114
+ | src/watch.ts | 0.00% | 0.00% | 0.00% | 0.00% |
115
115
  <!-- coverage-end -->
116
116
 
117
117
  Run coverage locally:
@@ -132,5 +132,5 @@ pnpm test:coverage
132
132
  [bundle-href]: https://bundlephobia.com/result?p=robuild
133
133
  [license-src]: https://img.shields.io/github/license/Sunny-117/robuild.svg?style=flat&colorA=080f12&colorB=1fa669
134
134
  [license-href]: https://github.com/Sunny-117/robuild/blob/main/LICENSE
135
- [coverage-src]: https://img.shields.io/badge/coverage-30.9%25-orange?style=flat&colorA=080f12
135
+ [coverage-src]: https://img.shields.io/badge/coverage-45.6%25-yellow?style=flat&colorA=080f12
136
136
  [coverage-href]: #test-coverage
@@ -0,0 +1,3 @@
1
+ import { n as performBuild, t as build } from "./build-xQVEbj8V.mjs";
2
+
3
+ export { performBuild };
@@ -1083,7 +1083,8 @@ async function rolldownBuild(ctx, entry, hooks, config) {
1083
1083
  const res = await rolldown(formatConfig);
1084
1084
  const formatOutDir = fullOutDir;
1085
1085
  let entryFileName = `[name]${extension}`;
1086
- if (isMultiFormat) {
1086
+ if (entry.fileName) entryFileName = entry.fileName;
1087
+ else if (isMultiFormat) {
1087
1088
  if (format === "cjs" || format === "commonjs") entryFileName = `[name].cjs`;
1088
1089
  else if (format === "es" || format === "esm" || format === "module") entryFileName = `[name].mjs`;
1089
1090
  else if (format === "iife" || format === "umd") entryFileName = `[name].js`;
@@ -1206,7 +1207,8 @@ function normalizeBundleInputs(input, ctx) {
1206
1207
  * Unbundle mode: preserve file structure without bundling
1207
1208
  */
1208
1209
  async function unbundleTransform(ctx, entry) {
1209
- await processDirectoryUnbundled(isAbsolute(entry.input) ? entry.input : join(ctx.pkgDir, entry.input), join(ctx.pkgDir, entry.outDir || "dist"), entry);
1210
+ const inputDir = entry.input;
1211
+ await processDirectoryUnbundled(inputDir, entry.outDir || join(ctx.pkgDir, "dist"), entry);
1210
1212
  }
1211
1213
  /**
1212
1214
  * Process directory in unbundle mode
@@ -1763,7 +1765,7 @@ function createBuildResult(entries, startTime) {
1763
1765
  * Perform watch build using rolldown's built-in watch mode
1764
1766
  */
1765
1767
  async function performWatchBuild(config, ctx, startTime) {
1766
- const { performBuild } = await import("./build-BY2-r2pO.mjs");
1768
+ const { performBuild } = await import("./build-DdGjMqZ-.mjs");
1767
1769
  await performBuild(config, ctx, startTime);
1768
1770
  const bundleEntries = (config.entries || []).filter((entry) => {
1769
1771
  if (typeof entry === "string") return !entry.endsWith("/");
@@ -2,7 +2,7 @@
2
2
  var package_default = {
3
3
  name: "robuild",
4
4
  type: "module",
5
- version: "0.1.4",
5
+ version: "0.1.5",
6
6
  packageManager: "pnpm@10.11.1",
7
7
  description: "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc",
8
8
  license: "MIT",
@@ -71,6 +71,7 @@ var package_default = {
71
71
  "oxlint": "^1.49.0",
72
72
  "turbo": "^2.8.7",
73
73
  "vitepress": "^1.6.4",
74
+ "vitepress-plugin-group-icons": "^1.7.1",
74
75
  "vitest": "^4.0.18"
75
76
  }
76
77
  };
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { g as logger, h as configureLogger, t as build } from "./_chunks/build-UBcR7iC8.mjs";
2
+ import { g as logger, h as configureLogger, t as build } from "./_chunks/build-xQVEbj8V.mjs";
3
3
  import { colors } from "consola/utils";
4
4
  import process from "node:process";
5
5
  import { loadConfig } from "c12";
package/dist/config.d.mts CHANGED
@@ -84,6 +84,21 @@ interface _BuildEntry {
84
84
  * Defaults to `dist/` if not provided.
85
85
  */
86
86
  outDir?: string;
87
+ /**
88
+ * Custom output file name.
89
+ *
90
+ * Overrides the default naming convention. Should include the file extension.
91
+ * Only works with single-entry builds.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * {
96
+ * input: './src/index.ts',
97
+ * fileName: 'bundle.min.js'
98
+ * }
99
+ * ```
100
+ */
101
+ fileName?: string;
87
102
  /**
88
103
  * Avoid actual build but instead link to the source files.
89
104
  */
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createBrowserShimsPlugin, c as SHEBANG_RE, d as shebangPlugin, f as nodeProtocolPlugin, g as logger, i as DEFAULT_SHIMS_CONFIG, l as hasShebang, m as hasGlobImports, o as createNodeShimsPlugin, p as createGlobImportPlugin, r as createSkipNodeModulesPlugin, s as createShimsPlugin, t as build, u as makeExecutable } from "./_chunks/build-UBcR7iC8.mjs";
1
+ import { a as createBrowserShimsPlugin, c as SHEBANG_RE, d as shebangPlugin, f as nodeProtocolPlugin, g as logger, i as DEFAULT_SHIMS_CONFIG, l as hasShebang, m as hasGlobImports, o as createNodeShimsPlugin, p as createGlobImportPlugin, r as createSkipNodeModulesPlugin, s as createShimsPlugin, t as build, u as makeExecutable } from "./_chunks/build-xQVEbj8V.mjs";
2
2
  import { t as RobuildPluginManager } from "./_chunks/manager-uQxDLzY6.mjs";
3
3
  import { defineConfig } from "./config.mjs";
4
4
  import { extname } from "node:path";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "robuild",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "packageManager": "pnpm@10.11.1",
6
6
  "description": "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc",
7
7
  "license": "MIT",
@@ -72,6 +72,7 @@
72
72
  "oxlint": "^1.49.0",
73
73
  "turbo": "^2.8.7",
74
74
  "vitepress": "^1.6.4",
75
+ "vitepress-plugin-group-icons": "^1.7.1",
75
76
  "vitest": "^4.0.18"
76
77
  }
77
78
  }
@@ -1,3 +0,0 @@
1
- import { n as performBuild, t as build } from "./build-UBcR7iC8.mjs";
2
-
3
- export { performBuild };