Skip to content

plugin: Automatic MDX docs #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 48 commits into
base: with/green-stack
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0f027ef
feat: Add MDX support for Expo
codinsonn Apr 9, 2024
9ed2846
feat: Add MDX support for Next.js
codinsonn Apr 9, 2024
1956140
feat: Add MarkdownImage component
codinsonn Jul 24, 2024
91605d0
feat: Add MDX docs app with Nextra
codinsonn Apr 19, 2024
e8b0a70
feat: Add 'with/mdx-docs-nextra' to list of plugins
codinsonn Apr 20, 2024
13a72c6
chore: Add docs for Turborepo plugin
codinsonn Apr 21, 2024
9e56141
feat: Include docs for GREEN stack plugin
codinsonn Jul 26, 2024
5dffa9d
feat: Merge plugin 'with/mdx-docs-nextra'
codinsonn Aug 20, 2024
e22b9e5
feat: Add FullProdct.dev docs
codinsonn Aug 22, 2024
b008f9c
chore: Add beta disclaimer to docs for now
codinsonn Aug 22, 2024
3f8195a
chore: Merge updates from 'with/green-stack'
codinsonn Sep 26, 2024
8e93d86
feat: Move MarkdownScreen to /demos/
codinsonn Sep 26, 2024
6658848
startup-sin: Finish implementing Dark Mode
codinsonn Oct 4, 2024
0c067b2
chore: Merge updates from 'with/green-stack'
codinsonn Oct 4, 2024
46f7937
chore: Merge changes from 'with/green-stack'
codinsonn Oct 7, 2024
5e36f18
feat: Add Component Docs Previews
codinsonn Oct 7, 2024
7a2609c
feat: Add initeractive props table
codinsonn Oct 9, 2024
d84d23d
chore: Merge updates from 'with/green-stack'
codinsonn Oct 11, 2024
69fc7fd
chore: Merge updates from 'with/green-stack'
codinsonn Oct 11, 2024
df4b58e
feat: Sync component docs preview props to url params
codinsonn Oct 11, 2024
f3af472
chore: Update to Nextra V3
codinsonn Oct 15, 2024
0be6d7d
feat: Add autogenerate-docs script
codinsonn Oct 18, 2024
c396e33
chore: Merge changes from 'with/green-stack'
codinsonn Oct 20, 2024
0c78792
feat: Add highlights to the Quickstart docs page
codinsonn Oct 22, 2024
8737d8c
feat: Update Core GREEN stack docs
codinsonn Oct 27, 2024
c651479
feat: Add schema generator
codinsonn Oct 27, 2024
9301326
chore: Merge updates from 'with/green-stack'
codinsonn Oct 27, 2024
59a6760
chore: Merge fixes from 'with/green-stack'
codinsonn Oct 27, 2024
e0aab47
fix: Preserve component casing in sidebar when regenerating docs
codinsonn Oct 28, 2024
30aa784
feat: Add docs for data resolver, fetching and app config
codinsonn Nov 22, 2024
c5767c6
chore: Merge changes from 'with/green-stack'
codinsonn Nov 22, 2024
5e6ba04
chore: Hide unfinished docs in sidebar for now
codinsonn Nov 24, 2024
b33a14a
feat: Add Form Management Docs
codinsonn Nov 29, 2024
2954b47
fix: Apply correct import path in regenerate docs script
codinsonn Nov 29, 2024
fd2d0ca
chore: Merge SDK 52 update from 'with/green-stack'
codinsonn Dec 6, 2024
dfb9e06
chore: Merge next 15 update from 'with/green-stack'
codinsonn Dec 9, 2024
ae4bd98
chore: Merge select fix from 'with/green-stack'
codinsonn Dec 11, 2024
8c62cda
chore: Update @types/react
codinsonn Dec 11, 2024
2c82020
feat: Revamp FormScreen efficiency calculator
codinsonn Dec 13, 2024
4156f65
chore: Merge changes from 'with/green-stack'
codinsonn Dec 13, 2024
45faa1a
chore: Fix FormsScreen docgen
codinsonn Dec 13, 2024
fd884d9
chore: Generate docs for FormScreen
codinsonn Dec 13, 2024
1ea22a8
chore: Merge changes from 'with/green-stack'
codinsonn Dec 13, 2024
969d41c
chore: Merge updates from 'with/green-stack'
codinsonn Jan 1, 2025
8e1e4b6
chore: Merge changes from 'with/green-stack'
codinsonn Jan 19, 2025
93f4d1e
feat: Save whether to show code or not in docs to URL
codinsonn Jan 19, 2025
1d2b238
chore: Merge changes from 'with/green-stack'
codinsonn Mar 17, 2025
0dd6d9c
feat: Add FullProduct.dev footer to docs
codinsonn Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions apps/docs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## --- Notes ----------------------------------------------------------------------------------- */

