@hanzo/build 0.2.74 → 0.2.75

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/lib/reply.js +6 -7
  2. package/package.json +1 -1
package/lib/reply.js CHANGED
@@ -28,14 +28,13 @@ const suffix = (s) => {
28
28
  const dot = s.lastIndexOf('.');
29
29
  return dot > 0 ? s.slice(dot + 1).toLowerCase() : '';
30
30
  };
31
- /** An info string is a file name (a dot, no spaces) or a language. */
31
+ /** An info string is a language, a file name (a dot, no spaces), or both (`html index.html`): the file name wins. */
32
32
  const called = (info, n) => {
33
- const word = info.trim().split(/\s+/)[0] ?? '';
34
- if (!word)
35
- return `Block ${n}`;
36
- if (word.includes('.') && suffix(word))
37
- return word;
38
- return `${word} block`;
33
+ const words = info.trim().split(/\s+/).filter(Boolean);
34
+ const file = words.find((w) => w.includes('.') && suffix(w));
35
+ if (file)
36
+ return file;
37
+ return words[0] ? `${words[0]} block` : `Block ${n}`;
39
38
  };
40
39
  /** Every fenced block in `text`, in order. */
41
40
  export function artifacts(text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/build",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "description": "Hanzo Build — say what you want, watch it built, deployed and running. The builder as a component, mounted by the Hanzo app at hanzo.ai.",