├── .gitignore
├── CONTRIBUTE.md
├── Gruntfile.js
├── README.md
├── dist
├── argsManager.js
├── generator-vulcanjs
│ ├── generators
│ │ ├── app
│ │ │ └── index.js
│ │ ├── component
│ │ │ ├── index.js
│ │ │ └── templates
│ │ │ │ ├── classComponent.js
│ │ │ │ ├── partials
│ │ │ │ ├── registerComponent.js
│ │ │ │ └── registerComponentImport.js
│ │ │ │ └── pureFunctionComponent.js
│ │ ├── list
│ │ │ ├── index.js
│ │ │ └── listers
│ │ │ │ └── packages.js
│ │ ├── module
│ │ │ ├── fragments
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ └── fragments.js
│ │ │ ├── index.js
│ │ │ ├── mutations
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ └── mutations.js
│ │ │ ├── resolvers
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ ├── partials
│ │ │ │ │ ├── listResolver.js
│ │ │ │ │ └── singleResolver.js
│ │ │ │ │ └── resolvers.js
│ │ │ ├── schema
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ ├── partials
│ │ │ │ │ └── schemaProperty.js
│ │ │ │ │ └── schema.js
│ │ │ └── templates
│ │ │ │ ├── collection.js
│ │ │ │ ├── generic-test.js
│ │ │ │ └── stories.js
│ │ ├── package
│ │ │ ├── index.js
│ │ │ └── templates
│ │ │ │ ├── client.js
│ │ │ │ ├── collections.js
│ │ │ │ ├── components.js
│ │ │ │ ├── modules.index.js
│ │ │ │ ├── package.js
│ │ │ │ ├── routes.js
│ │ │ │ ├── seed.js
│ │ │ │ └── server.js
│ │ ├── remove
│ │ │ ├── index.js
│ │ │ └── removers
│ │ │ │ ├── module.js
│ │ │ │ ├── package.js
│ │ │ │ └── route.js
│ │ ├── route
│ │ │ └── index.js
│ │ └── start
│ │ │ └── index.js
│ └── lib
│ │ ├── VulcanGenerator.js
│ │ ├── assertions.js
│ │ ├── ast.js
│ │ ├── common.js
│ │ ├── filters.js
│ │ ├── finalizers.js
│ │ ├── lister.js
│ │ ├── optionsManager.js
│ │ ├── path-finder.js
│ │ ├── questions.js
│ │ ├── reducers.js
│ │ ├── repairs.js
│ │ ├── store.js
│ │ ├── styles.js
│ │ ├── ui-text.js
│ │ └── validations.js
└── index.js
├── media
├── logo-plain.png
└── usage
│ ├── create.gif
│ ├── generate-component.gif
│ ├── generate-custom-model.gif
│ ├── generate-default-model.gif
│ ├── generate-package.gif
│ ├── generate-route.gif
│ ├── list-packages.gif
│ ├── list-routes.gif
│ ├── remove-model.gif
│ └── remove-package.gif
├── package-lock.json
├── package.json
├── src
├── .eslintrc.js
├── argsManager.js
├── generator-vulcanjs
│ ├── .DS_Store
│ ├── .gitignore
│ ├── generators
│ │ ├── app
│ │ │ └── index.js
│ │ ├── component
│ │ │ ├── index.js
│ │ │ └── templates
│ │ │ │ ├── classComponent.js
│ │ │ │ ├── partials
│ │ │ │ ├── registerComponent.js
│ │ │ │ └── registerComponentImport.js
│ │ │ │ └── pureFunctionComponent.js
│ │ ├── list
│ │ │ ├── index.js
│ │ │ └── listers
│ │ │ │ └── packages.js
│ │ ├── module
│ │ │ ├── fragments
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ └── fragments.js
│ │ │ ├── index.js
│ │ │ ├── mutations
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ └── mutations.js
│ │ │ ├── resolvers
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ ├── partials
│ │ │ │ │ ├── listResolver.js
│ │ │ │ │ └── singleResolver.js
│ │ │ │ │ └── resolvers.js
│ │ │ ├── schema
│ │ │ │ ├── index.js
│ │ │ │ └── templates
│ │ │ │ │ ├── partials
│ │ │ │ │ └── schemaProperty.js
│ │ │ │ │ └── schema.js
│ │ │ └── templates
│ │ │ │ ├── collection.js
│ │ │ │ ├── generic-test.js
│ │ │ │ └── stories.js
│ │ ├── package
│ │ │ ├── index.js
│ │ │ └── templates
│ │ │ │ ├── client.js
│ │ │ │ ├── collections.js
│ │ │ │ ├── components.js
│ │ │ │ ├── modules.index.js
│ │ │ │ ├── package.js
│ │ │ │ ├── routes.js
│ │ │ │ ├── seed.js
│ │ │ │ └── server.js
│ │ ├── remove
│ │ │ ├── index.js
│ │ │ └── removers
│ │ │ │ ├── module.js
│ │ │ │ ├── package.js
│ │ │ │ └── route.js
│ │ ├── route
│ │ │ └── index.js
│ │ └── start
│ │ │ └── index.js
│ └── lib
│ │ ├── VulcanGenerator.js
│ │ ├── assertions.js
│ │ ├── ast.js
│ │ ├── common.js
│ │ ├── filters.js
│ │ ├── finalizers.js
│ │ ├── lister.js
│ │ ├── optionsManager.js
│ │ ├── path-finder.js
│ │ ├── questions.js
│ │ ├── reducers.js
│ │ ├── repairs.js
│ │ ├── store.js
│ │ ├── styles.js
│ │ ├── ui-text.js
│ │ └── validations.js
└── index.js
├── test
└── semi-automatic.sh
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .DS_Store
3 | /nbproject
4 |
--------------------------------------------------------------------------------
/CONTRIBUTE.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 | - Once you pull the repo, don't forget to run `npm install`.
3 | - In the project root, run `npm run watch`
4 | - Do not work on the root. Make your changes in the `/src` directory.
5 | - Grunt will compile your code into the root directory (`/dist`).
6 | - PRs are always welcome!
7 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = (grunt) => {
2 | grunt.initConfig({
3 | babel: {
4 | options: {
5 | // sourceMap: true,
6 | presets: ['es2015'],
7 | plugins: [
8 | 'transform-object-rest-spread',
9 | // 'transform-es2015-modules-commonjs',
10 | 'transform-es2015-shorthand-properties',
11 | ],
12 | },
13 | dist: {
14 | files: [{
15 | expand: true,
16 | cwd: './src/',
17 | src: ['**/*.js', '!**/templates/**'],
18 | dest: './dist/',
19 | }],
20 | },
21 | },
22 | copy: {
23 | templates: {
24 | files: [{
25 | expand: true,
26 | cwd: './src/generator-vulcanjs/',
27 | src: ['**/templates/**'],
28 | dest: './dist/generator-vulcanjs/',
29 | }],
30 | },
31 | },
32 | clean: {
33 | dist: {
34 | src: ['./dist']
35 | }
36 | },
37 | watch: {
38 | src: {
39 | files: ['src/**/*.*',],
40 | tasks: ['default'],
41 | options: {
42 | interrupt: true,
43 | },
44 | },
45 | },
46 | });
47 |
48 | grunt.loadNpmTasks('grunt-babel');
49 | grunt.loadNpmTasks('grunt-contrib-clean');
50 | grunt.loadNpmTasks('grunt-contrib-copy');
51 | grunt.loadNpmTasks('grunt-contrib-watch');
52 |
53 | grunt.registerTask(
54 | 'default',
55 | [
56 | 'clean',
57 | 'babel',
58 | 'copy',
59 | 'chmod'
60 | ]
61 | );
62 | grunt.registerTask('chmod', 'Fixes permissions', function() {
63 | var fs = require('fs');
64 | fs.chmodSync('./dist/index.js', '775');
65 | });
66 |
67 | };
68 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | VulcanJS-cli
6 |
7 |
8 |
9 | The official CLI scaffolding tool for VulcanJS.
10 |
11 | ## Warning
12 |
13 | This project is young. Use with caution. Always commit your code before using any program that modifies it.
14 |
15 | Last tested on [Vulcan 1.14] (except for custom mutations and resolvers)
16 |
17 | ## Table of Contents
18 |
19 | - [Warning](#warning)
20 | - [Table of Contents](#table-of-contents)
21 | - [Background](#background)
22 | - [Install](#install)
23 | - [Usage](#usage)
24 | - [Create](#create)
25 | - [Generate](#generate)
26 | - [Remove](#remove)
27 | - [List](#list)
28 | - [Maintainers](#maintainers)
29 | - [Contribute](#contribute)
30 | - [License](#license)
31 |
32 | ## Background
33 |
34 | 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.
35 |
36 | With this cli, you'll be able to easily generate `packages`, `modules`, `components`, and `routes` for your VulcanJS project.
37 |
38 | ## Install
39 |
40 | Npm:
41 |
42 | ```sh
43 | $ npm install -g vulcanjs-cli
44 | ```
45 |
46 | Yarn:
47 |
48 | ```sh
49 | $ yarn global add vulcanjs-cli
50 | ```
51 |
52 | ## Usage
53 |
54 | ### Create
55 |
56 | Creates a new project with the given app name:
57 |
58 | ```sh
59 | $ vulcan create
60 | ```
61 |
62 | ### Generate
63 |
64 | Generates a project component
65 |
66 | - Generate Package
67 |
68 | ```sh
69 | $ vulcan g package
70 | ```
71 |
72 | - Generate Module
73 |
74 | ```sh
75 | $ vulcan g module
76 | ```
77 |
78 | - Generate Component
79 |
80 | ```sh
81 | $ vulcan g component
82 | ```
83 |
84 | - Generate Route
85 |
86 | ```sh
87 | $ vulcan g route
88 | ```
89 |
90 | ### Remove
91 |
92 | - Remove Package
93 |
94 | ```sh
95 | $ vulcan remove package
96 | ```
97 |
98 | - Remove Module
99 |
100 | ```sh
101 | $ vulcan remove module
102 | ```
103 |
104 | ### List
105 |
106 | - List Packages
107 |
108 | ```sh
109 | $ vulcan list packages
110 | ```
111 |
112 | - List Routes
113 |
114 | ```sh
115 | $ vulcan list routes
116 | ```
117 |
118 | ## Maintainers
119 |
120 | [@mechanical-turk](https://github.com/mechanical-turk)
121 |
122 | [@albancrommer](https://github.com/albancrommer)
123 |
124 | [@SachaG](https://github.com/SachaG)
125 |
126 | [@eric-burel](https://github.com/eric-burel)
127 |
128 | ## Contribute
129 |
130 | See [CONTRIBUTE.md](./CONTRIBUTE.md)!
131 |
132 | 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.
133 |
134 | PRs are always welcome however, even if incomplete or just a draft.
135 |
136 | ## License
137 |
138 | MIT © 2017 Kerem Kazan
139 |
--------------------------------------------------------------------------------
/dist/argsManager.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var minimist = require('minimist');
4 | var _ = require('lodash');
5 | var chalk = require('chalk');
6 |
7 | var recognizedActions = {
8 | generate: 'generate',
9 | g: 'generate',
10 | create: 'create',
11 | c: 'create',
12 | remove: 'remove',
13 | r: 'remove',
14 | list: 'list',
15 | l: 'list',
16 | un: 'unshallow',
17 | unshallow: 'unshallow',
18 | start: 'start'
19 | };
20 |
21 | var genericProcessor = function genericProcessor(args) {
22 | var argsToProcess = args.slice(1);
23 | var action = {
24 | type: recognizedActions[args[0]],
25 | args: []
26 | };
27 | if (argsToProcess.length > 0) {
28 | action.component = argsToProcess[0];
29 | }
30 | argsToProcess.shift();
31 | if (argsToProcess.length > 0) {
32 | action.args = argsToProcess;
33 | }
34 | return action;
35 | };
36 |
37 | var createProcessor = function createProcessor(args) {
38 | return {
39 | type: 'create',
40 | args: args.slice(1)
41 | };
42 | };
43 |
44 | var argsProcessors = {
45 | generate: genericProcessor,
46 | remove: genericProcessor,
47 | list: genericProcessor,
48 | create: createProcessor,
49 | start: genericProcessor
50 | };
51 |
52 | function usage() {
53 | var values = _.uniq(_.values(recognizedActions));
54 | console.log(chalk.green('\nvulcan usage:'));
55 | console.log(chalk.grey('\nSynopsis'));
56 | console.log(' vulcan