diff --git a/packages/round/src/config.ts b/packages/round/src/config.ts new file mode 100644 index 00000000..43317fa6 --- /dev/null +++ b/packages/round/src/config.ts @@ -0,0 +1,27 @@ +import { resolve } from "path"; +import { readdirSync } from "fs"; + +const rawSvgsDir = resolve("./src/svg"); +const staticCursorsDir = resolve(rawSvgsDir, "static"); +const animatedCursorsDir = resolve(rawSvgsDir, "animated"); + +const staticCursors = readdirSync(staticCursorsDir).map((f) => + resolve(staticCursorsDir, f) +); + +const animatedCursors = readdirSync(animatedCursorsDir).map((f) => + resolve(animatedCursorsDir, f) +); + +const schemesPath = resolve("schemes"); +const projectRoot = resolve("../../"); +const bitmapsPath = resolve(projectRoot, "bitmaps"); + +export { + rawSvgsDir, + schemesPath, + projectRoot, + bitmapsPath, + staticCursors, + animatedCursors +}; diff --git a/packages/round/src/index.ts b/packages/round/src/index.ts index 9bb16f36..3aa4acc4 100644 --- a/packages/round/src/index.ts +++ b/packages/round/src/index.ts @@ -3,7 +3,7 @@ import { renderCursors, spinner } from "common"; import { generateConfigs } from "./utils/schema"; import { colorSchemes } from "./color"; -import { bitmapsPath } from "./paths"; +import { bitmapsPath } from "./config"; const main = async () => { const prefix = "Bibata-Round"; diff --git a/packages/round/src/paths.ts b/packages/round/src/paths.ts deleted file mode 100644 index 3da23fb5..00000000 --- a/packages/round/src/paths.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { resolve } from "path"; - -const rawSvgsDir = resolve("svg"); - -const schemesPath = resolve("schemes"); -const projectRoot = resolve("../../"); -const bitmapsPath = resolve(projectRoot, "bitmaps"); - -export { rawSvgsDir, schemesPath, projectRoot, bitmapsPath }; diff --git a/packages/round/src/utils/schema.ts b/packages/round/src/utils/schema.ts index 9df969e5..c958bac7 100644 --- a/packages/round/src/utils/schema.ts +++ b/packages/round/src/utils/schema.ts @@ -3,7 +3,7 @@ import path from "path"; import { staticCursors, animatedCursors } from "../cursors.json"; import { baseKeyColor, outlineKeyColor, watchKeyColor } from "../color"; -import { rawSvgsDir, schemesPath, bitmapsPath } from "../paths"; +import { rawSvgsDir, schemesPath, bitmapsPath } from "../config"; import { ColorSchema, Config } from "../types"; // --------------------------------------- Generate Configs ðŸ›