@figma-export/cli
Advanced tools
Comparing version 3.1.0 to 3.2.0-alpha.0
@@ -49,7 +49,7 @@ "use strict"; | ||
log: (message) => { spinner.text = message; }, | ||
}).then(() => { | ||
}).finally(() => { | ||
spinner.stop(); | ||
}).catch((err) => { | ||
spinner.stop(); | ||
this.error(err, { exit: 1 }); | ||
}).catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
}); | ||
@@ -56,0 +56,0 @@ }); |
@@ -47,7 +47,7 @@ "use strict"; | ||
log: (message) => { spinner.text = message; }, | ||
}).then(() => { | ||
}).finally(() => { | ||
spinner.stop(); | ||
}).catch((err) => { | ||
spinner.stop(); | ||
this.error(err, { exit: 1 }); | ||
}).catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.log(error); | ||
}); | ||
@@ -54,0 +54,0 @@ }); |
@@ -45,11 +45,4 @@ "use strict"; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const handlePromise = (figmaExporter, options) => { | ||
return figmaExporter(Object.assign(Object.assign({ token: process.env.FIGMA_TOKEN || '', fileId: '' }, options), { log: (message) => { spinner.text = message; } })).then(() => { | ||
spinner.stop(); | ||
}).catch((err) => { | ||
spinner.stop(); | ||
this.error(err, { exit: 1 }); | ||
}); | ||
}; | ||
Promise.all(commands.map((command) => { | ||
const runExport = (figmaExporter, options) => figmaExporter(Object.assign(Object.assign({ token: process.env.FIGMA_TOKEN || '', fileId: '' }, options), { log: (message) => { spinner.text = message; } })); | ||
const commandPromises = commands.map((command) => { | ||
const [commandName, options] = command; | ||
@@ -59,9 +52,17 @@ spinner.start(); | ||
case 'components': | ||
return handlePromise(figmaExport.components, options); | ||
return () => runExport(figmaExport.components, options); | ||
case 'styles': | ||
return handlePromise(figmaExport.styles, options); | ||
return () => runExport(figmaExport.styles, options); | ||
default: | ||
throw new Error(`Command ${commandName} is not found.`); | ||
} | ||
})); | ||
}); | ||
commandPromises.reduce((actualPromise, nextPromise) => { | ||
return actualPromise.then(nextPromise); | ||
}, Promise.resolve()).finally(() => { | ||
spinner.stop(); | ||
}).catch((error) => { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
}); | ||
}); | ||
@@ -68,0 +69,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"version":"3.1.0","commands":{"components":{"id":"components","description":"export components from a Figma file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{"page":{"name":"page","type":"option","char":"p","description":"Figma page names (defaults to 'all pages')"},"output":{"name":"output","type":"option","char":"o","description":"Output directory","default":"output"},"outputter":{"name":"outputter","type":"option","char":"O","description":"Outputter module or path"},"transformer":{"name":"transformer","type":"option","char":"T","description":"Transformer module or path"}},"args":[{"name":"fileId","required":true}]},"styles":{"id":"styles","description":"export styles from a Figma file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"Output directory","default":"output"},"outputter":{"name":"outputter","type":"option","char":"O","description":"Outputter module or path"}},"args":[{"name":"fileId","required":true}]},"use-config":{"id":"use-config","description":"export using a configuration file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"config","required":true,"default":".figmaexportrc.js"}]}}} | ||
{"version":"3.2.0-alpha.0","commands":{"components":{"id":"components","description":"export components from a Figma file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{"page":{"name":"page","type":"option","char":"p","description":"Figma page names (defaults to 'all pages')"},"output":{"name":"output","type":"option","char":"o","description":"Output directory","default":"output"},"outputter":{"name":"outputter","type":"option","char":"O","description":"Outputter module or path"},"transformer":{"name":"transformer","type":"option","char":"T","description":"Transformer module or path"}},"args":[{"name":"fileId","required":true}]},"styles":{"id":"styles","description":"export styles from a Figma file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"Output directory","default":"output"},"outputter":{"name":"outputter","type":"option","char":"O","description":"Outputter module or path"}},"args":[{"name":"fileId","required":true}]},"use-config":{"id":"use-config","description":"export using a configuration file\n","pluginName":"@figma-export/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"config","required":true,"default":".figmaexportrc.js"}]}}} |
{ | ||
"name": "@figma-export/cli", | ||
"description": "Command line for @figma-export", | ||
"version": "3.1.0", | ||
"version": "3.2.0-alpha.0", | ||
"main": "dist/index.js", | ||
@@ -13,3 +13,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@figma-export/core": "^3.1.0", | ||
"@figma-export/core": "^3.2.0-alpha.0", | ||
"@figma-export/types": "^3.0.0", | ||
@@ -66,3 +66,3 @@ "@oclif/command": "~1.8.0", | ||
}, | ||
"gitHead": "bea70bc2e3ce3150be8ebdec7d9944ca74212054" | ||
"gitHead": "2a97810d7ad75bb566e8265c085838b42f7dd3d2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27417
273
1