Create a new turborepo repository
diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js
new file mode 100644
index 0000000..c9523f1
--- /dev/null
+++ b/packages/eslint-config-custom/index.js
@@ -0,0 +1,11 @@
+module.exports = {
+ extends: ["next", "turbo", "prettier"],
+ rules: {
+ "@next/next/no-html-link-for-pages": "off",
+ },
+ parserOptions: {
+ babelOptions: {
+ presets: [require.resolve("next/babel")],
+ },
+ },
+};
diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json
new file mode 100644
index 0000000..17574f3
--- /dev/null
+++ b/packages/eslint-config-custom/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "eslint-config-custom",
+ "version": "0.0.0",
+ "main": "index.js",
+ "license": "MIT",
+ "dependencies": {
+ "eslint-config-next": "^13.4.1",
+ "eslint-config-prettier": "^8.3.0",
+ "eslint-plugin-react": "7.28.0",
+ "eslint-config-turbo": "^1.9.3"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json
new file mode 100644
index 0000000..d72a9f3
--- /dev/null
+++ b/packages/tsconfig/base.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "https://json.schemastore.org/tsconfig",
+ "display": "Default",
+ "compilerOptions": {
+ "composite": false,
+ "declaration": true,
+ "declarationMap": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "inlineSources": false,
+ "isolatedModules": true,
+ "moduleResolution": "node",
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "preserveWatchOutput": true,
+ "skipLibCheck": true,
+ "strict": true
+ },
+ "exclude": ["node_modules"]
+}
diff --git a/packages/tsconfig/nextjs.json b/packages/tsconfig/nextjs.json
new file mode 100644
index 0000000..d5010a1
--- /dev/null
+++ b/packages/tsconfig/nextjs.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://json.schemastore.org/tsconfig",
+ "display": "Next.js",
+ "extends": "./base.json",
+ "compilerOptions": {
+ "plugins": [{ "name": "next" }],
+ "allowJs": true,
+ "declaration": false,
+ "declarationMap": false,
+ "incremental": true,
+ "jsx": "preserve",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "module": "esnext",
+ "noEmit": true,
+ "resolveJsonModule": true,
+ "strict": false,
+ "target": "es5"
+ },
+ "include": ["src", "next-env.d.ts"],
+ "exclude": ["node_modules"]
+}
diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json
new file mode 100644
index 0000000..6efb83e
--- /dev/null
+++ b/packages/tsconfig/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "tsconfig",
+ "version": "0.0.0",
+ "private": true,
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/tsconfig/react-library.json b/packages/tsconfig/react-library.json
new file mode 100644
index 0000000..36b62be
--- /dev/null
+++ b/packages/tsconfig/react-library.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json.schemastore.org/tsconfig",
+ "display": "React Library",
+ "extends": "./base.json",
+ "compilerOptions": {
+ "jsx": "react-jsx",
+ "lib": ["ES2015", "DOM"],
+ "module": "ESNext",
+ "target": "es6"
+ }
+}
diff --git a/packages/ui/Button.tsx b/packages/ui/Button.tsx
new file mode 100644
index 0000000..ff7e99d
--- /dev/null
+++ b/packages/ui/Button.tsx
@@ -0,0 +1,7 @@
+"use client";
+
+import * as React from "react";
+
+export const Button = () => {
+ return <button onClick={() => alert("boop")}>Boop</button>;
+};
diff --git a/packages/ui/Header.tsx b/packages/ui/Header.tsx
new file mode 100644
index 0000000..3a96ae8
--- /dev/null
+++ b/packages/ui/Header.tsx
@@ -0,0 +1,5 @@
+import * as React from "react";
+
+export const Header = ({ text }: { text: string }) => {
+ return <h1>{text}</h1>;
+};
diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx
new file mode 100644
index 0000000..93afd50
--- /dev/null
+++ b/packages/ui/index.tsx
@@ -0,0 +1,5 @@
+import * as React from "react";
+
+// component exports
+export * from "./Button";
+export * from "./Header";
diff --git a/packages/ui/package.json b/packages/ui/package.json
new file mode 100644
index 0000000..1c85c2c
--- /dev/null
+++ b/packages/ui/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "ui",
+ "version": "0.0.0",
+ "main": "./index.tsx",
+ "types": "./index.tsx",
+ "license": "MIT",
+ "scripts": {
+ "lint": "eslint \"**/*.ts*\"",
+ "generate:component": "turbo gen react-component"
+ },
+ "devDependencies": {
+ "@types/react": "^18.2.0",
+ "@types/react-dom": "^18.2.0",
+ "eslint": "^7.32.0",
+ "eslint-config-custom": "workspace:*",
+ "react": "^17.0.2",
+ "tsconfig": "workspace:*",
+ "typescript": "^4.5.2"
+ }
+}
diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json
new file mode 100644
index 0000000..cd6c94d
--- /dev/null
+++ b/packages/ui/tsconfig.json
@@ -0,0 +1,5 @@
+{
+ "extends": "tsconfig/react-library.json",
+ "include": ["."],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/ui/turbo/generators/config.ts b/packages/ui/turbo/generators/config.ts
new file mode 100644
index 0000000..730d424
--- /dev/null
+++ b/packages/ui/turbo/generators/config.ts
@@ -0,0 +1,30 @@
+import { 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: "{{pascalCase name}}.tsx",
+ templateFile: "templates/component.hbs",
+ },
+ {
+ type: "append",
+ path: "index.tsx",
+ pattern: /(\/\/ component exports)/g,
+ template: 'export * from "./{{pascalCase name}}";',
+ },
+ ],
+ });
+}
diff --git a/packages/ui/turbo/generators/templates/component.hbs b/packages/ui/turbo/generators/templates/component.hbs
new file mode 100644
index 0000000..cf7b636
--- /dev/null
+++ b/packages/ui/turbo/generators/templates/component.hbs
@@ -0,0 +1,14 @@
+import * as React from "react";
+
+interface Props {
+ children?: React.ReactNode;
+}
+
+export const {{ pascalCase name }} = ({ children }: Props) => {
+ return (
+ <div>
+ <h1>{{ name }}</h1>
+ {children}
+ </div>
+ );
+};