## -i- The `.env.example` file can be copied into `.env.local` using `npx turbo env:local`
## -i- For development, staging & production environments, check the next.js docs:
## -i- https://nextjs.org/docs/app/building-your-application/configuring/environment-variables

## -i- Note that you should treat environment variables as if they could be inlined in your bundle during builds & deployments
## -i- This means dynamically retrieving environment variables from e.g. `process.env[someKey]` might not work
## -i- It also means that you should never prefix with `NEXT_PUBLIC_` for sensitive / private keys

## -i- We suggest that for each environment variable you add here, you also add an entry in `appConfig.ts`
## -i- There, you can add logic like ```envValue: process.env.NEXT_PUBLIC_ENV_KEY || process.env.EXPO_PUBLIC_ENV_KEY```
## -i- Where you would only define the NEXT_PUBLIC_ prefixed versions here in `.env.local` locally and using Next.js UI for deployed envs
## -i- For environment variables you only be available server-side, you can omit `NEXT_PUBLIC_`

NEXT_PUBLIC_APP_ENV=next

## --- General --------------------------------------------------------------------------------- */
## -i- Env vars that should always be present & the same locally, independent of the simulated environment
## --------------------------------------------------------------------------------------------- */

APP_SECRET="your-secret-here" # used for signing header context, generate a random string

## --- LOCAL ----------------------------------------------------------------------------------- */
## -i- Defaults you might want to switch out for local development by commenting / uncommenting
## --------------------------------------------------------------------------------------------- */

NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000/api
NEXT_PUBLIC_GRAPH_URL=http://localhost:3000/api/graphql

# DB_URL= # TODO: Add DB layer connection for full local dev...

## --- DEV ------------------------------------------------------------------------------------- */
# -i- Uncomment while on development branch to simulate the dev environment
## --------------------------------------------------------------------------------------------- */

# DB_URL= # TODO: Add DB layer connection for the dev environment...

## --- STAGE ----------------------------------------------------------------------------------- */
# -i- Uncomment while on staging branch to simulate the stage environment
## --------------------------------------------------------------------------------------------- */

# DB_URL= # TODO: Add DB layer connection for the stage environment...

## --- PROD ------------------------------------------------------------------------------------ */
# -i- Uncomment while on main branch to simulate the production environment
## --------------------------------------------------------------------------------------------- */

# DB_URL= # TODO: Add DB layer connection for the production environment...
14 changes: 14 additions & 0 deletions apps/docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
['@babel.plugin-transform-react-jsx', {
runtime: 'automatic',
importSource: 'nativewind',
jsxImportSource: 'nativewind',
}]
]
}
}
8 changes: 8 additions & 0 deletions apps/docs/components/Button.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as AppButton from '@app/components/Button'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const Button = AppButton.Button
export const ButtonProps = AppButton.ButtonProps
8 changes: 8 additions & 0 deletions apps/docs/components/Checkbox.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as AppCheckbox from '@app/core/forms/Checkbox.styled'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const Checkbox = AppCheckbox.Checkbox
export const CheckboxProps = AppCheckbox.CheckboxProps
8 changes: 8 additions & 0 deletions apps/docs/components/Checklist.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as AppCheckList from '@app/core/forms/CheckList.styled'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const CheckList = AppCheckList.CheckList
export const CheckListProps = AppCheckList.CheckListProps
12 changes: 12 additions & 0 deletions apps/docs/components/NumberStepper.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as AppNumberStepper from '@app/core/forms/NumberStepper.styled'
import { styled } from '@app/primitives'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const NumberStepper = styled(AppNumberStepper.NumberStepper, '', {
textInputClassName: 'bg-transparent',
})

export const NumberStepperProps = AppNumberStepper.NumberStepperProps
14 changes: 14 additions & 0 deletions apps/docs/components/RadioGroup.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as AppRadioGroup from '@app/core/forms/RadioGroup.styled'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const RadioGroup = AppRadioGroup.RadioGroup
export const RadioGroupProps = AppRadioGroup.RadioGroupProps

export const RadioGroupContext = AppRadioGroup.RadioGroupContext
export const useRadioGroupContext = AppRadioGroup.useRadioGroupContext

