Skip to content

Commit

Permalink
Merge pull request #5 from daltonmenezes/build/migrate-to-turborepo
Browse files Browse the repository at this point in the history
build: migrate to turborepo
  • Loading branch information
daltonmenezes authored Aug 12, 2024
2 parents 55ebc69 + 993eeab commit 711d403
Show file tree
Hide file tree
Showing 200 changed files with 3,268 additions and 1,479 deletions.
5 changes: 0 additions & 5 deletions .env.example

This file was deleted.

53 changes: 26 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

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

# testing
/coverage
# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# next.js
/.next/
/out/
# Testing
coverage

# production
/build
# Turbo
.turbo

# misc
.DS_Store
*.pem
# Vercel
.vercel

# debug
# Build Outputs
.next/
out/
build
dist


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

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.contentlayer/
# Misc
.DS_Store
*.pem
29 changes: 22 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" }
],

"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
Expand All @@ -14,19 +19,29 @@
".vscode/css.json"
],

"[javascript]": {
"editor.formatOnSave": true
"[javascript]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},

"[typescript]": {
"editor.formatOnSave": true
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},

"[typescriptreact]": {
"editor.formatOnSave": true
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},

"[json]": {
"editor.formatOnSave": true
}
"eslint.validate": [
"javascript",
"typescript"
],
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p align="center">
<a href="#opendocs">
<img alt="preview" src="./public/og.jpg" width="100%">
<img alt="preview" src="./apps/web/public/og.jpg" width="100%">
</a>
</p>

Expand All @@ -28,6 +28,7 @@
</p>

## 🎉 Features

- 🕸️ Site
- 📄 Docs
- ✍️ Blog
Expand Down Expand Up @@ -55,6 +56,7 @@ and more...
Visit https://opendocs.daltonmenezes.com/docs to view the documentation.

## 💬 Contributing

> **Note**: contributions are always welcome, but always **ask first**, — please — before work on a PR.
That said, there's a bunch of ways you can contribute to this project, like by:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is with happiness that I announce that blogs have arrived at opendocs! 🎉

Now you can create and manage blogs with ease and speed.

To get started, just add a new `.mdx` file to the `./content/blog/[language]` directory and it will be automatically displayed on the blog page.
To get started, just add a new `.mdx` file to the `apps/content/blog/[language]` directory and it will be automatically displayed on the blog page.

In addition, you can count on features such as:

Expand All @@ -25,8 +25,8 @@ In addition, you can count on features such as:

## Customizing the blog

You can customize the blog according to your needs, just edit the `./src/config/blog.ts` file. That simple!
You can customize the blog according to your needs, just edit the `src/config/blog.ts` file. That simple!

To better understand what is possible in the `.mdx` files, you can consult the example files in the `./content/blog/[language]` directory.
To better understand what is possible in the `.mdx` files, you can consult the example files in the `apps/content/blog/[language]` directory.


File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags: [next.js, blog, static blog, tailwind, mdx, contentlayer]

Agora você poderá criar e gerenciar blogs com facilidade e rapidez.

Para começar, basta adicionar um novo arquivo `.mdx` ao diretório `./content/blog/[idioma]` e ele será automaticamente exibido na página de blog.
Para começar, basta adicionar um novo arquivo `.mdx` ao diretório `apps/content/blog/[idioma]` e ele será automaticamente exibido na página de blog.

Além disso, você poderá contar com recursos como:

Expand All @@ -25,8 +25,8 @@ Além disso, você poderá contar com recursos como:

## Customizando o blog

Você pode customizar o blog de acordo com suas necessidades, basta editar o arquivo `./src/config/blog.ts`. Simples assim!
Você pode customizar o blog de acordo com suas necessidades, basta editar o arquivo `src/config/blog.ts`. Simples assim!

Para compreender melhor sobre o que é possível fazer nos arquivos `.mdx`, você pode consultar os arquivos de exemplo no diretório `./content/blog/[idioma]`.
Para compreender melhor sobre o que é possível fazer nos arquivos `.mdx`, você pode consultar os arquivos de exemplo no diretório `apps/content/blog/[idioma]`.


File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description: Add new documents to your documentation site and blog.

# For documentation

1. Create a new `.mdx` file in the `content/docs/[language]` folder with the content of your document.
1. Create a new `.mdx` file in the `apps/content/docs/[language]` folder with the content of your document.
2. Add the document to the site's navigation menu.
To do this, add a new item to the `src/config/docs.ts` file in the `sidebarNav` property with the desired information, just follow the pattern of the existing items. By doing this, the document will also be added to the search command palette.

# For the Blog

Just create a new `.mdx` file in the `content/blog/[language]` folder with the content of your post.
Just create a new `.mdx` file in the `apps/content/blog/[language]` folder with the content of your post.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To customize your documentation site, you can check the files and folders below:

## MDX Document Settings

MDX documents are stored in the `content/docs/[language]` and `content/blog/[language]` folder. Each document is an MDX file that contains a header with metadata, such as title and description. Below is an example of a document header:
MDX documents are stored in the `apps/content/docs/[language]` and `apps/content/blog/[language]` folder. Each document is an MDX file that contains a header with metadata, such as title and description. Below is an example of a document header:

```mdx
---
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description: Adicione novos documentos ao seu site de documentação e blog.

# Para documentação

1. Crie um novo arquivo `.mdx` na pasta `content/docs/[idioma]` com o conteúdo do seu documento.
1. Crie um novo arquivo `.mdx` na pasta `apps/content/docs/[idioma]` com o conteúdo do seu documento.
2. Adicione o documento ao menu de navegação do site.
Para isso, adicione um novo item ao arquivo `src/config/docs.ts` na propriedade `sidebarNav` com as informações desejadas, basta seguir o padrão dos itens já existentes. Ao fazer isso, o documento também será adicionado à paleta de comandos de pesquisa.

# Para o Blog

Basta criar um novo arquivo `.mdx` na pasta `content/blog/[idioma]` com o conteúdo do seu post.
Basta criar um novo arquivo `.mdx` na pasta `apps/content/blog/[idioma]` com o conteúdo do seu post.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Para personalizar seu site de documentação, você pode checar os arquivos e pa

## Configurações dos documentos MDX

Os documentos MDX são armazenados na pasta `content/docs/[idioma]` ou `content/blog/[idioma]`. Cada documento é um arquivo MDX que contém um cabeçalho com metadados, como título e descrição. Abaixo está um exemplo de cabeçalho de documento:
Os documentos MDX são armazenados na pasta `apps/content/docs/[idioma]` ou `apps/content/blog/[idioma]`. Cada documento é um arquivo MDX que contém um cabeçalho com metadados, como título e descrição. Abaixo está um exemplo de cabeçalho de documento:

```mdx
---
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["@opendocs/eslint-config/next.js"],
parserOptions: {
project: true,
},
};
39 changes: 39 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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*

