From cfed2bf6f63c5d61d9d358556d3a7117ba9c59ba Mon Sep 17 00:00:00 2001 From: figma-bot Date: Fri, 14 Feb 2025 14:51:14 +0000 Subject: [PATCH] Code Connect v1.3.1 --- CHANGELOG.md | 15 ++++++ Package.swift | 16 +++--- cli/package.json | 22 ++++---- cli/patches/@types+prompts+2.4.9.patch | 12 ----- cli/patches/prompts+2.4.2.patch | 14 ----- cli/src/commands/connect.ts | 10 ++-- .../e2e/e2e_parse_command_raw.test.ts | 2 +- .../connect/__test__/e2e/test_wizard_e2e.ts | 3 +- cli/src/connect/project.ts | 11 ++++ cli/src/connect/wizard/helpers.ts | 10 ++-- cli/src/connect/wizard/run_wizard.ts | 54 ++++++++++--------- 11 files changed, 87 insertions(+), 82 deletions(-) delete mode 100644 cli/patches/@types+prompts+2.4.9.patch delete mode 100644 cli/patches/prompts+2.4.2.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a00843..f91ae9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# Code Connect v1.3.1 (TBD) + +## Fixed + +- Allow .gradle files to be detected as Android/Compose projects. Thanks to @sebastienrouif for the [PR](https://github.com/figma/code-connect/pull/237) +- Remove prompts patching (fixes https://github.com/figma/code-connect/issues/241) + +## Features + +- Added `interactiveSetupFigmaFileUrl` to the interactive setup, allowing you to specify the Figma file to use for connecting components in your `figma.config.json` file. +- Rename `--include-raw-templates` flag to `--include-template-files`. Further details of this feature can be found in the [documentation](https://www.figma.com/code-connect-docs/no-parser/). + +### SwiftUI +- Updated `swift-syntax` to point to the new URL. Thanks to @pontusJPaf for the [PR](https://github.com/figma/code-connect/pull/239). + # Code Connect v1.3.0 (28th January 2025) ## Features diff --git a/Package.swift b/Package.swift index e4e88c9..6af5a58 100644 --- a/Package.swift +++ b/Package.swift @@ -8,14 +8,14 @@ let package = Package( name: "Figma", platforms: [ .iOS(.v15), - .macOS(.v13) + .macOS(.v13), ], products: [ .library(name: "Figma", targets: ["Figma"]), - .executable(name: "figma-swift", targets: ["CodeConnectCLI"]) + .executable(name: "figma-swift", targets: ["CodeConnectCLI"]), ], dependencies: [ - .package(url: "https://github.com/apple/swift-syntax", "510.0.3"..."600.0.0"), + .package(url: "https://github.com/swiftlang/swift-syntax", "510.0.3"..."600.0.1"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.55.3"), ], @@ -28,7 +28,7 @@ let package = Package( name: "CodeConnectCLI", dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), - .target(name: "CodeConnectParser") + .target(name: "CodeConnectParser"), ], path: "swiftui/cli" ), @@ -39,7 +39,7 @@ let package = Package( .product(name: "SwiftParser", package: "swift-syntax"), .product(name: "SwiftFormat", package: "SwiftFormat"), .product(name: "SwiftSyntaxBuilder", package: "swift-syntax"), - .target(name: "Figma") + .target(name: "Figma"), ], path: "swiftui/lib" ), @@ -48,12 +48,12 @@ let package = Package( dependencies: [ .product(name: "SwiftSyntax", package: "swift-syntax"), .target(name: "CodeConnectParser"), - .target(name: "Figma") + .target(name: "Figma"), ], path: "swiftui/Tests/CodeConnectParserTest", resources: [ - .copy("Samples.figma.test"), + .copy("Samples.figma.test") ] - ) + ), ] ) diff --git a/cli/package.json b/cli/package.json index a86d214..f2f7ad0 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@figma/code-connect", - "version": "1.3.0", + "version": "1.3.1", "description": "A tool for connecting your design system components in code with your design system in Figma", "keywords": [], "author": "Figma", @@ -29,8 +29,7 @@ "figma": "bin/figma" }, "files": [ - "dist/**/*", - "patches/**/*" + "dist/**/*" ], "engines": { "node": ">=18" @@ -41,7 +40,7 @@ "build:web": "pnpm build", "build:webpack": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" webpack --mode production", "test": "npm run test:no-coverage -- --coverage", - "test:no-coverage": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" npx jest", + "test:no-coverage": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation --max-old-space-size=10240\" npx jest --logHeapUsage --workerIdleMemoryLimit=1.5G", "test:fast": "npm run test -- --testPathIgnorePatterns=template_rendering.test.ts --testPathIgnorePatterns=e2e_parse_command_swift.test.ts --testPathIgnorePatterns=e2e_wizard_swift.test.ts", "test:ci": "npm run test:non-mac -- --runInBand", "test:wizard": "npm run test -- --runInBand --testPathPattern=e2e_wizard_react.test.ts --testPathPattern=e2e_wizard_swift.test.ts", @@ -59,11 +58,15 @@ "bundle:cli:win": "npm run bundle:cli -- -o bundle-cli/figma-win --target node18-win-x64", "publish:npm": "npm install && npm run build && npm run bundle:npm-readme:prepare && npm publish --access public; npm run bundle:npm-readme:restore", "typecheck": "tsc --noEmit -p tsconfig-typecheck.json", - "benchmarking:run": "npx tsx ./src/connect/wizard/__test__/prop_mapping/prop_mapping_benchmarking.ts", - "postinstall": "patch-package" + "benchmarking:run": "npx tsx ./src/connect/wizard/__test__/prop_mapping/prop_mapping_benchmarking.ts" }, "devDependencies": { + "@babel/core": "7.26.0", + "@babel/generator": "7.26.2", + "@babel/parser": "7.26.0", + "@babel/types": "7.26.0", + "@storybook/csf-tools": "^8.4.7", "@types/cross-spawn": "^6.0.6", "@types/jest": "^29.5.13", "@types/jsdom": "^21.1.7", @@ -74,6 +77,7 @@ "@types/react": "18.0.26", "cross-env": "^7.0.3", "jest": "^29.7.0", + "patch-package": "^8.0.0", "pkg": "^5.8.1", "react": "18.2.0", "ts-jest": "^29.2.5", @@ -83,12 +87,7 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "@babel/core": "7.26.0", - "@babel/generator": "7.26.2", - "@babel/parser": "7.26.0", - "@babel/types": "7.26.0", - "@storybook/csf-tools": "^8.4.7", "boxen": "5.1.1", "chalk": "^4.1.2", "commander": "^11.1.0", @@ -103,7 +102,6 @@ "minimatch": "^9.0.3", "ora": "^5.4.1", "parse5": "^7.1.2", - "patch-package": "^8.0.0", "prettier": "^2.8.8", "prompts": "^2.4.2", "strip-ansi": "^6.0.0", diff --git a/cli/patches/@types+prompts+2.4.9.patch b/cli/patches/@types+prompts+2.4.9.patch deleted file mode 100644 index 4423db7..0000000 --- a/cli/patches/@types+prompts+2.4.9.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/node_modules/@types/prompts/index.d.ts b/node_modules/@types/prompts/index.d.ts -index e3124b0..f4fac10 100644 ---- a/node_modules/@types/prompts/index.d.ts -+++ b/node_modules/@types/prompts/index.d.ts -@@ -91,6 +91,7 @@ declare namespace prompts { - mask?: string | PrevCaller | undefined; - stdout?: Writable | undefined; - stdin?: Readable | undefined; -+ submitOnEscapeKey?: boolean | undefined; - } - - type Answers = { [id in T]: any }; diff --git a/cli/patches/prompts+2.4.2.patch b/cli/patches/prompts+2.4.2.patch deleted file mode 100644 index c52be00..0000000 --- a/cli/patches/prompts+2.4.2.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/node_modules/prompts/lib/elements/prompt.js b/node_modules/prompts/lib/elements/prompt.js -index b793330..836de28 100644 ---- a/node_modules/prompts/lib/elements/prompt.js -+++ b/node_modules/prompts/lib/elements/prompt.js -@@ -26,6 +26,9 @@ class Prompt extends EventEmitter { - const isSelect = [ 'SelectPrompt', 'MultiselectPrompt' ].indexOf(this.constructor.name) > -1; - const keypress = (str, key) => { - let a = action(key, isSelect); -+ if (key.name === 'escape' && a === 'exit' && opts.submitOnEscapeKey) { -+ a = 'submit' -+ } - if (a === false) { - this._ && this._(str, key); - } else if (typeof this[a] === 'function') { diff --git a/cli/src/commands/connect.ts b/cli/src/commands/connect.ts index 9831a7d..ba6ea3e 100644 --- a/cli/src/commands/connect.ts +++ b/cli/src/commands/connect.ts @@ -87,7 +87,7 @@ export function addConnectCommandToProgram(program: commander.Command) { ) .option('--skip-validation', 'skip validation of Code Connect docs') .option('-l --label