Code Monkey home page Code Monkey logo

vulcanjs-cli's Introduction


vulcanjs-banner
VulcanJS-cli

The official CLI scaffolding tool for VulcanJS.

Warning

This project is young. Use with caution. Always commit your code before using any program that modifies it.

Last tested on [Vulcan 1.14] (except for custom mutations and resolvers)

Table of Contents

Background

VulcanJS is a full stack javascript framework, built on Meteor, React and GraphQL. If you aren't familiar with VulcanJS, we highly recommend that you check out the website and read the docs.

With this cli, you'll be able to easily generate packages, modules, components, and routes for your VulcanJS project.

Install

Npm:

$ npm install -g vulcanjs-cli

Yarn:

$ yarn global add vulcanjs-cli

Usage

Create

Creates a new project with the given app name:

$ vulcan create <appName>

Generate

Generates a project component

  • Generate Package
$ vulcan g package <packageName>
  • Generate Module
$ vulcan g module <packageName> <moduleName>
  • Generate Component
$ vulcan g component <packageName> <moduleName> <componentName>
  • Generate Route
$ vulcan g route <packageName> <routeName> <routePath>

Remove

  • Remove Package
$ vulcan remove package <packageName>
  • Remove Module
$ vulcan remove module <packageName> <moduleName>

List

  • List Packages
$ vulcan list packages
  • List Routes
$ vulcan list routes

Maintainers

@mechanical-turk

@albancrommer

@SachaG

@eric-burel

Contribute

See CONTRIBUTE.md!

This package is in very low maintenance mode. If you encounter a bug or have a suggestion, feel free to open an issue, but we won't guarantee any fix.

PRs are always welcome however, even if incomplete or just a draft.

License

MIT © 2017 Kerem Kazan

vulcanjs-cli's People

Contributors

albancrommer avatar dependabot[bot] avatar eric-burel avatar luhagel avatar mechanical-turk avatar neobii avatar sachag 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulcanjs-cli's Issues

vulcan update command

I am posting this on behalf of dalerka on slack

Easy updating of Vulcan and vulcan-packages is very important for Dev eXperience, painful for beginners like myself. It'd be great to have cli-commands something like vulcan update to update the core or to latest release and vulcan update --all-packages for other vulcan:packages and maybe vulcan update --release @1.6.0 to revert to specific release.

Vulcan create <projectName>

vulcan create should create Vulcan projects without the getting started packages. Perhaps have two boilerplates for bootstrap or material-UI.

generating new route does not import component

Created a new package movies and created a module movies and component movies.

Executing vulcan g route movies root / asks for componentName, but it add a route to routes.js without importing the component first which results in

