Skip to content

New: Add --capturedir and --rootdir to grunt migration tasks (fixes #3667)#3668

Merged
joe-allen-89 merged 3 commits into
masterfrom
issue/3667
Apr 11, 2025
Merged

New: Add --capturedir and --rootdir to grunt migration tasks (fixes #3667)#3668
joe-allen-89 merged 3 commits into
masterfrom
issue/3667

Conversation

@oliverfoster
Copy link
Copy Markdown
Member

@oliverfoster oliverfoster commented Apr 2, 2025

fixes #3667

New

  • Allow the task to be executed against any plugins and course-data
  • Allow the task to specify a capture output and an outputdir for the migrated files

Test

Capture cwd plugins and data

--outputdir changes away from src/course to a defined folder relative to the cwd, usually build/ or an AAT temp folder for the course json and assets
--capturedir defaults to ./migrations/ and specifies where to write the capture output for migration

To capture the course-data ./src/course and ./src/ plugins at ./migrations/:
$ grunt migration:capture

To capture the course-data ./build/course and ./src/ plugins at ./migrations/:
$ grunt migration:capture --outputdir=build/

To capture the course-data ./build/course and ./src/ plugins at ./captured/:
$ grunt migration:capture --outputdir=build/ --capturedir=./captured/

Capture plugins and data from another directory

--rootdir defaults to cwd and is where the from-framework plugins and src/course are located
--outputdir changes away from src/course to a defined folder relative to the --rootdir, usually build/ or an AAT temp folder for the course json and assets
--capturedir defaults to ./migrations/ and specifies where to write the capture output for migration

To capture the course-data ../old_course/src/course and ../old_course plugins at ./migrations/:
$ grunt migration:capture --rootdir=../old_course/

To capture the course-data ../old_course/src/course and ../old_course plugins at ./captured/:
$ grunt migration:capture --rootdir=../old_course/ --capturedir=captured/

To capture the course-data ../old_course/build/course and ../old_course plugins at ./captured/:
$ grunt migration:capture --rootdir=../old_course/ --outputdir=build/ --capturedir=captured/

Migrate

The to-framework plugins are always the plugins specified in the cwd.

--outputdir changes away from src/course to a defined folder relative to the cwd, usually build/ or an AAT temp folder for the course json and assets
--capturedir defaults to ./migrations/ and specifies where to read the capture data for migration

To migrate the captured data ./captured/ to ./src/course using the to-framework plugins from cwd:
$ grunt migration:migrate --capturedir=captured/

To migrate the captured data ./captured/ to ./build/course using the to-framework plugins from cwd:
$ grunt migration:migrate --capturedir=captured/ --outputdir=build/

Copy link
Copy Markdown
Contributor

@joe-allen-89 joe-allen-89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Copy Markdown
Member

@taylortom taylortom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in v1

@joe-allen-89 joe-allen-89 merged commit c6992ef into master Apr 11, 2025
1 check passed
@joe-allen-89 joe-allen-89 deleted the issue/3667 branch April 11, 2025 16:06
@github-project-automation github-project-automation Bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 11, 2025
github-actions Bot pushed a commit that referenced this pull request Apr 11, 2025
# [5.46.0](v5.45.2...v5.46.0) (2025-04-11)

### New

* Add --capturedir and --rootdir to grunt migration tasks (fixes #3667) (#3668) ([c6992ef](c6992ef)), closes [#3667](#3667) [#3668](#3668) [#3667](#3667)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 5.46.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@taylortom
Copy link
Copy Markdown
Member

taylortom commented Apr 11, 2025

Have just come across an AAT issue related to this PR - specifically these lines. The AAT passes absolute paths, so we were getting something like C:/path/C:/path.

Switching from path.join to path.resolve fixes this for me

If we should be passing the rootDir somehow via the AAT, let me know (not sure if this is hooked up to the CLI API)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure grunt migrations can be run on any historic course

4 participants