adapt-cli 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,7 @@ export default class Plugin {
79
79
  * @returns {boolean|null}
80
80
  */
81
81
  get isUpToDate () {
82
- if (!this.hasFrameworkCompatibleVersion) return true;
82
+ if (!this.hasFrameworkCompatibleVersion) return true
83
83
  const canCheckSourceAgainstProject = (this.latestSourceVersion && this.projectVersion)
84
84
  if (!canCheckSourceAgainstProject) return null
85
85
  const isLatestVersion = (this.projectVersion === this.latestSourceVersion)
@@ -104,6 +104,14 @@ export default class Plugin {
104
104
  return (this._projectInfo?.version || null)
105
105
  }
106
106
 
107
+ /**
108
+ * the required framework version from the source package json
109
+ * @returns {string|null}
110
+ */
111
+ get frameworkVersion () {
112
+ return (this._sourceInfo?.framework || null)
113
+ }
114
+
107
115
  /**
108
116
  * a list of tags denoting the source versions of the plugin
109
117
  * @returns {[string]}
@@ -293,7 +301,7 @@ export default class Plugin {
293
301
 
294
302
  // check if the latest version is compatible
295
303
  const satisfiesConstraint = !this.hasValidRequestVersion || semver.satisfies(this._sourceInfo.version, this.requestedVersion, semverOptions)
296
- const satisfiesFramework = semver.satisfies(framework, this._sourceInfo.framework, semverOptions)
304
+ const satisfiesFramework = semver.satisfies(framework, this.frameworkVersion, semverOptions)
297
305
  if (!this.latestCompatibleSourceVersion && satisfiesFramework) this.latestCompatibleSourceVersion = this.latestSourceVersion
298
306
  if (satisfiesConstraint && satisfiesFramework) {
299
307
  return this.latestSourceVersion
@@ -165,7 +165,7 @@ async function conflictResolution ({ logger, targets, isInteractive }) {
165
165
  }
166
166
  const preFilteredPlugins = targets.filter(target => !target.isLocalSource)
167
167
  const allQuestions = [
168
- add(preFilteredPlugins.filter(target => !target.hasFrameworkCompatibleVersion), 'There is no compatible version of the following plugins:', checkVersion),
168
+ add(preFilteredPlugins.filter(target => !target.hasFrameworkCompatibleVersion && target.latestSourceVersion), 'There is no compatible version of the following plugins:', checkVersion),
169
169
  add(preFilteredPlugins.filter(target => target.hasFrameworkCompatibleVersion && !target.hasValidRequestVersion), 'The version requested is invalid, there are newer compatible versions of the following plugins:', checkVersion),
170
170
  add(preFilteredPlugins.filter(target => target.hasFrameworkCompatibleVersion && target.hasValidRequestVersion && !target.isApplyLatestCompatibleVersion), 'There are newer compatible versions of the following plugins:', checkVersion)
171
171
  ].filter(Boolean)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-cli",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Command line tools for Adapt",
5
5
  "main": "./lib/api.js",
6
6
  "type": "module",