@manifest-configuration-language/browser 0.3.24 → 0.3.27

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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createMclRuntime, MclRuntimeError, } from "./runtime.js";
2
2
  export type { MclOperation, MclResult, MclRuntime, MclProject, RuntimeStatus, RuntimeStatusEvent, RuntimeOperationOutcome, RuntimeOperationEvent, RuntimeOptions, } from "./runtime.js";
3
3
  export { isValidProjectPath, isValidProjectFileSet, } from "./project.js";
4
- export type { ProjectFile, ProjectFiles, RequestOptions, ProjectOperationOptions, ProjectCompletionOptions, ProjectNavigationOptions, ProjectRenameOptions, ProjectFileRenameOptions, } from "./project.js";
4
+ export type { ProjectFile, ProjectFiles, RequestOptions, ProjectOperationOptions, ProjectParametersOptions, ProjectCompletionOptions, ProjectNavigationOptions, ProjectRenameOptions, ProjectFileRenameOptions, } from "./project.js";
5
5
  export { maxSourceBytes, maxSourceMapBytes, maxRenameNameLength, maxProjectFiles, maxProjectFileBytes, maxProjectBytes, maxProjectPathLength, maxProjectPathDepth, } from "./limits.js";
6
6
  export type { CheckResult, CompletionItem, CompletionPosition, CompletionResult, DefinitionLocation, DefinitionResult, EvaluateResult, FormatResult, HoverInfo, HoverResult, LintCodeAction, LintDiagnostic, ParseResult, ReferenceLocation, ReferencesResult, RelatedLocation, RenderResult, RenameEdit, RenameFileImportsResult, RenameResult, SourceMap, SourceMapEntry, SourceMapOrigin, SourceRange, } from "./protocol.js";
package/dist/mcl.wasm CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/mcl.wasm
3
- size: 97264725 bytes
4
- sha256: 42920c29ca0da31afa4528ac787712f337151589e630aa06659e896e6d5dfb3c
3
+ size: 97266980 bytes
4
+ sha256: e081e8d77d536b3a060f6615d47ca9972027c4c7034a788132f70c10b6a93bf9
package/dist/project.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { maxProjectBytes, maxProjectFileBytes, maxProjectFiles, maxProjectPathDepth, maxProjectPathLength, maxSourceBytes } from "./limits.js";
2
- import type { Request as WasmRequest } from "./protocol.js";
2
+ import type { Request as WasmRequest, RequestParameters } from "./protocol.js";
3
3
  export type MclOperation = WasmRequest["operation"];
4
4
  export { maxProjectBytes, maxProjectFileBytes, maxProjectFiles, maxProjectPathDepth, maxProjectPathLength, maxSourceBytes, };
