mirror of
https://git.vectorsigma.ru/public/AdGuardHome.git
synced 2026-07-28 20:29:10 +00:00
Merge branch 'ADG-10291' into ADG-10294
This commit is contained in:
21
.twosky.json
21
.twosky.json
@@ -43,5 +43,26 @@
|
||||
"zh-hk": "繁體中文(香港)",
|
||||
"zh-tw": "正體中文(台灣)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"project_id": "home_v2",
|
||||
"base_locale": "en",
|
||||
"localizable_files": [
|
||||
"client_v2/src/__locales/en.json"
|
||||
],
|
||||
"languages": {
|
||||
"de": "Deutsch",
|
||||
"en": "English",
|
||||
"es": "Español",
|
||||
"fr": "Français",
|
||||
"it": "Italiano",
|
||||
"ja": "日本語",
|
||||
"ko": "한국어",
|
||||
"pt-br": "Português (BR)",
|
||||
"pt-pt": "Português (PT)",
|
||||
"ru": "Русский",
|
||||
"zh-cn": "简体中文",
|
||||
"zh-tw": "正體中文(台灣)"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
3
Makefile
3
Makefile
@@ -21,7 +21,8 @@ GO.MACRO = $${GO:-go}
|
||||
VERBOSE.MACRO = $${VERBOSE:-0}
|
||||
|
||||
CHANNEL = development
|
||||
CLIENT_DIR = client_v2
|
||||
# TODO: Update CLIENT_DIR to client_v2 for new frontend migration
|
||||
CLIENT_DIR = client
|
||||
DEPLOY_SCRIPT_PATH = not/a/real/path
|
||||
DIST_DIR = dist
|
||||
GOAMD64 = v1
|
||||
|
||||
@@ -6,6 +6,7 @@ set -e -f -u -x
|
||||
# for this database is https://github.com/AdguardTeam/companiesdb.
|
||||
#
|
||||
trackers_url='https://raw.githubusercontent.com/AdguardTeam/companiesdb/main/dist/trackers.json'
|
||||
# TODO: Update output path to './client_v2/src/helpers/trackers/trackers.json' for new frontend migration
|
||||
output='./client/src/helpers/trackers/trackers.json'
|
||||
readonly trackers_url output
|
||||
|
||||
|
||||
@@ -27,9 +27,11 @@ import (
|
||||
|
||||
const (
|
||||
twoskyConfFile = "./.twosky.json"
|
||||
// TODO: Update localesDir to "./client_v2/src/__locales" for new frontend migration
|
||||
localesDir = "./client/src/__locales"
|
||||
defaultBaseFile = "en.json"
|
||||
defaultProjectID = "home"
|
||||
// TODO: Update srcDir to "./client_v2/src" for new frontend migration
|
||||
srcDir = "./client/src"
|
||||
twoskyURI = "https://twosky.int.agrd.dev/api/v1"
|
||||
|
||||
@@ -77,6 +79,8 @@ func main() {
|
||||
usage("")
|
||||
}
|
||||
|
||||
// TODO: Support multiple projects in .twosky.json - add PROJECT_ID env var to select between 'home' and 'home_v2'
|
||||
// TODO: Modify readTwoskyConfig() to return all configs and add selectProject() function
|
||||
conf := errors.Must(readTwoskyConfig())
|
||||
|
||||
var cli *twoskyClient
|
||||
@@ -106,6 +110,7 @@ func main() {
|
||||
// usage prints usage. If addStr is not empty print addStr and exit with code
|
||||
// 1, otherwise exit with code 0.
|
||||
func usage(addStr string) {
|
||||
// TODO: Add PROJECT_ID environment variable documentation when multi-project support is implemented
|
||||
const usageStr = `Usage: go run main.go <command> [<args>]
|
||||
Commands:
|
||||
help
|
||||
@@ -161,6 +166,7 @@ func readTwoskyConfig() (t *twoskyConfig, err error) {
|
||||
return nil, fmt.Errorf("%q is empty", twoskyConfFile)
|
||||
}
|
||||
|
||||
// TODO: Currently only uses first project - modify to support project selection
|
||||
conf := tsc[0]
|
||||
|
||||
for _, lang := range conf.Languages {
|
||||
|
||||
@@ -95,6 +95,7 @@ func main() {
|
||||
|
||||
errors.Check(enc.Encode(aghFlt))
|
||||
|
||||
// TODO: Update output path to "client_v2/src/helpers/filters/filters.ts" for new frontend migration
|
||||
err = maybe.WriteFile("client/src/helpers/filters/filters.ts", buf.Bytes(), 0o644)
|
||||
errors.Check(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user