Skip to content

Commit cc41fd6

Browse files
authored
feat(cli): remove default option for controller (#768)
The CLI no longer has a default ('new') name for the controller, and will prompt for a name until it is given properly.
1 parent f67db6c commit cc41fd6

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

packages/cli/lib/artifact-generator.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ module.exports = class ArtifactGenerator extends Generator {
6161
{
6262
type: 'input',
6363
name: 'name',
64-
message: utils.toClassName(this.artifactInfo.type) + ' name:', // capitalization
64+
message: utils.toClassName(this.artifactInfo.type) + ' class name:', // capitalization
6565
when: this.artifactInfo.name === undefined,
66-
default: this.artifactInfo.defaultName,
6766
validate: utils.validateClassName,
6867
},
6968
];

packages/cli/test/controller.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,6 @@ describe('lb4 controller', () => {
5151
assert.fileContent(tmpDir + withInputName, /constructor\(\) {}/);
5252
});
5353
});
54-
describe('without input', () => {
55-
let tmpDir;
56-
before(() => {
57-
return helpers
58-
.run(generator)
59-
.inTmpDir(dir => {
60-
tmpDir = dir;
61-
fs.writeFileSync(
62-
path.join(tmpDir, 'package.json'),
63-
JSON.stringify({
64-
keywords: ['loopback'],
65-
})
66-
);
67-
})
68-
.withPrompts(noInputProps);
69-
});
70-
it('writes correct file name', () => {
71-
assert.file(tmpDir + noInputName);
72-
assert.noFile(tmpDir + templateName);
73-
});
74-
it('scaffolds correct files', () => {
75-
assert.fileContent(tmpDir + noInputName, /class NewController/);
76-
assert.fileContent(tmpDir + noInputName, /constructor\(\) {}/);
77-
});
78-
});
7954
describe('with arg', () => {
8055
let tmpDir;
8156
before(() => {

0 commit comments

Comments
 (0)