diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 00000000..7aa72618 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# editorconfig.org +root = true + +[*] +indent_size = 2 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = off diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..8f0079ca --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Production license for @nuxt/ui-pro, get one at https://ui.nuxt.com/pro/purchase +NUXT_UI_PRO_LICENSE= + +# Public URL, used for OG Image when running nuxt generate +NUXT_PUBLIC_SITE_URL= diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..7945f332 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +*.d.ts +**/node_modules/** +**/build/** +**/dist/** +**/coverage/** +**/.*/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..b2953578 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": ["eslint:recommended", "plugin:vue/vue3-essential", "@nuxt/eslint-config"], + "plugins": ["vue"], + "rules": { + "quote-props": ["error", "as-needed"] + } +} diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 4fd0fe56..b8862165 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -16,7 +16,7 @@ jobs: - name: Runs prettier formatter run: | bun install - bun run lint:fmt + bun run lint:prettier spelling: name: spelling @@ -27,10 +27,10 @@ jobs: - name: Runs cspell spell checker run: | bun install - bun run lint:spell + bun run lint:spelling lint: - name: lint + name: lint markdown runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,4 +38,4 @@ jobs: - name: Runs mdl markdown linter run: | bun install - bun run lint:mdl \ No newline at end of file + bun run lint:markdown \ No newline at end of file diff --git a/.gitignore b/.gitignore index ab5afb29..feb2e8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,7 @@ # Logs logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* +*.log # Diagnostic reports (https://nodejs.org/api/report.html) @@ -30,35 +25,11 @@ lib-cov coverage \*.lcov -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - # Dependency directories node_modules/ jspm_packages/ -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - # TypeScript cache \*.tsbuildinfo @@ -67,6 +38,14 @@ web_modules/ .npm +# npm and pnpm +package-lock.json +__package_previews__ +.store + +privatePackages/store +pnpm-lock.yaml + # Optional eslint cache .eslintcache @@ -75,25 +54,6 @@ web_modules/ .stylelintcache -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -\*.tgz - -# Yarn Integrity file - -.yarn-integrity - # dotenv environment variable files .env @@ -101,72 +61,28 @@ web_modules/ .env.test.local .env.production.local .env.local +.env.* +!.env.example # parcel-bundler cache (https://parceljs.org/) .cache .parcel-cache -# Next.js build output - -.next -out - # Nuxt.js build / generate output .nuxt dist -# Gatsby files - -.cache/ - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp -.cache - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 +# yarn +.yarn-integrity .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz -.pnp.\* +.pnp.* +yarn.lock # IntelliJ based IDEs .idea @@ -174,3 +90,12 @@ dist # Finder (MacOS) folder config .DS_Store +.history + +# Nuxt dev/build outputs +.output +.data +.nuxt +.nitro +.cache +dist diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..8a59db9f --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json", + "default": true, + "MD001": false, + "MD003": { + "style": "atx" + }, + "MD007": { + "indent": 2 + }, + "MD013": { + "code_blocks": false, + "line_length": 120, + "tables": false + }, + "MD033": false +} diff --git a/.prettierignore b/.prettierignore index e8aab8ec..4c35c090 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ node_modules .github .idea -public \ No newline at end of file +public +content diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..2bebcd86 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,14 @@ +{ + "plugins": ["prettier-plugin-tailwindcss"], + "bracketSameLine": false, + "printWidth": 120, + "useTabs": false, + "tabWidth": 2, + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "bracketSpacing": true, + "vueIndentScriptAndStyle": false, + "proseWrap": "always", + "singleAttributePerLine": true +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..12c3eb1e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,19 @@ +{ + "recommendations": [ + "bradlc.vscode-tailwindcss", + "christian-kohler.npm-intellisense", + "christian-kohler.path-intellisense", + "DavidAnson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "editorconfig.editor", + "esbenp.prettier-vscode", + "mikestead.dotenv", + "nuxt.mdc", + "rvest.vs-code-prettier-eslint", + "simonsiefke.svg-preview", + "streetsidesoftware.code-spell-checker", + "vue.volar", + "yoavbls.pretty-ts-errors" + ], + "unwantedRecommendations": ["vue.vscode-typescript-vue-plugin"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..b95ecf4f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnType": false, + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + "editor.tabSize": 2, + "editor.insertSpaces": true, + "files.eol": "\n", + "[markdown]": { + "editor.wordWrap": "on" + } +} diff --git a/NUXT_README.md b/NUXT_README.md new file mode 100644 index 00000000..f90638e4 --- /dev/null +++ b/NUXT_README.md @@ -0,0 +1,126 @@ +![nuxt-ui-docs-social-card](https://github.com/nuxt-ui-pro/docs/assets/739984/f64e13d9-9ae0-4e03-bf7f-6be4c36cd9ba) + +# Nuxt UI Pro - Docs template + +[![Nuxt UI Pro](https://img.shields.io/badge/Made%20with-Nuxt%20UI%20Pro-00DC82?logo=nuxt.js&labelColor=020420)](https://ui.nuxt.com/pro) +[![Nuxt Studio](https://img.shields.io/badge/Open%20in%20Nuxt%20Studio-18181B?&logo=nuxt.js&logoColor=3BB5EC)](https://nuxt.studio/themes/docs) + +- [Live demo](https://docs-template.nuxt.dev/) +- [Play on Stackblitz](https://stackblitz.com/github/nuxt-ui-pro/docs) +- [Documentation](https://ui.nuxt.com/pro/getting-started) +- [Clone on Nuxt Studio](https://nuxt.studio/themes/docs) + +## Quick Start + +```bash [Terminal] +npx nuxi init -t github:nuxt-ui-pro/docs +``` + +## Setup + +Make sure to install the dependencies: + +```bash +# npm +npm install + +# pnpm +pnpm install + +# yarn +yarn install + +# bun +bun install +``` + +## Development Server + +Start the development server on `http://localhost:3000`: + +```bash +# npm +npm run dev + +# pnpm +pnpm run dev + +# yarn +yarn dev + +# bun +bun run dev +``` + +## Production + +Build the application for production: + +```bash +# npm +npm run build + +# pnpm +pnpm run build + +# yarn +yarn build + +# bun +bun run build +``` + +Locally preview production build: + +```bash +# npm +npm run preview + +# pnpm +pnpm run preview + +# yarn +yarn preview + +# bun +bun run preview +``` + +Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. + +## Nuxt Studio integration + +Add `@nuxthq/studio` dependency to your package.json: + +```bash +# npm +npm install --save-dev @nuxthq/studio + +# pnpm +pnpm add -D @nuxthq/studio + +# yarn +yarn add -D @nuxthq/studio + +# bun +bun add -d @nuxthq/studio +``` + +Add this module to your `nuxt.config.ts`: + +```ts +export default defineNuxtConfig({ + ... + modules: [ + ... + '@nuxthq/studio' + ] +}) +``` + +Read more on [Nuxt Studio docs](https://nuxt.studio/docs/projects/setup). + +## Renovate integration + +Install [Renovate GitHub app](https://github.com/apps/renovate/installations/select_target) on your repository and you +are good to go. diff --git a/README.md b/README.md index 173b0335..105dbb92 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,58 @@ -# zksync-docs +# ZK Sync Docs -Docs for zkSync +Welcome to the ZK Sync Docs repository. This project serves as the community hub for zkSync, providing comprehensive +documentation for developers. Whether you're a beginner looking to get started with zkSync or an experienced developer +seeking advanced guides, you'll find the resources you need here. + +## Setup + +This project uses bun to run, follow the [bun installation instructions](https://bun.sh/docs/installation). Once bun is +installed, run the following command to install all project dependencies: + +```shell +bun install +``` + +## Development + +To run the project locally at `http://localhost:3000` + +```shell +bun run dev -o +``` + +## Production + +```shell +bun run build +``` + +## Local Preview + +To locally preview the production build: + +```shell +bun run preview +``` + +## Lint & Formatting + +This project provides lint commands to check the project. + +### Markdown Linting + +Markdown files are found in the `/content` directory. The following lint commands will run within that directory: + +```shell +bun run lint:spelling +bun run lint:markdown +``` + +### Linting + +The following commands are available to run linting on the project: + +```shell +bun run lint:prettier +bun run lint:eslint +``` diff --git a/app.config.ts b/app.config.ts new file mode 100644 index 00000000..a79717ae --- /dev/null +++ b/app.config.ts @@ -0,0 +1,98 @@ +export default defineAppConfig({ + ui: { + primary: 'green', + gray: 'slate', + footer: { + bottom: { + left: 'text-sm text-gray-500 dark:text-gray-400', + wrapper: 'border-t border-gray-200 dark:border-gray-800', + }, + }, + content: { + prose: { + code: { + icon: { + go: 'vscode-icons:file-type-go', + }, + }, + }, + }, + }, + seo: { + siteName: 'Nuxt UI Pro - Docs template', + }, + header: { + logo: { + alt: '', + light: '', + dark: '', + }, + search: true, + colorMode: true, + links: [ + { + icon: 'i-simple-icons-github', + to: 'https://github.com/nuxt-ui-pro/docs', + target: '_blank', + 'aria-label': 'Docs template on GitHub', + }, + ], + }, + footer: { + credits: 'Copyright © 2023', + colorMode: false, + links: [ + { + icon: 'i-simple-icons-nuxtdotjs', + to: 'https://nuxt.com', + target: '_blank', + 'aria-label': 'Nuxt Website', + }, + { + icon: 'i-simple-icons-discord', + to: 'https://discord.com/invite/ps2h6QT', + target: '_blank', + 'aria-label': 'Nuxt UI on Discord', + }, + { + icon: 'i-simple-icons-x', + to: 'https://x.com/nuxt_js', + target: '_blank', + 'aria-label': 'Nuxt on X', + }, + { + icon: 'i-simple-icons-github', + to: 'https://github.com/nuxt/ui', + target: '_blank', + 'aria-label': 'Nuxt UI on GitHub', + }, + ], + }, + toc: { + title: 'Table of Contents', + bottom: { + title: 'Community', + edit: 'https://github.com/nuxt-ui-pro/docs/edit/main/content', + links: [ + { + icon: 'i-heroicons-star', + label: 'Star on GitHub', + to: 'https://github.com/nuxt/ui', + target: '_blank', + }, + { + icon: 'i-heroicons-book-open', + label: 'Nuxt UI Pro docs', + to: 'https://ui.nuxt.com/pro/guide', + target: '_blank', + }, + { + icon: 'i-simple-icons-nuxtdotjs', + label: 'Purchase a license', + to: 'https://ui.nuxt.com/pro/purchase', + target: '_blank', + }, + ], + }, + }, +}); diff --git a/app.vue b/app.vue new file mode 100644 index 00000000..0243a37a --- /dev/null +++ b/app.vue @@ -0,0 +1,54 @@ + + + diff --git a/bun.lockb b/bun.lockb index d100895b..3d240a64 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/checks-config/.markdownlint.json b/checks-config/.markdownlint.json deleted file mode 100644 index ec292f9a..00000000 --- a/checks-config/.markdownlint.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "default": true, - "fenced-code-language": false, - "no-duplicate-header": false, - "first-header-h1": false, - "first-line-h1": false, - "no-inline-html": false, - "ol-prefix": false, - "MD026": { - "punctuation": ".,;:!。,;:!:" - }, - "MD013": false, - "MD001": false, - "MD051": false, - "MD025": false, - "MD036": false, - "MD003": false, - "MD007": { - "indent": 2, - "code_blocks": false, - "headings": false, - "tables": false - }, - "no-hard-tabs": false, - "whitespace": false -} diff --git a/checks-config/cspell.json b/checks-config/cspell.json deleted file mode 100644 index 6b75610a..00000000 --- a/checks-config/cspell.json +++ /dev/null @@ -1,44 +0,0 @@ -{ -"language": "en", -"ignorePaths": [ - "node_modules/**", - ".github/**", - ".firebase/**", - ".yarn/**", - "dist/**" -], -"dictionaries": [ - "typescript", - "cpp", - "npm", - "filetypes", - "cpp", - "en_GB", - "en_US", - "node", - "bash", - "fonts", - "npm", - "cryptocurrencies", - "companies", - "rust", - "html", - "css", - "entities", - "softwareTerms", - "misc", - "fullstack", - "softwareTerms", - "zksync", - "nuxt", - "viem" -], -"dictionaryDefinitions": [ - { - "name": "zksync", - "addWords": true, - "path": "./cspell-zksync.txt" - } -], -"allowCompoundWords": true -} diff --git a/components/Footer.vue b/components/Footer.vue new file mode 100644 index 00000000..a5dc4a5f --- /dev/null +++ b/components/Footer.vue @@ -0,0 +1,23 @@ + + + diff --git a/components/Header.vue b/components/Header.vue new file mode 100644 index 00000000..8d83e6c4 --- /dev/null +++ b/components/Header.vue @@ -0,0 +1,54 @@ + + + diff --git a/components/OgImage/OgImageDocs.vue b/components/OgImage/OgImageDocs.vue new file mode 100644 index 00000000..cc0e1eb0 --- /dev/null +++ b/components/OgImage/OgImageDocs.vue @@ -0,0 +1,29 @@ + + + diff --git a/content/10.getting-started/1.index.md b/content/10.getting-started/1.index.md new file mode 100644 index 00000000..47be72c1 --- /dev/null +++ b/content/10.getting-started/1.index.md @@ -0,0 +1,55 @@ +--- +title: Introduction +description: Welcome to Nuxt UI Pro documentation template. +layout: test +--- + +This template is a ready-to-use documentation template made with [Nuxt UI Pro](https://ui.nuxt.com/pro), a collection of +premium components built on top of [Nuxt UI](https://ui.nuxt.com) to create beautiful & responsive Nuxt applications in +minutes. + +There are already many websites based on this template: + +- [Nuxt](https://nuxt.com) - The Nuxt website +- [Nuxt UI](https://ui.nuxt.com) - The documentation of `@nuxt/ui` and `@nuxt/ui-pro` +- [Nuxt Image](https://image.nuxt.com) - The documentation of `@nuxt/image` +- [Nuxt Content](https://content.nuxt.com) - The documentation of `@nuxt/content` +- [Nuxt Devtools](https://devtools.nuxt.com) - The documentation of `@nuxt/devtools` +- [Nuxt Studio](https://nuxt.studio) - The pro version of Nuxt Content + +## Features + +- Powered by [Nuxt 3](https://nuxt.com) +- Built with [Nuxt UI](https://ui.nuxt.com) and [Nuxt UI Pro](https://ui.nuxt.com/pro) +- Write content with [MDC syntax](https://content.nuxt.com/usage/markdown) thanks to + [Nuxt Content](https://content.nuxt.com) +- Compatible with [Nuxt Studio](https://nuxt.studio) +- Auto-generated sidebar navigation +- Full-Text Search out of the box +- Beautiful Typography styles +- Dark mode support +- And more... + +## Play online + +You can start playing with this template in your browser using our online sandboxes: + +::u-button + +class: mr-4 icon: i-simple-icons-stackblitz label: Play on StackBlitz target: \_blank to: +[stackblitz](https://stackblitz.com/github/nuxt-ui-pro/docs/) + +--- + +:: + +::u-button + +class: mt-2 sm:mt-0 icon: i-simple-icons-codesandbox label: Play on CodeSandbox target: \_blank to: +[codesandbox](https://codesandbox.io/s/github/nuxt-ui-pro/docs/) + +--- + +:: + +Or open [Nuxt UI playground](https://ui.nuxt.com/playground). diff --git a/content/10.getting-started/2.installation.md b/content/10.getting-started/2.installation.md new file mode 100644 index 00000000..eda61a5c --- /dev/null +++ b/content/10.getting-started/2.installation.md @@ -0,0 +1,33 @@ +--- +title: Installation +description: Get started with Nuxt UI Pro documentation template. +layout: docs +--- + +## ::callout + +icon: i-heroicons-light-bulb target: \_blank to: [nuxt studio](https://nuxt.studio/themes/docs) + +--- + +Use this template on Nuxt Studio and start your documentation in seconds. :: + +## Quick Start + +You can start a fresh new project with: + +```bash [Terminal] +npx nuxi init -t github:nuxt-ui-pro/docs +``` + +or create a new repository from GitHub: + +1. Open +2. Click on `Use this template` button +3. Enter repository name and click on `Create repository from template` button +4. Clone your new repository +5. Install dependencies with your favorite package manager +6. Start development server + +That's it! You can now start writing your documentation in the +[`content/`](https://content.nuxt.com/usage/content-directory) directory 🚀 diff --git a/content/10.getting-started/3.usage.md b/content/10.getting-started/3.usage.md new file mode 100644 index 00000000..6cdaaed6 --- /dev/null +++ b/content/10.getting-started/3.usage.md @@ -0,0 +1,155 @@ +--- +title: Usage +description: Learn how to write and customize your documentation. +--- + +This is only a basic example of what you can achieve with [Nuxt UI Pro](https://ui.nuxt.com/pro/guide), you can tweak it +to match your needs. The template uses several Nuxt modules underneath like [`@nuxt/content`](https://content.nuxt.com) +for the content, [`@nuxtjs/fontaine`](https://github.com/nuxt-modules/fontaine) and +[`@nuxtjs/google-fonts`](https://github.com/nuxt-modules/google-fonts) to change the font and +[`nuxt-og-image`](https://nuxtseo.com/og-image/getting-started/installation) for social previews. + +## ::callout + +icon: i-heroicons-light-bulb target: \_blank to: [nuxt guide](https://ui.nuxt.com/pro/guide/usage#structure) + +--- + +Learn more on how to customize and structure a Nuxt UI Pro app! :: + +## Writing content + +You can just start writing `.md` or `.yml` files in the [`content/`](https://content.nuxt.com/usage/content-directory) +directory to have your pages updated. The navigation will be automatically generated in the left aside and in the mobile +menu. You will also be able to go through your content with full-text search. + +::callout{icon="i-heroicons-light-bulb"} This template relies on a +[catch-all route](https://nuxt.com/docs/guide/directory-structure/pages#catch-all-route) but you can achieve the same +thing with the [document-driven mode](https://content.nuxt.com/document-driven/introduction). :: + +## App Configuration + +In addition to `@nuxt/ui-pro` configuration through the `app.config.ts`, this template lets you customize the `Header`, +`Footer` and the `Table of contents` components. + +### Header + +```ts [app.config.ts] +export default defineAppConfig({ + header: { + // Logo configuration + logo: { + // Light mode + light: { + src: '', + alt: '', + class: '', + }, + // Dark mode + dark: { + src: '', + alt: '', + class: '', + }, + }, + // Show or hide the search bar + search: true, + // Show or hide the color mode button + colorMode: true, + // Customize links + links: [ + { + icon: 'i-simple-icons-github', + to: 'https://github.com/nuxt-ui-pro/docs', + target: '_blank', + 'aria-label': 'Docs template on GitHub', + }, + ], + }, +}); +``` + +### Footer + +```ts [app.config.ts] +export default defineAppConfig({ + footer: { + // Update bottom left credits + credits: 'Copyright © 2023', + // Show or hide the color mode button + colorMode: false, + // Customize links + links: [ + { + icon: 'i-simple-icons-nuxtdotjs', + to: 'https://nuxt.com', + target: '_blank', + 'aria-label': 'Nuxt Website', + }, + { + icon: 'i-simple-icons-discord', + to: 'https://discord.com/invite/ps2h6QT', + target: '_blank', + 'aria-label': 'Nuxt UI on Discord', + }, + { + icon: 'i-simple-icons-x', + to: 'https://x.com/nuxt_js', + target: '_blank', + 'aria-label': 'Nuxt on X', + }, + { + icon: 'i-simple-icons-github', + to: 'https://github.com/nuxt/ui', + target: '_blank', + 'aria-label': 'Nuxt UI on GitHub', + }, + ], + }, +}); +``` + +### Table of contents + +```ts [app.config.ts] +export default defineAppConfig({ + toc: { + // Title of the main table of contents + title: 'Table of Contents', + // Bottom TOC configuration + bottom: { + // Title of the bottom table of contents + title: 'Community', + // URL of your repository content folder + edit: '', + // Customize links + links: [ + { + icon: 'i-heroicons-star', + label: 'Star on GitHub', + to: 'https://github.com/nuxt/ui', + target: '_blank', + }, + { + icon: 'i-heroicons-book-open', + label: 'Nuxt UI Pro docs', + to: 'https://ui.nuxt.com/pro/guide', + target: '_blank', + }, + { + icon: 'i-simple-icons-nuxtdotjs', + label: 'Purchase a license', + to: 'https://ui.nuxt.com/pro/purchase', + target: '_blank', + }, + ], + }, + }, +}); +``` + +icon: i-heroicons-light-bulb target: \_blank to: [app-config](https://nuxt.studio/docs/developers/app-config) + +--- + +A dedicated interface is provided to edit those configurations on Nuxt Studio. :: diff --git a/content/10.getting-started/_dir.yml b/content/10.getting-started/_dir.yml new file mode 100644 index 00000000..c8496134 --- /dev/null +++ b/content/10.getting-started/_dir.yml @@ -0,0 +1,2 @@ +title: Getting Started +layout: docs diff --git a/content/index.yml b/content/index.yml new file mode 100644 index 00000000..a938eb27 --- /dev/null +++ b/content/index.yml @@ -0,0 +1,70 @@ +title: 'Nuxt UI Pro - Docs template' +description: + Nuxt UI Pro is a collection of premium Vue components built on top of Nuxt UI to create beautiful & responsive Nuxt + applications in minutes. +navigation: false +hero: + title: 'Build your docs in seconds' + description: 'Create your documentation in seconds with this template!' + orientation: horizontal + headline: + label: Made with Nuxt UI Pro + to: https://ui.nuxt.com/pro + icon: i-heroicons-arrow-top-right-on-square-20-solid + links: + - label: Get started + icon: i-heroicons-arrow-right-20-solid + trailing: true + to: '/getting-started' + size: lg + - label: Use this template + icon: i-simple-icons-github + size: lg + color: gray + to: https://github.com/nuxt-ui-pro/docs + target: _blank + code: | + ```bash [Terminal] + npx nuxi init -t github:nuxt-ui-pro/docs + ``` +features: + title: 'All-in-one docs template' + links: + - label: 'Explore Nuxt UI Pro' + icon: 'i-simple-icons-nuxtdotjs' + trailingIcon: 'i-heroicons-arrow-right-20-solid' + color: 'gray' + to: 'https://ui.nuxt.com/pro' + target: '_blank' + size: lg + items: + - title: 'Nuxt 3' + description: 'Powered by Nuxt 3 for optimal performances and SEO.' + icon: 'i-simple-icons-nuxtdotjs' + to: 'https://nuxt.com' + target: '_blank' + - title: 'Markdown' + description: 'Write your pages with MDC thanks to Nuxt Content.' + icon: 'i-simple-icons-markdown' + to: 'https://content.nuxt.com' + target: '_blank' + - title: 'Nuxt UI' + description: 'Offers a very large set of full customizable components.' + icon: 'i-heroicons-sparkles-20-solid' + to: 'https://ui.nuxt.com' + target: '_blank' + - title: 'TypeScript' + description: 'A fully typed development experience.' + icon: 'i-simple-icons-typescript' + to: 'https://www.typescriptlang.org' + target: '_blank' + - title: 'Nuxt Studio' + description: 'Supported by Nuxt Studio for fast updates and previews.' + icon: 'i-simple-icons-nuxtdotjs' + to: 'https://nuxt.studio' + target: '_blank' + - title: 'Search' + description: 'A full-text search modal empowered by Fuse.js.' + icon: 'i-heroicons-magnifying-glass-20-solid' + to: 'https://ui.nuxt.com/pro/components/docs/docs-search' + target: '_blank' diff --git a/cspell-config/cspell-blockchain.txt b/cspell-config/cspell-blockchain.txt new file mode 100644 index 00000000..c855ab20 --- /dev/null +++ b/cspell-config/cspell-blockchain.txt @@ -0,0 +1,3 @@ +evm +merkle +keccak diff --git a/cspell-config/cspell-dev.txt b/cspell-config/cspell-dev.txt new file mode 100644 index 00000000..079032b5 --- /dev/null +++ b/cspell-config/cspell-dev.txt @@ -0,0 +1,8 @@ +nuxt +nuxtjs +rocksdb +nuxi +otlp +nvme +nuxtdotjs +fontaine diff --git a/checks-config/cspell-zksync.txt b/cspell-config/cspell-zksync.txt similarity index 71% rename from checks-config/cspell-zksync.txt rename to cspell-config/cspell-zksync.txt index 74b0e0fc..a4b6547b 100644 --- a/checks-config/cspell-zksync.txt +++ b/cspell-config/cspell-zksync.txt @@ -1,3 +1,4 @@ // zkSync-related words matterlabs -zksync \ No newline at end of file +zksync +boojum diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..f0f56c77 --- /dev/null +++ b/cspell.json @@ -0,0 +1,50 @@ +{ + "language": "en", + "ignorePaths": ["node_modules/**", ".github/**", ".firebase/**", ".yarn/**", "dist/**", ".vscode/**"], + "dictionaries": [ + "bash", + "cpp", + "cryptocurrencies", + "docker", + "css", + "en_GB", + "en_US", + "filetypes", + "fullstack", + "git", + "golang", + "html", + "java", + "misc", + "node", + "npm", + "npm", + "nuxt", + "python", + "rust", + "softwareTerms", + "swift", + "typescript", + "dict-zksync", + "dict-blockchain", + "dict-dev" + ], + "dictionaryDefinitions": [ + { + "name": "dict-zksync", + "addWords": true, + "path": "./cspell-config/cspell-zksync.txt" + }, + { + "name": "dict-blockchain", + "addWords": true, + "path": "./cspell-config/cspell-blockchain.txt" + }, + { + "name": "dict-dev", + "addWords": true, + "path": "./cspell-config/cspell-dev.txt" + } + ], + "allowCompoundWords": true +} diff --git a/error.vue b/error.vue new file mode 100644 index 00000000..a6c0ca61 --- /dev/null +++ b/error.vue @@ -0,0 +1,55 @@ + + + diff --git a/index.ts b/index.ts deleted file mode 100644 index f67b2c64..00000000 --- a/index.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello via Bun!"); \ No newline at end of file diff --git a/layouts/docs.vue b/layouts/docs.vue new file mode 100644 index 00000000..dee5cd38 --- /dev/null +++ b/layouts/docs.vue @@ -0,0 +1,22 @@ + + + diff --git a/layouts/test.vue b/layouts/test.vue new file mode 100644 index 00000000..37ede177 --- /dev/null +++ b/layouts/test.vue @@ -0,0 +1,19 @@ + + + diff --git a/nuxt.config.ts b/nuxt.config.ts new file mode 100644 index 00000000..02be878c --- /dev/null +++ b/nuxt.config.ts @@ -0,0 +1,50 @@ +// https://nuxt.com/docs/api/configuration/nuxt-config +export default defineNuxtConfig({ + extends: ['@nuxt/ui-pro'], + modules: ['@nuxt/content', '@nuxt/ui', '@nuxt/fonts', '@nuxthq/studio', 'nuxt-og-image'], + hooks: { + // Define `@nuxt/ui` components as global to use them in `.md` (feel free to add those you need) + 'components:extend': (components) => { + const globals = components.filter((c) => ['UButton', 'UIcon', 'Test'].includes(c.pascalName)); + + globals.forEach((c) => (c.global = true)); + }, + }, + ui: { + icons: ['heroicons', 'simple-icons'], + }, + routeRules: { + '/api/search.json': { prerender: true }, + }, + devtools: { + enabled: true, + }, + typescript: { + strict: false, + }, + content: { + highlight: { + langs: [ + 'solidity', + 'go', + 'jsx', + 'swift', + 'python', + 'rust', + 'toml', + 'java', + 'xml', + 'graphql', + 'groovy', + 'asm', + 'c++', + ], + theme: { + default: 'github-light', + light: 'github-light', + dark: 'github-dark', + sepia: 'monokai', + }, + }, + }, +}); diff --git a/nuxt.schema.ts b/nuxt.schema.ts new file mode 100644 index 00000000..b173c97c --- /dev/null +++ b/nuxt.schema.ts @@ -0,0 +1,241 @@ +import { field, group } from '@nuxthq/studio/theme'; + +export default defineNuxtSchema({ + appConfig: { + ui: group({ + title: 'UI', + description: 'UI Customization.', + icon: 'i-mdi-palette-outline', + fields: { + icons: group({ + title: 'Icons', + description: 'Manage icons used in UI Pro.', + icon: 'i-mdi-application-settings-outline', + fields: { + search: field({ + type: 'icon', + title: 'Search Bar', + description: 'Icon to display in the search bar.', + icon: 'i-mdi-magnify', + default: 'i-heroicons-magnifying-glass-20-solid', + }), + dark: field({ + type: 'icon', + title: 'Dark mode', + description: 'Icon of color mode button for dark mode.', + icon: 'i-mdi-moon-waning-crescent', + default: 'i-heroicons-moon-20-solid', + }), + light: field({ + type: 'icon', + title: 'Light mode', + description: 'Icon of color mode button for light mode.', + icon: 'i-mdi-white-balance-sunny', + default: 'i-heroicons-sun-20-solid', + }), + external: field({ + type: 'icon', + title: 'External Link', + description: 'Icon for external link.', + icon: 'i-mdi-arrow-top-right', + default: 'i-heroicons-arrow-up-right-20-solid', + }), + chevron: field({ + type: 'icon', + title: 'Chevron', + description: 'Icon for chevron.', + icon: 'i-mdi-chevron-down', + default: 'i-heroicons-chevron-down-20-solid', + }), + hash: field({ + type: 'icon', + title: 'Hash', + description: 'Icon for hash anchors.', + icon: 'i-ph-hash', + default: 'i-heroicons-hashtag-20-solid', + }), + }, + }), + primary: field({ + type: 'string', + title: 'Primary', + description: 'Primary color of your UI.', + icon: 'i-mdi-palette-outline', + default: 'green', + required: [ + 'sky', + 'mint', + 'rose', + 'amber', + 'violet', + 'emerald', + 'fuchsia', + 'indigo', + 'lime', + 'orange', + 'pink', + 'purple', + 'red', + 'teal', + 'yellow', + 'green', + 'blue', + 'cyan', + 'gray', + 'white', + 'black', + ], + }), + gray: field({ + type: 'string', + title: 'Gray', + description: 'Gray color of your UI.', + icon: 'i-mdi-palette-outline', + default: 'slate', + required: ['slate', 'cool', 'zinc', 'neutral', 'stone'], + }), + }, + }), + seo: group({ + title: 'SEO', + description: 'SEO configuration.', + icon: 'i-ph-app-window', + fields: { + siteName: field({ + type: 'string', + title: 'Site Name', + description: + 'Name used in ogSiteName and used as second part of your page title (My page title - Nuxt UI Pro).', + icon: 'i-mdi-web', + default: [], + }), + }, + }), + header: group({ + title: 'Header', + description: 'Header configuration.', + icon: 'i-mdi-page-layout-header', + fields: { + logo: group({ + title: 'Logo', + description: 'Header logo configuration.', + icon: 'i-mdi-image-filter-center-focus-strong-outline', + fields: { + light: field({ + type: 'media', + title: 'Light Mode Logo', + description: 'Pick an image from your gallery.', + icon: 'i-mdi-white-balance-sunny', + default: '', + }), + dark: field({ + type: 'media', + title: 'Dark Mode Logo', + description: 'Pick an image from your gallery.', + icon: 'i-mdi-moon-waning-crescent', + default: '', + }), + alt: field({ + type: 'string', + title: 'Alt', + description: 'Alt to display for accessibility.', + icon: 'i-mdi-alphabet-latin', + default: '', + }), + }, + }), + search: field({ + type: 'boolean', + title: 'Search Bar', + description: 'Hide or display the search bar.', + icon: 'i-mdi-magnify', + default: true, + }), + colorMode: field({ + type: 'boolean', + title: 'Color Mode', + description: 'Hide or display the color mode button in your header.', + icon: 'i-mdi-moon-waning-crescent', + default: true, + }), + links: field({ + type: 'array', + title: 'Links', + description: 'Array of link object displayed in header.', + icon: 'i-mdi-link-variant', + default: [], + }), + }, + }), + footer: group({ + title: 'Footer', + description: 'Footer configuration.', + icon: 'i-mdi-page-layout-footer', + fields: { + credits: field({ + type: 'string', + title: 'Footer credits section', + description: 'Text to display as credits in the footer.', + icon: 'i-mdi-circle-edit-outline', + default: '', + }), + colorMode: field({ + type: 'boolean', + title: 'Color Mode', + description: 'Hide or display the color mode button in the footer.', + icon: 'i-mdi-moon-waning-crescent', + default: false, + }), + links: field({ + type: 'array', + title: 'Links', + description: 'Array of link object displayed in footer.', + icon: 'i-mdi-link-variant', + default: [], + }), + }, + }), + toc: group({ + title: 'Table of contents', + description: 'TOC configuration.', + icon: 'i-mdi-table-of-contents', + fields: { + title: field({ + type: 'string', + title: 'Title', + description: 'Text to display as title of the main toc.', + icon: 'i-mdi-format-title', + default: '', + }), + bottom: group({ + title: 'Bottom', + description: 'Bottom TOC configuration.', + icon: 'i-mdi-table-of-contents', + fields: { + title: field({ + type: 'string', + title: 'Title', + description: 'Text to display as title of the bottom toc.', + icon: 'i-mdi-format-title', + default: '', + }), + edit: field({ + type: 'string', + title: 'Edit Page Link', + description: 'URL of your repository content folder.', + icon: 'i-ph-note-pencil', + default: '', + }), + links: field({ + type: 'array', + title: 'Links', + description: 'Array of link object displayed in bottom toc.', + icon: 'i-mdi-link-variant', + default: [], + }), + }, + }), + }, + }), + }, +}); diff --git a/package.json b/package.json index 0f0b3183..0700d336 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,54 @@ { "name": "zksync-docs", - "module": "index.ts", + "type": "module", "description": "zkSync Docs V3", + "version": "0.0.0", "license": "MIT", "author": "Matter Labs", "homepage": "https://zksync.io", "devDependencies": { - "bun-types": "latest", + "@nuxt/eslint-config": "^0.2.0", + "@nuxthq/studio": "^1.0.13", + "@types/bun": "^1.0.8", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@vue/eslint-config-prettier": "^9.0.0", + "@vue/eslint-config-typescript": "^13.0.0", + "@vue/test-utils": "^2.4.5", "cspell": "^8.6.0", + "eslint": "^8.52.0", + "eslint-plugin-vue": "^9.23.0", + "husky": "^9.0.11", "markdownlint": "^0.33.0", "markdownlint-cli2": "^0.12.1", - "prettier": "^3.2.5" + "prettier": "^3.1.0", + "prettier-eslint": "^16.1.2", + "prettier-plugin-tailwindcss": "^0.5.12", + "vue-eslint-parser": "^8.0.0", + "vue-tsc": "^2.0.6" }, "peerDependencies": { "typescript": "^5.0.0" }, - "scripts": { - "start": "bun run index.ts", - "lint:fmt": "prettier --check **/*.md", - "lint:fix": "prettier --write **/*.md", - "lint:spell": "cspell **/*.md --config=./checks-config/cspell.json", - "lint:mdl": "markdownlint-cli2 -c .markdownlint.json \"**/*.md\" \"#node_modules\" \"#.github\"" + "dependencies": { + "@iconify-json/heroicons": "^1.1.20", + "@iconify-json/simple-icons": "^1.1.95", + "@nuxt/content": "^2.12.1", + "@nuxt/fonts": "^0.3.0", + "@nuxt/ui-pro": "^1.0.2", + "nuxt": "^3.10.3", + "nuxt-og-image": "^3.0.0-rc.45" }, - "type": "module" -} \ No newline at end of file + "scripts": { + "build": "nuxt build", + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview", + "lint:spelling": "cspell content/**/*.md --config=./cspell.json", + "lint:markdown": "markdownlint-cli2 \"content/**/*.md\" --config \".markdownlint.json\"", + "lint:eslint": "eslint .", + "lint:prettier": "prettier --check .", + "prepare": "husky", + "postinstall": "nuxt prepare" + } +} diff --git a/pages/[...slug].vue b/pages/[...slug].vue new file mode 100644 index 00000000..d9eac692 --- /dev/null +++ b/pages/[...slug].vue @@ -0,0 +1,102 @@ + + + diff --git a/pages/about-us.vue b/pages/about-us.vue new file mode 100644 index 00000000..8b7ce673 --- /dev/null +++ b/pages/about-us.vue @@ -0,0 +1,3 @@ + + + diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 00000000..72e7747d --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,72 @@ + + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..18993ad9 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/social-card.png b/public/social-card.png new file mode 100644 index 00000000..8cd50a17 Binary files /dev/null and b/public/social-card.png differ diff --git a/server/api/search.json.get.ts b/server/api/search.json.get.ts new file mode 100644 index 00000000..e075d921 --- /dev/null +++ b/server/api/search.json.get.ts @@ -0,0 +1,7 @@ +import { serverQueryContent } from '#content/server'; + +export default eventHandler(async (event) => { + return serverQueryContent(event) + .where({ _type: 'markdown', navigation: { $ne: false } }) + .find(); +}); diff --git a/server/tsconfig.json b/server/tsconfig.json new file mode 100644 index 00000000..b9ed69c1 --- /dev/null +++ b/server/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../.nuxt/tsconfig.server.json" +} diff --git a/tailwind.config.ts b/tailwind.config.ts new file mode 100644 index 00000000..7fd60df3 --- /dev/null +++ b/tailwind.config.ts @@ -0,0 +1,27 @@ +import type { Config } from 'tailwindcss'; +import defaultTheme from 'tailwindcss/defaultTheme'; + +export default >{ + theme: { + extend: { + fontFamily: { + sans: ['DM Sans', ...defaultTheme.fontFamily.sans], + }, + colors: { + green: { + 50: '#EFFDF5', + 100: '#D9FBE8', + 200: '#B3F5D1', + 300: '#75EDAE', + 400: '#00DC82', + 500: '#00C16A', + 600: '#00A155', + 700: '#007F45', + 800: '#016538', + 900: '#0A5331', + 950: '#052e16', + }, + }, + }, + }, +}; diff --git a/tsconfig.json b/tsconfig.json index 7556e1d4..0abb1cfd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,22 +1,11 @@ { + "extends": "./.nuxt/tsconfig.json", "compilerOptions": { - "lib": ["ESNext"], - "module": "esnext", - "target": "esnext", - "moduleResolution": "bundler", - "moduleDetection": "force", - "allowImportingTsExtensions": true, - "noEmit": true, "composite": true, "strict": true, "downlevelIteration": true, - "skipLibCheck": true, - "jsx": "react-jsx", - "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "allowJs": true, - "types": [ - "bun-types" // add Bun global - ] + "typeRoots": ["./node_modules/@types", "./types"] } }