This commit is contained in:
echo committed 2025-03-24 00:54:46 +01:00
1 parent c527aa7bb7
commit 39d2698f28
36 files changed
+487 -3

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
import { ReactNode } from "react";
interface ButtonProps {
children: ReactNode;
className?: string;
appName: string;
}
export declare const Button: ({ children, className, appName }: ButtonProps) => import("react").JSX.Element;
export {};
+6
View File
@@ -0,0 +1,6 @@
"use client";
export const Button = ({ children, className, appName }) => {
return (<button className={className} onClick={() => alert(`Hello from your ${appName} app!`)}>
{children}
</button>);
};
+7
View File
@@ -0,0 +1,7 @@
import { type JSX } from "react";
export declare function Card({ className, title, children, href, }: {
className?: string;
title: string;
children: React.ReactNode;
href: string;
}): JSX.Element;
+8
View File
@@ -0,0 +1,8 @@
export function Card({ className, title, children, href, }) {
return (<a className={className} href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`} rel="noopener noreferrer" target="_blank">
<h2>
{title} <span>-&gt;</span>
</h2>
<p>{children}</p>
</a>);
}
+5
View File
@@ -0,0 +1,5 @@
import { type JSX } from "react";
export declare function Code({ children, className, }: {
children: React.ReactNode;
className?: string;
}): JSX.Element;
+3
View File
@@ -0,0 +1,3 @@
export function Code({ children, className, }) {
return <code className={className}>{children}</code>;
}
+2
View File
@@ -0,0 +1,2 @@
import type { PlopTypes } from "@turbo/gen";
export default function generator(plop: PlopTypes.NodePlopAPI): void;
+27
View File
@@ -0,0 +1,27 @@
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
export default function generator(plop) {
// A simple generator to add a new React component to the internal UI library
plop.setGenerator("react-component", {
description: "Adds a new react component",
prompts: [
{
type: "input",
name: "name",
message: "What is the name of the component?",
},
],
actions: [
{
type: "add",
path: "src/{{kebabCase name}}.tsx",
templateFile: "templates/component.hbs",
},
{
type: "append",
path: "package.json",
pattern: /"exports": {(?<insertion>)/g,
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
},
],
});
}