Conversation
Member
This needs to be solved elsewhere. It should be fine to have a plugin with no |
Contributor
Author
Do you mean the migration script isn't needed or that the schema default fix should happen in a separate PR? |
Add two migration scripts for the adapt-youtube plugin: - migrations/v1.js: migration from v1.0.2–<1.2.0 to 1.2.0. Renames global _globals._youtube.transcriptButton to skipToTranscript, adds _media._controls and _media._allowFullscreen to youtube components when missing, ensures _transcript exists on components, updates plugin metadata to 1.2.0, and includes unit tests and guards. - migrations/v2.js: migration from v2.1.0–<2.1.1 to 2.1.1. Adds _media._playsinline (false) to youtube components that have _media but lack _playsinline, updates plugin metadata to 2.1.1, and includes tests and stop conditions. Both files include checks to validate changes and test cases covering expected and guard scenarios.
Contributor
|
Adding migrations for v1 & v2. |
Add // @ts-nocheck to the migration file, change direct assignment of _transcript to use _.set for safer mutation, and update a testStopWhere description to clarify that no migration is needed when YouTube components already have the required properties.
joe-replin
approved these changes
Jun 26, 2026
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.
Fixes #49
Fix
migrations/directory (the plugin previously shipped none). The new migration reconciles legacy course content against the current component schema so it imports cleanly into the Adapt Authoring Tool instead of aborting._media._aspectRatiofrom a string (e.g."1.778") to a number. Non-numeric strings are left untouched so no data is destroyed, and values already stored as numbers are skipped._media._progressColorfrom the stray value"default"(never a member of the schema enum) to"red", matching the modern schema default. Existing"red"/"white"values are left alone._progressColorfrom"default"to"red", so the Authoring Tool stops writing the invalid value into new content.Dependencies
semantic-release-replace-pluginso the migration's@@CURRENT_VERSION/@@RELEASE_VERSIONplaceholders resolve to real version numbers on release. This required bumpingsemantic-releaseto^21.0.1(the replace plugin's peer requirement), matching other adaptlearning plugins that ship migrations.Testing
grunt migration:test --file=adapt-youtube._media._aspectRatiois a quoted string, import it into an Authoring Tool instance whose framework types that field as a number, and confirm the import now succeeds without manual JSON edits.Posted via collaboration with Claude Code