Skip to content
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

Provide example of how to create custom templates #16

Closed
vb opened this issue Jul 5, 2017 · 5 comments
Closed

Provide example of how to create custom templates #16

vb opened this issue Jul 5, 2017 · 5 comments

Comments

@vb
Copy link

vb commented Jul 5, 2017

The description on how to create custom templates is pretty thin. Could you provide a more detailed example?

@CVarisco
Copy link
Owner

CVarisco commented Jul 6, 2017

Hi @viktorbergehall !
Yes, you are right.

I'm creating a .md file with more details about the custom templates.

Thanks for your support 🚀

@CVarisco
Copy link
Owner

CVarisco commented Jul 6, 2017

Hi @viktorbergehall !

I created a doc file to create custom templates.
Give me some feedbacks 👍

@vb
Copy link
Author

vb commented Jul 7, 2017

Thanks for the guide!

A couple of thoughts:

  • How do you specify pure/stateless/class in templates?
  • If you collect all settings in one file then the settings doesn't seem to apply. For example:
# config.json
{
  "path": "./src/components",
  "jsExtension": "js",
  "cssExtension": "scss",
  "includeTests": true,
  "includeStories": true,
  "type": "custom",
  "templatesPath": ".ccarc/templates"
}
  • It would be great if the script defaulted to look for settings in .ccarc/config.json (or something) rather than you'd have to specify it with the config flag.
  • It wold be great if you could specify file name for each file. I thinking something like this:
# config.json
{
  ...
  file_name: {
    test: 'COMPONENT_NAME.test.js',
    etc
  }
}

I'm running create-react-appand that looks for test files with the naming *.test.js so files name *.tests.js doesn't run by default

@CVarisco
Copy link
Owner

CVarisco commented Jul 7, 2017

How do you specify pure/stateless/class in templates ?
If you collect all settings in one file then the settings doesn't seem to apply

With type custom you can't specify from the config the type because I can't know what are you writing in your template.
So, the only options that you can use when you use type:custom are:

  • path
  • templatesPath

The other will be ignore because you are writing your own templates, and in your templates folder you can put whatever you want 👍 .

It would be great if the script defaulted to look for settings in .ccarc/config.json (or something) rather than you'd have to specify it with the config flag.

It is already in this way 🙂
If doesn't work give me additional information to fix the bug 💪

It would be great if you could specify file name for each file.

Cool 🌮 Do you want contribute with this enhancement ?

I'm running create-react-appand that looks for test files with the naming *.test.js so files name *.tests.js doesn't run by default

Sorry, but I don't understand what you mean 🙁

Thanks a lot for your support.
If there are other issue/questions I'm here 🎉

@CVarisco
Copy link
Owner

Hi @viktorbergehall
If you don't have any question, I'm closing the issue

Thanks a lot for your contribute 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants