feat: Add TypeScript to plop configuration#88
feat: Add TypeScript to plop configuration#88SkrzypMajster wants to merge 4 commits intoTheSoftwareHouse:masterfrom
Conversation
|
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: plop@3.1.2 |
31e38d2 to
d433346
Compare
79a65ef to
1150501
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds TypeScript-based plop generator configurations to streamline component, hook, API, and context creation.
- Introduces multiple plop generators for various parts of the codebase (app components, container components, UI components, API queries/mutations, context, and custom hooks).
- Adds a constants file for standardized component type descriptions and exports all generators in a central index.
Reviewed Changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plop/generators/appContainerComponent.generator.ts | New generator for app container components with directory and naming prompts. |
| plop/generators/appComponent.generator.ts | New generator for app components with prompts and file actions. |
| plop/generators/apiQuery.generator.ts | New generator for API query actions using modify actions to inject code. |
| plop/generators/context.generator.ts | New generator for React context with multiple file generation actions. |
| plop/generators/apiMutation.generator.ts | New generator for API mutation actions with prompts and modify actions. |
| plop/generators/customHook.generator.ts | New generator for custom hooks with addition and modification actions. |
| plop/generators/uiComponent.generator.ts | New generator for UI components with file creation and index modification. |
| plop/generators/apiActions.generator.ts | New generator for API actions collection with file creation and index injections. |
| plop/generators/index.ts | Exports all new generator configurations. |
| plop/constants.ts | Added constants for component type descriptions. |
| name: 'directory', | ||
| message: 'select directory', | ||
| basePath: './src/app', | ||
| } as any, |
There was a problem hiding this comment.
Avoid using 'as any' for the prompt configuration; use the appropriate Plop prompt type to maintain type safety.
| import { componentTypes } from '../constants'; | ||
| import { apiActionCollectionChoices, apiActionCollectionDefaultChoice, getPlaceholderPattern } from '../utils'; | ||
|
|
||
| export const apiQueryGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({ |
There was a problem hiding this comment.
Consider using a more specific type annotation for 'toKebabCase' instead of the generic Function type to improve code clarity and type safety.
| export const apiQueryGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({ | |
| export const apiQueryGenerator = (toKebabCase: (input: string) => string): PlopGeneratorConfig => ({ |
| import { componentTypes } from '../constants'; | ||
| import { apiActionCollectionChoices, apiActionCollectionDefaultChoice, getPlaceholderPattern } from '../utils'; | ||
|
|
||
| export const apiMutationGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({ |
There was a problem hiding this comment.
Consider replacing the generic Function type for 'toKebabCase' with a more specific function signature to enhance type safety.
| export const apiMutationGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({ | |
| export const apiMutationGenerator = (toKebabCase: (input: string) => string): PlopGeneratorConfig => ({ |
No description provided.