Skip to content

Commit cd89f8f

Browse files
committed
Merge branch 'main' into add_custom_cli_path_swiftui
# Conflicts: # cli/src/connect/parser_executables.ts
2 parents 8702880 + 24ef296 commit cd89f8f

File tree

305 files changed

+9550
-3551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+9550
-3551
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for the project.
44
title: ''
5-
labels: ''
5+
labels: 'feature request'
66
assignees: ''
77
---
88

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ bundle/
1111
.swiftpm/
1212
bundle-cli
1313
webpack-dist
14+
bundle-npm
15+
bundle-local

CHANGELOG.md

+135-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,134 @@
1+
# Code Connect v1.2.2 (5th November 2024)
2+
3+
## Features
4+
5+
### General
6+
- Added support to create Custom parsers. Those allow users to add support for languages which aren't natively supported by Code Connect. Check the [documentation](https://github.com/figma/code-connect/blob/main/docs/custom.md) for more details.
7+
8+
## Fixed
9+
10+
### React
11+
- Only show AI question for React
12+
- Fix error in autolinking in reduce function
13+
14+
# Code Connect v1.2.1 (23rd October 2024)
15+
16+
### General
17+
- Added a `--exit-on-unreadable-files` flag to all commands to exit if any Code Connect files cannot be parsed. We recommend using this option for CI/CD.
18+
19+
## Fixed
20+
21+
### React
22+
- Fixed a bug introduced in 1.2.0 where `nestedProps` referencing a hidden layer would result in an error rendering Code Connect
23+
24+
### SwiftUI
25+
- Fixed potential "index is out of bounds" error.
26+
27+
### General
28+
- Changed how the extension makes HTTP requests to resolve issues when connecting through a proxy. Please [submit a support ticket](https://help.figma.com/hc/en-us/requests/new?ticket_form_id=360001744374) if you continue to have connection issues after this update.
29+
30+
### Compose
31+
32+
- Fixed some parsing errors when running the `create` and `publish` commands
33+
34+
# Code Connect v1.2.0
35+
36+
## Features
37+
38+
### General
39+
- The interactive setup now offers AI support for accurate prop mapping between Figma and code components. Users will now be given the option to use AI during the setup process, which if chosen will assist in creating Code Connect files and attempting to accurately map your code to Figma properties.
40+
41+
Data is used only for mapping and is not stored or used for training. To learn more, visit https://help.figma.com/hc/en-us/articles/23920389749655-Code-Connect
42+
43+
### React
44+
- Added support for returning strings or React components from the `example` function, in addition to JSX
45+
- Added `getProps` on `figma.instance()` which can be used to access props of a nested connected component
46+
- Added `render` on `figma.instance()` which can be used to render a nested connected component dynamically
47+
- Added support for including any custom props in the `props` object, that can be accessed with `getProps` in a parent component
48+
49+
## Fixed
50+
51+
### HTML
52+
- Case of attribute names is now preserved to support Angular (fixes https://github.com/figma/code-connect/issues/172)
53+
- Fixed a bug with `nestedProps` (fixes https://github.com/figma/code-connect/issues/176)
54+
55+
## Fixed
56+
57+
# Code Connect v1.1.4 (26th September 2024)
58+
59+
## Fixed
60+
61+
### React
62+
- Fixed a Prettier bug with the interactive setup
63+
- Removed empty enum mappings from generated Code Connect in interactive setup
64+
- Fixed an issue with props not rendering correctly in the Figma UI if used in the body of a component (e.g. as a hook argument). Any Code Connect with this issue will need republishing to be fixed. (fixes https://github.com/figma/code-connect/issues/167)
65+
- Support mapping from an enum value to a boolean prop in CLI Assistant
66+
67+
## Features
68+
69+
### Compose
70+
- The dependencies required to author Code Connect files now live in a separate module from the plugin and are hosted on Maven Central. Refer to the [documentation](docs/compose.md) for updated instructions on adding Code Connect to your project.
71+
72+
### SwiftUI
73+
- Updated the swift-syntax dependency to include 600.0.0 (Swift 6)
74+
75+
# Code Connect v1.1.3 (11th September 2024)
76+
77+
## Fixed
78+
79+
### HTML
80+
- Fixed an issue where `imports` was incorrectly not included in the TypeScript interface
81+
- Added a note in the [documentation](docs/html.md) that HTML support requires `moduleResolution: "NodeNext"`
82+
83+
### React
84+
- Fixed an issue where `imports` was incorrectly not included in the TypeScript interface (fixes https://github.com/figma/code-connect/issues/159)
85+
86+
## Features
87+
88+
### React
89+
- Code Connect files created in the CLI assistant will now start try to use auto-generated prop mappings in the component props. This is an early feature and support for different types is limited.
90+
91+
# Code Connect v1.1.2 (10th September 2024)
92+
93+
## Fixed
94+
95+
### React
96+
- Fixed an issue with `client` export used by the icon script (fixes https://github.com/figma/code-connect/issues/156)
97+
98+
# Code Connect v1.1.1 (10th September 2024)
99+
100+
## Fixed
101+
102+
### General
103+
- Fixed an issue where the `@figma/[email protected]` npm package had an incorrect README
104+
105+
# Code Connect v1.1.0 (10th September 2024)
106+
107+
## Features
108+
109+
### HTML
110+
- Added support for documenting HTML-based frameworks (including Web Components, Angular and Vue), using the new `html` parser. See the [documentation](docs/html.md) for more information.
111+
112+
HTML support for Code Connect is in preview, and the API is liable to change during this period. Please let us know your feedback via [GitHub Issues](https://github.com/figma/code-connect/issues/new/choose).
113+
114+
### SwiftUI
115+
- Added a `swiftPackagePath` configuration option to specify a custom path to a `Package.swift` file to run Code Connect from.
116+
117+
### React
118+
- Code Connect files created in the CLI assistant will now start including some auto-generated prop mappings between Figma properties and linked code props. This is an early feature and support for different prop types is limited.
119+
120+
### General
121+
122+
- Restructured the Code Connect documentation. All documentation can now be found in the [docs](docs) directory.
123+
124+
## Fixed
125+
126+
### React
127+
- `figma.nestedProps` can now be used in conjunction with `figma.boolean` for conditionally hidden nested instances (fixes https://github.com/figma/code-connect/issues/118, https://github.com/figma/code-connect/issues/89)
128+
- Fixed an issue where backticks could not be used in the example code (fixes https://github.com/figma/code-connect/issues/139)
129+
- Fixed an issue with wildcard paths in import mappings
130+
- Fixed an error when trying to use the icon script with component sets
131+
1132
# Code Connect v1.0.6 (21st August 2024)
2133

3134
## Fixed
@@ -7,7 +138,6 @@
7138

8139
## Features
9140

10-
11141
### React
12142
- figma.enum now supports floating point numbers
13143

@@ -154,10 +284,10 @@
154284

155285
### React
156286

157-
- Added support for [nested properties](cli/README.md#nested-properties), using `figma.nestedProps`
158-
- Added support for [concatenating strings for CSS class names](cli/README.md#classname), using `figma.className`
159-
- Added support for [text content from layers](cli/README.md#text-content), using `figma.textContent`
160-
- Added support for [wildcards](cli/README.md#wildcard-match) with `figma.children`
287+
- Added support for [nested properties](docs/react.md#nested-properties), using `figma.nestedProps`
288+
- Added support for [concatenating strings for CSS class names](docs/react.md#classname), using `figma.className`
289+
- Added support for [text content from layers](docs/react.md#text-content), using `figma.textContent`
290+
- Added support for [wildcards](docs/react.md#wildcard-match) with `figma.children`
161291

162292
### SwiftUI
163293

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/apple/swift-syntax",
1616
"state" : {
17-
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
18-
"version" : "509.1.1"
17+
"revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82",
18+
"version" : "510.0.3"
1919
}
2020
},
2121
{

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let package = Package(
1515
.executable(name: "figma-swift", targets: ["CodeConnectCLI"])
1616
],
1717
dependencies: [
18-
.package(url: "https://github.com/apple/swift-syntax", from: "509.1.1"),
18+
.package(url: "https://github.com/apple/swift-syntax", "510.0.3"..."600.0.0"),
1919
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
2020
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.49.0"),
2121
],

README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Code Connect is a tool for connecting your design system components in code with your design system in Figma. When using Code Connect, Figma's Dev Mode will display true-to-production code snippets from your design system instead of autogenerated code examples. In addition to connecting component definitions, Code Connect also supports mapping properties from code to Figma enabling dynamic and correct examples. This can be useful for when you have an existing design system and are looking to drive consistent and correct adoption of that design system across design and engineering.
44

5-
Code Connect is easy to set up, easy to maintain, type-safe, and extensible. Out of the box Code Connect comes with support for React (and React Native), Storybook, SwiftUI and Jetpack Compose.
5+
Code Connect is easy to set up, easy to maintain, type-safe, and extensible. Out of the box Code Connect comes with support for React (and React Native), Storybook, HTML (e.g. Web Components, Angular and Vue), SwiftUI and Jetpack Compose.
66

77
![image](https://static.figma.com/uploads/d98e747613e01685d6a0f9dd3e2dcd022ff289c0.png)
88

@@ -11,7 +11,7 @@ Code Connect is easy to set up, easy to maintain, type-safe, and extensible. Out
1111
1212
## CLI installation
1313

14-
To install Code Connect locally to a React project, you can follow the instructions in the [React README](cli/README.md#installation).
14+
To install Code Connect locally to a React project, you can follow the instructions in the [React README](docs/react.md#installation).
1515

1616
For other platforms, you first need to have Node.js v16 or newer installed on your computer. You can check if you already have Node.js installed and which version by running `node -v`. If you need to install Node.js, instructions for all platforms can be found [on the Node.js website](https://nodejs.org/en/download/package-manager).
1717

@@ -25,9 +25,10 @@ We hope to provide a way to install Code Connect without requiring Node.js soon.
2525

2626
To learn how to implement Code Connect for your platform, please navigate to the platform-specific API usage and documentation.
2727

28-
- [React (or React Native)](cli/README.md)
29-
- [SwiftUI](swiftui/README.md)
30-
- [Jetpack Compose](compose/README.md)
28+
- [React (or React Native)](docs/react.md)
29+
- [HTML (Web Components, Angular, Vue, etc.)](docs/html.md)
30+
- [SwiftUI](docs/swiftui.md)
31+
- [Jetpack Compose](docs/compose.md)
3132

3233
## General configuration
3334

@@ -37,7 +38,7 @@ Every platform supports some common configuration options, in addition to any pl
3738

3839
### `include` and `exclude`
3940

40-
`include` and `exclude` are lists of globs for where to parse Code Connect files, and for where to search for your component code when using the [interactive setup](cli/README.md#interactive-setup). `include` and `exclude` paths must be relative to the location of the config file.
41+
`include` and `exclude` are lists of globs for where to parse Code Connect files, and for where to search for your component code when using the [interactive setup](docs/react.md#interactive-setup). `include` and `exclude` paths must be relative to the location of the config file.
4142

4243
```jsonp
4344
{
@@ -53,10 +54,11 @@ Every platform supports some common configuration options, in addition to any pl
5354
Code Connect will attempt to determine your project type by looking the first ancestor of the working directory which matches one of the following:
5455

5556
- If a `package.json` containing `react` is found, your project is detected as React
57+
- If a `package.json` is found not containing `react`, your project is detected as HTML
5658
- If a file matching `Package.swift` or `*.xcodeproj` is found, your project is detected as Swift
5759
- If a file matching `build.gradle.kts` is found, your project is detected as Jetpack Compose
5860

59-
In case this does not correctly work for your project, you can override the project type by using the `parser` configuration key. Valid values are `react`, `swift` and `compose`.
61+
In case this does not correctly work for your project, you can override the project type by using the `parser` configuration key. Valid values are `react`, `html`, `swift` and `compose`.
6062

6163
```jsonp
6264
{
@@ -66,6 +68,10 @@ In case this does not correctly work for your project, you can override the proj
6668
}
6769
```
6870

71+
### `label`
72+
73+
`label` allows you to specify the label used in Figma for your Code Connect docs. This defaults to the type of your project (e.g. `React`). You can override this to show a different name in the UI, which can be useful for e.g. showing different versions of the code.
74+
6975
### `documentUrlSubstitutions`
7076

7177
`documentUrlSubstitutions` allows you to specify a set of substitutions which will be run on the `figmaNode` URLs when parsing or publishing documents.

0 commit comments

Comments
 (0)