@mcmcjs/julia 0.20.0 → 0.21.1

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.
package/dist/index.d.cts CHANGED
@@ -223,6 +223,16 @@ declare function resolveVersion(bin: string, channel: string, run: CommandRunner
223
223
  args: string[];
224
224
  version?: string;
225
225
  }>;
226
+ /**
227
+ * Resolves a channel to the Julia that runs it: through juliaup when it is installed, and
228
+ * otherwise the `julia` on PATH when that is exactly the version asked for, as on a machine
229
+ * or notebook runtime that ships Julia without juliaup.
230
+ */
231
+ declare function resolveJulia(channel: string, run: CommandRunner): Promise<{
232
+ command: string;
233
+ args: string[];
234
+ version?: string;
235
+ }>;
226
236
  /** Throws with an actionable message if any requested channel is not installed. */
227
237
  declare function assertVersionsInstalled(channels: string[], installed: RuntimeVersion[]): void;
228
238
 
@@ -262,4 +272,4 @@ type StopOutcome = "stopped" | "stale" | "pending";
262
272
  */
263
273
  declare function stopWorker(socket: string): Promise<StopOutcome>;
264
274
 
265
- export { type DoctorReport, type FitIo, type InstallCommand, type LogLikIo, type MatrixEntry, type MatrixIo, type MatrixResult, type PackagePins, type PredictIo, type SetupOptions, type SetupResult, type SetupStep, type SetupStepResult, type StepStatus, type WorkerStatus, addVersion, assertVersionsInstalled, detectJulia, detectJuliaup, ensureProject, gcVersions, juliaEngine, juliaupInstallCommand, killWorker, listVersions, listWorkers, managedProjectDir, managedProjectReady, planSetup, predictData, removeVersion, resolveVersion, runDoctor, runFit, runFitAuto, runLogLik, runMatrix, runPredict, runSetup, setDefaultVersion, sharedTmpParent, stopWorker, updateVersion, validatePins, validateVersionString };
275
+ export { type DoctorReport, type FitIo, type InstallCommand, type LogLikIo, type MatrixEntry, type MatrixIo, type MatrixResult, type PackagePins, type PredictIo, type SetupOptions, type SetupResult, type SetupStep, type SetupStepResult, type StepStatus, type WorkerStatus, addVersion, assertVersionsInstalled, detectJulia, detectJuliaup, ensureProject, gcVersions, juliaEngine, juliaupInstallCommand, killWorker, listVersions, listWorkers, managedProjectDir, managedProjectReady, planSetup, predictData, removeVersion, resolveJulia, resolveVersion, runDoctor, runFit, runFitAuto, runLogLik, runMatrix, runPredict, runSetup, setDefaultVersion, sharedTmpParent, stopWorker, updateVersion, validatePins, validateVersionString };
package/dist/index.d.ts CHANGED
@@ -223,6 +223,16 @@ declare function resolveVersion(bin: string, channel: string, run: CommandRunner
223
223
  args: string[];
224
224
  version?: string;
225
225
  }>;
226
+ /**
227
+ * Resolves a channel to the Julia that runs it: through juliaup when it is installed, and
228
+ * otherwise the `julia` on PATH when that is exactly the version asked for, as on a machine
229
+ * or notebook runtime that ships Julia without juliaup.
230
+ */
231
+ declare function resolveJulia(channel: string, run: CommandRunner): Promise<{
232
+ command: string;
233
+ args: string[];
234
+ version?: string;
235
+ }>;
226
236
  /** Throws with an actionable message if any requested channel is not installed. */
227
237
  declare function assertVersionsInstalled(channels: string[], installed: RuntimeVersion[]): void;
228
238
 
@@ -262,4 +272,4 @@ type StopOutcome = "stopped" | "stale" | "pending";
262
272
  */
263
273
  declare function stopWorker(socket: string): Promise<StopOutcome>;
264
274
 
265
- export { type DoctorReport, type FitIo, type InstallCommand, type LogLikIo, type MatrixEntry, type MatrixIo, type MatrixResult, type PackagePins, type PredictIo, type SetupOptions, type SetupResult, type SetupStep, type SetupStepResult, type StepStatus, type WorkerStatus, addVersion, assertVersionsInstalled, detectJulia, detectJuliaup, ensureProject, gcVersions, juliaEngine, juliaupInstallCommand, killWorker, listVersions, listWorkers, managedProjectDir, managedProjectReady, planSetup, predictData, removeVersion, resolveVersion, runDoctor, runFit, runFitAuto, runLogLik, runMatrix, runPredict, runSetup, setDefaultVersion, sharedTmpParent, stopWorker, updateVersion, validatePins, validateVersionString };
275
+ export { type DoctorReport, type FitIo, type InstallCommand, type LogLikIo, type MatrixEntry, type MatrixIo, type MatrixResult, type PackagePins, type PredictIo, type SetupOptions, type SetupResult, type SetupStep, type SetupStepResult, type StepStatus, type WorkerStatus, addVersion, assertVersionsInstalled, detectJulia, detectJuliaup, ensureProject, gcVersions, juliaEngine, juliaupInstallCommand, killWorker, listVersions, listWorkers, managedProjectDir, managedProjectReady, planSetup, predictData, removeVersion, resolveJulia, resolveVersion, runDoctor, runFit, runFitAuto, runLogLik, runMatrix, runPredict, runSetup, setDefaultVersion, sharedTmpParent, stopWorker, updateVersion, validatePins, validateVersionString };
package/dist/index.js CHANGED
@@ -866,6 +866,15 @@ async function resolveVersion(bin, channel, run) {
866
866
  }
867
867
  return { command: match.File, args: match.Args ?? [], version: match.Version };
868
868
  }
869
+ async function resolveJulia(channel, run) {
870
+ const juliaup = await detectJuliaup(run);
871
+ if (juliaup.found && juliaup.path) return resolveVersion(juliaup.path, channel, run);
872
+ const julia = await detectJulia(run);
873
+ if (julia.found && julia.path && julia.version === channel) {
874
+ return { command: julia.path, args: [], version: julia.version };
875
+ }
876
+ throw new Error("juliaup not found. Run `mcmc setup` to install the Julia toolchain.");
877
+ }
869
878
  function assertVersionsInstalled(channels, installed) {
870
879
  const have = new Set(installed.map((v) => v.id));
871
880
  const missing = channels.filter((c) => !have.has(c));
@@ -1223,6 +1232,7 @@ export {
1223
1232
  planSetup,
1224
1233
  predictData,
1225
1234
  removeVersion,
1235
+ resolveJulia,
1226
1236
  resolveVersion,
1227
1237
  runDoctor,
1228
1238
  runFit,