Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Const Name are not generated correctly in services index.js file #58

Closed
Mr-Martinez opened this issue Sep 28, 2018 · 6 comments
Closed

Comments

@Mr-Martinez
Copy link

Steps to reproduce

The issue was found to be solved here: feathersjs/feathers#539
However it seems the issue persist when using feathers-plus generate service

  1. Create a new service feathers-plus generate service

  2. When asked what to name the service use camelCase
    Example: newServiceMethod

  3. Choose custom method, no authentication, yes to GraphQL, leave everything else on defaults.

  4. Check index.js inside services, the system has used dashes to seperate the words where the Uppercases were.

Javascript variables using dashes is invalid.

Expected behavior

I expected it to use the CamelCase words given during the naming of the service inside of the index.js inside the services folder. Like the feathers-plus generate hooks does.

Actual behavior

It used the dashes instead.

I try to work on it myself, but I dont know how the magic of the cli works.
Hooks has no problem with camelCasing when adding itself to the .hooks js file you specify it too.

@eddyystop
Copy link
Member

eddyystop commented Sep 28, 2018

Thanks for catching this.

The generator's tests use names like name1 and they don't have this problem even though the file names used are like name-1.

The problem was introduced when this generator implemented feathersjs/generator-feathers PR feathersjs-ecosystem/generator-feathers#379 "Fix renaming to preserve dot notation" (feathersjs-ecosystem/generator-feathers@5621a35) with fb8cb9d

@eddyystop
Copy link
Member

eddyystop commented Sep 28, 2018

It comes down to users1 is a valid NPM repo/file name while usersNames is not. See #59

@eddyystop
Copy link
Member

Your issue is fixed in f+/cli v0.7.35 using generator v0.6.34.

Please confirm. Thanks.

@eddyystop
Copy link
Member

Better make that f+/cli v0.7.36 using generator v0.6.35. :(

@Mr-Martinez
Copy link
Author

Mr-Martinez commented Sep 28, 2018

Hello @eddyystop,

I have confirmed that the issue has been resolved.

To learn just a little more about how this cli works in code, which file here contains the code that adds the names onto the service from the cli?

Edit:

Aw, I see what you meant, the feathers generator imported was changed to v0.6.35, I thought that was the plus-generator version you were referring to.

@eddyystop
Copy link
Member

eddyystop commented Sep 28, 2018

Thanks for pointing out a phrase I've used so many times is ambiguouses. f+/cli v0.7.36 which uses generator v0.6.35.

The generator semver appears under the big Feathers+ sign when you run the generator. That lets you check you are using the right version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants