handoff-app 1.0.5 → 1.0.6-canary.1

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/Changelog.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to
7
7
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## \[1.0.6] - 2026-02-24
10
+
11
+ Version 1.0.4 fixed an issue when running Handoff in subpaths (eg.
12
+ https://mysite.com/folder/handoff). We discovered a minor bug in that fix that
13
+ causes some menu constructs to work poorly. This release fixes that issue.
14
+
9
15
  ## \[1.0.5] - 2026-02-19
10
16
 
11
17
  This is a minor improvement release that extends the quickstart released in the
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ class HandoffCliError extends Error {
19
19
  * Show the help message
20
20
  */
21
21
  const showVersion = () => {
22
- return 'Handoff App - 1.0.5';
22
+ return 'Handoff App - 1.0.6';
23
23
  };
24
24
  /**
25
25
  * Define a CLI error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-app",
3
- "version": "1.0.5",
3
+ "version": "1.0.6-canary.1",
4
4
  "description": "Automated documentation toolchain for building client side documentation from figma",
5
5
  "author ": {
6
6
  "name": "Convertiv",
@@ -234,7 +234,7 @@ export const AbstractComponentsPageCard = ({
234
234
  return (
235
235
  <div className={cn(layout === 'single' && 'grid grid-cols-[130px_1fr] items-start gap-6')}>
236
236
  <Link href={available ? (absolute ? path : `/system/component/${id}`) : '#'} className="block bg-gray-50">
237
- <img src={image} width={1528} height={1250} alt="Components" className="mb-5 rounded-lg" />
237
+ <img src={`${process.env.HANDOFF_APP_BASE_PATH ?? ''}${image}`} width={1528} height={1250} alt="Components" className="mb-5 rounded-lg" />
238
238
  </Link>
239
239
  <div>
240
240
  <h2 className="text-base font-medium">{title}</h2>
@@ -289,8 +289,15 @@ export const staticBuildMenu = () => {
289
289
  return sections.concat(custom).sort((a: SectionLink, b: SectionLink) => a.weight - b.weight);
290
290
  };
291
291
 
292
+ const buildBasePath = () => {
293
+ if(!process.env.HANDOFF_APP_BASE_PATH) {
294
+ return '';
295
+ }
296
+ return (process.env.HANDOFF_APP_BASE_PATH ?? '').replace(/^\//, '') + '/';
297
+ };
298
+
292
299
  const staticBuildComponentMenu = (type?: boolean | string) => {
293
- const basePath = (process.env.HANDOFF_APP_BASE_PATH ?? '').replace(/^\//, '');
300
+ const basePath = buildBasePath();
294
301
  let menu = [];
295
302
  let components = fetchComponents({ includeTokens: false });
296
303
  if (typeof type === 'string' && type !== '') {
@@ -309,7 +316,7 @@ const staticBuildComponentMenu = (type?: boolean | string) => {
309
316
  if (component.name) {
310
317
  title = component.name;
311
318
  }
312
- menuGroup.menu.push({ path: `${basePath}/system/component/${component.id}`, title });
319
+ menuGroup.menu.push({ path: `${basePath}system/component/${component.id}`, title });
313
320
  });
314
321
  // sort the menu group by name alphabetical
315
322
  menuGroup.menu = menuGroup.menu.sort((a, b) => a.title.localeCompare(b.title));
@@ -321,24 +328,24 @@ const staticBuildComponentMenu = (type?: boolean | string) => {
321
328
  };
322
329
 
323
330
  const staticBuildTokensMenu = () => {
324
- const basePath = (process.env.HANDOFF_APP_BASE_PATH ?? '').replace(/^\//, '');
331
+ const basePath = buildBasePath();
325
332
 
326
333
  const menu = [
327
334
  {
328
335
  title: `Foundations`,
329
- path: `${basePath}/system/tokens/foundations`,
336
+ path: `${basePath}system/tokens/foundations`,
330
337
  menu: [
331
338
  {
332
339
  title: `Colors`,
333
- path: `${basePath}/system/tokens/foundations/colors`,
340
+ path: `${basePath}system/tokens/foundations/colors`,
334
341
  },
335
342
  {
336
343
  title: `Effects`,
337
- path: `${basePath}/system/tokens/foundations/effects`,
344
+ path: `${basePath}system/tokens/foundations/effects`,
338
345
  },
339
346
  {
340
347
  title: `Typography`,
341
- path: `${basePath}/system/tokens/foundations/typography`,
348
+ path: `${basePath}system/tokens/foundations/typography`,
342
349
  },
343
350
  ],
344
351
  },
@@ -358,14 +365,14 @@ const staticBuildTokensMenu = () => {
358
365
  if (component.name) {
359
366
  title = component.name;
360
367
  }
361
- componentMenuItems.push({ path: `${basePath}/system/tokens/components/${component.id}`, title });
368
+ componentMenuItems.push({ path: `${basePath}system/tokens/components/${component.id}`, title });
362
369
  });
363
370
  });
364
371
 
365
372
  if (componentMenuItems.length > 0) {
366
373
  menu.push({
367
374
  title: `Components`,
368
- path: `${basePath}/system/tokens/components`,
375
+ path: `${basePath}system/tokens/components`,
369
376
  menu: componentMenuItems,
370
377
  });
371
378
  }
@@ -374,11 +381,11 @@ const staticBuildTokensMenu = () => {
374
381
  };
375
382
 
376
383
  const staticBuildTokenMenu = () => {
377
- const basePath = (process.env.HANDOFF_APP_BASE_PATH ?? '').replace(/^\//, '');
384
+ const basePath = buildBasePath();
378
385
 
379
386
  let subSections = {
380
387
  title: 'Tokens',
381
- path: `${basePath}/system/tokens`,
388
+ path: `${basePath}system/tokens`,
382
389
  menu: [],
383
390
  };
384
391
  const tokens = getTokens();
@@ -115,11 +115,11 @@ const GenericComponentPage = ({ menu, metadata, current, id, config, componentHo
115
115
  };
116
116
 
117
117
  const previousLink = previousComponent ? {
118
- href: previousComponent ? '/system/component/' + previousComponent.id : null,
118
+ href: previousComponent ? `${process.env.HANDOFF_APP_BASE_PATH ?? ''}system/component/${previousComponent.id}` : null,
119
119
  title: previousComponent ? previousComponent.name : null,
120
120
  } : null;
121
121
  const nextLink = nextComponent ? {
122
- href: '/system/component/' + nextComponent.id,
122
+ href: `${process.env.HANDOFF_APP_BASE_PATH ?? ''}system/component/${nextComponent.id}`,
123
123
  title: nextComponent.name,
124
124
  } : null;
125
125
 
package/src/cli.ts CHANGED
@@ -19,7 +19,7 @@ class HandoffCliError extends Error {
19
19
  * Show the help message
20
20
  */
21
21
  const showVersion = () => {
22
- return 'Handoff App - 1.0.5';
22
+ return 'Handoff App - 1.0.6';
23
23
  };
24
24
 
25
25
  /**