Skip to content
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

V1 implementation #2

Merged
merged 3 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
# 🚧 Figma Select and Inspect
# Figma Select and Inspect

More info soon

<!-- ![Plugin's logo reporting "From Figma prototypes to XState’s machine config"](./assets/hero.jpg "Select and Inspect") -->

<!-- ## Why?
![Plugin's logo reporting a screenshot of the Console](./assets/Plugin%20logo.png "Select and Inspect")

TODO:

![A screenshot of the plugin running in Figma](./assets/Figma%20Community%20screenshot.jpg "Select and Inspect")



## Why?

If you ever implemented a Figma plugin, you know how slow the process of inspecting specific properties (among the hundreds available) and values in a Figma file is.

This plugin aims to solve this problem by making logging as easy as possible!

## Features

1. Select one or more Figma elements to get them logged in the Console
2. Add expressions to be evaluated on the selected Figma elements (`name,id,reactions[0].actions` results in each expression to be evaluated and logged in the Console)
3. Stringy and format the result for better readability
4. Preferences are stored locally

## FAQ

TODO: -->
*Why not using [the existing "Inspector" plugin](https://www.figma.com/community/plugin/760351147138040099/inspector?searchSessionId=ltk4azg4-ud0njxlfa8)?*

Because the properties must be added to the UI by the plugin's author, limiting the plugin's scalability (as you can see in the reviews).

<!-- ### Install the plugin

### Install the plugin
TODO: update this guide, for figma to xstate too.

1. In the Figma desktop app, open a Figma document.
2. Search for and run `Import plugin from manifest…` via the Quick Actions search bar.
3. Select the `manifest.json` file that was generated by the `build` script.
3. Select the `manifest.json` file that was generated by the `build` script. -->
Binary file added assets/Figma Community screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Plugin logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/hero.jpg
Binary file not shown.
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import antfu from '@antfu/eslint-config'

export default antfu({ rules: { 'no-console': 0 } })
export default antfu({ rules: { 'no-console': 0 }, extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@figma/figma-plugins/recommended',
] })
16 changes: 1 addition & 15 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
{
"api": "1.0.0",
"editorType": [
"figma"
],
"id": "select-and-inspect",
"name": "Select and Inspect",
"main": "build/main.js",
"ui": "build/ui.js",
"networkAccess": {
"allowedDomains": [
"none"
]
}
}
{ "api": "1.0.0", "editorType": ["figma"], "id": "1348339696557868933", "name": "Select and Inspect", "main": "build/main.js", "ui": "build/ui.js", "networkAccess": { "allowedDomains": ["none"] }, "documentAccess": "dynamic-page" }
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,46 @@
"ci:install": "pnpm install --frozen-lockfile",
"build": "build-figma-plugin --typecheck --minify",
"watch": "build-figma-plugin --typecheck --watch",
"test": "npm run test:unit",
"test": "npm run test:fake",
"test:vitest": "npm run test:unit",
"test:fake": "echo 'no tests yet'",
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test:unit": "vitest"
},
"dependencies": {
"@create-figma-plugin/utilities": "2.6.1",
"code-block-writer": "12.0.0",
"figx": "0.1.3"
"figx": "0.1.3",
"zod": "^3.22.4"
},
"devDependencies": {
"@antfu/eslint-config": "1.1.0",
"@create-figma-plugin/build": "3.0.2",
"@create-figma-plugin/tsconfig": "3.0.2",
"@create-figma-plugin/ui": "3.0.2",
"@figma/plugin-typings": "1.79.0",
"@figma/eslint-plugin-figma-plugins": "^0.14.0",
"@figma/plugin-typings": "*",
"eslint": "^8.55.0",
"preact": "10.18.1",
"simple-git-hooks": "^2.9.0",
"typescript": "5.2.2",
"vitest": "1.0.4"
},
"figma-plugin": {
"documentAccess": "dynamic-page",
"editorType": [
"figma"
],
"id": "select-and-inspect",
"id": "1348339696557868933",
"name": "Select and Inspect",
"ui": "src/ui.tsx",
"main": "src/main.ts",
"networkAccess": { "allowedDomains": ["none"] }
"networkAccess": {
"allowedDomains": [
"none"
]
}
},
"simple-git-hooks": {
"pre-commit": "pnpm typecheck && pnpm lint:fix"
Expand Down
113 changes: 102 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading