Skip to content

Commit

Permalink
fix: upgrade deps, fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianCataldo committed Oct 15, 2023
1 parent 7b2192d commit 9dd9dbb
Show file tree
Hide file tree
Showing 9 changed files with 1,925 additions and 1,947 deletions.
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
root = true

[*]
indent_style = space
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
Expand All @@ -12,3 +12,7 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


[*.json,*.yaml]
indent_style = space
11 changes: 10 additions & 1 deletion .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import("@types/prettier").Options} */
/** @type {import("prettier").Options} */

module.exports = {
/**
Expand All @@ -8,4 +8,13 @@ module.exports = {
*
* */
...require('webdev-configs/prettier-base.cjs'),

overrides: [
{
files: ['*.json', '*.yaml'],
options: {
useTabs: false,
},
},
],
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# E.g, with a full relative path
'$schema': ../creative-work.schema.yaml

# title: Behind the Gare St. Lazare, Paris, 1932
Expand Down
3 changes: 2 additions & 1 deletion demo/content/creative-work/guten-nachte__local-correct.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
'$schema': ../creative-work.schema.yaml
# E.g, with a path relative to remark config root folder
'$schema': ./content/creative-work.schema.yaml

title: Guten Nachte
category: Musical piece
Expand Down
12 changes: 6 additions & 6 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"author": "",
"license": "ISC",
"devDependencies": {
"tsx": "^3.11.0",
"remark-cli": "11.0.0"
"remark-cli": "12.0.0",
"tsx": "^3.13.0"
},
"dependencies": {
"remark": "14.0.2",
"remark-frontmatter": "4.0.1",
"remark-lint-frontmatter-schema": "link:..",
"vfile-reporter": "^7.0.4"
"remark": "15.0.1",
"remark-frontmatter": "5.0.0",
"remark-lint-frontmatter-schema": "latest",
"vfile-reporter": "^8.1.0"
}
}
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'node:path';
import { existsSync } from 'node:fs';
import { findUp } from 'find-up';
// NOTE: minimatch@9 is breaking import.
import minimatch from 'minimatch';
import { minimatch } from 'minimatch';
/* ·········································································· */
import yaml, { type Document, isNode, LineCounter } from 'yaml';
import Ajv from 'ajv';
Expand Down Expand Up @@ -351,8 +351,8 @@ const remarkFrontmatterSchema = lintRule(
async (ast: Root, vFile: VFile, settings: Settings = {}) => {
if (ast.children.length) {
/* Handle only if the processed Markdown file has a frontmatter section */
const frontmatter = ast.children.find((child): child is YAML => child.type === 'yaml');
if (frontmatter) {
const frontmatter = ast.children.find((child) => child.type === 'yaml');
if (frontmatter?.type === 'yaml') {
await validateFrontmatter(frontmatter, vFile, settings);
}
}
Expand Down
170 changes: 86 additions & 84 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,88 @@
{
"name": "remark-lint-frontmatter-schema",
"version": "3.15.3",
"description": "Validate Markdown frontmatter YAML against an associated JSON schema — remark-lint rule plugin",
"keywords": [
"lint",
"yaml",
"remark",
"validation",
"linting",
"json-schema",
"linter",
"unified",
"frontmatter",
"remarkjs",
"rule",
"ajv",
"markdown",
"vscode",
"tooling"
],
"homepage": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema",
"bugs": {
"url": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema/issues",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema"
},
"license": "ISC",
"author": "Julian Cataldo",
"type": "module",
"main": "./dist/index.js",
"source": "./index.ts",
"types": "./dist/index.d.ts",
"files": [
"dist/*",
"index.ts"
],
"scripts": {
"build": "pnpm tsc",
"dev": "pnpm tsc -w",
"release": "semantic-release"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^10.1.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"find-up": "^6.3.0",
"minimatch": "^7.4.6",
"unified-lint-rule": "^2.1.1",
"yaml": "^2.2.1"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "8.0.7",
"@semantic-release/npm": "10.0.3",
"@types/eslint": "8.37.0",
"@types/json-schema": "7.0.11",
"@types/mdast": "3.0.11",
"@types/minimatch": "^5.1.2",
"@types/node": "18.15.11",
"@types/prettier": "2.7.2",
"@types/unist": "2.0.6",
"@typescript-eslint/eslint-plugin": "5.58.0",
"@typescript-eslint/parser": "5.58.0",
"eslint": "8.38.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "8.8.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-tsdoc": "0.2.17",
"prettier": "2.8.7",
"remark": "14.0.2",
"remark-cli": "11.0.0",
"semantic-release": "^21.0.1",
"typescript": "5.0.4",
"unified": "10.1.2",
"vfile-message": "^3.1.4",
"webdev-configs": "^1.4.0"
}
"name": "remark-lint-frontmatter-schema",
"version": "3.15.3",
"description": "Validate Markdown frontmatter YAML against an associated JSON schema — remark-lint rule plugin",
"keywords": [
"lint",
"yaml",
"remark",
"validation",
"linting",
"json-schema",
"linter",
"unified",
"frontmatter",
"remarkjs",
"rule",
"ajv",
"markdown",
"vscode",
"tooling"
],
"homepage": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema",
"bugs": {
"url": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema/issues",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/JulianCataldo/remark-lint-frontmatter-schema"
},
"license": "ISC",
"author": "Julian Cataldo",
"type": "module",
"main": "./dist/index.js",
"source": "./index.ts",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js"
},
"files": [
"dist/*",
"index.ts"
],
"scripts": {
"build": "pnpm tsc",
"dev": "pnpm tsc -w",
"release": "semantic-release"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "11.1.0",
"ajv": "8.12.0",
"ajv-formats": "2.1.1",
"find-up": "6.3.0",
"minimatch": "9.0.3",
"unified-lint-rule": "2.1.2",
"yaml": "2.3.3"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.1",
"@semantic-release/npm": "11.0.0",
"@types/eslint": "8.44.4",
"@types/json-schema": "7.0.13",
"@types/mdast": "3.0.13",
"@types/minimatch": "5.1.2",
"@types/node": "20.8.6",
"@types/unist": "2.0.8",
"@typescript-eslint/eslint-plugin": "6.7.5",
"@typescript-eslint/parser": "6.7.5",
"eslint": "8.51.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-tsdoc": "0.2.17",
"prettier": "3.0.3",
"remark": "15.0.1",
"remark-cli": "12.0.0",
"semantic-release": "22.0.5",
"typescript": "5.2.2",
"unified": "10.1.2",
"vfile-message": "3.1.4",
"webdev-configs": "1.5.0"
}
}
Loading

0 comments on commit 9dd9dbb

Please sign in to comment.