# env files (can opt-in for commiting if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# content layer
.contentlayer/
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion contentlayer.config.ts → apps/web/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export const Blog = defineDocumentType(() => ({

export default makeSource({
documentTypes: [Doc, Blog],
contentDirPath: './content',
contentDirPath: '../content',
contentDirInclude: ['docs', 'blog'],

mdx: {
Expand Down
File renamed without changes.
File renamed without changes.
84 changes: 84 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"name": "opendocs-web",
"version": "3.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "run-s contentlayer:build next:build",
"start": "next start",
"lint": "next lint",
"lint:fix": "eslint --fix .",
"next:build": "next build",
"contentlayer:build": "contentlayer2 build"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-collapsible": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
"contentlayer2": "^0.5.0",
"date-fns": "^3.6.0",
"deepmerge": "^4.3.1",
"feed": "^4.2.2",
"framer-motion": "^11.3.8",
"geist": "^1.3.1",
"lucide-react": "0.414.0",
"markdown-wasm": "^1.2.0",
"mdx-bundler": "^10.0.2",
"next": "14.2.5",
"next-contentlayer2": "^0.5.0",
"next-intl": "^3.17.2",
"next-themes": "^0.3.0",
"normalize-path": "^3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-wrap-balancer": "^1.1.1",
"sharp": "^0.33.4",
"simplex-noise": "^4.0.2",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@opendocs/eslint-config": "workspace:*",
"@opendocs/typescript-config": "workspace:*",
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "8.57.0",
"eslint-config-next": "14.2.5",
"@babel/core": "^7.24.9",
"@types/normalize-path": "^3.0.2",
"autoprefixer": "^10.4.19",
"concurrently": "^8.2.2",
"esbuild": "0.23.0",
"mdast-util-toc": "^7.1.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.39",
"pretty-quick": "^4.0.0",
"rehype": "^13.0.1",
"rehype-autolink-headings": "^7.1.0",
"rehype-pretty-code": "^0.13.2",
"rehype-slug": "^6.0.0",
"remark": "^15.0.1",
"remark-code-import": "^1.2.0",
"remark-gfm": "^4.0.0",
"shiki": "^1.11.0",
"tailwindcss": "^3.4.6",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0"
}
}
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export const GET = async (_: Request, { params }: StaticParams) => {
})

const feed = blogConfig.rss.find((rss) => rss.file === params.feed)
const contentType = feed?.contentType || blogConfig.rss?.[0]?.contentType

const contentType = String(
feed?.contentType || blogConfig.rss?.[0]?.contentType
)

return new NextResponse(websiteFeed, {
status: websiteFeed ? 200 : 404,
Expand All @@ -128,6 +131,7 @@ export const dynamicParams = true
export const dynamic = 'force-static'

const VERCEL_REVALIDATE = Number(
// eslint-disable-next-line turbo/no-undeclared-env-vars
process.env.NEXT_PUBLIC_VERCEL_REVALIDATE_TIME || 300
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 711d403

Please sign in to comment.