Skip to content

Commit e3f41da

Browse files
authored
Merge pull request #2 from moonclavedev/setup-tooling
Setup tooling
2 parents 90dcd89 + f8044c1 commit e3f41da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3898
-1239
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# <http://editorconfig.org>
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Setup runner"
2+
description: "It setups node, install pnpm packages and caches them"
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install Node.js
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version: 22
10+
- uses: pnpm/action-setup@v4
11+
name: Install pnpm
12+
id: pnpm-install
13+
- name: Get pnpm store directory
14+
id: pnpm-cache
15+
shell: bash
16+
run: |
17+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
18+
19+
- uses: actions/cache@v4
20+
name: Setup pnpm cache
21+
with:
22+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
23+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pnpm-store-
26+
27+
- name: Install dependencies
28+
shell: bash
29+
run: pnpm install --frozen-lockfile

.github/workflows/check.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Astro check
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
env:
14+
CI_RUN: true
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ./.github/actions/prepare-runner
18+
- run: pnpm check

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Run linters
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
env:
14+
CI_RUN: true
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ./.github/actions/prepare-runner
18+
- run: pnpm lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
dist/
33
# generated types
44
.astro/
5+
.vercel
56

67
# dependencies
78
node_modules/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore any non .astro files
2+
pnpm-lock.yaml
3+
**/node_modules
4+
.astro/**
5+
**/.tmp
6+
aptos-spec.json

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2-
"recommendations": ["astro-build.astro-vscode"],
2+
"recommendations": [
3+
"astro-build.astro-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode"
6+
],
37
"unwantedRecommendations": []
48
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"eslint.useFlatConfig": true,
3+
"eslint.validate": ["javascript", "typescript", "html", "markdown", "astro"],
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll": "explicit"
6+
}
7+
}

astro.config.mjs

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,59 @@
11
// @ts-check
2-
import { defineConfig } from 'astro/config';
3-
import starlight from '@astrojs/starlight';
4-
import tailwind from '@astrojs/tailwind';
5-
import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi'
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
import tailwindcss from "@tailwindcss/vite";
5+
import starlightOpenAPI, { openAPISidebarGroups } from "starlight-openapi";
66

7-
import vercel from '@astrojs/vercel';
7+
import vercel from "@astrojs/vercel";
88

99
// https://astro.build/config
1010
export default defineConfig({
1111
site: 'https://aptos.dev',
1212
integrations: [
13-
starlight({
14-
title: 'Aptos Docs',
15-
social: {
16-
github: 'https://github.com/aptos-labs/',
13+
starlight({
14+
title: "Aptos Docs",
15+
social: {
16+
github: "https://github.com/aptos-labs/",
17+
},
18+
components: {
19+
// Override the default `Head` component.
20+
PageFrame: "./src/components/PageFrame.astro",
21+
},
22+
plugins: [
23+
// Generate the OpenAPI documentation pages.
24+
starlightOpenAPI(
25+
[
26+
{
27+
base: "api",
28+
label: "API",
29+
schema: "./aptos-spec.json",
30+
sidebarMethodBadges: true,
31+
},
32+
],
33+
{
34+
routeEntrypoint: "./src/components/OpenAPI/Route.astro",
1735
},
18-
components: {
19-
// Override the default `Head` component.
20-
PageFrame: './src/components/PageFrame.astro',
21-
},
22-
plugins: [
23-
// Generate the OpenAPI documentation pages.
24-
starlightOpenAPI([
25-
{
26-
base: 'api',
27-
label: 'API',
28-
schema: './aptos-spec.json',
29-
sidebarMethodBadges: true,
30-
},
31-
], {
32-
routeEntrypoint: './src/components/OpenAPI/Route.astro'
33-
}),
34-
],
35-
sidebar: [
36-
{
37-
label: 'Guides',
38-
items: [
39-
// Each item here is one entry in the navigation menu.
40-
{ label: 'Example Guide', slug: 'guides/example' },
41-
],
42-
},
43-
{
44-
label: 'Reference',
45-
autogenerate: { directory: 'reference' },
46-
},
47-
...openAPISidebarGroups,
36+
),
37+
],
38+
sidebar: [
39+
{
40+
label: "Guides",
41+
items: [
42+
// Each item here is one entry in the navigation menu.
43+
{ label: "Example Guide", slug: "guides/example" },
4844
],
49-
customCss: ['./src/tailwind.css'],
50-
}),
51-
tailwind({ applyBaseStyles: false }),
52-
],
53-
45+
},
46+
{
47+
label: "Reference",
48+
autogenerate: { directory: "reference" },
49+
},
50+
...openAPISidebarGroups,
51+
],
52+
customCss: ["./src/globals.css"],
53+
}),
54+
],
5455
adapter: vercel(),
56+
vite: {
57+
plugins: [tailwindcss()],
58+
},
5559
});

0 commit comments

Comments
 (0)