Conversation
79bd274 to
2216405
Compare
agnes512
left a comment
There was a problem hiding this comment.
LGTM 👍 the naming part is pretty reasonable, makes the code more readable.
I am good with the PR once the CI passes
packages/cli/lib/utils.js
Outdated
| return util.format('Class name is invalid: %s', name); | ||
| }; | ||
|
|
||
| exports.remindAboutNamingRules = function(name, log) { |
There was a problem hiding this comment.
Is checkNamingConvention a better name?
There was a problem hiding this comment.
Not in my mind. I understand checkNamingConvention to report an error when the name does not match certain pattern(s). This function just prints a warning to explain the user what will happen.
There was a problem hiding this comment.
Maybe reportNamingIssues or warnInvalidName?
There was a problem hiding this comment.
I'll go with logNamingIssues for consistency with logClassCreation.
packages/cli/lib/utils.js
Outdated
| } | ||
| }; | ||
|
|
||
| exports.printClassFileName = function(type, typePlural, name, log) { |
There was a problem hiding this comment.
printClassFileName => logClassGeneration?
There was a problem hiding this comment.
I'll go with logClassCreation to match the message printed. I find generation ambiguous - is it describing the process of generating something new, or a generation like a group of similarly-aged organisms?
7d7fdac to
0c1ab24
Compare
packages/cli/test/integration/lib/check-loopback-project.suite.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
Introduce two new helpers to be used in generators not inheriting form `ArtifactGenerator`: - `_isGenerationSuccessful` to detect whether all target files were successfully created or modified. - `_updateIndexFile` to add a single entry to a given `index.ts` file Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
0c1ab24 to
e524742
Compare
While working on #3688 (
lb4 import-lb3-model), I discovered many obstacles preventing me from reusing existing code in my new generator.This pull request contains a series of commits to make various bits in our CLI code base easier to use in new ways.
It may be best to review the changes commit-by-commit.
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