@dannote/figma-use 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/README.md +8 -1
- package/SKILL.md +8 -1
- package/dist/cli/index.js +171 -62
- package/package.json +1 -1
- package/packages/plugin/dist/main.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,14 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [0.5.
|
|
10
|
+
## [0.5.7] - 2026-01-18
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Font family and style now shown in `node tree` output
|
|
15
|
+
|
|
16
|
+
## [0.5.6] - 2026-01-18
|
|
11
17
|
|
|
12
18
|
### Added
|
|
13
19
|
|
|
14
20
|
- `comment list|add|delete` — manage file comments
|
|
15
|
-
- `version list` — view file version history
|
|
21
|
+
- `version list` — view file version history
|
|
16
22
|
- `file info` — get file key and name
|
|
17
23
|
- `me` — get current user info
|
|
24
|
+
- `font list` — list available fonts with optional family filter
|
|
25
|
+
- `plugin list` — list installed development plugins
|
|
26
|
+
- `plugin` is now a subcommand group: `plugin install|uninstall|list|path`
|
|
18
27
|
|
|
19
28
|
## [0.5.4] - 2026-01-18
|
|
20
29
|
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ The `render` command takes this JSX and creates real Figma nodes — frames, tex
|
|
|
49
49
|
```bash
|
|
50
50
|
bun install -g @dannote/figma-use
|
|
51
51
|
|
|
52
|
-
figma-use plugin
|
|
52
|
+
figma-use plugin install # Install plugin (quit Figma first)
|
|
53
53
|
figma-use proxy # Start proxy server
|
|
54
54
|
```
|
|
55
55
|
|
|
@@ -260,6 +260,13 @@ figma-use style list
|
|
|
260
260
|
figma-use style create-paint "Brand/Primary" --color "#E11D48"
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
+
### Fonts
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
figma-use font list # All available fonts
|
|
267
|
+
figma-use font list --family Roboto # Filter by family name
|
|
268
|
+
```
|
|
269
|
+
|
|
263
270
|
### Comments & History
|
|
264
271
|
|
|
265
272
|
```bash
|
package/SKILL.md
CHANGED
|
@@ -29,7 +29,7 @@ figma --remote-debugging-port=9222
|
|
|
29
29
|
If plugin not installed:
|
|
30
30
|
```bash
|
|
31
31
|
# Quit Figma first, then:
|
|
32
|
-
figma-use plugin
|
|
32
|
+
figma-use plugin install
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
---
|
|
@@ -175,6 +175,13 @@ figma-use style list
|
|
|
175
175
|
figma-use style create-paint "Brand/Primary" --color "#E11D48"
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
+
### Fonts
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
figma-use font list # All available fonts
|
|
182
|
+
figma-use font list --family Roboto # Filter by family name
|
|
183
|
+
```
|
|
184
|
+
|
|
178
185
|
### Comments & History
|
|
179
186
|
|
|
180
187
|
Requires Figma running with `--remote-debugging-port=9222`:
|
package/dist/cli/index.js
CHANGED
|
@@ -977,8 +977,9 @@ function formatNode(node, indent = "") {
|
|
|
977
977
|
details.push(`radius: ${node.cornerRadius}px`);
|
|
978
978
|
}
|
|
979
979
|
if (node.fontSize) {
|
|
980
|
-
const
|
|
981
|
-
|
|
980
|
+
const family = node.fontFamily || "";
|
|
981
|
+
const style = node.fontStyle || "";
|
|
982
|
+
details.push(`font: ${node.fontSize}px ${family} ${style}`.trim());
|
|
982
983
|
}
|
|
983
984
|
if (node.characters && !name) {
|
|
984
985
|
details.push(`text: "${node.characters}"`);
|
|
@@ -22791,6 +22792,7 @@ __export(exports_commands, {
|
|
|
22791
22792
|
import: () => import_default,
|
|
22792
22793
|
group: () => group_default,
|
|
22793
22794
|
get: () => get_default2,
|
|
22795
|
+
font: () => font_default2,
|
|
22794
22796
|
find: () => find_default,
|
|
22795
22797
|
file: () => file_default,
|
|
22796
22798
|
export: () => export_default,
|
|
@@ -22923,10 +22925,9 @@ var proxy_default = defineCommand({
|
|
|
22923
22925
|
child.on("exit", (code) => process.exit(code || 0));
|
|
22924
22926
|
}
|
|
22925
22927
|
});
|
|
22926
|
-
// packages/cli/src/commands/plugin.ts
|
|
22927
|
-
import { resolve as resolve2, dirname as dirname2, join } from "path";
|
|
22928
|
+
// packages/cli/src/commands/plugin/install.ts
|
|
22929
|
+
import { resolve as resolve2, dirname as dirname2, join as join2 } from "path";
|
|
22928
22930
|
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
22929
|
-
import { execSync } from "child_process";
|
|
22930
22931
|
|
|
22931
22932
|
// packages/cli/node_modules/consola/dist/core.mjs
|
|
22932
22933
|
var LogLevels2 = {
|
|
@@ -23901,21 +23902,9 @@ function _getDefaultLogLevel2() {
|
|
|
23901
23902
|
}
|
|
23902
23903
|
var consola2 = createConsola4();
|
|
23903
23904
|
|
|
23904
|
-
// packages/cli/src/commands/plugin.ts
|
|
23905
|
-
|
|
23906
|
-
|
|
23907
|
-
let dir = dirname2(currentFile);
|
|
23908
|
-
for (let i3 = 0;i3 < 10; i3++) {
|
|
23909
|
-
try {
|
|
23910
|
-
const pkg = __require(resolve2(dir, "package.json"));
|
|
23911
|
-
if (pkg.name === "@dannote/figma-use") {
|
|
23912
|
-
return dir;
|
|
23913
|
-
}
|
|
23914
|
-
} catch {}
|
|
23915
|
-
dir = dirname2(dir);
|
|
23916
|
-
}
|
|
23917
|
-
return dirname2(dirname2(dirname2(currentFile)));
|
|
23918
|
-
}
|
|
23905
|
+
// packages/cli/src/commands/plugin/utils.ts
|
|
23906
|
+
import { join } from "path";
|
|
23907
|
+
import { execSync } from "child_process";
|
|
23919
23908
|
function getFigmaSettingsPath() {
|
|
23920
23909
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
23921
23910
|
if (process.platform === "darwin") {
|
|
@@ -23943,12 +23932,28 @@ function isFigmaRunning() {
|
|
|
23943
23932
|
return false;
|
|
23944
23933
|
}
|
|
23945
23934
|
}
|
|
23935
|
+
|
|
23936
|
+
// packages/cli/src/commands/plugin/install.ts
|
|
23937
|
+
function getPackageRoot2() {
|
|
23938
|
+
const currentFile = import.meta.path || import.meta.url.replace("file://", "");
|
|
23939
|
+
let dir = dirname2(currentFile);
|
|
23940
|
+
for (let i3 = 0;i3 < 10; i3++) {
|
|
23941
|
+
try {
|
|
23942
|
+
const pkg = __require(resolve2(dir, "package.json"));
|
|
23943
|
+
if (pkg.name === "@dannote/figma-use") {
|
|
23944
|
+
return dir;
|
|
23945
|
+
}
|
|
23946
|
+
} catch {}
|
|
23947
|
+
dir = dirname2(dir);
|
|
23948
|
+
}
|
|
23949
|
+
return dirname2(dirname2(dirname2(currentFile)));
|
|
23950
|
+
}
|
|
23946
23951
|
function getNextId(extensions) {
|
|
23947
23952
|
if (!extensions || extensions.length === 0)
|
|
23948
23953
|
return 1;
|
|
23949
23954
|
return Math.max(...extensions.map((e3) => e3.id)) + 1;
|
|
23950
23955
|
}
|
|
23951
|
-
function installPlugin(manifestPath) {
|
|
23956
|
+
function installPlugin(manifestPath, force = false) {
|
|
23952
23957
|
const settingsPath = getFigmaSettingsPath();
|
|
23953
23958
|
if (!settingsPath || !existsSync(settingsPath)) {
|
|
23954
23959
|
return {
|
|
@@ -23956,10 +23961,10 @@ function installPlugin(manifestPath) {
|
|
|
23956
23961
|
message: "Figma settings not found. Please install Figma Desktop first."
|
|
23957
23962
|
};
|
|
23958
23963
|
}
|
|
23959
|
-
if (isFigmaRunning()) {
|
|
23964
|
+
if (!force && isFigmaRunning()) {
|
|
23960
23965
|
return {
|
|
23961
23966
|
success: false,
|
|
23962
|
-
message: "Figma is running.
|
|
23967
|
+
message: "Figma is running. Quit Figma first or use --force"
|
|
23963
23968
|
};
|
|
23964
23969
|
}
|
|
23965
23970
|
try {
|
|
@@ -23975,9 +23980,9 @@ function installPlugin(manifestPath) {
|
|
|
23975
23980
|
for (const ext of extensions) {
|
|
23976
23981
|
if (ext.fileMetadata?.manifestFileId === existing.id) {
|
|
23977
23982
|
if (ext.fileMetadata.type === "code") {
|
|
23978
|
-
ext.manifestPath =
|
|
23983
|
+
ext.manifestPath = join2(pluginDir2, manifest.main || "main.js");
|
|
23979
23984
|
} else if (ext.fileMetadata.type === "ui") {
|
|
23980
|
-
ext.manifestPath =
|
|
23985
|
+
ext.manifestPath = join2(pluginDir2, manifest.ui || "ui.html");
|
|
23981
23986
|
}
|
|
23982
23987
|
}
|
|
23983
23988
|
}
|
|
@@ -24005,7 +24010,7 @@ function installPlugin(manifestPath) {
|
|
|
24005
24010
|
});
|
|
24006
24011
|
extensions.push({
|
|
24007
24012
|
id: codeId,
|
|
24008
|
-
manifestPath:
|
|
24013
|
+
manifestPath: join2(pluginDir, manifest.main || "main.js"),
|
|
24009
24014
|
fileMetadata: {
|
|
24010
24015
|
type: "code",
|
|
24011
24016
|
manifestFileId: manifestId
|
|
@@ -24013,7 +24018,7 @@ function installPlugin(manifestPath) {
|
|
|
24013
24018
|
});
|
|
24014
24019
|
extensions.push({
|
|
24015
24020
|
id: uiId,
|
|
24016
|
-
manifestPath:
|
|
24021
|
+
manifestPath: join2(pluginDir, manifest.ui || "ui.html"),
|
|
24017
24022
|
fileMetadata: {
|
|
24018
24023
|
type: "ui",
|
|
24019
24024
|
manifestFileId: manifestId
|
|
@@ -24029,15 +24034,15 @@ function installPlugin(manifestPath) {
|
|
|
24029
24034
|
};
|
|
24030
24035
|
}
|
|
24031
24036
|
}
|
|
24032
|
-
function uninstallPlugin(manifestPath) {
|
|
24037
|
+
function uninstallPlugin(manifestPath, force = false) {
|
|
24033
24038
|
const settingsPath = getFigmaSettingsPath();
|
|
24034
24039
|
if (!settingsPath || !existsSync(settingsPath)) {
|
|
24035
24040
|
return { success: false, message: "Figma settings not found" };
|
|
24036
24041
|
}
|
|
24037
|
-
if (isFigmaRunning()) {
|
|
24042
|
+
if (!force && isFigmaRunning()) {
|
|
24038
24043
|
return {
|
|
24039
24044
|
success: false,
|
|
24040
|
-
message: "Figma is running.
|
|
24045
|
+
message: "Figma is running. Quit Figma first or use --force"
|
|
24041
24046
|
};
|
|
24042
24047
|
}
|
|
24043
24048
|
try {
|
|
@@ -24060,7 +24065,7 @@ function uninstallPlugin(manifestPath) {
|
|
|
24060
24065
|
};
|
|
24061
24066
|
}
|
|
24062
24067
|
}
|
|
24063
|
-
var
|
|
24068
|
+
var install_default = defineCommand({
|
|
24064
24069
|
meta: { description: "Install/uninstall Figma plugin" },
|
|
24065
24070
|
args: {
|
|
24066
24071
|
uninstall: { type: "boolean", description: "Uninstall the plugin" },
|
|
@@ -24075,7 +24080,7 @@ var plugin_default = defineCommand({
|
|
|
24075
24080
|
return;
|
|
24076
24081
|
}
|
|
24077
24082
|
if (args.uninstall) {
|
|
24078
|
-
const result2 = uninstallPlugin(pluginPath);
|
|
24083
|
+
const result2 = uninstallPlugin(pluginPath, args.force);
|
|
24079
24084
|
if (result2.success) {
|
|
24080
24085
|
consola2.success(result2.message);
|
|
24081
24086
|
} else {
|
|
@@ -24083,13 +24088,7 @@ var plugin_default = defineCommand({
|
|
|
24083
24088
|
}
|
|
24084
24089
|
return;
|
|
24085
24090
|
}
|
|
24086
|
-
|
|
24087
|
-
consola2.error("Figma is running");
|
|
24088
|
-
consola2.info("Please quit Figma, then run: figma-use plugin");
|
|
24089
|
-
consola2.info("Or use --force to install anyway (changes will apply on restart)");
|
|
24090
|
-
return;
|
|
24091
|
-
}
|
|
24092
|
-
const result = installPlugin(pluginPath);
|
|
24091
|
+
const result = installPlugin(pluginPath, args.force);
|
|
24093
24092
|
if (result.success) {
|
|
24094
24093
|
consola2.success(result.message);
|
|
24095
24094
|
if (result.message !== "Plugin already installed") {
|
|
@@ -24111,6 +24110,72 @@ var plugin_default = defineCommand({
|
|
|
24111
24110
|
}
|
|
24112
24111
|
}
|
|
24113
24112
|
});
|
|
24113
|
+
|
|
24114
|
+
// packages/cli/src/commands/plugin/list.ts
|
|
24115
|
+
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
24116
|
+
init_format();
|
|
24117
|
+
var list_default = defineCommand({
|
|
24118
|
+
meta: { description: "List installed development plugins" },
|
|
24119
|
+
args: {
|
|
24120
|
+
json: { type: "boolean", description: "Output as JSON" }
|
|
24121
|
+
},
|
|
24122
|
+
async run({ args }) {
|
|
24123
|
+
try {
|
|
24124
|
+
const settingsPath = getFigmaSettingsPath();
|
|
24125
|
+
if (!settingsPath || !existsSync2(settingsPath)) {
|
|
24126
|
+
console.log("No Figma settings found");
|
|
24127
|
+
return;
|
|
24128
|
+
}
|
|
24129
|
+
const settings = JSON.parse(readFileSync2(settingsPath, "utf-8"));
|
|
24130
|
+
const extensions = settings.localFileExtensions || [];
|
|
24131
|
+
const plugins = extensions.filter((e3) => e3.fileMetadata?.type === "manifest").map((e3) => ({
|
|
24132
|
+
id: e3.lastKnownPluginId || "unknown",
|
|
24133
|
+
name: e3.lastKnownName || "Unnamed",
|
|
24134
|
+
path: e3.manifestPath
|
|
24135
|
+
}));
|
|
24136
|
+
if (args.json) {
|
|
24137
|
+
console.log(JSON.stringify(plugins, null, 2));
|
|
24138
|
+
return;
|
|
24139
|
+
}
|
|
24140
|
+
if (plugins.length === 0) {
|
|
24141
|
+
console.log("No development plugins installed");
|
|
24142
|
+
return;
|
|
24143
|
+
}
|
|
24144
|
+
for (const p of plugins) {
|
|
24145
|
+
console.log(`${accent(p.name)} ${dim(`(${p.id})`)}`);
|
|
24146
|
+
console.log(` ${dim(p.path)}`);
|
|
24147
|
+
}
|
|
24148
|
+
console.log(`
|
|
24149
|
+
${plugins.length} plugin${plugins.length === 1 ? "" : "s"}`);
|
|
24150
|
+
} catch (e3) {
|
|
24151
|
+
handleError(e3);
|
|
24152
|
+
}
|
|
24153
|
+
}
|
|
24154
|
+
});
|
|
24155
|
+
|
|
24156
|
+
// packages/cli/src/commands/plugin/index.ts
|
|
24157
|
+
var plugin_default = defineCommand({
|
|
24158
|
+
meta: { description: "Manage Figma plugins" },
|
|
24159
|
+
subCommands: {
|
|
24160
|
+
install: install_default,
|
|
24161
|
+
list: list_default,
|
|
24162
|
+
uninstall: defineCommand({
|
|
24163
|
+
meta: { description: "Uninstall the Figma Use plugin" },
|
|
24164
|
+
args: {
|
|
24165
|
+
force: { type: "boolean", description: "Force uninstall even if Figma is running" }
|
|
24166
|
+
},
|
|
24167
|
+
async run({ args }) {
|
|
24168
|
+
await install_default.run?.({ args: { uninstall: true, path: false, force: args.force } });
|
|
24169
|
+
}
|
|
24170
|
+
}),
|
|
24171
|
+
path: defineCommand({
|
|
24172
|
+
meta: { description: "Show plugin manifest path" },
|
|
24173
|
+
async run() {
|
|
24174
|
+
await install_default.run?.({ args: { path: true, uninstall: false, force: false } });
|
|
24175
|
+
}
|
|
24176
|
+
})
|
|
24177
|
+
}
|
|
24178
|
+
});
|
|
24114
24179
|
// packages/cli/src/commands/profile.ts
|
|
24115
24180
|
init_format();
|
|
24116
24181
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -24256,9 +24321,9 @@ var profile_default = defineCommand({
|
|
|
24256
24321
|
init_format();
|
|
24257
24322
|
var React3 = __toESM(require_react(), 1);
|
|
24258
24323
|
import { resolve as resolve3 } from "path";
|
|
24259
|
-
import { existsSync as
|
|
24324
|
+
import { existsSync as existsSync3, writeFileSync as writeFileSync2, unlinkSync } from "fs";
|
|
24260
24325
|
import { tmpdir } from "os";
|
|
24261
|
-
import { join as
|
|
24326
|
+
import { join as join3 } from "path";
|
|
24262
24327
|
|
|
24263
24328
|
// packages/cli/src/render/reconciler.ts
|
|
24264
24329
|
var import_react_reconciler = __toESM(require_react_reconciler(), 1);
|
|
@@ -28345,7 +28410,7 @@ async function readStdin() {
|
|
|
28345
28410
|
function findNodeModulesDir() {
|
|
28346
28411
|
let dir = import.meta.dir;
|
|
28347
28412
|
for (let i3 = 0;i3 < 10; i3++) {
|
|
28348
|
-
if (
|
|
28413
|
+
if (existsSync3(join3(dir, "node_modules", "react"))) {
|
|
28349
28414
|
return dir;
|
|
28350
28415
|
}
|
|
28351
28416
|
const parent = resolve3(dir, "..");
|
|
@@ -28468,12 +28533,12 @@ var render_default = defineCommand({
|
|
|
28468
28533
|
}
|
|
28469
28534
|
code = transformJsxSnippet(code);
|
|
28470
28535
|
const baseDir = findNodeModulesDir() || tmpdir();
|
|
28471
|
-
tempFile =
|
|
28536
|
+
tempFile = join3(baseDir, `.figma-render-${Date.now()}.js`);
|
|
28472
28537
|
writeFileSync2(tempFile, code);
|
|
28473
28538
|
filePath = tempFile;
|
|
28474
28539
|
} else if (args.file) {
|
|
28475
28540
|
filePath = resolve3(args.file);
|
|
28476
|
-
if (!
|
|
28541
|
+
if (!existsSync3(filePath)) {
|
|
28477
28542
|
console.error(fail(`File not found: ${filePath}`));
|
|
28478
28543
|
process.exit(1);
|
|
28479
28544
|
}
|
|
@@ -28556,7 +28621,7 @@ var render_default = defineCommand({
|
|
|
28556
28621
|
} catch (e6) {
|
|
28557
28622
|
handleError(e6);
|
|
28558
28623
|
} finally {
|
|
28559
|
-
if (tempFile &&
|
|
28624
|
+
if (tempFile && existsSync3(tempFile)) {
|
|
28560
28625
|
unlinkSync(tempFile);
|
|
28561
28626
|
}
|
|
28562
28627
|
}
|
|
@@ -29956,7 +30021,7 @@ var blend_default = defineCommand({
|
|
|
29956
30021
|
});
|
|
29957
30022
|
|
|
29958
30023
|
// packages/cli/src/commands/set/image.ts
|
|
29959
|
-
import { readFileSync as
|
|
30024
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
29960
30025
|
var image_default = defineCommand({
|
|
29961
30026
|
meta: { description: "Set image fill from file" },
|
|
29962
30027
|
args: {
|
|
@@ -29967,7 +30032,7 @@ var image_default = defineCommand({
|
|
|
29967
30032
|
},
|
|
29968
30033
|
async run({ args }) {
|
|
29969
30034
|
try {
|
|
29970
|
-
const buffer =
|
|
30035
|
+
const buffer = readFileSync3(args.file);
|
|
29971
30036
|
const base64 = buffer.toString("base64");
|
|
29972
30037
|
const result = await sendCommand("set-image-fill", {
|
|
29973
30038
|
id: args.id,
|
|
@@ -30354,7 +30419,7 @@ var export_default = defineCommand({
|
|
|
30354
30419
|
}
|
|
30355
30420
|
});
|
|
30356
30421
|
// packages/cli/src/commands/page/list.ts
|
|
30357
|
-
var
|
|
30422
|
+
var list_default2 = defineCommand({
|
|
30358
30423
|
meta: { description: "List all pages" },
|
|
30359
30424
|
args: {
|
|
30360
30425
|
json: { type: "boolean", description: "Output as JSON" }
|
|
@@ -30390,7 +30455,7 @@ var set_default3 = defineCommand({
|
|
|
30390
30455
|
var page_default2 = defineCommand({
|
|
30391
30456
|
meta: { description: "Page operations" },
|
|
30392
30457
|
subCommands: {
|
|
30393
|
-
list:
|
|
30458
|
+
list: list_default2,
|
|
30394
30459
|
set: set_default3
|
|
30395
30460
|
}
|
|
30396
30461
|
});
|
|
@@ -30461,7 +30526,7 @@ var viewport_default = defineCommand({
|
|
|
30461
30526
|
}
|
|
30462
30527
|
});
|
|
30463
30528
|
// packages/cli/src/commands/variable/list.ts
|
|
30464
|
-
var
|
|
30529
|
+
var list_default3 = defineCommand({
|
|
30465
30530
|
meta: { description: "List all variables" },
|
|
30466
30531
|
args: {
|
|
30467
30532
|
type: { type: "string", description: "Filter by type: COLOR, FLOAT, STRING, BOOLEAN" },
|
|
@@ -30586,7 +30651,7 @@ var bind_default = defineCommand({
|
|
|
30586
30651
|
var variable_default = defineCommand({
|
|
30587
30652
|
meta: { description: "Variable operations" },
|
|
30588
30653
|
subCommands: {
|
|
30589
|
-
list:
|
|
30654
|
+
list: list_default3,
|
|
30590
30655
|
get: get_default5,
|
|
30591
30656
|
create: create_default2,
|
|
30592
30657
|
set: set_default5,
|
|
@@ -30595,7 +30660,7 @@ var variable_default = defineCommand({
|
|
|
30595
30660
|
}
|
|
30596
30661
|
});
|
|
30597
30662
|
// packages/cli/src/commands/collection/list.ts
|
|
30598
|
-
var
|
|
30663
|
+
var list_default4 = defineCommand({
|
|
30599
30664
|
meta: { description: "List variable collections" },
|
|
30600
30665
|
args: {
|
|
30601
30666
|
json: { type: "boolean", description: "Output as JSON" }
|
|
@@ -30665,14 +30730,14 @@ var delete_default3 = defineCommand({
|
|
|
30665
30730
|
var collection_default = defineCommand({
|
|
30666
30731
|
meta: { description: "Variable collection operations" },
|
|
30667
30732
|
subCommands: {
|
|
30668
|
-
list:
|
|
30733
|
+
list: list_default4,
|
|
30669
30734
|
get: get_default6,
|
|
30670
30735
|
create: create_default3,
|
|
30671
30736
|
delete: delete_default3
|
|
30672
30737
|
}
|
|
30673
30738
|
});
|
|
30674
30739
|
// packages/cli/src/commands/style/list.ts
|
|
30675
|
-
var
|
|
30740
|
+
var list_default5 = defineCommand({
|
|
30676
30741
|
meta: { description: "List local styles" },
|
|
30677
30742
|
args: {
|
|
30678
30743
|
json: { type: "boolean", description: "Output as JSON" }
|
|
@@ -30763,7 +30828,7 @@ var create_effect_default = defineCommand({
|
|
|
30763
30828
|
var style_default = defineCommand({
|
|
30764
30829
|
meta: { description: "Style operations" },
|
|
30765
30830
|
subCommands: {
|
|
30766
|
-
list:
|
|
30831
|
+
list: list_default5,
|
|
30767
30832
|
"create-paint": create_paint_default,
|
|
30768
30833
|
"create-text": create_text_default,
|
|
30769
30834
|
"create-effect": create_effect_default
|
|
@@ -31008,7 +31073,7 @@ function formatComment(c7) {
|
|
|
31008
31073
|
${c7.message}
|
|
31009
31074
|
${dim(`id: ${c7.id}`)}`;
|
|
31010
31075
|
}
|
|
31011
|
-
var
|
|
31076
|
+
var list_default6 = defineCommand({
|
|
31012
31077
|
meta: { description: "List comments on the current file" },
|
|
31013
31078
|
args: {
|
|
31014
31079
|
file: { type: "string", description: "File key (default: current file)" },
|
|
@@ -31091,16 +31156,16 @@ var delete_default4 = defineCommand({
|
|
|
31091
31156
|
|
|
31092
31157
|
// packages/cli/src/commands/comment/index.ts
|
|
31093
31158
|
var comment_default = defineCommand({
|
|
31094
|
-
meta: { description: "Manage file comments
|
|
31159
|
+
meta: { description: "Manage file comments " },
|
|
31095
31160
|
subCommands: {
|
|
31096
|
-
list:
|
|
31161
|
+
list: list_default6,
|
|
31097
31162
|
add: add_default,
|
|
31098
31163
|
delete: delete_default4
|
|
31099
31164
|
}
|
|
31100
31165
|
});
|
|
31101
31166
|
// packages/cli/src/commands/version/list.ts
|
|
31102
31167
|
init_format();
|
|
31103
|
-
var
|
|
31168
|
+
var list_default7 = defineCommand({
|
|
31104
31169
|
meta: { description: "List file version history" },
|
|
31105
31170
|
args: {
|
|
31106
31171
|
file: { type: "string", description: "File key (default: current file)" },
|
|
@@ -31135,9 +31200,9 @@ var list_default6 = defineCommand({
|
|
|
31135
31200
|
|
|
31136
31201
|
// packages/cli/src/commands/version/index.ts
|
|
31137
31202
|
var version_default = defineCommand({
|
|
31138
|
-
meta: { description: "View file version history
|
|
31203
|
+
meta: { description: "View file version history" },
|
|
31139
31204
|
subCommands: {
|
|
31140
|
-
list:
|
|
31205
|
+
list: list_default7
|
|
31141
31206
|
}
|
|
31142
31207
|
});
|
|
31143
31208
|
// packages/cli/src/commands/file/info.ts
|
|
@@ -31164,11 +31229,55 @@ var info_default = defineCommand({
|
|
|
31164
31229
|
|
|
31165
31230
|
// packages/cli/src/commands/file/index.ts
|
|
31166
31231
|
var file_default = defineCommand({
|
|
31167
|
-
meta: { description: "File operations
|
|
31232
|
+
meta: { description: "File operations " },
|
|
31168
31233
|
subCommands: {
|
|
31169
31234
|
info: info_default
|
|
31170
31235
|
}
|
|
31171
31236
|
});
|
|
31237
|
+
// packages/cli/src/commands/font/list.ts
|
|
31238
|
+
init_format();
|
|
31239
|
+
var list_default8 = defineCommand({
|
|
31240
|
+
meta: { description: "List available fonts" },
|
|
31241
|
+
args: {
|
|
31242
|
+
family: { type: "string", description: "Filter by family name" },
|
|
31243
|
+
json: { type: "boolean", description: "Output as JSON" }
|
|
31244
|
+
},
|
|
31245
|
+
async run({ args }) {
|
|
31246
|
+
try {
|
|
31247
|
+
const fonts = await sendCommand("list-fonts");
|
|
31248
|
+
let filtered = fonts;
|
|
31249
|
+
if (args.family) {
|
|
31250
|
+
const search = args.family.toLowerCase();
|
|
31251
|
+
filtered = fonts.filter((f7) => f7.family.toLowerCase().includes(search));
|
|
31252
|
+
}
|
|
31253
|
+
if (args.json) {
|
|
31254
|
+
console.log(JSON.stringify(filtered, null, 2));
|
|
31255
|
+
return;
|
|
31256
|
+
}
|
|
31257
|
+
const families = new Map;
|
|
31258
|
+
for (const font of filtered) {
|
|
31259
|
+
const styles = families.get(font.family) || [];
|
|
31260
|
+
styles.push(font.style);
|
|
31261
|
+
families.set(font.family, styles);
|
|
31262
|
+
}
|
|
31263
|
+
for (const [family, styles] of families) {
|
|
31264
|
+
console.log(`${family} ${dim(`(${styles.join(", ")})`)}`);
|
|
31265
|
+
}
|
|
31266
|
+
console.log(`
|
|
31267
|
+
${families.size} families, ${filtered.length} fonts`);
|
|
31268
|
+
} catch (e6) {
|
|
31269
|
+
handleError(e6);
|
|
31270
|
+
}
|
|
31271
|
+
}
|
|
31272
|
+
});
|
|
31273
|
+
|
|
31274
|
+
// packages/cli/src/commands/font/index.ts
|
|
31275
|
+
var font_default2 = defineCommand({
|
|
31276
|
+
meta: { description: "Font operations" },
|
|
31277
|
+
subCommands: {
|
|
31278
|
+
list: list_default8
|
|
31279
|
+
}
|
|
31280
|
+
});
|
|
31172
31281
|
// packages/cli/src/index.ts
|
|
31173
31282
|
var main = defineCommand({
|
|
31174
31283
|
meta: {
|
package/package.json
CHANGED
|
@@ -272,6 +272,10 @@
|
|
|
272
272
|
}
|
|
273
273
|
case "get-current-page":
|
|
274
274
|
return { id: figma.currentPage.id, name: figma.currentPage.name };
|
|
275
|
+
case "list-fonts": {
|
|
276
|
+
const fonts = yield figma.listAvailableFontsAsync();
|
|
277
|
+
return fonts.map((f) => ({ family: f.fontName.family, style: f.fontName.style }));
|
|
278
|
+
}
|
|
275
279
|
case "get-node-tree": {
|
|
276
280
|
const { id } = args;
|
|
277
281
|
const node = yield figma.getNodeByIdAsync(id);
|
|
@@ -1434,6 +1438,10 @@
|
|
|
1434
1438
|
const textNode = node;
|
|
1435
1439
|
base.characters = textNode.characters;
|
|
1436
1440
|
if (typeof textNode.fontSize === "number") base.fontSize = textNode.fontSize;
|
|
1441
|
+
if (typeof textNode.fontName === "object") {
|
|
1442
|
+
base.fontFamily = textNode.fontName.family;
|
|
1443
|
+
base.fontStyle = textNode.fontName.style;
|
|
1444
|
+
}
|
|
1437
1445
|
}
|
|
1438
1446
|
if ("children" in node) {
|
|
1439
1447
|
base.childCount = node.children.length;
|