robuild 0.0.10 → 0.0.12

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
@@ -4,6 +4,12 @@
4
4
 
5
5
  # 📦 robuild 😯 [![npm](https://img.shields.io/npm/v/robuild.svg)](https://npmjs.com/package/robuild)
6
6
 
7
+ [![npm version][npm-version-src]][npm-version-href]
8
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
9
+ [![bundle][bundle-src]][bundle-href]
10
+ [![JSDocs][jsdocs-src]][jsdocs-href]
11
+ [![License][license-src]][license-href]
12
+
7
13
  English | <a href="./README-zh.md">简体中文</a>
8
14
 
9
15
  ⚡️ Zero-config ESM/TS package builder. Powered by [**Oxc**](https://oxc.rs/), [**Rolldown**](https://rolldown.rs/) and [**rolldown-plugin-dts**](https://github.com/sxzz/rolldown-plugin-dts).
@@ -89,4 +95,16 @@ Visit our documentation site for detailed guides, API reference, and examples.
89
95
 
90
96
  ## License
91
97
 
92
- 💛 Released under the [MIT](./LICENSE) license.
98
+ 💛 [MIT](./LICENSE) License © [Sunny-117](https://github.com/Sunny-117)
99
+ <!-- Badges -->
100
+
101
+ [npm-version-src]: https://img.shields.io/npm/v/robuild?style=flat&colorA=080f12&colorB=1fa669
102
+ [npm-version-href]: https://npmjs.com/package/robuild
103
+ [npm-downloads-src]: https://img.shields.io/npm/dm/robuild?style=flat&colorA=080f12&colorB=1fa669
104
+ [npm-downloads-href]: https://npmjs.com/package/robuild
105
+ [bundle-src]: https://img.shields.io/bundlephobia/minzip/robuild?style=flat&colorA=080f12&colorB=1fa669&label=minzip
106
+ [bundle-href]: https://bundlephobia.com/result?p=robuild
107
+ [license-src]: https://img.shields.io/github/license/Sunny-117/robuild.svg?style=flat&colorA=080f12&colorB=1fa669
108
+ [license-href]: https://github.com/Sunny-117/robuild/blob/main/LICENSE
109
+ [jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
110
+ [jsdocs-href]: https://www.jsdocs.io/package/robuild
@@ -1179,6 +1179,7 @@ async function rolldownBuild(ctx, entry, hooks, config) {
1179
1179
  banner: resolveChunkAddon(entry.banner, format),
1180
1180
  footer: resolveChunkAddon(entry.footer, format)
1181
1181
  };
1182
+ if (entry.sourcemap !== void 0) outConfig.sourcemap = entry.sourcemap;
1182
1183
  await hooks.rolldownOutput?.(outConfig, res, ctx);
1183
1184
  const { output } = await res.write(outConfig);
1184
1185
  await res.close();
@@ -1211,6 +1212,11 @@ async function rolldownBuild(ctx, entry, hooks, config) {
1211
1212
  const hashedFilePath = join(formatOutDir, hashedFileName);
1212
1213
  const { rename } = await import("node:fs/promises");
1213
1214
  await rename(finalFilePath, hashedFilePath);
1215
+ try {
1216
+ const mapOld = `${finalFilePath}.map`;
1217
+ const mapNew = `${hashedFilePath}.map`;
1218
+ await rename(mapOld, mapNew);
1219
+ } catch {}
1214
1220
  finalFileName = hashedFileName;
1215
1221
  finalFilePath = hashedFilePath;
1216
1222
  }
@@ -155,6 +155,14 @@ interface _BuildEntry {
155
155
  */
156
156
  define?: Record<string, string>;
157
157
  /**
158
+ * Generate source maps for built files.
159
+ *
160
+ * - `true` - emit separate `.map` files
161
+ * - `'inline'` - embed source maps in generated files
162
+ * - `'hidden'` - emit map files but do not add sourceMappingURL comment
163
+ */
164
+ sourcemap?: boolean | "inline" | "hidden" | Record<string, any>;
165
+ /**
158
166
  * External dependencies that should not be bundled.
159
167
  */
160
168
  external?: (string | RegExp)[] | ((id: string, importer?: string) => boolean);
@@ -395,6 +403,14 @@ interface BuildConfig {
395
403
  hooks?: BuildHooks;
396
404
  watch?: WatchOptions;
397
405
  /**
406
+ * Output directory for builds.
407
+ */
408
+ outDir?: string;
409
+ /**
410
+ * Clean output directory before build.
411
+ */
412
+ clean?: boolean | string[];
413
+ /**
398
414
  * Plugins to use during build
399
415
  */
400
416
  plugins?: RobuildPlugin[];
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var name = "robuild";
3
3
  var type = "module";
4
- var version = "0.0.10";
4
+ var version = "0.0.12";
5
5
  var packageManager = "pnpm@10.11.1";
6
6
  var description = "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc";
7
7
  var license = "MIT";
@@ -27,7 +27,8 @@ var scripts = {
27
27
  "test:types": "tsc --noEmit --skipLibCheck",
28
28
  "docs:dev": "vitepress dev docs",
29
29
  "docs:build": "vitepress build docs",
30
- "docs:preview": "vitepress preview docs"
30
+ "docs:preview": "vitepress preview docs",
31
+ "commit": "git-cz"
31
32
  };
32
33
  var dependencies = {
33
34
  "c12": "^3.0.4",
@@ -58,6 +59,7 @@ var devDependencies = {
58
59
  "changelogen": "^0.6.1",
59
60
  "eslint": "^9.28.0",
60
61
  "esno": "^4.8.0",
62
+ "git-cz": "^4.9.0",
61
63
  "prettier": "^3.5.3",
62
64
  "vitepress": "^1.6.3",
63
65
  "vitest": "^3.2.2"
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { build } from "./_chunks/build-C8jF81Ux.mjs";
2
+ import { build } from "./_chunks/build-BFnZNGy3.mjs";
3
3
  import { consola } from "consola";
4
4
  import { parseArgs } from "node:util";
5
5
  import { loadConfig } from "c12";
package/dist/config.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { defineConfig } from "./_chunks/config-CeOzkcue.mjs";
1
+ import { defineConfig } from "./_chunks/config-BDpkh_pL.mjs";
2
2
  export { defineConfig };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildConfig, BuildEntry, BundleEntry, TransformEntry, defineConfig } from "./_chunks/config-CeOzkcue.mjs";
1
+ import { BuildConfig, BuildEntry, BundleEntry, TransformEntry, defineConfig } from "./_chunks/config-BDpkh_pL.mjs";
2
2
 
3
3
  //#region src/build.d.ts
4
4
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { build } from "./_chunks/build-C8jF81Ux.mjs";
1
+ import { build } from "./_chunks/build-BFnZNGy3.mjs";
2
2
  import { defineConfig } from "./_chunks/config-B_2eqpNJ.mjs";
3
3
 
4
4
  export { build, defineConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "robuild",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
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",
@@ -29,7 +29,8 @@
29
29
  "test:types": "tsc --noEmit --skipLibCheck",
30
30
  "docs:dev": "vitepress dev docs",
31
31
  "docs:build": "vitepress build docs",
32
- "docs:preview": "vitepress preview docs"
32
+ "docs:preview": "vitepress preview docs",
33
+ "commit": "git-cz"
33
34
  },
34
35
  "dependencies": {
35
36
  "c12": "^3.0.4",
@@ -60,6 +61,7 @@
60
61
  "changelogen": "^0.6.1",
61
62
  "eslint": "^9.28.0",
62
63
  "esno": "^4.8.0",
64
+ "git-cz": "^4.9.0",
63
65
  "prettier": "^3.5.3",
64
66
  "vitepress": "^1.6.3",
65
67
  "vitest": "^3.2.2"