docs/src
docs-bot 58d8b58c59
Update audit log event data (#53051)
2024-11-09 16:33:41 +00:00
..
archives Work for preview envs 2024-11-05 14:03:09 -08:00
assets Update GHES proxy middleware to proxy to individual GitHub Pages sites (#52856) 2024-11-05 21:07:08 +00:00
audit-logs Update audit log event data (#53051) 2024-11-09 16:33:41 +00:00
automated-pipelines Convert more files to TypeScript `sync.js` & `find-page.js` (#51775) 2024-07-29 21:18:44 +00:00
bookmarklets Move files out of script/ (#45454) 2023-11-02 18:17:39 +00:00
changelogs Port `whats-new-changelog.js` to TypeScript (#51199) 2024-06-14 17:35:29 +00:00
code-scanning [WAIT FOR APPROVAL FROM PM BEFORE MERGING]: Autofix moving out of beta + rebrand (#51835) 2024-08-14 16:06:18 +00:00
codeql-cli Convert more files to TypeScript `sync.js` & `find-page.js` (#51775) 2024-07-29 21:18:44 +00:00
color-schemes Use vitest instead of jest (#50150) 2024-04-16 17:07:22 +00:00
content-linter Content Linter Rule - Whitespace (#52622) 2024-11-07 18:02:18 +00:00
content-render Fix for unused reusable script (#52591) 2024-10-21 18:36:02 +00:00
data-directory Port `warm-server.js` to TypeScript (#51434) 2024-06-27 00:18:28 +00:00
dev-toc Port `context.js` to TypeScript (#50978) 2024-06-07 12:23:13 +00:00
early-access Port `early-access-links.js` to TypeScript (#51173) 2024-06-13 17:55:56 +00:00
events Update eslint packages except eslint@9 (#52435) 2024-09-25 20:15:50 +00:00
fixtures `src/search` refactor + new endpoint: AI Search Autocomplete (#52822) 2024-11-07 18:15:57 +00:00
frame Allow a category landing page for Copilot Cookbook (#53002) 2024-11-07 20:35:35 +00:00
ghes-releases `src/search` refactor + new endpoint: AI Search Autocomplete (#52822) 2024-11-07 18:15:57 +00:00
github-apps Update OpenAPI Description (#52994) 2024-11-06 16:47:35 +00:00
graphql GraphQL schema update (#53013) 2024-11-07 16:35:57 +00:00
landings Allow a category landing page for Copilot Cookbook (#53002) 2024-11-07 20:35:35 +00:00
languages `src/search` refactor + new endpoint: AI Search Autocomplete (#52822) 2024-11-07 18:15:57 +00:00
learning-track A11y: update paths on guides links (#51845) 2024-07-30 20:36:32 +00:00
links `src/search` refactor + new endpoint: AI Search Autocomplete (#52822) 2024-11-07 18:15:57 +00:00
observability Port `trigger-error.js` to TypeScript (#51185) 2024-06-13 20:13:20 +00:00
open-source Start an open-source src directory (#42187) 2023-09-11 16:26:08 +00:00
pageinfo changed short-version.js to ts and updated references (#51805) 2024-07-30 19:12:53 +00:00
pagelist updated the pagelist middleware so it only returns english pagelinks (#52342) 2024-09-18 19:59:16 +00:00
pages Spelling scripts (#30895) 2024-01-05 09:14:38 -08:00
products Port `product-groups.js` to TypeScript (#51364) 2024-06-25 15:47:23 +00:00
redirects Update GHES proxy middleware to proxy to individual GitHub Pages sites (#52856) 2024-11-05 21:07:08 +00:00
release-notes Update GHES proxy middleware to proxy to individual GitHub Pages sites (#52856) 2024-11-05 21:07:08 +00:00
rest Improve error message for a REST test (#53037) 2024-11-08 17:44:17 +00:00
search include already-conforming index versions in the ES version map 2024-11-07 12:15:00 -08:00
secret-scanning Sync secret scanning data (#52754) 2024-10-18 10:09:20 +00:00
shielding Port shielding middleware to TypeScript (#51146) 2024-06-12 17:22:03 +00:00
tests `src/search` refactor + new endpoint: AI Search Autocomplete (#52822) 2024-11-07 18:15:57 +00:00
tools October 28-30: GitHub Universe 2024 docs-internal megabranch (#52491) 2024-10-29 08:40:06 -07:00
tracking Port `tracking` middleware to TypeScript (#51403) 2024-06-26 11:08:05 +00:00
versions Update GHES proxy middleware to proxy to individual GitHub Pages sites (#52856) 2024-11-05 21:07:08 +00:00
webhooks Update OpenAPI Description (#52994) 2024-11-06 16:47:35 +00:00
workflows Update datadog tag to latest (#52786) 2024-10-18 12:47:43 -04:00
README.md Update README.md (#52740) 2024-10-16 22:24:04 +00:00
types.ts Update secret scanning schema (#51949) 2024-08-07 19:41:18 +00:00

README.md

Welcome to our src directory

Our application is in Node, Express, React, & Next. We are using a "subject folder" pattern. Each folder represents a major capability of the docs.github.com. To learn more about each subject, check the README.md file in the folder.

Why subject folders

We used to organize our code more by role. Client, stylesheets, server middleware, shared files, tests, and so on. As the site grew, we had difficulty finding all the pieces that made a single feature work across the code base. Instead, we're moving to organize by subject. Subjects are easier to find all the related code for a single capability in one place.

How to create and use subject folders

Subjects do not need every element below. Not every element needs to be a folder. A subject folder looks like:

src/
  xsubject/
    README.md
    docs/
    lib/
    middleware/
    pages/
    components/
    stylesheets/
    scripts/
    tests/

If subject depends on another subject, please make this explicit in the README.

Choose the most specific subject folder available when organizing code.

When to use subject folders

A capability should have its own subject folder when it has its own specific tests.

When not to use subject folders

A few things are harder to categorize, so there's some broad folders:

  • frame/, for things that make the header, footer, global sidebar functional. And there's no more specific option.
  • workflows/, for things that are processes rather than the production application. And there's no more specific option.

But don't hesitate to make a new subject folder if there's at least a few files related.

Where to get help

Check the README.md in the subject folder for questions specific to a subject.

For internal folks, please ask in the Docs Engineering Slack or repository.

For open source folks, please open an issue in the repository.

A note on tests and required checks

Most subject folders have their own mention in .github/workflows/test.yml. Open the file to see the beginning of it. It's manually maintained but it's important to point out two things:

  1. It's manually entered so creating a src/foo/tests/*.js doesn't automatically start running those tests.
  2. When you add an entry to .github/workflows/test.yml, and it's gone into main, don't forget to add it to the branch protection's required checks.