Skip to content

Commit e7f8a0f

Browse files
author
figma-bot
committed
Code Connect v1.1.0
1 parent 76c9fcc commit e7f8a0f

File tree

190 files changed

+6067
-2997
lines changed

Some content is hidden

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

190 files changed

+6067
-2997
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ bundle/
1111
.swiftpm/
1212
bundle-cli
1313
webpack-dist
14+
bundle-npm

CHANGELOG.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# Code Connect v1.1.0 (10th September 2024)
2+
3+
## Features
4+
5+
### HTML
6+
- 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.
7+
8+
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).
9+
10+
### SwiftUI
11+
- Added a `swiftPackagePath` configuration option to specify a custom path to a `Package.swift` file to run Code Connect from.
12+
13+
### React
14+
- 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.
15+
16+
### General
17+
18+
- Restructured the Code Connect documentation. All documentation can now be found in the [docs](docs) directory.
19+
20+
## Fixed
21+
22+
### React
23+
- `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)
24+
- Fixed an issue where backticks could not be used in the example code (fixes https://github.com/figma/code-connect/issues/139)
25+
- Fixed an issue with wildcard paths in import mappings
26+
- Fixed an error when trying to use the icon script with component sets
27+
128
# Code Connect v1.0.6 (21st August 2024)
229

330
## Fixed
@@ -7,7 +34,6 @@
734

835
## Features
936

10-
1137
### React
1238
- figma.enum now supports floating point numbers
1339

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-prerelease-2024-08-14"),
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

+11-5
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

@@ -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

@@ -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)