feat(create-turbo): apply official-starter transform
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@repo/ui",
|
||||
"version": "0.0.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/typescript-config": "*",
|
||||
"@types/react": "^18.2.14",
|
||||
"@types/react-native": "^0.73.0",
|
||||
"tsup": "^8.0.1",
|
||||
"typescript": "5.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.2.0",
|
||||
"react-native": "0.74.5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import * as React from "react";
|
||||
import {
|
||||
StyleSheet,
|
||||
GestureResponderEvent,
|
||||
Text,
|
||||
Pressable,
|
||||
} from "react-native";
|
||||
|
||||
export interface ButtonProps {
|
||||
text: string;
|
||||
onClick?: (event: GestureResponderEvent) => void;
|
||||
}
|
||||
|
||||
export function Button({ text, onClick }: ButtonProps) {
|
||||
return (
|
||||
<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";
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@repo/typescript-config/react-native-library",
|
||||
"include": ["."],
|
||||
"exclude": ["dist", "build", "node_modules"],
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
}));
|
||||
Reference in New Issue
Block a user