Skip to content

Commit 1d1746d

Browse files
[docs-infra] Fix Vale no longer working (#46029)
1 parent 13186f4 commit 1d1746d

19 files changed

+82
-77
lines changed

.circleci/config.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -193,45 +193,11 @@ jobs:
193193
- run:
194194
name: Lint Markdown
195195
command: pnpm markdownlint
196-
- run:
197-
# See https://circleci.com/developer/orbs/orb/circleci/vale as reference
198-
name: Install Vale
199-
command: |
200-
#!/bin/bash
201-
VALE_STR_CLI_VERSION=3.3.0
202-
203-
# set smart sudo
204-
if [[ $EUID -eq 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
205-
206-
mkdir /tmp/vale-extract
207-
cd /tmp/vale-extract
208-
GZIPPED_OUTPUT="vale.tar.gz"
209-
BINARY_URL=https://github.com/errata-ai/vale/releases/download/v${VALE_STR_CLI_VERSION}/vale_${VALE_STR_CLI_VERSION}_Linux_64-bit.tar.gz
210-
curl -sSL "$BINARY_URL" -o "${GZIPPED_OUTPUT}"
211-
212-
if [ ! -s "${GZIPPED_OUTPUT}" ]; then
213-
echo "Downloaded file is empty"
214-
rm "${GZIPPED_OUTPUT}"
215-
exit 1
216-
fi
217-
218-
tar -xzf "${GZIPPED_OUTPUT}"
219-
$SUDO mv vale /usr/local/bin
220-
rm "${GZIPPED_OUTPUT}"
221-
222-
# validate installation
223-
if [[ -z "$(command -v vale)" ]]; then
224-
echo "vale installation failed"
225-
exit 1
226-
else
227-
echo "vale installation successful"
228-
vale --version
229-
exit 0
230-
fi
231196
- run:
232197
name: Lint writing style
233198
command: |
234-
vale sync
199+
# Or use https://circleci.com/developer/orbs/orb/circleci/vale as reference to install Vale
200+
pnpm vale sync
235201
pnpm valelint
236202
test_static:
237203
<<: *default-job

.github/workflows/vale-action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ jobs:
1313
pull-requests: write
1414
steps:
1515
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- name: Extract Vale version from pnpm-lock.yaml
17+
id: vale-version
18+
run: |
19+
# Extract version from lock file
20+
VERSION=$(awk -F"@|'" '/@vvago\/vale@/ {print $4}' pnpm-lock.yaml | head -n1)
21+
echo "Extracted Vale version: $VERSION"
22+
echo "vale_version=$VERSION" >> $GITHUB_OUTPUT
1623
- uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
1724
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
1825
with:
26+
version: ${{ steps.vale-version.outputs.vale_version }}
1927
# Errors should be more visible
2028
fail_on_error: true
2129
# The other reports don't work, not really https://github.com/reviewdog/reviewdog#reporters

docs/mui-vale.zip

12 Bytes
Binary file not shown.

docs/mui-vale/styles/MUI/CorrectReferenceAllCases.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ ignorecase: true # There is only one correct way to spell those, so we want to m
66
# swap maps tokens in form of bad: good
77
# for more information: https://vale.sh/docs/topics/styles/#substitution
88
swap:
9-
' api': API
9+
' api': ' API'
1010
typescript: TypeScript
11-
' ts': TypeScript
11+
' ts': ' TypeScript'
1212
javascript: JavaScript
13-
' js': JavaScript
14-
' css ': CSS
15-
' html ': HTML
13+
' js': ' JavaScript'
14+
' css ': ' CSS '
15+
' html ': ' HTML '
1616
NPM: npm # https://css-tricks.com/start-sentence-npm/
1717
Github: GitHub
1818
StackOverflow: Stack Overflow
@@ -21,17 +21,17 @@ swap:
2121
Tailwind CSS: Tailwind CSS
2222
Heat map: Heatmap
2323
Tree map: Treemap
24-
Sparkline Chart: Sparkline
25-
Gauge Chart: Gauge
26-
Treemap Chart: Treemap
24+
Sparkline Chart: Sparkline chart
25+
Gauge Chart: Gauge chart
26+
Treemap Chart: Treemap chart
2727
sub-component: subcomponent
2828
sub-components: subcomponents
2929
use-case: use case
3030
usecase: use case
3131
Material 3: Material Design 3
3232
VSCode: VS Code
3333
VS Code: VS Code
34-
'Codesandbox ': CodeSandbox
34+
'Codesandbox ': 'CodeSandbox '
3535
code sandbox: CodeSandbox
3636
Stackblitz: StackBlitz
3737
Webpack: webpack # https://twitter.com/wSokra/status/855800490713649152

docs/pages/blog/2019-developer-survey-results.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'The 2019 Material UI Developer Survey: here's what we discovered'
2+
title: "The 2019 Material UI Developer Survey: here's what we discovered"
33
description: Your feedback helps us to build better products. Here's what we learned about your needs in our annual survey.
44
date: 2019-03-16T00:00:00.000Z
55
authors: ['oliviertassinari', 'mbrookes']

docs/pages/blog/2020-developer-survey-results.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'The 2020 Material UI Developer Survey: here's what we discovered'
2+
title: "The 2020 Material UI Developer Survey: here's what we discovered"
33
description: Your feedback helps us to build better products. Here's what we learned about your needs in our annual survey.
44
date: 2020-06-27T00:00:00.000Z
55
authors: ['mnajdova', 'oliviertassinari', 'mbrookes']

docs/pages/blog/2021-developer-survey-results.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'The 2021 MUI Developer Survey: here's what we discovered'
2+
title: "The 2021 MUI Developer Survey: here's what we discovered"
33
description: Your feedback helps us to build better products. Here's what we learned about your needs in our annual survey.
44
date: 2022-03-15T00:00:00.000Z
55
authors: ['danilo-leal', 'samuelsycamore', 'oliviertassinari']

docs/pages/blog/2022-tenerife-retreat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: MUI's company retreat in Tenerife: a recap
2+
title: "MUI's company retreat in Tenerife: a recap"
33
description: Our internationally distributed startup gathered on a remote island to get to know each other better. Here's what happened!
44
date: 2022-07-28T00:00:00.000Z
55
authors: ['samuelsycamore']

docs/pages/blog/2023-toolpad-beta-announcement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Introducing Toolpad: MUI's low-code admin builder
2+
title: "Introducing Toolpad: MUI's low-code admin builder"
33
description: Assemble admin panels and internal tools faster than ever before with Toolpad—now in beta.
44
date: 2023-07-24T00:00:00.000Z
55
authors: ['prakhargupta']

docs/pages/blog/docs-restructure-2022.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Our docs just got a major upgrade—here's what that means for you'
2+
title: "Our docs just got a major upgrade—here's what that means for you"
33
description: Each of MUI's products now has its own dedicated documentation, making it easier than ever to find exactly what you need.
44
date: 2022-04-06T00:00:00.000Z
55
authors: ['danilo-leal']

docs/pages/blog/introducing-pigment-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'A preview of Pigment CSS: the next generation of CSS-in-JS'
2+
title: 'A preview of Pigment CSS: the next generation of CSS-in-JS'
33
description: 'Pigment CSS offers significant performance gains along with RSC and App Router support.'
44
date: 2024-05-16T00:00:00.000Z
55
authors:

docs/pages/blog/material-ui-2024-updates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Material UI 2024 end-of-year updates
3-
description: Recapping our biggest accomplishments for Material UI this year; plus, a look at what's to come in 2025.
2+
title: Material UI 2024 end-of-year updates
3+
description: Recapping our biggest accomplishments for Material UI this year; plus, a look at what's to come in 2025.
44
date: 2024-12-11T00:00:00.000Z
55
authors: ['diegoandai', 'alelthomas']
66
tags: ['Material UI', 'Product']

docs/pages/blog/mui-x-sep-2024-price-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Upcoming changes to MUI X pricing in 2024
2+
title: Upcoming changes to MUI X pricing in 2024
33
description: Check out the new pricing updates and how to transition to the new model.
44
date: 2024-08-01T08:00:00.000Z
55
authors: ['josefreitas', 'oliviertassinari']

docs/pages/blog/react-19-update.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
title: How we migrated MUI X to React 19
2+
title: How we migrated MUI X to React 19
33
description: Learn how we migrated our library's codebase to React 19 while maintaining backward compatibility.
44
date: 2025-02-25
55
authors: ['arminmeh']
66
tags: ['MUI X']
7+
manualCard: false
78
---
89

910
As maintainers of a popular set of React UI components, we planned to migrate our library's codebase to React 19 as soon as possible after its stable release, which came at the end of 2024.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"docs:typescript:formatted": "tsx ./docs/scripts/formattedTSDemos",
4040
"docs:sync-team": "tsx ./docs/scripts/syncTeamMembers.ts && pnpm prettier",
4141
"docs:mdicons:synonyms": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js,.mjs\" ./docs/scripts/updateIconSynonyms && pnpm prettier",
42-
"docs:zipRules": "cd docs && rm mui-vale.zip && zip -r mui-vale.zip mui-vale && cd ../ && vale sync",
42+
"docs:zipRules": "cd docs && rm mui-vale.zip && zip -r mui-vale.zip mui-vale && cd ../ && pnpm vale sync",
4343
"extract-error-codes": "cross-env MUI_EXTRACT_ERROR_CODES=true lerna run --concurrency 1 build:stable",
4444
"template:screenshot": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/generateTemplateScreenshots",
4545
"install:codesandbox": "pnpm install --no-frozen-lockfile",
@@ -48,7 +48,7 @@
4848
"eslint:ci": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
4949
"stylelint": "stylelint --reportInvalidScopeDisables --reportNeedlessDisables \"docs/**/*.?(c|m)[jt]s?(x)\" --ignore-path .gitignore",
5050
"markdownlint": "markdownlint-cli2 \"**/*.md\"",
51-
"valelint": "git ls-files | grep -h \".md$\" | xargs vale --filter='.Level==\"error\"'",
51+
"valelint": "pnpm vale sync && git ls-files | grep -h \".md$\" | xargs pnpm vale --filter='.Level==\"error\"'",
5252
"prettier": "pretty-quick --ignore-path .eslintignore --branch master",
5353
"prettier:all": "prettier --write . --ignore-path .eslintignore",
5454
"size:snapshot": "node --max-old-space-size=4096 ./scripts/sizeSnapshot/create",
@@ -146,6 +146,7 @@
146146
"@vitejs/plugin-react": "^4.4.1",
147147
"@vitest/browser": "^3.1.2",
148148
"@vitest/coverage-v8": "^3.1.2",
149+
"@vvago/vale": "^3.11.2",
149150
"babel-loader": "^10.0.0",
150151
"babel-plugin-istanbul": "^7.0.0",
151152
"babel-plugin-module-resolver": "^5.0.2",

packages/markdown/parseMarkdown.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ function getHeaders(markdown) {
145145
value = value.replace(/,\s+\]$/g, ']');
146146
headers[key] = JSON.parse(value);
147147
} else {
148-
// Remove trailing single quote yml escaping.
149-
headers[key] = value.replace(/^'|'$/g, '');
148+
// Remove quote YAML escaping.
149+
headers[key] = value.replace(/^"|"$|^'|'$/g, '');
150150
}
151151
}
152152

packages/markdown/parseMarkdown.test.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,14 @@ authors: ['foo', 'bar']
8787
---
8888
title: React Alert component
8989
components: Alert, AlertTitle
90-
githubLabel: 'component: alert'
91-
packageName: '@mui/lab'
92-
waiAria: https://www.w3.org/TR/wai-aria-practices/#alert
9390
authors:
9491
['foo', 'bar']
9592
---
9693
`),
9794
).to.deep.equal({
9895
components: ['Alert', 'AlertTitle'],
9996
hooks: [],
100-
githubLabel: 'component: alert',
101-
packageName: '@mui/lab',
10297
title: 'React Alert component',
103-
waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert',
10498
authors: ['foo', 'bar'],
10599
});
106100
});
@@ -111,9 +105,6 @@ authors:
111105
---
112106
title: React Alert component
113107
components: Alert, AlertTitle
114-
githubLabel: 'component: alert'
115-
packageName: '@mui/lab'
116-
waiAria: https://www.w3.org/TR/wai-aria-practices/#alert
117108
authors:
118109
[
119110
'foo',
@@ -124,13 +115,24 @@ authors:
124115
).to.deep.equal({
125116
components: ['Alert', 'AlertTitle'],
126117
hooks: [],
127-
githubLabel: 'component: alert',
128-
packageName: '@mui/lab',
129118
title: 'React Alert component',
130-
waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert',
131119
authors: ['foo', 'bar'],
132120
});
133121
});
122+
123+
it('should work with quotes', () => {
124+
expect(
125+
getHeaders(`
126+
---
127+
title: "Our docs just got a major upgrade—here's what that means for you"
128+
---
129+
`),
130+
).to.deep.equal({
131+
title: "Our docs just got a major upgrade—here's what that means for you",
132+
components: [],
133+
hooks: [],
134+
});
135+
});
134136
});
135137

136138
describe('getContents', () => {

pnpm-lock.yaml

Lines changed: 28 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ packages:
88
- test/moduleResolution
99
- apps/*
1010
- scripts/sizeSnapshot
11+
1112
patchedDependencies:
1213
styled-components: patches/styled-components.patch
14+
15+
onlyBuiltDependencies:
16+
- '@vvago/vale'

0 commit comments

Comments
 (0)