W20181124-22:59:13.033(0)? (STDERR) Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
W20181124-22:59:13.043(0)? (STDERR) Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
W20181124-22:59:13.043(0)? (STDERR)     in Movies
W20181124-22:59:13.044(0)? (STDERR)     in DummyErrorCatcher
W20181124-22:59:13.044(0)? (STDERR)     in div
W20181124-22:59:13.044(0)? (STDERR)     in Layout
W20181124-22:59:13.044(0)? (STDERR)     in div
W20181124-22:59:13.044(0)? (STDERR)     in IntlProvider
W20181124-22:59:13.044(0)? (STDERR)     in App
W20181124-22:59:13.044(0)? (STDERR)     in withCookies(Component)
W20181124-22:59:13.045(0)? (STDERR)     in withApollo(withCookies(Component))
W20181124-22:59:13.045(0)? (STDERR)     in withUpdateUser(withApollo(withCookies(Component)))
W20181124-22:59:13.045(0)? (STDERR)     in withSiteData(withUpdateUser(withApollo(withCookies(Component))))
W20181124-22:59:13.045(0)? (STDERR)     in withCurrentUser(withSiteData(withUpdateUser(withApollo(withCookies(Component)))))
W20181124-22:59:13.045(0)? (STDERR)     in RouterContext
W20181124-22:59:13.045(0)? (STDERR)     in CookiesProvider
W20181124-22:59:13.045(0)? (STDERR)     in QueryRecyclerProvider
W20181124-22:59:13.045(0)? (STDERR)     in ApolloProvider
W20181124-22:59:13.045(0)? (STDERR)     in StyleSheetManager
W20181124-22:59:13.046(0)? (STDERR) Error while server-rendering. date: Sat Nov 24 2018 22:59:13 GMT+0000 (GMT Standard Time) url: /
W20181124-22:59:13.070(0)? (STDERR) { Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
W20181124-22:59:13.071(0)? (STDERR)     at invariant (F:\Projects\js\notez\node_modules\react-dom\cjs\react-dom-server.node.development.js:58:15)
W20181124-22:59:13.071(0)? (STDERR)     at ReactDOMServerRenderer.render (F:\Projects\js\notez\node_modules\react-dom\cjs\react-dom-server.node.development.js:3321:7)
W20181124-22:59:13.071(0)? (STDERR)     at ReactDOMServerRenderer.read (F:\Projects\js\notez\node_modules\react-dom\cjs\react-dom-server.node.development.js:3057:29)
W20181124-22:59:13.071(0)? (STDERR)     at renderToString (F:\Projects\js\notez\node_modules\react-dom\cjs\react-dom-server.node.development.js:3524:27)
W20181124-22:59:13.072(0)? (STDERR)     at generateSSRData (packages/vulcan:routing/lib/server/router.jsx:58:14)
W20181124-22:59:13.072(0)? (STDERR)     at sendSSRHtml (packages/vulcan:routing/lib/server/router.jsx:86:45)
W20181124-22:59:13.072(0)? (STDERR)     at match (packages/vulcan:routing/lib/server/router.jsx:149:11)
W20181124-22:59:13.073(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\match.js:67:5
W20181124-22:59:13.073(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\createTransitionManager.js:108:11
W20181124-22:59:13.074(0)? (STDERR)     at done (F:\Projects\js\notez\node_modules\react-router\lib\AsyncUtils.js:79:19)
W20181124-22:59:13.074(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\AsyncUtils.js:85:7
W20181124-22:59:13.074(0)? (STDERR)     at getComponentsForRoute (F:\Projects\js\notez\node_modules\react-router\lib\getComponents.js:11:5)
W20181124-22:59:13.075(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\getComponents.js:35:5
W20181124-22:59:13.075(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\AsyncUtils.js:84:5
W20181124-22:59:13.075(0)? (STDERR)     at Array.forEach (<anonymous>)
W20181124-22:59:13.075(0)? (STDERR)     at mapAsync (F:\Projects\js\notez\node_modules\react-router\lib\AsyncUtils.js:83:9)
W20181124-22:59:13.076(0)? (STDERR)     at getComponents (F:\Projects\js\notez\node_modules\react-router\lib\getComponents.js:34:28)
W20181124-22:59:13.076(0)? (STDERR)     at finishEnterHooks (F:\Projects\js\notez\node_modules\react-router\lib\createTransitionManager.js:102:35)
W20181124-22:59:13.076(0)? (STDERR)     at runTransitionHooks (F:\Projects\js\notez\node_modules\react-router\lib\TransitionUtils.js:79:7)
W20181124-22:59:13.076(0)? (STDERR)     at runEnterHooks (F:\Projects\js\notez\node_modules\react-router\lib\TransitionUtils.js:112:12)
W20181124-22:59:13.076(0)? (STDERR)     at F:\Projects\js\notez\node_modules\react-router\lib\createTransitionManager.js:95:7
W20181124-22:59:13.077(0)? (STDERR)     at runTransitionHooks (F:\Projects\js\notez\node_modules\react-router\lib\TransitionUtils.js:79:7) name: 'Invariant Violation', framesToPop: 1 }

Fix: Importing the component before adding a route fixes the problem.

Install error

Running into this error when I try to install/update the CLI:

Sachas-MacBook-Pro-2:Dev sachagreif$ npm install -g vulcanjs-cli
npm ERR! Unexpected end of input at 1:21086
npm ERR! "test":"js/test"},"dist":{"shasum":"a9af79699742ac9a1b6fddc1fdbc78bc4
npm ERR!                                                                      ^

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sachagreif/.npm/_logs/2017-08-31T03_00_55_404Z-debug.log

Tolerate ":" in package name like vulcan does

Eg "myapp:core" will be translated as "myapp-core", while Vulcan uses this convention. This in counterintuitive. But beware, we also need a valid folder name, so we still need this translation for the file system.

vulcan start

Like we discussed in the Slack, it'd be great to have a vulcan start command that could be used instead of meteor, meteor run, or the current npm start (which is equivalent to meteor --settings settings.json).

In addition to the --settings flag, it'd be great to use the package_dirs variable to set up local package development.

Maybe when the user sets up the command line for the first time (or creates their first Vulcan project), they could be prompted with something like where would you like to store VulcanJS packages for local development? (default: ~/VulcanJS)?

Once this is done, we'll be able to split the repo in two: VulcanJS/Starter, which will contain the examples but not packages, and VulcanJS/Vulcan which only contains packages (and no .meteor directory). This should make getting started a lot easier without making it too hard to access Vulcan core code either.

Vulcan Cli General Improvements

Howdy,

I have a couple of suggestions for the cli:

  • vulcan create <appName> style=<bootstrap|material> pr
  • vulcan heroku, set up heroku / deploy to heroku
  • vulcan one2Many, hasOne resolvers on schema fields, creates basic fragments
  • vulcan many-to-many <denormalized> (denormalized)hasMany, resolvers on schema fields, creates basic fragments
  • vulcan many-to-many <normalized> creates relationship collection, hasMany, resolvers on schema fields, creates basic fragments
  • vulcan package update, right now one of the biggest headaches I see with Vulcan is managing dependencies. We should manage the base dependencies in these starter repos and keep them synced.
  • vulcan core newVersion “1.14.2” go through vulcan core and upgrade vulcan package versions
  • vulcan set-vulcan (one|two) this will set either workflow branch for devel (two repo install) or master (one repo install)

The vulcan cli is fast, but I'm finding that creating my n2n relations takes a bit of time. The relationship properties of schemas are documented, but there isn't much hinting about overall design patterns because they tend to change at this point in Vulcan development... this would be a good way to document the 🌋 way of getting things done.

More feedback

Using version 1.2.2, I noticed the following issues:

  • Routes use component: Components.Foo instead of componentName: 'Foo'
  • Routes use layoutName: 'Components.Foo' instead of layoutName: 'Foo'
  • Components still have indentation problems.
  • User group names are not pluralized (i.e. member instead of members).
  • I think the modules directory should remain named modules instead of models, since it can contain things other than models.

See also: https://www.twitch.tv/videos/161497431

Unable to npm start myapplication with node_modules/fibers/future.js:280 ERROR

Unable to npm start the app that i created by the tool and getting the following error.

`
=> Started proxy.
=> Started MongoDB.
W20180512-17:15:09.331(8)? (STDERR) /Users/kan/.meteor/packages/meteor-tool/.1.6.1_1.o8hqcq.5zvm++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20180512-17:15:09.542(8)? (STDERR) throw(ex);
W20180512-17:15:09.542(8)? (STDERR) ^
W20180512-17:15:09.543(8)? (STDERR)
W20180512-17:15:09.543(8)? (STDERR) TypeError: Class extends value undefined is not a constructor or null
W20180512-17:15:09.543(8)? (STDERR) at intl.js (packages/vulcan:lib/lib/server/intl.js:13:29)
W20180512-17:15:09.543(8)? (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9)
W20180512-17:15:09.544(8)? (STDERR) at require (packages/modules-runtime.js:238:16)
W20180512-17:15:09.544(8)? (STDERR) at main.js (packages/vulcan:lib/lib/server/main.js:1:824)
W20180512-17:15:09.544(8)? (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9)
W20180512-17:15:09.545(8)? (STDERR) at require (packages/modules-runtime.js:238:16)
W20180512-17:15:09.545(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/packages/vulcan_lib.js:5334:15
W20180512-17:15:09.545(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/packages/vulcan_lib.js:5341:3
W20180512-17:15:09.545(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:411:36
W20180512-17:15:09.546(8)? (STDERR) at Array.forEach ()
W20180512-17:15:09.546(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:220:19
W20180512-17:15:09.546(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:471:5
W20180512-17:15:09.546(8)? (STDERR) at Function.run (/Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/profile.js:510:12)
W20180512-17:15:09.547(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:470:11
=> Exited with code: 1
W20180512-17:15:21.234(8)? (STDERR) /Users/kan/.meteor/packages/meteor-tool/.1.6.1_1.o8hqcq.5zvm++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20180512-17:15:21.235(8)? (STDERR) throw(ex);
W20180512-17:15:21.235(8)? (STDERR) ^
W20180512-17:15:21.236(8)? (STDERR)
W20180512-17:15:21.236(8)? (STDERR) TypeError: Class extends value undefined is not a constructor or null
W20180512-17:15:21.236(8)? (STDERR) at intl.js (packages/vulcan:lib/lib/server/intl.js:13:29)
W20180512-17:15:21.236(8)? (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9)
W20180512-17:15:21.237(8)? (STDERR) at require (packages/modules-runtime.js:238:16)
W20180512-17:15:21.237(8)? (STDERR) at main.js (packages/vulcan:lib/lib/server/main.js:1:824)
W20180512-17:15:21.237(8)? (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9)
W20180512-17:15:21.237(8)? (STDERR) at require (packages/modules-runtime.js:238:16)
W20180512-17:15:21.237(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/packages/vulcan_lib.js:5334:15
W20180512-17:15:21.238(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/packages/vulcan_lib.js:5341:3
W20180512-17:15:21.238(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:411:36
W20180512-17:15:21.238(8)? (STDERR) at Array.forEach ()
W20180512-17:15:21.239(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:220:19
W20180512-17:15:21.239(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:471:5
W20180512-17:15:21.239(8)? (STDERR) at Function.run (/Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/profile.js:510:12)
W20180512-17:15:21.239(8)? (STDERR) at /Users/kan/Documents/kan/myapplication/.meteor/local/build/programs/server/boot.js:470:11
=> Exited with code: 1

`

Module that i have imported is
accounts-password 1.5.0* Password support for accounts myapplication 0.0.0+ vulcan:core 1.10.0+ Vulcan core package vulcan:debug 1.10.0+ Vulcan debug package vulcan:i18n-en-us 1.10.0+ Vulcan i18n package (en_US)

And i'm running the following version

`

meteor --version
Meteor 1.6.1.1
npm --v
5.6.0
node --version
v8.11.1
`

Anyone could shed some light please?

Generating Modules Creates Variable Conflict

Currently when you generate a module it does this:
collectionName: 'Movies', typeName: 'Movies',
instead of this:

collectionName: 'Movies', typeName: 'Movie',
causing this error: Error: Field "Query.movies" can only be defined once.

can't list packages or routes on existing project

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?

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.