export const RadioButton = AppRadioGroup.RadioButton
export const RadioButtonProps = AppRadioGroup.RadioButtonProps
40 changes: 40 additions & 0 deletions apps/docs/components/Select.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import * as AppSelect from '@app/core/forms/Select.styled'
import { styled } from '@app/primitives'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const SelectContext = AppSelect.SelectContext
export const useSelectContext = AppSelect.useSelectContext

export const SelectTrigger = AppSelect.SelectTrigger
export const SelectTriggerProps = AppSelect.SelectTriggerProps

export const SelectScrollButton = AppSelect.SelectScrollButton
export const SelectScrollButtonProps = AppSelect.SelectScrollButtonProps

export const SelectContent = AppSelect.SelectContent
export const SelectContentProps = AppSelect.SelectContentProps

export const SelectLabel = AppSelect.SelectLabel
export const SelectLabelProps = AppSelect.SelectLabelProps

export const SelectItem = AppSelect.SelectItem
export const SelectItemProps = AppSelect.SelectItemProps

export const SelectSeparator = AppSelect.SelectSeparator
export const SelectSeparatorProps = AppSelect.SelectSeparatorProps

export const SelectProps = AppSelect.SelectProps
export const Select = Object.assign(styled(AppSelect.Select, 'bg-transparent', {
triggerClassName: 'bg-transparent',
}), {
displayName: 'Select',
Option: SelectItem,
Item: SelectItem,
Separator: SelectSeparator,
Group: AppSelect.Select.Group,
Label: SelectLabel,
Content: SelectContent,
})
8 changes: 8 additions & 0 deletions apps/docs/components/Switch.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as AppSwitch from '@app/core/forms/Switch.styled'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const Switch = AppSwitch.Switch
export const SwitchProps = AppSwitch.SwitchProps
9 changes: 9 additions & 0 deletions apps/docs/components/TextArea.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as AppTextArea from '@app/core/forms/TextArea.styled'
import { styled } from '@app/primitives'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const TextArea = styled(AppTextArea.TextArea, 'bg-transparent')
export const TextAreaProps = AppTextArea.TextAreaProps
9 changes: 9 additions & 0 deletions apps/docs/components/TextInput.docs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as AppTextInput from '@app/core/forms/TextInput.styled'
import { styled } from '@app/primitives'

/* --- Documentation overrides? ---------------------------------------------------------------- */

// -i- Optionally wrap and edit these to restyle the component for the docs

export const TextInput = styled(AppTextInput.TextInput, 'bg-transparent')
export const TextInputProps = AppTextInput.TextInputProps
203 changes: 203 additions & 0 deletions apps/docs/docs.theme.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
import { useRouter } from 'next/router'

/* --- Theme ----------------------------------------------------------------------------------- */

