Skip to content

Commit

Permalink
Examples polish. (#8511)
Browse files Browse the repository at this point in the history
### Description

Updating for 2.0 changes.
- Handling `.env` files more gracefully
- Removing root internal dependencies
- Using `tsc` in a few more places

### Testing Instructions

CI (or you can go hand test them all if you want) 😄
  • Loading branch information
anthonyshew committed Jun 20, 2024
1 parent 1aa5f78 commit 7044e5b
Show file tree
Hide file tree
Showing 71 changed files with 6,766 additions and 5,173 deletions.
2 changes: 1 addition & 1 deletion examples/basic/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env", ".env.*"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {
Expand Down
14 changes: 4 additions & 10 deletions examples/design-system/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"outputs": [
"dist/**",
"storybook-static/**"
],
"dependsOn": [
"^build"
]
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**", "storybook-static/**"],
"dependsOn": ["^build"]
},
"lint": {
"dependsOn": [
"^lint"
]
"dependsOn": ["^lint"]
},
"dev": {
"cache": false,
Expand Down
8 changes: 4 additions & 4 deletions examples/kitchen-sink/apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"lint": "eslint src/"
},
"dependencies": {
"@repo/ui": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "workspace:*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"typescript": "^5.3.3",
"vite": "^5.1.4"
}
Expand Down
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/admin/src/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import "./styles.css";
import { CounterButton, Link } from "@repo/ui";
import { Link } from "@repo/ui/link";
import { CounterButton } from "@repo/ui/counter-button";

function App(): JSX.Element {
return (
Expand Down
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/blog/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CounterButton, Link } from "@repo/ui";
import { Link } from "@repo/ui/link";
import { CounterButton } from "@repo/ui/counter-button";

export default function Index(): JSX.Element {
return (
Expand Down
8 changes: 4 additions & 4 deletions examples/kitchen-sink/apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"@remix-run/react": "^2.8.0",
"@remix-run/serve": "^2.8.0",
"@remix-run/server-runtime": "^2.8.0",
"@repo/ui": "workspace:*",
"@vercel/analytics": "^1.2.2",
"@vercel/remix-entry-server": "^0.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "workspace:*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^2.8.0",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"typescript": "^5.3.3"
},
"engines": {
Expand Down
10 changes: 5 additions & 5 deletions examples/kitchen-sink/apps/storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
},
"dependencies": {
"@repo/logger": "workspace:*",
"next": "^14.1.1",
"@repo/ui": "workspace:*",
"next": "^14.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "workspace:*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.1",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^20.11.24",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"typescript": "^5.3.3"
}
}
3 changes: 2 additions & 1 deletion examples/kitchen-sink/apps/storefront/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { log } from "@repo/logger";
import { CounterButton, Link } from "@repo/ui";
import { Link } from "@repo/ui/link";
import { CounterButton } from "@repo/ui/counter-button";

export const metadata = {
title: "Store | Kitchen Sink",
Expand Down
3 changes: 3 additions & 0 deletions examples/kitchen-sink/packages/config-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"eslint-plugin-mdx": "^3.1.5",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-storybook": "^0.8.0"
},
"dependencies": {
"next": "^14.2.4"
}
}
2 changes: 0 additions & 2 deletions examples/kitchen-sink/packages/config-typescript/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"allowImportingTsExtensions": true,
"inlineSources": false,
"isolatedModules": true,
"module": "ESNext",
Expand All @@ -17,7 +16,6 @@
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"strictNullChecks": true
},
"exclude": ["node_modules"]
Expand Down
3 changes: 3 additions & 0 deletions examples/kitchen-sink/packages/config-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"license": "MIT",
"publishConfig": {
"access": "public"
},
"dependencies": {
"next": "^14.2.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"lib": ["ES2015"],
"module": "ESNext",
"target": "ES6",
"jsx": "react-jsx",
"noEmit": true
"jsx": "react-jsx"
}
}
1 change: 1 addition & 0 deletions examples/kitchen-sink/packages/jest-presets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"node/jest-preset.js"
],
"dependencies": {
"next": "^14.2.4",
"ts-jest": "^29.1.2"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions examples/kitchen-sink/packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
"jest": "^29.7.0",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
},
"dependencies": {
"next": "^14.2.4"
}
}
23 changes: 16 additions & 7 deletions examples/kitchen-sink/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@
"private": true,
"license": "MIT",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
"./link": {
"types": "./src/link.index.tsx",
"default": "./dist/link/index.js"
},
"./counter-button": {
"types": "./src/counter-button.index.tsx",
"default": "./dist/counter-button/index.js"
}
},
"scripts": {
"build": "tsup",
"build": "tsc",
"clean": "rm -rf dist",
"dev": "tsup --watch",
"dev": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint src/",
"test": "jest"
Expand All @@ -30,11 +37,13 @@
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"jest": "^29.7.0",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
},
"dependencies": {
"next": "^14.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { useState } from "react";

export function CounterButton(): JSX.Element {
Expand Down
2 changes: 0 additions & 2 deletions examples/kitchen-sink/packages/ui/src/index.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion examples/kitchen-sink/packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"lib": ["dom", "ES2015"],
"types": ["jest", "node"]
},
"include": ["."],
"include": ["src"],
"exclude": ["dist", "build", "node_modules"]
}
12 changes: 0 additions & 12 deletions examples/kitchen-sink/packages/ui/tsup.config.ts

This file was deleted.

Loading

0 comments on commit 7044e5b

Please sign in to comment.