Skip to content

Build process fails when an exercise use a NodeJS module #182

Closed

Description

@rchavarria

A nice way to add dependencies to some exercises would be to add those to the package.json file.

If a new dependency is added, and an individual exercise uses that dependency in the specs file (i.e.: tests need to use an external library), running tests inside the exercise folder works. But the build process (make command) fails.

Find a way to use package.json dependencies in specs files when running the make command.

Activity

  1. stale commented on Apr 29, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. matthewmorgan commented on Apr 29, 2017

    @matthewmorgan
    Contributor

    I think we could address this by adding the dependency to the main package.json file and running npm install as part of the makefile.

  3. joeljuca commented on May 7, 2017

    @joeljuca
    SponsorContributor

    Is there any specific case that we would need specific packages for an exercise? I understand that students should have an easy way to test their solutions, but we solved a similar problem on exercism/xjavascript by using a global installation of Jasmine.

    Since Exercism is supposed to teach a programming language and not libraries, platforms and/or tools, why not use a simpler approach?

    Sorry, I just commented in the wrong issue 😕

  4. rchavarria commented on May 10, 2017

    @rchavarria
    ContributorAuthor

    I tried that with the old system (gulp-cli, babel and the like). I don't remember exactly what was the problem. It probably was too slow to run all the tests, because of npm install on each one.

    Or, during the build process with make, the working directory is not the same as the working dir when one works on a single exercise. I think I didn't dig deep in the build process with make.

    Probably now, with Jest as the test runner, there is no need for a transpilation step, and adding dependencies to package.json will work. But that has a drawback, a single dependency for just one exercise will be spread among all exercises.

    Maybe, this is an interesting issue to work. Any ideas?

  5. matthewmorgan commented on May 10, 2017

    @matthewmorgan
    Contributor

    @rchavarria I'm thinking a smarter makefile is the solution for this, but I also think this is somewhat dependent on #235 .

    If we want to get rid of per-exercise package.json files, then we lose that functionality.

    Since npm install is the de facto way to install JavaScript dependencies, I would feel better about closing #235 as "will not fix" and implementing this instead, rather than, for example, changing the makefile somehow to install modules where needed. It would be better to stick to an approach that is likely to serve the users IRL.

    Thoughts?

  6. rchavarria commented on May 21, 2017

    @rchavarria
    ContributorAuthor

    Yep. I agree we should make user's live as easy as possible.

    I know it's a bit tedious to run npm install on each exercise. But having independent exercises is a key point of exercism. So, I'll close #235 with won't fix and we can have some ideas about how to make Makefile smarter.

  7. stale commented on Jul 20, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  8. joeljuca commented on Jul 21, 2017

    @joeljuca
    SponsorContributor

    Shaw we really consider this issue wontfix?

  9. rchavarria commented on Jul 22, 2017

    @rchavarria
    ContributorAuthor

    Or even close it. It's very old.

    In fact, something improved when running tests with Jest. If we feel something need to be fixed, we can create a new issue and fix it then.

  10. stale commented on Sep 20, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfix 🙅‍♀️This won't be applied, fixed, worked on, continued.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions