forked from intuit/design-systems-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.ts
113 lines (111 loc) · 2.95 KB
/
command.ts
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import { CliCommand } from '@design-systems/plugin';
const command: CliCommand = {
name: 'size',
description:
'Determine how the bundle size will be affected by your changes.',
examples: [
{
example: 'ds size',
desc:
'Determine the size changes for changed component or a single component'
},
{
example: 'ds size --css --diff',
desc:
'Show the size differences of both the CSS + JS and open a diff of the changes.'
},
{
example: 'ds size --ignore @foo/bar @foo/baz',
desc: 'Ignore the sizes of packages @foo/bar and @foo/baz'
},
{
example: 'ds size --merge-base prerelease',
desc: 'Show the size changes between current HEAD and prerelease branch'
}
],
options: [
{
name: 'analyze',
type: Boolean,
description: "Open 'webpack-bundle-analyzer' for each bundle"
},
{
name: 'css',
type: Boolean,
description: 'Show separate diffs for the JS and CSS',
config: true
},
{
name: 'detailed',
type: Boolean,
description: 'Show the cost of each of a package exports'
},
{
name: 'persist',
type: Boolean,
description: 'Move bundles to CWD with stats.json.'
},
{
name: 'diff',
type: Boolean,
description:
'Run a diff of the resulting directories and open it in a browser. Output will be persisted. Only run on single package'
},
{
name: 'ci',
type: Boolean,
description: 'Only output the result as markdown.'
},
{
name: 'all',
type: Boolean,
description: 'Ignore git changes and calculate sizes for all packages'
},
{
name: 'ignore',
alias: 'i',
type: String,
multiple: true,
description: 'Package names to ignore',
config: true
},
{
name: 'registry',
type: String,
description: 'The registry to install packages from. The plugin will use a local .npmrc file if available for authentication.',
config: true
},
{
name: 'comment',
type: Boolean,
description:
'Comment on the Pull request with the results. (Only from CI + must set env var GH_TOKEN. In jenkins OWNER and REPO must also be set. In enterprise you must also set GITHUB_URL)',
config: true
},
{
name: 'failureThreshold',
type: Number,
description: 'Failure Threshold for Size',
config: true
},
{
name: 'sizeLimit',
type: Number,
description: 'Size limit failure threshold',
config: true,
scope: 'Local'
},
{
name: 'merge-base',
type: String,
description: 'Run the plugin against merge base. (Will be slower due to additional build process)'
},
{
name: 'build-command',
type: String,
description: 'Build command for --merge-base (defaults to "yarn build")',
defaultValue: 'yarn build'
}
]
};
export default command;