Repository navigation
feat(author): export sourceType, so the build page hands over the type the build took - #177
Merged
Merged
Conversation
… type (#176) The build page hands a chat the type file of the content type a source is written in. It found that type by a rule of its own, the source's `type` as written, so a type named loosely or under `contentType` got no file, though the build reads both since 0.7.1. A copy of the build's rule in the page would drift from the build it ships, so the build's reading is exported instead. `sourceType(source, names)`, from `.`, `./core` and `./browser`: of the machine names given, the one the source's `type` names, as it is or loosely; where it has no `type`, the one name under `contentType` or `library`; null where none can be meant, and for a quiz in the published format, which has rules of its own. It is made of the two functions `sourceOf` reads a type with. On the 328 sources the weak-model tests stored, it names what `sourceOf` takes the type to be in every one, 322 with a type and 6 without. A test holds it to `sourceOf` on every shape it reads.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
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.
Closes #176.
The build page hands a chat, with a source's problems, the type file of the content type the source is written in. It found that type by a rule of its own, the source's
typeas written, so a type named loosely ("interactive-book") or undercontentTypegot no file, though the build reads both since 0.7.1 (#175). The 12 of 12 measured in #175 with no skill text were with a page that hands the file back for such a type.What changes
sourceType(source, names)is exported from.,./coreand./browser: of the machine names given, the one the source'stypenames, as it is or loosely; where it has notype, the one name undercontentTypeorlibrary;nullwhere none can be meant, and for a quiz in the published format, which has rules of its own.It is made of the two functions
sourceOfreads a type with (machineNameOf,namingKey), so the page asks the build it ships instead of keeping a copy of the rule. That is the only change: no build reads anything differently.Tested
pnpm --filter @missing-elements/h5p-author test: 179 pass. A new test covers each shape, and holdssourceTypeto whatsourceOftakes the type to be in every case it reads one. Three mutations (nocontentTypeorlibrary, those read beside atypethat names nothing, no quiz exception) each fail it. The typecheck passes, and the declaration issourceType(source: unknown, names: Iterable<string>): string | null.sourceOfdoes in every one: 322 with a type, 6 without.To release
h5p-author 0.8.0, a minor for the new export. Then the build page's pull request in missing-elements.github.io pins it and attaches the type file of
sourceType(source, listed), with the files of what the source names below it.Summary by cubic
Exports
sourceTypeso the build page hands a chat the content type file the build itself would read.The page previously found the type by its own rule—the source's
typeas written—so a loosely named type ("interactive-book") or one undercontentTypegot no file, though the build reads both.sourceType(source, names)is now exported from.,./core, and./browser, built from the same functionssourceOfreads a type with, so the page asks the build it ships instead of keeping a copy of the rule.typenames (exact or loose); with notype, the name undercontentTypeorlibrary;nullwhere none can be meant and for a quiz in the published format.sourceTypeto whatsourceOfreads on all 328 stored sources; the suite passes 179 tests.h5p-author(0.8.0) for the new export.Written for commit 7b3747d. Summary will update on new commits.