Skip to content

Commit 6076d26

Browse files
committed
prettier
1 parent e128f7f commit 6076d26

28 files changed

Lines changed: 3525 additions & 1672 deletions

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
77
workflow_dispatch:
88

@@ -31,4 +31,4 @@ jobs:
3131
steps:
3232
- name: Deploy to GitHub Pages
3333
id: deployment
34-
uses: actions/deploy-pages@v5
34+
uses: actions/deploy-pages@v5

.github/workflows/format.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check Formatting
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions: read
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v7
16+
17+
- name: Set up pnpm
18+
uses: pnpm/action-setup@v6
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 24
24+
cache: pnpm
25+
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile
28+
29+
- name: Check formatting
30+
run: pnpm format:check

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"tabWidth": 2,
3+
"plugins": ["prettier-plugin-astro", "prettier-plugin-sentences-per-line"],
4+
"overrides": [
5+
{
6+
"files": "*.mdx",
7+
"options": {
8+
"proseWrap": "preserve"
9+
}
10+
}
11+
]
12+
}

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
44

5-
Documentation site for **NextFTC v2**, built with [Astro](https://astro.build) and [Starlight](https://starlight.astro.build). Deployed to [beta.nextftc.dev](https://beta.nextftc.dev).
5+
Documentation site for **NextFTC v2**, built with [Astro](https://astro.build) and [Starlight](https://starlight.astro.build).
6+
Deployed to [beta.nextftc.dev](https://beta.nextftc.dev).
67

78
## 🚀 Project Structure
89

@@ -21,22 +22,24 @@ Documentation site for **NextFTC v2**, built with [Astro](https://astro.build) a
2122
└── tsconfig.json
2223
```
2324

24-
Starlight looks for `.md` or `.mdx` files in `src/content/docs/`. Each file is exposed as a route based on its file name.
25+
Starlight looks for `.md` or `.mdx` files in `src/content/docs/`.
26+
Each file is exposed as a route based on its file name.
2527

26-
Images can be added to `src/assets/` and embedded in Markdown with a relative link. Static assets, like favicons, go in `public/`.
28+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
29+
Static assets, like favicons, go in `public/`.
2730

2831
## 🧞 Commands
2932

3033
All commands are run from the root of the project, from a terminal:
3134

32-
| Command | Action |
33-
| :------------------- | :------------------------------------------------ |
34-
| `bun install` | Installs dependencies |
35-
| `bun dev` | Starts local dev server at `localhost:4321` |
36-
| `bun run build` | Build the production site to `./dist/` |
37-
| `bun preview` | Preview the build locally, before deploying |
38-
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
39-
| `bun astro -- --help` | Get help using the Astro CLI |
35+
| Command | Action |
36+
| :-------------------- | :----------------------------------------------- |
37+
| `bun install` | Installs dependencies |
38+
| `bun dev` | Starts local dev server at `localhost:4321` |
39+
| `bun run build` | Build the production site to `./dist/` |
40+
| `bun preview` | Preview the build locally, before deploying |
41+
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
42+
| `bun astro -- --help` | Get help using the Astro CLI |
4043

4144
## Deployment
4245

astro.config.mjs

Lines changed: 80 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,86 @@
11
// @ts-check
2-
import { defineConfig } from 'astro/config';
3-
import starlight from '@astrojs/starlight';
4-
import starlightThemeGalaxy from 'starlight-theme-galaxy';
5-
import starlightSidebarTopics from 'starlight-sidebar-topics';
6-
import starlightLinksValidator from 'starlight-links-validator';
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
import starlightThemeGalaxy from "starlight-theme-galaxy";
5+
import starlightSidebarTopics from "starlight-sidebar-topics";
6+
import starlightLinksValidator from "starlight-links-validator";
77

88
// https://astro.build/config
99
export default defineConfig({
10-
site: 'https://beta.nextftc.dev',
11-
integrations: [
12-
starlight({
13-
title: 'NextFTC',
14-
logo: {
15-
light: './src/assets/nextftc-banner-light.png',
16-
dark: './src/assets/nextftc-banner-dark.png',
17-
replacesTitle: true,
10+
site: "https://beta.nextftc.dev",
11+
integrations: [
12+
starlight({
13+
title: "NextFTC",
14+
logo: {
15+
light: "./src/assets/nextftc-banner-light.png",
16+
dark: "./src/assets/nextftc-banner-dark.png",
17+
replacesTitle: true,
18+
},
19+
favicon: "/favicon.svg",
20+
customCss: ["./src/styles/custom.css"],
21+
social: [
22+
{
23+
icon: "github",
24+
label: "GitHub",
25+
href: "https://github.com/NextFTC/NextFTCSuite",
26+
},
27+
{
28+
icon: "discord",
29+
label: "Discord",
30+
href: "https://nextftc.dev/discord",
31+
},
32+
],
33+
plugins: [
34+
starlightSidebarTopics([
35+
{
36+
label: "Introduction",
37+
link: "/introduction/",
38+
icon: "rocket",
39+
items: [{ autogenerate: { directory: "introduction" } }],
1840
},
19-
favicon: '/favicon.svg',
20-
customCss: ['./src/styles/custom.css'],
21-
social: [
22-
{ icon: 'github', label: 'GitHub', href: 'https://github.com/NextFTC/NextFTCSuite' },
23-
{ icon: 'discord', label: 'Discord', href: 'https://nextftc.dev/discord' },
24-
],
25-
plugins: [
26-
starlightSidebarTopics([
27-
{
28-
label: 'Introduction',
29-
link: '/introduction/',
30-
icon: 'rocket',
31-
items: [{ autogenerate: { directory: 'introduction' } }],
32-
},
33-
{
34-
label: 'Your First Robot',
35-
link: '/your-first-robot/',
36-
icon: 'star',
37-
items: [{ autogenerate: { directory: 'your-first-robot' } }],
38-
},
39-
{
40-
label: 'Robot Module',
41-
link: '/robot/',
42-
icon: 'puzzle',
43-
items: [{ autogenerate: { directory: 'robot' } }],
44-
},
45-
{
46-
label: 'Hardware Module',
47-
link: '/hardware/',
48-
icon: 'setting',
49-
items: [
50-
{
51-
label: 'Actuators',
52-
items: [{ autogenerate: { directory: 'hardware/actuators' } }],
53-
},
54-
{
55-
label: 'Sensors',
56-
items: [{ autogenerate: { directory: 'hardware/sensors' } }],
57-
},
58-
{
59-
label: 'Miscellaneous',
60-
items: [{ autogenerate: { directory: 'hardware/miscellaneous' } }],
61-
},
62-
],
63-
},
64-
{
65-
label: 'Control Module',
66-
link: '/control/',
67-
icon: 'document',
68-
items: [{ autogenerate: { directory: 'control' } }],
69-
},
70-
]),
71-
starlightThemeGalaxy(),
72-
starlightLinksValidator(),
73-
]
74-
}),
75-
],
41+
{
42+
label: "Your First Robot",
43+
link: "/your-first-robot/",
44+
icon: "star",
45+
items: [{ autogenerate: { directory: "your-first-robot" } }],
46+
},
47+
{
48+
label: "Robot Module",
49+
link: "/robot/",
50+
icon: "puzzle",
51+
items: [{ autogenerate: { directory: "robot" } }],
52+
},
53+
{
54+
label: "Hardware Module",
55+
link: "/hardware/",
56+
icon: "setting",
57+
items: [
58+
{
59+
label: "Actuators",
60+
items: [{ autogenerate: { directory: "hardware/actuators" } }],
61+
},
62+
{
63+
label: "Sensors",
64+
items: [{ autogenerate: { directory: "hardware/sensors" } }],
65+
},
66+
{
67+
label: "Miscellaneous",
68+
items: [
69+
{ autogenerate: { directory: "hardware/miscellaneous" } },
70+
],
71+
},
72+
],
73+
},
74+
{
75+
label: "Control Module",
76+
link: "/control/",
77+
icon: "document",
78+
items: [{ autogenerate: { directory: "control" } }],
79+
},
80+
]),
81+
starlightThemeGalaxy(),
82+
starlightLinksValidator(),
83+
],
84+
}),
85+
],
7686
});

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"build": "astro build",
99
"preview": "astro preview",
1010
"astro": "astro",
11-
"check": "astro check"
11+
"check": "astro check",
12+
"format": "prettier --write .",
13+
"format:check": "prettier --check ."
1214
},
1315
"dependencies": {
1416
"@astrojs/starlight": "^0.41.5",
@@ -18,5 +20,10 @@
1820
"starlight-links-validator": "^0.25.2",
1921
"starlight-sidebar-topics": "^0.8.0",
2022
"starlight-theme-galaxy": "^0.8.0"
23+
},
24+
"devDependencies": {
25+
"prettier": "^3.9.6",
26+
"prettier-plugin-astro": "^0.14.1",
27+
"prettier-plugin-sentences-per-line": "^0.2.4"
2128
}
22-
}
29+
}

0 commit comments

Comments
 (0)