diff --git a/.env b/.env index 2460154..ddcd1e5 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ +RADAR_NAME=AOE Technology Radar PUBLIC_URL=/techradar \ No newline at end of file diff --git a/README.md b/README.md index 0b05aa7..4c5cf4d 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ # AOE Technology Radar - A static site generator for AOE Technology Radar ## Looking for the AOE Tech Radar content? - The repository is now found here: https://github.com/AOEpeople/techradar The AOE Tech radar is deployed here: https://www.aoe.com/techradar/index.html ## Usage for your own radar? - The generator is free to use under Open Source License - in fact there are already some other Radars published based on our Radar and there are also Contributions back. (There is a list of planned features below in case someone wants to contribute :-) @@ -18,7 +15,6 @@ However, please be aware: * Also, when you want to reuse the CSS and Styling: Change the font (it is a licensed font) and the colors (It using AOE CI) ## Use and build - Add the tech radar as a dependency ``` yarn add https://github.com/aoepeople/aoe_technology_radar.git @@ -43,10 +39,9 @@ python3 -m http.server 8080 Then open here: http://localhost:8080 ## Run a prepared static version +In most cases you have the tech radar available at `/techradar`, and for reasons want all correct pages to be accessible. -In most cases you have the techradar available at `/techradar`, and for reasons want all correct pages to be accessible. - -Until this setup improves, you can use the following way to generate the correct techradar: +Until this setup improves, you can use the following way to generate the correct tech radar: ``` yarn aoe_technology_radar-generateJson @@ -57,14 +52,32 @@ cp -r build techradar (This is rather workaroundish for now, but does the job.) -## Usage +## Customize the tech radar +You can customize the following parts of the tech radar. +### Change title, description and headline +Set the environment variable `RADAR_NAME`. The default is "AOE Technology Radar". + +### Host the application under a sub path +To host the application under a sub path, set the environment variable `PUBLIC_URL`, e.g. "/techradar". + +### Change the favicon +To change the favicon, create a public folder in your application and put your favicon.ico in it. + +### Change the logo +To change the logo, create a public folder in your application and put your logo.svg in it. +For reference have a look at [public/logo.svg](./public/logo.svg). + +### Change the index.html +To change the index.html, create a public folder in your application and put your index.html in it. +For reference have a look at [public/index.html](./public/index.html). + +## Usage For a new Technology Radar release, create a folder of the release date (YYYY-MM-DD) under `/radar`. In each release folder create a folder for every quadrant and place the items there. ### Maintaining items - The items are written in Markdown format (.md) Each file has a [front-matter](https://github.com/jxson/front-matter) header @@ -97,24 +110,12 @@ the same name from older releases. If an item is overwritten in a new release, the attributes from the new item are merged with the old ones, and a new history entry is created for that item. -## Open points +You can integrate images in your markdown. Put the image files in your public folder and reference them +``` +![nice image](/images/nice-image.png) +``` -* dotenv necessary? -> Could be necessary for other companies -* measure file sizes necessary? -> no -* check browsers necessary? -> no -* copy public folder necessary? -> no -* specific webpack configurations necessary? -> no - -## TODOs - -* add dist folder for precompiled builder -* add default envs to .env file -** add envs to readme -* Check package.json scripts -* Add documentation for build dist_scripts folder -* prettier on all files -* check lint staged and prettier -* Rename package to make more clear that this is a tech radar builder? -* provide only one bin script with subcommands like react-scripts? -* add tests for scripts -* add tests for components \ No newline at end of file +## Development +### Change scripts +If you change one of the scripts in the scripts' folder, you have to compile them to JavaScript. +Therefore, run `yarn build:scripts` and commit the results in dist_scripts. diff --git a/dist_scripts/scripts/buildRadar.js b/dist_scripts/scripts/buildRadar.js index 66fc3e3..a683a9d 100644 --- a/dist_scripts/scripts/buildRadar.js +++ b/dist_scripts/scripts/buildRadar.js @@ -63,6 +63,7 @@ var buildTemplate = function () { if (fs.existsSync(paths.appRdJson)) { buildTemplate().then(function () { fs.copySync(paths.templateBuild, paths.appBuild); + fs.copySync(paths.appPublic, paths.appBuild); console.log(paths.appBuild + " was created and can be deployed."); }); } diff --git a/dist_scripts/scripts/paths.js b/dist_scripts/scripts/paths.js index c2b151f..1bca0fc 100644 --- a/dist_scripts/scripts/paths.js +++ b/dist_scripts/scripts/paths.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.appYarnLock = exports.appBuild = exports.appRdJson = exports.templateBuild = exports.template = exports.radarJson = void 0; +exports.appYarnLock = exports.appPublic = exports.appBuild = exports.appRdJson = exports.templateBuild = exports.template = exports.radarJson = void 0; var path_1 = require("path"); var fs_1 = require("fs"); exports.radarJson = "rd.json"; @@ -12,10 +12,11 @@ var resolveApp = function (relativePath) { var templateDirectory = fs_1.realpathSync(__dirname); var resolveTemplate = function (relativePath) { if (relativePath === void 0) { relativePath = ""; } - return path_1.resolve(templateDirectory, "..", relativePath); + return path_1.resolve(templateDirectory, "../..", relativePath); }; exports.template = resolveTemplate(); exports.templateBuild = resolveTemplate("build"); exports.appRdJson = resolveApp("build/" + exports.radarJson); exports.appBuild = resolveApp("build"); +exports.appPublic = resolveApp("public"); exports.appYarnLock = resolveApp("yarn.lock"); diff --git a/package.json b/package.json index 1354071..c40c5e2 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,11 @@ }, "scripts": { "prepare": "husky install && yarn build:scripts", - "start": "react-scripts start", "build": "react-scripts build", "build:scripts": "tsc --project tsconfig.scripts.json", "test": "react-scripts test", "ts:check": "tsc --noEmit", - "lint": "yarn ts:check", - "eject": "react-scripts eject" + "lint": "yarn ts:check" }, "dependencies": { "classnames": "^2.3.1", diff --git a/public/images/microservices-pyramid.png b/public/images/microservices-pyramid.png deleted file mode 100644 index 3503f7f..0000000 Binary files a/public/images/microservices-pyramid.png and /dev/null differ diff --git a/public/images/strategic-domain-driven-design-relationships.png b/public/images/strategic-domain-driven-design-relationships.png deleted file mode 100644 index 8a280ca..0000000 Binary files a/public/images/strategic-domain-driven-design-relationships.png and /dev/null differ diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/scripts/buildRadar.ts b/scripts/buildRadar.ts index ee7d90f..c05418f 100644 --- a/scripts/buildRadar.ts +++ b/scripts/buildRadar.ts @@ -50,6 +50,7 @@ const buildTemplate = () => { if (fs.existsSync(paths.appRdJson)) { buildTemplate().then(() => { fs.copySync(paths.templateBuild, paths.appBuild); + fs.copySync(paths.appPublic, paths.appBuild); console.log(`${paths.appBuild} was created and can be deployed.`); }); } else { diff --git a/scripts/paths.ts b/scripts/paths.ts index eaea8e2..df62f2f 100644 --- a/scripts/paths.ts +++ b/scripts/paths.ts @@ -6,10 +6,11 @@ const appDirectory = realpathSync(process.cwd()); const resolveApp = (relativePath = "") => resolve(appDirectory, relativePath); const templateDirectory = realpathSync(__dirname); const resolveTemplate = (relativePath = "") => - resolve(templateDirectory, "..", relativePath); + resolve(templateDirectory, "../..", relativePath); export const template = resolveTemplate(); export const templateBuild = resolveTemplate("build"); export const appRdJson = resolveApp(`build/${radarJson}`); export const appBuild = resolveApp("build"); +export const appPublic = resolveApp("public"); export const appYarnLock = resolveApp("yarn.lock");