Skip to content

Commit d8a30ed

Browse files
committed
fix: migrate server flags to new format
1 parent fbffad2 commit d8a30ed

File tree

1 file changed

+161
-162
lines changed

1 file changed

+161
-162
lines changed

bin/cli-flags.js

+161-162
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
{
1919
type: 'number',
2020
},
21-
]
21+
],
2222
},
2323
static: {
2424
name: 'static',
@@ -36,187 +36,186 @@ module.exports = {
3636
negative: true,
3737
},
3838
'static-directory': {
39-
name: 'static-directory',
40-
type: String,
41-
configs: [
42-
{
43-
type: 'string',
44-
},
45-
],
46-
description: 'Directory for static contents.',
47-
processor(opts) {
48-
opts.static = opts.static || {};
49-
opts.static.directory = opts.staticDirectory;
50-
delete opts.staticDirectory;
39+
name: 'static-directory',
40+
type: String,
41+
configs: [
42+
{
43+
type: 'string',
5144
},
45+
],
46+
description: 'Directory for static contents.',
47+
processor(opts) {
48+
opts.static = opts.static || {};
49+
opts.static.directory = opts.staticDirectory;
50+
delete opts.staticDirectory;
5251
},
53-
'static-public-path': {
54-
name: 'static-public-path',
55-
type: String,
56-
configs: [
57-
{
58-
type: 'string',
59-
},
60-
],
61-
description:
62-
'The bundled files will be available in the browser under this path.',
63-
multiple: true,
64-
processor(opts) {
65-
opts.static = opts.static || {};
66-
opts.static.publicPath = opts.staticPublicPath;
67-
delete opts.staticPublicPath;
52+
},
53+
'static-public-path': {
54+
name: 'static-public-path',
55+
type: String,
56+
configs: [
57+
{
58+
type: 'string',
6859
},
60+
],
61+
description:
62+
'The bundled files will be available in the browser under this path.',
63+
multiple: true,
64+
processor(opts) {
65+
opts.static = opts.static || {};
66+
opts.static.publicPath = opts.staticPublicPath;
67+
delete opts.staticPublicPath;
6968
},
70-
'static-serve-index': {
71-
name: 'static-serve-index',
72-
type: Boolean,
73-
configs: [
74-
{
75-
type: 'boolean',
76-
},
77-
],
78-
description: 'Tells dev-server to use serveIndex middleware.',
79-
negatedDescription:
80-
'Do not tell dev-server to use serveIndex middleware.',
81-
negative: true,
82-
processor(opts) {
83-
opts.static = opts.static || {};
84-
opts.static.serveIndex = opts.staticServeIndex;
85-
delete opts.staticServeIndex;
69+
},
70+
'static-serve-index': {
71+
name: 'static-serve-index',
72+
type: Boolean,
73+
configs: [
74+
{
75+
type: 'boolean',
8676
},
77+
],
78+
description: 'Tells dev-server to use serveIndex middleware.',
79+
negatedDescription: 'Do not tell dev-server to use serveIndex middleware.',
80+
negative: true,
81+
processor(opts) {
82+
opts.static = opts.static || {};
83+
opts.static.serveIndex = opts.staticServeIndex;
84+
delete opts.staticServeIndex;
8785
},
88-
'static-watch': {
89-
name: 'static-watch',
90-
type: Boolean,
91-
configs: [
92-
{
93-
type: 'boolean',
94-
},
95-
],
96-
description: 'Watch for files in static content directory.',
97-
negatedDescription: 'Do not watch for files in static content directory.',
98-
negative: true,
99-
processor(opts) {
100-
opts.static = opts.static || {};
101-
opts.static.watch = opts.staticWatch;
102-
delete opts.staticWatch;
86+
},
87+
'static-watch': {
88+
name: 'static-watch',
89+
type: Boolean,
90+
configs: [
91+
{
92+
type: 'boolean',
10393
},
94+
],
95+
description: 'Watch for files in static content directory.',
96+
negatedDescription: 'Do not watch for files in static content directory.',
97+
negative: true,
98+
processor(opts) {
99+
opts.static = opts.static || {};
100+
opts.static.watch = opts.staticWatch;
101+
delete opts.staticWatch;
104102
},
105-
'live-reload': {
106-
name: 'live-reload',
107-
type: Boolean,
108-
configs: [
109-
{
110-
type: 'boolean',
111-
},
112-
],
113-
description: 'Enables live reloading on changing files.',
114-
negatedDescription: 'Disables live reloading on changing files.',
115-
negative: true,
116-
},
117-
https: {
118-
name: 'https',
119-
type: Boolean,
120-
configs: [
121-
{
122-
type: 'boolean',
123-
},
124-
],
125-
description: 'Use HTTPS protocol.',
126-
negatedDescription: 'Do not use HTTPS protocol.',
127-
negative: true,
128-
},
129-
'https-passphrase': {
130-
name: 'https-passphrase',
131-
type: String,
132-
configs: [
133-
{
134-
type: 'string',
135-
},
136-
],
137-
description: 'Passphrase for a pfx file.',
138-
processor(opts) {
139-
opts.https = opts.https || {};
140-
opts.https.passphrase = opts.httpsPassphrase;
141-
delete opts.httpsPassphrase;
103+
},
104+
'live-reload': {
105+
name: 'live-reload',
106+
type: Boolean,
107+
configs: [
108+
{
109+
type: 'boolean',
110+
},
111+
],
112+
description: 'Enables live reloading on changing files.',
113+
negatedDescription: 'Disables live reloading on changing files.',
114+
negative: true,
115+
},
116+
https: {
117+
name: 'https',
118+
type: Boolean,
119+
configs: [
120+
{
121+
type: 'boolean',
142122
},
123+
],
124+
description: 'Use HTTPS protocol.',
125+
negatedDescription: 'Do not use HTTPS protocol.',
126+
negative: true,
127+
},
128+
'https-passphrase': {
129+
name: 'https-passphrase',
130+
type: String,
131+
configs: [
132+
{
133+
type: 'string',
134+
},
135+
],
136+
description: 'Passphrase for a pfx file.',
137+
processor(opts) {
138+
opts.https = opts.https || {};
139+
opts.https.passphrase = opts.httpsPassphrase;
140+
delete opts.httpsPassphrase;
143141
},
144-
'https-key': {
145-
name: 'https-key',
146-
type: String,
147-
configs: [
148-
{
149-
type: 'string',
150-
},
151-
],
152-
description: 'Path to an SSL key.',
153-
processor(opts) {
154-
opts.https = opts.https || {};
155-
opts.https.key = opts.httpsKey;
156-
delete opts.httpsKey;
142+
},
143+
'https-key': {
144+
name: 'https-key',
145+
type: String,
146+
configs: [
147+
{
148+
type: 'string',
157149
},
150+
],
151+
description: 'Path to an SSL key.',
152+
processor(opts) {
153+
opts.https = opts.https || {};
154+
opts.https.key = opts.httpsKey;
155+
delete opts.httpsKey;
158156
},
159-
'https-pfx': {
160-
name: 'https-pfx',
161-
type: String,
162-
configs: [
163-
{
164-
type: 'string',
165-
},
166-
],
167-
description: 'Path to an SSL pfx file.',
168-
processor(opts) {
169-
opts.https = opts.https || {};
170-
opts.https.pfx = opts.httpsPfx;
171-
delete opts.httpsPfx;
157+
},
158+
'https-pfx': {
159+
name: 'https-pfx',
160+
type: String,
161+
configs: [
162+
{
163+
type: 'string',
172164
},
165+
],
166+
description: 'Path to an SSL pfx file.',
167+
processor(opts) {
168+
opts.https = opts.https || {};
169+
opts.https.pfx = opts.httpsPfx;
170+
delete opts.httpsPfx;
173171
},
174-
'https-cert': {
175-
name: 'https-cert',
176-
type: String,
177-
configs: [
178-
{
179-
type: 'string',
180-
},
181-
],
182-
description: 'Path to an SSL certificate.',
183-
processor(opts) {
184-
opts.https = opts.https || {};
185-
opts.https.cert = opts.httpsCert;
186-
delete opts.httpsCert;
172+
},
173+
'https-cert': {
174+
name: 'https-cert',
175+
type: String,
176+
configs: [
177+
{
178+
type: 'string',
187179
},
180+
],
181+
description: 'Path to an SSL certificate.',
182+
processor(opts) {
183+
opts.https = opts.https || {};
184+
opts.https.cert = opts.httpsCert;
185+
delete opts.httpsCert;
188186
},
189-
'https-cacert': {
190-
name: 'https-cacert',
191-
type: String,
192-
configs: [
193-
{
194-
type: 'string',
195-
},
196-
],
197-
description: 'Path to an SSL CA certificate.',
198-
processor(opts) {
199-
opts.https = opts.https || {};
200-
opts.https.cacert = opts.httpsCacert;
201-
delete opts.httpsCacert;
187+
},
188+
'https-cacert': {
189+
name: 'https-cacert',
190+
type: String,
191+
configs: [
192+
{
193+
type: 'string',
202194
},
195+
],
196+
description: 'Path to an SSL CA certificate.',
197+
processor(opts) {
198+
opts.https = opts.https || {};
199+
opts.https.cacert = opts.httpsCacert;
200+
delete opts.httpsCacert;
203201
},
204-
'https-request-cert': {
205-
name: 'https-request-cert',
206-
type: Boolean,
207-
configs: [
208-
{
209-
type: 'boolean',
210-
},
211-
],
212-
description: 'Request for an SSL certificate.',
213-
negatedDescription: 'Do not request for an SSL certificate.',
214-
processor(opts) {
215-
opts.https = opts.https || {};
216-
opts.https.requestCert = opts.httpsRequestCert;
217-
delete opts.httpsRequestCert;
202+
},
203+
'https-request-cert': {
204+
name: 'https-request-cert',
205+
type: Boolean,
206+
configs: [
207+
{
208+
type: 'boolean',
218209
},
210+
],
211+
description: 'Request for an SSL certificate.',
212+
negatedDescription: 'Do not request for an SSL certificate.',
213+
processor(opts) {
214+
opts.https = opts.https || {};
215+
opts.https.requestCert = opts.httpsRequestCert;
216+
delete opts.httpsRequestCert;
219217
},
218+
},
220219
http2: {
221220
name: 'http2',
222221
type: Boolean,

0 commit comments

Comments
 (0)