handoff-app 1.2.2-6 → 2.0.0-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.
- package/Changelog.md +37 -15
- package/README.md +372 -118
- package/dist/app-builder/build.d.ts +41 -2
- package/dist/app-builder/build.js +455 -18
- package/dist/app-builder/client-config.d.ts +15 -2
- package/dist/app-builder/client-config.js +43 -4
- package/dist/app-builder/config-diff/snapshot.d.ts +1 -6
- package/dist/app-builder/config-diff/snapshot.js +2 -9
- package/dist/app-builder/index.d.ts +1 -1
- package/dist/app-builder/index.js +3 -1
- package/dist/app-builder/nav-shell.d.ts +23 -0
- package/dist/app-builder/nav-shell.js +80 -0
- package/dist/app-builder/static-export.d.ts +17 -0
- package/dist/app-builder/static-export.js +181 -0
- package/dist/app-builder/vercel-output.d.ts +39 -0
- package/dist/app-builder/vercel-output.js +259 -0
- package/dist/app-builder/watchers/utils.d.ts +2 -0
- package/dist/app-builder/watchers.d.ts +14 -4
- package/dist/app-builder/watchers.js +123 -28
- package/dist/app-builder/websocket.js +1 -1
- package/dist/artifacts/index.d.ts +2 -0
- package/dist/artifacts/index.js +13 -0
- package/dist/artifacts/types.d.ts +136 -0
- package/dist/artifacts/types.js +24 -0
- package/dist/artifacts/url.d.ts +49 -0
- package/dist/artifacts/url.js +86 -0
- package/dist/cache/build-cache.js +48 -4
- package/dist/commands/build/app.js +1 -2
- package/dist/commands/build/index.d.ts +17 -0
- package/dist/commands/build/index.js +66 -0
- package/dist/commands/checkout/index.d.ts +24 -0
- package/dist/commands/checkout/index.js +71 -0
- package/dist/commands/db/migrate.d.ts +11 -0
- package/dist/commands/db/migrate.js +33 -0
- package/dist/commands/index.js +8 -0
- package/dist/commands/publish/index.d.ts +21 -0
- package/dist/commands/publish/index.js +68 -0
- package/dist/config/defaults.js +15 -1
- package/dist/config/loader.js +6 -1
- package/dist/config/normalizers/declaration.js +4 -1
- package/dist/config/normalizers/page.d.ts +18 -0
- package/dist/config/normalizers/page.js +34 -0
- package/dist/config/normalizers/pattern.js +7 -1
- package/dist/config/runtime.d.ts +4 -0
- package/dist/config/runtime.js +53 -5
- package/dist/index.d.ts +65 -1
- package/dist/index.js +123 -3
- package/dist/nav/index.d.ts +83 -0
- package/dist/nav/index.js +9 -0
- package/dist/nav/registry.d.ts +15 -0
- package/dist/nav/registry.js +42 -0
- package/dist/nav/resolver.d.ts +8 -0
- package/dist/nav/resolver.js +192 -0
- package/dist/nav/workspace.d.ts +18 -0
- package/dist/nav/workspace.js +103 -0
- package/dist/pipeline/styles.js +7 -35
- package/dist/pipeline/token-transformers.d.ts +45 -0
- package/dist/pipeline/token-transformers.js +71 -0
- package/dist/registry/asset-storage/adapters/vercel-blob.d.ts +17 -0
- package/dist/registry/asset-storage/adapters/vercel-blob.js +87 -0
- package/dist/registry/asset-storage/define.d.ts +10 -0
- package/dist/registry/asset-storage/define.js +13 -0
- package/dist/registry/asset-storage/resolve.d.ts +45 -0
- package/dist/registry/asset-storage/resolve.js +36 -0
- package/dist/registry/asset-storage/types.d.ts +51 -0
- package/dist/registry/asset-storage/types.js +9 -0
- package/dist/registry/assets/layout.d.ts +22 -0
- package/dist/registry/assets/layout.js +30 -0
- package/dist/registry/assets/sets.d.ts +18 -0
- package/dist/registry/assets/sets.js +44 -0
- package/dist/registry/assets/transfer.d.ts +45 -0
- package/dist/registry/assets/transfer.js +11 -0
- package/dist/registry/checkout/assets.d.ts +16 -0
- package/dist/registry/checkout/assets.js +150 -0
- package/dist/registry/checkout/index.d.ts +33 -0
- package/dist/registry/checkout/index.js +610 -0
- package/dist/registry/checkout/tokens.d.ts +15 -0
- package/dist/registry/checkout/tokens.js +171 -0
- package/dist/registry/client.d.ts +61 -0
- package/dist/registry/client.js +211 -0
- package/dist/registry/connection.d.ts +30 -0
- package/dist/registry/connection.js +36 -0
- package/dist/registry/db/adapter.d.ts +43 -0
- package/dist/registry/db/adapter.js +59 -0
- package/dist/registry/db/client.d.ts +35 -0
- package/dist/registry/db/client.js +94 -0
- package/dist/registry/db/index.d.ts +5 -0
- package/dist/registry/db/index.js +24 -0
- package/dist/registry/db/migrate.d.ts +23 -0
- package/dist/registry/db/migrate.js +64 -0
- package/dist/registry/db/schema.d.ts +4869 -0
- package/dist/registry/db/schema.js +347 -0
- package/dist/registry/path.d.ts +4 -0
- package/dist/registry/path.js +31 -0
- package/dist/registry/publish/artifacts.d.ts +16 -0
- package/dist/registry/publish/artifacts.js +132 -0
- package/dist/registry/publish/assets.d.ts +16 -0
- package/dist/registry/publish/assets.js +129 -0
- package/dist/registry/publish/errors.d.ts +5 -0
- package/dist/registry/publish/errors.js +26 -0
- package/dist/registry/publish/index.d.ts +27 -0
- package/dist/registry/publish/index.js +126 -0
- package/dist/registry/publish/package.d.ts +27 -0
- package/dist/registry/publish/package.js +257 -0
- package/dist/registry/publish/publish-build.d.ts +12 -0
- package/dist/registry/publish/publish-build.js +43 -0
- package/dist/registry/publish/tokens.d.ts +18 -0
- package/dist/registry/publish/tokens.js +112 -0
- package/dist/registry/tokens/sets.d.ts +59 -0
- package/dist/registry/tokens/sets.js +109 -0
- package/dist/registry/tokens/transfer.d.ts +48 -0
- package/dist/registry/tokens/transfer.js +10 -0
- package/dist/registry/transfer.d.ts +75 -0
- package/dist/registry/transfer.js +11 -0
- package/dist/store/filesystem-assets.d.ts +17 -0
- package/dist/store/filesystem-assets.js +147 -0
- package/dist/store/filesystem.d.ts +76 -0
- package/dist/store/filesystem.js +208 -0
- package/dist/store/index.d.ts +20 -0
- package/dist/store/index.js +38 -0
- package/dist/store/registry.d.ts +77 -0
- package/dist/store/registry.js +350 -0
- package/dist/store/source-files.d.ts +24 -0
- package/dist/store/source-files.js +147 -0
- package/dist/store/types.d.ts +185 -0
- package/dist/store/types.js +12 -0
- package/dist/transformers/plugins/csf-render.js +17 -8
- package/dist/transformers/plugins/handlebars-previews.js +10 -3
- package/dist/transformers/plugins/ssr-render.js +116 -49
- package/dist/transformers/preview/component/api.js +3 -1
- package/dist/transformers/preview/component/artifacts.js +8 -1
- package/dist/transformers/preview/component/builder.js +13 -5
- package/dist/transformers/preview/component/css.js +9 -1
- package/dist/transformers/preview/component/javascript.d.ts +9 -3
- package/dist/transformers/preview/component/javascript.js +45 -17
- package/dist/transformers/preview/component/shared-artifacts.d.ts +83 -0
- package/dist/transformers/preview/component/shared-artifacts.js +92 -0
- package/dist/transformers/preview/component.js +5 -2
- package/dist/transformers/preview/pattern/builder.js +28 -9
- package/dist/transformers/preview/pattern/html.d.ts +13 -10
- package/dist/transformers/preview/pattern/html.js +62 -27
- package/dist/transformers/preview/types.d.ts +38 -0
- package/dist/transformers/utils/handlebars.d.ts +3 -0
- package/dist/transformers/utils/handlebars.js +19 -5
- package/dist/types/config.d.ts +118 -25
- package/dist/utils/menu-shell.d.ts +60 -0
- package/dist/utils/menu-shell.js +221 -0
- package/dist/utils/stable-stringify.d.ts +2 -0
- package/dist/utils/stable-stringify.js +8 -0
- package/docs/cli.md +4 -2
- package/drizzle/0000_init_registry_storage.sql +95 -0
- package/drizzle/0001_add_review_metadata.sql +2 -0
- package/drizzle/0002_add_pages.sql +28 -0
- package/drizzle/0003_add_tokens.sql +29 -0
- package/drizzle/0004_add_assets.sql +37 -0
- package/drizzle/meta/0000_snapshot.json +642 -0
- package/drizzle/meta/0001_snapshot.json +654 -0
- package/drizzle/meta/0002_snapshot.json +835 -0
- package/drizzle/meta/0003_snapshot.json +1023 -0
- package/drizzle/meta/0004_snapshot.json +1252 -0
- package/drizzle/meta/_journal.json +41 -0
- package/drizzle.config.ts +16 -0
- package/package.json +10 -1
- package/src/app/components/Component/ComponentLists.tsx +102 -102
- package/src/app/components/Component/Preview.tsx +3 -2
- package/src/app/components/Component/RegistryActions.tsx +150 -0
- package/src/app/components/Foundations/DisplayLogo.tsx +5 -3
- package/src/app/components/Layout/Header.tsx +21 -3
- package/src/app/components/Layout/Main.tsx +11 -3
- package/src/app/components/Navigation/MainNav.tsx +4 -2
- package/src/app/components/Navigation/MobileNav.tsx +4 -2
- package/src/app/components/Navigation/SideNav.tsx +46 -11
- package/src/app/components/NotFound.tsx +24 -0
- package/src/app/components/context/NavProvider.tsx +71 -0
- package/src/app/components/old/Header.tsx +3 -3
- package/src/app/components/util/index.ts +203 -380
- package/src/app/components/util/useCollectionAssets.ts +125 -0
- package/src/app/components/util/useFoundationTokens.ts +67 -0
- package/src/app/generated/default-pages.json +1 -0
- package/src/app/generated/nav-shell.json +1 -0
- package/src/app/lib/api/query.ts +6 -0
- package/src/app/lib/api/redact.ts +46 -0
- package/src/app/lib/asset-storage.ts +81 -0
- package/src/app/lib/docs-api/artifacts.ts +116 -0
- package/src/app/lib/docs-api/backend.ts +151 -0
- package/src/app/lib/docs-api/errors.ts +52 -0
- package/src/app/lib/docs-api/handler.ts +34 -0
- package/src/app/lib/docs-api/index.ts +7 -0
- package/src/app/lib/docs-api/records.ts +189 -0
- package/src/app/lib/docs-api/registry.ts +130 -0
- package/src/app/lib/docs-api/runtime-config.ts +173 -0
- package/src/app/lib/docs-api/serve.ts +37 -0
- package/src/app/lib/docs-api/token-detail.ts +19 -0
- package/src/app/lib/registry-api/allowlist.ts +163 -0
- package/src/app/lib/registry-api/asset-transfer.ts +363 -0
- package/src/app/lib/registry-api/auth.ts +68 -0
- package/src/app/lib/registry-api/entity-routes.ts +197 -0
- package/src/app/lib/registry-api/errors.ts +51 -0
- package/src/app/lib/registry-api/files.ts +135 -0
- package/src/app/lib/registry-api/handler.ts +96 -0
- package/src/app/lib/registry-api/index.ts +4 -0
- package/src/app/lib/registry-api/meta.ts +87 -0
- package/src/app/lib/registry-api/revalidate.ts +36 -0
- package/src/app/lib/registry-api/store.ts +348 -0
- package/src/app/lib/registry-api/token-transfer.ts +231 -0
- package/src/app/lib/registry-api/transfer.ts +513 -0
- package/src/app/lib/registry-api/validation.ts +74 -0
- package/src/app/lib/registry-connection.ts +58 -0
- package/src/app/lib/utils.ts +14 -0
- package/src/app/next.config.mjs +72 -13
- package/src/app/pages/[...slug]/index.tsx +74 -20
- package/src/app/pages/_app.tsx +5 -2
- package/src/app/pages/api/docs/artifacts/[...artifactPath].ts +16 -0
- package/src/app/pages/api/docs/assets/[collection]/[...path].ts +50 -0
- package/src/app/pages/api/docs/assets/[collection]/index.ts +22 -0
- package/src/app/pages/api/docs/components/[id]/assets/[asset].ts +33 -0
- package/src/app/pages/api/docs/components/[id]/inspect/[previewId].ts +20 -0
- package/src/app/pages/api/docs/components/[id]/previews/[previewId].ts +21 -0
- package/src/app/pages/api/docs/components/[id].ts +24 -0
- package/src/app/pages/api/docs/components.json.ts +12 -0
- package/src/app/pages/api/docs/nav.json.ts +48 -0
- package/src/app/pages/api/docs/patterns/[id]/preview.ts +19 -0
- package/src/app/pages/api/docs/patterns/[id].ts +24 -0
- package/src/app/pages/api/docs/patterns.json.ts +12 -0
- package/src/app/pages/api/docs/tokens/components/[id].ts +30 -0
- package/src/app/pages/api/docs/tokens/foundations/[type].ts +32 -0
- package/src/app/pages/api/registry/components/[id]/files/[...filePath].ts +19 -0
- package/src/app/pages/api/registry/components/[id]/files/index.ts +19 -0
- package/src/app/pages/api/registry/components/[id].ts +20 -0
- package/src/app/pages/api/registry/components/index.ts +19 -0
- package/src/app/pages/api/registry/health.ts +20 -0
- package/src/app/pages/api/registry/patterns/[id]/files/[...filePath].ts +19 -0
- package/src/app/pages/api/registry/patterns/[id]/files/index.ts +19 -0
- package/src/app/pages/api/registry/patterns/[id].ts +20 -0
- package/src/app/pages/api/registry/patterns/index.ts +19 -0
- package/src/app/pages/api/registry/transfer/[kind]/[id].ts +39 -0
- package/src/app/pages/api/registry/transfer/assets/[collection].ts +24 -0
- package/src/app/pages/api/registry/transfer/assets/blobs/[hash].ts +23 -0
- package/src/app/pages/api/registry/transfer/assets/blobs/have.ts +11 -0
- package/src/app/pages/api/registry/transfer/assets/index.ts +10 -0
- package/src/app/pages/api/registry/transfer/tokens/[...setId].ts +26 -0
- package/src/app/pages/api/registry/transfer/tokens/index.ts +11 -0
- package/src/app/pages/assets/fonts.tsx +41 -17
- package/src/app/pages/assets/index.tsx +2 -2
- package/src/app/pages/assets/logos.tsx +2 -2
- package/src/app/pages/foundations/colors.tsx +18 -8
- package/src/app/pages/foundations/effects.tsx +18 -8
- package/src/app/pages/foundations/icons/[name]/index.tsx +26 -14
- package/src/app/pages/foundations/icons/index.tsx +13 -9
- package/src/app/pages/foundations/index.tsx +1 -1
- package/src/app/pages/foundations/logo.tsx +7 -4
- package/src/app/pages/foundations/typography.tsx +19 -9
- package/src/app/pages/index.tsx +1 -1
- package/src/app/pages/system/component/[component]/index.tsx +87 -17
- package/src/app/pages/system/index.tsx +13 -4
- package/src/app/pages/system/pattern/[pattern]/index.tsx +70 -14
- package/src/app/pages/system/tokens/components/[component]/index.tsx +42 -14
- package/src/app/pages/system/tokens/foundations/colors.tsx +7 -5
- package/src/app/pages/system/tokens/foundations/effects.tsx +7 -5
- package/src/app/pages/system/tokens/foundations/typography.tsx +8 -4
- package/src/app/tsconfig.json +2 -3
- package/src/app-builder/build.ts +555 -11
- package/src/app-builder/client-config.ts +61 -4
- package/src/app-builder/config-diff/snapshot.ts +1 -11
- package/src/app-builder/index.ts +1 -1
- package/src/app-builder/nav-shell.ts +74 -0
- package/src/app-builder/static-export.ts +215 -0
- package/src/app-builder/vercel-output.ts +297 -0
- package/src/app-builder/watchers/utils.ts +2 -0
- package/src/app-builder/watchers.ts +149 -25
- package/src/app-builder/websocket.ts +2 -2
- package/src/artifacts/README.md +14 -0
- package/src/artifacts/index.ts +17 -0
- package/src/artifacts/types.ts +146 -0
- package/src/artifacts/url.ts +90 -0
- package/src/cache/build-cache.ts +47 -2
- package/src/commands/build/app.ts +1 -2
- package/src/commands/build/index.ts +61 -0
- package/src/commands/checkout/index.ts +66 -0
- package/src/commands/db/migrate.ts +25 -0
- package/src/commands/index.ts +8 -0
- package/src/commands/publish/index.ts +63 -0
- package/src/config/defaults.ts +15 -0
- package/src/config/loader.ts +10 -1
- package/src/config/normalizers/declaration.ts +3 -0
- package/src/config/normalizers/page.ts +45 -0
- package/src/config/normalizers/pattern.ts +4 -1
- package/src/config/runtime.ts +48 -2
- package/src/index.ts +126 -3
- package/src/nav/index.ts +94 -0
- package/src/nav/registry.ts +54 -0
- package/src/nav/resolver.ts +217 -0
- package/src/nav/workspace.ts +87 -0
- package/src/pipeline/styles.ts +4 -35
- package/src/pipeline/token-transformers.ts +97 -0
- package/src/registry/asset-storage/adapters/vercel-blob.ts +51 -0
- package/src/registry/asset-storage/define.ts +15 -0
- package/src/registry/asset-storage/resolve.ts +72 -0
- package/src/registry/asset-storage/types.ts +46 -0
- package/src/registry/assets/layout.ts +38 -0
- package/src/registry/assets/sets.ts +48 -0
- package/src/registry/assets/transfer.ts +50 -0
- package/src/registry/checkout/assets.ts +126 -0
- package/src/registry/checkout/index.ts +596 -0
- package/src/registry/checkout/tokens.ts +152 -0
- package/src/registry/client.ts +234 -0
- package/src/registry/connection.ts +50 -0
- package/src/registry/db/adapter.ts +74 -0
- package/src/registry/db/client.ts +88 -0
- package/src/registry/db/index.ts +35 -0
- package/src/registry/db/migrate.ts +56 -0
- package/src/registry/db/schema.ts +444 -0
- package/src/registry/path.ts +26 -0
- package/src/registry/publish/artifacts.ts +147 -0
- package/src/registry/publish/assets.ts +129 -0
- package/src/registry/publish/errors.ts +34 -0
- package/src/registry/publish/index.ts +128 -0
- package/src/registry/publish/package.ts +272 -0
- package/src/registry/publish/publish-build.ts +51 -0
- package/src/registry/publish/tokens.ts +119 -0
- package/src/registry/tokens/sets.ts +132 -0
- package/src/registry/tokens/transfer.ts +53 -0
- package/src/registry/transfer.ts +82 -0
- package/src/store/filesystem-assets.ts +152 -0
- package/src/store/filesystem.ts +237 -0
- package/src/store/index.ts +62 -0
- package/src/store/registry.ts +334 -0
- package/src/store/source-files.ts +155 -0
- package/src/store/types.ts +210 -0
- package/src/transformers/plugins/csf-render.ts +31 -7
- package/src/transformers/plugins/handlebars-previews.ts +22 -3
- package/src/transformers/plugins/ssr-render.ts +145 -57
- package/src/transformers/preview/component/api.ts +2 -1
- package/src/transformers/preview/component/artifacts.ts +10 -1
- package/src/transformers/preview/component/builder.ts +9 -2
- package/src/transformers/preview/component/css.ts +10 -1
- package/src/transformers/preview/component/javascript.ts +55 -20
- package/src/transformers/preview/component/shared-artifacts.ts +146 -0
- package/src/transformers/preview/component.ts +5 -2
- package/src/transformers/preview/pattern/builder.ts +33 -7
- package/src/transformers/preview/pattern/html.ts +71 -27
- package/src/transformers/preview/types.ts +42 -0
- package/src/transformers/utils/handlebars.ts +31 -5
- package/src/types/config.ts +123 -25
- package/src/utils/menu-shell.ts +241 -0
- package/src/utils/stable-stringify.ts +7 -0
- package/templates/default/package.json.tpl +1 -1
- package/handoff.config.js +0 -90
- package/src/app/components/ComponentSearch.tsx +0 -93
package/Changelog.md
CHANGED
|
@@ -6,19 +6,42 @@ 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.2.2] -
|
|
9
|
+
## \[1.2.2] - TBD
|
|
10
10
|
|
|
11
|
-
This patch release
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
This patch release improves watch-mode reliability for patterns, broadens slot
|
|
12
|
+
default typing, clears downstream lint/build compatibility issues, and fixes a
|
|
13
|
+
few release-branch UI and dependency issues.
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Added
|
|
16
16
|
|
|
17
|
-
*
|
|
18
|
-
|
|
17
|
+
* Added `watchPatternDirectories` so newly created pattern subdirectories are
|
|
18
|
+
detected during `start` without restarting the dev server.
|
|
19
|
+
* Added a shared `NotFound` component and reused it for stale pattern URLs and
|
|
20
|
+
missing markdown pages.
|
|
19
21
|
|
|
20
|
-
###
|
|
22
|
+
### Changed
|
|
21
23
|
|
|
24
|
+
* Broadened `SlotMetadata.default` so slot defaults can be strings, numbers,
|
|
25
|
+
booleans, objects, arrays, or `null`.
|
|
26
|
+
* Refactored component and pattern directory watching through a shared
|
|
27
|
+
`watchEntityDirectories` helper.
|
|
28
|
+
* Downgraded incomplete or mid-edit pattern declarations from hard parse errors
|
|
29
|
+
to warnings, allowing watch mode to retry automatically after the file is
|
|
30
|
+
saved with valid content.
|
|
31
|
+
* Removed unneeded theme declarations.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
* Fixed watch-mode rebuilds for newly added patterns by rebuilding referenced
|
|
36
|
+
component previews before composing the new pattern.
|
|
37
|
+
* Fixed pattern watcher edge cases where declaration IDs differ from directory
|
|
38
|
+
names, and where an initially incomplete pattern config later becomes valid.
|
|
39
|
+
* Fixed `.handoff.ts` declaration files not being detected by the new-entity
|
|
40
|
+
config-file gate.
|
|
41
|
+
* Extended component build-cache inputs to include pattern config files that
|
|
42
|
+
reference the component, preventing stale preview output after pattern changes.
|
|
43
|
+
* Fixed select/list handling when a component group or category value is empty.
|
|
44
|
+
* Fixed CSS typing issues and app build issues found during the release branch.
|
|
22
45
|
* Resolved `no-else-return`, `no-unused-vars`, `camelcase`, `prefer-const`,
|
|
23
46
|
`eqeqeq`, `no-nested-ternary`, `no-lonely-if`, and `no-use-before-define`
|
|
24
47
|
across static pages (catch-all docs, assets, foundations, home, system, and
|
|
@@ -26,17 +49,16 @@ enabling `--downlevelIteration`.
|
|
|
26
49
|
* Removed or refactored unused `getStaticProps` context parameters, props, and
|
|
27
50
|
locals; normalized naming (e.g. font machine keys); simplified icon detail
|
|
28
51
|
routing query handling.
|
|
29
|
-
* Reordered helper components
|
|
30
|
-
|
|
52
|
+
* Reordered helper components ahead of page components where required for
|
|
53
|
+
declaration order.
|
|
31
54
|
* Converted `getComponentPreviews` to a hoisted `function` declaration and
|
|
32
55
|
refactored the component token table for clearer control flow.
|
|
56
|
+
* Avoided iterating `Map`, `Set`, `Iterable`, and `matchAll` results directly in
|
|
57
|
+
`for...of` where the compile target requires `--downlevelIteration`.
|
|
33
58
|
|
|
34
|
-
###
|
|
59
|
+
### Security
|
|
35
60
|
|
|
36
|
-
*
|
|
37
|
-
`for...of` where the compile target requires it: use `Array.from(...)` or
|
|
38
|
-
equivalent helpers in the config-diff registry, snapshot diff, CSF import
|
|
39
|
-
parsing, and component artifact sync.
|
|
61
|
+
* Updated Vite to address a security issue.
|
|
40
62
|
|
|
41
63
|
## \[1.2.1] - 2026-04-08
|
|
42
64
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Handoff - Design
|
|
1
|
+
# Handoff - Design System Runtime
|
|
2
2
|
|
|
3
3
|
<a aria-label="NPM version" href="https://www.npmjs.com/package/handoff-app">
|
|
4
4
|
<img alt="" src="https://img.shields.io/npm/v/handoff-app?style=for-the-badge&labelColor=000000">
|
|
@@ -7,197 +7,451 @@
|
|
|
7
7
|
<img alt="" src="https://img.shields.io/npm/l/handoff-app?style=for-the-badge&labelColor=000000">
|
|
8
8
|
</a>
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Handoff is a design system runtime. It turns the source of truth for your design
|
|
11
|
+
system, the tokens, components, and patterns, into dev-ready artifacts and living
|
|
12
|
+
documentation, and serves both through one consistent runtime whether you are
|
|
13
|
+
authoring locally or running a shared, deployed catalog.
|
|
12
14
|
|
|
13
|
-
## Table of
|
|
15
|
+
## Table of contents
|
|
14
16
|
|
|
15
|
-
* [What
|
|
16
|
-
* [How
|
|
17
|
-
* [Handoff is in Beta!](#handoff-is-in-beta)
|
|
17
|
+
* [What is Handoff?](#what-is-handoff)
|
|
18
|
+
* [How it works](#how-it-works)
|
|
18
19
|
* [Requirements](#requirements)
|
|
19
|
-
* [
|
|
20
|
-
* [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* [
|
|
20
|
+
* [Quick start](#quick-start)
|
|
21
|
+
* [Project layout](#project-layout)
|
|
22
|
+
* [Authoring components and patterns](#authoring-components-and-patterns)
|
|
23
|
+
* [Fetching design tokens](#fetching-design-tokens)
|
|
24
|
+
* [Running locally](#running-locally)
|
|
25
|
+
* [Building artifacts](#building-artifacts)
|
|
26
|
+
* [Static site (default)](#static-site-default)
|
|
27
|
+
* [Registry app](#registry-app)
|
|
28
|
+
* [Publishing and checkout](#publishing-and-checkout)
|
|
29
|
+
* [Configuration](#configuration)
|
|
30
|
+
* [The runtime block](#the-runtime-block)
|
|
31
|
+
* [Environment variables](#environment-variables)
|
|
32
|
+
* [Hooks](#hooks)
|
|
33
|
+
* [CLI reference](#cli-reference)
|
|
34
|
+
* [Further reading](#further-reading)
|
|
25
35
|
* [Maintainers](#maintainers)
|
|
26
36
|
* [Contributing](#contributing)
|
|
27
37
|
* [License](#license)
|
|
28
38
|
|
|
29
|
-
## What
|
|
39
|
+
## What is Handoff?
|
|
40
|
+
|
|
41
|
+
Handoff is an open source design system runtime that closes the gap between
|
|
42
|
+
design and development. By automating the delivery of your design system, it
|
|
43
|
+
helps eliminate the bottlenecks between the two.
|
|
44
|
+
|
|
45
|
+
It brings a few pieces together:
|
|
46
|
+
|
|
47
|
+
* **Token extraction.** Pull standardized foundations from your design source and
|
|
48
|
+
store them as JSON. Figma is supported out of the box through the Figma REST
|
|
49
|
+
API.
|
|
50
|
+
* **Transformation pipeline.** Produce SCSS, CSS, Style Dictionary, and preview
|
|
51
|
+
snippets from that data.
|
|
52
|
+
* **Documentation runtime.** Render live, working previews of your components,
|
|
53
|
+
tokens, and styles, served through a stable docs read API.
|
|
54
|
+
* **Delivery tooling.** Build and ship the deliverables, either as a static site
|
|
55
|
+
or as a deployed, database-backed catalog.
|
|
56
|
+
|
|
57
|
+
Out of the box Handoff ships SCSS and CSS maps for [Bootstrap 5](https://getbootstrap.com/).
|
|
58
|
+
If you use another framework or custom CSS, you can write your own map files to
|
|
59
|
+
connect the generated tokens to your project.
|
|
60
|
+
|
|
61
|
+
You install `handoff-app` as a project-local dependency and run its commands in
|
|
62
|
+
your project's context, so every project pins its own toolchain version.
|
|
63
|
+
|
|
64
|
+
## How it works
|
|
65
|
+
|
|
66
|
+
Handoff has two runtime modes. Mode is resolved solely from `runtime.mode` in
|
|
67
|
+
your config and defaults to `workspace`. It is never inferred from environment
|
|
68
|
+
variables or token presence, so setting `DATABASE_URL` can never silently flip
|
|
69
|
+
your app into another mode. The app chrome shows a `Workspace` or `Registry`
|
|
70
|
+
badge so the active mode is always clear.
|
|
71
|
+
|
|
72
|
+
* **Workspace mode (default).** Your local filesystem is the source of truth.
|
|
73
|
+
You author components, patterns, and tokens locally, preview them with a dev
|
|
74
|
+
server, and build a static documentation snapshot. Local authoring stays fast
|
|
75
|
+
and self-contained, with no database or registry required.
|
|
76
|
+
* **Registry mode.** A deployed, dynamic Next.js app backed by PostgreSQL serves
|
|
77
|
+
a shared catalog. It only ever serves what a workspace published to it. The
|
|
78
|
+
registry never compiles or materializes workspace source.
|
|
79
|
+
|
|
80
|
+
A **connected workspace** is workspace mode plus a registry connection. It still
|
|
81
|
+
renders only your local files and still reads as `Workspace`, but it gains two
|
|
82
|
+
commands: `publish` to push a locally built component or pattern up to a
|
|
83
|
+
registry, and `checkout` to pull one back down into your workspace.
|
|
84
|
+
|
|
85
|
+
Under the hood, documentation in every mode is consumed through one stable docs
|
|
86
|
+
read API and one canonical artifact URL scheme (`/api/docs/artifacts/{path}`),
|
|
87
|
+
so the same UI serves workspace, static, and registry backings without knowing
|
|
88
|
+
which store is behind it.
|
|
30
89
|
|
|
31
|
-
|
|
32
|
-
API and building frontend developer documentation from that Figma file. By
|
|
33
|
-
automating the design token delivery, Handoff helps to eliminate bottlenecks
|
|
34
|
-
between design and development.
|
|
90
|
+
## Requirements
|
|
35
91
|
|
|
36
|
-
|
|
92
|
+
* Node 18.17+
|
|
93
|
+
* npm 8+
|
|
94
|
+
* A paid Figma account, if you fetch tokens from a Figma library
|
|
95
|
+
* PostgreSQL (or a Postgres-compatible service such as Neon) for registry mode
|
|
37
96
|
|
|
38
|
-
|
|
39
|
-
standardized design foundations and components from Figma.
|
|
40
|
-
* **Transformation Pipeline** - A set of transformers for producing SASS, CSS,
|
|
41
|
-
Style Dictionary, and preview snippets from that data.
|
|
42
|
-
* **Documentation Web App** - A static, client side, Javascript web app that
|
|
43
|
-
renders live, working previews of your components, tokens and styles.
|
|
44
|
-
* **Delivery Tools** - Easy build tooling and CI/CD wrapper that allows
|
|
45
|
-
automation to render and ship the various deliverables as needed.
|
|
97
|
+
## Quick start
|
|
46
98
|
|
|
47
|
-
|
|
99
|
+
Scaffold a new project with the interactive wizard:
|
|
48
100
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
design tokens are published as SASS and CSS variables.
|
|
101
|
+
```bash
|
|
102
|
+
npx handoff-app init
|
|
103
|
+
```
|
|
53
104
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
105
|
+
The wizard asks for a project name, whether to include sample components, your
|
|
106
|
+
preferred language (TypeScript or JavaScript), and optionally your Figma project
|
|
107
|
+
ID and access token. It then creates the project directory, writes the config
|
|
108
|
+
and starter files, and installs dependencies.
|
|
58
109
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
110
|
+
```bash
|
|
111
|
+
cd my-handoff-project
|
|
112
|
+
npm run fetch # pull design tokens from Figma (optional if no Figma creds yet)
|
|
113
|
+
npm run start # author locally with live preview at http://localhost:3000
|
|
114
|
+
```
|
|
63
115
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
116
|
+
The generated `package.json` wires up the common scripts:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"scripts": {
|
|
121
|
+
"start": "handoff-app start",
|
|
122
|
+
"dev": "handoff-app dev",
|
|
123
|
+
"build": "handoff-app build",
|
|
124
|
+
"fetch": "handoff-app fetch"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
68
128
|
|
|
69
|
-
|
|
70
|
-
|
|
129
|
+
Any other command can be run with `npx handoff-app <command>` or added as a
|
|
130
|
+
script of your own.
|
|
71
131
|
|
|
72
|
-
|
|
73
|
-
to provide automatic, up-to-date, easily readable developer documentation.
|
|
132
|
+
## Project layout
|
|
74
133
|
|
|
75
|
-
|
|
134
|
+
A typical workspace project looks like this:
|
|
76
135
|
|
|
77
|
-
|
|
136
|
+
```
|
|
137
|
+
my-handoff-project/
|
|
138
|
+
├─ handoff.config.ts # project + runtime configuration
|
|
139
|
+
├─ .env # Figma credentials and other secrets
|
|
140
|
+
├─ components/
|
|
141
|
+
│ └─ button/
|
|
142
|
+
│ ├─ Button.tsx # component implementation
|
|
143
|
+
│ └─ button.handoff.ts # component declaration
|
|
144
|
+
├─ patterns/ # multi-component compositions
|
|
145
|
+
├─ sass/ # optional global SCSS entry
|
|
146
|
+
├─ js/ # optional global JS entry
|
|
147
|
+
├─ exported/ # generated tokens and artifacts (gitignored)
|
|
148
|
+
└─ out/ # build output (gitignored)
|
|
149
|
+
```
|
|
78
150
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
a
|
|
151
|
+
## Authoring components and patterns
|
|
152
|
+
|
|
153
|
+
A component is a directory with an implementation file and a declaration. The
|
|
154
|
+
declaration is discovered as `*.handoff.{ts,js,cjs,json}` (the legacy
|
|
155
|
+
`{dirname}.{js,cjs,json}` form keeps working too). List the directories you want
|
|
156
|
+
built under `entries.components` in your config.
|
|
157
|
+
|
|
158
|
+
Declarations are written with the typed helpers exported from `handoff-app`:
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import { defineReactComponent } from 'handoff-app';
|
|
162
|
+
import Button from './Button';
|
|
163
|
+
|
|
164
|
+
export default defineReactComponent(Button, {
|
|
165
|
+
id: 'button',
|
|
166
|
+
name: 'Button',
|
|
167
|
+
description: 'Interactive button used for primary and secondary actions.',
|
|
168
|
+
group: 'Atomic Elements',
|
|
169
|
+
entries: {
|
|
170
|
+
component: './Button.tsx',
|
|
171
|
+
},
|
|
172
|
+
previews: {
|
|
173
|
+
primary: {
|
|
174
|
+
title: 'Primary',
|
|
175
|
+
args: { type: 'primary', children: 'Click me!' },
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
```
|
|
82
180
|
|
|
83
|
-
|
|
181
|
+
The available helpers are:
|
|
84
182
|
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
183
|
+
* `defineReactComponent` for React components
|
|
184
|
+
* `defineHandlebarsComponent` for Handlebars templates
|
|
185
|
+
* `defineCsfComponent` for Component Story Format stories
|
|
186
|
+
* `defineComponent` for a generic, renderer-agnostic declaration
|
|
187
|
+
* `definePattern` for compositions that reference several components by `id`
|
|
188
|
+
|
|
189
|
+
Every component and pattern has a stable `id` (explicit `id` field, otherwise the
|
|
190
|
+
directory name). The display `name`/`title` is independent of the `id`, so you
|
|
191
|
+
can rename freely without breaking references. Identity is matched by `id`
|
|
192
|
+
during publish and checkout.
|
|
193
|
+
|
|
194
|
+
## Fetching design tokens
|
|
195
|
+
|
|
196
|
+
Handoff fetches tokens from Figma out of the box. Set your Figma credentials in
|
|
197
|
+
`.env`:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
HANDOFF_FIGMA_PROJECT_ID=your-figma-file-id
|
|
201
|
+
HANDOFF_DEV_ACCESS_TOKEN=your-figma-personal-access-token
|
|
202
|
+
```
|
|
88
203
|
|
|
89
|
-
|
|
204
|
+
Then pull the latest foundations and component data:
|
|
90
205
|
|
|
91
|
-
|
|
206
|
+
```bash
|
|
207
|
+
npm run fetch
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
To get a personal access token in Figma, open the Figma menu, go to
|
|
211
|
+
`Help and Account` then `Account Settings`, scroll to `Personal Access Token`,
|
|
212
|
+
name a token, and copy it. Republish your Figma library after design changes and
|
|
213
|
+
run `fetch` again to pick them up.
|
|
92
214
|
|
|
93
|
-
|
|
94
|
-
and duplicate this project to your account
|
|
215
|
+
## Running locally
|
|
95
216
|
|
|
96
|
-
|
|
217
|
+
Both commands run a workspace-first local server with live preview.
|
|
97
218
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
219
|
+
```bash
|
|
220
|
+
handoff-app dev # development server with the live docs read API
|
|
221
|
+
handoff-app start # dev server plus file watchers that rebuild on change
|
|
222
|
+
```
|
|
102
223
|
|
|
103
|
-
|
|
224
|
+
`start` is the day-to-day authoring loop: edit a component, save, and the
|
|
225
|
+
preview updates. The site boots at http://localhost:3000 by default.
|
|
104
226
|
|
|
105
|
-
|
|
106
|
-
* Go to `Help and Account`
|
|
107
|
-
* Click on `Account Settings`
|
|
108
|
-
* Scroll to `Personal Access Token`
|
|
109
|
-
* Enter a token name and hit enter
|
|
110
|
-
* Note that token for the next steps
|
|
227
|
+
## Building artifacts
|
|
111
228
|
|
|
112
|
-
|
|
229
|
+
`handoff-app build` accepts a `--target` flag. The target, not `NODE_ENV`,
|
|
230
|
+
decides what gets produced.
|
|
113
231
|
|
|
114
|
-
|
|
232
|
+
### Static site (default)
|
|
115
233
|
|
|
116
234
|
```bash
|
|
117
|
-
|
|
118
|
-
handoff-app
|
|
235
|
+
handoff-app build # static target (default)
|
|
236
|
+
handoff-app build --target static # explicit, identical output
|
|
119
237
|
```
|
|
120
238
|
|
|
121
|
-
|
|
239
|
+
The static target builds your workspace components, patterns, and tokens,
|
|
240
|
+
materializes the docs read model into route-shaped static files, and runs a
|
|
241
|
+
static export to `out/<projectId>` (respecting `sitesOutputDirectory`). The
|
|
242
|
+
output is plain static files: it renders list, detail, preview, and inspect
|
|
243
|
+
pages and loads previews through canonical artifact URLs with no live server. It
|
|
244
|
+
works on a managed host like Vercel and on a plain static file server with no
|
|
245
|
+
host-specific rewrites.
|
|
122
246
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* **Blank project** - Only the essential configuration files
|
|
127
|
-
3. **Figma configuration** - Optionally provide your Figma project ID and developer access token
|
|
247
|
+
The build fails clearly if a required artifact referenced by generated HTML
|
|
248
|
+
cannot be materialized, and it fails if the runtime is registry-only (there is
|
|
249
|
+
no local workspace to export).
|
|
128
250
|
|
|
129
|
-
|
|
251
|
+
### Registry app
|
|
130
252
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
253
|
+
```bash
|
|
254
|
+
handoff-app build --target registry
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
The registry target packages a deployable, dynamic Next.js app to
|
|
258
|
+
`<sitesOutputDirectory>/registry` (default `out/registry`) as a Next.js
|
|
259
|
+
standalone bundle. It never builds or bundles workspace source and has no
|
|
260
|
+
workspace-source runtime dependency. It serves the docs read API and the
|
|
261
|
+
registry API from the database and published artifacts.
|
|
134
262
|
|
|
135
|
-
|
|
263
|
+
The bundle is self-hostable on a Node server, VPS, or container. Start it with
|
|
264
|
+
`node server.js` from the output directory and supply the database connection at
|
|
265
|
+
deploy time:
|
|
136
266
|
|
|
137
267
|
```bash
|
|
138
|
-
|
|
139
|
-
npm run fetch # Fetch design tokens from Figma
|
|
140
|
-
npm run start # Start the documentation site
|
|
268
|
+
DATABASE_URL="postgres://…" node out/registry/server.js
|
|
141
269
|
```
|
|
142
270
|
|
|
143
|
-
|
|
271
|
+
A generated `README.md` next to the bundle documents the required env vars and
|
|
272
|
+
Docker/Vercel specifics. Apply database migrations from the CLI as a controlled
|
|
273
|
+
release step (e.g. in CI/CD) before deploying:
|
|
144
274
|
|
|
145
|
-
|
|
275
|
+
```bash
|
|
276
|
+
handoff-app db:migrate
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`db:migrate` reads your project config and DB env vars, applies the
|
|
280
|
+
package-owned migration set, and runs independently of `build`. The database
|
|
281
|
+
adapter (`pg` or `neon`) is chosen with `runtime.registry.database.adapter`, and
|
|
282
|
+
both adapters ship with the package.
|
|
283
|
+
|
|
284
|
+
## Publishing and checkout
|
|
146
285
|
|
|
147
|
-
|
|
286
|
+
Connect a workspace to a registry by adding a `registryConnection` block to your
|
|
287
|
+
config and setting the access token env var:
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
runtime: {
|
|
291
|
+
mode: 'workspace',
|
|
292
|
+
registryConnection: {
|
|
293
|
+
url: 'https://registry.example.com',
|
|
294
|
+
accessTokenEnv: 'HANDOFF_REGISTRY_ACCESS_TOKEN',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
```
|
|
148
298
|
|
|
149
299
|
```bash
|
|
150
|
-
|
|
151
|
-
|
|
300
|
+
# .env
|
|
301
|
+
HANDOFF_REGISTRY_ACCESS_TOKEN=your-registry-token
|
|
152
302
|
```
|
|
153
303
|
|
|
154
|
-
|
|
304
|
+
Then push and pull entities by `id`:
|
|
155
305
|
|
|
156
306
|
```bash
|
|
157
|
-
|
|
158
|
-
handoff-app
|
|
159
|
-
|
|
307
|
+
handoff-app publish component button # build locally, upload that entity's package
|
|
308
|
+
handoff-app checkout pattern hero # pull a registry entity into this workspace
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
`publish` runs a fresh targeted build of the selected entity and uploads only
|
|
312
|
+
that entity's package: normalized metadata, source files referenced by its
|
|
313
|
+
`entries`, rendered docs artifacts (including required shared artifacts like
|
|
314
|
+
`component/main.css` and `component/main.js`), and build metadata. It fails
|
|
315
|
+
before upload if required artifacts are missing, stale, or incompatible, and it
|
|
316
|
+
never touches unrelated entities' artifacts. Declaration files are never
|
|
317
|
+
uploaded.
|
|
318
|
+
|
|
319
|
+
`checkout` reads the registry record and source files, writes them in standard
|
|
320
|
+
authoring form, and synthesizes a local declaration in your configured
|
|
321
|
+
`runtime.workspace.declarationFormat` (defaulting to `js`). Declarations are a
|
|
322
|
+
workspace-only concern, so they are always synthesized locally and never read
|
|
323
|
+
from the registry. Overwriting existing local files requires `--force` or an
|
|
324
|
+
interactive confirmation.
|
|
325
|
+
|
|
326
|
+
## Configuration
|
|
327
|
+
|
|
328
|
+
Project configuration lives in `handoff.config.{ts,js,cjs,json}` (resolved in
|
|
329
|
+
that precedence order). TypeScript and ESM configs use `defineConfig` for typed
|
|
330
|
+
authoring; plain CommonJS configs that never call `defineConfig` keep working
|
|
331
|
+
unchanged.
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
import { defineConfig } from 'handoff-app';
|
|
335
|
+
|
|
336
|
+
export default defineConfig({
|
|
337
|
+
app: {
|
|
338
|
+
title: 'Acme Design System',
|
|
339
|
+
client: 'Acme Corp',
|
|
340
|
+
basePath: '',
|
|
341
|
+
},
|
|
342
|
+
entries: {
|
|
343
|
+
scss: './sass/main.scss',
|
|
344
|
+
js: './js/main.js',
|
|
345
|
+
components: ['components/button', 'components/badge'],
|
|
346
|
+
patterns: ['patterns'],
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### The runtime block
|
|
352
|
+
|
|
353
|
+
The `runtime` block selects the mode and carries mode-specific settings. It is
|
|
354
|
+
optional and deep-merged into the defaults, so a partial block never wipes them.
|
|
355
|
+
|
|
356
|
+
```ts
|
|
357
|
+
runtime: {
|
|
358
|
+
// Sole determinant of runtime mode. Defaults to 'workspace'.
|
|
359
|
+
mode: 'workspace', // 'workspace' | 'registry'
|
|
360
|
+
|
|
361
|
+
workspace: {
|
|
362
|
+
// Format for newly generated / checkout-synthesized declarations.
|
|
363
|
+
declarationFormat: 'ts', // 'ts' | 'js' | 'cjs' | 'json'
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
// Connect a workspace to a remote registry (publish/checkout).
|
|
367
|
+
registryConnection: {
|
|
368
|
+
url: 'https://registry.example.com',
|
|
369
|
+
accessTokenEnv: 'HANDOFF_REGISTRY_ACCESS_TOKEN',
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
// Registry deployment settings (build --target registry, db:migrate).
|
|
373
|
+
registry: {
|
|
374
|
+
databaseUrlEnv: 'DATABASE_URL',
|
|
375
|
+
apiTokenEnv: 'HANDOFF_REGISTRY_API_TOKEN',
|
|
376
|
+
database: { adapter: 'pg' }, // 'pg' | 'neon'
|
|
377
|
+
},
|
|
378
|
+
},
|
|
160
379
|
```
|
|
161
380
|
|
|
162
|
-
|
|
381
|
+
Secrets are always referenced by environment-variable name, never written as
|
|
382
|
+
values, and are redacted from API responses.
|
|
163
383
|
|
|
164
|
-
|
|
165
|
-
* Republish the changes to the library. Click on the publish button from the main
|
|
166
|
-
dropdown. You'll see a list of changes that have been made. Clicking publish
|
|
167
|
-
will make those changes available to handoff.
|
|
168
|
-
* Back in your project, open a new terminal tab and type `npm run fetch`
|
|
384
|
+
### Environment variables
|
|
169
385
|
|
|
170
|
-
|
|
386
|
+
| Variable | Purpose |
|
|
387
|
+
| --- | --- |
|
|
388
|
+
| `HANDOFF_FIGMA_PROJECT_ID` | Figma file ID used by `fetch` |
|
|
389
|
+
| `HANDOFF_DEV_ACCESS_TOKEN` | Figma personal access token used by `fetch` |
|
|
390
|
+
| `HANDOFF_REGISTRY_URL` | Default env var for a connected workspace's registry URL |
|
|
391
|
+
| `HANDOFF_REGISTRY_ACCESS_TOKEN` | Connected-workspace access token for publish/checkout |
|
|
392
|
+
| `DATABASE_URL` | Registry database connection string (name is configurable) |
|
|
393
|
+
| `HANDOFF_REGISTRY_API_TOKEN` | Bearer token guarding registry management mutations |
|
|
171
394
|
|
|
172
|
-
|
|
395
|
+
### Hooks
|
|
173
396
|
|
|
174
|
-
Pipeline customization is done in
|
|
397
|
+
Pipeline customization is done in your config under `hooks` (camelCase names such
|
|
398
|
+
as `validateComponent`, `jsBuildConfig`, `registerHandlebarsHelpers`). For
|
|
399
|
+
example, `registerHandlebarsHelpers` runs after Handoff registers the built-in
|
|
400
|
+
`field` and `eq` helpers, so you can register your own helpers for `.hbs`
|
|
401
|
+
preview templates.
|
|
175
402
|
|
|
176
403
|
See [docs/api.md](docs/api.md#hooks) for hook arguments and examples.
|
|
177
404
|
|
|
178
|
-
##
|
|
405
|
+
## CLI reference
|
|
406
|
+
|
|
407
|
+
| Command | Description |
|
|
408
|
+
| --- | --- |
|
|
409
|
+
| `init` | Scaffold a new workspace project with the interactive wizard |
|
|
410
|
+
| `fetch` | Fetch design tokens from Figma |
|
|
411
|
+
| `dev` | Start the local dev server with the live docs read API |
|
|
412
|
+
| `start` | Start the dev server with file watchers for live authoring |
|
|
413
|
+
| `build [--target static\|registry]` | Build the static site (default) or package the registry app |
|
|
414
|
+
| `build:components [component]` | Build components without building the full app |
|
|
415
|
+
| `publish <component\|pattern> <id>` | Build and publish an entity to the connected registry |
|
|
416
|
+
| `checkout <component\|pattern> <id>` | Pull an entity from the connected registry |
|
|
417
|
+
| `db:migrate` | Run registry database migrations (Drizzle / PostgreSQL) |
|
|
418
|
+
| `make:component <name>` | Scaffold a new component |
|
|
419
|
+
| `make:page <name> [parent]` | Scaffold a documentation page |
|
|
420
|
+
| `make:template <component> [state]` | Scaffold a preview template |
|
|
421
|
+
| `eject:config` | Eject the default config to the project |
|
|
422
|
+
| `eject:pages` | Eject the default documentation pages |
|
|
423
|
+
| `eject:theme` | Eject the default theme |
|
|
424
|
+
| `validate:components` | Run component validation |
|
|
425
|
+
|
|
426
|
+
Global flags: `-c, --config <file>`, `-d, --debug`, `-f, --force`,
|
|
427
|
+
`-h, --help`, `-v, --version`. See [docs/cli.md](docs/cli.md) for the full
|
|
428
|
+
reference.
|
|
429
|
+
|
|
430
|
+
## Further reading
|
|
179
431
|
|
|
180
432
|
* [Configure your project](https://www.handoff.com/docs/customization)
|
|
181
433
|
* [Customize the content](https://www.handoff.com/docs/customization/content)
|
|
182
434
|
* [Integrate tokens with your project](https://www.handoff.com/docs/tokens/integration)
|
|
183
|
-
* [Build to
|
|
184
|
-
* [
|
|
185
|
-
* [
|
|
435
|
+
* [Build to static assets](https://www.handoff.com/docs/tokens/publishing)
|
|
436
|
+
* [GitHub Actions CI/CD](https://www.handoff.com/docs/infrastructure/github/)
|
|
437
|
+
* [Bitbucket Pipelines CI/CD](https://www.handoff.com/docs/infrastructure/bitbucket/)
|
|
186
438
|
|
|
187
439
|
## Maintainers
|
|
188
440
|
|
|
189
441
|
[@bradmering](https://github.com/bradmering)
|
|
190
442
|
|
|
191
|
-
[@DomagojGojak](https://github.com/DomagojGojak)
|
|
443
|
+
[@DomagojGojak](https://github.com/DomagojGojak)
|
|
192
444
|
|
|
193
|
-
[@Natko](https://github.com/Natko)
|
|
445
|
+
[@Natko](https://github.com/Natko)
|
|
194
446
|
|
|
195
447
|
## Contributing
|
|
196
448
|
|
|
197
|
-
Feel free to dive in
|
|
449
|
+
Feel free to dive in. [Open an issue](https://github.com/Convertiv/handoff-app/issues/new)
|
|
450
|
+
or submit a PR.
|
|
198
451
|
|
|
199
|
-
Handoff follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/)
|
|
452
|
+
Handoff follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/)
|
|
453
|
+
Code of Conduct.
|
|
200
454
|
|
|
201
455
|
## License
|
|
202
456
|
|
|
203
|
-
[MIT](
|
|
457
|
+
[MIT](License.md) ©Convertiv
|