From 6f5920d2e2262e60ce250a0a323018daabb5752f Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Mon, 31 Aug 2020 11:52:18 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=82=20Directory=20&=20Cursors=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/round/src/config.ts | 27 +++++++++++++++++++++++++++ packages/round/src/index.ts | 2 +- packages/round/src/paths.ts | 9 --------- packages/round/src/utils/schema.ts | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 packages/round/src/config.ts delete mode 100644 packages/round/src/paths.ts 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 ðŸ›