From a4c4878130f3675d7a04d54ce95bf53d8a035b48 Mon Sep 17 00:00:00 2001 From: "shunquan.wang" Date: Wed, 21 Aug 2024 16:21:47 +0800 Subject: [PATCH 1/4] feat: update --- ...de-workspace => docusaurus.code-workspace | 2 +- .changeset/config.json | 2 +- .github/workflows/release-or-version-pr.yml | 2 +- CHANGELOG.md | 14 +- LICENSE | 58 ++++--- README.md | 61 +++++-- package.json | 10 +- website/CHANGELOG.md | 12 -- website/copyright.config.ts | 58 +++++++ website/docusaurus.config.ts | 74 ++++++--- website/package.json | 4 +- .../src/components/HomepageFeatures/index.tsx | 151 ++++++++++++++---- website/src/pages/index.tsx | 86 ++++++++-- website/static/img/bars.svg | 1 + website/static/img/browser.svg | 1 + website/static/img/lightbulb.svg | 3 + website/static/img/muscle.svg | 1 + website/static/img/puzzle.svg | 1 + website/static/img/shield.svg | 4 + website/tailwind.config.cjs | 6 +- yarn.lock | 70 +++++--- 21 files changed, 467 insertions(+), 154 deletions(-) rename ghpage.code-workspace => docusaurus.code-workspace (98%) create mode 100644 website/copyright.config.ts create mode 100644 website/static/img/bars.svg create mode 100644 website/static/img/browser.svg create mode 100644 website/static/img/lightbulb.svg create mode 100644 website/static/img/muscle.svg create mode 100644 website/static/img/puzzle.svg create mode 100644 website/static/img/shield.svg diff --git a/ghpage.code-workspace b/ docusaurus.code-workspace similarity index 98% rename from ghpage.code-workspace rename to docusaurus.code-workspace index 6dfce9b..ae368a6 100644 --- a/ghpage.code-workspace +++ b/ docusaurus.code-workspace @@ -1,7 +1,7 @@ { "folders": [ { - "name": "gh-pages", + "name": "docusaurus", "path": "./", }, { diff --git a/.changeset/config.json b/.changeset/config.json index 98a04e7..bba76d5 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -3,7 +3,7 @@ "changelog": [ "@changesets/changelog-github", { - "repo": "hyperse-io/gh-pages-starter" + "repo": "hyperse-io/docusaurus-mono-starter" } ], "commit": false, diff --git a/.github/workflows/release-or-version-pr.yml b/.github/workflows/release-or-version-pr.yml index e999b6a..34ca192 100644 --- a/.github/workflows/release-or-version-pr.yml +++ b/.github/workflows/release-or-version-pr.yml @@ -8,7 +8,7 @@ on: jobs: release: # Basic security: the release job can only be executed from this repo and from the main branch (not a remote thing) - if: ${{ github.repository == 'hyperse-io/gh-pages-starter' && contains('refs/heads/main',github.ref)}} + if: ${{ github.repository == 'hyperse-io/docusaurus-mono-starter' && contains('refs/heads/main',github.ref)}} name: Release and changelog runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3bc92..ab06ec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1 @@ -# @hyperse/gh-pages-starter - -## 1.0.2 - -### Patch Changes - -- [`9a36660`](https://github.com/hyperse-io/gh-pages-starter/commit/9a366605ec5104e47472d97d8ab115a7bf8c785c) Thanks [@tianyingchun](https://github.com/tianyingchun)! - Add code-coverage on changeset - -## 1.0.1 - -### Patch Changes - -- [`d9afa31`](https://github.com/hyperse-io/gh-pages-starter/commit/d9afa31e7c12aba68e0fc7fc629150f300c74372) Thanks [@tianyingchun](https://github.com/tianyingchun)! - initialize projects +# @hyperse/docusaurus-mono-starter diff --git a/LICENSE b/LICENSE index f1cc904..da9bfb5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,37 @@ -MIT License - -Copyright (c) 2024 Hyperse - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +# License +Copyright (C) Hyperse (Yuantai Information Technology (Shanghai) Co., Ltd) + +This software is available under two different licenses: +* GNU General Public License version 3 (GPLv3) as Hyperse Community Edition +* Hyperse Commercial License (HCL) + +The default Hyperse license, without a valid Hyperse Commercial License agreement, is the Open-Source GPLv3 license. + +## GNU General Public License version 3 (GPLv3) + +If you decide to choose the GPLv3 license, you must comply with the following terms: + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +## Hyperse Commercial License (HCL) + +Alternatively, commercial and supported versions of the program - also known as +Commercial Distributions - must be used in accordance with the terms and conditions +contained in a separate written agreement between you and Hyperse GmbH. +For more information about the Hyperse Commercial License (HCL) please contact hi@hyperse.net. + +Please see also: + +- [Licensing FAQ - license-faq.md](https://github.com/hyperse-io/.github/blob/main/license/license-faq.md) +- [GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - gpl-3.0.txt](https://github.com/hyperse-io/.github/blob/main/license/gpl-3.0.txt) \ No newline at end of file diff --git a/README.md b/README.md index b396750..7187a1d 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# @hyperse/gh-pages-starter +

docusaurus-mono-starter

-

- - build +

+ + build - - stable version + + stable version - LoC + LoC - - GitHub top language + + GitHub top language - - Licence + + Licence

-

- Coverage: Statements - Coverage: Branches version - Coverage: Functions - Coverage: Lines +

+ Coverage: Statements + Coverage: Branches version + Coverage: Functions + Coverage: Lines

@@ -31,4 +31,31 @@
Status Category Percentage Covered / Total
🔵 Lines 75% 6 / 8
🔵 Statements 75% 6 / 8
🔵 Functions 75% 3 / 4
🔵 Branches 75% 3 / 4
-The starter template for running Github Pages with docusaurus for document +## Prerequisites + +Before you begin, make sure you have the following installed: + +- Node.js (recommended version 16.x or higher) +- npm (comes with Node.js) + +## Installation + +```ts +// npm +npm i @hyperse/track + +// yarn +yarn add @hyperse/track +``` + +## Documentation + +You can find the Track documentation [on the website](https://hyperse-io.github.io/docusaurus-mono-starter/). + +## Contributing + +Contributions are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request. + +## License + +Code released under [Track LICENSE](https://github.com/hyperse-io/docusaurus-mono-starter/blob/main/LICENSE) diff --git a/package.json b/package.json index 2644d26..ac034d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@hyperse/gh-pages-starter", - "version": "1.0.2", + "name": "@hyperse/docusaurus-mono-starter", + "version": "1.0.1", "description": "The starter template for running Github Pages with docusaurus for document", "keywords": [ "hyperse", @@ -11,13 +11,13 @@ "Github Pages", "github pages CI CD" ], - "homepage": "https://hyperse-io.github.io/gh-pages-starter", + "homepage": "https://hyperse-io.github.io/docusaurus-mono-starter", "bugs": { - "url": "https://github.com/hyperse-io/gh-pages-starter/issues" + "url": "https://github.com/hyperse-io/docusaurus-mono-starter/issues" }, "repository": { "type": "git", - "url": "git@github.com:hyperse-io/gh-pages-starter.git" + "url": "git@github.com:hyperse-io/docusaurus-mono-starter.git" }, "type": "module", "exports": { diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index c1cdd94..1fd62cb 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -1,13 +1 @@ # website - -## 1.0.2 - -### Patch Changes - -- [`9a36660`](https://github.com/hyperse-io/gh-pages-starter/commit/9a366605ec5104e47472d97d8ab115a7bf8c785c) Thanks [@tianyingchun](https://github.com/tianyingchun)! - Add code-coverage on changeset - -## 1.0.1 - -### Patch Changes - -- [`d9afa31`](https://github.com/hyperse-io/gh-pages-starter/commit/d9afa31e7c12aba68e0fc7fc629150f300c74372) Thanks [@tianyingchun](https://github.com/tianyingchun)! - initialize projects diff --git a/website/copyright.config.ts b/website/copyright.config.ts new file mode 100644 index 0000000..9c91c28 --- /dev/null +++ b/website/copyright.config.ts @@ -0,0 +1,58 @@ +export const copyrightConfig = `
+ Copyright © ${new Date().getFullYear()} Hyperse + +
`; diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 042db27..94f0e0e 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -2,12 +2,14 @@ import { themes } from 'prism-react-renderer'; import type * as Preset from '@docusaurus/preset-classic'; import type { Config } from '@docusaurus/types'; import type * as Plugin from '@docusaurus/types/src/plugin'; +import { copyrightConfig } from './copyright.config'; const config: Config = { - title: 'MUI tel input', - tagline: 'A phone number input designed for the React library MUI built with', + title: 'Docusaurus Mono Repo', + tagline: + 'A Docusaurus monorepo starter with Yarn Workspaces, and GitHub Actions', url: 'https://hyperse.github.io', - baseUrl: '/gh-pages-starter', + baseUrl: '/docusaurus-mono-starter', onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', favicon: '/icon/favicon.ico', @@ -20,7 +22,7 @@ const config: Config = { docs: { routeBasePath: '/docs', sidebarPath: './sidebars.ts', - editUrl: 'https://github.com/hyperse-io/gh-pages-starter', + editUrl: 'https://github.com/hyperse-io/docusaurus-mono-starter', }, blog: false, theme: { @@ -46,7 +48,7 @@ const config: Config = { }, docs: { sidebar: { - hideable: true, + hideable: false, }, }, navbar: { @@ -67,29 +69,65 @@ const config: Config = { label: 'Documentation', }, { - href: 'https://github.com/hyperse-io', + href: 'https://www.npmjs.com/package/@hyperse/docusaurus-mono-starter', + label: 'NPM', + position: 'right', + }, + { + href: 'https://github.com/hyperse-io/docusaurus-mono-starter', label: 'GitHub', position: 'right', }, { - href: 'https://www.npmjs.com/package/@hyperse/eslint-config-hyperse', - label: 'NPM', + href: 'https://www.hyperse.net/community', + label: 'Discord', + position: 'right', + }, + { + href: 'https://www.hyperse.net/blog', + label: 'Blog', position: 'right', }, ], }, footer: { - style: 'dark', - logo: { - alt: 'Hyperse', - src: '/img/logo.svg', - height: 40, - style: { - borderRadius: '2px', + links: [ + { + title: 'Resources', + items: [ + { + label: 'hyperse', + href: 'https://www.hyperse.net/', + }, + { + label: 'hyperse blog', + href: 'https://www.hyperse.net/blog', + }, + { + label: 'hyperse devutils', + href: 'https://devutils.hyperse.net/', + }, + ], }, - href: 'https://github.com/hyperse-io', - }, - copyright: `Copyright © ${new Date().getFullYear()} Hyperse`, + { + title: 'Community', + items: [ + { + label: 'Discord', + href: 'https://www.hyperse.net/community', + }, + { + label: 'Twitter', + href: 'https://x.com/hyperse_net', + }, + { + label: 'GitHub', + href: 'https://github.com/hyperse-io', + }, + ], + }, + ], + copyright: copyrightConfig, }, algolia: { apiKey: '441074cace987cbf4640c039ebed303c', diff --git a/website/package.json b/website/package.json index cc03576..8cd8b1e 100644 --- a/website/package.json +++ b/website/package.json @@ -50,13 +50,15 @@ "@docusaurus/plugin-content-docs": "^3.5.1", "@docusaurus/plugin-google-gtag": "^3.5.1", "@docusaurus/preset-classic": "^3.5.1", + "@heroicons/react": "^2.1.5", "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "postcss": "^8.4.41", "prism-react-renderer": "^2.3.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "tailwindcss": "^3.4.9" + "tailwindcss": "^3.4.9", + "usehooks-ts": "^3.1.0" }, "devDependencies": { "@changesets/changelog-github": "0.5.0", diff --git a/website/src/components/HomepageFeatures/index.tsx b/website/src/components/HomepageFeatures/index.tsx index a56f21f..025405b 100644 --- a/website/src/components/HomepageFeatures/index.tsx +++ b/website/src/components/HomepageFeatures/index.tsx @@ -1,38 +1,124 @@ import React from 'react'; -import clsx from 'clsx'; -import mountain from '@site/static/img/undraw_docusaurus_mountain.svg'; -import react from '@site/static/img/undraw_docusaurus_react.svg'; -import tree from '@site/static/img/undraw_docusaurus_tree.svg'; +import bars from '@site/static/img/bars.svg'; +import browser from '@site/static/img/browser.svg'; +import lightbulb from '@site/static/img/lightbulb.svg'; +import muscle from '@site/static/img/muscle.svg'; +import puzzle from '@site/static/img/puzzle.svg'; +import shield from '@site/static/img/shield.svg'; import styles from './styles.module.css'; const FeatureList = [ { - title: 'Easy to Use', - Svg: mountain, + title: 'Typed', + Svg: shield, description: ( <> - Docusaurus was designed from the ground up to be easily installed and - used to get your website up and running quickly. +

+ Leveraging TypeScript's static type checking, Hyperse ensures that + most errors are caught during development, reducing runtime issues and + enhancing the robustness and stability of front-end code. +

+

+ The strong typing system also aids developers in faster code + completion, refactoring, and debugging, thereby increasing development + efficiency. +

), }, { - title: 'Focus on What Matters', - Svg: tree, + title: 'Smart', + Svg: lightbulb, description: ( <> - Docusaurus lets you focus on your docs, and we'll do the chores. Go - ahead and move your docs into the docs directory. +

+ Hyperse integrates intelligent data collection strategies that + automatically optimize the collection process based on user behavior, + data changes, and network conditions, ensuring real-time data accuracy + and timeliness. +

+

+ It supports dynamic configuration, allowing the adjustment of + collection strategies to meet performance needs across different + front-end scenarios. +

), }, { - title: 'Powered by React', - Svg: react, + title: 'Scalable', + Svg: bars, description: ( <> - Extend or customize your website layout by reusing React. Docusaurus can - be extended while reusing the same header and footer. +

+ Optimized for large-scale front-end data collection tasks, Hyperse + efficiently gathers necessary data whether in single-page applications + (SPA) or multi-page applications. +

+

+ Its modular design allows developers to extend and adjust collection + features as needed, ensuring scalability to accommodate future + requirements. +

+ + ), + }, + + { + title: 'Powerful', + Svg: muscle, + description: ( + <> +

+ Supports multiple data sources and formats, including browser APIs, + user inputs, DOM elements, and network requests, covering a wide range + of front-end data collection scenarios. +

+

+ Offers flexible configuration options, enabling developers to + customize collection frequency, data formats, filtering rules, and + more, catering to specific application needs. +

+

+ Integrated with basic data cleansing functionalities, ensuring the + collected data is accurate and consistent. +

+ + ), + }, + + { + title: 'Front-End Friendly', + Svg: browser, + description: ( + <> +

+ Designed with front-end performance and user experience in mind, + Hyperse collects data without significantly impacting page load times + or user interactions. +

+

+ Its lightweight design ensures smooth operation even on + resource-constrained mobile devices. +

+ + ), + }, + + { + title: 'Easy Integration', + Svg: puzzle, + description: ( + <> +

+ Provides an intuitive API that simplifies integration with existing + front-end frameworks and libraries such as React, Vue, and Angular. +

+

+ Supports real-time data transmission to backend systems or third-party + services via Webhooks or other front-end communication methods, + ensuring a smooth data flow. +

), }, @@ -40,28 +126,35 @@ const FeatureList = [ function Feature({ Svg, title, description }) { return ( -
-
- -
-
-

{title}

-

{description}

+
+
+

+ + {title} +

+
+
+ {description} +
+
-
+ +
+
+ ); } export default function HomepageFeatures() { return ( -
-
-
+
+
+
{FeatureList.map((props, idx) => ( ))}
-
-
+ +
); } diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 9ccc78b..5439fb6 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -1,27 +1,93 @@ import React from 'react'; import clsx from 'clsx'; +import { useCopyToClipboard } from 'usehooks-ts'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import { CheckIcon } from '@heroicons/react/24/outline'; +import { DocumentDuplicateIcon } from '@heroicons/react/24/outline'; import HomepageFeatures from '@site/src/components/HomepageFeatures'; -import Docusaurus from '@site/static/img/docusaurus-splash.png'; import Layout from '@theme/Layout'; +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; import styles from './index.module.css'; function HomepageHeader() { const { siteConfig } = useDocusaurusContext(); + const [, copy] = useCopyToClipboard(); + const [copied, setCopied] = React.useState(false); + return (
-
- MUI color input -

{siteConfig.title}

+
+
+ {/* + */} +
+

{siteConfig.title}

{siteConfig.tagline}

-
+