Skip to content

Vuejs generator #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Sep 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e9a6180
Added Vue.js generator
alOneh Sep 15, 2017
827e01b
Added api templates for Vue.js generator
alOneh Sep 15, 2017
66d496a
Added list module template for Vue.js
alOneh Sep 15, 2017
c8c8f92
Fixed the modules path
alOneh Sep 15, 2017
74b1a8f
Updated list store module for foo
alOneh Sep 15, 2017
b89c181
Added create module store for foo
alOneh Sep 15, 2017
2f22dc3
Added update module store for foo
alOneh Sep 15, 2017
36dbcf2
Added show store module for foo
alOneh Sep 15, 2017
cec2438
Added delete store module for foo
alOneh Sep 15, 2017
78bf55c
Improve the VueCrudGenerator
alOneh Sep 15, 2017
ec0c66d
Fix store module
alOneh Sep 15, 2017
726ea4a
Added routes template for vue
alOneh Sep 15, 2017
adaa3b3
Updated list store module for foo
alOneh Sep 16, 2017
90ed6f6
Added foo List component
alOneh Sep 16, 2017
f7aa44b
Namespaced foo store module
alOneh Sep 17, 2017
6f73ef7
Fixed foo store delete module
alOneh Sep 17, 2017
131204f
Fixed foo store show module
alOneh Sep 17, 2017
a46e06c
Cleanup foo store module update
alOneh Sep 17, 2017
2d92c52
Added template for foo show component
alOneh Sep 17, 2017
729e6c7
Fixed List.vue
alOneh Sep 17, 2017
e14cc71
Fixed delete store module
alOneh Sep 17, 2017
aac5f04
Fixed show store module
alOneh Sep 17, 2017
a1b37c1
Added Create.vue
alOneh Sep 19, 2017
3a4d928
Added Update.vue
alOneh Sep 20, 2017
a028642
Fix the icon of edit link on List.vue
alOneh Sep 20, 2017
cf27239
Refactored mutations syntax
alOneh Sep 20, 2017
338d2dc
Added mutation-types
alOneh Sep 20, 2017
c1149ef
Use commit instead of dispatch
alOneh Sep 21, 2017
1fb9fe7
Fix loading on List.vue
alOneh Sep 21, 2017
bde1276
Fix List.vue pagination
alOneh Sep 21, 2017
55369b5
Fix VueCrudGenerator
alOneh Sep 21, 2017
3b0db53
Fix Update.vue FormComponent syntax
alOneh Sep 21, 2017
9cb4a73
Fix missing SubmissionError
alOneh Sep 21, 2017
81419f7
Fix
alOneh Sep 21, 2017
091776e
Move fetch to utils
alOneh Sep 22, 2017
3ae4c9f
Update the documentation for VueCrudGenerator
alOneh Sep 22, 2017
bfb71fb
Added VueCrudGenerator.test
alOneh Sep 22, 2017
5985ec3
Updated test-gen command
alOneh Sep 22, 2017
c03c91f
Removed *Fetch.js
alOneh Sep 22, 2017
bdfea11
Cleanup store module update.js
alOneh Sep 22, 2017
2ba8e03
Removed prefix of fetch() in compoments
alOneh Sep 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/generators/VueCrudGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export default class VueCrudGenerator {
this.registerTemplate(templatePath, 'store/modules/foo/show.js');
this.registerTemplate(templatePath, 'store/modules/foo/mutation-types.js');

// api
this.registerTemplate(templatePath, 'api/fooFetch.js');

// components
this.registerTemplate(templatePath, 'components/foo/Create.vue');
this.registerTemplate(templatePath, 'components/foo/Form.vue');
Expand Down Expand Up @@ -92,7 +89,6 @@ export const store = new Vuex.Store({

// Create directories
// These directories may already exist
mkdirp.sync(`${dir}/api`);
mkdirp.sync(`${dir}/config`);
mkdirp.sync(`${dir}/routes`);
mkdirp.sync(`${dir}/utils`);
Expand All @@ -109,9 +105,6 @@ export const store = new Vuex.Store({
this.createFile('store/modules/foo/show.js', `${dir}/store/modules/${lc}/show.js`, context);
this.createFile('store/modules/foo/mutation-types.js', `${dir}/store/modules/${lc}/mutation-types.js`, context);

// api
this.createFile('api/fooFetch.js', `${dir}/api/${lc}Fetch.js`, context);

// components
this.createFile('components/foo/Create.vue', `${dir}/components/${lc}/Create.vue`, context);
this.createFile('components/foo/Form.vue', `${dir}/components/${lc}/Form.vue`, context);
Expand Down
2 changes: 0 additions & 2 deletions src/generators/VueCrudGenerator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ test('Generate a Vue app', () => {
});
generator.generate(api, resource, tmpobj.name);

expect(fs.existsSync(tmpobj.name+'/api/abcFetch.js'), true);

expect(fs.existsSync(tmpobj.name+'/components/abc/Create.vue'), true);
expect(fs.existsSync(tmpobj.name+'/components/abc/Form.vue'), true);
expect(fs.existsSync(tmpobj.name+'/components/abc/List.vue'), true);
Expand Down
3 changes: 0 additions & 3 deletions templates/vue/api/fooFetch.js

This file was deleted.

2 changes: 1 addition & 1 deletion templates/vue/store/modules/foo/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SubmissionError from '../../../error/SubmissionError';
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch';
import {{{ lc }}}Fetch from '../../../utils/fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to name Fetch function to the componenet ?

import {
{{{ uc }}}_CREATE_ERROR,
{{{ uc }}}_CREATE_LOADING,
Expand Down
2 changes: 1 addition & 1 deletion templates/vue/store/modules/foo/delete.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch';
import {{{ lc }}}Fetch from '../../../utils/fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to name Fetch function to the componenet ?

import {
{{{ uc }}}_DELETE_ERROR,
{{{ uc }}}_DELETE_LOADING,
Expand Down
2 changes: 1 addition & 1 deletion templates/vue/store/modules/foo/list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch';
import {{{ lc }}}Fetch from '../../../utils/fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to name Fetch function to the componenet ?

import {
{{{ uc }}}_LIST_ERROR,
{{{ uc }}}_LIST_LOADING,
Expand Down
2 changes: 1 addition & 1 deletion templates/vue/store/modules/foo/show.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch';
import {{{ lc }}}Fetch from '../../../utils/fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to name Fetch function to the componenet ?

import {
{{{ uc }}}_SHOW_ERROR,
{{{ uc }}}_SHOW_LOADING,
Expand Down
2 changes: 1 addition & 1 deletion templates/vue/store/modules/foo/update.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SubmissionError from '../../../error/SubmissionError';
import {{{ lc }}}Fetch from '../../../api/{{{ lc }}}Fetch';
import {{{ lc }}}Fetch from '../../../utils/fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to name Fetch function to the componenet ?

import {
{{{ uc }}}_UPDATE_RESET,
{{{ uc }}}_UPDATE_UPDATE_ERROR,
Expand Down