-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Format website with prettier #2536
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
582c40d
add prettier
ranile 73c6988
ci
ranile 140991a
run prettier
ranile 97a3419
run prettier in CI
ranile a7ed986
run prettier --write
ranile f2a7366
ignore README.md
ranile 6b1db19
Merge branch 'master' into prettier-website
ranile bc753c5
specify googleAnalytics
ranile 98508b8
fmt
ranile 65b1c1e
npm run write-translations
ranile 9c696d2
fmt
ranile 69bd069
ignore i18n json files
ranile 9002794
Merge branch 'master' into prettier-website
ranile 8d110f7
post merge fixes & some updates
ranile 1b6a060
Merge branch 'master' into prettier-website
ranile 3aeab7e
post merge fixes
ranile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# it messes these files | ||
README.md | ||
i18n/**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"semi": false, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
hamza: | ||
name: Muhammad Hamza | ||
title: Maintainer of Yew | ||
url: https://github.com/hamza1311 | ||
image_url: https://github.com/hamza1311.png | ||
name: Muhammad Hamza | ||
title: Maintainer of Yew | ||
url: https://github.com/hamza1311 | ||
image_url: https://github.com/hamza1311.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
const {i18n: {locales}} = require('./docusaurus.config.js'); | ||
const util = require('util'); | ||
const exec = util.promisify(require('child_process').exec); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
const dircompare = require('dir-compare'); | ||
const { | ||
i18n: { locales }, | ||
} = require('./docusaurus.config.js') | ||
const util = require('util') | ||
const exec = util.promisify(require('child_process').exec) | ||
const path = require('path') | ||
const fs = require('fs') | ||
const os = require('os') | ||
const dircompare = require('dir-compare') | ||
const writeTranslations = require('./write-translations.js') | ||
|
||
|
||
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'yew-website-')); | ||
|
||
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'yew-website-')) | ||
|
||
async function main() { | ||
await new Promise(resolve => { | ||
fs.cp('i18n', temp, {recursive: true}, () => { | ||
await new Promise((resolve) => { | ||
fs.cp('i18n', temp, { recursive: true }, () => { | ||
resolve() | ||
}) | ||
}) | ||
|
||
await writeTranslations() | ||
|
||
const result = await dircompare.compare(temp, 'i18n', {compareContent: true}); | ||
const result = await dircompare.compare(temp, 'i18n', { | ||
compareContent: true, | ||
}) | ||
if (result.same) { | ||
console.log("Translations unchanged"); | ||
console.log('Translations unchanged') | ||
} else { | ||
console.error("Translations changed, please run `npm run write-translations` to generate the stubs"); | ||
process.exitCode = 1; | ||
console.error( | ||
'Translations changed, please run `npm run write-translations` to generate the stubs' | ||
) | ||
process.exitCode = 1 | ||
} | ||
} | ||
|
||
main() | ||
.catch(e => console.error(e)) | ||
|
||
|
||
|
||
|
||
main().catch((e) => console.error(e)) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You probably wanted to revert this name change too, right?
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.
No, this job does everything: run prettier, check translations, build the site and upload the artifacts. That's why we need to install dependencies. I just made it a separate step (it was done in the check translations step previously)
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.
Ah, I totally missed what was going on here, sorry! I thought you renamed the entire job to "Install dependencies" :)
In my defence, it was very early in the morning :D