@tsmodule/tsmodule 41.37.0 → 41.38.0

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.
Files changed (2) hide show
  1. package/README.md +14 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -101,20 +101,32 @@ tsmodule build [--bundle]
101
101
  - Bundle CSS by default
102
102
  - Use Tailwind by default
103
103
 
104
- ### Optimize NPM dependencies with `-b, --bundle`
104
+ ### Optimize NPM dependencies with `build --bundle`
105
105
 
106
106
  With `-b, --bundle` mode, all entry points are compiled "in-place" and runtime NPM dependencies will generally not be needed as they will be inlined. If you build in bundle mode, you can move your dependencies to devDependencies, as the only thing that will be needed to run any/all compiled-in-place entry point(s) in your module are the bundles themselves.
107
107
 
108
- TSModule itself builds with `-b, --bundle` flag, and requires only two runtime NPM dependencies:
108
+ TSModule itself builds with `-b, --bundle` flag, and requires only three runtime NPM dependencies:
109
109
 
110
110
  1. `esbuild`, which does the heavy lifting for the build process, does not allow itself to be bundled
111
111
  2. `typescript`, so TSModule can use the built `tsc` binary to generate `.d.ts`
112
112
  type declarations during builds
113
+ 3. `pkg`, for building binaries with `build --binary` (which implies `--bundle`
114
+ and `--standalone src/bin.ts`).
113
115
 
114
116
  <sub>Note: Bundling every entry point in place may not be what you want, i.e. if you
115
117
  only have a single entrypoint. In these cases, `tsmodule build -b src/index.ts`
116
118
  is more appropriate.</sub>
117
119
 
120
+ ### Build executable binaries with `build --binary`
121
+
122
+ Uses Vercel's [`pkg`](https://github.com/vercel/pkg) to build binaries from
123
+ `src/bin.ts`.
124
+
125
+ <sub>**IMPORTANT:** This requires coercing to CJS, which is not possible if your
126
+ program uses top-level await. For now, replace with async closures and monitor
127
+ [this issue](https://github.com/vercel/pkg/issues/1291) for updates on full ESM
128
+ support.</sub>
129
+
118
130
  ### Run TypeScript directly
119
131
 
120
132
  ```
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tsmodule/tsmodule",
3
3
  "platform": "node",
4
4
  "type": "module",
5
- "version": "41.37.0",
5
+ "version": "41.38.0",
6
6
  "repository": "tsmodule/tsmodule",
7
7
  "description": "Create standardized TypeScript ESM packages for Node or browser.",
8
8
  "license": "MIT",