From 1b023fd8c7382d840a734ce8f7606c954387b1a7 Mon Sep 17 00:00:00 2001 From: Mike North Date: Sat, 1 Sep 2018 16:44:00 -0700 Subject: [PATCH] feat: practice platforms --- src/data/categories.ts | 41 ++++++++++++++++--- src/data/categories/javascript.ts | 16 ++++---- src/data/resource.ts | 24 +++++++---- src/data/sites/bootcamps.ts | 7 ++++ src/data/sites/bootcamps/codeacademy.ts | 21 ++++++++++ src/data/sites/bootcamps/free-code-camp.ts | 14 +++++++ src/data/sites/bootcamps/khan-academy.ts | 14 +++++++ src/data/sites/bootcamps/node-school.ts | 14 +++++++ src/data/sites/bootcamps/odin-project.ts | 14 +++++++ src/data/sites/games.ts | 4 -- src/data/sites/games/branching-game.ts | 2 +- src/data/sites/games/git-game.ts | 2 +- src/data/sites/playgrounds.ts | 5 ++- src/data/sites/practice-platforms.ts | 6 +++ .../code-wars.ts | 0 .../cyber-dojo.ts | 1 + src/data/sites/practice-platforms/edabit.ts | 25 +++++++++++ src/data/sites/practice-platforms/tech-io.ts | 33 +++++++++++++++ src/format/category.ts | 2 +- src/format/site.ts | 12 ++++-- 20 files changed, 223 insertions(+), 34 deletions(-) create mode 100644 src/data/sites/bootcamps.ts create mode 100644 src/data/sites/bootcamps/codeacademy.ts create mode 100644 src/data/sites/bootcamps/free-code-camp.ts create mode 100644 src/data/sites/bootcamps/khan-academy.ts create mode 100644 src/data/sites/bootcamps/node-school.ts create mode 100644 src/data/sites/bootcamps/odin-project.ts create mode 100644 src/data/sites/practice-platforms.ts rename src/data/sites/{games => practice-platforms}/code-wars.ts (100%) rename src/data/sites/{games => practice-platforms}/cyber-dojo.ts (97%) create mode 100644 src/data/sites/practice-platforms/edabit.ts create mode 100644 src/data/sites/practice-platforms/tech-io.ts diff --git a/src/data/categories.ts b/src/data/categories.ts index ebbb413..84e4d82 100644 --- a/src/data/categories.ts +++ b/src/data/categories.ts @@ -3,12 +3,41 @@ import ALL_TOOLS_WITH_ID from './categories/tools-and-editors'; import { Resource } from './resource'; // @ts-check -const ALL_CATEGORIES: Resource.Categories = { +const ALL_CATEGORIES = { + playground: { + description: 'Web-based tools for running code right in a web browser', + id: 'playground', + name: 'Playgrounds', + order: 9, + }, + bootcamp: { + description: + 'Curated and structured education that leads to leveling up your skills through exercises, projects and quizzes', + id: 'bootcamp', + name: 'Learning platforms and bootcamps', + order: 1, + url: 'https://en.wikipedia.org/wiki/Coding_bootcamp', + }, + practicePlatform: { + description: + "Collections of exercises to help you sharpen your skills and learn at your own pace. Good for practice once you've mastered the basics", + id: 'practicePlatform', + name: 'Practice Platform', + order: 1.2, + }, + dataScience: { + description: + 'The scientific methods, processes, algorithms and systems used to extract knowledge and insights from data', + id: 'dataScience', + name: 'Data Science', + order: 2, + url: 'https://en.wikipedia.org/wiki/Data_science', + }, generalProgramming: { description: 'General computer programming skills & techniques', id: 'generalProgramming', name: 'General Programming', - order: 1, + order: 3, url: 'https://en.wikipedia.org/wiki/Computer_programming', }, languages: { @@ -16,7 +45,7 @@ const ALL_CATEGORIES: Resource.Categories = { description: 'Programming languages', id: 'languages', name: 'Languages', - order: 3, + order: 5, url: 'https://en.wikipedia.org/wiki/Programming_languages', }, toolsAndEditors: { @@ -24,9 +53,11 @@ const ALL_CATEGORIES: Resource.Categories = { description: 'Build tools, text editors, IDEs and more', id: 'toolsAndEditors', name: 'Tools & Editors', - order: 2, + order: 4, url: 'https://en.wikipedia.org/wiki/Programming_tool', }, }; -export default ALL_CATEGORIES; +export type TopLevelCategoryName = keyof typeof ALL_CATEGORIES; + +export default ALL_CATEGORIES as Resource.Categories; diff --git a/src/data/categories/javascript.ts b/src/data/categories/javascript.ts index 7156b5c..4299583 100644 --- a/src/data/categories/javascript.ts +++ b/src/data/categories/javascript.ts @@ -2,6 +2,12 @@ import { Resource } from '../resource'; import ALL_WEB_FRAMEWORKS_WITH_ID from './client-web-frameworks'; const ALL_JS_TOPICS = { + node: { + description: "Run JavaScript in a places other than a web browser, using Chrome's V8 engine", + id: 'node', + name: 'Node.js', + url: 'https://nodejs.org/', + }, clientWebFrameworks: { children: ALL_WEB_FRAMEWORKS_WITH_ID, description: 'Frameworks for building web applications that run in the browser', @@ -29,13 +35,5 @@ export default { id: 'javascript', name: 'JavaScript', url: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript', - children: { - clientWebFrameworks: { - children: ALL_WEB_FRAMEWORKS_WITH_ID, - description: 'Frameworks for building web applications that run in the browser', - id: 'clientWebFrameworks', - name: 'Client Web Frameworks', - url: 'https://en.wikipedia.org/wiki/Web_framework', - }, - }, + children: ALL_JS_TOPICS, }; diff --git a/src/data/resource.ts b/src/data/resource.ts index 952578d..3a346f2 100644 --- a/src/data/resource.ts +++ b/src/data/resource.ts @@ -1,22 +1,22 @@ // @ts-check -import ALL_CATEGORIES from './categories'; +import ALL_CATEGORIES, { TopLevelCategoryName } from './categories'; import { ProgrammingLanguage } from './categories/languages'; import { pipe } from '../utils'; import { ClientWebFramework } from './categories/client-web-frameworks'; import { JSTopic } from './categories/javascript'; import { ToolName } from './categories/tools-and-editors'; +import allBootcamps from './sites/bootcamps'; import allGames from './sites/games'; import allPlaygrounds from './sites/playgrounds'; +import allPracticePlatforms from './sites/practice-platforms'; import allVideoCourses from './sites/video-course'; export interface Resource { id: string; platforms: Resource.Platform[]; categoryIds: Array< - | ['toolsAndEditors'] - | ['generalProgramming'] - | ['clientWebFrameworks'] + | [TopLevelCategoryName] | ['languages', ProgrammingLanguage] | ['toolsAndEditors', ToolName] | ['languages', 'javascript', JSTopic] @@ -26,7 +26,7 @@ export interface Resource { author?: Resource.Entity; authorOrg?: Resource.Entity; publisher?: Resource.Entity; - type: Resource.Type; + type: Resource.Type | Resource.Type[]; kidOriented?: boolean; description: string; url: string; @@ -55,15 +55,15 @@ export declare namespace Resource { type: Price.Type; frequency: Price.Frequency; } - type Type = 'game' | 'playground' | 'video-course'; + type Type = 'game' | 'playground' | 'video-course' | 'learning-platform'; type Platform = 'ios' | 'android' | 'web' | 'windows' | 'os x' | 'linux'; interface Category { id: ID; name: string; description?: string; - order?: number | string; + order?: number; img?: string; - url: string; + url?: string; } type Categories

