Repository navigation
aiops: site-components - Follow the built template composition in the manifest #3999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ZaredRogers
wants to merge
25
commits into
develop
Choose a base branch
from
aiops/git-2754-manifest-composition
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
663cf74
fix(skills): site-to-figma-components - follow the built template com…
ZaredRogers 7c23c7b
docs(skills): figma-to-block-theme - handle manifest overrides and ex…
ZaredRogers 05ef493
fix(skills): validate Figma composition and preserve text overrides w…
coderabbitai[bot] 120918a
fix(skills): site-to-figma-components - tidy CodeRabbit autofix and f…
ZaredRogers fadcd3a
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] a7a6977
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] e31a176
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 147bdf1
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 91b5783
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] b3cf720
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] f4ccf19
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 91ad19f
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] de7604e
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] f8d9947
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 26c28b8
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] b14b1dc
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] cb5d6d1
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 6a0cbff
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 097bd79
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 4ba842c
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 05e65fe
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] f3b5744
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 5b30ee7
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 1dd228c
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] 7c409de
Merge branch 'develop' into aiops/git-2754-manifest-composition
lightspeed-docs-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
skills/site-to-figma-components/scripts/__tests__/figma-build.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { readFileSync } from 'node:fs'; | ||
| import { join } from 'node:path'; | ||
| import { runInNewContext } from 'node:vm'; | ||
|
|
||
| // Exercise the documented read-only scan against synthetic Figma nodes. | ||
| const guide = readFileSync( | ||
| join(process.cwd(), 'skills/site-to-figma-components/references/figma-build.md'), | ||
| 'utf8' | ||
| ); | ||
| const snippet = /```js\n([\s\S]*?)\n```/.exec(guide)![1]; | ||
|
|
||
| describe('documented composition scan', () => { | ||
| it('continues after an unresolved instance and records every changed text property', async () => { | ||
| const owner = { | ||
| type: 'COMPONENT_SET', | ||
| description: 'Inventory id pattern:cards', | ||
| componentPropertyDefinitions: { | ||
| 'Heading#1': { defaultValue: 'Heading' }, | ||
| 'Body#2': { defaultValue: 'Body' }, | ||
| 'Link#3': { defaultValue: 'Link' }, | ||
| }, | ||
| }; | ||
| const main = { parent: owner }; | ||
| const instance = { | ||
| type: 'INSTANCE', | ||
| getMainComponentAsync: async () => main, | ||
| componentProperties: { | ||
| 'Heading#1': { type: 'TEXT', value: 'Heading' }, | ||
| 'Body#2': { type: 'TEXT', value: 'New body' }, | ||
| 'Link#3': { type: 'TEXT', value: '' }, | ||
| Visible: { type: 'BOOLEAN', value: false }, | ||
| }, | ||
| }; | ||
| const children = [ | ||
| { type: 'INSTANCE', id: '1:2', getMainComponentAsync: async () => null }, | ||
| instance, | ||
| { | ||
| ...instance, | ||
| getMainComponentAsync: async () => ({ ...owner, parent: null }), | ||
| componentProperties: {}, | ||
| }, | ||
| { type: 'FRAME', name: 'Custom' }, | ||
| ]; | ||
| const out = await runInNewContext(`(async () => { ${snippet} })()`, { | ||
| figma: { getNodeByIdAsync: async () => ({ children }) }, | ||
| }); | ||
| expect(out).toEqual([ | ||
| { id: 'unknown:1:2' }, | ||
| { id: 'pattern:cards', overrides: { 'Body#2': 'New body', 'Link#3': '' } }, | ||
| 'pattern:cards', | ||
| { id: 'local:Custom' }, | ||
| ]); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.