From 56dea1b1047fb6e41bb8f43a45262992b07e4382 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Sat, 30 Nov 2024 22:38:45 +0100 Subject: [PATCH] docs: update home content --- docs/.gitignore | 2 +- docs/.vitepress/config.mts | 25 ++- .../{api.ts => scripts/api-summary.js} | 7 +- docs/.vitepress/theme/index.ts | 12 +- docs/.vitepress/theme/style.css | 4 + docs/api.md | 12 +- docs/docs/authentication.md | 12 +- docs/docs/cache.md | 12 +- docs/docs/command.md | 12 +- docs/docs/configuration/index.md | 12 +- docs/docs/controllers.md | 12 +- docs/docs/exceptions.md | 12 +- docs/docs/json-mapper.md | 12 +- docs/docs/logger.md | 12 +- docs/docs/model.md | 12 +- docs/docs/platform-serverless-http.md | 12 +- docs/docs/platform-serverless.md | 12 +- docs/docs/providers-lazy-loading.md | 12 +- docs/docs/providers.md | 12 +- docs/docs/response-filter.md | 12 +- docs/docs/serve-files.md | 12 +- docs/docs/templating.md | 12 +- docs/docs/upload-files.md | 12 +- docs/getting-started.md | 147 ++++++++++++++++++ docs/index.md | 53 +++---- .../create-your-first-controller.md | 12 +- docs/introduction/getting-started.md | 8 +- docs/introduction/migrate-from-v7.md | 12 +- docs/more/team.md | 4 +- docs/package.json | 9 +- docs/plugins/index.md | 12 +- docs/yarn.lock | 10 +- readme.md | 11 +- team.json | 4 +- 34 files changed, 374 insertions(+), 174 deletions(-) rename docs/.vitepress/{api.ts => scripts/api-summary.js} (85%) create mode 100644 docs/getting-started.md diff --git a/docs/.gitignore b/docs/.gitignore index 7df88fdf9e8..072eb4cac60 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -3,6 +3,7 @@ api .vitepress/cache .vitepress/dist public/api.json +public/reference-sidebar.json # Yarn .pnp.* @@ -13,4 +14,3 @@ public/api.json !.yarn/cache !.yarn/sdks !.yarn/versions - diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 867340ca81a..eb22b5019ae 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,14 +1,15 @@ import {apiAnchor} from "@tsed/vitepress-theme/markdown/api-anchor/api-anchor.js"; import {defineConfig} from "vitepress"; import pkg from "../../package.json"; -import {getSidebar} from "./api.js"; +import referenceSidebar from "../public/reference-sidebar.json"; +import team from "../team.json"; // https://vitepress.dev/reference/site-config export default defineConfig({ - title: "Ts.ED", + title: "Ts.ED a modern Node.js/Bun.js framework built with TypeScript", lastUpdated: true, - + description: "Ts.ED offers a flexible and easy-to-learn structure designed to enhance the developer experience. It provides decorators, guidelines, and supports Node.js, Bun.js, Express, Koa, CLI, and serverless architectures (e.g., AWS).", sitemap: { hostname: "https://tsed.io" }, @@ -26,13 +27,26 @@ export default defineConfig({ ["meta", {property: "og:title", content: "Ts.ED - A Node.js and TypeScript Framework on top of Express/Koa.js."}], ["meta", {property: "og:site_name", content: "Ts.ED"}], ["meta", {property: "og:image", content: "https://tsed.dev/tsed-og.png"}], - ["meta", {property: "og:url", content: "https://tsed.dev/"}] + ["meta", {property: "og:url", content: "https://tsed.dev/"}], + [ + "script", + {async: "", src: "https://www.googletagmanager.com/gtag/js?id=G-3M3Q4QME6H&cx=c&_slc=1"} + ], + [ + 'script', + {}, + `window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-3M3Q4QME6H');` + ] ], themeConfig: { logo: "/tsed.svg", siteTitle: false, apiUrl: "/api.json", + team, apiRedirectUrl: "", repo: "tsedio/tsed", githubProxyUrl: "https://api.tsed.io/rest/github/tsedio/tsed", @@ -560,8 +574,7 @@ export default defineConfig({ ].sort((a, b) => a.text.localeCompare(b.text)) } ], - - "/api/": getSidebar() + "/api/": referenceSidebar }, socialLinks: [ {icon: "github", link: "https://github.com/tsedio/tsed"}, diff --git a/docs/.vitepress/api.ts b/docs/.vitepress/scripts/api-summary.js similarity index 85% rename from docs/.vitepress/api.ts rename to docs/.vitepress/scripts/api-summary.js index 23699c5b236..0a198bbe116 100644 --- a/docs/.vitepress/api.ts +++ b/docs/.vitepress/scripts/api-summary.js @@ -1,5 +1,6 @@ import {mapApiReferences} from "@tsed/vitepress-theme/composables/api/mappers/mapApiReferences.js"; -import api from "../public/api.json"; +import api from "../../public/api.json" with { type: "json" }; +import {writeFile} from "node:fs/promises"; const IS_CORES = /core|@tsed\/di|hooks|schema$|\/exceptions$|engines|json-mapper|open-spec/; const IS_PLATFORM = /platform/; @@ -31,7 +32,7 @@ export function getSidebar() { platformModules.push(item); } else if (IS_ORM.test(module)) { ormModules.push(item); - }else { + } else { thirdParties.push(item); } }); @@ -56,3 +57,5 @@ export function getSidebar() { ]; } + +await writeFile(import.meta.dirname + "/../../public/reference-sidebar.json", JSON.stringify(getSidebar(), null, 2)); diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index c7f17922b83..ec02c623bb2 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,15 +1,15 @@ // https://vitepress.dev/guide/custom-theme import {DefaultTheme} from "@tsed/vitepress-theme"; -import type {Theme} from "vitepress"; -import {h} from "vue"; import HomeBanner from "@tsed/vitepress-theme/organisms/home/HomeBanner.vue"; -import HomePartners from "@tsed/vitepress-theme/organisms/home/HomePartners.vue"; import HomeBody from "@tsed/vitepress-theme/organisms/home/HomeBody.vue"; import HomeTabsTerminal from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabsTerminal.vue"; +import HomeTabTerminalBun from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalBun.vue"; import HomeTabTerminalNpm from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalNpm.vue"; -import HomeTabTerminalYarn from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalYarn.vue"; import HomeTabTerminalPnpm from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalPnpm.vue"; -import HomeTabTerminalBun from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalBun.vue"; +import HomeTabTerminalYarn from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalYarn.vue"; +import HomeBeforeFeatures from "@tsed/vitepress-theme/organisms/home/HomeBeforeFeatures.vue"; +import type {Theme} from "vitepress"; +import {h} from "vue"; import "./style.css"; export default { @@ -26,7 +26,7 @@ export default { bun: () => h(HomeTabTerminalBun) }) }), - "home-features-before": () => h(HomePartners), + "home-features-before": () => h(HomeBeforeFeatures), "home-features-after": () => h(HomeBody) }); } diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index f00ef8b1960..fd8b9049a5f 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -3,3 +3,7 @@ padding-right: 0; } + +.box a { + color: var(--vp-c-brand-1); +} diff --git a/docs/api.md b/docs/api.md index 6acd11e620b..aad5a15c0c9 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,11 +1,13 @@ --- layout: page sidebar: false -meta: - - name: description - content: Api Reference of Ts.ED. Use decorator to build your model and map data. - - name: keywords - content: api reference model decorators ts.ed express typescript node.js javascript jsonschema json mapper serialization deserialization +head: + - - meta + - name: description + content: Api Reference of Ts.ED. Use decorator to build your model and map data. + - - meta + - name: keywords + content: api reference model decorators ts.ed express typescript node.js javascript jsonschema json mapper serialization deserialization --- - - -
Team members
- - -
diff --git a/docs/introduction/create-your-first-controller.md b/docs/introduction/create-your-first-controller.md index 242f0c4d13e..f1d79859ab4 100644 --- a/docs/introduction/create-your-first-controller.md +++ b/docs/introduction/create-your-first-controller.md @@ -2,11 +2,13 @@ next: text: Controllers link: /docs/controllers -meta: - - name: description - content: Create your first controller. Ts.ED is built on top of Express and uses TypeScript language. - - name: keywords - content: controller getting started ts.ed express typescript node.js javascript decorators mvc class models +head: + - - meta + - name: description + content: Create your first controller. Ts.ED is built on top of Express and uses TypeScript language. + - - meta + - name: keywords + content: controller getting started ts.ed express typescript node.js javascript decorators mvc class models --- # Create your first controller diff --git a/docs/introduction/getting-started.md b/docs/introduction/getting-started.md index bb8e7f116d2..9db526937dc 100644 --- a/docs/introduction/getting-started.md +++ b/docs/introduction/getting-started.md @@ -141,7 +141,7 @@ If none of previous solutions are satisfying maybe you are in these cases: Now you can follow one of these links to develop your new application: -[//]: # "- [Create your first controller](/getting-started/create-your-first-controller.md)" -[//]: # "- [Change server configuration](/docs/configuration.md)" -[//]: # "- [Load configuration from files](/docs/configuration.md)" -[//]: # "- [What is the Platform API](/docs/platform-api.md)" +- [Create your first controller](/introduction/create-your-first-controller.md) +- [Change server configuration](/docs/configuration/index.md) +- [Load configuration from files](/docs/configuration/index.md) +- [What is the Platform API](/docs/platform-api.md) diff --git a/docs/introduction/migrate-from-v7.md b/docs/introduction/migrate-from-v7.md index e23c1ccdf92..c5b5bd594cc 100644 --- a/docs/introduction/migrate-from-v7.md +++ b/docs/introduction/migrate-from-v7.md @@ -1,9 +1,11 @@ --- -meta: - - name: description - content: Migrate Ts.ED application from v7 to v8. Ts.ED is built on top of Express and uses TypeScript language. - - name: keywords - content: migration getting started ts.ed express typescript node.js javascript decorators mvc class models +head: + - - meta + - name: description + content: Migrate Ts.ED application from v7 to v8. Ts.ED is built on top of Express and uses TypeScript language. + - - meta + - name: keywords + content: migration getting started ts.ed express typescript node.js javascript decorators mvc class models --- # Migrate from v7 to v8 diff --git a/docs/more/team.md b/docs/more/team.md index 08452fd454f..e628a49c5da 100644 --- a/docs/more/team.md +++ b/docs/more/team.md @@ -13,8 +13,8 @@ import team from '../team.json'; const members = team.map((member) => { return { avatar: member.src, - name: member.title + ' - ' + member.job, - title: member.role, + name: member.title, + title: member.role + ' - ' + member.job, links: [ { icon: 'github', link: 'https://github.com/' + member.github }, member.twitter && { icon: 'twitter', link: 'https://x.com/' + member.twitter } diff --git a/docs/package.json b/docs/package.json index 30c2f733dc8..4924ca73b9a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,12 +3,13 @@ "version": "8.0.4", "type": "module", "scripts": { - "docs:dev": "vitepress dev .", - "docs:build": "vitepress build .", - "docs:preview": "vitepress preview ." + "docs:dev": "yarn build:api:summary && vitepress dev .", + "docs:build": "yarn build:api:summary && vitepress build .", + "docs:preview": "vitepress preview .", + "build:api:summary": "node ./.vitepress/scripts/api-summary.js" }, "dependencies": { - "@tsed/vitepress-theme": "1.4.0", + "@tsed/vitepress-theme": "1.5.2", "@vueuse/core": "10.11.0", "axios": "1.7.7", "lodash": "4.17.21", diff --git a/docs/plugins/index.md b/docs/plugins/index.md index 836ef6669d7..216b9332eb9 100644 --- a/docs/plugins/index.md +++ b/docs/plugins/index.md @@ -1,10 +1,12 @@ --- layout: page -meta: - - name: description - content: Discover our list of plugins to extends your Ts.ED project. Created by the Ts.ED team and community. - - name: keywords - content: Ts.ED nodejs express typescript javascript es6 decorators mvc model ioc service model middleware socket.io swagger typeorm mongoose ajv +head: + - - meta + - name: description + content: Discover our list of plugins to extends your Ts.ED project. Created by the Ts.ED team and community. + - - meta + - name: keywords + content: Ts.ED nodejs express typescript javascript es6 decorators mvc model ioc service model middleware socket.io swagger typeorm mongoose ajv --- diff --git a/docs/yarn.lock b/docs/yarn.lock index eee3f50e73b..d8a1a870e24 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -734,7 +734,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tsed/docs-new@workspace:." dependencies: - "@tsed/vitepress-theme": "npm:1.4.0" + "@tsed/vitepress-theme": "npm:1.5.2" "@vueuse/core": "npm:10.11.0" autoprefixer: "npm:^10.4.19" axios: "npm:1.7.7" @@ -746,14 +746,14 @@ __metadata: languageName: unknown linkType: soft -"@tsed/vitepress-theme@npm:1.4.0": - version: 1.4.0 - resolution: "@tsed/vitepress-theme@npm:1.4.0" +"@tsed/vitepress-theme@npm:1.5.2": + version: 1.5.2 + resolution: "@tsed/vitepress-theme@npm:1.5.2" dependencies: "@vueuse/core": "npm:10.11.0" axios: "npm:1.7.7" lucide-vue-next: "npm:^0.436.0" - checksum: 10/4b42f36e7513ae6c85ef6433d269f0d48510a4d3c0d1a1a51bfdfd254716039cd9a405140b479f1025b95335003c1f75ad5ec819648627e9294599102cdf93ac + checksum: 10/04ce26cf6599b36ca9d28d6162740468ac37d0a0f68679fe982c31ee5ebe926dd9c50734111fa3aba8c1212839963017681e1c2122a592961cad775d6b47edf9 languageName: node linkType: hard diff --git a/readme.md b/readme.md index f49eb6a53b7..a475423abd3 100644 --- a/readme.md +++ b/readme.md @@ -28,12 +28,15 @@
-> A Node.js and TypeScript Framework on top of Express. It provides a lot of decorators and guidelines to write your code. - ## What it is -Ts.ED is a Node.js and TypeScript Framework on top of Express/Koa.js. Ts.ED is a framework on top of Express/Koa to write your application with TypeScript (or ES6). -It provides a lot of decorators and guideline to make your code more readable and less error-prone. +Ts.ED is a modern Node.js framework built with TypeScript. It offers a flexible structure with a fast learning curve, specifically designed to improve the developer experience. Ts.ED provides numerous decorators and guidelines to make your code more readable and less error-prone. It supports various platforms and tools, including Node.js/Bun.js, Express.js/Koa.js, CLI, and serverless architectures (e.g., AWS). + +- Multi-platform: Easily build your server-side application using Express.js, Koa.js, CLI, or serverless platforms (e.g., AWS). It supports both Node.js and Bun.js runtimes. Learn more here. +- Configuration: Stop wasting time on configuration—your application comes preconfigured for a fast start! Try our CLI. +- Decorators: Use a wide range of decorators to structure your code, define routes, and implement methods with ease. Learn more here. +- Class-based: Define classes as Controllers, Models, Providers (DI), Pipes, and more, with JSON Schema and OpenAPI at the core of the framework. +- Testing: Testing is not optional—it's essential! Ts.ED includes built-in features to make testing your code simple and efficient. Learn more here. ## Features diff --git a/team.json b/team.json index 93ccf6ad412..73321a9440f 100644 --- a/team.json +++ b/team.json @@ -91,8 +91,8 @@ "country": "Germany", "city": "Cologne", "role": "Contributor" - } - { + }, + { "title": "Xavier Jamito", "job": "Developer", "src": "https://avatars.githubusercontent.com/u/17645632?v=4",