= { [L in string]: Category & @@ -76,7 +76,13 @@ export declare namespace Resource { }; } -const ALL_SITES: Resource[] = [...allGames, ...allPlaygrounds, ...allVideoCourses]; +const ALL_SITES: Resource[] = [ + ...allGames, + ...allPlaygrounds, + ...allVideoCourses, + ...allBootcamps, + ...allPracticePlatforms, +]; function siteMap(sites: Resource[]): { [k: string]: Resource[] } { const m: { [k: string]: Resource[] } = {}; diff --git a/src/data/sites/bootcamps.ts b/src/data/sites/bootcamps.ts new file mode 100644 index 0000000..362deb1 --- /dev/null +++ b/src/data/sites/bootcamps.ts @@ -0,0 +1,7 @@ +import codeacademy from './bootcamps/codeacademy'; +import freecodecamp from './bootcamps/free-code-camp'; +import khan from './bootcamps/khan-academy'; +import nodeschool from './bootcamps/node-school'; +import odin from './bootcamps/odin-project'; + +export default [codeacademy, freecodecamp, odin, khan, nodeschool]; diff --git a/src/data/sites/bootcamps/codeacademy.ts b/src/data/sites/bootcamps/codeacademy.ts new file mode 100644 index 0000000..c0f39bc --- /dev/null +++ b/src/data/sites/bootcamps/codeacademy.ts @@ -0,0 +1,21 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [ + ['bootcamp'], + ['dataScience'], + ['languages', 'javascript'], + ['languages', 'python'], + ['languages', 'ruby'], + ['languages', 'java'], + ], + description: 'Free platform for online learning web technologies, computer programming and data science.', + id: 'codeacademy', + name: 'Codeacademy', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://www.codecademy.com/', +}; + +export default r; diff --git a/src/data/sites/bootcamps/free-code-camp.ts b/src/data/sites/bootcamps/free-code-camp.ts new file mode 100644 index 0000000..ce1e0a6 --- /dev/null +++ b/src/data/sites/bootcamps/free-code-camp.ts @@ -0,0 +1,14 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [['bootcamp'], ['languages', 'javascript']], + description: 'The king of free coding camps. Learn to code and help nonprofits. Extensive curriculum.', + id: 'freecodecamp', + name: 'Free Code Camp', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://www.freecodecamp.org/', +}; + +export default r; diff --git a/src/data/sites/bootcamps/khan-academy.ts b/src/data/sites/bootcamps/khan-academy.ts new file mode 100644 index 0000000..583b6e6 --- /dev/null +++ b/src/data/sites/bootcamps/khan-academy.ts @@ -0,0 +1,14 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [['bootcamp'], ['generalProgramming']], + description: 'Learn anything for free, forever.', + id: 'khan-academy', + name: 'Khan Academy', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://www.khanacademy.org/', +}; + +export default r; diff --git a/src/data/sites/bootcamps/node-school.ts b/src/data/sites/bootcamps/node-school.ts new file mode 100644 index 0000000..824e1a3 --- /dev/null +++ b/src/data/sites/bootcamps/node-school.ts @@ -0,0 +1,14 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [['bootcamp'], ['languages', 'javascript', 'node']], + description: 'Open source workshops that teach web software skills. Do them on your own or at a workshop nearby.', + id: 'nodeschool', + name: 'Node School', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://nodeschool.io/', +}; + +export default r; diff --git a/src/data/sites/bootcamps/odin-project.ts b/src/data/sites/bootcamps/odin-project.ts new file mode 100644 index 0000000..8546415 --- /dev/null +++ b/src/data/sites/bootcamps/odin-project.ts @@ -0,0 +1,14 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [['bootcamp'], ['languages', 'ruby'], ['languages', 'javascript']], + description: 'A full stack (and open source) Ruby/JS bootcamp', + id: 'odin-project', + name: 'The Odin Project', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://www.theodinproject.com/', +}; + +export default r; diff --git a/src/data/sites/games.ts b/src/data/sites/games.ts index e73e260..9353514 100644 --- a/src/data/sites/games.ts +++ b/src/data/sites/games.ts @@ -3,10 +3,8 @@ import checkIO from './games/check-io'; import codeCombat from './games/code-combat'; import codeHunt from './games/code-hunt'; import codeMonkey from './games/code-monkey'; -import codeWars from './games/code-wars'; import codingGame from './games/codin-game'; import cssDiner from './games/css-diner'; -import cyberDojo from './games/cyber-dojo'; import flexboxDefense from './games/flexbox-defense'; import flexboxFrogger from './games/flexbox-frogger'; import gitGame from './games/git-game'; @@ -27,10 +25,8 @@ export default [ codeCombat, codeHunt, codeMonkey, - codeWars, codingGame, cssDiner, - cyberDojo, flexboxDefense, flexboxFrogger, gitGame, diff --git a/src/data/sites/games/branching-game.ts b/src/data/sites/games/branching-game.ts index ed19fb3..f9e7f2c 100644 --- a/src/data/sites/games/branching-game.ts +++ b/src/data/sites/games/branching-game.ts @@ -1,7 +1,7 @@ import { Resource } from '../../resource'; const learnGitBranching: Resource = { - categoryIds: [['toolsAndEditors']], + categoryIds: [['toolsAndEditors', 'git']], description: '"The most visual and interactive way to learn Git on the web"', id: 'learnGitBranching', name: 'Learn Git Branching', diff --git a/src/data/sites/games/git-game.ts b/src/data/sites/games/git-game.ts index e5fe613..5ce5543 100644 --- a/src/data/sites/games/git-game.ts +++ b/src/data/sites/games/git-game.ts @@ -1,7 +1,7 @@ import { Resource } from '../../resource'; const gitGames: Resource = { - categoryIds: [['toolsAndEditors']], + categoryIds: [['toolsAndEditors', 'git']], description: 'A terminal based game that teaches both new and advances users some pretty cool features of the git scm (source control management) system', id: 'gitGames', diff --git a/src/data/sites/playgrounds.ts b/src/data/sites/playgrounds.ts index 2ba6423..ecf8e5b 100644 --- a/src/data/sites/playgrounds.ts +++ b/src/data/sites/playgrounds.ts @@ -30,4 +30,7 @@ export default [ stackblitz, codepen, codeSandbox, -]; +].map(cat => { + cat.categoryIds.push(['playground']); + return cat; +}); diff --git a/src/data/sites/practice-platforms.ts b/src/data/sites/practice-platforms.ts new file mode 100644 index 0000000..34c81b6 --- /dev/null +++ b/src/data/sites/practice-platforms.ts @@ -0,0 +1,6 @@ +import codeWars from './practice-platforms/code-wars'; +import cyberDojo from './practice-platforms/cyber-dojo'; +import edabit from './practice-platforms/edabit'; +import techio from './practice-platforms/tech-io'; + +export default [edabit, techio, codeWars, cyberDojo]; diff --git a/src/data/sites/games/code-wars.ts b/src/data/sites/practice-platforms/code-wars.ts similarity index 100% rename from src/data/sites/games/code-wars.ts rename to src/data/sites/practice-platforms/code-wars.ts diff --git a/src/data/sites/games/cyber-dojo.ts b/src/data/sites/practice-platforms/cyber-dojo.ts similarity index 97% rename from src/data/sites/games/cyber-dojo.ts rename to src/data/sites/practice-platforms/cyber-dojo.ts index f97fd32..c924c35 100644 --- a/src/data/sites/games/cyber-dojo.ts +++ b/src/data/sites/practice-platforms/cyber-dojo.ts @@ -2,6 +2,7 @@ import { Resource } from '../../resource'; const cyberDojo: Resource = { categoryIds: [ + ['practicePlatform'], ['languages', 'bash'], ['languages', 'c'], ['languages', 'cSharp'], diff --git a/src/data/sites/practice-platforms/edabit.ts b/src/data/sites/practice-platforms/edabit.ts new file mode 100644 index 0000000..4b883b7 --- /dev/null +++ b/src/data/sites/practice-platforms/edabit.ts @@ -0,0 +1,25 @@ +import { Resource } from '../../resource'; + +const r: Resource = { + categoryIds: [ + ['practicePlatform'], + ['languages', 'javascript'], + ['languages', 'python'], + ['languages', 'ruby'], + ['languages', 'java'], + ['languages', 'swift'], + ['languages', 'php'], + ['languages', 'cSharp'], + ['languages', 'c++'], + ], + description: + 'Work through a wide array of bite-sized programming challenges, that increase in difficulty as you progress', + id: 'edabit', + name: 'Edabit', + platforms: ['web'], + price: 0, + type: 'learning-platform', + url: 'https://edabit.com/', +}; + +export default r; diff --git a/src/data/sites/practice-platforms/tech-io.ts b/src/data/sites/practice-platforms/tech-io.ts new file mode 100644 index 0000000..e5d3401 --- /dev/null +++ b/src/data/sites/practice-platforms/tech-io.ts @@ -0,0 +1,33 @@ +import { Resource } from '../../resource'; + +const techio: Resource = { + categoryIds: [ + ['practicePlatform'], + ['languages', 'bash'], + ['languages', 'cSharp'], + ['languages', 'c++'], + ['languages', 'css'], + ['languages', 'elixir'], + ['languages', 'go'], + ['languages', 'groovy'], + ['languages', 'haskell'], + ['languages', 'java'], + ['languages', 'javascript'], + ['languages', 'kotlin'], + ['languages', 'php'], + ['languages', 'python'], + ['languages', 'ruby'], + ['languages', 'rust'], + ['languages', 'scala'], + ['languages', 'swift'], + ], + description: 'Design, share, and learn from community-sourced tutorials quizzes and interactive exercises', + id: 'techio', + name: 'TechIO', + platforms: ['web'], + price: 0, + type: ['playground', 'learning-platform'], + url: 'https://tech.io/', +}; + +export default techio; diff --git a/src/format/category.ts b/src/format/category.ts index 51ece6c..4e41179 100644 --- a/src/format/category.ts +++ b/src/format/category.ts @@ -2,7 +2,7 @@ import { Resource } from '../data/resource'; import { mdHeader } from './utils'; export const mdCategory = (cat: Resource.Category, level: number): string => { - const parts = [mdHeader(`[${cat.name}](${cat.url})`, level)]; + const parts = [mdHeader(cat.url ? `[${cat.name}](${cat.url})` : cat.name, level)]; if (cat.description) { parts.push('\n', '\n', cat.description); } diff --git a/src/format/site.ts b/src/format/site.ts index dcc153f..6051d16 100644 --- a/src/format/site.ts +++ b/src/format/site.ts @@ -28,15 +28,21 @@ const mdSiteIcons = (site: Resource): string => { if (site.platforms.indexOf('ios') >= 0 || site.platforms.indexOf('android') >= 0) { icons.push('📱'); } - if (site.type === 'game') { + if (site.type === 'game' || (site.type instanceof Array && site.type.indexOf('game') >= 0)) { icons.push('🎮'); } - if (site.type === 'playground') { + if (site.type === 'playground' || (site.type instanceof Array && site.type.indexOf('playground') >= 0)) { icons.push('🏗'); } - if (site.type === 'video-course') { + if (site.type === 'video-course' || (site.type instanceof Array && site.type.indexOf('video-course') >= 0)) { icons.push('📼'); } + if ( + site.type === 'learning-platform' || + (site.type instanceof Array && site.type.indexOf('learning-platform') >= 0) + ) { + icons.push('🎓'); + } if (icons.length === 0) { return ''; }