Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Project): Adds support for variant languages/optional and turning off learning objectives #88

Merged
merged 15 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
// Only print leaf nodes (erros may contain child errors)
if (!err.errors?.length) {
if (opts.debug) {
console.error(err);

Check warning on line 23 in index.js

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected console statement

Check warning on line 23 in index.js

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected console statement

Check warning on line 23 in index.js

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected console statement
} else {
console.error(err.message);

Check warning on line 25 in index.js

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected console statement

Check warning on line 25 in index.js

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected console statement

Check warning on line 25 in index.js

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected console statement
if (err.path) {
console.error(`└── ${err.path}`);

Check warning on line 27 in index.js

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected console statement

Check warning on line 27 in index.js

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected console statement

Check warning on line 27 in index.js

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected console statement
}
}
}
Expand All @@ -40,7 +40,7 @@
if (!result) {
return;
}
console.log(JSON.stringify(result, null, 2));

Check warning on line 43 in index.js

View workflow job for this annotation

GitHub Actions / test (16)

Unexpected console statement

Check warning on line 43 in index.js

View workflow job for this annotation

GitHub Actions / test (18)

Unexpected console statement

Check warning on line 43 in index.js

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected console statement
})
.catch((err) => {
printError(Object.assign(err, { path: err.path || dir }), opts);
Expand All @@ -54,7 +54,10 @@
.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
lupomontero marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading