You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e5877ed
Browse filesBrowse the repository at this point in the historyBrowse files
feat(vite): refuse runtimes older than the version @nativescript/vite requires
@nativescript/vite may declare `nativescriptCli.minRuntimeVersion` in its
package.json, keyed by platform (e.g. `{ "ios": "9.2.0" }`). When it does,
prepare (and so build, run, debug and deploy) fails before bundling if the
project's installed runtime for that platform is older, naming the
platform, both versions and the npm command that updates the runtime.
Versions compare on major.minor.patch with prerelease tags dropped, so
9.2.0-next.* and PR builds of 9.2.0 satisfy a 9.2.0 minimum while 9.1.x
prereleases do not. No field, no entry for the platform, or a version
that cannot be parsed skips the check, leaving current packages
unaffected.
The check runs in PrepareController.prepareCore after the platform is
added, since every command that bundles goes through it and the runtime
version is known by then.
`Skipping the ${requirement.bundlerPackageName} runtime check for ${platform}: cannot compare runtime version "${runtime?.version}" with minimum "${requirement.minVersion}".`,
it("prepares when the bundler declares no minimum for the platform",async()=>{
288
+
awaitprepareWith(null,"8.0.0");
289
+
290
+
assert.isTrue(isCompileWithoutWatchCalled);
291
+
});
292
+
293
+
it("stops before bundling when the runtime is older",async()=>{
294
+
awaitassert.isRejected(
295
+
prepareWith(vite("9.2.0"),"9.1.3"),
296
+
'@nativescript/vite 2.0.0 requires @nativescript/ios 9.2.0 or newer for ios, but the project has @nativescript/ios 9.1.3 installed. Update the runtime with "npm install --save-dev @nativescript/ios@^9.2.0" and run the command again.',
297
+
);
298
+
299
+
assert.isFalse(isCompileWithoutWatchCalled);
300
+
assert.isFalse(isNativePrepareCalled);
301
+
});
302
+
303
+
it("rejects a prerelease of an older version",async()=>{
0 commit comments