Skip to content

Commit c2037d8

Browse files
authored
Revert checklist feature (#295)
* Revert "Add support for checklists (#267)" This reverts commit 9ddaa08. * Create shaggy-donkeys-beg.md
1 parent 9972de8 commit c2037d8

File tree

12 files changed

+9
-605
lines changed

12 files changed

+9
-605
lines changed

.changeset/shaggy-donkeys-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/gatsby-theme-doctocat": major
3+
---
4+
5+
Remove checklist feature

docs/content/usage/checklists.mdx

Lines changed: 0 additions & 242 deletions
This file was deleted.

docs/src/@primer/gatsby-theme-doctocat/nav.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
url: /usage/live-code
1717
- title: Deployment
1818
url: /usage/deployment
19-
- title: Images
19+
- title: Using images
2020
url: /usage/using-images
21-
- title: Checklists
22-
url: /usage/checklists
2321
- title: Components
2422
url: /components
2523
children:

theme/gatsby-node.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,6 @@ const axios = require('axios')
55
const uniqBy = require('lodash.uniqby')
66
const extractExports = require(`gatsby-plugin-mdx/utils/extract-exports`)
77
const mdx = require(`gatsby-plugin-mdx/utils/mdx`)
8-
const requireGlob = require('require-glob')
9-
const {validateChecklistSchema, validateChecklist} = require('./src/validate-checklists')
10-
const checklistSchemas = requireGlob.sync('./src/checklists/*.schema.js')
11-
12-
exports.sourceNodes = ({actions, createNodeId, createContentDigest}) => {
13-
const {createNode} = actions
14-
15-
// Add checklist schemas to GraphQL API
16-
for (const schemaKey in checklistSchemas) {
17-
try {
18-
validateChecklistSchema(checklistSchemas[schemaKey])
19-
} catch (error) {
20-
throw new Error(`Invalid checklist schema: ${schemaKey.replace('Schema', '')}.schema.js\n${error.message}`)
21-
}
22-
23-
const name = schemaKey.replace('Schema', '')
24-
const data = {name, ...checklistSchemas[schemaKey]}
25-
26-
const node = {
27-
id: createNodeId(schemaKey),
28-
parent: null,
29-
children: [],
30-
internal: {
31-
type: 'ChecklistSchema',
32-
contentDigest: createContentDigest(data)
33-
},
34-
...data
35-
}
36-
createNode(node)
37-
}
38-
}
398

409
const CONTRIBUTOR_CACHE = new Map()
4110

@@ -87,18 +56,6 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
8756
const code = await mdx(node.rawBody)
8857
const {frontmatter} = extractExports(code)
8958

90-
// Validate checklist frontmatter
91-
for (const schemaKey in checklistSchemas) {
92-
const checklistKey = schemaKey.replace('Schema', 'Checklist')
93-
if (checklistKey in frontmatter) {
94-
try {
95-
validateChecklist(frontmatter[checklistKey], checklistSchemas[schemaKey])
96-
} catch (error) {
97-
throw new Error(`Invalid checklist: ${checklistKey} in ${fileRelativePath}\n${error.message}`)
98-
}
99-
}
100-
}
101-
10259
actions.createPage({
10360
path: pagePath,
10461
component: node.fileAbsolutePath,

theme/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"scripts": {
77
"test": "jest",
8-
"lint": "eslint '**/*.js'",
8+
"lint": "eslint '**/*.{js,ts,tsx}'",
99
"lint:fix": "yarn lint -- --fix"
1010
},
1111
"prettier": "@github/prettier-config",
@@ -60,7 +60,6 @@
6060
"github-slugger": "^1.2.1",
6161
"html-react-parser": "^1.4.0",
6262
"jest": "^24.9.0",
63-
"jsonschema": "^1.4.0",
6463
"lodash.debounce": "4.0.8",
6564
"lodash.uniqby": "^4.7.0",
6665
"pkg-up": "^3.1.0",
@@ -76,7 +75,6 @@
7675
"react-live": "^2.1.2",
7776
"react-measure": "^2.3.0",
7877
"read-pkg-up": "^6.0.0",
79-
"require-glob": "^4.0.0",
8078
"sentence-case": "^2.1.1",
8179
"styled-components": "^4.3.2",
8280
"styled-system": "^5.0.18",

0 commit comments

Comments
 (0)