* 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
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
/* 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()
|