5
5
  /** Root-relative project files passed to MCL's in-memory session filesystem.
@@ -45,7 +45,9 @@ export interface RequestOptions {
45
45
  }
46
46
  export interface ProjectOperationOptions extends RequestOptions {
47
47
  entrypoint?: string;
48
- parameters?: Record<string, unknown>;
48
+ }
49
+ export interface ProjectParametersOptions extends ProjectOperationOptions {
50
+ parameters?: RequestParameters;
49
51
  }
50
52
  export interface PositionOptions {
51
53
  line: number;
package/dist/runtime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ProjectFiles, RequestOptions, ProjectOperationOptions, ProjectCompletionOptions, ProjectNavigationOptions, ProjectRenameOptions, ProjectFileRenameOptions } from "./project.js";
1
+ import type { ProjectFiles, RequestOptions, ProjectOperationOptions, ProjectParametersOptions, ProjectCompletionOptions, ProjectNavigationOptions, ProjectRenameOptions, ProjectFileRenameOptions } from "./project.js";
2
2
  import type { CheckResult, CompletionResult as ProtocolCompletionResult, DefinitionResult as ProtocolDefinitionResult, EvaluateResult, FormatResult, HoverResult as ProtocolHoverResult, LintDiagnostic as ProtocolLintDiagnostic, ParseResult, ReferencesResult as ProtocolReferencesResult, RenderResult, RenameResult as ProtocolRenameResult, RenameFileImportsResult as ProtocolRenameFileImportsResult, Request as WasmRequest, Error as ProtocolError } from "./protocol.js";
3
3
  export type MclOperation = WasmRequest["operation"];
4
4
  export type MclResult = ({
@@ -56,7 +56,7 @@ export interface MclProject {
56
56
  set?: ProjectFiles;
57
57
  delete?: string[];
58
58
  }): MclProject;
59
- run<O extends MclOperation>(operation: O, ...options: O extends "completion" ? [options: ProjectCompletionOptions] : O extends "definition" | "hover" | "references" ? [options: ProjectNavigationOptions] : O extends "rename" ? [options: ProjectRenameOptions] : O extends "renameFileImports" ? [options: ProjectFileRenameOptions] : [options?: ProjectOperationOptions]): Promise<Extract<MclResult, {
59
+ run<O extends MclOperation>(operation: O, ...options: O extends "completion" ? [options: ProjectCompletionOptions] : O extends "definition" | "hover" | "references" ? [options: ProjectNavigationOptions] : O extends "rename" ? [options: ProjectRenameOptions] : O extends "check" | "evaluate" | "render" ? [options?: ProjectParametersOptions] : O extends "renameFileImports" ? [options: ProjectFileRenameOptions] : [options?: ProjectOperationOptions]): Promise<Extract<MclResult, {
60
60
  operation: O;
61
61
  }>>;
62
62
  }
package/dist/runtime.js CHANGED
@@ -401,8 +401,10 @@ export function createMclRuntime(options = {}) {
401
401
  const previousSnapshot = workerProjectId === projectId ? workerSnapshot : undefined;
402
402
  const reset = workerProjectId !== projectId;
403
403
  const result = computeProjectDelta(snapshot, previousSnapshot, reset);
404
- if (result === null)
405
- return; // nothing changed
404
+ if (result === null) {
405
+ workerSnapshot = snapshot;
406
+ return;
407
+ }
406
408
  const { delta, binaryFiles, transferables } = result;
407
409
  const updateJSON = JSON.stringify(delta);
408
410
  // Transfer binary buffers to avoid copying.
@@ -425,14 +427,12 @@ export function createMclRuntime(options = {}) {
425
427
  throw new TypeError("parameters are only valid for check, evaluate, and render operations");
426
428
  }
427
429
  const parameters = requestOptions.parameters;
428
- if (parameters === null || typeof parameters !== "object" || Array.isArray(parameters)) {
430
+ if (parameters === null ||
431
+ typeof parameters !== "object" ||
432
+ Array.isArray(parameters) ||
433
+ !isJSONValue(parameters)) {
429
434
  throw new TypeError("parameters must be an object with JSON values");
430
435
  }
431
- for (const value of Object.values(parameters)) {
432
- if (!isJSONValue(value)) {
433
- throw new TypeError("parameters must be an object with JSON values");
434
- }
435
- }
436
436
  }
437
437
  // Validate renameFileImports paths eagerly so we never spin up a Worker.
438
438
  if (operation === "renameFileImports") {
@@ -466,15 +466,10 @@ export function createMclRuntime(options = {}) {
466
466
  try {
467
467
  if (timeoutMs <= 0)
468
468
  throw timeoutError;
469
- timer = setTimeout(() => {
470
- if (stopCurrent)
471
- stopCurrent(timeoutError);
472
- else
473
- stopInitialization?.(timeoutError);
474
- }, timeoutMs);
475
469
  await waitUntilReady(signal);
476
470
  if (signal?.aborted)
477
471
  throw new DOMException("The operation was aborted", "AbortError");
472
+ timer = setTimeout(() => stopCurrent?.(timeoutError), timeoutMs);
478
473
  const currentApi = workerApi;
479
474
  const currentGeneration = workerGeneration;
480
475
  operationWorkerGeneration = currentGeneration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifest-configuration-language/browser",
3
- "version": "0.3.24",
3
+ "version": "0.3.27",
4
4
  "description": "Run MCL projects in a browser Web Worker using the Go WebAssembly runtime.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "typescript": "^7.0.2"
34
34
  },
35
35
  "engines": {
36
- "node": ">=26.13.0"
36
+ "node": ">=24.22.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build:wasm": "node ./scripts/build-wasm.mjs",