/** @type {import('nextra-theme-docs').DocsThemeConfig} */
export default {
logo: (
<div className="relative flex flex-row items-center">
<img
className="rounded-md"
src="/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fgreen-stack-logo.b8051d21.png&w=128&q=75"
width="30"
height="30"
/>
<div className="w-3"></div>
<span><strong>FullProduct.dev</strong> ⚡️ Universal App Starter</span>
</div>
),
logoLink: 'https://fullproduct.dev',
project: {
link: 'https://github.com/Aetherspace/green-stack-starter-demo?tab=readme-ov-file#:Rr9ab:',
},
navigation: true,
sidebar: {
autoCollapse: true,
defaultMenuCollapseLevel: 3,
toggleButton: true,
},
docsRepositoryBase: 'https://github.com/Aetherspace/green-stack-starter-demo',
editLink: {
component: null,
},
darkMode: true,
footer: {
content: (
<div className="flex w-full justify-center items-center bg-transparent">
<div className="flex flex-col md:flex-row w-full max-w-[90rem] px-0 lg:px-8 justify-between">
<div className="flex flex-col max-w-[364px]">
<a
className="text-link flex flex-row no-underline"
href="https://fullproduct.dev"
>
<div className="w-12 h-12">
<img
alt="FullProduct.dev Starterkit Logo"
loading="lazy"
decoding="async"
data-nimg="fill"
className="w-full h-full"
sizes="100vw"
src="/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fgreen-stack-logo.b8051d21.png&amp;w=3840&amp;q=75"
style={{
height: '100%',
width: '100%',
inset: '0px',
objectFit: 'cover',
color: 'transparent',
}}
/>
</div>
<div className="w-3" />
<div className="flex flex-col justify-center h-12">
<div dir="auto" className="flex font-bold text-left text-primary text-lg">
FullProduct.dev 🚀
</div>
<div dir="auto" className="flex text-left font-medium text-muted text-sm mt-[-3px]">
Universal Base Starterkit
</div>
</div>
</a>
<div className="w-4 h-4" />
<a
className="text-link flex flex-row items-center no-underline h-10 bg-secondary-foreground max-w-[258px] px-4 rounded-lg"
target="_blank"
href="https://codinsonn.dev"
>
<div className="flex flex-row items-center">
<div className="flex flex-row h-10 items-center">
<div dir="auto" className="flex text-sm text-secondary">
By
</div>
</div>
<div className="w-2" />
<div className="flex w-7 h-7" style={{ width: '28px', height: '28px' }}>
<img
alt="Thorr / codinsonn's Profile Picture"
loading="lazy"
decoding="async"
className="flex rounded-full w-full h-full"
src="https://codinsonn.dev/_next/image?url=%2Fimg%2FCodelyFansLogoPic160x160.jpeg&amp;w=256&amp;q=75"
style={{
height: '100%',
width: '100%',
inset: '0px',
objectFit: 'cover',
color: 'transparent',
}}
/>
</div>
<div className="w-2" />
<div className="flex flex-row h-10 items-center">
<div dir="auto" className="css-text-146c3p1 text-sm text-secondary font-bold">
Thorr ⚡️ codinsonn.dev
</div>
</div>
</div>
</a>
<div className="w-4 h-4" />
<div dir="auto" className="css-text-146c3p1 text-muted">
FullProduct.dev is a product of 'Aetherspace Digital' (registered in Belgium under 0757.590.784)
</div>
<div className="w-2 h-2" />
<div dir="auto" className="css-text-146c3p1 text-muted italic">
For support or inquiries, please <a className="text-link underline" href="mailto:[email protected]">contact us</a>
</div>
</div>
<div className="h-12 md:h-0" />
<div className="flex flex-row">
<div className="flex flex-col">
<div dir="auto" className="css-text-146c3p1 text-primary font-bold text-lg">
The GREEN stack
</div>
<div className="h-2" />
<a className="underline text-muted" target="_blank" href="https://graphql.org/learn/">
GraphQL
</a>
<div className="h-1" />
<a className="underline text-muted" target="_blank" href="https://18.react.dev/">
React
</a>
<div className="h-1" />
<a className="underline text-muted" target="_blank" href="https://docs.expo.dev/">
Expo
</a>
<div className="h-1" />
<a className="underline text-muted" target="_blank" href="https://nextjs.org/docs">
Next.js
</a>
<div className="h-1" />
</div>
<div className="w-12" />
<div className="flex flex-col">
<div dir="auto" className="css-text-146c3p1 text-primary font-bold text-lg">
Product
</div>
<div className="h-2" />
<a className="underline text-muted" target="_blank" href="https://fullproduct.dev/docs">
Starterkit Docs
</a>
<div className="h-1" />
<a className="underline text-muted" href="https://fullproduct.dev/sign-up">
Sign-Up
</a>
<div className="h-1" />
<a className="underline text-muted" href="https://fullproduct.dev/sign-in">
Sign-In
</a>
<div className="h-1" />
<a className="underline text-muted" href="https://fullproduct.dev/demos">
Demo
</a>
<div className="h-1" />
</div>
<div className="w-12" />
<div className="flex flex-col">
<div dir="auto" className="css-text-146c3p1 text-primary font-bold text-lg">
Legal
</div>
<div className="h-2" />
<a className="underline text-muted" href="https://fullproduct.dev/eula">
License Terms (EULA)
</a>
<div className="h-1" />
<a className="underline text-muted" href="https://fullproduct.dev/privacy-policy">
Privacy Policy
</a>
<div className="h-1" />
<a className="underline text-muted" href="https://fullproduct.dev/cookie-policy">
Cookie Policy
</a>
<div className="h-1" />
</div>
</div>
</div>
</div>
),
},
useNextSeoProps() {
const { asPath } = useRouter()
if (asPath === '/') {
return {
title: 'FullProduct.dev ⚡️ Universal Base Starter',
}
} else if (asPath.includes('plugins')) {
return {
titleTemplate: 'FullProduct.dev ⚡️ %s Plugin - Universal Base Starter Docs',
}
}
return {
titleTemplate: 'FullProduct.dev | %s - Universal Base Starter Docs',
}
}
}
Loading