feat(create-turbo): create with-tailwind
This commit is contained in:
3
packages/eslint-config-custom/README.md
Normal file
3
packages/eslint-config-custom/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@turbo/eslint-config`
|
||||
|
||||
Collection of internal eslint configurations.
|
37
packages/eslint-config-custom/library.js
Normal file
37
packages/eslint-config-custom/library.js
Normal file
@ -0,0 +1,37 @@
|
||||
const { resolve } = require("node:path");
|
||||
|
||||
const project = resolve(process.cwd(), "tsconfig.json");
|
||||
|
||||
/*
|
||||
* This is a custom ESLint configuration for use with
|
||||
* typescript packages.
|
||||
*
|
||||
* This config extends the Vercel Engineering Style Guide.
|
||||
* For more information, see https://github.com/vercel/style-guide
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
"@vercel/style-guide/eslint/node",
|
||||
"@vercel/style-guide/eslint/typescript",
|
||||
].map(require.resolve),
|
||||
parserOptions: {
|
||||
project,
|
||||
},
|
||||
globals: {
|
||||
React: true,
|
||||
JSX: true,
|
||||
},
|
||||
settings: {
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
project,
|
||||
},
|
||||
node: {
|
||||
extensions: [".mjs", ".js", ".jsx", ".ts", ".tsx"],
|
||||
},
|
||||
},
|
||||
},
|
||||
ignorePatterns: ["node_modules/", "dist/"],
|
||||
};
|
45
packages/eslint-config-custom/next.js
Normal file
45
packages/eslint-config-custom/next.js
Normal file
@ -0,0 +1,45 @@
|
||||
const { resolve } = require("node:path");
|
||||
|
||||
const project = resolve(process.cwd(), "tsconfig.json");
|
||||
|
||||
/*
|
||||
* This is a custom ESLint configuration for use with
|
||||
* Next.js apps.
|
||||
*
|
||||
* This config extends the Vercel Engineering Style Guide.
|
||||
* For more information, see https://github.com/vercel/style-guide
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
"@vercel/style-guide/eslint/node",
|
||||
"@vercel/style-guide/eslint/typescript",
|
||||
"@vercel/style-guide/eslint/browser",
|
||||
"@vercel/style-guide/eslint/react",
|
||||
"@vercel/style-guide/eslint/next",
|
||||
"eslint-config-turbo",
|
||||
].map(require.resolve),
|
||||
parserOptions: {
|
||||
project,
|
||||
},
|
||||
globals: {
|
||||
React: true,
|
||||
JSX: true,
|
||||
},
|
||||
settings: {
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
project,
|
||||
},
|
||||
node: {
|
||||
extensions: [".mjs", ".js", ".jsx", ".ts", ".tsx"],
|
||||
},
|
||||
},
|
||||
},
|
||||
ignorePatterns: ["node_modules/", "dist/"],
|
||||
// add rules configurations here
|
||||
rules: {
|
||||
"import/no-default-export": "off",
|
||||
},
|
||||
};
|
10
packages/eslint-config-custom/package.json
Normal file
10
packages/eslint-config-custom/package.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "eslint-config-custom",
|
||||
"license": "MIT",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@vercel/style-guide": "^5.0.0",
|
||||
"eslint-config-turbo": "^1.10.12"
|
||||
}
|
||||
}
|
41
packages/eslint-config-custom/react.js
vendored
Normal file
41
packages/eslint-config-custom/react.js
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
const { resolve } = require("node:path");
|
||||
|
||||
const project = resolve(process.cwd(), "tsconfig.json");
|
||||
|
||||
/*
|
||||
* This is a custom ESLint configuration for use a library
|
||||
* that utilizes React.
|
||||
*
|
||||
* This config extends the Vercel Engineering Style Guide.
|
||||
* For more information, see https://github.com/vercel/style-guide
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
"@vercel/style-guide/eslint/browser",
|
||||
"@vercel/style-guide/eslint/typescript",
|
||||
"@vercel/style-guide/eslint/react",
|
||||
].map(require.resolve),
|
||||
parserOptions: {
|
||||
project,
|
||||
},
|
||||
globals: {
|
||||
JSX: true,
|
||||
},
|
||||
settings: {
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
project,
|
||||
},
|
||||
node: {
|
||||
extensions: [".mjs", ".js", ".jsx", ".ts", ".tsx"],
|
||||
},
|
||||
},
|
||||
},
|
||||
ignorePatterns: ["node_modules/", "dist/", ".eslintrc.js", "**/*.css"],
|
||||
// add rules configurations here
|
||||
rules: {
|
||||
"import/no-default-export": "off",
|
||||
},
|
||||
};
|
10
packages/tailwind-config/package.json
Normal file
10
packages/tailwind-config/package.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "tailwind-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"types": "index.ts",
|
||||
"devDependencies": {
|
||||
"tailwindcss": "^3.2.4"
|
||||
}
|
||||
}
|
15
packages/tailwind-config/tailwind.config.ts
Normal file
15
packages/tailwind-config/tailwind.config.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
const config: Config = {
|
||||
content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"],
|
||||
theme: {
|
||||
extend: {
|
||||
backgroundImage: {
|
||||
"glow-conic":
|
||||
"conic-gradient(from 180deg at 50% 50%, #2a8af6 0deg, #a853ba 180deg, #e92a67 360deg)",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
export default config;
|
23
packages/tsconfig/base.json
Normal file
23
packages/tsconfig/base.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Default",
|
||||
"compilerOptions": {
|
||||
"composite": false,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"noEmit": true,
|
||||
"inlineSources": false,
|
||||
"isolatedModules": true,
|
||||
"moduleResolution": "node",
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"preserveWatchOutput": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
20
packages/tsconfig/nextjs.json
Normal file
20
packages/tsconfig/nextjs.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"$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",
|
||||
"resolveJsonModule": true,
|
||||
"strict": false,
|
||||
"target": "es5"
|
||||
},
|
||||
"include": ["src", "next-env.d.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
9
packages/tsconfig/package.json
Normal file
9
packages/tsconfig/package.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "tsconfig",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
12
packages/tsconfig/react-library.json
Normal file
12
packages/tsconfig/react-library.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "React Library",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2015", "DOM"],
|
||||
"module": "ESNext",
|
||||
"target": "ES6",
|
||||
"jsx": "react-jsx",
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
3
packages/ui/.eslintrc.js
Normal file
3
packages/ui/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ["custom/react"],
|
||||
};
|
34
packages/ui/package.json
Normal file
34
packages/ui/package.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "ui",
|
||||
"version": "0.0.0",
|
||||
"sideEffects": [
|
||||
"**/*.css"
|
||||
],
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist",
|
||||
"./styles.css": "./dist/index.css"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"lint": "eslint src/",
|
||||
"dev": "tsup --watch",
|
||||
"check-types": "tsc --noEmit"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.2.5",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"postcss": "^8.4.20",
|
||||
"react": "^18.2.0",
|
||||
"tailwind-config": "workspace:*",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tsconfig": "workspace:*",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^5.1.6"
|
||||
}
|
||||
}
|
9
packages/ui/postcss.config.js
Normal file
9
packages/ui/postcss.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
// If you want to use other PostCSS plugins, see the following:
|
||||
// https://tailwindcss.com/docs/using-with-preprocessors
|
||||
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
30
packages/ui/src/card.tsx
Normal file
30
packages/ui/src/card.tsx
Normal file
@ -0,0 +1,30 @@
|
||||
import * as React from "react";
|
||||
|
||||
export function Card({
|
||||
title,
|
||||
children,
|
||||
href,
|
||||
}: {
|
||||
title: string;
|
||||
children: React.ReactNode;
|
||||
href: string;
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<a
|
||||
className="ui-group ui-rounded-lg ui-border ui-border-transparent ui-px-5 ui-py-4 ui-transition-colors hover:ui-border-neutral-700 hover:ui-bg-neutral-800/30"
|
||||
href={`${href}?utm_source=create-turbo&utm_medium=with-tailwind&utm_campaign=create-turbo"`}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<h2 className="ui-mb-3 ui-text-2xl ui-font-semibold">
|
||||
{title}{" "}
|
||||
<span className="ui-inline-block ui-transition-transform group-hover:ui-translate-x-1 motion-reduce:ui-transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className="ui-m-0 ui-max-w-[30ch] ui-text-sm ui-opacity-50">
|
||||
{children}
|
||||
</p>
|
||||
</a>
|
||||
);
|
||||
}
|
5
packages/ui/src/index.tsx
Normal file
5
packages/ui/src/index.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
// styles
|
||||
import "./styles.css";
|
||||
|
||||
// components
|
||||
export * from "./card";
|
3
packages/ui/src/styles.css
Normal file
3
packages/ui/src/styles.css
Normal file
@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
10
packages/ui/tailwind.config.ts
Normal file
10
packages/ui/tailwind.config.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// tailwind config is required for editor support
|
||||
import type { Config } from "tailwindcss";
|
||||
import sharedConfig from "tailwind-config/tailwind.config.ts";
|
||||
|
||||
const config: Pick<Config, "prefix" | "presets"> = {
|
||||
prefix: "ui-",
|
||||
presets: [sharedConfig],
|
||||
};
|
||||
|
||||
export default config;
|
5
packages/ui/tsconfig.json
Normal file
5
packages/ui/tsconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "tsconfig/react-library.json",
|
||||
"include": ["."],
|
||||
"exclude": ["dist", "build", "node_modules"]
|
||||
}
|
13
packages/ui/tsup.config.ts
Normal file
13
packages/ui/tsup.config.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { defineConfig, Options } from "tsup";
|
||||
|
||||
export default defineConfig((options: Options) => ({
|
||||
treeshake: true,
|
||||
splitting: true,
|
||||
entry: ["src/**/*.tsx"],
|
||||
format: ["esm"],
|
||||
dts: true,
|
||||
minify: true,
|
||||
clean: true,
|
||||
external: ["react"],
|
||||
...options,
|
||||
}));
|
Reference in New Issue
Block a user