@hanzo/build 0.2.73 → 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.
- package/lib/plugins/index.d.ts +1 -1
- package/lib/plugins/index.js +5 -1
- package/lib/reply.js +6 -7
- package/package.json +1 -1
package/lib/plugins/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function usePlugins(t: Target): Plugins;
|
|
|
17
17
|
export declare function shelf(p: Plugins, g: GearState, c: Composer): Shelf;
|
|
18
18
|
/** The plugins this message asks, in the menu's order. */
|
|
19
19
|
export declare const active: (plugins: readonly Plugin[], g: Gear) => Plugin[];
|
|
20
|
-
/** Several plugins' preparations as one: system parts and replies in order, files together. */
|
|
20
|
+
/** Several plugins' preparations as one: system parts and replies in order, files together, the design system one made. */
|
|
21
21
|
export declare function merge(preps: readonly Prep[]): Prep;
|
|
22
22
|
/**
|
|
23
23
|
* Ask every plugin that is on what the message carries. A plugin that fails
|
package/lib/plugins/index.js
CHANGED
|
@@ -96,19 +96,23 @@ export function shelf(p, g, c) {
|
|
|
96
96
|
}
|
|
97
97
|
/** The plugins this message asks, in the menu's order. */
|
|
98
98
|
export const active = (plugins, g) => plugins.filter((p) => p.prepare && on(p, g));
|
|
99
|
-
/** Several plugins' preparations as one: system parts and replies in order, files together. */
|
|
99
|
+
/** Several plugins' preparations as one: system parts and replies in order, files together, the design system one made. */
|
|
100
100
|
export function merge(preps) {
|
|
101
101
|
const join = (k) => preps.map((p) => p[k]?.trim()).filter(Boolean).join('\n\n') || undefined;
|
|
102
102
|
const files = preps.flatMap((p) => p.files ?? []);
|
|
103
103
|
const out = {};
|
|
104
104
|
const system = join('system');
|
|
105
105
|
const reply = join('reply');
|
|
106
|
+
// A design system a plugin made is attached by the host (carry.tsx); dropped here, it never was.
|
|
107
|
+
const design = preps.map((p) => p.design).filter(Boolean).at(-1);
|
|
106
108
|
if (system)
|
|
107
109
|
out.system = system;
|
|
108
110
|
if (reply)
|
|
109
111
|
out.reply = reply;
|
|
110
112
|
if (files.length)
|
|
111
113
|
out.files = files;
|
|
114
|
+
if (design)
|
|
115
|
+
out.design = design;
|
|
112
116
|
return out;
|
|
113
117
|
}
|
|
114
118
|
/**
|
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
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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.
|
|
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.",
|