Giter Site home page Giter Site logo

cli's People

Contributors

corymsmith avatar daffl avatar dependabot-preview[bot] avatar ekryski avatar github-actions[bot] avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jeremyjs avatar marshallswain avatar omgimalexis avatar zaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Can't generate a project on Linux Mint

When i press a key when it prompts for "Description" i got an error:

$ feathers generate
Feathers CLI


? Description 

readline.js:925
            throw err;
            ^

TypeError: Cannot read property 'emit' of undefined
    at Prompt.inquirer.prompt.prompts.(anonymous function).onKeypress (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/vorpal/dist/ui.js:133:20)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver.tryCatcher (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:5782:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
    at AutoDetachObserver.tryCatcher (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.next (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:5782:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:1469:31)
    at InnerObserver.onNext (/home/rottmann/.nvm/versions/node/v4.4.1/lib/node_modules/feathers-cli/node_modules/rx-lite/rx.lite.js:4306:29)

Fresh installed and updated Linux Mint 17.3
node 4.4.1
npm 3.8.3
feathers-cli 1.2.2
generator-feathers 0.7.0
generator-feathers-plugin 0.6.9
yo 1.7.0

Setup

  • nvm
    $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
    $ nvm install 4.4
    $ nvm use 4.4
  • feathersjs
    $ npm install -g yo generator-feathers generator-feathers-plugin feathers-cli

Run: $ feathers generate

Support Heroku deployments

Migrated from feathersjs/feathers#250:

We also have some thoughts around being able to do feathers deploy or feathers deploy:heroku and it will deploy your app.

We can start small and just support Heroku but we might want to wrap Otto in the future in order to support easy dev and prod deployments.

[3.0] Have a basic "doctor" command

A lot of people seem to get hung up because their environment is either a bit broken or isn't setting up really well for Feathers.

A good place to start might be to have a doctor command that inspects their env when they generate a project. This is what I'm thinking:

Basic

This is some of the basic stuff we probably should check.

  • Check that node exists
  • Check that npm exists
  • Check for node v5.x+, prompt for upgrade if not
  • Check for npm v.3.8.7+, prompt for upgrade if not

More Advanced

This is stuff that would be nice but definitely isn't crucial from day one.

  • Check that project name isn't the same as a dependency
  • Check that all the dependencies are installed
  • Check for node_gyp (ie. that we can compile binaries)
  • Check gcc version?
  • Check feathers.json is valid
  • Check/print out environment variables

Inspiration

Error on Node version 7.1.0

CLI wont work anymore due to updating node to version 7.1.0

  • machine: Windows 10
  • node: 7.1.0 x64
C:\feathers-chat>feathers generate middleware
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: This socket is closed
    at WriteStream.Socket._writeGeneric (net.js:683:19)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at Console.log (console.js:43:16)
    at UI.prompt (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\ui.js:233:17)
    at Vorpal.vorpal._prompt (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\vorpal.js:612:15)
    at UI.attach (C:\Users\Shahab\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\vorpal\dist\ui.js:400:19)

Remove the "generate" command shortcut

Remove the generate command, which is currently a shortcut for generate app. This allows us to accept set application name and directory to create as generate app [app name].

Update dependencies: feathers-configuration

Could we update dependencies in the generator?

Package                 Current  Wanted  Latest  
feathers-configuration    0.2.3   0.2.3   0.3.1 

I tried to do it locally. Nothing is broken. The tests were successful.

[3.0] Support file conflicts

If a file or folder already exists we should prompt for confirmation of overwriting, unless the -f, --force flag is passed.

TODO

  • Add support -f, --force flag to CLI
  • Prompt the user for confirmation on individual file conflicts. This may need to happen in the individual generator.

Generate Hooks

I'm having a problem where I can't generate a hook if I specify where the hook should be used. Here is the code I'm running in my feather app root directory. This is straight from the docs

feathers generate hook
? What do you want to call your hook? gravatar
? What type of hook do you need? before hook
? What service is this hook for? user
? What method is this hook for? create

No file was created in this instance above. If I don't specify what method(s) the hook is for, then it generates the hook.

feathers generate hook
? What do you want to call your hook? gravatar
? What type of hook do you need? before hook
? What service is this hook for? user
? What method is this hook for? 
   create src/services/user/hooks/gravatar.js
   create test/services/user/hooks/gravatar.test.js

I just ran npm i -g feathers-cli so I'm running the latest version. Any ideas?

toLowerCase error

local@MBP~$ generate service

? What do you want to call your service? 
? What type of service do you need? database
? For which database? NeDB
? Does your service require users to be authenticated? No
events.js:141
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at Object.module.exports.string.downcase (/usr/local/lib/node_modules/feathers-cli/node_modules/i/lib/util.js:126:21)
    at Object.inflect.camelize (/usr/local/lib/node_modules/feathers-cli/node_modules/i/lib/methods.js:46:24)
    at Object.exports.addImport (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/lib/transform.js:92:21)
    at importService (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/service/index.js:14:15)
    at module.exports.generators.Base.extend.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/service/index.js:171:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:431:23)
    at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:26:25
    at new Promise (/usr/local/lib/node_modules/feathers-cli/node_modules/core-js/modules/es6.promise.js:191:7)
    at /usr/local/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:19
    at /usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:432:9

UNMET PEER DEPENDENCY yo@>=1.0.0

From feathersjs/feathers#288:

"I'm getting this warning after installing feathers:

└─┬ [email protected]
  └── UNMET PEER DEPENDENCY yo@>=1.0.0

npm WARN [email protected] requires a peer of yo@>=1.0.0 but none was installed.

Sorry if the fix is obvious, I'm a novice. I haven't been able to find a solution on the internet or by myself (I tried to update feathers-cli and yo manually and stuff like that...)."

Add rethinkdb support

Hey guys, great work on everything so far. Now that the official feathers-rethinkdb adapter is out, I would like to get the support added to the new project creation and service generator. Thanks!

ceero

Removing services with the CLI

I was wondering if this feature was already implemented. I can't find anything online about it. If so, what's the command? If there is no command, what would be the safest way to remove a service?

Can't generate a new service (Node 6.2.0 on Mac OS X 10.11.5)

Here's a copy of my terminal output:

$ feathers generate service

? What do you want to call your service? user
? What type of service do you need? database
? For which database? MongoDB
? Does your service require users to be authenticated? Yes
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: /usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/templates/mongoose.js:11
    9| const Schema = mongoose.Schema;
    10| 
 >> 11| const <%= name %>Schema = new Schema({<% if(name === 'user') { %><% for (var i = 0; i < providers.length; i++) { %>
    12|   <% if (providers[i] === 'local') { %>email: {type: String, required: true, unique: true},
    13|   password: { type: String, required: true },
    14|   <% } else { %><%= providers[i].name %>Id: { type: String },

Cannot read property 'length' of undefined
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:485:12), <anonymous>:19:37)
    at returnedFn (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:514:17)
    at Object.exports.render (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:316:37)
    at copy.process (/usr/local/lib/node_mair-4.local auth [master]$

Remove Yeoman dependency

Yeoman is a fairly heavy dependency and the cli takes forever to install. It would be nice if we rolled all generator functions directly into the cli project in a more lightweight fashion.

Error when generating new service

Steps to reproduce

To reproduce for me, all I have to do is run feathers generate service at the top level folder of my application and then give it a name, select generic, and say yes or no to if it needs auth.

Expected behavior

I expect to produce a baseline service file and the associated baseline test.

Actual behavior

I'm using the latest version of the cli but when I try to generate a new service I get the error as follows:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: No function expression found after module.exports
    at Object.exports.addLastInFunction (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\lib\transform.js:81:11)
    at importService (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\generators\service\index.js:16:15)
    at module.exports.generators.Base.extend.writing (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\generator-feathers\generators\service\index.js:171:5)
    at Object.<anonymous> (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\yeoman-generator\lib\base.js:439:23)
    at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\run-async\index.js:26:25
    at new Promise (C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\core-js\modules\es6.promise.js:191:7)
    at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\run-async\index.js:25:19
    at C:\Users\Steven.Lambe\AppData\Roaming\npm\node_modules\feathers-cli\node_modules\yeoman-generator\lib\base.js:440:9
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):
feathers-cli 1.2.7

NodeJS version:
4.6.0

Operating System:
Windows 10 Pro

Module Loader:
Node

Services become plural?

Being new ..today... with Feathers, following the Quick start, I ran feathers generate service and entered my service name transponder.

I expect to be able to call http://localhost:3030/transponder but the call that works is http://localhost:3030/transponders (note the plural 's')

Bug? My misunderstanding? Are service names to be required in English only?

Add option for creating application without static content [Feature Request]

Currently in feathers-cli (which is so awesome thank you all so much), when you generate a application, the default behavior is to serve static content in three places: /, /favicon.ico, and any 404 requests. If someone is building a purely backend application to support a mobile app for example, then returning HTML is less ideal than json responses. It'd be great if there was an option to generate a feathers application that serves 404 responses as a JSON payload with an error message as well as an / response that has authentication turned on by default. I suppose in a typical REST backend application, the / wouldn't return anything but it could (just a thought), render any documentation embedded inside the application or be further configure to support pointing to a separate documentation server.

Do you guys have any thoughts on this? I'd mark it as super low priority because it's really easy to rip out the static content if need be.

Cannot create 'user' service

Steps to reproduce

I created a new application with the CLI, and didn't enable any authentication options, because I did not need any of the ones which were present, so no user service was generated.

Eventually, though, I needed one, so I ran feathers generate service and provided user as the name.

Expected behavior

A MongoDB user service should be generated

Actual behavior

Seems like the template expects you to be running generate app if the service name is user, because in this case, providers was undefined.

? What do you want to call your service? user
? What type of service do you need? database
? For which database? MongoDB
? Does your service require users to be authenticated? Yes
events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: /usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/templates/mongoose.js:11
    9| const Schema = mongoose.Schema;
    10| 
 >> 11| const <%= name %>Schema = new Schema({<% if(name === 'user') { %><% for (var i = 0; i < providers.length; i++) { %>
    12|   <% if (providers[i] === 'local') { %>email: {type: String, required: true, unique: true},
    13|   password: { type: String, required: true },
    14|   <% } else { %><%= providers[i].name %>Id: { type: String },

Cannot read property 'length' of undefined
    at eval (eval at compile (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:481:12), <anonymous>:17:37)
    at returnedFn (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:512:17)
    at Object.exports.render (/usr/local/lib/node_modules/feathers-cli/node_modules/ejs/lib/ejs.js:316:37)
    at process (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:12:18)
    at applyProcessingFunc (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:13:16)
    at EditionInterface.exports._copySingle (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:51:16)
    at EditionInterface.exports.copy (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy.js:23:17)
    at EditionInterface.module.exports [as copyTpl] (/usr/local/lib/node_modules/feathers-cli/node_modules/mem-fs-editor/lib/actions/copy-tpl.js:10:8)
    at constructor.writing (/usr/local/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/model/index.js:81:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/base.js:439:23)

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):
feathers-cli 1.2.7

NodeJS version:
7.3.0

Operating System:
macOS Sierra

Browser Version:
Irrelevant

React Native Version:
N/A

Module Loader:
npm

Using a hyphen in service name silently fails.

When generating a new service with the cli, there is no error if you name the service with a hyphen. For example: calling your service test-service will silently fail.

Start with a new app then use the cli to do the following.

$ feathers generate service

? What do you want to call your service? test-service
? What type of service do you need? generic
? Does your service require users to be authenticated? Yes
$

There is no error and the service is not created.

Errors when running generate

TLDR - Changing env.lookup() to env.register(require.resolve('generator-feathers')) in generate.js seemed to fix this for me. I do not know enough about yeoman to know if this is machine specific or not. Hopefully this helps.

When running any command (generate shown below) I receive the following:

514 ajones:sandbox$feathers generate
feathers$

events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: You don't seem to have a generator with the name feathers:app installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 0 registered generators run yo with the `--help` option.
    at Environment.create (/Users/ajones/git/forks/feathers-cli/node_modules/yeoman-environment/lib/environment.js:296:7)
    at Environment.run (/Users/ajones/git/forks/feathers-cli/node_modules/yeoman-environment/lib/environment.js:364:24)
    at CommandInstance.<anonymous> (/Users/ajones/git/forks/feathers-cli/lib/commands/generate.js:10:9)
    at EventEmitter.session.execCommandSet (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/session.js:470:20)
    at EventEmitter.vorpal._exec (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:956:18)
    at EventEmitter.vorpal._execQueueItem (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:747:17)
    at EventEmitter.vorpal._queueHandler (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:731:10)
    at EventEmitter.vorpal.exec (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:678:10)
    at EventEmitter.Vorpal.parse (/Users/ajones/git/forks/feathers-cli/node_modules/vorpal/dist/vorpal.js:163:12)
    at exports.default (/Users/ajones/git/forks/feathers-cli/lib/index.js:14:40)

running yo --help shows that I do have them.

Available Generators:

  feathers
    hook
    middleware
    model
    service

Generate a directory for the app

It's a pet peeve of mine that I have to create and cd into a directory in order to run yeoman. We should do that for people. Less keystrokes FTW!!

Automated testing environment

Often the code needs to be tested with access to the database or some other service, thus making neccesary to run the tests in a different environment.

Should the generator provide an ready to use automated testing environment for this?

For example with:

  • A ready to use testing.json config, to run with NODE_ENV=testing mocha.
  • A basic reset database script to run before testing
  • Some example tests with database dummy-filling and testing

jshint errors failing tests

I'm going to clean up these jshint errors in 2.0.

> jshint src/. test/. --config

src/commands/debug.js: line 19, col 20, 'callback' is defined but never used.
src/commands/debug.js: line 19, col 14, 'args' is defined but never used.

src/commands/deploy.js: line 14, col 20, 'callback' is defined but never used.
src/commands/deploy.js: line 14, col 14, 'args' is defined but never used.
src/commands/deploy.js: line 5, col 7, 'providers' is defined but never used.

src/index.js: line 24, col 40, Strings must use singlequote.
src/index.js: line 58, col 78, Strings must use singlequote.
src/index.js: line 58, col 128, Strings must use singlequote.
src/index.js: line 75, col 9, 'run' was used before it was defined.

src/utils/check-environment.js: line 11, col 25, 'args' is defined but never used.
src/utils/check-environment.js: line 23, col 60, 'error' is not defined.

src/utils/check-for-updates.js: line 6, col 54, Missing semicolon.

src/utils/start-server.js: line 4, col 25, 'args' is defined but never used.

src/utils/update-cli.js: line 3, col 25, 'args' is defined but never used.

14 errors

Won't install on NodeJS v6.x

Looks like Yeoman is bombing:

npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/eric/.nvm/versions/node/v6.2.0/lib
└── (empty)

npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/eric/.nvm/versions/node/v6.2.0/bin/node" "/Users/eric/.nvm/versions/node/v6.2.0/bin/npm" "install" "-g" "feathers-cli"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! path /Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/eric/.nvm/versions/node/v6.2.0/lib/node_modules/feathers-cli/node_modules/yo/lib/cli.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/eric/Development/rpm/rpm-mobile/npm-debug.log
npm ERR! code 1

feathers generate hook fails when some hooks are commented out

How to reproduce

Let it be a service with these hooks

exports.before = {
  all: [computeAverage()],
  find: [],
  get: [],
  create: [],
  update: [
    /*auth.verifyToken(),
    auth.populateUser(),
    auth.restrictToAuthenticated()
    */
  ],
  patch: [],
  remove: []
};

exports.after = {
  all: [],
  find: [],
  get: [],
  create: [],
  update: [],
  patch: [],
  remove: []
};

when using feathers generate hook for this service and choosing before hook for the update method, the genrator will throw the following error

TypeError: Cannot read property 'loc' of null at print (generator-feathers/node_modules/recast/lib/printer.js:72:37) at exports.printComments (generator-feathers/node_modules/recast/lib/comments.js:324:22) at printWithComments (generator-feathers/node_modules/recast/lib/printer.js:61:16) at print (generator-feathers/node_modules/recast/lib/printer.js:66:20) at Printer.print (generator-feathers/node_modules/recast/lib/printer.js:118:21) at Object.print (generator-feathers/node_modules/recast/main.js:6:33) at traverse.pre (generator-feathers/lib/transform.js:33:49) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:16:19) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:29:25) at visit (generator-feathers/node_modules/ast-traverse/ast-traverse.js:32:21)

Disable yeoman updates

The following happens when generator-feathers is bumped but the user is on an older version via feathers-cli. Following the instructions won't work, as the cli uses its own instance of the module as a local dependency.

$ feathers generate
Feathers CLI



┌──────────────────────────────────────────────────┐
│ Update available: 0.7.0 (current: 0.6.20)        │
│ Run npm install -g generator-feathers to update. │
└──────────────────────────────────────────────────┘

? Do you want to update this generator? (Use arrow keys)
❯ Yes (stops the generator and runs npm install -g generator-feathers) 
  No (continues running the generator) 
  Get me out of here 

Support yarn for generating app

Since yarn is way more faster than npm so I think it's a great time to start supporting yarn when generating new feathers app.

I think it's a good idea to detect yarn is installed on the current system and provide an option to use yarn instead of npm when running feathers generate

Running a Feathers app isn't clear when in interactive mode

Currently when you generate an app it prompts you to run npm start. When in interactive mode that command doesn't work. As we migrate this to be the formal CLI tool we should:

  • have a run or start command
  • remove the commentary after the yeoman generator is complete

Support update notifications

Once we are able to disable update notifications from generator-feathers, we should provide the functionality directly in the cli.

Add service to manage file uploads

It would be awesome to be able to generate a service to manage file uploads. Maybe even ask wether the user wants to use S3 or just upload to a directory inside public/.

If the user selects S3, maybe prompt for AWS Key and Secret and then add that to the config file?

[3.0] Allow plugins

overview

Similarly to how git allows you to use the git-x namespace to extend functionality as needed, feathers-cli should support this too.

For example the generator should be added to bin as feathers-generate.

Feathers doesn't exit when generating a Generic Service

This is a low priority issue. After creating a generic service (no database) the CLI tool won't release the command prompt.

Steps to reproduce:

  1. Generate a new service using feathers generate service
  2. When prompted, enter the name you want to give it, then select generic and, finally, select wether or not you need auth.
  3. You'll see that Feathers generates the corresponding files and then the command prompt stays as local@mbp~$ (or whatever your hostname is). Trying to run ls results in an Invalid command error and displays all available commands.

Workaround:

Just hit Ctrl+c to exit manually.

Add default filters for real-time events if service is generated with authentication required

Currently if you create a service using feathers generate service with

Does your service require users to be authenticated? Yes

the following hooks are applied:

all: [
    auth.verifyToken(),
    auth.populateUser(),
    auth.restrictToAuthenticated()
  ]

The problem is there are no default filters for live events, which exposes a huge security threat for people using generator and not aware of this.

People can just connect to the server unauthorized and catch all created/update/etc. events:

feathers.service('messages').on('updated', function(obj) { console.log(obj); })

The generator should at least add a simple filter to the service like the one from the docs http://docs.feathersjs.com/real-time/filtering.html#filter-examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.