docs: migrate UI docs (#13245)

* docs: create a new UI docs project (#13233)

* docs: create a new UI docs project

* fix installation errors

* docs: migrate UI docs content to new project (#13241)

* Fix content

* added examples for some components

* finish adding examples

* lint fix

* fix build errors

* delete empty files

* path fixes + refactor

* fix build error
This commit is contained in:
Shahed Nasser
2025-08-20 11:42:25 +03:00
committed by GitHub
parent 5b7a041246
commit d1a1135328
748 changed files with 13079 additions and 7319 deletions
-29
View File
@@ -1,29 +0,0 @@
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable no-console */
const fs = require("fs")
const path = require("path")
const { execSync } = require("child_process")
// copy colors from the `@medusajs/ui-preset` package
// to `src/config/colors.ts`
const originalPath = path.join(
require.resolve("@medusajs/ui-preset"),
"../..",
"src/theme/tokens/colors.ts"
)
const newPath = path.join("src/config/colors.ts")
console.info(`Copying file from ${originalPath} to ${newPath}...`)
fs.copyFileSync(originalPath, newPath)
console.info(`File copied successfully`)
// fix possible eslint errors to avoid build errors
console.info("Running ESLint...")
execSync(`npx eslint ${newPath} --fix`)
console.info("Finished ESLint process")
+37
View File
@@ -0,0 +1,37 @@
/* eslint-disable no-console */
import { generateEditedDates, generateSidebar } from "build-scripts"
import { sidebar } from "../sidebar.mjs"
import path from "path"
import { copyFileSync } from "fs"
import { execSync } from "child_process"
import { fileURLToPath } from "url"
async function main() {
await generateSidebar(sidebar)
await generateEditedDates()
// copy colors from the `@medusajs/ui-preset` package
const resolvedURL = import.meta.resolve("@medusajs/ui-preset")
const resolvedPath = fileURLToPath(resolvedURL)
const originalPath = path.join(
resolvedPath,
"../..",
"src/theme/tokens/colors.ts"
)
const newPath = path.resolve("config", "colors.ts")
console.info(`Copying file from ${originalPath} to ${newPath}...`)
copyFileSync(originalPath, newPath)
console.info(`File copied successfully`)
// fix possible eslint errors to avoid build errors
console.info("Running ESLint...")
execSync(`npx eslint ${newPath} --fix`)
console.info("Finished ESLint process")
}
void main()