This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcli.js
76 lines (69 loc) · 2.23 KB
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const meow = require('meow');
const app = require('./index');
const cli = meow(
`
Usage
$ hubble-cli <input> [options]
Options
--outputDir=<dir>, -o The directory where parsed files will be placed after a run. Defaults to current working directory.
--useStyleDictionaryOutput, -s Generate Style Dictionary compatible output instead of the generic design token format.
--dump, -d Generate a raw JSON dump from your design parser, before Hubble exports its tokens
Options: Sketch
--useColorArtboards Use artboard formatting to export colors instead of using the document colors.
--useGradientArtboards Use artboard formatting to export gradients instead of using the document gradients.
--ignoreTextStylePaths Textstyles that use slashes to enable navigation in Sketch will be ignored
and their id will be the first part of the path.
Options: Figma
--token, -t Authorization token when accessing the Figma API.
--exportAssets, -e Export assets from Figma.
Examples
$ hubble-cli "__mocks/sample_sketchfile.sketch"
$ hubble-cli "__mocks/sample_sketchfile.sketch" -d --useColorArtboards --outputDir="config/"
$ hubble-cli --token "29-206..." HbgJuBVOwIOcoZMVnpG01LqA
$ hubble-cli --token "29-206..." HbgJuBVOwIOcoZMVnpG01LqA --useStyleDictionary
`,
{
flags: {
token: {
type: 'string',
alias: 't',
},
ignoreTextStylePaths: {
type: 'boolean',
default: false,
},
outputDir: {
default: __dirname,
type: 'string',
alias: 'o',
},
dump: {
type: 'boolean',
alias: 'd',
},
useColorArtboards: {
type: 'boolean',
default: false,
},
useGradientArtboards: {
type: 'boolean',
default: false,
},
useStyleDictionaryOutput: {
type: 'boolean',
default: false,
alias: 's',
},
exportAssets: {
type: 'boolean',
default: false,
alias: 'e',
},
version: {
type: 'boolean',
alias: 'v',
},
},
},
);
app(cli.input, cli.flags);