@dexhq/canvas 0.13.0 → 0.15.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 (341) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +21 -18
  3. package/app/canvas/activity.tsx +8 -15
  4. package/app/canvas/anchoring.ts +3 -5
  5. package/app/canvas/canvas-input.ts +151 -14
  6. package/app/canvas/canvas-keys.ts +9 -0
  7. package/app/canvas/canvas-model.ts +5 -42
  8. package/app/canvas/canvas-panels.ts +1 -17
  9. package/app/canvas/canvas-scene.ts +7 -3
  10. package/app/canvas/canvas-ui.ts +2 -1
  11. package/app/canvas/canvas.css +61 -26
  12. package/app/canvas/change-notice.tsx +10 -1
  13. package/app/canvas/comment-layer.tsx +2 -1
  14. package/app/canvas/comments.tsx +204 -82
  15. package/app/canvas/element-picker.ts +200 -27
  16. package/app/canvas/engine/canvas-gestures.ts +72 -17
  17. package/app/canvas/engine/canvas-store.ts +17 -1
  18. package/app/canvas/engine/engine.css +6 -3
  19. package/app/canvas/find-bar.tsx +817 -0
  20. package/app/canvas/find-model.ts +135 -0
  21. package/app/canvas/flow-canvas.tsx +18 -2
  22. package/app/canvas/follow-pin.ts +26 -6
  23. package/app/canvas/frame-node.tsx +43 -26
  24. package/app/canvas/imported-reviews.tsx +12 -22
  25. package/app/canvas/layout.ts +27 -0
  26. package/app/canvas/live-page.ts +142 -19
  27. package/app/canvas/page-find.ts +220 -0
  28. package/app/canvas/page-style.ts +23 -0
  29. package/app/canvas/section-node.tsx +2 -0
  30. package/app/canvas/spec-threads.ts +24 -23
  31. package/app/canvas/thread-focus.tsx +14 -12
  32. package/app/canvas/tool-cursors.ts +16 -16
  33. package/app/canvas/use-activity.ts +0 -8
  34. package/app/canvas/use-agent-changes.tsx +34 -40
  35. package/app/canvas/use-canvas-clipboard.tsx +11 -14
  36. package/app/canvas/xray.ts +3 -12
  37. package/app/frame.tsx +5 -0
  38. package/app/i18n/locales/en/messages.po +114 -12
  39. package/app/i18n/locales/en/messages.ts +1 -1
  40. package/app/i18n/locales/pseudo/messages.po +114 -12
  41. package/app/i18n/locales/pseudo/messages.ts +1 -1
  42. package/app/icons/{sets/lucide.tsx → glyphs.tsx} +7 -5
  43. package/app/icons/index.tsx +3 -3
  44. package/app/icons/types.ts +3 -10
  45. package/app/index.html +3 -3
  46. package/app/main.tsx +3 -0
  47. package/app/pages/canvas-settings.tsx +35 -0
  48. package/app/pages/canvas.tsx +27 -8
  49. package/app/pages/commands-settings.tsx +16 -2
  50. package/app/shell/about.tsx +5 -4
  51. package/app/shell/feedback-details.ts +0 -3
  52. package/app/shell/feedback-form.tsx +10 -21
  53. package/app/shell/feedback-link.tsx +2 -1
  54. package/app/shell/instructions-editor.tsx +1 -1
  55. package/app/shell/presence-style.ts +59 -0
  56. package/app/shell/presence.tsx +6 -3
  57. package/app/shell/scaled-frame.tsx +21 -9
  58. package/app/shell/settings-sections.ts +12 -0
  59. package/app/shell/sidebar.tsx +1 -1
  60. package/app/studio-ui.d.ts +0 -9
  61. package/app/types.ts +21 -205
  62. package/app/ui/file-drop.ts +128 -0
  63. package/app/ui/prompt-editor.tsx +1 -1
  64. package/app/ui/shadcn/input-group.tsx +2 -2
  65. package/dist/cli/banner.d.mts +4 -2
  66. package/dist/cli/banner.mjs +34 -11
  67. package/dist/cli/commands/app.mjs +19 -11
  68. package/dist/cli/commands/create.d.mts +26 -14
  69. package/dist/cli/commands/create.mjs +13 -7
  70. package/dist/cli/commands/dev.mjs +2 -3
  71. package/dist/cli/commands/hook.mjs +2 -1
  72. package/dist/cli/commands/init.d.mts +11 -6
  73. package/dist/cli/help.d.mts +1 -1
  74. package/dist/cli/help.mjs +3 -3
  75. package/dist/cli/main.d.mts +22 -12
  76. package/dist/config/index.d.mts +6 -5
  77. package/dist/config/project-files.d.mts +6 -3
  78. package/dist/config/project-files.mjs +14 -5
  79. package/dist/config/renamed.d.mts +0 -2
  80. package/dist/config/renamed.mjs +1 -3
  81. package/dist/config/schema.d.mts +0 -5
  82. package/dist/config/schema.mjs +0 -5
  83. package/dist/content/capture.d.mts +2 -2
  84. package/dist/content/capture.mjs +2 -2
  85. package/dist/content/content.d.mts +3 -141
  86. package/dist/content/content.mjs +7 -65
  87. package/dist/content/flow-specs.mjs +1 -1
  88. package/dist/content/prototype-summary.d.mts +3 -39
  89. package/dist/content/prototype-summary.mjs +2 -3
  90. package/dist/content/prototypes.mjs +1 -1
  91. package/dist/content/snapshot-client.mjs +1 -1
  92. package/dist/content/text-replace.d.mts +30 -0
  93. package/dist/content/text-replace.mjs +309 -0
  94. package/dist/content/thread-module.mjs +1 -1
  95. package/dist/content/threads.mjs +1 -1
  96. package/dist/paths.d.mts +0 -2
  97. package/dist/paths.mjs +1 -3
  98. package/dist/server/agent-env.d.mts +5 -1
  99. package/dist/server/agent-env.mjs +7 -2
  100. package/dist/server/agent-session.d.mts +14 -1
  101. package/dist/server/agent-session.mjs +84 -19
  102. package/dist/server/brief.mjs +3 -3
  103. package/dist/server/build-pictures.mjs +1 -1
  104. package/dist/server/channel.d.mts +19 -24
  105. package/dist/server/channel.mjs +70 -37
  106. package/dist/server/claimed-presence.d.mts +18 -0
  107. package/dist/server/claimed-presence.mjs +58 -0
  108. package/dist/server/close-check.mjs +2 -2
  109. package/dist/server/comments/actions.d.mts +153 -0
  110. package/dist/server/comments/actions.mjs +154 -0
  111. package/dist/server/comments/routes.d.mts +25 -0
  112. package/dist/server/comments/routes.mjs +88 -0
  113. package/dist/server/comments/tools.d.mts +6 -0
  114. package/dist/server/comments/tools.mjs +154 -0
  115. package/dist/server/dev-server.mjs +36 -13
  116. package/dist/server/file-errors.d.mts +7 -2
  117. package/dist/server/file-errors.mjs +31 -8
  118. package/dist/server/file-lock.d.mts +2 -2
  119. package/dist/server/file-lock.mjs +130 -36
  120. package/dist/server/mcp.d.mts +0 -2
  121. package/dist/server/mcp.mjs +7 -8
  122. package/dist/server/me.d.mts +1 -1
  123. package/dist/server/open-page.d.mts +22 -0
  124. package/dist/server/open-page.mjs +20 -2
  125. package/dist/server/outcome.d.mts +22 -0
  126. package/dist/server/outcome.mjs +8 -0
  127. package/dist/server/own-copies.mjs +2 -2
  128. package/dist/server/people.d.mts +1 -1
  129. package/dist/server/port.d.mts +12 -0
  130. package/dist/server/port.mjs +66 -14
  131. package/dist/server/presence.d.mts +4 -1
  132. package/dist/server/presence.mjs +2 -2
  133. package/dist/server/requests.d.mts +5 -1
  134. package/dist/server/requests.mjs +32 -47
  135. package/dist/server/studio-for.d.mts +5 -0
  136. package/dist/server/studio-for.mjs +18 -4
  137. package/dist/server/sync-install.d.mts +8 -12
  138. package/dist/server/sync-install.mjs +12 -30
  139. package/dist/server/thread-source.mjs +2 -2
  140. package/dist/server/tools/describe.d.mts +1 -1
  141. package/dist/server/tools/describe.mjs +1 -1
  142. package/dist/server/tools/feedback.d.mts +1 -1
  143. package/dist/server/tools/reading.mjs +13 -4
  144. package/dist/server/tools/show.d.mts +1 -1
  145. package/dist/server/tools/snapshot.d.mts +1 -1
  146. package/dist/server/tools/thread-list.mjs +1 -1
  147. package/dist/server/tools/watch.mjs +5 -3
  148. package/dist/server/vite.mjs +28 -31
  149. package/dist/server/web-app.mjs +7 -10
  150. package/dist/server/work-groups.mjs +1 -1
  151. package/dist/setup/apply.mjs +8 -14
  152. package/dist/setup/create.d.mts +4 -2
  153. package/dist/setup/create.mjs +118 -36
  154. package/dist/setup/design-system-checks.mjs +3 -12
  155. package/dist/setup/desktop-app-script.mjs +4 -3
  156. package/dist/setup/desktop-app-start.d.mts +8 -2
  157. package/dist/setup/desktop-app-start.mjs +64 -29
  158. package/dist/setup/desktop-app.d.mts +8 -0
  159. package/dist/setup/desktop-app.mjs +20 -4
  160. package/dist/setup/detect.d.mts +14 -7
  161. package/dist/setup/detect.mjs +56 -10
  162. package/dist/setup/doctor.mjs +2 -4
  163. package/dist/setup/existing-setup.d.mts +1 -3
  164. package/dist/setup/existing-setup.mjs +10 -11
  165. package/dist/setup/migrate/row-titles.mjs +1 -1
  166. package/dist/setup/own-app.d.mts +1 -2
  167. package/dist/setup/own-app.mjs +4 -5
  168. package/dist/setup/plan.d.mts +8 -6
  169. package/dist/setup/plan.mjs +64 -48
  170. package/dist/setup/project.d.mts +6 -17
  171. package/dist/setup/project.mjs +17 -61
  172. package/dist/setup/prompts.d.mts +5 -5
  173. package/dist/setup/prompts.mjs +28 -61
  174. package/dist/setup/questions.d.mts +12 -4
  175. package/dist/setup/questions.mjs +10 -25
  176. package/dist/setup/starters.d.mts +2 -0
  177. package/dist/setup/starters.mjs +26 -9
  178. package/dist/setup/workspace-setup.d.mts +1 -2
  179. package/dist/setup/workspace-setup.mjs +4 -6
  180. package/dist/setup/write.d.mts +15 -5
  181. package/dist/setup/write.mjs +35 -9
  182. package/dist/shared/annotations-core.mjs +1 -1
  183. package/dist/shared/canvas-core.mjs +1 -1
  184. package/dist/shared/canvas-file.d.mts +201 -0
  185. package/dist/shared/canvas-file.mjs +1 -0
  186. package/dist/shared/comments/routes.d.mts +53 -0
  187. package/dist/shared/comments/routes.mjs +37 -0
  188. package/dist/shared/feedback.d.mts +8 -0
  189. package/dist/shared/feedback.mjs +10 -2
  190. package/dist/shared/page-review.d.mts +2 -11
  191. package/dist/shared/page-review.mjs +4 -13
  192. package/dist/shared/presence-core.d.mts +11 -0
  193. package/dist/shared/presence-core.mjs +11 -2
  194. package/dist/shared/review-file.d.mts +5 -0
  195. package/dist/shared/review-file.mjs +23 -13
  196. package/dist/shared/server-page.mjs +7 -1
  197. package/dist/shared/signup.d.mts +2 -5
  198. package/dist/shared/signup.mjs +2 -35
  199. package/dist/shared/studio-events.d.mts +0 -6
  200. package/dist/shared/studio-events.mjs +1 -5
  201. package/dist/shared/studio-files.d.mts +12 -0
  202. package/dist/shared/studio-files.mjs +6 -1
  203. package/dist/shared/studio-routes.d.mts +16 -62
  204. package/dist/shared/studio-routes.mjs +1 -69
  205. package/dist/shared/threads-core.d.mts +2 -2
  206. package/dist/shared/threads-core.mjs +1 -1
  207. package/extension/dist/feedback.js +148 -138
  208. package/extension/dist/manifest.json +1 -1
  209. package/extension/dist/picker.js +146 -136
  210. package/package.json +3 -20
  211. package/src/cli/banner.ts +45 -11
  212. package/src/cli/commands/app.ts +23 -8
  213. package/src/cli/commands/create.ts +17 -9
  214. package/src/cli/commands/dev.ts +0 -3
  215. package/src/cli/commands/hook.ts +4 -1
  216. package/src/cli/help.ts +3 -3
  217. package/src/config/index.ts +6 -5
  218. package/src/config/project-files.ts +21 -11
  219. package/src/config/renamed.ts +0 -3
  220. package/src/config/schema.ts +0 -1
  221. package/src/content/capture.ts +6 -12
  222. package/src/content/content.ts +7 -244
  223. package/src/content/flow-specs.ts +2 -1
  224. package/src/content/prototype-summary.ts +4 -44
  225. package/src/content/review-pages.ts +2 -1
  226. package/src/content/snapshot-client.ts +1 -1
  227. package/src/content/text-replace.ts +449 -0
  228. package/src/paths.ts +0 -8
  229. package/src/server/agent-env.ts +12 -2
  230. package/src/server/agent-session.ts +124 -34
  231. package/src/server/brief.ts +8 -3
  232. package/src/server/channel.ts +121 -52
  233. package/src/server/claimed-presence.ts +93 -0
  234. package/src/server/comments/actions.ts +352 -0
  235. package/src/server/comments/routes.ts +176 -0
  236. package/src/server/comments/tools.ts +317 -0
  237. package/src/server/dev-server.ts +49 -15
  238. package/src/server/file-errors.ts +47 -13
  239. package/src/server/file-lock.ts +205 -54
  240. package/src/server/mcp.ts +13 -14
  241. package/src/server/me.ts +2 -5
  242. package/src/server/open-page.ts +54 -4
  243. package/src/server/outcome.ts +26 -0
  244. package/src/server/people.ts +2 -1
  245. package/src/server/port.ts +94 -20
  246. package/src/server/presence.ts +11 -3
  247. package/src/server/requests.ts +60 -70
  248. package/src/server/studio-for.ts +27 -3
  249. package/src/server/sync-install.ts +35 -26
  250. package/src/server/thread-place.ts +2 -4
  251. package/src/server/tools/reading.ts +16 -3
  252. package/src/server/tools/watch.ts +7 -7
  253. package/src/server/vite.ts +37 -40
  254. package/src/server/web-app.ts +14 -12
  255. package/src/setup/apply.ts +10 -16
  256. package/src/setup/create.ts +143 -37
  257. package/src/setup/design-system-checks.ts +7 -15
  258. package/src/setup/desktop-app-script.ts +4 -3
  259. package/src/setup/desktop-app-start.ts +94 -26
  260. package/src/setup/desktop-app.ts +24 -3
  261. package/src/setup/detect.ts +56 -14
  262. package/src/setup/doctor.ts +4 -4
  263. package/src/setup/existing-setup.ts +10 -12
  264. package/src/setup/own-app.ts +2 -5
  265. package/src/setup/plan.ts +93 -84
  266. package/src/setup/project.ts +25 -118
  267. package/src/setup/prompts.ts +44 -127
  268. package/src/setup/questions.ts +27 -29
  269. package/src/setup/starters.ts +35 -10
  270. package/src/setup/workspace-setup.ts +8 -18
  271. package/src/setup/write.ts +52 -9
  272. package/src/shared/canvas-file.ts +205 -0
  273. package/src/shared/comments/routes.ts +79 -0
  274. package/src/shared/feedback.ts +14 -4
  275. package/src/shared/page-review.ts +11 -16
  276. package/src/shared/presence-core.ts +16 -2
  277. package/src/shared/review-file.ts +28 -12
  278. package/src/shared/server-page.ts +11 -1
  279. package/src/shared/signup.ts +4 -28
  280. package/src/shared/studio-events.ts +0 -13
  281. package/src/shared/studio-files.ts +14 -0
  282. package/src/shared/studio-routes.ts +21 -64
  283. package/src/shared/threads-core.ts +2 -2
  284. package/templates/methods/review.md +2 -2
  285. package/templates/rules/canvas-frames.md +104 -0
  286. package/templates/rules/canvas.md +8 -142
  287. package/templates/rules/prototypes.md +1 -1
  288. package/templates/rules/snapshots.md +52 -0
  289. package/templates/starters/standalone/README.md +7 -7
  290. package/templates/starters/standalone/components.json +1 -1
  291. package/templates/starters/standalone/package.json +1 -2
  292. package/templates/starters/turborepo/README.md +6 -6
  293. package/templates/starters/turborepo/apps/web/components.json +1 -1
  294. package/templates/starters/turborepo/apps/web/package.json +1 -2
  295. package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
  296. package/templates/starters/turborepo/packages/ui/components.json +1 -1
  297. package/templates/starters/turborepo/packages/ui/package.json +1 -2
  298. package/templates/starters/vite/README.md +7 -6
  299. package/templates/starters/vite/components.json +1 -1
  300. package/templates/starters/vite/package.json +1 -2
  301. package/templates/starters/vite/src/app.tsx +3 -4
  302. package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
  303. package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
  304. package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
  305. package/templates/starters/vite/src/components/ui/button.tsx +17 -12
  306. package/templates/starters/vite/src/components/ui/card.tsx +1 -1
  307. package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
  308. package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
  309. package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
  310. package/templates/starters/vite/src/components/ui/field.tsx +3 -1
  311. package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
  312. package/templates/starters/vite/src/components/ui/input.tsx +1 -1
  313. package/templates/starters/vite/src/components/ui/label.tsx +2 -0
  314. package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
  315. package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
  316. package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
  317. package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
  318. package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
  319. package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
  320. package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
  321. package/templates/starters/vite/src/index.css +533 -111
  322. package/app/icons/sets/hugeicons.tsx +0 -259
  323. package/app/icons/sets/phosphor.tsx +0 -251
  324. package/dist/server/icon-set.d.mts +0 -15
  325. package/dist/server/icon-set.mjs +0 -31
  326. package/dist/server/tools/close-reply.d.mts +0 -6
  327. package/dist/server/tools/close-reply.mjs +0 -138
  328. package/dist/server/tools/comment.d.mts +0 -6
  329. package/dist/server/tools/comment.mjs +0 -49
  330. package/dist/shared/icon-sets.d.mts +0 -9
  331. package/dist/shared/icon-sets.mjs +0 -21
  332. package/src/server/icon-set.ts +0 -56
  333. package/src/server/tools/close-reply.ts +0 -271
  334. package/src/server/tools/comment.ts +0 -96
  335. package/src/shared/icon-sets.ts +0 -23
  336. /package/app/public/{sudio-192.png → dex-192.png} +0 -0
  337. /package/app/public/{sudio-512.png → dex-512.png} +0 -0
  338. /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
  339. /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
  340. /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
  341. /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
