Skip to content

Opt-in support for including templates/*/node_modules in lessons #201

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

Open
AriPerkkio opened this issue Aug 1, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@AriPerkkio
Copy link
Member

AriPerkkio commented Aug 1, 2024

Is your feature request related to a problem?

In #198 we hard-coded node_modules to be excluded from templates. However in some cases users might want to have pre-optimized node_modules available in lessons. This featue should be opt-in, as most users will likely not need it and configuring such modules can be tricky.

Describe the solution you'd like.

Not yet sure which way would be better:

  1. Define ignore patterns in templates:
---
type: lesson
template:
  name: default
  ignoredFiles: ["utils/**.js", "node_modules"]
---
---
type: lesson
template:
  name: default
  ignoredFiles: [] # Don't ignore any files, e.g. node_modules
---

However this can be tricky as <template-name>.template.json files are built in advance, before metadata is parsed.

  1. Define ignore patterns in .tk-config.json
{
  "extends": "../default",
  "ignoredFiles": []
}

This would work well for <template-name>.template.json files too, but now exclusion is on template-level and cannot be defined per-lesson/part/chapter.

@AriPerkkio AriPerkkio added the enhancement New feature or request label Aug 1, 2024
@Nemikolh
Copy link
Member

Nemikolh commented Aug 1, 2024

I like the idea of defining the pattern in the config file a lot because it is more intuitive with inheritance and this seems to be a property of the template as opposed to be a configuration option of the part / chapter / lesson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants