Skip to content

Add Concept Exercise for type checking. #2704

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
wants to merge 92 commits into
base: main
Choose a base branch
from

Conversation

quintuple-mallard
Copy link
Contributor

@quintuple-mallard quintuple-mallard commented Jun 30, 2025

This PR adds the assembly-line exercise and type-checking concept to the JavaScript track.

A few notes/questions:

  • I have noticed that some other tracks (C#, Go, and Ruby (and possibly more)) already have an exercise called Assembly Line, all on the numbers concept, but all slightly different. Does this matter?
  • An error with nodejs that I haven't been able to fix has stopped me from running the format script. Configlet and the other node scripts have been working.
  • The concept teaches Object.hasOwn rather than Object.prototype.hasOwnProperty, as it seems Object.hasOwn is the recommended over Object.prototype.hasOwnProperty, that is considered somewhat outdated.
  • I have been coding via GitHub's online editor, often for only a few minutes, so there are quite a few very small commits.

Copy link
Contributor

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Jun 30, 2025
@SleeplessByte SleeplessByte reopened this Jun 30, 2025
@SleeplessByte
Copy link
Member

Sweeeet. Thanks, this is great.

A response to your questions @quintuple-mallard

This PR adds the assembly-line exercise and type-checking concept to the JavaScript track.

A few notes/questions:

  • I have noticed that some other tracks (C#, Go, and Ruby (and possibly more)) already have an exercise called Assembly Line, all on the numbers concept, but all slightly different. Does this matter?

Yes, somewhere on the website (cannot find it now) there is a page that shows exercise information + which tracks implement it. There should be no problem with overloading the name of an exercise, but for clarity and to ensure that that page doesn't break, we should slightly change the story. Perhaps we just call this recycling-robot and use the exact same story but then for recycling material?

  • An error with nodejs that I haven't been able to fix has stopped me from running the format script. Configlet and the other node scripts have been working.

What is the error? I can also format for you by typing /format here (an action will now run to format using the CI).

  • The concept teaches Object.hasOwn rather than Object.prototype.hasOwnProperty, as it seems Object.hasOwn is the recommended over Object.prototype.hasOwnProperty, that is considered somewhat outdated.

That is correct! Times have changed.

  • I have been coding via GitHub's online editor, often for only a few minutes, so there are quite a few very small commits.

Sounds fine; we will squash at the end, so make as many commits as you want.

Copy link
Contributor

The "Format code" action has started running.

@SleeplessByte
Copy link
Member

Ah. Format on the CI doesn't run because your branch is called main ;). I'll fix the format once you're done. Just ping me @quintuple-mallard

@quintuple-mallard quintuple-mallard deleted the branch exercism:main June 30, 2025 17:46
@quintuple-mallard quintuple-mallard deleted the main branch June 30, 2025 17:46
@quintuple-mallard quintuple-mallard restored the main branch June 30, 2025 17:46
@quintuple-mallard quintuple-mallard deleted the branch exercism:main June 30, 2025 17:57
@quintuple-mallard quintuple-mallard deleted the main branch June 30, 2025 17:57
@quintuple-mallard quintuple-mallard restored the main branch June 30, 2025 17:58
rename Assembly Line to Recycling Robot
@quintuple-mallard
Copy link
Contributor Author

I have renamed the exercise to Recycling Robot.

Here is the "Format code" script output:

/home/[username]/Documents/GitHub/javascript
/home/[username]/Documents/GitHub/javascript/node_modules/.pnpm/[email protected]/node_modules/prettier

[format] corepack pnpm dlx [email protected]/node_modules/prettier --write "**/*.{js,jsx,cjs,mjs,ts,tsx,css,sass,scss,html,json,md,yml}"
 ENOENT  ENOENT: no such file or directory, open '/home/[username]/.cache/pnpm/dlx/neavhuhbszfrs6ovixsvauyx5e/197bfebc68f-21ad/node_modules/prettier/package.json'

@quintuple-mallard
Copy link
Contributor Author

Sorry for the closing and reopening, that came from me trying to rename the main branch.

@quintuple-mallard
Copy link
Contributor Author

quintuple-mallard commented Jul 1, 2025

@SleeplessByte I managed to format it by switching to Windows and running the script.
Possibly the issue came from me using Xubuntu, or missing something I had installed on Windows?

@SleeplessByte
Copy link
Member

@SleeplessByte I managed to format it by switching to Windows and running the script. Possibly the issue came from me using Xubuntu, or missing something I had installed on Windows?

Yeah weird. The format of what command it's trying to run is off I think. I think it should have been:

corepack pnpm dlx [email protected] --write "**/*.{js,jsx,cjs,mjs,ts,tsx,css,sass,scss,html,json,md,yml}"

But 🤷🏽

@quintuple-mallard
Copy link
Contributor Author

quintuple-mallard commented Jul 2, 2025

somewhere on the website (cannot find it now) there is a page that shows exercise information + which tracks implement it.

I think it is exercism.org/exercises/<exercise-slug> (e.g. https://exercism.org/exercises/bob) (unless there is a different one I don't know of). It throws a 500 error for Concept Exercises though.

@SleeplessByte
Copy link
Member

somewhere on the website (cannot find it now) there is a page that shows exercise information + which tracks implement it.

I think it is exercism.org/exercises/<exercise-slug> (e.g. https://exercism.org/exercises/bob) (unless there is a different one I don't know of). It throws a 500 error for Concept Exercises though.

That's it!

I'll have an in depth review for you by the weekend. Thanks for working on this, am excited!

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

Successfully merging this pull request may close these issues.

2 participants