Skip to content

Commit

Permalink
Add nextjs example, update deps, migrate to turbo 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
macieklad committed Aug 4, 2024
1 parent fe7383b commit 95e1c8b
Show file tree
Hide file tree
Showing 26 changed files with 3,513 additions and 2,352 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ Huge shutout to [@miikebar](https://github.com/miikebar) for his work on this pr

## TODO

### V1

- [ ] Application templates
- [ ] Remix
- [ ] Docs
- [x] Template
- [ ] Next.js
- [ ] Docs
- [ ] Template
- [x] Template
- [ ] Astro
- [ ] Docs
- [x] Template
Expand Down Expand Up @@ -153,6 +155,12 @@ Huge shutout to [@miikebar](https://github.com/miikebar) for his work on this pr
- [x] Types
- [x] Node externals
- [x] Style guide
- [ ] CI/CD Pipeline
- Testing
- Linting
- Caching
- Versioning
- Docs
- [ ] Documentation
- [x] Included tool links
- [ ] Configuration after cloning
Expand All @@ -161,3 +169,7 @@ Huge shutout to [@miikebar](https://github.com/miikebar) for his work on this pr
- [ ] Explanation for each used tool with best practices
- [ ] Hoisting configuration and why it matters to build packages (workspace:\* dependency resolving and externalisation)
- [x] Thanks

V2

- [ ] Module federation
6 changes: 3 additions & 3 deletions apps/astro-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"dependencies": {
"@acme/style-guide": "workspace:*",
"@astrojs/check": "^0.6.0",
"@astrojs/starlight": "^0.22.2",
"astro": "^4.3.5",
"@astrojs/starlight": "^0.22.4",
"astro": "^4.13.1",
"sharp": "^0.32.5",
"typescript": "^5.4.5"
"typescript": "~5.5.4"
}
}
3 changes: 3 additions & 0 deletions apps/nextjs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: [require.resolve('@acme/style-guide/eslint/next')],
};
36 changes: 36 additions & 0 deletions apps/nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
36 changes: 36 additions & 0 deletions apps/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
2 changes: 2 additions & 0 deletions apps/nextjs/app/components/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client';
export { Button } from '@acme/components';
Binary file added apps/nextjs/app/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions apps/nextjs/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
22 changes: 22 additions & 0 deletions apps/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Next app',
description: 'Monoplate next app',
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
10 changes: 10 additions & 0 deletions apps/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Button } from '#/components/client';

export default function Home() {
return (
<div className="flex flex-col h-screen w-screen items-center justify-center">
<h1 className="text-4xl font-bold mb-4">Welcome to Remix!</h1>
<Button>It works with your buttons</Button>
</div>
);
}
4 changes: 4 additions & 0 deletions apps/nextjs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
30 changes: 30 additions & 0 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"next": "^14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@acme/components": "workspace:*",
"@acme/style-guide": "workspace:*",
"@acme/tailwind": "workspace:*",
"@tsconfig/next": "^2.0.3",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.2.7",
"eslint": "~8.57.0",
"eslint-config-next": "^14.2.5",
"postcss": "^8.4.40",
"tailwindcss": "^3.4.7",
"typescript": "~5.5.4"
}
}
7 changes: 7 additions & 0 deletions apps/nextjs/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('postcss-load-config').Config} */
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
9 changes: 9 additions & 0 deletions apps/nextjs/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { config } from '@acme/components/tailwind';

export default config({
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
});
10 changes: 10 additions & 0 deletions apps/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@tsconfig/next/tsconfig.json",
"compilerOptions": {
"paths": {
"#/*": ["./app/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
14 changes: 7 additions & 7 deletions apps/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/node": "^2.9.1",
"@remix-run/react": "^2.9.1",
"@remix-run/serve": "^2.9.1",
"@remix-run/node": "^2.11.0",
"@remix-run/react": "^2.11.0",
"@remix-run/serve": "^2.11.0",
"isbot": "^4.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand All @@ -24,12 +24,12 @@
"@acme/components": "workspace:*",
"@acme/style-guide": "workspace:*",
"@acme/tailwind": "workspace:*",
"@remix-run/dev": "^2.9.1",
"@remix-run/dev": "^2.11.0",
"@tsconfig/remix": "^2.0.5",
"@types/react": "^18.2.73",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.2.7",
"typescript": "~5.4.5",
"vite": "~5.2.11",
"typescript": "~5.5.4",
"vite": "~5.2.13",
"vite-tsconfig-paths": "^4.2.1"
}
}
1 change: 1 addition & 0 deletions apps/remix/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('postcss-load-config').Config} */
module.exports = {
plugins: {
tailwindcss: {},
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "monoplate",
"private": true,
"scripts": {
"build": "turbo run build --cache-dir=.turbo",
Expand All @@ -18,16 +19,17 @@
},
"devDependencies": {
"@acme/style-guide": "workspace:*",
"@changesets/cli": "^2.27.1",
"@playwright/test": "^1.41.2",
"@changesets/cli": "^2.27.7",
"@playwright/test": "^1.45.3",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^20.12.8",
"@types/node": "^20.14.14",
"eslint": "~8.57.0",
"husky": "^9.0.11",
"husky": "^9.1.4",
"is-ci": "^3.0.1",
"lint-staged": "^15.0.2",
"lint-staged": "^15.2.8",
"prettier": "~3.2.5",
"syncpack": "^12.3.0",
"turbo": "latest"
}
"syncpack": "^12.4.0",
"turbo": "^2.0.11"
},
"packageManager": "pnpm@9.6.0"
}
12 changes: 6 additions & 6 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
"dependencies": {
"@acme/tailwind": "workspace:*",
"react": "^18.3.1",
"react-aria-components": "^1.2.0"
"react-aria-components": "^1.3.1"
},
"devDependencies": {
"@acme/style-guide": "workspace:*",
"@acme/vite": "workspace:*",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^15.0.6",
"@testing-library/user-event": "^14.5.2",
"@tsconfig/vite-react": "^2.0.1",
"@types/react": "^18.2.73",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.2.7",
"happy-dom": "^14.7.1",
"typescript": "~5.4.5",
"vite": "~5.2.11",
"happy-dom": "^14.12.3",
"typescript": "~5.5.4",
"vite": "~5.2.13",
"vitest": "^1.5.3"
}
}
1 change: 1 addition & 0 deletions packages/components/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
'use client';
export * from './Button';
export * from './utils';
6 changes: 3 additions & 3 deletions packages/react-package-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"@acme/style-guide": "workspace:*",
"@acme/vite": "workspace:*",
"@tsconfig/vite-react": "^2.0.1",
"@types/react": "^18.2.73",
"typescript": "~5.4.5",
"vite": "~5.2.11",
"@types/react": "^18.3.3",
"typescript": "~5.5.4",
"vite": "~5.2.13",
"vitest": "^1.5.3"
}
}
Loading

0 comments on commit 95e1c8b

Please sign in to comment.