Skip to content

Commit 6c4fdf5

Browse files
🤖 GITHUB ACTIONS format_prettier
1 parent cb829b5 commit 6c4fdf5

2 files changed

Lines changed: 27 additions & 32 deletions

File tree

‎scripts/postbuild.ts‎

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@ import { newRelic } from './new-relic.postbuild'
1313

1414
const glob = require('glob')
1515
// Run updates on index.html files across languages
16-
glob
17-
.sync('./dist/*/index.html')
18-
.forEach((file) => {
19-
const options = getOptionsObjet(file)
20-
let data = readFileSync(file, 'utf8')
21-
data = buildInfo(data, options)
22-
// Replace all the `*.js` references to match updated JS file names with the language code.
23-
data = addLanguageCodeToHashesOnToHTMLFiles(data, options)
24-
data = addOneTrustNotAutoBlockForAppScripts(data)
25-
data = newRelic(data)
16+
glob.sync('./dist/*/index.html').forEach((file) => {
17+
const options = getOptionsObjet(file)
18+
let data = readFileSync(file, 'utf8')
19+
data = buildInfo(data, options)
20+
// Replace all the `*.js` references to match updated JS file names with the language code.
21+
data = addLanguageCodeToHashesOnToHTMLFiles(data, options)
22+
data = addOneTrustNotAutoBlockForAppScripts(data)
23+
data = newRelic(data)
2624

27-
// data = robotsMetadata(data, options) DISABLE robots headers, as those will be handle via nginx
28-
save(data, options)
29-
})
25+
// data = robotsMetadata(data, options) DISABLE robots headers, as those will be handle via nginx
26+
save(data, options)
27+
})
3028

3129
// The following code is added to generate unique hash names for each language.
3230
// For instance `runtime.<hash>.js` and `polyfills.<hash>.js will will become `runtime.<hash>-it.js` and `polyfills.<hash>-it.js for italian
@@ -41,26 +39,22 @@ glob.sync('./dist/*/*.js').forEach((file) => {
4139
})
4240

4341
// Replace all the `runtime*.js` references to match updated JS values with language code
44-
glob
45-
.sync('./dist/*/runtime*.js')
46-
.forEach((file) => {
47-
const options = getOptionsObjet(file)
48-
let data = readFileSync(file, 'utf8')
49-
data = addLanguageCodeToHashesOnJSFiles(
50-
data,
51-
Object.keys(replacedHash),
52-
options
53-
)
54-
save(data, options)
55-
})
42+
glob.sync('./dist/*/runtime*.js').forEach((file) => {
43+
const options = getOptionsObjet(file)
44+
let data = readFileSync(file, 'utf8')
45+
data = addLanguageCodeToHashesOnJSFiles(
46+
data,
47+
Object.keys(replacedHash),
48+
options
49+
)
50+
save(data, options)
51+
})
5652

5753
// Rename chinese folders to use underscore to allow Orcid Source and Nginx to correctly point these folders
58-
glob
59-
.sync('./dist/*/index.html')
60-
.forEach((file) => {
61-
const options = getOptionsObjet(file)
62-
renameSync(options.folder, options.folder.replace('-', '_'))
63-
})
54+
glob.sync('./dist/*/index.html').forEach((file) => {
55+
const options = getOptionsObjet(file)
56+
renameSync(options.folder, options.folder.replace('-', '_'))
57+
})
6458

6559
// Move all assets into a single shared folder
6660
createShareAssetsFolder()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
// tslint:disable-next-line: max-line-length
2-
export const BROWSERLIST_REGEXP = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|15[_.]8|15[_.](9|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+|17[_.]0|17[_.]([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})[_.]\d+|18[_.]0|18[_.]([1-9]|\d{2,})|(19|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+|17\.0|17\.([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})\.\d+|18\.0|18\.([1-9]|\d{2,})|(19|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/
2+
export const BROWSERLIST_REGEXP =
3+
/((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|15[_.]8|15[_.](9|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+|17[_.]0|17[_.]([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})[_.]\d+|18[_.]0|18[_.]([1-9]|\d{2,})|(19|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+|17\.0|17\.([1-9]|\d{2,})|(1[8-9]|[2-9]\d|\d{3,})\.\d+|18\.0|18\.([1-9]|\d{2,})|(19|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/

0 commit comments

Comments
 (0)