diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 722600a..296be0b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,8 @@ jobs: name: build-artifacts path: | apps/next-auth/dist/ - apps/teste/dist/ + apps/home/dist/ + apps/next-introdutorio/dist/ deploy: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 6211ed5..672dd01 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ 1. Adicione o app dentro da pasta "apps" 2. Altere a matriz na github action para fazer o deploy do app específico + 1. Altere também a parte de artifacts na action 3. Altere o base path no app para que o app funcione no path específico. 1. No caso do app Next Auth, por exemplo: - Base Path: `/next-auth/` \ No newline at end of file diff --git a/apps/teste/.astro/types.d.ts b/apps/teste/.astro/types.d.ts new file mode 100644 index 0000000..6be8ed8 --- /dev/null +++ b/apps/teste/.astro/types.d.ts @@ -0,0 +1,148 @@ +declare module 'astro:content' { + interface Render { + '.mdx': Promise<{ + Content: import('astro').MarkdownInstance<{}>['Content']; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + }>; + } +} + +declare module 'astro:content' { + interface Render { + '.md': Promise<{ + Content: import('astro').MarkdownInstance<{}>['Content']; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + }>; + } +} + +declare module 'astro:content' { + type Flatten = T extends { [K: string]: infer U } ? U : never; + + export type CollectionKey = keyof AnyEntryMap; + export type CollectionEntry = Flatten; + + export type ContentCollectionKey = keyof ContentEntryMap; + export type DataCollectionKey = keyof DataEntryMap; + + type AllValuesOf = T extends any ? T[keyof T] : never; + type ValidContentEntrySlug = AllValuesOf< + ContentEntryMap[C] + >['slug']; + + export function getEntryBySlug< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + // Note that this has to accept a regular string too, for SSR + entrySlug: E + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + + export function getDataEntryById( + collection: C, + entryId: E + ): Promise>; + + export function getCollection>( + collection: C, + filter?: (entry: CollectionEntry) => entry is E + ): Promise; + export function getCollection( + collection: C, + filter?: (entry: CollectionEntry) => unknown + ): Promise[]>; + + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >(entry: { + collection: C; + slug: E; + }): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >(entry: { + collection: C; + id: E; + }): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + slug: E + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >( + collection: C, + id: E + ): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + + /** Resolve an array of entry references from the same collection */ + export function getEntries( + entries: { + collection: C; + slug: ValidContentEntrySlug; + }[] + ): Promise[]>; + export function getEntries( + entries: { + collection: C; + id: keyof DataEntryMap[C]; + }[] + ): Promise[]>; + + export function reference( + collection: C + ): import('astro/zod').ZodEffects< + import('astro/zod').ZodString, + C extends keyof ContentEntryMap + ? { + collection: C; + slug: ValidContentEntrySlug; + } + : { + collection: C; + id: keyof DataEntryMap[C]; + } + >; + // Allow generic `string` to avoid excessive type errors in the config + // if `dev` is not running to update as you edit. + // Invalid collection names will be caught at build time. + export function reference( + collection: C + ): import('astro/zod').ZodEffects; + + type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; + type InferEntrySchema = import('astro/zod').infer< + ReturnTypeOrOriginal['schema']> + >; + + type ContentEntryMap = { + + }; + + type DataEntryMap = { + + }; + + type AnyEntryMap = ContentEntryMap & DataEntryMap; + + export type ContentConfig = never; +} diff --git a/apps/teste/.gitignore b/apps/teste/.gitignore deleted file mode 100644 index 6240da8..0000000 --- a/apps/teste/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# build output -dist/ -# generated types -.astro/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store diff --git a/apps/teste/README.md b/apps/teste/README.md deleted file mode 100644 index b51abaa..0000000 --- a/apps/teste/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Starlight Starter Kit: Basics - -[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) - -``` -npm create astro@latest -- --template starlight -``` - -[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics) -[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics) -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs) - -> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! - -## 🚀 Project Structure - -Inside of your Astro + Starlight project, you'll see the following folders and files: - -``` -. -├── public/ -├── src/ -│ ├── assets/ -│ ├── content/ -│ │ ├── docs/ -│ │ └── config.ts -│ └── env.d.ts -├── astro.config.mjs -├── package.json -└── tsconfig.json -``` - -Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. - -Images can be added to `src/assets/` and embedded in Markdown with a relative link. - -Static assets, like favicons, can be placed in the `public/` directory. - -## 🧞 Commands - -All commands are run from the root of the project, from a terminal: - -| Command | Action | -| :------------------------ | :----------------------------------------------- | -| `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:4321` | -| `npm run build` | Build your production site to `./dist/` | -| `npm run preview` | Preview your build locally, before deploying | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | -| `npm run astro -- --help` | Get help using the Astro CLI | - -## 👀 Want to learn more? - -Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). diff --git a/apps/teste/astro.config.mjs b/apps/teste/astro.config.mjs deleted file mode 100644 index 9ff6f9e..0000000 --- a/apps/teste/astro.config.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { defineConfig } from 'astro/config'; -import starlight from '@astrojs/starlight'; - -// https://astro.build/config -export default defineConfig({ - base: '/teste/', - integrations: [ - starlight({ - title: 'My Docs', - social: { - github: 'https://github.com/withastro/starlight', - }, - sidebar: [ - { - label: 'Guides', - items: [ - // Each item here is one entry in the navigation menu. - { label: 'Example Guide', link: '/guides/example/' }, - ], - }, - { - label: 'Reference', - autogenerate: { directory: 'reference' }, - }, - ], - }), - ], -}); diff --git a/apps/teste/package.json b/apps/teste/package.json deleted file mode 100644 index c25ad67..0000000 --- a/apps/teste/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "teste", - "type": "module", - "version": "0.0.1", - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro check && astro build", - "preview": "astro preview", - "astro": "astro" - }, - "dependencies": { - "@astrojs/starlight": "^0.24.2", - "astro": "^4.10.2", - "sharp": "^0.32.5", - "@astrojs/check": "^0.7.0", - "typescript": "^5.4.5" - } -} \ No newline at end of file diff --git a/apps/teste/public/favicon.svg b/apps/teste/public/favicon.svg deleted file mode 100644 index cba5ac1..0000000 --- a/apps/teste/public/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/teste/src/assets/houston.webp b/apps/teste/src/assets/houston.webp deleted file mode 100644 index 930c164..0000000 Binary files a/apps/teste/src/assets/houston.webp and /dev/null differ diff --git a/apps/teste/src/content/config.ts b/apps/teste/src/content/config.ts deleted file mode 100644 index 45f60b0..0000000 --- a/apps/teste/src/content/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineCollection } from 'astro:content'; -import { docsSchema } from '@astrojs/starlight/schema'; - -export const collections = { - docs: defineCollection({ schema: docsSchema() }), -}; diff --git a/apps/teste/src/content/docs/guides/example.md b/apps/teste/src/content/docs/guides/example.md deleted file mode 100644 index ebd0f3b..0000000 --- a/apps/teste/src/content/docs/guides/example.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Example Guide -description: A guide in my new Starlight docs site. ---- - -Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. -Writing a good guide requires thinking about what your users are trying to do. - -## Further reading - -- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework diff --git a/apps/teste/src/content/docs/index.mdx b/apps/teste/src/content/docs/index.mdx deleted file mode 100644 index 117179d..0000000 --- a/apps/teste/src/content/docs/index.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Welcome to Starlight -description: Get started building your docs site with Starlight. -template: splash -hero: - tagline: Congrats on setting up a new Starlight project! - image: - file: ../../assets/houston.webp - actions: - - text: Example Guide - link: /guides/example/ - icon: right-arrow - variant: primary - - text: Read the Starlight docs - link: https://starlight.astro.build - icon: external ---- - -import { Card, CardGrid } from '@astrojs/starlight/components'; - -## Next steps - - - - Edit `src/content/docs/index.mdx` to see this page change. - - - Add Markdown or MDX files to `src/content/docs` to create new pages. - - - Edit your `sidebar` and other config in `astro.config.mjs`. - - - Learn more in [the Starlight Docs](https://starlight.astro.build/). - - diff --git a/apps/teste/src/content/docs/reference/example.md b/apps/teste/src/content/docs/reference/example.md deleted file mode 100644 index 0224f09..0000000 --- a/apps/teste/src/content/docs/reference/example.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Example Reference -description: A reference page in my new Starlight docs site. ---- - -Reference pages are ideal for outlining how things work in terse and clear terms. -Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting. - -## Further reading - -- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework diff --git a/apps/teste/src/env.d.ts b/apps/teste/src/env.d.ts index acef35f..8c34fb4 100644 --- a/apps/teste/src/env.d.ts +++ b/apps/teste/src/env.d.ts @@ -1,2 +1 @@ -/// -/// +/// \ No newline at end of file diff --git a/apps/teste/tsconfig.json b/apps/teste/tsconfig.json deleted file mode 100644 index 77da9dd..0000000 --- a/apps/teste/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "astro/tsconfigs/strict" -} \ No newline at end of file