From 0e3692f9a0c3e37c8417df2ac7c4fdea943360d3 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 26 Aug 2025 12:54:27 +0300 Subject: [PATCH] add todos --- .twosky.json | 21 +++++++++++++++++++++ Makefile | 1 + scripts/companiesdb/download.sh | 1 + scripts/translations/main.go | 6 ++++++ scripts/vetted-filters/main.go | 1 + 5 files changed, 30 insertions(+) diff --git a/.twosky.json b/.twosky.json index e7721ca6..b704bc02 100644 --- a/.twosky.json +++ b/.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": "正體中文(台灣)" + } } ] diff --git a/Makefile b/Makefile index 06b3e420..23fc4a6d 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ GO.MACRO = $${GO:-go} VERBOSE.MACRO = $${VERBOSE:-0} CHANNEL = development +# TODO: Update CLIENT_DIR to client_v2 for new frontend migration CLIENT_DIR = client DEPLOY_SCRIPT_PATH = not/a/real/path DIST_DIR = dist diff --git a/scripts/companiesdb/download.sh b/scripts/companiesdb/download.sh index 8aa8c8cb..4f677526 100755 --- a/scripts/companiesdb/download.sh +++ b/scripts/companiesdb/download.sh @@ -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 diff --git a/scripts/translations/main.go b/scripts/translations/main.go index e8dc0473..8eafa8b5 100644 --- a/scripts/translations/main.go +++ b/scripts/translations/main.go @@ -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 [] 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 { diff --git a/scripts/vetted-filters/main.go b/scripts/vetted-filters/main.go index 323b6019..d6586e23 100644 --- a/scripts/vetted-filters/main.go +++ b/scripts/vetted-filters/main.go @@ -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) }