diff --git a/.gitignore b/.gitignore index 76c2238..ab07899 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ # production /build +# local development +/public/rd.json + # misc .idea .DS_Store diff --git a/.husky/pre-commit b/.husky/pre-commit index 5a31180..4cac0e3 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn ts:check && yarn lint-staged +yarn ts:check && yarn lint-staged && yarn build:scripts diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..0429977 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,3 @@ +{ + "*.{json, md, yml, js, ts, tsx}": ["prettier --write"] +} diff --git a/README.md b/README.md index 53416cc..12b1a58 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,45 @@ # 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 :-) However, please be aware: -* It would be nice to mention in radar that the generator is based on this repository. -* 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) + +- It would be nice to mention in radar that the generator is based on this repository. +- 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 ``` Generate json file based on md files + ``` yarn aoe_technology_radar-generateJson ``` Build the radar + ``` yarn aoe_technology_radar-buildRadar ``` Serve + ``` cd build python3 -m http.server 8080 @@ -39,6 +48,7 @@ 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. Until this setup improves, you can use the following way to generate the correct tech radar: @@ -53,31 +63,39 @@ cp -r build techradar (This is rather workaroundish for now, but does the job.) ## Customize the tech radar + You can customize the following parts of the tech radar. ### Change title, description and headline + Set the environment variable `REACT_APP_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 @@ -95,13 +113,13 @@ Text goes here. You can use **markdown** here. Following front-matter attributes are possible: -* **title**: Name of the Item -* **quadrant**: Quadrant. One of `languages-and-frameworks`, +- **title**: Name of the Item +- **quadrant**: Quadrant. One of `languages-and-frameworks`, `methods-and-patterns`, `platforms-and-aoe-services`, `tools` -* **ring**: Ring section in radar. One of `trial`, `assess`, `adopt`, `hold` -* **info**: (optional) A short textual description of the item (visible in +- **ring**: Ring section in radar. One of `trial`, `assess`, `adopt`, `hold` +- **info**: (optional) A short textual description of the item (visible in overview pages) -* **featured**: (optional, default "true") If you set this to `false`, the item +- **featured**: (optional, default "true") If you set this to `false`, the item will not be visible in the radar quadrants but still be available in the overview. The name of the .md file acts as item identifier and may overwrite items with @@ -111,11 +129,23 @@ 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. You can integrate images in your markdown. Put the image files in your public folder and reference them + ```  ``` ## Development + +For local development you need a `rd.json` in the public folder. You can use `rd_example.json`. +Then simply start the dev server + +``` +yarn start +``` + ### 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. + +To make it more robust the script will be executed on commit. diff --git a/dist_scripts/src/model.js b/dist_scripts/src/model.js index da9f1c4..615bc4d 100644 --- a/dist_scripts/src/model.js +++ b/dist_scripts/src/model.js @@ -25,7 +25,6 @@ var nonFeaturedOnly = function (items) { return items.filter(function (item) { return !item.featured; }); }; exports.nonFeaturedOnly = nonFeaturedOnly; - var groupByQuadrants = function (items) { return items.reduce(function (quadrants, item) { var _a; @@ -59,5 +58,7 @@ var addItemToRing = function (ring, item) { if (ring === void 0) { ring = []; } return __spreadArray(__spreadArray([], ring), [item]); }; -var getFirstLetter = function (item) { return item.title.substr(0, 1).toUpperCase(); }; +var getFirstLetter = function (item) { + return item.title.substr(0, 1).toUpperCase(); +}; exports.getFirstLetter = getFirstLetter; diff --git a/public/index.html b/public/index.html index 7dfff6a..6831b00 100644 --- a/public/index.html +++ b/public/index.html @@ -10,13 +10,18 @@ - +