quickbundle 0.0.0-next-5441a21 → 0.0.0-next-800b69a

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
@@ -11,11 +11,14 @@
11
11
  Quickbundle allows you to bundle a library in a **quick**, **fast** and **easy** way:
12
12
 
13
13
  - Fast build and watch mode powered by Rollup[^1] and SWC[^2].
14
+ - Compile mode to create a standalone binary for systems that do not have Node.js installed (relies on [Node.js single executable applications feature](https://nodejs.org/api/single-executable-applications.html)).
14
15
  - Zero configuration: define the build artifacts in your `package.json`, and you're all set!
15
16
  - Support of `cjs` & `esm` module formats output.
16
17
  - Support of several loaders including JavaScript, TypeScript, JSX, JSON, and Images.
17
18
  - TypeScript's declaration file (`.d.ts`) bundling.
18
- - Automatic dependency inclusion (`peerDependencies` and `dependencies` are not bundled in the final output, `devDependencies` are unless they're not imported).
19
+ - Automatic dependency inclusion:
20
+ - For the build/watch mode, `peerDependencies` and `dependencies` are not bundled in the final output, `devDependencies` are unless they're not imported.
21
+ - For the compile mode: all dependencies are included to make the code standalone.
19
22
 
20
23
  [^1]: A [module bundler](https://rollupjs.org/) optimized for better tree-shaking processing and seamless interoperability of CommonJS and ESM formats with minimal code footprint.
21
24
 
@@ -38,6 +41,9 @@ yarn add quickbundle
38
41
 
39
42
  2️⃣ Set up your package configuration (`package.json`):
40
43
 
44
+ <details>
45
+ <summary><strong>For building libraries</strong></summary>
46
+
41
47
  - When exporting exclusively ESM format:
42
48
 
43
49
  ```jsonc
@@ -53,8 +59,8 @@ yarn add quickbundle
53
59
  },
54
60
  "./otherModulePath": {
55
61
  // ...
56
- }
57
- }
62
+ },
63
+ },
58
64
  "scripts": {
59
65
  "build": "quickbundle build", // Production mode (optimizes bundle)
60
66
  "watch": "quickbundle watch", // Development mode (watches each file change)
@@ -80,8 +86,8 @@ yarn add quickbundle
80
86
  },
81
87
  "./otherModulePath": {
82
88
  // ...
83
- }
84
- }
89
+ },
90
+ },
85
91
  "scripts": {
86
92
  "build": "quickbundle build", // Production mode (optimizes bundle)
87
93
  "watch": "quickbundle watch", // Development mode (watches each file change)
@@ -90,6 +96,31 @@ yarn add quickbundle
90
96
  }
91
97
  ```
92
98
 
99
+ </details>
100
+
101
+ <details>
102
+ <summary><strong>For compiling single executable applications</strong></summary>
103
+
104
+ ```jsonc
105
+ {
106
+ "name": "lib", // Package name
107
+ "source": "./src/index.ts", // Source code entry point. Make sure that it starts with `#!/usr/bin/env node` pragme to make the binary portable for consumers who would like to use it by installing the package instead of using the generated standalone executable.
108
+ "bin": {
109
+ "your-binary-name": "./dist/index.cjs", // Binary information used to get the executable name from the key and, from the value, the build file to inject into the generated executable.
110
+ },
111
+ // "bin": "./dist/index.cjs", // Or, if the binary name follows the package name, you can define a string-based `bin` value.
112
+ "scripts": {
113
+ "build": "quickbundle compile",
114
+ },
115
+ // ...
116
+ }
117
+ ```
118
+
119
+ > [!warning] Limitations
120
+ > TODO
121
+
122
+ </details>
123
+
93
124
  3️⃣ Try it by running:
94
125
 
95
126
  ```bash
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ import os from 'node:os';
15
15
  import { gzipSize } from 'gzip-size';
16
16
 
17
17
  var name = "quickbundle";
18
- var version = "0.0.0-next-5441a21";
18
+ var version = "0.0.0-next-800b69a";
19
19
 
20
20
  const CWD = process.cwd();
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickbundle",
3
- "version": "0.0.0-next-5441a21",
3
+ "version": "0.0.0-next-800b69a",
4
4
  "description": "The zero-configuration transpiler and bundler for the web",
5
5
  "author": {
6
6
  "name": "Ayoub Adib",