Skip to content

Commit c9e7a3e

Browse files
authored
Merge pull request chakra-ui#6076 from TylerAPfledderer/fix/changelog-turn-off-live
fix(CHANGELOG.md): fix jsx snippets #2
2 parents f3832f5 + c4b968d commit c9e7a3e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ return (
435435
Allow user configure the storage key for the provider and script. We now export
436436
a `createLocalStorageManager` and `createCookieStorageManager` functions.
437437

438-
```jsx
438+
```jsx live=false
439439
const manager = createLocalStorageManager("{storageKey}")
440440

441441
function App({ Component, pageProps }) {
@@ -452,7 +452,7 @@ cookie script, you can set `type=cookie`.
452452

453453
> Pro tip: You can also configure the `storageKey` from script as well
454454
455-
```jsx
455+
```jsx live=false
456456
import { ColorModeScript } from "@chakra-ui/react"
457457
function Document() {
458458
return (

scripts/changelog-write.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ const cwd = process.cwd()
44

55
async function main() {
66
const content = fs.readFileSync(`${cwd}/.changelogrc`).toString()
7+
// If "live=false" is missing in jsx snippet, add it!
8+
const noLiveContent = content.replace(
9+
/^(```jsx)(\s?)+$/gim,
10+
"```jsx live=false",
11+
)
712
const changelogPath = `${cwd}/CHANGELOG.md`
813
const changelog = await fs.promises.readFile(changelogPath, "utf8")
914
const newChangelog = changelog.replace(
1015
"<!-- CHANGELOG:INSERT -->",
11-
`<!-- CHANGELOG:INSERT -->\n\n${content}`,
16+
`<!-- CHANGELOG:INSERT -->\n\n${noLiveContent}`,
1217
)
1318
// write new changelog
1419
await fs.promises.writeFile(changelogPath, newChangelog)

0 commit comments

Comments
 (0)