Skip to content

feat(cli): Add ability to specify component generation config parameters - #2427

Closed
nathanb21 wants to merge 1 commit into
stenciljs:mainfrom
nathanb21:feature/generate-task-config-options
Closed

nathanb21 wants to merge 1 commit into
stenciljs:mainfrom
nathanb21:feature/generate-task-config-options

Conversation

@nathanb21

@nathanb21 nathanb21 commented May 8, 2020 •

Copy link
Copy Markdown

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:
#2303
#2347
#2348
#2396

@nathanb21

Copy link
Copy Markdown
Author

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 :)

@say25 say25 mentioned this pull request Jul 9, 2021
@nathanb21
nathanb21 requested a review from a team October 6, 2021 16:35
@prodkt

prodkt commented Apr 15, 2022

Copy link
Copy Markdown

Are there any plans to move forward on this PR?

@noopliez

Copy link
Copy Markdown

This would be a great help for our projects, too. Writing the tag names/prefixes manually comes always with the possibility of human error...

@nathanb21
nathanb21 requested a review from a team as a code owner May 13, 2024 16:20
@christian-bromann

Copy link
Copy Markdown
Member

I am going ahead and close this one as I don't see how this fits in current context of the Stencil project. All referenced issues were closed already. If someone could provide me with more context I am happy to re-open and reconsider merging. Thank you @nathanb21 for your contribution and apologies that this patch was never picked up.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants