diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4250a32 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0c83652 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,32 @@ +node_modules +.nuxt +.output +dist +build +coverage +.pnpm-store + +# Auto-generated by Nuxt +**/.nuxt/** +**/.output/** + +# Lockfiles +pnpm-lock.yaml +Cargo.lock + +# Generated tsconfigs (Nuxt) +**/.nuxt/tsconfig*.json + +# env files +.env +.env.* +!.env.example + +# Don't reformat OpenSpec specs / changes / docs — these are prose where +# line breaks around `### Requirement:` / `#### Scenario:` blocks are part +# of the spec's reading layout, not cosmetic. +openspec/specs/** +openspec/changes/** +openspec/MIGRATION-PLAN.md +docs/**/*.md +docs/**/*.html diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..764ddba --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,12 @@ +{ + "semi": true, + "singleQuote": false, + "trailingComma": "all", + "printWidth": 100, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "lf", + "arrowParens": "always", + "vueIndentScriptAndStyle": false, + "plugins": ["prettier-plugin-tailwindcss"] +} diff --git a/apps/admin/app.vue b/apps/admin/app.vue index e1afc8b..5e0c33e 100644 --- a/apps/admin/app.vue +++ b/apps/admin/app.vue @@ -25,18 +25,20 @@ const navItems = [ diff --git a/apps/admin/pages/brands.vue b/apps/admin/pages/brands.vue index fff1028..74ef238 100644 --- a/apps/admin/pages/brands.vue +++ b/apps/admin/pages/brands.vue @@ -105,7 +105,6 @@ async function save(): Promise { } } - onMounted(() => { void loadBrands(); }); @@ -113,10 +112,14 @@ onMounted(() => { \ No newline at end of file + diff --git a/apps/admin/pages/content.vue b/apps/admin/pages/content.vue index 461269c..c4820cb 100644 --- a/apps/admin/pages/content.vue +++ b/apps/admin/pages/content.vue @@ -107,7 +107,12 @@ function validate(kind: ContentKind): boolean { for (const [index, row] of list.entries()) { if (kind === "quick-links") { const link = row as QuickLinkRow; - if (!link.label.en.trim() || !link.label.zh.trim() || !link.url.trim() || !link.glyph.trim()) { + if ( + !link.label.en.trim() || + !link.label.zh.trim() || + !link.url.trim() || + !link.glyph.trim() + ) { errors[index] = t("admin.contentQuickLinkInvalid"); } } else if (kind === "floor-adverts") { @@ -150,7 +155,6 @@ async function saveKind(kind: ContentKind): Promise { } } - onMounted(() => { void loadContent(); }); @@ -158,14 +162,23 @@ onMounted(() => { \ No newline at end of file + diff --git a/apps/admin/pages/currencies.vue b/apps/admin/pages/currencies.vue index 064fe71..cfb087a 100644 --- a/apps/admin/pages/currencies.vue +++ b/apps/admin/pages/currencies.vue @@ -157,61 +157,104 @@ onMounted(() => { - + - + - + {{ creating ? $t("common.loading") : $t("admin.saveCurrency") }} -

{{ $t("common.loading") }}

- +

{{ $t("common.loading") }}

+ {{ $t("common.empty") }}
-
- - - {{ $t("common.currency") }} - {{ $t("admin.currencyNameEn") }} - {{ $t("admin.symbol") }} - {{ $t("admin.exponent") }} - {{ $t("admin.rate") }} - {{ $t("admin.baseCurrency") }} - {{ $t("admin.enabled") }} - {{ $t("common.actions") }} - - - - - {{ currency.code }} - {{ localizedName(currency.name) }} - {{ currency.symbol }} - {{ currency.exponent }} - - - {{ $t("admin.baseCurrency") }} - — - - {{ currency.enabled ? $t("common.yes") : $t("common.no") }} -
- - {{ savingCode === currency.code ? $t("common.loading") : $t("admin.updateRate") }} - - - {{ currency.enabled ? $t("admin.suspend") : $t("admin.activate") }} - -
- - -
+
+ + + + {{ $t("common.currency") }} + {{ $t("admin.currencyNameEn") }} + {{ $t("admin.symbol") }} + {{ $t("admin.exponent") }} + {{ $t("admin.rate") }} + {{ $t("admin.baseCurrency") }} + {{ $t("admin.enabled") }} + {{ $t("common.actions") }} + + + + + + {{ currency.code }} + + {{ localizedName(currency.name) }} + {{ currency.symbol }} + {{ currency.exponent }} + + + + + {{ $t("admin.baseCurrency") }} + — + + + {{ + currency.enabled ? $t("common.yes") : $t("common.no") + }} + + +
+ + {{ + savingCode === currency.code ? $t("common.loading") : $t("admin.updateRate") + }} + + + {{ currency.enabled ? $t("admin.suspend") : $t("admin.activate") }} + +
+ + + +
+
diff --git a/apps/admin/pages/index.vue b/apps/admin/pages/index.vue index 396911d..31f0b18 100644 --- a/apps/admin/pages/index.vue +++ b/apps/admin/pages/index.vue @@ -1,5 +1,4 @@