VulcanJS / vulcanjs-cli

The official cli scaffolding tool for VulcanJS
36 stars 9 forks source link

can't list packages or routes on existing project #14

Closed klokie closed 7 years ago

klokie commented 7 years ago

Hi, this is a great initiative! I'm having trouble getting it to work on either of two existing Vulcan sites. Here's the dump:

$ vulcan list packages
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module './listers/undefined'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.resolve (internal/module.js:18:19)
    at _class.composing (/usr/local/lib/node_modules/vulcanjs-cli/dist/generator-vulcanjs/generators/list/index.js:52:28)
    at Object.<anonymous> (/usr/local/lib/node_modules/vulcanjs-cli/node_modules/yeoman-generator/lib/index.js:417:23)
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/run-async/index.js:25:25
    at Promise (<anonymous>)
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/run-async/index.js:24:19
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/yeoman-generator/lib/index.js:418:9
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)

Same thing with

$ vulcan list routes
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module './listers/undefined'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.resolve (internal/module.js:18:19)
    at _class.composing (/usr/local/lib/node_modules/vulcanjs-cli/dist/generator-vulcanjs/generators/list/index.js:52:28)
    at Object.<anonymous> (/usr/local/lib/node_modules/vulcanjs-cli/node_modules/yeoman-generator/lib/index.js:417:23)
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/run-async/index.js:25:25
    at Promise (<anonymous>)
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/run-async/index.js:24:19
    at /usr/local/lib/node_modules/vulcanjs-cli/node_modules/yeoman-generator/lib/index.js:418:9
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)

Where are these listers supposed to come from?

mechanical-turk commented 7 years ago

hi @klokie. when did you start this vulcan project? did you use the cli to build it?

currently, the way the cli works is that for every action you take, it stores some meta data in a file called .yo-rc.json, which is stored in the root of your project. The list method merely reads from this metadata and presents it in a nice way.

Therefore if you have created the routes or the packages without using the cli tool, the list command cannot show them.

mechanical-turk commented 7 years ago

That being said, you shouldn't be getting the Cannot find module './listers/undefined' error. Why don't you update your cli to the latest version and let me know what errors you get

klokie commented 7 years ago

Ok, the project was started prior to the existence of the CLI, so I guess it won't work without some changes to the underlying Yeoman setup. FYI I get the same error with the latest version ("3.0.10").

mechanical-turk commented 7 years ago

@klokie thanks for checkin in. it seems to be working fine for me, so it is probably due to how you didnt use the cli before. if you want to use the cli from now on, go to the root of the project, and run vulcan init. That will place that yo-rc.json file to the root, and start recording the cli actions afterwards.

feel free to close the issue or ask more.

klokie commented 7 years ago

Got it, thanks.