diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 6e87a003..00000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# Editor configuration, see http://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -max_line_length = off -trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 3c3629e6..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..5b999efa --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,10 @@ +module.exports = { + root: true, + // This tells ESLint to load the config from the package `eslint-config-custom` + extends: ["custom"], + settings: { + next: { + rootDir: ["apps/*/"], + }, + }, +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9ca2e830..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "root": true, - "ignorePatterns": ["**/*"], - "plugins": ["@nx"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "@nx/enforce-module-boundaries": [ - "error", - { - "enforceBuildableLibDependency": true, - "allow": [], - "depConstraints": [ - { - "sourceTag": "*", - "onlyDependOnLibsWithTags": ["*"] - } - ] - } - ] - } - }, - { - "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@nx/typescript"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "extends": ["plugin:@nx/javascript"], - "rules": {} - } - ] -} diff --git a/.github/workflows/git-sync-zhi-widget-blog.yml b/.github/workflows/git-sync-zhi-widget-blog.yml deleted file mode 100644 index a985ffbb..00000000 --- a/.github/workflows/git-sync-zhi-widget-blog.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: sync zhi-widget-blog - -on: - push: - branches: - - main - -jobs: - git-sync: - runs-on: ubuntu-latest - steps: - - name: git-sync - uses: wei/git-sync@v3 - with: - source_repo: "terwer/zhi" - source_branch: "main" - destination_repo: "terwer/zhi-blog" - destination_branch: "dist" - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # optional - source_ssh_private_key: ${{ secrets.SOURCE_SSH_PRIVATE_KEY }} # optional, will override `SSH_PRIVATE_KEY` - destination_ssh_private_key: ${{ secrets.DESTINATION_SSH_PRIVATE_KEY }} # optional, will override `SSH_PRIVATE_KEY` diff --git a/.gitignore b/.gitignore index 51b9af52..7b561172 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,39 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -dist -tmp -/out-tsc +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies node_modules +.pnp +.pnp.js + +# testing +coverage -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +# next.js +.next/ +out/ +build # misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -yarn-error.log -testem.log -/typings - -# System Files .DS_Store -Thumbs.db +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo + +# vercel +.vercel + +# IDE +.idea diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..ded82e2f --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +auto-install-peers = true diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 9481e77e..00000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -# Add files here to ignore them from prettier formatting -/dist -/coverage \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index f8ba1865..00000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": false, - "printWidth": 120 -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 1b301e19..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] -} diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index db7a2f1f..00000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,53 +0,0 @@ -# Zhi - - - -✨ **This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)** ✨ - -## Understand this workspace - -Run `nx graph` to see a diagram of the dependencies of the projects. - -## Remote caching - -Run `npx nx connect-to-nx-cloud` to enable [remote caching](https://nx.app) and make CI faster. - -## Further help - -Visit the [Nx Documentation](https://nx.dev) to learn more. - -## Components - -### commitlint - -1 - -https://www.npmjs.com/package/@commitlint/cz-commitlint - -```bash -npm install --save-dev @commitlint/config-angular @commitlint/cz-commitlint commitizen inquirer@8 -## commitlint.config.js -``` - -2 package.json - -or - -``` -{ - "scripts": { - "commit": "git-cz" - }, - "config": { - "commitizen": { - "path": "@commitlint/cz-commitlint" - } - } -} -``` - -3 -```bash -git add -A -npm run commit -``` diff --git a/README.md b/README.md index b8cdc93d..bc389a06 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,81 @@ -# Zhi +# Turborepo starter -🛍️ A series of widgets, plugins and themes based on siyuan-note +This is an official starter Turborepo. -[中文版](README_zh_CN.md) +## Using this example -[![dev checks](https://img.shields.io/github/checks-status/terwer/zhi/dev?label=build)](https://github.com/terwer/zhi/tree/dev) -![version](https://img.shields.io/github/release/terwer/zhi.svg?style=flat-square) -![license](https://img.shields.io/badge/license-GPL-blue.svg?style=popout-square) +Run the following command: -> ⚠️ WARNING: Due to `theme.js` will be removed, this theme cannot be published yet.I will publish style-based theme, plugins, widgets later. +```sh +npx create-turbo@latest +``` -## Zhi family +## What's inside? -- zhi-framework - Core framework (originally unpublished zhi theme, relying on theme.js) not on the shelf, can explore -- zhi-theme - Style-based theme in progress -- zhi-widget-publisher (sy-post-publisher) - Siyuan note publishing tool has been put on the shelf official pendant market -- zhi-plugin-bridge-publisher - Siyuan note release tool plugin bridge version has been put on the third-party plug-in market -- zhi-plugin-publisher - Siyuan Note publishing tool plug-in edition in progress -- zhi-widget-blog - Blog widget version based on Siyuan Note API in progress -- zhi-plugin-blog - Blog plug-in version based on Siyuan Note API in progress +This Turborepo includes the following packages/apps: -## Acknowledgments +### Apps and Packages -Thanks to [zuoez02](https://github.com/zuoez02/siyuan-plugin-system) for providing the plugin system. +- `docs`: a [Next.js](https://nextjs.org/) app +- `web`: another [Next.js](https://nextjs.org/) app +- `ui`: a stub React component library shared by both `web` and `docs` applications +- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) +- `tsconfig`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This Turborepo has some additional tools already setup for you: + +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [ESLint](https://eslint.org/) for code linting +- [Prettier](https://prettier.io) for code formatting + +### Build + +To build all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm build +``` + +### Develop + +To develop all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm dev +``` + +### Remote Caching + +Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. + +By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands: + +``` +cd my-turborepo +npx turbo login +``` + +This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). + +Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo: + +``` +npx turbo link +``` + +## Useful Links + +Learn more about the power of Turborepo: + +- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks) +- [Caching](https://turbo.build/repo/docs/core-concepts/caching) +- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) +- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering) +- [Configuration Options](https://turbo.build/repo/docs/reference/configuration) +- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference) diff --git a/README_BACKUP.md b/README_BACKUP.md deleted file mode 100644 index a778f467..00000000 --- a/README_BACKUP.md +++ /dev/null @@ -1,83 +0,0 @@ -# Zhi - -🛍️ A series of widgets, plugins and themes based on siyuan-note - -[![](https://img.shields.io/badge/api-docs-green)](https://zhi.terwer.space) -[![dev checks](https://img.shields.io/github/checks-status/terwer/zhi/dev?label=build)](https://github.com/terwer/zhi/tree/dev) -![version](https://img.shields.io/github/release/terwer/zhi.svg?style=flat-square) -![license](https://img.shields.io/badge/license-GPL-blue.svg?style=popout-square) - -[![](https://img.shields.io/badge/build-assets-green)](https://github.com/terwer/zhi) -[![](https://img.shields.io/badge/theme-source-red)](https://github.com/terwer/zhi/tree/dev/packages/zhi-mini) -[![](https://img.shields.io/badge/dynamic-blog-blue)](https://github.com/terwer/zhi/tree/dev/packages/zhi-blog) -[![](https://img.shields.io/badge/static-blog-purple)](https://github.com/terwer/zhi/tree/dev/packages/zhi-blog-astro) - -~~> ⚠️ WARNING 1: Attention: The `zhi` theme only supports the `2.7.6+` version of [siyuan-note](https://github.com/siyuan-note/siyuan) , and the plugin system only supports `2.8.1+`. Otherwise, you need to upgrade [siyuan-note](https://github.com/siyuan-note/siyuan) to a new version.~~ - -~~> ⚠️ WARNING 2: `1.0.0` is an available version in the early stage, and the function is not comprehensive yet. It is only used for testing and welcomes valuable opinions through issuing. Please refer to [core features](#core-features) for this version's characteristics.~~ - -~~> ⚠️ WARNING 3: The plugin system is set to `security mode` by default, and you need to click on the settings menu in the upper right corner to turn off the security mode before you can activate the plugin system.~~ - -~~> ⚠️ WARNING 4: Except for the theme's core plugins, all plugins are disabled by default and need to be enabled in the plugin list before the first use.~~ - -> ⚠️ WARNING 4: Due to `theme.js` will be removed, this theme cannot be published yet.I will publish style-based theme, plugins, widgets later. - -## Zhi family - -- zhi-framework -- zhi-theme -- zhi-widget-publisher (sy-post-publisher) -- zhi-plugin-publisher -- zhi-widget-blog -- zhi-plugin-blog - -## Key benefits - -- Integrated blog feature based on the Siyuan API - -- No publishing, no configuration, ready to use out of the box - -- Plugin system bundled, by design - -## Quick start - -You can download the `zhi` theme directly in the Market of siyuan-note, and then select the `zhi` theme -in `Settings` - `Appearance` - `Theme` to change the appearance of the notebook. - -Note: `zhi` theme only supports siyuan-note `2.7.6+`, or you must upgrade siyuan-note first. - -## Design Philosophy - -- The theme core should be kept lightweight and compact as much as possible. -- Plugins should be used as much as possible to implement functions. -- Plugin functions should be single-purpose to avoid brainless accumulation of functions. -- Components should be kept as reusable as possible. - -## Core Features - -The theme is inspired by `Zhihu` but not limited to its style. The appearance optimization includes but is not limited -to: - -- Font style beautification, using `Open Sans` for English and `LXGW WenKai` for Chinese -- Background color optimization, overall layout and spacing optimization -- Code block beautification, similar to the Mac window style -- It natively supports the plugin system and comes with many built-in plugins. The plugin system is supported by - community developers. - - Siyuan-note publishing tool plugin - - Document image background automatic transparency plugin - - Blog plugin -- It can handle both the theme and the preview. Installing the zhi theme is equivalent to installing an additional - plugin system and an online blog. - - SPA blog homepage( `enabled and bundled by default` ): http://127.0.0.1:6806/appearance/themes/zhi/web/blog/ simple - - SSR blog homepage( `⚠️ need to be enabled manually` ): http://127.0.0.1:6806/appearance/themes/zhi/server/blog/ seo friendly - -> Note: 🌹 The plugin system is provided by enthusiastic community developers. Please understand the relevant mechanisms in -> detail before using. - -## Technical Roadmap - -[development](DEVELOPMENT.md) - -## Acknowledgments - -Thanks to [zuoez02](https://github.com/zuoez02/siyuan-plugin-system) for providing the plugin system. diff --git a/README_zh_CN.md b/README_zh_CN.md deleted file mode 100644 index 58594584..00000000 --- a/README_zh_CN.md +++ /dev/null @@ -1,21 +0,0 @@ -# Zhi - -🛍️ 基于思源笔记的一系列框架、插件、挂件、主题等 - -[English](README.md) - -[![dev checks](https://img.shields.io/github/checks-status/terwer/zhi/dev?label=build)](https://github.com/terwer/zhi/tree/dev) -![version](https://img.shields.io/github/release/terwer/zhi.svg?style=flat-square) -![license](https://img.shields.io/badge/license-GPL-blue.svg?style=popout-square) - -> ⚠️警告:由于 `theme.js` 将被删除,这个主题不能发布。稍后我会发布基于样式的主题、插件和小部件等。 - -## Zhi 项目家族 - -- zhi-framework - 核心框架( 原未发布的 zhi 主题,依赖 theme.js ) 未上架,可自行探索 -- zhi-theme - 基于样式的主题 进行中 -- zhi-widget-publisher (sy-post-publisher) - 思源笔记发布工具 已上架官方挂件集市 -- zhi-plugin-bridge-publisher - 思源笔记发布工具插件桥接版 已上架第三方插件市场 -- zhi-plugin-publisher - 思源笔记发布工具插件版 进行中 -- zhi-widget-blog - 基于思源笔记API的博客挂件版 进行中 -- zhi-plugin-blog - 基于思源笔记API的博客插件版 进行中 diff --git a/apps/.gitkeep b/apps/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/docs/.eslintrc.js b/apps/docs/.eslintrc.js new file mode 100644 index 00000000..c8df6075 --- /dev/null +++ b/apps/docs/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore new file mode 100644 index 00000000..1437c53f --- /dev/null +++ b/apps/docs/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/apps/docs/README.md b/apps/docs/README.md new file mode 100644 index 00000000..4fae62af --- /dev/null +++ b/apps/docs/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx new file mode 100644 index 00000000..225b6038 --- /dev/null +++ b/apps/docs/app/layout.tsx @@ -0,0 +1,11 @@ +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + {children} + + ); +} diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx new file mode 100644 index 00000000..77198484 --- /dev/null +++ b/apps/docs/app/page.tsx @@ -0,0 +1,10 @@ +import { Button, Header } from "ui"; + +export default function Page() { + return ( + <> +
+