Skip to content

Commit 3ca24b1

Browse files
author
Fabs
committed
Use library. Fix window path. Update template variables and documentation
1 parent 4d7af62 commit 3ca24b1

28 files changed

+125
-235
lines changed

CHANGE-NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
- v0.6.0 Use component-creator-lib
2+
- Fix windows paths
3+
- Update documentation
4+
- Add camelcase and pascalcase variables for templates
15
- v0.5.0 Checkboxes checked by default can be configured in the settings
26
- v0.4.0 Add Customisable templates. Improve a lot of code. Update doc
37
- v0.2.1 Export enum for action types

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
![Rating](https://img.shields.io/jetbrains/plugin/r/rating/13965-react-component-creator?style=for-the-badge)
66

77

8-
- An Brainstorm Plugin to create a new react functional component with all additional files like
9-
SCSS, Spec, Storybook.
10-
- Add Redux reducer module with actions, mutations, state and types.
11-
- Add custom templates to match your coding style and your needs.
8+
An Brainstorm Plugin to create a new react functional component with all additional files like
9+
SCSS, Spec, Storybook. Add Redux reducer module with actions, mutations, state and types.
10+
Add custom templates to match your coding style and your needs.
1211

1312

14-
![Settings](https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/settings.png?raw=true "")
15-
![Create component](https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/create_component.gif?raw=true "")
16-
![Create Reducer](https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/create_reducer.gif?raw=true "")
13+
![Settings](https://github.com/component-creator-plugin/react-component-creator-plugin/blob/master/doc/settings.png?raw=true "")
14+
![Create component](https://github.com/component-creator-plugin/react-component-creator-plugin/blob/master/doc/create_component.gif?raw=true "")
15+
![Create Reducer](https://github.com/component-creator-plugin/react-component-creator-plugin/blob/master/doc/create_reducer.gif?raw=true "")
1716

1817
# Install
19-
Search for `React Component Creator` in the plugins settings. Or download the plugin from the [release site](https://github.com/faebeee/react-component-creator-plugin/releases)
18+
Search for `React Component Creator` in the plugins settings. Or download the plugin from the [release site](https://github.com/component-creator-plugin/react-component-creator-plugin/releases)
2019

2120
# Custom Templates
2221
If you are not happy with the predefined templates, you can choose your
@@ -31,17 +30,18 @@ Following variables are available
3130
| variable | Description |
3231
|---|---|
3332
| {{componentName}} | the inputted component name. Without any alterations |
34-
| {{componentCamelcaseName}} | Camelcased input `my-component` becomes `MyComponent` |
33+
| {{componentNameCamelCase}} | camelcased input `my-component` becomes `myComponent` |
34+
| {{componentNamePascalCase}} | pascalcased input `my-component` becomes `MyComponent` |
3535

3636
**Reducer**
3737

3838
| variable | Description |
3939
|---|---|
40+
| {{componentName}} | Name of the folder |
41+
| {{componentNameCamelCase}} | camelcased input `my-component` becomes `myComponent` |
42+
| {{componentNamePascalCase}} | pascalcased input `my-component` becomes `MyComponent` |
4043
| {{actionFunctionName}} | Name of the function inside the `actions.ts` file |
41-
| {{moduleName}} | Name of the folder |
4244
| {{mutationType}} | String which will be used as type of the dispatch/mutation |
43-
| {{moduleNamePascalCase}} | Pascalcased moduleName |
44-
| {{stateName}} | Name for the state. `my-component` becomes `MyComponentState` |
4545
| {{actionTypeName}} | Takes the input of `actionFunctionName` and capitalizes the first letter and appends `Action`. From `setData` becomes `SetDataAction` |
4646
| {{actionTypesEnumName}} | Name used for the action types enum. actionTypesEnumName is the namespace where all `mutationType` actions are kept |
4747

lib/component-creator-lib.jar

1.15 KB
Binary file not shown.

resources/META-INF/plugin.xml

Lines changed: 26 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>com.faebeee.reactcomponentcreator</id>
33
<name>React Component Creator</name>
4-
<version>0.5.0</version>
4+
<version>0.6.0</version>
55
<vendor email="[email protected]" url="http://fabs.io">Fabio Gianini</vendor>
66

77
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
@@ -13,112 +13,73 @@
1313
<depends>com.intellij.modules.lang</depends>
1414
<description>
1515
<![CDATA[
16-
<h1><a href="#react-component-creator" id="react-component-creator">react-component-creator</a></h1>
17-
<p><img src="https://img.shields.io/jetbrains/plugin/d/13965-react-component-creator?style=for-the-badge" alt="Downloads" />
18-
<img src="https://img.shields.io/jetbrains/plugin/v/13965-react-component-creator?style=for-the-badge" alt="Version" />
19-
<img src="https://img.shields.io/jetbrains/plugin/r/rating/13965-react-component-creator?style=for-the-badge" alt="Rating" /></p>
20-
<ul>
21-
<li>An Brainstorm Plugin to create a new react functional component with all additional files like
22-
SCSS, Spec, Storybook.</li>
23-
<li>Add Redux reducer module with actions, mutations, state and types.</li>
24-
<li>Add custom templates to match your coding style and your needs.</li>
25-
</ul>
26-
<p><img src="https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/settings.png?raw=true" alt="Settings" title="" />
27-
<img src="https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/create_component.gif?raw=true" alt="Create component" title="" />
28-
<img src="https://github.com/faebeee/react-component-creator-plugin/blob/master/doc/create_reducer.gif?raw=true" alt="Create Reducer" title="" /></p>
29-
<h1><a href="#install" id="install">Install</a></h1>
30-
<p>Search for <code>React Component Creator</code> in the plugins settings. Or download the plugin from the <a href="https://github.com/faebeee/react-component-creator-plugin/releases">release site</a></p>
31-
<h1><a href="#custom-templates" id="custom-templates">Custom Templates</a></h1>
32-
<p>If you are not happy with the predefined templates, you can choose your
33-
own templates. The templates will be processed with mustache as templating.
34-
All variables can also be used for the filenames.</p>
35-
<p>Following variables are available</p>
36-
<p><strong>Component</strong></p>
37-
<table>
38-
<thead>
39-
<tr><th> variable </th><th> Description </th></tr>
40-
</thead>
41-
<tbody>
42-
<tr><td> {{componentName}} </td><td> the inputted component name. Without any alterations </td></tr>
43-
<tr><td> {{componentCamelcaseName}} </td><td> Camelcased input <code>my-component</code> becomes <code>MyComponent</code> </td></tr>
44-
</tbody>
45-
</table>
46-
<p><strong>Reducer</strong></p>
47-
<table>
48-
<thead>
49-
<tr><th> variable </th><th> Description </th></tr>
50-
</thead>
51-
<tbody>
52-
<tr><td> {{actionFunctionName}} </td><td> Name of the function inside the <code>actions.ts</code> file </td></tr>
53-
<tr><td> {{moduleName}} </td><td> Name of the folder </td></tr>
54-
<tr><td> {{mutationType}} </td><td> String which will be used as type of the dispatch/mutation </td></tr>
55-
<tr><td> {{moduleNamePascalCase}} </td><td> Pascalcased moduleName </td></tr>
56-
<tr><td> {{stateName}} </td><td> Name for the state. <code>my-component</code> becomes <code>MyComponentState</code> </td></tr>
57-
<tr><td> {{actionTypeName}} </td><td> Takes the input of <code>actionFunctionName</code> and capitalizes the first letter and appends <code>Action</code>. From <code>setData</code> becomes <code>SetDataAction</code> </td></tr>
58-
<tr><td> {{actionTypesEnumName}} </td><td> Name used for the action types enum. actionTypesEnumName is the namespace where all <code>mutationType</code> actions are kept </td></tr>
59-
</tbody>
60-
</table>
61-
<h1><a href="#development" id="development">Development</a></h1>
62-
<p>Follow the <a href="./doc/DEVELOPMENT.md">Setup Instructions</a></p>
63-
<h1><a href="#icons" id="icons">Icons</a></h1>
64-
<p>Icons provided by <a href="https://www.iconfinder.com/justicon">https://www.iconfinder.com/justicon</a> via <a href="https://www.iconfinder.com">https://www.iconfinder.com</a></p>
16+
An Brainstorm Plugin to create a new react functional component with all additional files like
17+
SCSS, Spec, Storybook. Add Redux reducer module with actions, mutations, state and types.
18+
Add custom templates to match your coding style and your needs.
6519
]]>
6620
</description>
6721

6822
<change-notes>
6923
<![CDATA[
7024
<ul>
71-
<li>v0.5.0 Checkboxes checked by default can be configured in the settings</li>
72-
<li>v0.4.0 Add Customisable templates. Improve a lot of code. Update doc</li>
73-
<li>v0.2.1 Export enum for action types</li>
74-
<li>v0.2.1 Export enum for action types</li>
75-
<li>v0.2.0 Add <code>Add Redux Reducer</code> Action</li>
76-
<li>v0.1.0 Add <code>Add React Component</code> Action</li>
25+
<li>v0.6.0 Use component-creator-lib
26+
<ul>
27+
<li>Fix windows paths</li>
28+
<li>Update documentation</li>
29+
<li>Add camelcase and pascalcase variables for templates</li>
30+
</ul>
31+
</li>
32+
<li>v0.5.0 Checkboxes checked by default can be configured in the settings</li>
33+
<li>v0.4.0 Add Customisable templates. Improve a lot of code. Update doc</li>
34+
<li>v0.2.1 Export enum for action types</li>
35+
<li>v0.2.1 Export enum for action types</li>
36+
<li>v0.2.0 Add <code>Add Redux Reducer</code> Action</li>
37+
<li>v0.1.0 Add <code>Add React Component</code> Action</li>
7738
</ul>
7839
]]>
7940
</change-notes>
8041

8142

8243
<extensions defaultExtensionNs="com.intellij">
8344
<projectConfigurable
84-
instance="fabs.react.component.settings.ComponentSettings"
45+
instance="io.fabs.react.component.settings.ComponentSettings"
8546
id="rcc.settings"
8647
displayName="React Component Creator"
8748
nonDefaultProject="true"/>
8849

8950
<projectConfigurable
90-
instance="fabs.react.reducer.settings.ReducerSettings"
51+
instance="io.fabs.react.reducer.settings.ReducerSettings"
9152
id="rcc.settings.redux"
9253
displayName="Redux"
9354
parentId="rcc.settings"
9455
nonDefaultProject="true"/>
9556

9657
<projectConfigurable
97-
instance="fabs.react.component.settings.ComponentSettings"
58+
instance="io.fabs.react.component.settings.ComponentSettings"
9859
id="rcc.settings.component"
9960
displayName="Component"
10061
parentId="rcc.settings"
10162
nonDefaultProject="true"/>
10263

103-
<projectService serviceInterface="fabs.react.reducer.data.ReducerSettingsState"
104-
serviceImplementation="fabs.react.reducer.data.ReducerSettingsState"/>
64+
<projectService serviceInterface="io.fabs.react.reducer.data.ReducerSettingsState"
65+
serviceImplementation="io.fabs.react.reducer.data.ReducerSettingsState"/>
10566

106-
<projectService serviceInterface="fabs.react.component.data.ComponentSettingsState"
107-
serviceImplementation="fabs.react.component.data.ComponentSettingsState"/>
67+
<projectService serviceInterface="io.fabs.react.component.data.ComponentSettingsState"
68+
serviceImplementation="io.fabs.react.component.data.ComponentSettingsState"/>
10869
</extensions>
10970

11071
<actions>
11172
<group description="React" id="React">
11273
<separator/>
11374
<action id="ReactComponent.ComponentCreatorAction"
114-
class="fabs.react.component.action.ComponentCreatorAction"
75+
class="io.fabs.react.component.action.ComponentCreatorAction"
11576
icon="/icons/component.png"
11677
text="React component"
11778
description="create new react component">
11879
</action>
11980

12081
<action id="ReactComponent.ReducerCreatorAction"
121-
class="fabs.react.reducer.action.ReducerCreatorAction"
82+
class="io.fabs.react.reducer.action.ReducerCreatorAction"
12283
icon="/icons/store.png"
12384
text="Redux reducer"
12485
description="create new redux reducer">
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
.{{ componentName }} {
2-
// Vars
32
4-
// Support
5-
6-
// Module
7-
& {
8-
//
9-
}
10-
11-
// Facets
12-
13-
// States
143
}

resources/templates/component/{{componentName}}.md.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# {{ componentCamelcaseName }}
1+
# {{ componentNameCamelCase }}
22

33
Description of component
44

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import { expect } from 'chai';
3-
import {{ componentCamelcaseName }} from './{{ componentName }}';
3+
import {{ componentNamePascalCase }} from './{{ componentName }}';
44

5-
describe('{{ componentName }}', function {{ componentCamelcaseName }}Spec () {
5+
describe('Spec {{ componentNamePascalCase }}', function () {
66
it('it exists', () => {
7-
expect({{ componentCamelcaseName }}).to.be.ok;
7+
expect({{ componentNamePascalCase }}).to.be.ok;
88
});
99
});
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import React from 'react';
2-
import { storiesOf } from '@storybook/react';
3-
import centered from '@storybook/addon-centered/react';
4-
import {{ componentCamelcaseName }} from './{{componentName}}';
2+
import {{ componentNamePascalCase }} from './{{componentName}}';
53

6-
const stories = storiesOf('{{ componentName }}', module)
7-
.addDecorator(centered);
8-
9-
stories.add(
10-
'Default',
11-
() => (<{{componentCamelcaseName}}/>),
12-
);
4+
export default {
5+
title: "{{ componentNamePascalCase }}",
6+
component: componentNamePascalCase
7+
};

resources/templates/component/{{componentName}}.tsx.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import React from 'react';
22

33
type Props = {}
44

5-
export default function {{ componentCamelcaseName }}({}: Props) {
5+
export default function {{ componentNameCamelCase }}({}: Props) {
66
return (<div className="{{ componentName }}"/>);
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export enum {{ actionTypesEnumName }} {
2-
{{ mutationType }} = '{{ moduleName }}/{{ mutationType }}',
2+
{{ mutationType }} = '{{ componentNameCamelCase }}/{{ mutationType }}',
33
}

0 commit comments

Comments
 (0)