Skip to content

Commit

Permalink
fix(build): bump ts version and fix docs build for v6 (#4004)
Browse files Browse the repository at this point in the history
* fix(typescript): bump version to fix dependency issue and topology build

* fix(build): comment out instance of visit function to fix docs build for v6

* fix(build): bump docs framework version to latest

* fix(build): update parseMD comment

* fix(build): update lockfile
  • Loading branch information
jenny-s51 authored May 7, 2024
1 parent 9e2ca6a commit 55db3db
Show file tree
Hide file tree
Showing 4 changed files with 4,277 additions and 4,242 deletions.
2 changes: 1 addition & 1 deletion packages/documentation-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"style-to-object": "0.3.0",
"to-vfile": "6.1.0",
"typedoc": "0.23.0",
"typescript": "4.3.5",
"typescript": "4.7.4",
"unified": "9.1.0",
"unist-util-remove": "2.0.0",
"unist-util-visit": "2.0.3",
Expand Down
61 changes: 31 additions & 30 deletions packages/documentation-framework/scripts/md/parseMD.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const vfileReport = require('vfile-reporter');
const yaml = require('js-yaml'); // https://github.com/nodeca/js-yaml
const chokidar = require('chokidar');
const { globSync } = require('glob');
const { typecheck } = require('./typecheck');
// const { typecheck } = require('./typecheck');
const { makeSlug } = require('../../helpers/slugger');
const { liveCodeTypes } = require('../../helpers/liveCodeTypes');
const { tsDocgen } = require('../tsDocgen');
Expand Down Expand Up @@ -204,35 +204,36 @@ function toReactComponent(mdFilePath, source, buildMode) {
&& node.tagName === 'Example'
&& liveCodeTypes.includes(node.properties.lang)
&& !node.properties.noLive;
visit(tree, isExample, node => {
if (node.properties.isFullscreen) {
pageData.fullscreenExamples = pageData.fullscreenExamples || [];
pageData.fullscreenExamples.push(node.title);
}
else {
pageData.examples = pageData.examples || [];
pageData.examples.push(node.title);
}
// Typecheck TS examples
if (node.properties.lang === 'ts') {
const typerrors = typecheck(
path.join(pageData.id, node.title + '.tsx'), // Needs to be unique per-example
node.properties.code
);
typerrors.forEach(({ line, character, message }) => {
line = node.position.start.line + line + 1;
const column = character;
if (buildMode === 'start') {
// Don't fail to start over types
file.message(`\u001b[31m THIS WILL FAIL THE BUILD\u001b[0m\n ${message}`, { line, column });
} else {
console.log('\u001b[31m');
file.fail(`\n ${message}\n`, { line, column });
console.log('\u001b[0m');
}
});
}
});
// TODO: revert when CommonJS is upgraded to ESM or when unist-util packages are updated to a tool that is compatible with ESM
// visit(tree, isExample, node => {
// if (node.properties.isFullscreen) {
// pageData.fullscreenExamples = pageData.fullscreenExamples || [];
// pageData.fullscreenExamples.push(node.title);
// }
// else {
// pageData.examples = pageData.examples || [];
// pageData.examples.push(node.title);
// }
// // Typecheck TS examples
// if (node.properties.lang === 'ts') {
// const typerrors = typecheck(
// path.join(pageData.id, node.title + '.tsx'), // Needs to be unique per-example
// node.properties.code
// );
// typerrors.forEach(({ line, character, message }) => {
// line = node.position.start.line + line + 1;
// const column = character;
// if (buildMode === 'start') {
// // Don't fail to start over types
// file.message(`\u001b[31m THIS WILL FAIL THE BUILD\u001b[0m\n ${message}`, { line, column });
// } else {
// console.log('\u001b[31m');
// file.fail(`\n ${message}\n`, { line, column });
// console.log('\u001b[0m');
// }
// });
// }
// });
})
// Add custom PatternFly doc design things
.use(require('./anchor-header'), toc => {
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"screenshots": "pf-docs-framework screenshots"
},
"dependencies": {
"@patternfly/documentation-framework": "6.0.0-alpha.23",
"@patternfly/documentation-framework": "6.0.0-alpha.24",
"@patternfly/quickstarts": "^5.1.0",
"@patternfly/react-catalog-view-extension": "5.0.0",
"@patternfly/react-console": "5.0.0",
Expand Down
Loading

0 comments on commit 55db3db

Please sign in to comment.