dec0dOS / zero-ui

ZeroUI - ZeroTier Controller Web UI - is a web user interface for a self-hosted ZeroTier network controller.
GNU General Public License v3.0
951 stars 152 forks source link

feat: i18n - dynamic import on build time #188

Closed aruznieto closed 6 months ago

aruznieto commented 1 year ago

Please check the type of change your PR introduces:

aruznieto commented 6 months ago

Hi, whats happened with that?

dec0dOS commented 6 months ago

LGTM, ready to merge. I tested extensively some big changes on my local setup before releasing the production image. I'm really busy with some projects now, so please let me know if that works for your setup as expected

aruznieto commented 6 months ago

LGTM, ready to merge. I tested extensively some big changes on my local setup before releasing the production image. I'm really busy with some projects now, so please let me know if that works for your setup as expected

Do you know why appears this error on yarn install?

error Workspaces can only be enabled in private projects.

dec0dOS commented 6 months ago

Seems like some errors in yarn.lock. Get the fixed version from main branch.

aruznieto commented 6 months ago

Seems like some errors in yarn.lock. Get the fixed version from main branch.

I am cloning the repo

dec0dOS commented 6 months ago

Make sure that you use the latest yarn version (corepack should help)

❯ yarn -v
4.1.1
❯ node -v
v20.10.0
❯ cd /tmp/zero-ui
❯ git pull
Already up to date.
❯ ls
backend       docker-compose.yml  LICENSE       README.md
CHANGELOG.md  docs                node_modules  tsconfig.json
docker        frontend            package.json  yarn.lock
❯ rm -rf node_modules
❯ yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 269ms
➤ YN0000: ┌ Link step
➤ YN0007: │ zero-ui@workspace:. must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 6s 563ms
➤ YN0000: · Done in 7s 102ms
❯ yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 275ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 612ms
❯ yarn build
vite v4.5.3 building for production...
Locales list saved to /private/tmp/zero-ui/frontend/src/generated/localesList.json
✓ 1234 modules transformed.
build/index.html                                              0.67 kB │ gzip:   0.37 kB
build/assets/roboto-vietnamese-400-normal-77b24796.woff2      5.56 kB
build/assets/roboto-greek-400-normal-daf51ab5.woff2           7.11 kB
build/assets/roboto-cyrillic-400-normal-495d38d4.woff2        9.63 kB
build/assets/roboto-latin-ext-400-normal-3c23eb02.woff2      11.87 kB
build/assets/roboto-cyrillic-ext-400-normal-b7ef2cd1.woff2   15.34 kB
build/assets/roboto-latin-400-normal-f6734f81.woff2          15.74 kB
build/assets/roboto-all-400-normal-e41533d5.woff             65.46 kB
build/assets/index-81542e93.css                              12.40 kB │ gzip:   4.32 kB
build/assets/index-b9b777a6.js                              901.67 kB │ gzip: 294.38 kB
✓ built in 3.21s
aruznieto commented 6 months ago

Make sure that you use the latest yarn version (corepack should help)

❯ yarn -v
4.1.1
❯ node -v
v20.10.0
❯ cd /tmp/zero-ui
❯ git pull
Already up to date.
❯ ls
backend       docker-compose.yml  LICENSE       README.md
CHANGELOG.md  docs                node_modules  tsconfig.json
docker        frontend            package.json  yarn.lock
❯ rm -rf node_modules
❯ yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 269ms
➤ YN0000: ┌ Link step
➤ YN0007: │ zero-ui@workspace:. must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 6s 563ms
➤ YN0000: · Done in 7s 102ms
❯ yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 275ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 612ms
❯ yarn build
vite v4.5.3 building for production...
Locales list saved to /private/tmp/zero-ui/frontend/src/generated/localesList.json
✓ 1234 modules transformed.
build/index.html                                              0.67 kB │ gzip:   0.37 kB
build/assets/roboto-vietnamese-400-normal-77b24796.woff2      5.56 kB
build/assets/roboto-greek-400-normal-daf51ab5.woff2           7.11 kB
build/assets/roboto-cyrillic-400-normal-495d38d4.woff2        9.63 kB
build/assets/roboto-latin-ext-400-normal-3c23eb02.woff2      11.87 kB
build/assets/roboto-cyrillic-ext-400-normal-b7ef2cd1.woff2   15.34 kB
build/assets/roboto-latin-400-normal-f6734f81.woff2          15.74 kB
build/assets/roboto-all-400-normal-e41533d5.woff             65.46 kB
build/assets/index-81542e93.css                              12.40 kB │ gzip:   4.32 kB
build/assets/index-b9b777a6.js                              901.67 kB │ gzip: 294.38 kB
✓ built in 3.21s

I just tested it, the i18n works perfect