Skip to content
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

docs next #610

Merged
merged 124 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
492c199
docs v2
davemooreuws Oct 2, 2024
01223b1
wip conversion with fixes
davemooreuws Oct 3, 2024
c1fde15
get build working - switching to new components
davemooreuws Oct 3, 2024
06e8b57
fix build
davemooreuws Oct 3, 2024
1fac45e
fix og
davemooreuws Oct 3, 2024
61d53c8
fix mobile layout
davemooreuws Oct 3, 2024
73a6963
fix search on mobile
davemooreuws Oct 3, 2024
17f167f
update batch page to use code switcher
davemooreuws Oct 4, 2024
5653cc5
tabs fixes for mobile
davemooreuws Oct 4, 2024
e6b66ab
update codehike
davemooreuws Oct 4, 2024
645d8ff
fix spelling
davemooreuws Oct 4, 2024
e7db596
don't cache next builds
davemooreuws Oct 4, 2024
bf0a269
generate cypress fixtures
davemooreuws Oct 4, 2024
d4908f9
fix tests not running
davemooreuws Oct 4, 2024
81e11c4
fix a11y issues
davemooreuws Oct 4, 2024
ca5c873
fix build
davemooreuws Oct 4, 2024
9dbba28
fix seo test
davemooreuws Oct 4, 2024
4a8b763
speed up a11y tests
davemooreuws Oct 4, 2024
3c6574f
mobile adjustments for lang select and padding
davemooreuws Oct 4, 2024
51e0a39
wip guides
davemooreuws Oct 7, 2024
a5b2b42
fix feedback form typo
davemooreuws Oct 7, 2024
bd295f9
guides layout wip
davemooreuws Oct 7, 2024
a02d383
filter guides by tag
davemooreuws Oct 8, 2024
3e57700
use jetbrains mono
davemooreuws Oct 8, 2024
469e64b
docs(configuration): add configuration docs (nitric.yaml)
jyecusch Oct 8, 2024
daa9ef7
update the project structure doc
jyecusch Oct 8, 2024
a8e2359
correct mono in tw config
davemooreuws Oct 8, 2024
b605e54
update local dev docs
jyecusch Oct 8, 2024
debf94a
fix monospace issue
davemooreuws Oct 8, 2024
aa5288e
add h3s as links
davemooreuws Oct 8, 2024
0cdfe3e
update basics/deployment page
jyecusch Oct 8, 2024
c2211fd
update resources and providers links
jyecusch Oct 8, 2024
f06776a
fix cli ref link
jyecusch Oct 8, 2024
6d9e356
add lang switcher to guides and replace existing lang pages
davemooreuws Oct 8, 2024
39f0e0a
clean up old concepts docs
jyecusch Oct 8, 2024
fadae86
fix guides in prod
davemooreuws Oct 8, 2024
7f9dd1f
wip why nitric page
jyecusch Oct 8, 2024
a334a4a
mobile guide filters
davemooreuws Oct 8, 2024
fca5d10
wip add more tags to guides
davemooreuws Oct 8, 2024
cfbb50f
fix spell test
davemooreuws Oct 8, 2024
fdf7155
Update scrollbar to change on heading scroll rather than scroll perce…
HomelessDinosaur Oct 8, 2024
04431bb
update nav icons
jyecusch Oct 8, 2024
100adaa
type error for doc toc
davemooreuws Oct 9, 2024
10c25f9
fix toc slugs
davemooreuws Oct 9, 2024
903568e
update structure and links
jyecusch Oct 9, 2024
380751f
remove guide pages that used to be index pages
davemooreuws Oct 9, 2024
3e02d9c
add breadcrumbs for guides so user can get back
davemooreuws Oct 9, 2024
dd122d1
remove log
davemooreuws Oct 9, 2024
ea75f71
fix anchor link active indicator
davemooreuws Oct 9, 2024
423ee5d
new tabs component and refactor of install nitric
davemooreuws Oct 9, 2024
f4c1bf2
tabs for light mode
davemooreuws Oct 9, 2024
7abf39c
convert all old CodeWithTabs to new Tabs
davemooreuws Oct 9, 2024
bbd8410
rename file: to title:
davemooreuws Oct 9, 2024
dc525fa
adjust styling of code block titles and make copy consistent
davemooreuws Oct 9, 2024
06ad449
add styling for shell scripts
davemooreuws Oct 9, 2024
da8645f
fixes
davemooreuws Oct 9, 2024
e3f0701
align collapse better
davemooreuws Oct 9, 2024
7eb7de3
add lang switcher example to home page wip
davemooreuws Oct 9, 2024
674abaa
fix build
davemooreuws Oct 9, 2024
24010b4
fix go example indentation
jyecusch Oct 9, 2024
212f6b9
remove duplicate themes and most theme italics
jyecusch Oct 9, 2024
a40cd18
add italics back to comments and remove from rust
jyecusch Oct 9, 2024
59c79f6
fix line-height of code and clean up tabs
davemooreuws Oct 9, 2024
905a6d0
fix copy button on scroll / transitions
davemooreuws Oct 9, 2024
95c5c10
update 'why nitric' with a practical example
jyecusch Oct 10, 2024
9d7fc77
code tab updates wip
davemooreuws Oct 10, 2024
9226821
fix implicit expectations list
jyecusch Oct 10, 2024
f82fec4
fix wording
jyecusch Oct 10, 2024
dcaa118
fix build by adding missing code examples
davemooreuws Oct 10, 2024
66a6ac3
fix typo
jyecusch Oct 10, 2024
8dfd0dd
fix spellcheck
davemooreuws Oct 10, 2024
89cfb75
Add light code theme (#627)
HomelessDinosaur Oct 10, 2024
73b5c87
fix titles not showing with code switcher tabs
davemooreuws Oct 10, 2024
13107f2
more light mode fixes
davemooreuws Oct 10, 2024
200b068
copy button text
davemooreuws Oct 10, 2024
92d5c38
fix broken switcher
davemooreuws Oct 10, 2024
17926ff
fix a11y issues with tabs
davemooreuws Oct 10, 2024
ff35883
update foundations content and link config
jyecusch Oct 10, 2024
e7bed00
restructure misc pages
jyecusch Oct 10, 2024
84c3d90
handle external pages in nav link
davemooreuws Oct 10, 2024
453533b
add keyvalue link to left nav
jyecusch Oct 10, 2024
cf4bef4
delete old pages
jyecusch Oct 10, 2024
478f862
fix light mode guides page
jyecusch Oct 10, 2024
aec6c9e
add missing guides frontmatter and tags
jyecusch Oct 10, 2024
bf3f03f
remove duplicate google guides tag
jyecusch Oct 10, 2024
3b29b0e
fix guides filters on smaller screens
jyecusch Oct 10, 2024
a38ce67
sort guides alphabetically
jyecusch Oct 10, 2024
4f13028
Introduction, Installation, and Quickstart (#628)
HomelessDinosaur Oct 10, 2024
65672fd
update provider pages
HomelessDinosaur Oct 10, 2024
2aa3391
make collapsible nav more accessible
davemooreuws Oct 10, 2024
515e102
broken links, home page pass
davemooreuws Oct 10, 2024
5f76137
fix a11y issue with nav item change
davemooreuws Oct 10, 2024
cb4da14
broken links wip
davemooreuws Oct 10, 2024
5e8284b
fix preview feature feedback links
jyecusch Oct 10, 2024
3dd1142
fix intro page
jyecusch Oct 10, 2024
0d7e736
link fixes and provider page updates
jyecusch Oct 10, 2024
ff3898d
provider docs updates and link fixes
jyecusch Oct 10, 2024
460fea2
fix code example titles
jyecusch Oct 10, 2024
0479975
fix the name of the Operating System Tabs UI component
jyecusch Oct 10, 2024
ddc737d
use OSTabs for all OS specific install instructions
jyecusch Oct 11, 2024
456e048
fix spellcheck
davemooreuws Oct 11, 2024
4435c55
fix frontmatter
jyecusch Oct 11, 2024
125eb6f
fix home page links
davemooreuws Oct 11, 2024
4e09524
fix provider overview page
jyecusch Oct 11, 2024
3d8cabd
broken links
davemooreuws Oct 11, 2024
235e550
broken links
davemooreuws Oct 11, 2024
d7d5dce
fix merge conflict
jyecusch Oct 11, 2024
48b63e7
update runtime arch diagram
jyecusch Oct 11, 2024
30978f1
more broken links
davemooreuws Oct 11, 2024
19ebabb
add details to the providers page
jyecusch Oct 11, 2024
1a2f891
add base pages (guides) to sitemap and tests
davemooreuws Oct 11, 2024
09c9a07
add flexibility notes
jyecusch Oct 11, 2024
38f1ed5
remove unused images
jyecusch Oct 11, 2024
b90b264
fix guides index seo meta
davemooreuws Oct 11, 2024
1af97bb
refresh the quick start guide
jyecusch Oct 11, 2024
c1bc393
fix why nitric page
jyecusch Oct 11, 2024
8f92b9d
redirects for old sitemap and rewrite of test
davemooreuws Oct 11, 2024
561c4ff
add missing page to nav
jyecusch Oct 11, 2024
1d2eab7
update properties components
davemooreuws Oct 11, 2024
d0d198b
fix guide a11y issue
davemooreuws Oct 11, 2024
8e4f18e
remove redundant install instructions on introduction page
HomelessDinosaur Oct 11, 2024
c7e5d25
small grammar update to install instructions
HomelessDinosaur Oct 11, 2024
82e372c
typo on quickstart
HomelessDinosaur Oct 11, 2024
3bf9c63
remove building blocks link
HomelessDinosaur Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 13 additions & 43 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
NEXT_PUBLIC_VERCEL_URL: nitric.io
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -27,43 +27,25 @@ jobs:
run: yarn format:check
- name: Run spellcheck test
run: yarn test:spellcheck
- name: Build Website
run: yarn build
env:
NEXT_PUBLIC_GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
- name: Cache Build
uses: actions/cache@v2
id: restore-build
with:
path: |
.next
public
key: ci-docs-test-${{ github.sha }}

test-broken-links:
runs-on: ubuntu-latest
needs: [tests]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Build
uses: actions/cache@v2
id: restore-build
with:
path: |
.next
public
key: ci-docs-test-${{ github.sha }}
uses: actions/checkout@v3
- name: Cypress tests 🧪
uses: cypress-io/github-action@v5
with:
headless: true
config: video=false
browser: chrome
spec: cypress/e2e/broken-links.cy.ts
build: node scripts/build-pages-fixture.js
build: yarn cypress:build
start: yarn start
wait-on: 'http://localhost:3000'
env:
NEXT_PUBLIC_GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -76,25 +58,19 @@ jobs:
needs: [tests]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Build
uses: actions/cache@v2
id: restore-build
with:
path: |
.next
public
key: ci-docs-test-${{ github.sha }}
uses: actions/checkout@v3
- name: Cypress tests 🧪
uses: cypress-io/github-action@v5
with:
headless: true
config: video=false
browser: chrome
spec: cypress/e2e/a11y.cy.ts
build: node scripts/build-pages-fixture.js
build: yarn cypress:build
start: yarn start
wait-on: 'http://localhost:3000'
env:
NEXT_PUBLIC_GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -107,25 +83,19 @@ jobs:
needs: [tests]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Build
uses: actions/cache@v2
id: restore-build
with:
path: |
.next
public
key: ci-docs-test-${{ github.sha }}
uses: actions/checkout@v3
- name: Cypress tests 🧪
uses: cypress-io/github-action@v5
with:
headless: true
config: video=false
browser: chrome
spec: cypress/e2e/seo.cy.ts
build: node scripts/build-pages-fixture.js
build: yarn cypress:build
start: yarn start
wait-on: 'http://localhost:3000'
env:
NEXT_PUBLIC_GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

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

.contentlayer

old
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
2 changes: 1 addition & 1 deletion .spellcheckerrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
files:
- 'src/pages/**/*.{md,mdx}'
- 'docs/**/*.{md,mdx}'
dictionaries:
- dictionary.txt
quiet: true
Expand Down
13 changes: 8 additions & 5 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"config": "tailwind.config.ts",
"css": "src/styles/tailwind.css",
"baseColor": "slate",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
82 changes: 82 additions & 0 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { defineDocumentType, makeSource } from 'contentlayer2/source-files'
import { extractTocHeadings } from './src/mdx/remark-toc-headings.mjs'
import path from 'path'
import fs from 'fs'

const contentDirPath = 'docs'

const branch = process.env.NEXT_PUBLIC_GITHUB_BRANCH || 'main'

const Doc = defineDocumentType(() => ({
name: 'Doc',
filePathPattern: '**/*.mdx',
fields: {
title_seo: {
type: 'string',
description:
'The meta title of the doc, this will override the title extracted from the markdown and the nav title',
},
description: {
type: 'string',
description: 'The description of the doc',
},
image: {
type: 'string',
description: 'The image of the doc',
},
image_alt: {
type: 'string',
description: 'The image alt of the doc',
},
disable_edit: {
type: 'boolean',
description: 'Disable the github edit button',
},
tags: {
type: 'list',
of: {
type: 'string',
},
description: 'The tags of the post, used by guides',
},
},
computedFields: {
slug: {
type: 'string',
resolve: (doc) => doc._raw.flattenedPath,
},
toc: { type: 'json', resolve: (doc) => extractTocHeadings(doc.body.raw) },
title: {
type: 'string',
resolve: async (doc) => {
const headings = await extractTocHeadings(doc.body.raw, [1])

return headings[0]?.value
},
},
editUrl: {
type: 'string',
resolve: (doc) =>
`https://github.com/nitrictech/docs/edit/${branch}/docs/${doc._raw.sourceFilePath}`,
},
lastModified: {
type: 'date',
resolve: (doc) => {
// Get the full path to the markdown file
const filePath = path.join(
process.cwd(),
contentDirPath,
doc._raw.sourceFilePath,
)
// Extract and return the last modified date
const stats = fs.statSync(filePath)
return stats.mtime // This is the last modified date
},
},
},
}))

export default makeSource({
contentDirPath,
documentTypes: [Doc],
})
14 changes: 12 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
// require("cypress-fail-fast/plugin")(on, config);
return config
on('task', {
log(message) {
console.log(message)

return null
},
table(message) {
console.table(message)

return null
},
})
},
},
})
61 changes: 58 additions & 3 deletions cypress/e2e/a11y.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,72 @@ import * as pages from '../fixtures/pages.json'

