@gajae-code/utils 0.9.4 → 0.9.6

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/package.json +2 -2
  2. package/src/prompt.ts +6 -6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/utils",
4
- "version": "0.9.4",
4
+ "version": "0.9.6",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@gajae-code/natives": "0.9.4",
34
+ "@gajae-code/natives": "0.9.6",
35
35
  "beautiful-mermaid": "^1.1.3",
36
36
  "handlebars": "^4.7.9",
37
37
  "winston": "^3.19.0",
package/src/prompt.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { createRequire } from "node:module";
2
1
  import type { HelperDelegate, HelperOptions, Template, TemplateDelegate } from "handlebars";
3
2
 
4
3
  export type { HelperDelegate, HelperOptions, Template, TemplateDelegate };
@@ -226,15 +225,16 @@ export interface TemplateContext extends Record<string, unknown> {
226
225
  type HandlebarsRuntime = typeof import("handlebars");
227
226
  type HandlebarsInstance = ReturnType<HandlebarsRuntime["create"]>;
228
227
 
229
- const require = createRequire(import.meta.url);
230
- const COMPILED_HANDLEBARS_PATH = "/$bunfs/root/node_modules/handlebars/lib/index.js";
231
228
  let handlebars: HandlebarsInstance | undefined;
232
229
 
233
230
  function getHandlebars(): HandlebarsInstance {
234
231
  if (handlebars) return handlebars;
235
- const Handlebars = asHandlebarsRuntime(
236
- require(process.env.PI_COMPILED === "true" ? COMPILED_HANDLEBARS_PATH : "handlebars"),
237
- );
232
+ // Lazy bare-literal require: statically traceable, so the bundler always
233
+ // embeds handlebars in the main bundle (compiled binaries included), while
234
+ // the module still loads only on first template render. The previous
235
+ // bunfs extra-entrypoint require crashed v0.9.3–v0.9.6 compiled releases
236
+ // at startup when --minify dropped the entrypoint (#1939).
237
+ const Handlebars = asHandlebarsRuntime(require("handlebars"));
238
238
  handlebars = Handlebars.create();
239
239
  registerBuiltinHelpers(handlebars);
240
240
  return handlebars;