nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.75k stars 483 forks source link

feat: new docs #2740

Closed MuhammadM1998 closed 9 months ago

MuhammadM1998 commented 9 months ago

πŸ”— Linked issue

Resolves #2692

❓ Type of change

πŸ“š Description

This updates the docs to use Nuxt UI Pro & Nuxt Content. Moving away from the un-maintained Docus and aligning with the other official modules docs.

I've tried to keep minimal changes and not changing the content for easier migration. I'll open other PRs to improve the docs sections I'm confident about later.

Changes

TODOs

Builds Are Failing Builds are failing as it needs NuxtUI Pro license which we don't have yet, a workaround is to set env for this deployment to 'development' so it doesn't ask for the license

πŸ“ Checklist

nuxt-studio[bot] commented 9 months ago

Live Preview ready!

Name Edit Preview Latest Commit
i18n Edit on Studio β†—οΈŽ View Live Preview 13fd55b38ad6ac92aefa1f7c58b0446d297d2e96
atinux commented 9 months ago

The license should be good now, the error when deploying are because of missing pages or wrong links

MuhammadM1998 commented 9 months ago

Thank you πŸ™ I'll look into the logs

MuhammadM1998 commented 9 months ago

Last commit build is failing due to 'invalid license' image

I guess the license needs to be added to Netlify's env variables? @Atinux @kazupon

MuhammadM1998 commented 9 months ago

Preview of OG Image. I can change the nuxt logo to the module logo if provided with an SVG for it Screenshot 2024-01-30 201325

MuhammadM1998 commented 9 months ago

I've pinned Nuxt Content to 2.8 because the syntax highlighting was broken in dev. I've tried it on stackblitz and It's working. Seems because I'm using Windows (https://github.com/nuxt/content/issues/2522) and should work fine when deployed. Feel free to bump it and test on your side if you're not using windows.

kazupon commented 9 months ago

@MuhammadM1998 Thanks for your efforts!

I checked your PR in my local machine the below command:

pnpm run --filter @nuxtjs/i18n-docs dev

However, in my environment, I could not see your docs because of an error in the dependency resolution.

log is the below:

``` [Vue Router warn]: uncaught error during route navigation: Error: Cannot find module './emojis' Require stack: - /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:110:18) at /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib:2:8 at ViteNodeRunner.directRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:341:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ViteNodeRunner.cachedRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:197:14) at async ViteNodeRunner.dependencyRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:231:12) at async /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/node-emoji:3:31 { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib' ] } Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'env' is not supported by shiki. Skipping highlight. Language 'env' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. Language 'asciidoc' is not supported by shiki. Skipping highlight. [Vue Router warn]: uncaught error during route navigation: Error: Cannot find module './emojis' Require stack: - /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:110:18) at /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib:2:8 at ViteNodeRunner.directRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:341:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ViteNodeRunner.cachedRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:197:14) at async ViteNodeRunner.dependencyRequest (file:///Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/node_modules/.pnpm/vite-node@0.33.0/node_modules/vite-node/dist/client.mjs:231:12) at async /Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/node-emoji:3:31 { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/kazuya.kawaguchi/Projects/oss/nuxt/tmp/i18n-renewal-docs/docs/emojilib' ] } ```

Can you solve this issue with the npm script so that I and others can see your docs? πŸ™

MuhammadM1998 commented 9 months ago

@kazupon Can you try running pnpm install first in the workspace root? I've encountered the same error sometimes. Installing the deps for all workspace (pnpm install) solved the issue and the pnpm run docs:dev ran correctly. I'll also check if I could see the root cause

BobbieGoede commented 9 months ago

I'm getting the same error, I did run pnpm install in the workspace root.

I found this issue https://github.com/nuxt/ui-pro/issues/37 that seems to describe a similar issue, the error went away after adding the following lines to docs/.npmrc (suggested by https://github.com/nuxt/ui-pro/issues/37#issuecomment-1811381891) and reinstalling.

shamefully-hoist=true
strict-peer-dependencies=false
MuhammadM1998 commented 9 months ago

@BobbieGoede Thanks for finding out! I'll add them and recheck if everything works

MuhammadM1998 commented 9 months ago

@BobbieGoede @kazupon I've pushed changes and tested locally by removing node_modules and running this

pnpm install && pnpm run --filter @nuxtjs/i18n-docs dev

It worked correctly. Please check now on your side. I've also bumped nuxt/content and the syntax highlighting issues were fixed so ignore my past comment.

kazupon commented 9 months ago

@MuhammadM1998 Thanks! I've checked new docs! It's amazing! ❀️ ✨

@Atinux When I've build, I've got the license the below error message:


> nuxi build docs

Nuxt 3.8.2 with Nitro 2.8.1                                                                                                                                              13:48:40
β„Ή Using default Tailwind CSS file                                                                                                                      nuxt:tailwindcss 13:48:41

 ERROR  Invalid NUXT_UI_PRO_LICENSE license key.                                                                                                                         13:48:43
Purchase Nuxt UI Pro at https://ui.nuxt.com/pro/purchase to build your app in production.

 ELIFECYCLE  Command failed with exit code 1.
 
 ```
 
 We can deploy nuxt i18n new docs, when we will config `NUXT_UI_PRO_LICENSE` in the netlify environment variable, correct?
atinux commented 9 months ago

Shall be good now!

BobbieGoede commented 9 months ago

This looks good but I don't know what steps are left to make deployment work πŸ€”

MuhammadM1998 commented 9 months ago

@BobbieGoede Preview Deployment is already working https://deploy-preview-2740--nuxt-i18n.netlify.app/ Production deployment works the same as Preview so I think there should be no further problems. Just making sure that NuxtUI Pro keys are added to env variables for Production too not just Preview on Netlify.

I'm available If there's anything I could help with

kazupon commented 9 months ago

I've checked netlify enviroment variables. I've found out NUXT_UI_PRO_LICENSE at ntlify.

@Atinux Do we need the configure license in netlify?

atinux commented 9 months ago

No need for a NUXT_UI_PRO_LICENSE when it's an open source repo on nuxt-modules org :)

kazupon commented 9 months ago

Okay! Thanks! I'll merge this PR!

kazupon commented 9 months ago

@MuhammadM1998 Thank you very much again! we really appreciate your contribution! πŸ’š