Fuck
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@repo/eslint-config",
|
||||
"name": "@nazara/eslint-config",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
@@ -21,4 +21,4 @@
|
||||
"typescript": "^5.7.3",
|
||||
"typescript-eslint": "^8.23.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "@repo/typescript-config",
|
||||
"name": "@nazara/typescript-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
.pnp.js
|
||||
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# build
|
||||
dist
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# turbo
|
||||
.turbo
|
||||
@@ -1,4 +1,4 @@
|
||||
import { config } from "@repo/eslint-config/react-internal";
|
||||
import { config } from "@nazara/eslint-config/react-internal";
|
||||
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
export default config;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "@repo/ui",
|
||||
"name": "@nazara/ui",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./button": "./src/button.tsx",
|
||||
"./card": "./src/card.tsx",
|
||||
"./code": "./src/code.tsx"
|
||||
@@ -13,8 +14,8 @@
|
||||
"check-types": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/eslint-config": "workspace:*",
|
||||
"@repo/typescript-config": "workspace:*",
|
||||
"@nazara/eslint-config": "workspace:*",
|
||||
"@nazara/typescript-config": "workspace:*",
|
||||
"@turbo/gen": "^2.4.0",
|
||||
"@types/node": "^22.13.0",
|
||||
"@types/react": "19.0.8",
|
||||
@@ -26,4 +27,4 @@
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,37 @@
|
||||
"use client";
|
||||
import * as React from "react";
|
||||
import {
|
||||
StyleSheet,
|
||||
GestureResponderEvent,
|
||||
Text,
|
||||
Pressable,
|
||||
} from "react-native";
|
||||
|
||||
import { ReactNode } from "react";
|
||||
|
||||
interface ButtonProps {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
appName: string;
|
||||
export interface ButtonProps {
|
||||
text: string;
|
||||
onClick?: (event: GestureResponderEvent) => void;
|
||||
}
|
||||
|
||||
export const Button = ({ children, className, appName }: ButtonProps) => {
|
||||
export function Button({ text, onClick }: ButtonProps) {
|
||||
return (
|
||||
<button
|
||||
className={className}
|
||||
onClick={() => alert(`Hello from your ${appName} app!`)}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
<Pressable style={styles.button} onPress={onClick}>
|
||||
<Text style={styles.text}>{text}</Text>
|
||||
</Pressable>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
button: {
|
||||
maxWidth: 200,
|
||||
textAlign: "center",
|
||||
borderRadius: 10,
|
||||
paddingTop: 14,
|
||||
paddingBottom: 14,
|
||||
paddingLeft: 30,
|
||||
paddingRight: 30,
|
||||
fontSize: 15,
|
||||
backgroundColor: "#2f80ed",
|
||||
},
|
||||
text: {
|
||||
color: "white",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { Button, type ButtonProps } from "./button";
|
||||
@@ -1,8 +1,13 @@
|
||||
{
|
||||
"extends": "@repo/typescript-config/react-library.json",
|
||||
"extends": "@nazara/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { defineConfig, Options } from "tsup";
|
||||
|
||||
export default defineConfig((options: Options) => ({
|
||||
entry: {
|
||||
index: "src/index.tsx",
|
||||
},
|
||||
banner: {
|
||||
js: "'use client'",
|
||||
},
|
||||
clean: true,
|
||||
format: ["cjs", "esm"],
|
||||
external: ["react"],
|
||||
dts: true,
|
||||
...options,
|
||||
}));
|
||||
@@ -1,30 +0,0 @@
|
||||
import type { PlopTypes } from "@turbo/gen";
|
||||
|
||||
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
|
||||
|
||||
export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
||||
// 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",',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
<div>
|
||||
<h1>{{ pascalCase name }} Component</h1>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user