Skip to content

Commit

Permalink
Refactor spec build system
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesrosiers committed Nov 7, 2024
1 parent 289e724 commit f6fbd19
Show file tree
Hide file tree
Showing 33 changed files with 1,449 additions and 632 deletions.
20 changes: 20 additions & 0 deletions .remarkrc-lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import remarkValidateLinks from "remark-validate-links";
import remarkPresetLintConsistent from "remark-preset-lint-consistent";
import remarkPresetLintRecommended from "remark-preset-lint-recommended";
import remarkPresetLintMarkdownStyleGuide from "remark-preset-lint-markdown-style-guide";
import remarkLintListItemIndent from "remark-lint-list-item-indent";
import remarkLintListItemSpacing from "remark-lint-list-item-spacing";
import remarkLintNoFileNameMixedCase from "remark-lint-no-file-name-mixed-case";


export default {
plugins: [
remarkValidateLinks,
remarkPresetLintConsistent,
remarkPresetLintRecommended,
remarkPresetLintMarkdownStyleGuide,
[remarkLintListItemIndent, "one"],
[remarkLintListItemSpacing, { checkBlanks: true }],
[remarkLintNoFileNameMixedCase, false]
]
};
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ Labels are assigned based on [Sensible Github Labels](https://github.com/Releque

### Specification
To build the spec files to HTML from the Markdown sources, run `npm run
build-all`.
You can also build each individually with `npm run build -- filename.md`
(Example: `npm run build -- jsonschema-core.md`). You can also use wildcards to
build multiple specs at the same time: `npm run build -- jsonschema-*.md`. The
HTML files will be available in the `web` folder.
build-all`. You can also build each individually with `npm run build --
specs/filename.md` (Example: `npm run build -- specs/jsonschema-core.md`). You
can also use wildcards to build multiple specs at the same time: `npm run build
-- specs/jsonschema-*.md`. The HTML files will be available in the `web` folder.

The spec is built using [Remark](https://remark.js.org/), a markdown engine with
good support for plugins and lots of existing plugins we can use.
good support for plugins and lots of existing plugins we can use. Remark also
has a [language server](https://github.com/remarkjs/remark-language-server) and
a [VSCode extension](https://github.com/remarkjs/vscode-remark) we can use to
get linting an link checking while developing the spec.

#### Plugins
The following is a not-necessarily-complete list of configured plugins and the
Expand Down
199 changes: 0 additions & 199 deletions build/build.js

This file was deleted.

3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import globals from "globals";
import stylistic from "@stylistic/eslint-plugin";
import importPlugin from "eslint-plugin-import";


export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
Expand Down Expand Up @@ -34,7 +35,7 @@ export default [

// Imports
"import/extensions": ["error", "ignorePackages"],
"import/newline-after-import": ["error", { count: 2, exactCount: false, considerComments: true }], // Doesn't respect @import
"import/newline-after-import": ["error", { count: 2, exactCount: false, considerComments: true }],

// Stylistic
"@stylistic/yield-star-spacing": ["error", "after"],
Expand Down
Loading

0 comments on commit f6fbd19

Please sign in to comment.