forked from NetanelBasal/vue-generate-component
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from justgeek/development
release v1.1.0
- Loading branch information
Showing
26 changed files
with
1,286 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [Release] 1.1.0 | ||
### Added | ||
- Specify destination folder is now possible with `--dest <destination path>` option | ||
- Added showroom to easily test tool functionality (test with `npm link`) | ||
|
||
### Changed | ||
- Updated docs | ||
- Changed bin command to `vgcx` instead of `vgc` [Breaking] | ||
- Test files are now generated inside `__tests__` folder [To be optionated later] | ||
- Store,Action,Mutation,Getter files are now generated inside `store` folder | ||
|
||
## [Release] 1.0.0 | ||
### Added | ||
- Working MVP for basic vue project page generation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
export const {{name | camelCase}}Actions={ | ||
import { Commit } from 'vuex'; | ||
import { {{name | camelCase}}Mutations } from './{{name}}.mutations'; | ||
import { {{name | camelCase}}Store } from './{{name}}.store'; | ||
|
||
export const namespace = '{{name | camelCase}}Store'; | ||
|
||
export const {{name | camelCase}}Actions = { | ||
|
||
} | ||
|
||
export const {{name | camelCase}}ActionsMap = { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { {{name | PascalCase}}State } from './{{ name }}.store.{{ filesType.script }}'; | ||
|
||
export const {{name | camelCase}}Getters = { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { MutationTree } from 'vuex'; | ||
export const {{name | camelCase}}Mutations: MutationTree<any> = { | ||
// DO__SOME_ACTION(state: any, payload: entity[]) { | ||
// state.entity = payload; | ||
// }, | ||
}; | ||
import { {{name | camelCase}}State } from './{{name}}.store'; | ||
|
||
export const namespace = '{{name | camelCase}}Store'; | ||
|
||
export const {{name | camelCase}}Mutations = { | ||
|
||
} | ||
|
||
export const {{name | camelCase}}MutationsMap = { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { Module } from 'vuex'; | ||
import { {{name | camelCase}}Mutations } from 'from "./{{ name }}.mutations.{{ filesType.script }}";' | ||
import { {{name | camelCase}}Actions} from 'from "./{{ name }}.actions.{{ filesType.script }}";' | ||
class {{name | camelCase}}Store implements Module<any, any> { | ||
public state = { | ||
}; | ||
actions = { ...{{name | camelCase}}Actions} | ||
|
||
mutations = {...{{name | camelCase}}Mutations} | ||
import { {{name | camelCase}}Getters } from './{{ name }}.getters'; | ||
import { {{name | camelCase}}MutationsMap } from './{{ name }}.mutations'; | ||
import { {{name | camelCase}}ActionsMap } from './{{ name }}.actions'; | ||
|
||
export interface {{name | PascalCase}}State { | ||
|
||
} | ||
|
||
export default new {{name | camelCase}}Store(); | ||
export const {{name | camelCase}}State: {{name | PascalCase}}State = { | ||
|
||
}; | ||
|
||
export const {{name | camelCase}}Store = { | ||
state: {{name | camelCase}}State, | ||
getters: {...{{name | camelCase}}Getters}, | ||
actions: { ...{{name | camelCase}}ActionsMap }, | ||
mutations: { ...{{name | camelCase}}MutationsMap }, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue'; | ||
import { mount } from '@vue/test-utils' | ||
import {{name | PascalCase}}{{postfix | PascalCase}} from './{{name}}{% if postfix %}.{{postfix}}{% endif %}.{{ filesType.script }}'; | ||
|
||
describe('{{name | PascalCase}}{{postfix | PascalCase}}', () => { | ||
test('is a Vue instance', () => { | ||
const wrapper = mount({{name | PascalCase}}{{postfix | PascalCase}}) | ||
expect(wrapper.isVueInstance()).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"dest": "", | ||
"filesType": { | ||
"spec": "js", | ||
"test": "js", | ||
"script": "js", | ||
"actions": "js", | ||
"store": "js", | ||
"mutations": "js", | ||
"getters": "js", | ||
"html": "html", | ||
"style": "scss" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
import _ from 'lodash'; | ||
|
||
export default ( swig ) => { | ||
export default (swig) => { | ||
/* =============== | ||
Swig filters | ||
=============== */ | ||
swig.setFilter('kebabCase', function( input ) { | ||
swig.setFilter('kebabCase', function (input) { | ||
return _.kebabCase(input); | ||
}); | ||
|
||
swig.setFilter('camelCase', function( input ) { | ||
return _.capitalize(_.camelCase(input)); | ||
swig.setFilter('camelCase', function (input) { | ||
return _.camelCase(input); | ||
}); | ||
|
||
swig.setFilter('camelCaseOnly', function( input ) { | ||
return _.camelCase(input); | ||
swig.setFilter('PascalCase', function (input) { | ||
return _.capitalize(_.camelCase(input)); | ||
}); | ||
|
||
swig.setFilter('upperCase', function( input ) { | ||
swig.setFilter('upperCase', function (input) { | ||
return input.toUpperCase(); | ||
}); | ||
|
||
} | ||
|
||
/* CASES */ | ||
/* | ||
camelCase | ||
PascalCase | ||
snake_case | ||
kebab-case | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.