From 3158ab913829079bee457f036ea5747da0fb1efd Mon Sep 17 00:00:00 2001 From: Pascal Kaufmann Date: Mon, 6 Jan 2025 21:02:51 +0100 Subject: [PATCH] Sanitize some docs --- docs/docs/Introduction.md | 24 +-- docs/docs/concepts/architecture-overview.md | 80 +++++---- docs/docs/concepts/cart-behavior.md | 39 +++-- docs/docs/concepts/search-behavior.md | 144 ++++++++-------- docs/docs/config/booting.md | 4 +- docs/docs/getting-started/Install-engine.md | 35 ++-- .../getting-started/Install-storefront.md | 39 ++--- docs/docusaurus.config.js | 15 +- package-lock.json | 157 ++++++++++++++++++ package.json | 2 + 10 files changed, 348 insertions(+), 191 deletions(-) diff --git a/docs/docs/Introduction.md b/docs/docs/Introduction.md index 591d31c5fb..d24dd5fe02 100644 --- a/docs/docs/Introduction.md +++ b/docs/docs/Introduction.md @@ -5,27 +5,27 @@ description: Overview slug: / --- -**Unchained Engine is a high-performant, open-source, e-commerce framework for Node.js/Bun** +**Unchained Engine is a high-performance, open-source e-commerce framework for Node.js/Bun** ![diagram](./assets/System-Architecture.png) -#### Core Design Principes of Unchained Engine: +#### Core Design Principles of Unchained Engine: -- **Codeability**, so you can extend the system with endless possibilities not restricted by "customization" or a settings-approach -- **GraphQL API**, allowing you to build modern and fully omni-channel storefronts -- **Stateless architecture**, allowing you to scale horizontally and vertically -- **Low Overhead** because we value simplicity and speed! Unchained runs on Node.js 22/23 and Bun 1.1, is pure ESM and directly uses the native Mongo-DB driver instead of a clunky DB abstraction -- **Production readiness**, because it's been used for years by companies running big B2C and B2B portals with 20'000+ articles and 100 concurrent users +- **Codeability**: Extend the system with endless possibilities, unrestricted by "customization" or settings. +- **GraphQL API**: Build modern, fully omni-channel storefronts. +- **Stateless architecture**: Scale horizontally and vertically. +- **Low Overhead**: We value simplicity and speed! Unchained runs on Node.js 22/23 and Bun 1.1, is pure ESM, and directly uses the native MongoDB driver. +- **Production readiness**: Used by companies running large B2C and B2B portals with 20,000+ articles and 100 concurrent users. ### Solution Overview -The following diagram shows all applications and services provided by Unchained as open-source software for you to easily setup your first eCommerce store in a few minutes. +The following diagram shows all applications and services provided by Unchained as open-source software for you to easily set up your first eCommerce store in a few minutes. ![diagram](./assets/Unchained_Ecosystem.png) -As you can see the Unchained Engine ecosystem consists of +The Unchained Engine ecosystem consists of: -- the **Engine** itself as server-side only GraphQL API included app to serve all functionality to manage the store \* -- the **Storefront** boilerplate web app which provides a customizable UI for the public store itself as [Next.js](https://nextjs.org/) project +- The **Engine**: A server-side only GraphQL API to manage the store. +- The **Storefront**: A customizable UI for the public store, provided as a [Next.js](https://nextjs.org/) project. -The next chapter helps you setup an E-Commerce solution self-hosted. +The next chapter helps you set up a self-hosted e-commerce solution. diff --git a/docs/docs/concepts/architecture-overview.md b/docs/docs/concepts/architecture-overview.md index 4251ff377c..752d17a093 100644 --- a/docs/docs/concepts/architecture-overview.md +++ b/docs/docs/concepts/architecture-overview.md @@ -1,61 +1,83 @@ --- sidebar_position: 1 title: Overview -sidebar_label: Overview +sidebar_label: Overview --- -::: -System Design of Unchained Engine -::: +::: System Design of Unchained Engine ::: + ## Core Values **Free and Open Source Software** -Usage of OSS prevents vendor lock-in. Using software that is open to the public leads to communities that help each other, the software is resilient to economic issues like bankruptcy of the software owner. +Using OSS prevents vendor lock-in and fosters a community that supports each other. It ensures resilience +against economic issues like the bankruptcy of the software owner. **Hackable / Code-first** -Non-hackable software (like SaaS) use the technique of "customizing", meaning it provides a massive control panel where every aspect of the software can be configured, themed or disabled. Sadly, there is always something that needs some extra development work and companies need to hire somebody to create a plugin. In Unchained Engine, the software flow is changed through the code and not through the UI. This means a software developer is always required to configure the platform. It's called "hackable" software and allows to configure even parts of the software that were not intended to get configured by the core developers. +Unlike SaaS, which relies on extensive control panels for customization, Unchained Engine allows +configuration through code. This means a developer is always required, enabling customization even beyond +what the core developers intended. **Headless / API-first** -User interfaces (like Web Shop Storefronts) rot at a much higher speed as the underlying processes and core systems. User interfaces change at a rapid speed: Technologies are born and die only a few years later, devices like smartwatches pop up, screen sizes vary. We think it's extremely important to have an e-commerce system that is going to stay for the long run like an ERP does, only then it's investable. By completely decoupling the Unchained Engine from any web shop user interface, it's usable in very flexible ways. But of course there are also [cons](https://www.semrush.com/blog/going-headless-ecommerce-store/) to that approach. +User interfaces evolve rapidly, while core systems remain stable. By decoupling the Unchained Engine from +any specific UI, it remains flexible and long-lasting. However, there are +[cons](https://www.semrush.com/blog/going-headless-ecommerce-store/) to this approach. ## Layered Approach Unchained Engine is built in layers: -| Unchained Engine Layers | -| ----------------------------- | -| App | -| Platform | -| Service Gateway (Coming soon) | -| Core Modules | +| Unchained Engine Layers | +| ----------------------- | +| App | +| Platform | +| Service Gateway | +| Core Modules | -When you set up a new Unchained Engine project, you usually just boot the platform layer by running `startPlatform`. +When setting up a new project, you typically boot the platform layer by running `startPlatform`. **App** -Unchained Engine is loaded as a framework into a common Node.js project. The user-land app is where your project and your custom project-specific code live. -**Platform** loads all the default core modules into a unified object, defines the GraphQL schema and resolvers, starts the API server, the work queue and orchestrates configuration of modules, e-mail templates and authentication. The packages "platform" and "api" both belong to the Platform Layer. In some very rare cases you might want to skip the it and directly access the core modules: +The user-land app is where your project-specific code lives, with Unchained Engine loaded as a framework +into a Node.js project. + +**Platform** + +The platform layer loads all default core modules, defines the GraphQL schema and resolvers, starts the +API server, work queue, and orchestrates module configuration, email templates, and authentication. The +"platform" and "api" packages belong to this layer. In rare cases, you might skip it to directly access +core modules, such as for federated microservices or custom APIs. + +For extending the GraphQL API, adding payment or delivery options, or configuring core modules, check the +basic [configuration options](../config/booting) and [existing plugins](../plugins/plugin-overview.md) +first, then consult [advanced options](../advanced/overview). -- You want to use a very custom version of an existing core module -- You want to decompose the backend into federated microservices (run orders core-module on another instance for example) -- You want to have a custom made REST API instead of the GraphQL API +**Service Gateway** -You don't need to implement your own platform layer if you just want to extend the GraphQL Schema, add new job types or configure core-modules. For these cases, [configuration options](../config/booting) exist. +The service gateway composes functions from multiple modules to enable complex workflows, like checkout. +You can modify services by using or writing custom plugins and extend services by adding functions to +`startPlatform` +[options](https://docs.unchained.shop/types/interfaces/_unchainedshop_core.UnchainedCoreOptions.html). -**Service Gateway** composes functions of multiple modules together to enable sophisticated workflows like a checkout where many different modules have to play together. This layer does not exist yet as the modules currently just interdependent with each other. +**Core Modules** -**Core Modules** are thematically split up packages that contain business logic and database abstraction to allow a developer to influence the way the modules behave. You as a developer can change the way a module behaves by configuration and writing plugins. +Core modules contain business logic and database abstractions. You can modify modules through +configuration and plugins. To add or overwrite modules, check +[write custom modules](../advanced/custom-modules). -## API Design Principles: +## API Design Principles -1. Unchained is stateless and doesn‘t know browser sessions. All data is being held in MongoDB (persistent data, transactional data) or Redis (caching, Pub/Sub). -2. Non-logged in users can only read certain data, but not mutate anything. For cases where you need an anonymous user (like letting a client add stuff to cart and checkout without registration) you can use the loginAsGuest mutation that creates a temporary user. -3. All business logic should stay on the server-side, that way your E-Commerce project stays truly omni-channel and domain logic in the client is reduced to an absolute minimum. +1. Unchained is stateless, with all data stored in MongoDB. +2. Non-logged-in users can only read certain data. For anonymous user actions like adding to cart and + checkout, use the loginAsGuest mutation. +3. All business logic remains server-side, ensuring omni-channel support and minimal client-side domain + logic. -Some consequence of these design decisions: +Consequences of these principles: -1. In Unchained, carts are defined as „open orders“ and are stored server side. A user can add something to a cart on one device and then checkout on another. After checkout, the cart becomes an immutable order. -2. Anonymous users can become real users without loosing order history or bookmarks done as anonymous user. Carts even get merged together if somebody starts anonymously and decides to login during the process of buying a good. \ No newline at end of file +1. Carts are defined as "open orders" and stored server-side, allowing users to add items on one device + and checkout on another. After checkout, the cart becomes an immutable order. +2. Anonymous users can become registered users without losing order history or bookmarks. Carts merge if + a user logs in during the buying process. diff --git a/docs/docs/concepts/cart-behavior.md b/docs/docs/concepts/cart-behavior.md index 8c175bdc5c..124eab45ba 100644 --- a/docs/docs/concepts/cart-behavior.md +++ b/docs/docs/concepts/cart-behavior.md @@ -1,32 +1,35 @@ --- sidebar_position: 2 title: Cart Behavior -description: Learn about the cart and it's advanced features +description: Learn about the cart and its advanced features sidebar_label: Cart --- -# Cart Behavior - -In Unchained, you can add products and quotations to carts, but only products will remain in the cart in the end. When adding products to the cart, they are transformed according to the following rules: +# Cart Behavior -Products: -- When adding a SimpleProduct or BundleProduct, the system adds the product to the cart with no transformation happening. -- When exploding a BundleProduct, it will be removed from the cart and its parts will be added to the cart. -- When adding a ConfigurableProduct, the system resolves to the concrete product if enough variation vector parameters are provided through the product configuration parameters. If not, the operation will fail. The variation configuration is stored on the resolved item along with the user-provided parameters. +In Unchained, you can add products and quotations to carts, but only products will remain in the cart in +the end. When adding products to the cart, they are transformed according to the following rules: -When one product leads to another, the source productId is saved in context.origin. This way, a SimpleProduct item still has a reference to the ConfigurableProduct for UX purposes. +**Products:** -Quotations: -When adding a Quotation to the cart, the actual product will be resolved and added to the cart. It uses the transform method of the quotation plugin system to transform a quotationConfiguration into a productConfiguration. The source quotationId is saved in context.origin. +- Adding a SimpleProduct or BundleProduct adds the product to the cart without transformation. +- Exploding a BundleProduct removes it from the cart and adds its parts instead. +- Adding a ConfigurableProduct resolves to a concrete product if enough variation parameters are + provided. Otherwise, the operation fails. The variation configuration is stored on the resolved item + along with user-provided parameters. +When one product leads to another, the source productId is saved in `orderPosition.originalProductId`, maintaining a +reference for UX purposes. -It is also possible to chain operations: +**Quotations:** When adding a Quotation to the cart, the actual product is resolved and added. The +quotation plugin system transforms a `quotationConfiguration` into a `productConfiguration`, and the +source quotationId is saved in `orderPosition.originalProductId`. -1. addCartQuotation is called with quotation Y -2. quotation Y is resolved to a configurable product X with a specific configuration -3. the specific configuration is handed to the vector logic to try to find a distinct concrete product Z -4. bundle product Z is resolved +**Chaining Operations:** -Now the cart looks like this (you guessed it): +1. `addCartQuotation` is called with quotation Y. +2. Quotation Y resolves to configurable product X with a specific configuration. +3. The configuration is handed to the vector logic to find a distinct concrete product Z. +4. Bundle product Z is resolved. -1 x Bundle Z (e.g. a piece of furniture) \ No newline at end of file +The cart then looks like this: 1 x Bundle Z (e.g., a piece of furniture) diff --git a/docs/docs/concepts/search-behavior.md b/docs/docs/concepts/search-behavior.md index 5b75d2c4d8..fc4635f00a 100644 --- a/docs/docs/concepts/search-behavior.md +++ b/docs/docs/concepts/search-behavior.md @@ -3,92 +3,90 @@ sidebar_position: 3 title: Search Behavior sidebar_label: Search --- -# Search Behavior ---- -:::: - Learn about the search feature -:::: -Unchained provides you with the ability to search and filter products and assortments. +:::: Learn about the search feature :::: + +Unchained allows you to search and filter products and assortments. ### Products Search -There are two ways to search for products in Unchained, first is a general search which is a common scenario where you'd want to search all products in your system. +There are two ways to search for products in Unchained: -``` -query searchProducts($queryString: String, $limit: Int) { - searchProducts(queryString: $queryString, includeInactive: true) { - products { - _id - status - texts { - _id - title - description - } - media(limit: $limit) { - texts { - _id - title - } - file { - _id - url - name - } - } - } - } - } -``` -There are multiple options available to further tailor your search result like orderBy, includeInactive, assortmentId. +1. **General Search**: Search all products in your system. + ```graphql + query searchProducts($queryString: String, $limit: Int) { + searchProducts(queryString: $queryString, includeInactive: true) { + products { + _id + status + texts { + _id + title + description + } + media(limit: $limit) { + texts { + _id + title + } + file { + _id + url + name + } + } + } + } + } + ``` -The second one is Assortment.searchProducts which provides you with the ability to only search the products attach to an assortment. + Options include `orderBy`, `includeInactive`, and `assortmentId`. -``` -query Assortment($assortmentId: ID) { - assortment(assortmentId: $assortmentId) { - ... - searchProducts { - filteredProducts - filters { - filteredProducts - definition { - _id - } - isSelected - options { - filteredProducts - definition { - _id - } - isSelected - } - } - products { - _id - } - } - ... -``` +2. **Assortment Search**: Search products attached to a specific assortment. + ```graphql + query Assortment($assortmentId: ID) { + assortment(assortmentId: $assortmentId) { + searchProducts { + filteredProducts + filters { + filteredProducts + definition { + _id + } + isSelected + options { + filteredProducts + definition { + _id + } + isSelected + } + } + products { + _id + } + } + } + } + ``` ### Assortments Search -Just like the products general search there's also a one available for products +Similar to the general product search, you can search for assortments: -``` - query searchAssortments($queryString: String) { - searchAssortments(queryString: $queryString, includeInactive: true) { - assortments { +```graphql +query searchAssortments($queryString: String) { + searchAssortments(queryString: $queryString, includeInactive: true) { + assortments { + _id + isActive + texts { _id - isActive - texts { - _id - title - description - } + title + description } } } -``` \ No newline at end of file +} +``` diff --git a/docs/docs/config/booting.md b/docs/docs/config/booting.md index a1c05b4749..2bd33aa932 100644 --- a/docs/docs/config/booting.md +++ b/docs/docs/config/booting.md @@ -20,8 +20,8 @@ The main entry point for unchained engine is `startPlatform` imported from `@unc import { startPlatform } from '@unchainedshop/platform' const unchainedAPI = await startPlatform({}) - ``` + `startPlatform` returns the unchained api that lets you control all the modules and services defined. for example you can create seed the database with configurations like add currency, language, payment provider, admin accounts etc... ```typescript @@ -36,8 +36,8 @@ await unchainedAPI.modules.users.createUser( }, { skipMessaging: true }, ) - ``` + Its also possible to configure the platform with a little effort through the various configuration options available. These options are available: - `modules: Record) => any }>`: Custom modules configuration point. allows you to extends the functionality the engine. diff --git a/docs/docs/getting-started/Install-engine.md b/docs/docs/getting-started/Install-engine.md index 193c4ac2ad..e5fd4f06c1 100644 --- a/docs/docs/getting-started/Install-engine.md +++ b/docs/docs/getting-started/Install-engine.md @@ -8,19 +8,11 @@ sidebar_label: Install engine Usage and Configuration Options for the Cryptopay Plugin ::: -In this section, we will walk you through the steps required to start up an Unchained Engine API server locally. - -This tutorial helps you: - -- Configure and run unchained engine. -- Access the engine through the [Admin UI sandbox](https://sandbox-v3.unchained.shop/log-in) -- Open the graphQL playground of your local Unchained Engine - -. +This section walks you through the steps to start an Unchained Engine API server locally. ## Step 1: Installation -1. First create a new folder for your project to be installed. +1. Create a new folder for your project. ```bash mkdir my-unchained-engine @@ -33,7 +25,7 @@ cd my-unchained-engine npm init @unchainedshop ``` -3. A message prompts you to select the installation template. Choose **Unchained engine** by using the `down key` and press `enter` +3. Select the installation template. Choose **Unchained engine**. ```bash ? What type of template do you want › @@ -42,7 +34,7 @@ Storefront Unchained engine <-- ``` -4. Next two steps are to select the directory, as we already created a new empty directory you can simply press `enter`, and whether you want to initialize git which is up to you. +4. Select the directory (press `enter` to use the current directory) and whether to initialize git. ```bash ? Directory name relative to current directory @@ -50,40 +42,39 @@ Unchained engine <-- ? Do you want Initialize git? no / yes ``` -5. Make sure your node version is 22+ and install the npm packages +5. Ensure your Node version is 22+ and install the npm packages. ```bash npm install ``` -The installation script downloads, installs and initialises all files and packages required to build and run unchained engine. - -## Step 2: Start the Unchained Engine +## Step 2: Start the Unchained Engine ```bash npm run dev ``` -Open [localhost:4010](http://localhost:4010) to check if your unchained engine is running correctly. You should see the following **Landing page** in your browser +Open [localhost:4010](http://localhost:4010) to check if your Unchained Engine is running correctly. You should see the following **Landing page** in your browser: ![diagram](../assets/engin_intro.png) ## Open Admin UI sandbox -On the initial landing page there are various options you can choose including [Use sandbox Admin UI](https://sandbox-v3.unchained.shop/log-in). Click on that button to mange you local engine instance using the admin ui sandbox, it will redirect you to a login page, use the below credentials to login into the engine and make sure to change the credentials as soon as possible + +On the initial landing page, click [Use sandbox Admin UI](https://sandbox-v3.unchained.shop/log-in) to manage your local engine instance using the admin UI sandbox. Use the following credentials to log in and change them as soon as possible: **Username**: _admin@unchained.local_
**Password**: _password_ ![diagram](../assets/sandbox-login.png) -You can also click on [Graphql playground](http://localhost:4010/graphql) to opens the GraphQL playground for you to easily execute queries and mutations. +You can also click on [GraphQL playground](http://localhost:4010/graphql) to open the GraphQL playground for executing queries and mutations. ## Step 3: Add Products -If you want to set up the store and add products and categories using the admin UI follow the instruction of the [Getting-Started](/getting-started/add-products) guide using your local instance under [localhost:4010](http://localhost:4010). +To set up the store and add products and categories using the admin UI, follow the instructions in the [Add Products](/getting-started/add-products) guide using your local instance at [localhost:4010](http://localhost:4010). -Follow the examples to learn about how to add products, initiate a check-out and use plugins with GraphQL. +Follow the examples to learn how to add products, initiate a checkout, and use plugins with GraphQL. ## Run the Storefront template -An easy way to test the Unchained Engine is to setup the test storefront web app created with [React.js](https://reactjs.org/) and [Next.js](https://nextjs.org/) locally and connect our local Unchained Engine GraphQL API to it which is covered in the next chapter. \ No newline at end of file +To test the Unchained Engine, set up the test storefront web app created with [React.js](https://reactjs.org/) and [Next.js](https://nextjs.org/) locally and connect it to your local Unchained Engine GraphQL API, as covered in the next chapter. \ No newline at end of file diff --git a/docs/docs/getting-started/Install-storefront.md b/docs/docs/getting-started/Install-storefront.md index 79d878ec35..b3c71d0b7d 100644 --- a/docs/docs/getting-started/Install-storefront.md +++ b/docs/docs/getting-started/Install-storefront.md @@ -4,17 +4,11 @@ title: Install and setup the storefront web-app sidebar_label: Install storefront --- -To test the Unchained Engine we setup the test frontend project **Storefront** created with [React.js](https://reactjs.org/) and [Next.js](https://nextjs.org/) locally. - - -Steps: - -- Install the storefront web app locally -- Conntect to the local Unchained Engine via [graphQL](https://graphql.org/) +To test the Unchained Engine, set up the test frontend project **Storefront** created with [React.js](https://reactjs.org/) and [Next.js](https://nextjs.org/) locally. ## Prerequisites -The storefront installation requires a Node version > 14. +The storefront installation requires Node.js version >= 18. ```bash node --version @@ -23,22 +17,22 @@ v14.17.1 ## Step 1: Installation -The **Storefront** project is a [Next.js](https://nextjs.org/) based web app and connects to your Unchained Engine through [graphQL](https://graphql.org/) queries. +The **Storefront** project is a [Next.js](https://nextjs.org/) based web app that connects to your Unchained Engine through [GraphQL](https://graphql.org/) queries. -1. First create a new folder for your project to be installed. +1. Create a new folder for your project. ```bash mkdir my-storefront-webapp cd my-storefront-webapp ``` -2. Use the Unchained initialisation script to download the code. +2. Use the Unchained initialization script to download the code. ```bash npm init @unchainedshop ``` -3. A message prompts you to select the installation template. Choose **storefront** by using the `down key` and press `enter` +3. Select the installation template. Choose **storefront**. ```bash ? What type of template do you want › @@ -47,7 +41,7 @@ Storefront <-- Unchained engine ``` -4. Next two steps are to select the directory, as we already created a new empty directory you can simply press `enter`, and whether you want to initialise git which is up to you. +4. Select the directory (press `enter` to use the current directory) and whether to initialize git. ```bash ? Directory name relative to current directory @@ -55,34 +49,27 @@ Unchained engine ? Do you want Initialize git? no / yes ``` -5. Install the npm packages +5. Install the npm packages. ```bash npm install ``` -The installation script downloads, installs and initialises all files and packages required to build and run the storefront web app. - ## Step 2: Start the app -Now, start the app by using the following command. Make sure that the engine runs that you set the `UNCHAINED_ENDPOINT` environment variable to. +Start the app and ensure the engine runs by setting the `UNCHAINED_ENDPOINT` environment variable. ```bash npm run dev ``` -Open [localhost:3000](http://localhost:3000) to check your storefront webapp is running correctly. - -And that's it! - -Your Unchained E-Commerce environment is fully setup and running locally. +Open [localhost:3000](http://localhost:3000) to check your storefront web app is running correctly. -## (Connect to a remote test Unchained Engine) +## Connect to a remote test Unchained Engine -Currently the store is empty since you haven't added any product so far. With a little update of our `.env` settings we can change that by connecting to Unchained's remote test engine which contains some prefilled product data. +To see prefilled product data, update the `.env` settings to connect to Unchained's remote test engine. - Stop the app: `ctrl+c` -- Open the file in the _my-storefront-webapp_ - Update the endpoint in the `.env` file to: `UNCHAINED_ENDPOINT=https://engine.swag.unchained.shop/graphql` - Restart the app: @@ -90,6 +77,6 @@ Currently the store is empty since you haven't added any product so far. With a npm run dev ``` -- Open `localhost:3000` again to see some swaggy products popping up in your store. 😎 +Open [localhost:3000](http://localhost:3000) to see the products in your store. ![diagram](../assets/Storefront-Swag-Startscreen.png) \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index e75487a485..ac4a71a257 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -83,15 +83,6 @@ const config = { schema: 'http://localhost:4010/graphql', }, ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'platform', - entryPoints: ['../packages/platform/src/platform-index.ts'], - tsconfig: '../packages/platform/tsconfig.json', - out: 'docs/types/platform', - }, - ], ], themeConfig: @@ -103,6 +94,7 @@ const config = { disableSwitch: true, defaultMode: 'light', }, + navbar: { title: 'Unchained Engine', logo: { @@ -116,6 +108,11 @@ const config = { position: 'left', label: 'Docs', }, + { + position: 'left', + label: 'Types', + href: '/types/index.html', + }, { href: 'https://github.com/unchainedshop/unchained', label: 'GitHub', diff --git a/package-lock.json b/package-lock.json index 53da1466c1..2818c6e5ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,7 @@ "npm-run-all": "^4.1.5", "prettier": "^3.4.2", "ts-jest": "^29.2.5", + "typedoc": "^0.27.6", "typescript": "^5.7.2", "workspaces-run": "^1.0.2" }, @@ -2001,6 +2002,18 @@ "safe-stable-stringify": "^2.4.3" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.26.1.tgz", + "integrity": "sha512-gHFUvv9f1fU2Piou/5Y7Sx5moYxcERbC7CXc6rkDLQTUBg5Dgg9L4u29/nHqfoQ3Y9R0h0BcOhd14uOEZIBP7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^1.26.1", + "@shikijs/types": "^1.26.1", + "@shikijs/vscode-textmate": "^10.0.1" + } + }, "node_modules/@graphql-tools/executor": { "version": "1.3.11", "resolved": "https://registry.npmjs.org/@graphql-tools/executor/-/executor-1.3.11.tgz", @@ -3583,6 +3596,35 @@ "node": ">=12" } }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.26.1.tgz", + "integrity": "sha512-F5XuxN1HljLuvfXv7d+mlTkV7XukC1cawdtOo+7pKgPD83CAB1Sf8uHqP3PK0u7njFH0ZhoXE1r+0JzEgAQ+kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.26.1", + "@shikijs/vscode-textmate": "^10.0.1" + } + }, + "node_modules/@shikijs/types": { + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.26.1.tgz", + "integrity": "sha512-d4B00TKKAMaHuFYgRf3L0gwtvqpW4hVdVwKcZYbBfAAQXspgkbWqnFfuFl3MDH6gLbsubOcr+prcnsqah3ny7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.1", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", + "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", + "dev": true, + "license": "MIT" + }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", @@ -4415,6 +4457,16 @@ "@types/node": "*" } }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -4597,6 +4649,13 @@ "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", "license": "MIT" }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", @@ -7334,6 +7393,19 @@ "node": ">= 0.8" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -11589,6 +11661,16 @@ "dev": true, "license": "MIT" }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -11752,6 +11834,13 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, + "license": "MIT" + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -11833,6 +11922,24 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -11853,6 +11960,13 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "license": "MIT" + }, "node_modules/media-typer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", @@ -16184,6 +16298,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typedoc": { + "version": "0.27.6", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", + "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "yaml": "^2.6.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + } + }, "node_modules/typeforce": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", @@ -16212,6 +16349,13 @@ "function.name": "^1.0.3" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, "node_modules/uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", @@ -17086,6 +17230,19 @@ "dev": true, "license": "ISC" }, + "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 42cd774d0a..9bf4eab8bd 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "examples/keycloak" ], "scripts": { + "typedoc": "typedoc --entryPointStrategy packages ./packages/* --out ./typedocs && mv ./typedocs ./docs/static/types", "lint": "eslint packages tests --fix --ext=js --ext=ts", "pretest": "npm run lint --silent", "lint:ci": "eslint packages tests --ext=jsx --ext=js", @@ -95,6 +96,7 @@ "npm-run-all": "^4.1.5", "prettier": "^3.4.2", "ts-jest": "^29.2.5", + "typedoc": "^0.27.6", "typescript": "^5.7.2", "workspaces-run": "^1.0.2" },