✨ feat: add Configuration Options > Secret Messages appetizer project - #82
Merged
Merged
Conversation
JoshuaKGoldberg
marked this pull request as ready for review
June 7, 2022 13:11
JoshuaKGoldberg
added a commit
that referenced
this pull request
Sep 22, 2026
`check-solutions.sh "tsc"` runs a bare `npm run tsc` in every project, which for secret-messages compiles both steps against the project-level TSConfig. That has failed since the project was added in #82, but the all-projects branch only runs when a PR touches no `projects/**` files, so it went unnoticed until this PR hit it. Three errors, all in `02-allowed-imports/index.ts`: - `answer.js` and `guesses.json` need `allowJs` and `resolveJsonModule`, which exist only in the step's own TSConfig -- the file the reader fills in, and which a project-level `tsc` never reads. Adds them to the project TSConfig, along with `noEmit` to avoid TS5055 overwriting `answer.js`. - `message.codePointAt(i)` is not strict-safe. Its counterpart in `01-encoded-outputs/index.ts` already writes `message.codePointAt(i)!`, so this matches the sibling step. The exercise is untouched: `npm run tsc -- --project 02-allowed-imports` still reads the step TSConfig, and `solution.test.ts` still asserts the reader added the options there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks done
JoshuaKGoldberg
added a commit
that referenced
this pull request
Sep 22, 2026
`check-solutions.sh "tsc"` runs a bare `npm run tsc` in every project, which for secret-messages compiles both steps against the project-level TSConfig. That has failed since the project was added in #82, but the all-projects branch only runs when a PR touches no `projects/**` files, so it went unnoticed. `answer.js` and `guesses.json` need `allowJs` and `resolveJsonModule`, which exist only in the step's own TSConfig -- the file the reader fills in, and which a project-level `tsc` never reads. Adds them to the project TSConfig, with `noEmit` to avoid TS5055 overwriting `answer.js`. `message.codePointAt(i)` is typed `number | undefined`, so it needs a non-null assertion under `strict`. Switches both steps to `charCodeAt`, which returns `number` and pairs more naturally with `fromCharCode`. That also drops the `!` from `01-encoded-outputs`, which was the only non-null assertion in the repository -- worth avoiding in a chapter 13 project regardless. Output is unchanged: the two differ only for characters above the BMP, and these messages are ASCII. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JoshuaKGoldberg
added a commit
that referenced
this pull request
Sep 22, 2026
`check-solutions.sh "tsc"` runs a bare `npm run tsc` in every project, which for secret-messages compiles both steps against the project-level TSConfig. That has failed since the project was added in #82, but the all-projects branch only runs when a PR touches no `projects/**` files, so it went unnoticed. `answer.js` and `guesses.json` need `allowJs` and `resolveJsonModule`, which exist only in the step's own TSConfig -- the file the reader fills in, and which a project-level `tsc` never reads. Adds them to the project TSConfig, with `noEmit` to avoid TS5055 overwriting `answer.js`. `message.codePointAt(i)` is typed `number | undefined`, so it needs a non-null assertion under `strict`. Switches both steps to `charCodeAt`, which returns `number` and pairs more naturally with `fromCharCode`. That also drops the `!` from `01-encoded-outputs`, which was the only non-null assertion in the repository -- worth avoiding in a chapter 13 project regardless. Output is unchanged: the two differ only for characters above the BMP, and these messages are ASCII. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
It's hard to think of configuration option appetizer projects...