Download chakra-ui/scripts/play.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 775 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/scripts/play.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/scripts/play.ts
-
curl -L -o play.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/scripts/play.ts
775 Bytes
| import fg from "fast-glob" | |
| import { writeFileSync } from "fs" | |
| import path, { join } from "path" | |
| const files = fg.sync("packages/react/src/components/**", { | |
| onlyDirectories: true, | |
| }) | |
| const result: Record<string, any> = {} | |
| files.forEach((file) => { | |
| const baseName = path.basename(file) | |
| result[`./${baseName}`] = { | |
| source: "./" + join(".", "src", baseName, "index.ts"), | |
| import: { | |
| type: "./" + join(".", "dist", "types", baseName, "index.d.ts"), | |
| default: "./" + join(".", "dist", "esm", baseName, "index.js"), | |
| }, | |
| require: { | |
| types: "./" + join(".", "dist", "types", baseName, "index.d.ts"), | |
| default: "./" + join(".", "dist", "cjs", baseName, "index.cjs"), | |
| }, | |
| } | |
| }) | |
| writeFileSync("play.json", JSON.stringify(result), "utf-8") | |