Skip to content

Commit ee0d1ad

Browse files
committed
Hide shared options and drop support for kebab case options.
1 parent 310f72d commit ee0d1ad

File tree

3 files changed

+4
-146
lines changed

3 files changed

+4
-146
lines changed

lib/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class Generator extends Base {
499499
questionStorage.setPath(name, answer);
500500
});
501501

502-
if (!this.options['skip-cache'] && !this.options.skipCache) {
502+
if (!this.options.skipCache) {
503503
promptSuggestion.storeAnswers(
504504
this._globalConfig,
505505
questions,
@@ -1071,13 +1071,9 @@ class Generator extends Base {
10711071
// Pass down the default options so they're correctly mirrored down the chain.
10721072
options = {
10731073
...options,
1074-
skipInstall: this.options.skipInstall || this.options['skip-install'],
1075-
'skip-install': this.options.skipInstall || this.options['skip-install'],
1076-
skipCache: this.options.skipCache || this.options['skip-cache'],
1077-
'skip-cache': this.options.skipCache || this.options['skip-cache'],
1078-
forceInstall: this.options.forceInstall || this.options['force-install'],
1079-
'force-install':
1080-
this.options.forceInstall || this.options['force-install'],
1074+
skipInstall: this.options.skipInstall,
1075+
skipCache: this.options.skipCache,
1076+
forceInstall: this.options.forceInstall,
10811077
skipLocalCache: this.options.skipLocalCache,
10821078
destinationRoot: this._destinationRoot
10831079
};

test/base.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,6 @@ describe('Base', () => {
828828
setTimeout(() => {
829829
this.dummy.run().then(() => {
830830
sinon.assert.callOrder(runSpy, this.spy);
831-
assert.equal(this.spy.thisValues[0].options.skipInstall, true);
832-
assert.equal(this.spy.thisValues[0].options['skip-install'], true);
833-
assert.equal(this.spy.thisValues[0].options.forceInstall, true);
834-
assert.equal(this.spy.thisValues[0].options['force-install'], true);
835-
assert.equal(this.spy.thisValues[0].options.skipCache, true);
836-
assert.equal(this.spy.thisValues[0].options['skip-cache'], true);
837831
assert(this.spy.calledAfter(runSpy));
838832
done();
839833
});

test/generators-compose-workflow.js

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,6 @@ describe('Multiples generators', () => {
8989
this.spyEnd1,
9090
this.spyEnd2
9191
);
92-
assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true);
93-
assert.equal(
94-
this.spyExec1.thisValues[0].options['skip-install'],
95-
true
96-
);
97-
assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true);
98-
assert.equal(
99-
this.spyExec1.thisValues[0].options['force-install'],
100-
true
101-
);
102-
assert.equal(this.spyExec1.thisValues[0].options.skipCache, true);
103-
assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true);
104-
assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true);
105-
assert.equal(
106-
this.spyExec2.thisValues[0].options['skip-install'],
107-
true
108-
);
109-
assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true);
110-
assert.equal(
111-
this.spyExec2.thisValues[0].options['force-install'],
112-
true
113-
);
114-
assert.equal(this.spyExec2.thisValues[0].options.skipCache, true);
115-
assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true);
11692
assert(this.spyInit1.calledAfter(runSpy));
11793
assert(this.spyInit2.calledAfter(this.spyInit1));
11894
assert(this.spyExec1.calledAfter(this.spyInit2));
@@ -143,30 +119,6 @@ describe('Multiples generators', () => {
143119
this.spyEnd2,
144120
this.spyEnd1
145121
);
146-
assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true);
147-
assert.equal(
148-
this.spyExec1.thisValues[0].options['skip-install'],
149-
true
150-
);
151-
assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true);
152-
assert.equal(
153-
this.spyExec1.thisValues[0].options['force-install'],
154-
true
155-
);
156-
assert.equal(this.spyExec1.thisValues[0].options.skipCache, true);
157-
assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true);
158-
assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true);
159-
assert.equal(
160-
this.spyExec2.thisValues[0].options['skip-install'],
161-
true
162-
);
163-
assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true);
164-
assert.equal(
165-
this.spyExec2.thisValues[0].options['force-install'],
166-
true
167-
);
168-
assert.equal(this.spyExec2.thisValues[0].options.skipCache, true);
169-
assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true);
170122
assert(this.spyInit2.calledAfter(runSpy));
171123
assert(this.spyInit1.calledAfter(this.spyInit2));
172124
assert(this.spyExec2.calledAfter(this.spyInit1));
@@ -211,42 +163,6 @@ describe('Multiples generators', () => {
211163
this.spyEnd1,
212164
this.spyEnd2
213165
);
214-
assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true);
215-
assert.equal(
216-
this.spyExec1.thisValues[0].options['skip-install'],
217-
true
218-
);
219-
assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true);
220-
assert.equal(
221-
this.spyExec1.thisValues[0].options['force-install'],
222-
true
223-
);
224-
assert.equal(this.spyExec1.thisValues[0].options.skipCache, true);
225-
assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true);
226-
assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true);
227-
assert.equal(
228-
this.spyExec2.thisValues[0].options['skip-install'],
229-
true
230-
);
231-
assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true);
232-
assert.equal(
233-
this.spyExec2.thisValues[0].options['force-install'],
234-
true
235-
);
236-
assert.equal(this.spyExec2.thisValues[0].options.skipCache, true);
237-
assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true);
238-
assert.equal(this.spyExec3.thisValues[0].options.skipInstall, true);
239-
assert.equal(
240-
this.spyExec3.thisValues[0].options['skip-install'],
241-
true
242-
);
243-
assert.equal(this.spyExec3.thisValues[0].options.forceInstall, true);
244-
assert.equal(
245-
this.spyExec3.thisValues[0].options['force-install'],
246-
true
247-
);
248-
assert.equal(this.spyExec3.thisValues[0].options.skipCache, true);
249-
assert.equal(this.spyExec3.thisValues[0].options['skip-cache'], true);
250166
assert(this.spyInit1.calledAfter(runSpy));
251167
assert(this.spyInit2.calledAfter(this.spyInit1));
252168
assert(this.spyInit3.calledAfter(this.spyInit2));
@@ -307,30 +223,6 @@ describe('Multiples generators', () => {
307223
this.spyEnd1,
308224
this.spyEnd2
309225
);
310-
assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true);
311-
assert.equal(
312-
this.spyExec1.thisValues[0].options['skip-install'],
313-
true
314-
);
315-
assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true);
316-
assert.equal(
317-
this.spyExec1.thisValues[0].options['force-install'],
318-
true
319-
);
320-
assert.equal(this.spyExec1.thisValues[0].options.skipCache, true);
321-
assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true);
322-
assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true);
323-
assert.equal(
324-
this.spyExec2.thisValues[0].options['skip-install'],
325-
true
326-
);
327-
assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true);
328-
assert.equal(
329-
this.spyExec2.thisValues[0].options['force-install'],
330-
true
331-
);
332-
assert.equal(this.spyExec2.thisValues[0].options.skipCache, true);
333-
assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true);
334226
assert(writingSpy1.calledAfter(runSpy));
335227
assert(this.spyInit1.calledAfter(writingSpy1));
336228
assert(this.spyInit2.calledAfter(this.spyInit1));
@@ -404,30 +296,6 @@ describe('Multiples generators', () => {
404296
this.spyEnd1,
405297
this.spyEnd2
406298
);
407-
assert.equal(this.spyExec1.thisValues[0].options.skipInstall, true);
408-
assert.equal(
409-
this.spyExec1.thisValues[0].options['skip-install'],
410-
true
411-
);
412-
assert.equal(this.spyExec1.thisValues[0].options.forceInstall, true);
413-
assert.equal(
414-
this.spyExec1.thisValues[0].options['force-install'],
415-
true
416-
);
417-
assert.equal(this.spyExec1.thisValues[0].options.skipCache, true);
418-
assert.equal(this.spyExec1.thisValues[0].options['skip-cache'], true);
419-
assert.equal(this.spyExec2.thisValues[0].options.skipInstall, true);
420-
assert.equal(
421-
this.spyExec2.thisValues[0].options['skip-install'],
422-
true
423-
);
424-
assert.equal(this.spyExec2.thisValues[0].options.forceInstall, true);
425-
assert.equal(
426-
this.spyExec2.thisValues[0].options['force-install'],
427-
true
428-
);
429-
assert.equal(this.spyExec2.thisValues[0].options.skipCache, true);
430-
assert.equal(this.spyExec2.thisValues[0].options['skip-cache'], true);
431299
assert(writingSpy1.calledAfter(runSpy));
432300
assert(this.spyInit1.calledAfter(writingSpy1));
433301
assert(this.spyExec1.calledAfter(this.spyInit1));

0 commit comments

Comments
 (0)