diff --git a/bin/techradar.js b/bin/techradar.js index 8b814e2f..f9672ff7 100644 --- a/bin/techradar.js +++ b/bin/techradar.js @@ -53,7 +53,7 @@ function bootstrap() { "Could not find a config.json. Created a bootstrap config.json in your current working directory. Customize it to your needs.", ); fs.copyFileSync( - path.join(BUILDER_DIR, "data", "config.json"), + path.join(BUILDER_DIR, "data", "config.default.json"), path.join(CWD, "config.json"), ); } @@ -77,7 +77,7 @@ function calculateHash(file) { return hashSum.digest("hex"); } -const CURRENT_HASH = calculateHash(path.join(CWD, "package.json")); +const CURRENT_HASH = calculateHash(path.join(CWD, "package-lock.json")); // Check if builder dir needs to be recreated let RECREATE_DIR = false; diff --git a/data/config.default.json b/data/config.default.json new file mode 100644 index 00000000..8572ff9d --- /dev/null +++ b/data/config.default.json @@ -0,0 +1,129 @@ +{ + "basePath": "/techradar", + "editUrl": "https://github.dev/AOEpeople/techradar/blob/main/radar/{release}/{id}.md", + "colors": { + "foreground": "#fcf2e6", + "background": "#113521", + "highlight": "#d4a373", + "content": "#fff", + "text": "#575757", + "link": "#bc6c25", + "border": "rgba(255, 255, 255, 0.1)", + "tag": "rgba(255, 255, 255, 0.1)" + }, + "quadrants": [ + { + "id": "languages-and-frameworks", + "title": "Languages & Frameworks", + "description": "A selection of programming languages, alongside essential frameworks for building a variety of custom software.", + "color": "#a3b18a" + }, + { + "id": "methods-and-patterns", + "title": "Methods & Patterns", + "description": "Key software development methods and design patterns, covering everything from continuous integration and testing to architecture.", + "color": "#588157" + }, + { + "id": "platforms-and-operations", + "title": "Platforms & Operations", + "description": "Technologies and tools for software and infrastructure operations, including platforms and services for managing and scaling applications.", + "color": "#3f633e" + }, + { + "id": "tools", + "title": "Tools", + "description": "A range of software tools, from simple productivity enhancers to comprehensive project solutions, catering to various project needs.", + "color": "#40713f" + } + ], + "rings": [ + { + "id": "adopt", + "title": "Adopt", + "description": "", + "color": "#588157", + "radius": 0.5, + "strokeWidth": 5 + }, + { + "id": "trial", + "title": "Trial", + "description": "", + "color": "#457b9d", + "radius": 0.69, + "strokeWidth": 3 + }, + { + "id": "assess", + "title": "Assess", + "description": "", + "color": "#bc6c25", + "radius": 0.85, + "strokeWidth": 2 + }, + { + "id": "hold", + "title": "Hold", + "description": "", + "color": "#d62828", + "radius": 1, + "strokeWidth": 0.75 + } + ], + "flags": { + "new": { + "color": "#f1235a", + "title": "New", + "titleShort": "N", + "description": "New in this version" + }, + "changed": { + "color": "#40a7d1", + "title": "Changed", + "titleShort": "C", + "description": "Recently changed" + }, + "default": { + "description": "Unchanged" + } + }, + "chart": { + "size": 800, + "blipSize": 12 + }, + "social": [ + { + "href": "https://twitter.com/aoepeople", + "icon": "x" + }, + { + "href": "https://www.linkedin.com/company/aoe", + "icon": "linkedIn" + }, + { + "href": "https://www.xing.com/company/aoe", + "icon": "xing" + }, + { + "href": "https://github.com/aoepeople", + "icon": "github" + } + ], + "imprint": "https://www.aoe.com/en/imprint.html", + "labels": { + "title": "Technology Radar", + "imprint": "Legal Information", + "quadrant": "Quadrant", + "quadrantOverview": "Quadrant Overview", + "zoomIn": "Zoom in", + "filterByTag": "Filter by Tag", + "footer": "The technology radar is a project by AOE GmbH. Feel free to build your own radar based on the open source project.", + "notUpdated": "This item was not updated in last three versions of the Radar. Should it have appeared in one of the more recent editions, there is a good chance it remains pertinent. However, if the item dates back further, its relevance may have diminished and our current evaluation could vary. Regrettably, our capacity to consistently revisit items from past Radar editions is limited.", + "notFound": "404 - Page not found", + "pageAbout": "How to use AOE Technology Radar?", + "pageOverview": "Technologies Overview", + "pageSearch": "Search", + "searchPlaceholder": "What are you looking for?" + } +} diff --git a/data/config.json b/data/config.json index 8572ff9d..0967ef42 100644 --- a/data/config.json +++ b/data/config.json @@ -1,129 +1 @@ -{ - "basePath": "/techradar", - "editUrl": "https://github.dev/AOEpeople/techradar/blob/main/radar/{release}/{id}.md", - "colors": { - "foreground": "#fcf2e6", - "background": "#113521", - "highlight": "#d4a373", - "content": "#fff", - "text": "#575757", - "link": "#bc6c25", - "border": "rgba(255, 255, 255, 0.1)", - "tag": "rgba(255, 255, 255, 0.1)" - }, - "quadrants": [ - { - "id": "languages-and-frameworks", - "title": "Languages & Frameworks", - "description": "A selection of programming languages, alongside essential frameworks for building a variety of custom software.", - "color": "#a3b18a" - }, - { - "id": "methods-and-patterns", - "title": "Methods & Patterns", - "description": "Key software development methods and design patterns, covering everything from continuous integration and testing to architecture.", - "color": "#588157" - }, - { - "id": "platforms-and-operations", - "title": "Platforms & Operations", - "description": "Technologies and tools for software and infrastructure operations, including platforms and services for managing and scaling applications.", - "color": "#3f633e" - }, - { - "id": "tools", - "title": "Tools", - "description": "A range of software tools, from simple productivity enhancers to comprehensive project solutions, catering to various project needs.", - "color": "#40713f" - } - ], - "rings": [ - { - "id": "adopt", - "title": "Adopt", - "description": "", - "color": "#588157", - "radius": 0.5, - "strokeWidth": 5 - }, - { - "id": "trial", - "title": "Trial", - "description": "", - "color": "#457b9d", - "radius": 0.69, - "strokeWidth": 3 - }, - { - "id": "assess", - "title": "Assess", - "description": "", - "color": "#bc6c25", - "radius": 0.85, - "strokeWidth": 2 - }, - { - "id": "hold", - "title": "Hold", - "description": "", - "color": "#d62828", - "radius": 1, - "strokeWidth": 0.75 - } - ], - "flags": { - "new": { - "color": "#f1235a", - "title": "New", - "titleShort": "N", - "description": "New in this version" - }, - "changed": { - "color": "#40a7d1", - "title": "Changed", - "titleShort": "C", - "description": "Recently changed" - }, - "default": { - "description": "Unchanged" - } - }, - "chart": { - "size": 800, - "blipSize": 12 - }, - "social": [ - { - "href": "https://twitter.com/aoepeople", - "icon": "x" - }, - { - "href": "https://www.linkedin.com/company/aoe", - "icon": "linkedIn" - }, - { - "href": "https://www.xing.com/company/aoe", - "icon": "xing" - }, - { - "href": "https://github.com/aoepeople", - "icon": "github" - } - ], - "imprint": "https://www.aoe.com/en/imprint.html", - "labels": { - "title": "Technology Radar", - "imprint": "Legal Information", - "quadrant": "Quadrant", - "quadrantOverview": "Quadrant Overview", - "zoomIn": "Zoom in", - "filterByTag": "Filter by Tag", - "footer": "The technology radar is a project by AOE GmbH. Feel free to build your own radar based on the open source project.", - "notUpdated": "This item was not updated in last three versions of the Radar. Should it have appeared in one of the more recent editions, there is a good chance it remains pertinent. However, if the item dates back further, its relevance may have diminished and our current evaluation could vary. Regrettably, our capacity to consistently revisit items from past Radar editions is limited.", - "notFound": "404 - Page not found", - "pageAbout": "How to use AOE Technology Radar?", - "pageOverview": "Technologies Overview", - "pageSearch": "Search", - "searchPlaceholder": "What are you looking for?" - } -} +{} diff --git a/next.config.js b/next.config.js index ae7eeabe..9ce6bb61 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,3 @@ -// @ts-check - const config = require("./data/config.json"); const basePath = config.basePath && config.basePath !== "/" ? config.basePath : ""; diff --git a/scripts/buildData.ts b/scripts/buildData.ts index c2cd3063..3d052c8a 100644 --- a/scripts/buildData.ts +++ b/scripts/buildData.ts @@ -5,8 +5,8 @@ import { Marked } from "marked"; import { markedHighlight } from "marked-highlight"; import path from "path"; -import config from "../data/config.json"; import nextConfig from "../next.config.js"; +import config from "../src/lib/config"; import Positioner from "./positioner"; import { Flag, Item } from "@/lib/types"; diff --git a/src/lib/config.ts b/src/lib/config.ts new file mode 100644 index 00000000..838f245f --- /dev/null +++ b/src/lib/config.ts @@ -0,0 +1,12 @@ +import defaultConfig from "../../data/config.default.json"; +import _userConfig from "../../data/config.json"; + +const userConfig = _userConfig as typeof defaultConfig; +const config = { ...defaultConfig, ...userConfig }; + +if (userConfig.colors) + config.colors = { ...defaultConfig.colors, ...userConfig.colors }; + +if (userConfig.labels) + config.labels = { ...defaultConfig.labels, ...userConfig.labels }; +export default config; diff --git a/src/lib/data.ts b/src/lib/data.ts index c2cf232f..9cd63254 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -1,5 +1,5 @@ -import config from "../../data/config.json"; import data from "../../data/data.json"; +import config from "./config"; import { format } from "@/lib/format"; import { Flag, Item, Quadrant, Ring } from "@/lib/types";