@hono/cli 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.
Files changed (2) hide show
  1. package/dist/cli.js +10 -2
  2. package/package.json +2 -1
package/dist/cli.js CHANGED
@@ -81,6 +81,9 @@ async function* buildAndImportApp(filePath, options = {}) {
81
81
  preparePromise();
82
82
  const context2 = await esbuild.context({
83
83
  entryPoints: [filePath],
84
+ sourcemap: options.sourcemap ?? false,
85
+ sourcesContent: false,
86
+ sourceRoot: process.cwd(),
84
87
  bundle: true,
85
88
  write: false,
86
89
  format: "esm",
@@ -95,7 +98,11 @@ async function* buildAndImportApp(filePath, options = {}) {
95
98
  setup(build2) {
96
99
  build2.onEnd(async (result) => {
97
100
  try {
98
- const code = result.outputFiles?.[0]?.text || "";
101
+ let code = result.outputFiles?.[0]?.text || "";
102
+ if (options.sourcemap) {
103
+ code += `
104
+ //# sourceURL=file://${process.cwd()}/__hono_cli_bundle__.js`;
105
+ }
99
106
  const dataUrl = `data:text/javascript;base64,${Buffer.from(code).toString("base64")}`;
100
107
  const module = await import(dataUrl);
101
108
  const app = module.default;
@@ -270,7 +277,8 @@ function getBuildIterator(appPath, watch) {
270
277
  const appFilePath = realpathSync2(resolvedAppPath);
271
278
  return buildAndImportApp(appFilePath, {
272
279
  external: ["@hono/node-server"],
273
- watch
280
+ watch,
281
+ sourcemap: true
274
282
  });
275
283
  }
276
284
  async function executeRequest(app, requestPath, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "hono": "dist/cli.js"
@@ -43,6 +43,7 @@
43
43
  "@types/node": "^24.7.0",
44
44
  "eslint": "^9.37.0",
45
45
  "np": "^10.2.0",
46
+ "pkg-pr-new": "^0.0.62",
46
47
  "prettier": "^3.6.2",
47
48
  "publint": "^0.3.14",
48
49
  "tsup": "^8.5.0",