Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const createEditUrl = require("./scripts/createEditUrl");
const createRedirects = require("./scripts/createRedirects");
const versionsList = require('./versions.json');
const installationChartPlugin = require('./src/plugins/installation-chart')

const prodVersion = versionsList[1]

Expand Down Expand Up @@ -357,6 +358,7 @@ const config = {
path: 'release-notes',
routeBasePath: 'release-notes',
sidebarPath: './sidebarsReleaseNotes.js',
remarkPlugins: [installationChartPlugin]
},
],
[
Expand Down
12 changes: 12 additions & 0 deletions output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
***

id: v14.5.0
title: Version 14.5.0 Release Notes
image: "img/release-note-link-preview.png"
------------------------------------------

Content...

## How to update your Console

{{ chart }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"react-dom": "^19.2.0",
"react-youtube": "^10.1.0",
"tsx": "^4.20.6",
"typescript-eslint": "^8.46.4"
"typescript-eslint": "^8.46.4",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.28.5",
Expand All @@ -57,6 +58,7 @@
"gray-matter": "^4.0.3",
"prettier": "3.6.2",
"prompts": "^2.4.2",
"remark": "^15.0.1",
"typescript": "^5.9.3"
},
"overrides": {
Expand Down
11 changes: 11 additions & 0 deletions release-notes/v14.5.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: v14.5.0
title: Version 14.5.0 Release Notes
image: "img/release-note-link-preview.png"
---

Content...

## How to update your Console

{{ chart }}
17 changes: 17 additions & 0 deletions src/plugins/installation-chart/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import fs from 'node:fs/promises'
import {visit} from 'unist-util-visit'

const rnPathRegex = /release-notes\/v[^/]*\.mdx$/
const chartTemplateRegex = /\{\{\s*chart\s*\}\}/

const isChartNode = (node) => node.type === 'text' && chartTemplateRegex.test(node.value)

export default () => {
return async (root) => {
visit(root, (node) => {
if (!isChartNode(node)) { return }

console.log(JSON.stringify(node, null, 2))

Check failure on line 14 in src/plugins/installation-chart/index.js

View workflow job for this annotation

GitHub Actions / Install and verify contents

Unexpected console statement
})
}
}
9 changes: 9 additions & 0 deletions src/plugins/installation-chart/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import fs from 'node:fs/promises'
import {remark} from 'remark'
import plugin from './index.js'

const document = await fs.readFile(`${process.cwd()}/release-notes/v14.5.0.mdx`, 'utf8')

const file = await remark().use(plugin).process(document)

await fs.writeFile('output.md', String(file))
Loading
Loading