describe('a11y accessiblity test suite', () => {
pages.forEach((page) => {
it(`Should test page ${page} for a11y violations`, () => {
it(`Should test page ${page} for a11y violations on desktop`, () => {
cy.viewport('macbook-16')
cy.visit(page)
cy.injectAxe()
cy.wait(150)
cy.wait(500)
cy.checkA11y(
undefined,
{
includedImpacts: ['critical'],
},
);
(violations) => {
cy.task(
'log',
`${violations.length} accessibility violation${
violations.length === 1 ? '' : 's'
} ${violations.length === 1 ? 'was' : 'were'} detected`,
)
// pluck specific keys to keep the table readable
const violationData = violations.map(
({ id, impact, description, nodes }) => ({
id,
impact,
description,
nodes: nodes.length,
}),
)

cy.task('table', violationData)

// console.error(JSON.stringify(violations));
},
)
})

it(`Should test page ${page} for a11y violations on mobile`, () => {
cy.viewport('iphone-x')
cy.visit(page)
cy.injectAxe()
cy.wait(500)
cy.checkA11y(
undefined,
{
includedImpacts: ['critical'],
},
(violations) => {
cy.task(
'log',
`${violations.length} accessibility violation${
violations.length === 1 ? '' : 's'
} ${violations.length === 1 ? 'was' : 'were'} detected`,
)
// pluck specific keys to keep the table readable
const violationData = violations.map(
({ id, impact, description, nodes }) => ({
id,
impact,
description,
nodes: nodes.length,
}),
)

cy.task('table', violationData)

// console.error(JSON.stringify(violations));
},
)
})
})
})
Loading
Loading