@@ -60,7 +60,6 @@ import type {
60
60
  DesignComponent,
61
61
  StudioDesignSystemGuide,
62
62
  } from "../shared/design-system.ts";
63
- import type { InterfaceIcons } from "../shared/icon-sets.ts";
64
63
  import { ME_META } from "../shared/studio-routes.ts";
65
64
  import {
66
65
  publicThreads,
@@ -76,7 +75,6 @@ import { CloudError } from "./cloud.ts";
76
75
  import { studioDev } from "./dev-server.ts";
77
76
  import { type Feature, features } from "./features.ts";
78
77
  import { fileErrors } from "./file-errors.ts";
79
- import { interfaceIconSet } from "./icon-set.ts";
80
78
  import { type Me, readMe } from "./me.ts";
81
79
  import { lacksNext, next } from "./next.ts";
82
80
  import { projectPublic } from "./project-public.ts";
@@ -279,6 +277,35 @@ const interfaceTakesDesignSystem = (project: StudioProject): boolean =>
279
277
  project.ui?.theme === "design-system" ||
280
278
  Boolean(project.ui?.components || project.ui?.primitives);
281
279
 
280
+ /**
281
+ * Where views import the project's components from: the top folder of the
282
+ * package they are in ("src" for src/components/ui), which holds what views
283
+ * import beside them too, such as a block shadcn adds to src/components.
284
+ * Vite's root is Dex's own, so neither Tailwind nor Vite's watcher finds any
285
+ * of it on their own, as they do in the project: views' Tailwind scans it,
286
+ * and the watcher sees a file appear in it (file-errors.ts). Never the
287
+ * package itself, which for an app is the whole repository, its node_modules
288
+ * and Dex's output with it; a package in node_modules gives its components'
289
+ * folder alone.
290
+ */
291
+ function componentsRoot(project: StudioProject): string | undefined {
292
+ const folder = project.designSystem?.componentSource?.folder;
293
+ if (!folder) {
294
+ return;
295
+ }
296
+ const home = project.designSystem?.componentPackage ?? project.root;
297
+ const path = relative(home, folder);
298
+ if (
299
+ !path ||
300
+ path.startsWith("..") ||
301
+ isAbsolute(path) ||
302
+ folder.split(sep).includes("node_modules")
303
+ ) {
304
+ return folder;
305
+ }
306
+ return join(home, path.split(sep)[0] ?? "");
307
+ }
308
+
282
309
  /**
283
310
  * Two stylesheets per project, one for each page. The frame page's is what
284
311
  * the real product would have: the design system's CSS (it brings Tailwind
@@ -306,7 +333,6 @@ export async function writeEntries(
306
333
  .map((folder) => `@source "${from(folder)}";`)
307
334
  ),
308
335
  ];
309
- const componentFolder = project.designSystem?.componentSource?.folder;
310
336
  const tailwind = tailwindSetup(project.root);
311
337
  // Tailwind 3's config, for Tailwind 4 wherever the design system's theme is
312
338
  // used: the one beside the components views render (Dub's packages/ui, for
@@ -324,7 +350,7 @@ export async function writeEntries(
324
350
  `@import "${from(join(APP_DIR, "frame.css"))}";`,
325
351
  ...config,
326
352
  `@source "${from(prototypesDir(project.content))}";`,
327
- ...sources([componentFolder]),
353
+ ...sources([componentsRoot(project)]),
328
354
  "",
329
355
  ].join("\n");
330
356
  const own = [
@@ -386,22 +412,14 @@ async function sourceFiles(dir: string): Promise<string[]> {
386
412
  return files;
387
413
  }
388
414
 
389
- const ICON_SETS_DIR = join(APP_DIR, "icons", "sets");
390
- const iconSetFile = (set: InterfaceIcons): string =>
391
- join(ICON_SETS_DIR, `${set}.tsx`);
392
-
393
415
  /**
394
- * Every library the studio's own interface imports, with only the icon set
395
- * it draws with: the others may not be installed. Installed from npm, the
416
+ * Every library the studio's own interface imports. Installed from npm, the
396
417
  * interface lives in node_modules, where Vite neither crawls imports nor
397
418
  * converts CommonJS for the browser, so they are listed for it to prepare.
398
419
  */
399
- async function interfaceDependencies(icons: InterfaceIcons): Promise<string[]> {
420
+ async function interfaceDependencies(): Promise<string[]> {
400
421
  const found = new Set<string>();
401
- const files = (await sourceFiles(APP_DIR)).filter(
402
- (file) => dirname(file) !== ICON_SETS_DIR || file === iconSetFile(icons)
403
- );
404
- for (const file of files) {
422
+ for (const file of await sourceFiles(APP_DIR)) {
405
423
  for (const specifier of importsIn(await readFile(file, "utf8"))) {
406
424
  // Macros compile away (studioMacros); bundled, they throw at runtime.
407
425
  if (!MACRO_IMPORT_RE.test(specifier)) {
@@ -468,26 +486,6 @@ const studioMacros = (): Plugin => {
468
486
  };
469
487
  };
470
488
 
471
- const ICONS_MODULE = "virtual:studio-icons";
472
- const RESOLVED_ICONS_MODULE = `\0${ICONS_MODULE}`;
473
-
474
- /**
475
- * `virtual:studio-icons`: the glyphs of the icon set the interface draws
476
- * with (interfaceIconSet). Only that set is bundled.
477
- */
478
- const studioIcons = (project: StudioProject): Plugin => {
479
- const set = interfaceIconSet(project);
480
- return {
481
- name: "studio-icons",
482
- resolveId: (id) =>
483
- id === ICONS_MODULE ? RESOLVED_ICONS_MODULE : undefined,
484
- load: (id) =>
485
- id === RESOLVED_ICONS_MODULE
486
- ? `export { glyphs } from ${JSON.stringify(iconSetFile(set))};\n`
487
- : undefined,
488
- };
489
- };
490
-
491
489
  /**
492
490
  * While serving, what a module made from `build` in dex.config.ts has is
493
491
  * made again once the file changes (Settings → Deployment writes it), so a
@@ -630,9 +628,9 @@ const studioInterface = (project: StudioProject): Plugin => {
630
628
  const build = serving
631
629
  ? await readBuildSettings(project.root)
632
630
  : project.build;
633
- const { title, subtitle, theme, locale, chromeTheme, components, icons } =
631
+ const { title, subtitle, theme, locale, chromeTheme, components } =
634
632
  project.ui ?? {};
635
- const settings = `export const ui = ${JSON.stringify({ title: workspaceName(title), subtitle, theme, locale, chromeTheme, icons, workspaceIcon })};`;
633
+ const settings = `export const ui = ${JSON.stringify({ title: workspaceName(title), subtitle, theme, locale, chromeTheme, workspaceIcon })};`;
636
634
  const slots = components
637
635
  ? `export * as slots from ${JSON.stringify(resolve(project.root, components))};`
638
636
  : "export const slots = {};";
@@ -1114,7 +1112,6 @@ export async function viteConfig(
1114
1112
  reactFromStudio(),
1115
1113
  tailwindcss(),
1116
1114
  studioInterface(project),
1117
- studioIcons(project),
1118
1115
  studioThreads(project),
1119
1116
  studioDesignSystem(project),
1120
1117
  studioComponents(project),
@@ -1125,7 +1122,7 @@ export async function viteConfig(
1125
1122
  ...((await lacksNext(project)) ? [next()] : []),
1126
1123
  studioDev(project),
1127
1124
  // A broken file in the content folder breaks only what loads it.
1128
- fileErrors(project.content),
1125
+ fileErrors(project.content, componentsRoot(project)),
1129
1126
  studioWebApp(project),
1130
1127
  projectPublic(project.root),
1131
1128
  ],
@@ -1164,7 +1161,7 @@ export async function viteConfig(
1164
1161
  },
1165
1162
  },
1166
1163
  optimizeDeps: {
1167
- include: await interfaceDependencies(interfaceIconSet(project)),
1164
+ include: await interfaceDependencies(),
1168
1165
  },
1169
1166
  preview: { port: project.port },
1170
1167
  // The instructions editor is a large chunk on purpose: it loads only
@@ -11,14 +11,13 @@
11
11
 
12
12
  import { homedir } from "node:os";
13
13
  import { basename, sep } from "node:path";
14
- import type { Plugin } from "vite";
14
+ import type { Plugin, ViteDevServer } from "vite";
15
15
  import { runningVersion } from "../paths.ts";
16
16
  import {
17
17
  APP_NAME,
18
- type DesktopApp,
19
- desktopApp,
20
18
  desktopAppState,
21
19
  desktopAppUnavailable,
20
+ servedApp,
22
21
  urlScheme,
23
22
  } from "../setup/desktop-app.ts";
24
23
  import { serverPage, shownPath } from "../shared/server-page.ts";
@@ -71,10 +70,10 @@ const webAppManifest = (name: string): WebAppManifest => ({
71
70
  background_color: LIGHT,
72
71
  theme_color: LIGHT,
73
72
  icons: [
74
- { src: "sudio-192.png", sizes: "192x192", type: "image/png" },
75
- { src: "sudio-512.png", sizes: "512x512", type: "image/png" },
73
+ { src: "dex-192.png", sizes: "192x192", type: "image/png" },
74
+ { src: "dex-512.png", sizes: "512x512", type: "image/png" },
76
75
  {
77
- src: "sudio-maskable-512.png",
76
+ src: "dex-maskable-512.png",
78
77
  sizes: "512x512",
79
78
  type: "image/png",
80
79
  purpose: "maskable",
@@ -155,8 +154,8 @@ const rememberAppScript = (startsHere: boolean): string => {
155
154
  export function studioWebApp(project: { root: string }): Plugin {
156
155
  let base = "/";
157
156
  let serving = false;
158
- // The app as `dex dev` would make it here: on a Mac, while serving.
159
- let app: DesktopApp | undefined;
157
+ // `dex dev`'s server: the app it makes opens the port it is served on.
158
+ let devServer: ViteDevServer | undefined;
160
159
  const name = APP_NAME;
161
160
  const manifest = JSON.stringify(webAppManifest(name), null, 2);
162
161
  return {
@@ -164,12 +163,9 @@ export function studioWebApp(project: { root: string }): Plugin {
164
163
  configResolved(config) {
165
164
  base = config.base;
166
165
  serving = config.command === "serve";
167
- app =
168
- serving && desktopAppUnavailable() === undefined
169
- ? desktopApp({ root: project.root, port: config.server.port, base })
170
- : undefined;
171
166
  },
172
167
  configureServer(server) {
168
+ devServer = server;
173
169
  const worker = serviceWorker(project.root);
174
170
  const id = projectId(project.root);
175
171
  server.middlewares.use((request, response, next) => {
@@ -218,6 +214,12 @@ export function studioWebApp(project: { root: string }): Plugin {
218
214
  return tags;
219
215
  }
220
216
  tags.push(head("script", { type: "module" }, registration(base)));
217
+ // The app as `dex dev` would make it here, on a Mac: a page is
218
+ // served only once the server listens, so on the port it took.
219
+ const app =
220
+ devServer && desktopAppUnavailable() === undefined
221
+ ? servedApp(project.root, devServer)
222
+ : undefined;
221
223
  if (app) {
222
224
  const { startsHere } = await desktopAppState(app);
223
225
  tags.push(
@@ -28,7 +28,6 @@ import { type AgentsSetUp, addAgent, setUpAgents } from "../server/agents.ts";
28
28
  import { nextPackage } from "../server/next.ts";
29
29
  import { STATE_FOLDER } from "../server/state.ts";
30
30
  import type { StylingApproach } from "../shared/design-system.ts";
31
- import { ICON_SET_NAMES } from "../shared/icon-sets.ts";
32
31
  import { jsonLike } from "../shared/json-style.ts";
33
32
  import { STUDIO_FILES } from "../shared/studio-files.ts";
34
33
  import { choicesOnly, type DesignSystemChoices } from "./config-choices.ts";
@@ -75,8 +74,10 @@ import {
75
74
  ignoreFile,
76
75
  missingIgnoreLines,
77
76
  missingScripts,
77
+ pnpmDecidesEsbuild,
78
78
  STUDIO_TYPES,
79
79
  tsconfigJson,
80
+ withEsbuildBuilds,
80
81
  withIgnoreLines,
81
82
  withPointer,
82
83
  } from "./write.ts";
@@ -292,18 +293,9 @@ function afterShadcn(root: string, decisions: SetupDecisions): SetupDecisions {
292
293
  }
293
294
  const choice = componentsChoice(library, root);
294
295
  const value: ComponentsDecision = { kind: "folder", choice };
295
- const icons = choice.icons ?? decisions.icons.value;
296
296
  return {
297
297
  ...decisions,
298
298
  components: { ...decisions.components, value },
299
- icons:
300
- decisions.icons.source === "--icons"
301
- ? decisions.icons
302
- : {
303
- ...decisions.icons,
304
- value: icons,
305
- shown: ICON_SET_NAMES[icons],
306
- },
307
299
  // A stylesheet given or left out with --styles stays as it was.
308
300
  styles:
309
301
  decisions.styles.value || decisions.styles.source === NO_STYLES
@@ -419,7 +411,6 @@ async function writeStep(
419
411
  configSource(written, {
420
412
  studio: posix(relative(packageDir, content)) || ".",
421
413
  primitives: decisions.primitives.value,
422
- icons: decisions.icons.value,
423
414
  next:
424
415
  nextPackage(
425
416
  nextFolders(packageDir, decisions, resolved?.componentPackage)
@@ -439,7 +430,6 @@ async function writeStep(
439
430
  await write(file, STUDIO_TYPES);
440
431
  } else if (step.write === "scripts") {
441
432
  const spec = plan.workspace?.studioSpec;
442
- const icons = plan.workspace ? plan.iconPackages : {};
443
433
  // Its own app's dev is the studio: it gets no script of its own.
444
434
  const own = plan.target.kind === "own-app";
445
435
  await editManifest(file, (manifest) => {
@@ -448,11 +438,10 @@ async function writeStep(
448
438
  manifest.scripts = { ...scripts, ...missingScripts(scripts) };
449
439
  }
450
440
  // In a workspace the package asks for the studio; the root installs.
451
- if (spec || Object.keys(icons).length > 0) {
441
+ if (spec) {
452
442
  manifest.devDependencies = {
453
443
  ...recordAt(manifest, "devDependencies"),
454
- ...(spec ? { [PACKAGE_NAME]: spec } : {}),
455
- ...icons,
444
+ [PACKAGE_NAME]: spec,
456
445
  };
457
446
  }
458
447
  });
@@ -460,7 +449,7 @@ async function writeStep(
460
449
  const script = plan.workspace.studioScript;
461
450
  await editManifest(file, (manifest) => {
462
451
  const scripts = recordAt(manifest, "scripts");
463
- manifest.scripts = { ...scripts, studio: scripts.studio ?? script };
452
+ manifest.scripts = { ...scripts, dex: scripts.dex ?? script };
464
453
  });
465
454
  } else {
466
455
  await editProjectFile(step, file, plan);
@@ -486,6 +475,11 @@ async function editProjectFile(
486
475
  await writeFile(file, withIgnoreLines(text, missing));
487
476
  } else if (step.write === "pointer") {
488
477
  await writeFile(file, withPointer(text, studio));
478
+ } else if (step.write === "pnpm-builds") {
479
+ const edited = withEsbuildBuilds(text);
480
+ if (edited !== undefined && !pnpmDecidesEsbuild(text)) {
481
+ await writeFile(file, edited);
482
+ }
489
483
  }
490
484
  }
491
485