feat(cli): Add ability to specify component generation config parameters
A user can define a prefix and styleFormat parameter in stencil.config.ts to provide more flexibility when working with the stencil generate CLI command.
eg.
import { Config } from '@stencil/core';
export const config: Config = {
...
componentGeneratorConfig: {
prefix: 'ion',
styleFormat: 'scss'
}
}
The toggle prompts remain the same, referencing scss instead of css in the above example.
This object is optional, with a default app prefix and css format being applied.
Generated files and folders are created without the prefix within the name. Eg. ion-button component would create file/folder structure button, button.tsx etc.
The generation command would change to:
npx stencil generate button instead of npx stencil generate ion-button
Resolves: https://github.com/ionic-team/stencil/issues/2303 https://github.com/ionic-team/stencil/issues/2347 https://github.com/ionic-team/stencil/issues/2348 https://github.com/ionic-team/stencil/issues/2396
I could remove the default application of app- if we didn't want to force a default on users, then the functionality would remain much the same as current. Let me know your thoughts :)
Are there any plans to move forward on this PR?
This would be a great help for our projects, too. Writing the tag names/prefixes manually comes always with the possibility of human error...