Skip to content

Commit

Permalink
feat(Project): Adds support for variant languages/optional and turnin…
Browse files Browse the repository at this point in the history
…g off learning objectives (#88)

* WIP-feat(Project): Adds support for variant learning objectives

* feat(Project): Adds support for multiple variants, creates new optionalLearningObjectives array in resulting JSON

* feat(Project): Doesn't include learningObjectves arrays in resulting JSON if they're empty

* feat(Project): Adds support for turning off learning objectives

* fix(Project): Fixes linting issues

* fix(tests): Corrects project.spec.js.snap snapshot

* fix(tests): Fixes condition for when there are no optional learning objectives present in a project

* feat(project): Adds support for optional learning objectives outside the variant object

* tests(project): Add tests for variant and optional learning objectives

* tests(project): Adds tests for variants/optional/turn off cases

* tests(project): Adds case to test one missing line lol

* feat(project): Simplifica lógica de parseado de OAs (WIP)

* feat(project): Excluye OAs duplicados de variantes

* test(project): Agrega prueba para validar comportamiento sugerido en comentarios de PR

Ver https://github.com/Laboratoria/curriculum-parser/pull/88/files#r1558205050

* feat(project): Agrega parseado de project.tags

---------

Co-authored-by: Lupo Montero <lupomontero@gmail.com>
  • Loading branch information
mfdebian and lupomontero authored May 22, 2024
1 parent acafb52 commit 26d16a0
Show file tree
Hide file tree
Showing 28 changed files with 1,081 additions and 90 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ program.command('project')
.argument('<dir>', 'path to project directory')
.option('--repo <string>', 'Repository')
.option('--version <string>', 'Project version')
.option('--lo <string>', 'Path to yml file with reference learning objectives')
.option(
'--lo <string>',
'Path to directory containing data.yml with reference learning objectives',
)
.option('--debug', 'Show error stack traces')
.action(createHandler(parseProject));

Expand Down
15 changes: 15 additions & 0 deletions lib/__tests__/__fixtures__/01-a-project-tags-not-array/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
track: web-dev
tracks:
- web-dev
tags: omg
learningObjectives:
- html
- css
- dom
15 changes: 15 additions & 0 deletions lib/__tests__/__fixtures__/01-a-project-tags-not-strings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
track: web-dev
tracks:
- web-dev
tags:
- featured
- foo: true
bar: 1
learningObjectives:
- html
- css
- dom
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- dom/selectors
- dom/events
- dom/manipulation
- js/data-types/primitive-vs-non-primitive
- js/data-types/strings
- js/variables
- js/conditionals
- js/functions
- js/semantics
- ux/user-understanding
- ux/prototyping
- id: css
exclude: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- name: react
optional: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
track: web-dev
tracks:
- web-dev
tags:
- featured
- foo
learningObjectives:
- html
- css
- dom
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- dom/selectors
- dom/events
- dom/manipulation
- js/data-types/primitive-vs-non-primitive
- js/data-types/strings
- js/variables
- js/conditionals
- js/functions
- js/semantics
- ux/user-understanding
- ux/prototyping
variants:
- name: foo
learningObjectives:
- id: css
exclude: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- dom/selectors
- dom/events
- dom/manipulation
- js/data-types/primitive-vs-non-primitive
- js/data-types/strings
- js/variables
- js/conditionals
- js/functions
- js/semantics
- ux/user-understanding
- ux/prototyping
variants:
- name: node
learningObjectives:
- node
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- dom/selectors
- dom/events
- dom/manipulation
- js/data-types/primitive-vs-non-primitive
- js/data-types/strings
- js/variables
- js/conditionals
- js/functions
- js/semantics
- ux/user-understanding
- ux/prototyping
- id: react
optional: true
15 changes: 15 additions & 0 deletions lib/__tests__/__fixtures__/01-a-project-with-tags/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
12 changes: 12 additions & 0 deletions lib/__tests__/__fixtures__/01-a-project-with-tags/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
track: web-dev
tracks:
- web-dev
tags:
- featured
- beta
- deprecated
- hidden
learningObjectives:
- html
- css
- dom
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- dom/selectors
- dom/events
- dom/manipulation
variants:
- name: node
learningObjectives:
- node
- id: dom/manipulation
exclude: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
track: web-dev
tracks:
- web-dev
learningObjectives:
- html/semantics
- css/selectors
- dom/selectors
- dom/events
- dom/manipulation
- js/data-types/primitive-vs-non-primitive
- js/data-types/strings
- js/variables
- js/conditionals
- js/functions
- js/semantics
- ux/user-understanding
- ux/prototyping
- id: react
optional: true
variants:
- name: node
learningObjectives:
- html/semantics
- node
- id: react
optional: true
- id: angular
optional: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A project

## Índice

Blah blah blah

***

## 1. Preámbulo

Blah blah blah

## 2. Resumen del proyecto

Blah blah blah
Loading

0 comments on commit 26d16a0

Please sign in to comment.