From 4118db933736fb3da71f31557a25451f7a77ce2a Mon Sep 17 00:00:00 2001 From: Sabrina Ferguson Date: Wed, 8 May 2024 15:52:46 -0400 Subject: [PATCH 1/4] feat: use docs nuxt layer --- .eslintignore | 8 - .eslintrc.json | 22 -- .vscode/settings.json | 3 +- README.md | 135 +++--------- app.config.ts | 85 +------- app.vue | 18 +- assets/zksync-icons.ts | 35 --- bun.lockb | Bin 613200 -> 641960 bytes components/AppFooter.vue | 23 -- components/AppHeader.vue | 54 ----- components/content/CheckIcon.vue | 17 -- components/content/ContentSwitcher.vue | 41 ---- components/content/DisplayPartial.vue | 16 -- components/content/DropPanel/DropPanel.vue | 58 ----- components/content/DropPanel/Panel.vue | 18 -- components/content/ImgPreview.vue | 86 -------- components/content/ProseA.vue | 36 --- components/content/ProseCodeInline.vue | 18 -- components/content/ProseImg.vue | 48 ---- content/_zksync.json | 53 ----- error.vue | 4 +- eslint.config.mjs | 18 ++ nuxt.config.ts | 80 +------ nuxt.schema.ts | 241 --------------------- package.json | 23 +- public/favicon copy.ico | Bin 9662 -> 0 bytes public/favicon-16x16.png | Bin 298 -> 0 bytes public/favicon-32x32.png | Bin 469 -> 0 bytes public/favicon.ico | Bin 4286 -> 0 bytes public/logos/matterlabs-logo.svg | 1 - public/logos/zksync_logo.svg | 56 ----- public/logos/zksync_logo_black.svg | 56 ----- public/main.css | 5 - server/plugins/parse-zk-tags.ts | 29 --- tailwind.config.ts | 68 ------ 35 files changed, 78 insertions(+), 1277 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json delete mode 100644 assets/zksync-icons.ts delete mode 100644 components/AppFooter.vue delete mode 100644 components/AppHeader.vue delete mode 100644 components/content/CheckIcon.vue delete mode 100644 components/content/ContentSwitcher.vue delete mode 100644 components/content/DisplayPartial.vue delete mode 100644 components/content/DropPanel/DropPanel.vue delete mode 100644 components/content/DropPanel/Panel.vue delete mode 100644 components/content/ImgPreview.vue delete mode 100644 components/content/ProseA.vue delete mode 100644 components/content/ProseCodeInline.vue delete mode 100644 components/content/ProseImg.vue delete mode 100644 content/_zksync.json create mode 100644 eslint.config.mjs delete mode 100644 nuxt.schema.ts delete mode 100644 public/favicon copy.ico delete mode 100644 public/favicon-16x16.png delete mode 100644 public/favicon-32x32.png delete mode 100644 public/favicon.ico delete mode 100644 public/logos/matterlabs-logo.svg delete mode 100644 public/logos/zksync_logo.svg delete mode 100644 public/logos/zksync_logo_black.svg delete mode 100644 public/main.css delete mode 100644 server/plugins/parse-zk-tags.ts delete mode 100644 tailwind.config.ts diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 22be491..0000000 --- a/.eslintignore +++ /dev/null @@ -1,8 +0,0 @@ -.output -.nuxt -*.d.ts -**/node_modules/** -**/build/** -**/dist/** -**/coverage/** -**/.*/** diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e9fca7d..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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"], - "vue/html-self-closing": [ - "error", - { - "html": { - "void": "always" - } - } - ], - "vue/singleline-html-element-content-newline": "off", - "vue/html-self-closing": "off" - } -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 7cbd388..32a3f97 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,5 +18,6 @@ "strings": "off" }, "editor.tabCompletion": "onlySnippets" - } + }, + "eslint.experimental.useFlatConfig": true } diff --git a/README.md b/README.md index ebf9039..aaf6ac5 100644 --- a/README.md +++ b/README.md @@ -1,125 +1,62 @@ -![nuxt-ui-docs-social-card](https://github.com/nuxt-ui-pro/docs/assets/739984/f64e13d9-9ae0-4e03-bf7f-6be4c36cd9ba) +# Community Code -# Nuxt UI Pro - Docs template +Welcome to the ZKsync Community Code repository. This project serves as the community hub for ZKsync, providing comprehensive +documentation for developers written by 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. -[![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) +## Tools used -- [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) +- [Vue](https://vuejs.org/) +- [Nuxt](https://nuxt.com/) +- [Nuxt Content](https://content.nuxt.com/) +- [Nuxt UI & Nuxt UI Pro](https://ui.nuxt.com/) +- [Tailwind](https://tailwindcss.com/) +- [Bun](https://bun.sh/) -## Quick Start +## Local Setup -```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 +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: -# bun +```shell 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 +## Development -# pnpm -pnpm run build +To run the project locally at `http://localhost:3000` -# yarn -yarn build - -# bun -bun run build +```shell +bun run dev -o ``` -Locally preview production build: - -```bash -# npm -npm run preview - -# pnpm -pnpm run preview +## Local Preview -# yarn -yarn preview +To locally preview the production build, first run `bun run generate` to build the project, then run the following: -# bun +```shell bun run preview ``` -Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. +## Lint & Formatting -## Nuxt Studio integration +This project provides lint commands to check the project. -Add `@nuxthq/studio` dependency to your package.json: +### Markdown Linting -```bash -# npm -npm install --save-dev @nuxthq/studio +Markdown files are found in the `/content` directory. The following lint commands will run within that directory: -# 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' - ] -}) +```shell +bun run lint:spelling +bun run lint:markdown ``` -Read more on [Nuxt Studio docs](https://nuxt.studio/docs/projects/setup). +### Linting -## Renovate integration +The following commands are available to run linting on the project: -Install [Renovate GitHub app](https://github.com/apps/renovate/installations/select_target) on your repository and you are good to go. +```shell +bun run lint:prettier +bun run lint:eslint +``` diff --git a/app.config.ts b/app.config.ts index bec4bd3..79fdd7a 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,95 +1,22 @@ export default defineAppConfig({ - ui: { - variables: { - light: { - background: '255 252 255', - // foreground: '147 68 68', - }, - dark: { - background: '17 20 43', - // foreground: 'var(--color-gray-200)', - }, - // header: { - // height: '1rem', - // }, - }, - primary: 'zkPurple', - gray: 'zkSlate', - 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', - vyper: 'devicon:vyper', - sol: 'vscode-icons:file-type-solidity', - }, - }, - }, - }, - }, seo: { - siteName: 'zkSync Community Cookbook', + siteName: 'ZKsync Community Code', }, header: { - logo: { - alt: '', - light: '/logos/zksync_logo_black.svg', - dark: '/logos/zksync_logo.svg', - }, - search: false, - colorMode: true, links: [ { icon: 'i-simple-icons-github', - to: 'https://github.com/matter-labs/zksync-docs', - target: '_blank', - 'aria-label': 'zkSync Docs on GitHub', - title: 'zkSync Docs on GitHub', - }, - ], - }, - footer: { - credits: 'Made with ❤️ by Matter Labs & Community', - colorMode: false, - links: [ - { - icon: 'i-zksync-matterlabs-logo', - to: 'https://matter-labs.io', - target: '_blank', - 'aria-label': 'MatterLabs Website', - }, - { - icon: 'i-simple-icons-x', - to: 'https://x.com/zksync', - target: '_blank', - 'aria-label': 'zkSync on X', - }, - { - icon: 'i-simple-icons-github', - to: 'https://github.com/matter-labs', - target: '_blank', - 'aria-label': 'zkSync on GitHub', - }, - { - icon: 'i-simple-icons-discord', - to: 'https://join.zksync.dev/', + to: 'https://github.com/zkSync-Community-Hub/community-code', target: '_blank', - 'aria-label': 'zkSync on Discord', + 'aria-label': 'Community Code on GitHub', + title: 'Community Code on GitHub', }, ], }, toc: { - title: 'Table of Contents', bottom: { - title: '', - edit: 'https://github.com/matter-labs/zksync-docs/edit/staging/content', - feedback: 'https://github.com/matter-labs/zksync-docs/issues/new?labels=documentation', + edit: 'https://github.com/zkSync-Community-Hub/community-code/edit/staging/content', + feedback: 'https://github.com/zkSync-Community-Hub/community-code/issues/new', links: [], }, }, diff --git a/app.vue b/app.vue index 32eb255..15fb0ca 100644 --- a/app.vue +++ b/app.vue @@ -1,13 +1,8 @@ - - diff --git a/components/AppHeader.vue b/components/AppHeader.vue deleted file mode 100644 index 8d83e6c..0000000 --- a/components/AppHeader.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/components/content/CheckIcon.vue b/components/content/CheckIcon.vue deleted file mode 100644 index 6c9f6ca..0000000 --- a/components/content/CheckIcon.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/components/content/ContentSwitcher.vue b/components/content/ContentSwitcher.vue deleted file mode 100644 index 19e1ab7..0000000 --- a/components/content/ContentSwitcher.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/components/content/DisplayPartial.vue b/components/content/DisplayPartial.vue deleted file mode 100644 index 7eead62..0000000 --- a/components/content/DisplayPartial.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/components/content/DropPanel/DropPanel.vue b/components/content/DropPanel/DropPanel.vue deleted file mode 100644 index cc78877..0000000 --- a/components/content/DropPanel/DropPanel.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - diff --git a/components/content/DropPanel/Panel.vue b/components/content/DropPanel/Panel.vue deleted file mode 100644 index 251e2f2..0000000 --- a/components/content/DropPanel/Panel.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/components/content/ImgPreview.vue b/components/content/ImgPreview.vue deleted file mode 100644 index 4a9b769..0000000 --- a/components/content/ImgPreview.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/components/content/ProseA.vue b/components/content/ProseA.vue deleted file mode 100644 index 007793f..0000000 --- a/components/content/ProseA.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/components/content/ProseCodeInline.vue b/components/content/ProseCodeInline.vue deleted file mode 100644 index 5e85672..0000000 --- a/components/content/ProseCodeInline.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/components/content/ProseImg.vue b/components/content/ProseImg.vue deleted file mode 100644 index dc8c079..0000000 --- a/components/content/ProseImg.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/content/_zksync.json b/content/_zksync.json deleted file mode 100644 index 968972f..0000000 --- a/content/_zksync.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "zkevm": { - "label": "zkSync VM" - }, - "mainnet": { - "name": "zkSync Era Mainnet", - "identifier": "mainnet", - "rpc_url": "https://mainnet.era.zksync.io", - "websocket_url": "wss://mainnet.era.zksync.io/ws", - "chain_id": 324, - "currency_symbol": "ETH", - "block_explorer_url": "https://explorer.zksync.io" - }, - "testnet": { - "name": "zkSync Era Testnet", - "identifier": "sepolia", - "rpc_url": "https://sepolia.era.zksync.dev", - "websocket_url": "wss://sepolia.era.zksync.dev/ws", - "chain_id": 280, - "currency_symbol": "ETH", - "block_explorer_url": "https://sepolia.explorer.zksync.io" - }, - "git_repo": { - "block-explorer": "https://github.com/matter-labs/block-explorer", - "era-boojum": "https://github.com/matter-labs/era-boojum", - "era-compiler-llvm": "https://github.com/matter-labs/era-compiler-llvm", - "era-compiler-llvm-context": "https://github.com/matter-labs/era-compiler-llvm-context", - "era-compiler-solidity": "https://github.com/matter-labs/era-compiler-solidity", - "era-compiler-vyper": "https://github.com/matter-labs/era-compiler-vyper", - "era-contracts": "https://github.com/matter-labs/era-contracts", - "era-hardhat-with-plugins": "https://github.com/matter-labs/era-hardhat-with-plugins", - "era-test-node": "https://github.com/matter-labs/era-test-node", - "era-solidity": "https://github.com/matter-labs/era-solidity", - "era-zkEVM-assembly": "https://github.com/matter-labs/era-zkEVM-assembly", - "era-zkevm_circuits": "https://github.com/matter-labs/era-zkevm_circuits", - "era-zkevm_test_harness": "https://github.com/matter-labs/era-zkevm_test_harness", - "eravm-spec": "https://matter-labs.github.io/eravm-spec", - "foundry-zksync": "https://github.com/matter-labs/foundry-zksync", - "franklin-crypto": "https://github.com/matter-labs/franklin-crypto", - "hardhat-zksync": "https://github.com/matter-labs/hardhat-zksync", - "local-setup": "https://github.com/matter-labs/local-setup", - "matter-labs-github-io": "https://matter-labs.github.io", - "zksolc-bin": "https://github.com/matter-labs/zksolc-bin", - "zksync-cli": "https://github.com/matter-labs/zksync-cli", - "zksync-contract-templates": "https://github.com/matter-labs/zksync-contract-templates", - "zksync-developers": "https://github.com/zkSync-Community-Hub/zksync-developers", - "zksync-docs": "https://github.com/matter-labs/zksync-docs", - "zksync-era": "https://github.com/matter-labs/zksync-era", - "zksync-frontend-templates": "https://github.com/matter-labs/zksync-frontend-templates", - "zksync-scripting-templates": "https://github.com/matter-labs/zksync-scripting-templates", - "zkvyper-bin": "https://github.com/matter-labs/zkvyper-bin" - } -} diff --git a/error.vue b/error.vue index a6c0ca6..da611b5 100644 --- a/error.vue +++ b/error.vue @@ -31,7 +31,7 @@ provide('navigation', navigation);