Conversation
#153) - Extract pure utility functions to lib/utils/: inferBuildAction, getPluginUpdateStatus, getImportContentCounts - Replace local readJson/writeJson/toBoolean with core imports - Replace local ensureDir in AdaptFrameworkBuild with core import - Replace Utils.spawn with named spawn import from core - Fix inferBuildAction bug with URLs lacking trailing slash - Add tests for all extracted utility functions - Bump adapt-authoring-core dependency to issue/91 branch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace git branch reference with semver range now that core PR #92 has been merged and released as 2.0.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follow the convention from UTILS.md: one test file per extracted utility, prefixed with utils-. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove readJson, writeJson, inferBuildAction, toBoolean, getPluginUpdateStatus, getImportContentCounts from the class. All internal callers now use direct imports from core or ./utils.js. External consumers (e.g. multilang) that use AdaptFrameworkUtils for non-deprecated methods (copyFrameworkSource, etc.) are unaffected. Co-Authored-By: Claude Opus 4.6 <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.
Summary
AdaptFrameworkUtilsstatic class into individual files underlib/utils/readJson,writeJson,toBoolean,ensureDirimplementations withcoreimportsUtils.spawn()inAdaptFrameworkImportwith namedspawnimport fromcoreinferBuildActionbug where URLs without a trailing slash (e.g./import) had the last character truncatedtests/utils.spec.jswith 14 tests for the extracted functionsNew files
lib/utils/inferBuildAction.jslib/utils/getPluginUpdateStatus.jslib/utils/getImportContentCounts.js_typelib/utils.jsChanged files
lib/AdaptFrameworkUtils.js@deprecatedlib/AdaptFrameworkBuild.jsensureDirfrom core, remove local methodlib/AdaptFrameworkImport.jsUtilswithspawnnamed importpackage.jsonadapt-authoring-coreatissue/91branchTest plan
tests/utils.spec.jsAdaptFrameworkUtils.spec.jsinferBuildActionbug fix verified (URLs without trailing slash)Resolves #153
🤖 Generated with Claude Code