Skip to content

feat: Add TypeScript to plop configuration#88

Draft
SkrzypMajster wants to merge 4 commits intoTheSoftwareHouse:masterfrom
SkrzypMajster:feat/add-typescript-to-plop-configuration
Draft

feat: Add TypeScript to plop configuration#88
SkrzypMajster wants to merge 4 commits intoTheSoftwareHouse:masterfrom
SkrzypMajster:feat/add-typescript-to-plop-configuration

Conversation

@SkrzypMajster
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 11, 2023

⚠️ No Changeset found

Latest commit: 1150501

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@SkrzypMajster SkrzypMajster changed the title Feat: Add TypeScript to plop configuration feat: Add TypeScript to plop configuration Sep 11, 2023
@socket-security
Copy link
Copy Markdown

socket-security bot commented Sep 11, 2023

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@crutchcorn/plop 4.1.0-alpha.1 filesystem, environment +32 8.38 MB crutchcorn

🚮 Removed packages: plop@3.1.2

@SkrzypMajster SkrzypMajster force-pushed the feat/add-typescript-to-plop-configuration branch from 79a65ef to 1150501 Compare September 12, 2023 13:45
@sethii sethii requested a review from Copilot March 13, 2025 18:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link

Copilot AI Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using 'as any' for the prompt configuration; use the appropriate Plop prompt type to maintain type safety.

Copilot uses AI. Check for mistakes.
import { componentTypes } from '../constants';
import { apiActionCollectionChoices, apiActionCollectionDefaultChoice, getPlaceholderPattern } from '../utils';

export const apiQueryGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({
Copy link

Copilot AI Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more specific type annotation for 'toKebabCase' instead of the generic Function type to improve code clarity and type safety.

Suggested change
export const apiQueryGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({
export const apiQueryGenerator = (toKebabCase: (input: string) => string): PlopGeneratorConfig => ({

Copilot uses AI. Check for mistakes.
import { componentTypes } from '../constants';
import { apiActionCollectionChoices, apiActionCollectionDefaultChoice, getPlaceholderPattern } from '../utils';

export const apiMutationGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({
Copy link

Copilot AI Mar 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the generic Function type for 'toKebabCase' with a more specific function signature to enhance type safety.

Suggested change
export const apiMutationGenerator = (toKebabCase: Function): PlopGeneratorConfig => ({
export const apiMutationGenerator = (toKebabCase: (input: string) => string): PlopGeneratorConfig => ({

Copilot uses AI. Check for mistakes.
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.

2 participants