-
-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: migrate build script to typescript #3423
base: master
Are you sure you want to change the base?
Conversation
This reverts commit df75c79.
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
const caseStudiesList = await Promise.all( | ||
files.map(async (file) => { | ||
const caseStudyFileName = [dirWithCaseStudy, file].join('/'); | ||
const caseStudyContent = await readFile(caseStudyFileName, 'utf-8'); | ||
|
||
return convertToJson(caseStudyContent); | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part refactored to avoid using await inside a loop (eslint error)
https://eslint.org/docs/latest/rules/no-await-in-loop
…asyncapi-site into script-migration-2
.eslintrc
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing commas from this file.
"scripts": { | ||
"dev": "npm run build-scripts && next dev", | ||
"build": "npm run build-scripts && next build", | ||
"test": "jest --passWithNoTests", | ||
"build:pages": "node scripts/build-pages.js && npm run format:mdx", | ||
"build:posts": "node scripts/index.js", | ||
"build:pages": "node --loader ts-node/esm scripts/build-pages.ts && npm run format:mdx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed to use tsx as well. Why you again moved to ts-node?
pages/_document.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you have used prettier code formatter here. Kindly remove these changes from the file.
scripts/build-rss.ts
Outdated
import fs from 'fs/promises'; | ||
import json2xml from 'jgexml/json2xml'; | ||
|
||
import posts from '../config/posts.json' assert { type: 'json' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't import posts directly here. This file is generated at the build time of the website.
"files": ["scripts/**/*"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"no-console": "off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor the code to remove the warning or use minimalistic console messages instead of turning off the rule?
Description
Related issue(s)
Related to #3187