Webatrice: husky (#4591)

This commit is contained in:
Jeremy Letto 2022-03-13 12:44:51 -05:00 committed by GitHub
parent b464fa8d99
commit 2c702d3579
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 7 deletions

7
.husky/pre-commit Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd webclient
npm run translate
git add src/i18n-default.json

View file

@ -6156,6 +6156,12 @@
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="
},
"husky": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz",
"integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==",
"dev": true
},
"hyphenate-style-name": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz",

View file

@ -45,7 +45,9 @@
"eject": "react-scripts eject",
"lint": "eslint \"./**/*.{ts,tsx}\"",
"lint:fix": "eslint \"./**/*.{ts,tsx}\" --fix",
"golden": "npm run lint && npm run test"
"golden": "npm run lint && npm run test",
"prepare": "cd .. && husky install",
"translate": "node prebuild.js -i18nOnly"
},
"eslintConfig": {
"extends": "react-app"
@ -85,6 +87,7 @@
"@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.14.0",
"fs-extra": "^10.0.1",
"husky": "^7.0.4",
"i18next-icu": "^2.0.3",
"identity-obj-proxy": "^3.0.0",
"intl-messageformat": "^9.11.4"

View file

@ -18,14 +18,20 @@ const sharedFiles = [
const i18nFileRegex = /\.i18n\.json$/;
const i18nOnly = process.argv.indexOf('-i18nOnly') > -1;
(async () => {
if (i18nOnly) {
await createI18NDefault();
return;
}
// make sure these files finish copying before master file is created
await copySharedFiles();
createMasterProtoFile();
createServerProps();
createI18NDefault();
await createMasterProtoFile();
await createServerProps();
await createI18NDefault();
})();
async function copySharedFiles() {
@ -37,7 +43,7 @@ async function copySharedFiles() {
}
}
function createMasterProtoFile() {
async function createMasterProtoFile() {
try {
fse.readdir(protoFilesDir, (err, files) => {
if (err) throw err;

View file

@ -1,6 +1,6 @@
{
"Common": {
"language": "Translate into English.",
"language": "English",
"disconnect": "Disconnect",
"label": {
"confirmPassword": "Confirm Password",
@ -270,6 +270,7 @@
"WS": "Samoa",
"YE": "Yemen",
"YT": "Mayotte",
"XK": "Kosovo",
"ZA": "South Africa",
"ZM": "Zambia",
"ZW": "Zimbabwe",

File diff suppressed because one or more lines are too long

View file

@ -247,6 +247,7 @@ export const countryCodes = [
'WF',
'EH',
'YE',
'XK',
'ZM',
'ZW',
];