turned template into create cli
This commit is contained in:
9
template/packages/sanity-connection/index.ts
Normal file
9
template/packages/sanity-connection/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const sanityConnection = {
|
||||
pageTitle: "lumify template",
|
||||
publicViewerToken: "skX06BHIWzgWfkt52091aJgLmYEwFJ7ufghsXi0wRXRkW2Nom8mzfYnFpSVJH1toNy0e34Hot2yTwjLxHCjhsWLZiC0qjR19WI6b9WEFj04shHMZCiS09LgRuzd9BnEgewAQpJUAbhdSwg3NOg8rOhZXpHyciAoYwLqhaTHP6g0FDpiZFrb5",
|
||||
studioHost: "vaporvee",
|
||||
studioUrl: "https://vaporvee.sanity.studio", // normaly https://<studioHost>.sanity.studio
|
||||
projectId: "ax04yw0e",
|
||||
previewUrl: "http://localhost:3000",
|
||||
dataset: "production", // leave as "production" for the main dataset
|
||||
};
|
||||
11
template/packages/sanity-connection/package.json
Normal file
11
template/packages/sanity-connection/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@repo/sanity-connection",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
27
template/packages/sanity-connection/tsconfig.json
Normal file
27
template/packages/sanity-connection/tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
// Enable latest features
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
// Some stricter flags (disabled by default)
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
}
|
||||
}
|
||||
22
template/packages/typescript-config/base.json
Normal file
22
template/packages/typescript-config/base.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"incremental": false,
|
||||
"isolatedModules": true,
|
||||
"lib": ["es2022", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"moduleDetection": "force",
|
||||
"moduleResolution": "Bundler",
|
||||
"allowJs": true,
|
||||
"jsx": "preserve",
|
||||
"noEmit": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"target": "ES2022"
|
||||
}
|
||||
}
|
||||
14
template/packages/typescript-config/nextjs.json
Normal file
14
template/packages/typescript-config/nextjs.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"allowJs": true,
|
||||
"noEmit": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
}
|
||||
9
template/packages/typescript-config/package.json
Normal file
9
template/packages/typescript-config/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@repo/typescript-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
7
template/packages/typescript-config/react-library.json
Normal file
7
template/packages/typescript-config/react-library.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx"
|
||||
}
|
||||
}
|
||||
0
template/packages/ui/favicon/.gitkeep
Normal file
0
template/packages/ui/favicon/.gitkeep
Normal file
27
template/packages/ui/package.json
Normal file
27
template/packages/ui/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@repo/ui",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./components/logo": "./src/components/logo.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"generate:component": "turbo gen react-component",
|
||||
"check-types": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/typescript-config": "*",
|
||||
"@types/node": "^22.15.3",
|
||||
"@types/react": "19.1.0",
|
||||
"@types/react-dom": "19.1.1",
|
||||
"eslint": "^9.30.0",
|
||||
"typescript": "5.8.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0"
|
||||
}
|
||||
}
|
||||
16
template/packages/ui/src/brand-colors.ts
Normal file
16
template/packages/ui/src/brand-colors.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import primitives from "./primitives";
|
||||
import variables from "./variables";
|
||||
|
||||
const brandColors = {
|
||||
"bg-primary": variables["light-sage"],
|
||||
"bg-secondary": variables.terracotta,
|
||||
white: "#FAFCFE",
|
||||
gray: "#F5F5F5",
|
||||
|
||||
foreground: "#333333",
|
||||
error: "#C23935",
|
||||
success: primitives.primary1[400],
|
||||
warning: primitives.secondary2[100],
|
||||
};
|
||||
|
||||
export default brandColors;
|
||||
7
template/packages/ui/src/components/logo.tsx
Normal file
7
template/packages/ui/src/components/logo.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function Logo() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Logo</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
4
template/packages/ui/src/index.ts
Normal file
4
template/packages/ui/src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { primitives } from "./primitives";
|
||||
export { default as variables } from "./variables";
|
||||
export { default as brandColors } from "./brand-colors";
|
||||
export { default as config } from "./tailwind.config";
|
||||
57
template/packages/ui/src/primitives.ts
Normal file
57
template/packages/ui/src/primitives.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
export const primitives = {
|
||||
primary1: {
|
||||
25: "#FDFDFD",
|
||||
50: "#DEEEE9",
|
||||
100: "#B0D6C7",
|
||||
200: "#7FBCA3",
|
||||
300: "#51A181",
|
||||
400: "#338E6B",
|
||||
500: "#1E7C56",
|
||||
600: "#1A704C",
|
||||
700: "#156140",
|
||||
800: "#0E5234",
|
||||
900: "#04371D",
|
||||
},
|
||||
primary2: {
|
||||
25: "#FFFFFF",
|
||||
50: "#F5F7E7",
|
||||
100: "#E5EAC4",
|
||||
200: "#D4DC9F",
|
||||
300: "#C2CE79",
|
||||
400: "#B5C45C",
|
||||
500: "#A8BA3E",
|
||||
600: "#97AA37",
|
||||
700: "#81972D",
|
||||
},
|
||||
secondary1: {
|
||||
25: "#FFFFFF",
|
||||
50: "#E6EFE2",
|
||||
100: "#C4D7B9",
|
||||
},
|
||||
secondary2: {
|
||||
25: "#FDFDFD",
|
||||
50: "#FDE9C9",
|
||||
100: "#F4C39C",
|
||||
200: "#D5A078",
|
||||
300: "#B47E52",
|
||||
400: "#9C6435",
|
||||
500: "#834C18",
|
||||
},
|
||||
accent1: {
|
||||
25: "#FDFDFD",
|
||||
50: "#FAF2DF",
|
||||
100: "#F3DDAF",
|
||||
200: "#ECC67B",
|
||||
300: "#E5B046",
|
||||
400: "#D1A040",
|
||||
},
|
||||
accent2: {
|
||||
25: "#FDFDFD",
|
||||
50: "#E4F3F9",
|
||||
100: "#C8DFE4",
|
||||
200: "#ABC8D0",
|
||||
300: "#8CB1BB",
|
||||
}
|
||||
};
|
||||
|
||||
export default primitives;
|
||||
27
template/packages/ui/src/tailwind.config.ts
Normal file
27
template/packages/ui/src/tailwind.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { Config } from 'tailwindcss';
|
||||
import primitives from './primitives';
|
||||
import variables from './variables';
|
||||
import brandColors from './brand-colors';
|
||||
|
||||
const config: Config = {
|
||||
content: [
|
||||
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
...primitives,
|
||||
...variables,
|
||||
...brandColors
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['var(--font-sans)'],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
|
||||
export default config;
|
||||
14
template/packages/ui/src/variables.ts
Normal file
14
template/packages/ui/src/variables.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import primitives from "./primitives";
|
||||
|
||||
const variables = {
|
||||
"olive-green": primitives.primary2[500],
|
||||
"pine-green": primitives.primary1[700],
|
||||
flora: primitives.secondary1[100],
|
||||
"soil-brown": primitives.secondary2[500],
|
||||
golden: primitives.accent1[300],
|
||||
water: primitives.accent2[300],
|
||||
"light-sage": primitives.secondary1[50],
|
||||
terracotta: primitives.secondary2[100],
|
||||
};
|
||||
|
||||
export default variables;
|
||||
12
template/packages/ui/tsconfig.json
Normal file
12
template/packages/ui/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@repo/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"allowJs": true,
|
||||
"noEmit": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user