-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Switching from jade to pug #21047
Merged
Merged
Switching from jade to pug #21047
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8dc3195
Upgrading pug
kobelb b7281c5
Switching .jade to .pug and fixing templates
kobelb 5c8a93e
Merge remote-tracking branch 'upstream/master' into pug
kobelb 91fb32c
Merge remote-tracking branch 'upstream/master' into pug
kobelb 069a04f
Merge remote-tracking branch 'upstream/master' into pug
kobelb 79f0a4a
Merge remote-tracking branch 'upstream/master' into pug
kobelb 3bef562
Renaming the I18N usages of jade to pug
kobelb 668ee40
No more jade in I18N
kobelb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ import JSON5 from 'json5'; | |
|
||
import { extractHtmlMessages } from './extract_html_messages'; | ||
import { extractCodeMessages } from './extract_code_messages'; | ||
import { extractJadeMessages } from './extract_jade_messages'; | ||
import { extractPugMessages } from './extract_pug_messages'; | ||
import { extractHandlebarsMessages } from './extract_handlebars_messages'; | ||
import { globAsync, makeDirAsync, accessAsync, readFileAsync, writeFileAsync } from './utils'; | ||
|
||
|
@@ -38,19 +38,19 @@ function addMessageToMap(targetMap, key, value) { | |
} | ||
|
||
export async function extractDefaultTranslations(inputPath) { | ||
const entries = await globAsync('*.{js,jsx,jade,ts,tsx,html,hbs,handlebars}', { | ||
const entries = await globAsync('*.{js,jsx,pug,jade,ts,tsx,html,hbs,handlebars}', { | ||
cwd: inputPath, | ||
matchBase: true, | ||
}); | ||
|
||
const { htmlEntries, codeEntries, jadeEntries, hbsEntries } = entries.reduce( | ||
const { htmlEntries, codeEntries, pugEntries, hbsEntries } = entries.reduce( | ||
(paths, entry) => { | ||
const resolvedPath = resolve(inputPath, entry); | ||
|
||
if (resolvedPath.endsWith('.html')) { | ||
paths.htmlEntries.push(resolvedPath); | ||
} else if (resolvedPath.endsWith('.jade')) { | ||
paths.jadeEntries.push(resolvedPath); | ||
} else if (resolvedPath.endsWith('.jade') || resolvedPath.endsWith('.pug')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since switching to |
||
paths.pugEntries.push(resolvedPath); | ||
} else if (resolvedPath.endsWith('.hbs') || resolvedPath.endsWith('.handlebars')) { | ||
paths.hbsFiles.push(resolvedPath); | ||
} else { | ||
|
@@ -59,7 +59,7 @@ export async function extractDefaultTranslations(inputPath) { | |
|
||
return paths; | ||
}, | ||
{ htmlEntries: [], codeEntries: [], jadeEntries: [], hbsEntries: [] } | ||
{ htmlEntries: [], codeEntries: [], pugEntries: [], hbsEntries: [] } | ||
); | ||
|
||
const defaultMessagesMap = new Map(); | ||
|
@@ -68,7 +68,7 @@ export async function extractDefaultTranslations(inputPath) { | |
[ | ||
[htmlEntries, extractHtmlMessages], | ||
[codeEntries, extractCodeMessages], | ||
[jadeEntries, extractJadeMessages], | ||
[pugEntries, extractPugMessages], | ||
[hbsEntries, extractHandlebarsMessages], | ||
].map(async ([entries, extractFunction]) => { | ||
const files = await Promise.all( | ||
|
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
src/ui/ui_render/views/ui_app.jade → src/ui/ui_render/views/ui_app.pug
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,4 +1,4 @@ | ||
extends ./chrome.jade | ||
extends ./chrome | ||
|
||
block content | ||
style. | ||
|
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.
🎉 I somehow always forget to remove this loader when I'm messing around with the optimizer