diff --git a/package.json b/package.json index 5ae0f3898..e765e4bd5 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,9 @@ "dependencies": { "@babel/parser": "^7.19.4", "@commander-js/extra-typings": "^14.0.0", + "@sourceacademy/common-cse-machine": "^0.1.0", + "@sourceacademy/conductor": "https://github.com/source-academy/conductor.git#0.5.0", + "@sourceacademy/runner-cse-machine": "^1.0.0", "@ts-morph/bootstrap": "^0.18.0", "acorn": "^8.8.2", "acorn-class-fields": "^1.0.0", @@ -45,6 +48,7 @@ "scripts": { "build": "yarn docs && yarn build:slang", "build:slang": "tsc --project tsconfig.prod.json", + "build:evaluators": "node scripts/build-evaluators.mjs", "eslint": "eslint --concurrency=auto src scripts", "format": "prettier --write \"src/**/*.{ts,tsx}\"", "format:ci": "prettier --list-different \"src/**/*.{ts,tsx}\"", @@ -59,6 +63,12 @@ "prepare": "husky" }, "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.3", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-replace": "^6.0.3", + "@rollup/plugin-terser": "^1.0.0", "@types/estree": "^1.0.5", "@types/lodash": "^4.14.202", "@types/node": "^24.12.2", @@ -67,13 +77,18 @@ "@vitest/ui": "^4.0.4", "ace-builds": "~1.17.0", "coveralls": "^3.1.0", + "esbuild": "^0.25.0", "eslint": "^9.39.1", "eslint-plugin-import": "^2.32.0", "globals": "^17.0.0", "husky": "^9.0.0", "jsdoc": "4.0.5", "jsdom": "^29.0.0", + "path-browserify": "^1.0.1", "prettier": "^3.6.2", + "rollup": "^4.59.0", + "rollup-plugin-esbuild": "^6.2.1", + "rollup-plugin-polyfill-node": "^0.13.0", "typescript": "^6.0.2", "typescript-eslint": "^8.46.3", "vitest": "^4.0.4" diff --git a/rollup.config.evaluator.mjs b/rollup.config.evaluator.mjs new file mode 100644 index 000000000..9937c2936 --- /dev/null +++ b/rollup.config.evaluator.mjs @@ -0,0 +1,79 @@ +import alias from '@rollup/plugin-alias'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import nodeResolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import terser from '@rollup/plugin-terser'; +import { fileURLToPath } from 'node:url'; +import esbuild from 'rollup-plugin-esbuild'; +import nodePolyfills from 'rollup-plugin-polyfill-node'; + +const EVALUATOR = process.env.EVALUATOR; +if (!EVALUATOR) { + throw new Error('EVALUATOR env var must be set. Use scripts/build-evaluators.mjs.'); +} + +const shim = name => fileURLToPath(new URL(`./scripts/evaluator-shims/${name}`, import.meta.url)); + +// js-slang has a few inline `require('')` calls inside ES modules that +// @rollup/plugin-commonjs cannot rewrite (it skips modules its acorn parser rejects as TS). +// This transform rewrites those static requires into hoisted ESM imports first. +function rewriteStaticRequires(modules) { + const pattern = new RegExp(`require\\((['"])(${modules.join('|')})\\1\\)`, 'g'); + return { + name: 'rewrite-static-requires', + transform(code) { + if (!pattern.test(code)) return null; + pattern.lastIndex = 0; + const imports = new Map(); + const replaced = code.replace(pattern, (_match, _quote, name) => { + const local = `__req_${name.replace(/[^a-zA-Z0-9]/g, '_')}`; + imports.set(name, local); + return local; + }); + const header = [...imports].map(([name, local]) => `import ${local} from '${name}';`).join('\n'); + return { code: `${header}\n${replaced}`, map: null }; + }, + }; +} + +function plugins() { + return [ + rewriteStaticRequires(['acorn-class-fields']), + replace({ + preventAssignment: true, + values: { __EVALUATOR__: EVALUATOR }, + }), + alias({ + entries: [ + { find: 'path', replacement: shim('path.mjs') }, + { find: 'inspector', replacement: shim('empty.mjs') }, + ], + }), + esbuild({ target: 'es2020', sourceMap: true }), + commonjs({ transformMixedEsModules: true }), + json(), + nodeResolve({ preferBuiltins: false, browser: true }), + nodePolyfills(), + terser({ compress: { dead_code: true, passes: 2 } }), + ]; +} + +export default { + treeshake: { moduleSideEffects: false }, + input: 'src/conductor/initialise.ts', + output: { + file: `dist/${EVALUATOR}.js`, + format: 'iife', + name: 'JsSlangWorker', + sourcemap: true, + banner: [ + 'var global = typeof globalThis !== "undefined" ? globalThis : self;', + 'var process = (typeof globalThis !== "undefined" && globalThis.process) || ' + + '{ env: { NODE_ENV: "production" }, argv: [], platform: "browser", version: "", ' + + 'versions: {}, nextTick: function (f) { Promise.resolve().then(f); }, ' + + 'cwd: function () { return "/"; }, browser: true };', + ].join('\n'), + }, + plugins: plugins(), +}; diff --git a/scripts/build-evaluators.mjs b/scripts/build-evaluators.mjs new file mode 100644 index 000000000..6ee6726f7 --- /dev/null +++ b/scripts/build-evaluators.mjs @@ -0,0 +1,28 @@ +#!/usr/bin/env node +import { spawn } from 'node:child_process'; + +// Keep in sync with exports in src/conductor/index.ts. +const targets = ['SourceEvaluator1', 'JSCseEvaluator3', 'JSCseEvaluator4']; + +function buildTarget(target) { + console.log(`\nBuilding ${target}...\n`); + return new Promise((resolve, reject) => { + const child = spawn( + process.execPath, + ['--max-old-space-size=4096', 'node_modules/rollup/dist/bin/rollup', '-c', 'rollup.config.evaluator.mjs'], + { + env: { ...process.env, EVALUATOR: target }, + stdio: 'inherit', + shell: false, + }, + ); + child.on('close', code => { + if (code === 0) resolve(); + else reject(new Error(`Build failed for ${target} (exit ${code})`)); + }); + }); +} + +for (const target of targets) { + await buildTarget(target); +} diff --git a/scripts/evaluator-shims/empty.mjs b/scripts/evaluator-shims/empty.mjs new file mode 100644 index 000000000..ff8b4c563 --- /dev/null +++ b/scripts/evaluator-shims/empty.mjs @@ -0,0 +1 @@ +export default {}; diff --git a/scripts/evaluator-shims/path.mjs b/scripts/evaluator-shims/path.mjs new file mode 100644 index 000000000..58ae03f90 --- /dev/null +++ b/scripts/evaluator-shims/path.mjs @@ -0,0 +1,8 @@ +import pathBrowserify from 'path-browserify'; + +const path = pathBrowserify.default ?? pathBrowserify; + +export default path; +export const posix = path.posix ?? path; +export const win32 = path.win32 ?? path; +export const { basename, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, relative, resolve, sep } = path; diff --git a/src/conductor/JSCseEvaluator.ts b/src/conductor/JSCseEvaluator.ts new file mode 100644 index 000000000..cee202588 --- /dev/null +++ b/src/conductor/JSCseEvaluator.ts @@ -0,0 +1,503 @@ +import { BasicEvaluator, IRunnerPlugin } from '@sourceacademy/conductor/runner'; +import type { Identifier, RestElement } from 'estree'; + +import type { + CseSerializedEnvFrame, + CseSerializedInstruction, + CseSerializedValue, + CseSnapshot, +} from '@sourceacademy/common-cse-machine'; +import { CseMachinePlugin } from '@sourceacademy/runner-cse-machine'; +import Closure from '../cse-machine/closure'; +import { Control, generateCSEMachineStateStream, Stash } from '../cse-machine/interpreter'; +import { InstrType } from '../cse-machine/types'; +import { createContext, parseError } from '../index'; +import { Chapter } from '../langs'; +import preprocessFileImports from '../modules/preprocessor'; +import type { Context, Environment, Value } from '../types'; +import { stringify } from '../utils/stringify'; +import * as seq from '../utils/statementSeqTransform'; + +// ── Value serialisation ─────────────────────────────────────────────────────── + +function serializeValue(v: Value, depth = 0): CseSerializedValue { + if (v instanceof Closure) { + const paramNames = v.node.params.map((p: Identifier | RestElement) => + p.type === 'RestElement' ? '...' + (p.argument as Identifier).name : p.name, + ); + const funcName = v.declaredName ?? v.functionName; + return { + displayValue: funcName, + label: 'closure', + metadata: { closureFrameId: v.environment.id, params: paramNames, funcName }, + }; + } + + if (Array.isArray(v)) { + if (depth > 2) return { displayValue: '[...]', label: 'array' }; + const items = v.map(el => serializeValue(el, depth + 1)); + return { + displayValue: stringify(v), + label: 'array', + metadata: { + elements: items, + id: (v as any).id, + envId: (v as any).environment?.id ?? null, + }, + }; + } + + if (v === null) return { displayValue: 'null', label: 'null' }; + if (v === undefined) return { displayValue: 'undefined', label: 'undefined' }; + + switch (typeof v) { + case 'number': + return { displayValue: String(v), label: 'number' }; + case 'string': + return { displayValue: `"${v}"`, label: 'string' }; + case 'boolean': + return { displayValue: String(v), label: 'boolean' }; + // Native (builtin) functions reach here — label them 'builtin' so the adapter + // doesn't try to reconstruct them as closures (which would produce null environments). + case 'function': + return { displayValue: stringify(v), label: 'builtin' }; + default: + return { displayValue: stringify(v), label: typeof v }; + } +} + +// ── Control serialisation ───────────────────────────────────────────────────── + +const INSTR_DISPLAY: Partial> = { + [InstrType.RESET]: 'return', + [InstrType.POP]: 'pop', + [InstrType.ASSIGNMENT]: 'assign', + [InstrType.UNARY_OP]: 'unary op', + [InstrType.BINARY_OP]: 'binary op', + [InstrType.APPLICATION]: 'call', + [InstrType.BRANCH]: 'branch', + [InstrType.WHILE]: 'while', + [InstrType.FOR]: 'for', + [InstrType.CONTINUE]: 'continue', + [InstrType.CONTINUE_MARKER]: 'mark', + [InstrType.BREAK]: 'break', + [InstrType.BREAK_MARKER]: 'mark', + [InstrType.ARRAY_LITERAL]: 'arr lit', + [InstrType.ARRAY_ACCESS]: 'arr acc', + [InstrType.ARRAY_ASSIGNMENT]: 'arr asgn', + [InstrType.ARRAY_LENGTH]: 'arr len', + [InstrType.MARKER]: 'marker', + [InstrType.SPREAD]: 'spread', +}; + +// Extract the full source text between two positions (multi-line aware). +function extractSourceRange(source: string, loc: any): string | null { + if (!loc?.start || !source) return null; + const lines = source.split('\n'); + const sl = loc.start.line - 1; + const el = (loc.end?.line ?? loc.start.line) - 1; + const sc = loc.start.column ?? 0; + if (sl < 0 || sl >= lines.length) return null; + if (sl === el) { + const ec = loc.end?.column ?? lines[sl].length; + return lines[sl].slice(sc, ec).trim() || null; + } + const chunks = [lines[sl].slice(sc)]; + for (let i = sl + 1; i < el && i < lines.length; i++) chunks.push(lines[i]); + if (el < lines.length) chunks.push(lines[el].slice(0, loc.end?.column ?? lines[el].length)); + return chunks.join('\n').trim() || null; +} + +// Minimal AST→string for nodes synthesised by the CSE machine (no source loc). +function nodeToString(node: any): string { + if (!node) return '?'; + switch (node.type) { + case 'VariableDeclaration': { + const d = node.declarations?.[0]; + const id = d?.id?.name ?? '?'; + const init = d?.init ? nodeToString(d.init) : undefined; + return `${node.kind ?? 'const'} ${id}${init !== undefined ? ` = ${init}` : ''}`; + } + case 'ArrowFunctionExpression': { + const params = (node.params ?? []) + .map((p: any) => + p.type === 'RestElement' ? `...${p.argument?.name ?? '?'}` : (p.name ?? '?'), + ) + .join(', '); + const paramsStr = (node.params?.length ?? 0) === 1 ? params : `(${params})`; + const body = + node.body?.type === 'BlockStatement' + ? `{\n${(node.body.body ?? []).map((s: any) => ' ' + nodeToString(s)).join('\n')}\n}` + : nodeToString(node.body); + return `${paramsStr} => ${body}`; + } + case 'BlockStatement': + return `{\n${(node.body ?? []).map((s: any) => ' ' + nodeToString(s)).join('\n')}\n}`; + case 'ReturnStatement': + return `return${node.argument ? ' ' + nodeToString(node.argument) : ''};`; + case 'ExpressionStatement': + return nodeToString(node.expression) + ';'; + case 'Identifier': + return node.name ?? '?'; + case 'Literal': + return JSON.stringify(node.value); + case 'BinaryExpression': + return `${nodeToString(node.left)} ${node.operator} ${nodeToString(node.right)}`; + case 'UnaryExpression': + return `${node.operator}${nodeToString(node.argument)}`; + case 'CallExpression': { + const args = (node.arguments ?? []).map(nodeToString).join(', '); + return `${nodeToString(node.callee)}(${args})`; + } + case 'ArrayExpression': + return `[${(node.elements ?? []).map(nodeToString).join(', ')}]`; + case 'MemberExpression': + return node.computed + ? `${nodeToString(node.object)}[${nodeToString(node.property)}]` + : `${nodeToString(node.object)}.${nodeToString(node.property)}`; + default: + return node.type ?? '?'; + } +} + +function serializeControlItem(item: any, source?: string): CseSerializedInstruction { + if (item?.instrType !== undefined) { + // ENVIRONMENT handled specially — adapter looks it up by envId, no instrType needed. + if (item.instrType === InstrType.ENVIRONMENT && item.env?.id) { + return { displayText: 'ENVIRONMENT', metadata: { envId: item.env.id as string } }; + } + if (item.instrType === InstrType.ASSIGNMENT && item.symbol) { + return { + displayText: `assign ${item.symbol}`, + metadata: { instrType: item.instrType, symbol: item.symbol as string }, + }; + } + if (item.instrType === InstrType.APPLICATION && item.numOfArgs !== undefined) { + return { + displayText: `call ${item.numOfArgs}`, + metadata: { instrType: item.instrType, numOfArgs: item.numOfArgs as number }, + }; + } + // ArrLitInstr uses .arity (not .numOfElements) + if (item.instrType === InstrType.ARRAY_LITERAL && item.arity !== undefined) { + return { + displayText: `arr lit ${item.arity}`, + metadata: { instrType: item.instrType, arity: item.arity as number }, + }; + } + if (item.instrType === InstrType.BINARY_OP && item.symbol) { + return { displayText: item.symbol as string, metadata: { instrType: item.instrType } }; + } + if (item.instrType === InstrType.UNARY_OP && item.symbol) { + return { displayText: item.symbol as string, metadata: { instrType: item.instrType } }; + } + const displayText = INSTR_DISPLAY[item.instrType as InstrType] ?? String(item.instrType); + return { displayText, metadata: { instrType: item.instrType } }; + } + + if (item?.type !== undefined) { + const loc = item.loc; + let displayText: string; + + if (item.type === 'BlockStatement' || item.type === 'Program') { + const body = extractSourceRange(source ?? '', loc); + displayText = body + ? `{\n${body + .split('\n') + .map(l => ' ' + l) + .join('\n')}\n}` + : '{ ... }'; + } else if (item.type === 'StatementSequence') { + displayText = extractSourceRange(source ?? '', loc) ?? '...'; + } else if (item.type === 'VariableDeclaration') { + displayText = nodeToString(item); + } else if (item.type === 'ArrowFunctionExpression') { + displayText = nodeToString(item); + } else { + displayText = extractSourceRange(source ?? '', loc) ?? nodeToString(item); + } + + // Serialize node type metadata so the adapter can reconstruct proper fake nodes + // for the animation system (instead of falling back to a generic Identifier). + const isBlockLike = + item.type === 'BlockStatement' || + item.type === 'Program' || + item.type === 'StatementSequence'; + const animMeta: Record = { nodeType: item.type as string }; + if (isBlockLike && Array.isArray(item.body)) { + animMeta.bodyLength = item.body.length; + animMeta.bodyNodeTypes = (item.body as any[]).map((n: any) => n?.type as string | undefined); + } + + if (loc?.start && loc?.end) { + return { + displayText, + metadata: { + ...animMeta, + startLine: loc.start.line as number, + endLine: loc.end.line as number, + }, + }; + } + return { displayText, metadata: animMeta }; + } + + return { displayText: '' }; +} + +// ── Environment serialisation ───────────────────────────────────────────────── + +function serializeEnvChain( + callStackEnvs: Environment[], + stashItems: Value[], + rawControl: any[], +): CseSerializedEnvFrame[] { + const seen = new Set(); + const queue: Environment[] = []; + + const visit = (env: Environment | null | undefined) => { + if (!env || seen.has(env.id)) return; + seen.add(env.id); + queue.push(env); + visit(env.tail); + for (const val of Object.values(env.head)) { + if (val instanceof Closure) visit(val.environment); + } + }; + + for (const env of callStackEnvs) visit(env); + for (const val of stashItems) { + if (val instanceof Closure) visit(val.environment); + } + for (const item of rawControl) { + if (item?.instrType === InstrType.ENVIRONMENT && item.env) visit(item.env as Environment); + } + + const callStackIds = new Set(callStackEnvs.map(e => e.id)); + + return queue.map(env => { + // The global env (id='-1', name='global') carries all Source builtins put there by + // defineBuiltin/defineSymbol. These are noisy — hide its bindings but keep the frame + // itself so the environment chain renders correctly. + // programEnvironment and all inner frames contain user-defined variables and must show bindings. + const isGlobalEnv = env.id === '-1' || (env.name === 'global' && env.tail === null); + const bindings = isGlobalEnv + ? [] + : Object.entries(Object.getOwnPropertyDescriptors(env.head)) + .filter( + ([, desc]) => + // Hide native builtin functions (not Closure instances) + !(typeof desc.value === 'function' && !(desc.value instanceof Closure)), + ) + .map(([name, desc]) => ({ + name, + // Uninitialized const placeholder (Symbol) — pass as special 'unassigned' label + // so the adapter can reconstruct Symbol('const declaration') for Frame.tsx. + value: + typeof desc.value === 'symbol' + ? { displayValue: '', label: 'unassigned' } + : serializeValue(desc.value), + isConst: desc.writable === false, + })); + + // Serialize closures/arrays in the frame's heap that are NOT already referenced via + // a named head binding. These are "anonymous" heap objects (e.g. a lambda returned + // from a function before being assigned) that the visualizer shows as dangling arrows + // from the frame — getUnreferencedObjects() looks them up via env.heap. + const headValues = new Set(Object.values(env.head)); + const heapObjects = + isGlobalEnv || !env.heap + ? [] + : [...env.heap.getHeap()] + .filter(obj => obj instanceof Closure && !headValues.has(obj)) + .map(obj => serializeValue(obj as Value)); + + return { + id: env.id, + name: env.name, + parentId: env.tail?.id ?? null, + bindings, + heapObjects: heapObjects.length > 0 ? heapObjects : undefined, + isActive: env.id === callStackEnvs[0]?.id, + isOnCallStack: callStackIds.has(env.id), + }; + }); +} + +// ── Snapshot collection ─────────────────────────────────────────────────────── + +// Quick structural fingerprint for deduplication — only hashes displayText/displayValue +// which is what the user actually sees. Two steps with identical fingerprints are visually +// identical even if internal interpreter state differs. +function snapshotFingerprint(snap: CseSnapshot): string { + const ctrl = snap.control.map(i => i.displayText).join('|'); + const stsh = snap.stash.map(v => v.displayValue).join('|'); + const envs = snap.environments + .map(e => e.id + ':' + e.bindings.map(b => b.name + '=' + b.value.displayValue).join(',')) + .join(';'); + return `${ctrl}§${stsh}§${envs}`; +} + +function collectSnapshots( + context: Context, + control: Control, + stash: Stash, + source: string, + maxSnapshots: number = 1000, +): CseSnapshot[] { + const snapshots: CseSnapshot[] = []; + + // Capture the initial state BEFORE the generator runs its first step. + // The Program handler processes the whole program in one step (creating programEnvironment, + // hoisting names, pushing StatementSequence), so the generator's first yield already shows + // the "opened" block. We manually capture the Program node on control here so the user + // sees step 1 as { } — matching the non-conductor CSE machine. + const initRawControl = control.getStack(); + const initRawStash = stash.getStack(); + // Step 0: nothing evaluated yet, so the "current node" is the program node sitting + // on top of control (matches non-conductor, which highlights the program's line 1). + const initTop = initRawControl[initRawControl.length - 1]; + const initSnap: CseSnapshot = { + stepIndex: 0, + control: initRawControl + .slice() + .reverse() + .map(item => serializeControlItem(item, source)), + stash: initRawStash + .slice() + .reverse() + .map(v => serializeValue(v)), + environments: serializeEnvChain(context.runtime.environments, initRawStash, initRawControl), + currentLine: (initTop as any)?.loc?.start?.line, + }; + snapshots.push(initSnap); + + // The js-slang generator is synchronous (function*), so for...of avoids the + // microtask-per-step overhead that for-await-of would impose. + const stream = generateCSEMachineStateStream(context, control, stash, -1, -1); + let lastFingerprint = snapshotFingerprint(initSnap); + + for (const { stash: s, control: c, steps } of stream) { + if (snapshots.length >= maxSnapshots) break; + + const rawControl = c.getStack(); + const rawStash = s.getStack(); + // The node most recently evaluated at this step. Mirrors non-conductor + // updateInspector, which reads context.runtime.nodes[0] for the blue line. + const currentNode = context.runtime.nodes[0] as any; + const snap: CseSnapshot = { + stepIndex: steps - 1, + control: rawControl + .slice() + .reverse() + .map(item => serializeControlItem(item, source)), + stash: rawStash + .slice() + .reverse() + .map(v => serializeValue(v)), + environments: serializeEnvChain(context.runtime.environments, rawStash, rawControl), + currentLine: currentNode?.loc?.start?.line, + }; + const fp = snapshotFingerprint(snap); + if (fp !== lastFingerprint) { + snapshots.push(snap); + lastFingerprint = fp; + } + } + + return snapshots; +} + +// ── Evaluator base ──────────────────────────────────────────────────────────── + +abstract class JSCseEvaluatorBase extends BasicEvaluator { + protected abstract readonly chapter: Chapter; + protected context!: Context; + private readonly csePlugin: CseMachinePlugin; + + constructor(conductor: IRunnerPlugin) { + super(conductor); + // Cast bridges the IPlugin type difference between this repo's (local/portal) + // conductor and the one @sourceacademy/runner-cse-machine builds against. Once both + // use the same published conductor, the cast can be removed. + this.csePlugin = conductor.registerPlugin(CseMachinePlugin); + } + + protected initContext(): void { + this.context = createContext(this.chapter); + } + + async evaluateChunk(chunk: string): Promise { + if (!this.context) this.initContext(); + + const preprocessResult = await preprocessFileImports( + path => (path === '/code.js' ? Promise.resolve(chunk) : Promise.resolve(undefined)), + '/code.js', + this.context, + ); + + if (!preprocessResult.ok) { + for (const error of this.context.errors) { + this.conductor.sendOutput(`Error: ${error.explain()}`); + } + this.context.errors = []; + return undefined; + } + + const { program } = preprocessResult; + seq.transform(program); + + const control = new Control(program); + const stash = new Stash(); + this.context.runtime.control = control; + this.context.runtime.stash = stash; + + try { + const configRaw = await this.conductor.requestFile('/__cse_config__'); + let maxSnapshots = 1000; + if (configRaw) { + try { + maxSnapshots = (JSON.parse(configRaw) as { stepLimit?: number }).stepLimit ?? 1000; + } catch { + // malformed config — fall back to default + } + } + const snapshots = collectSnapshots(this.context, control, stash, chunk, maxSnapshots); + this.csePlugin.sendSnapshots(snapshots); + + // Return the final stash value so BasicEvaluator.startEvaluator sends it as the result. + // (BasicEvaluator calls conductor.sendResult(await evaluateChunk(...)) — do NOT call + // sendResult here too or every program gets two result entries in the home tab.) + const finalStash = stash.getStack(); + return finalStash[finalStash.length - 1]; + } catch (e) { + const msg = + this.context.errors.length > 0 + ? parseError(this.context.errors) + : e instanceof Error + ? e.message + : String(e); + this.conductor.sendOutput(`Error: ${msg}`); + this.context.errors = []; + return undefined; + } + } +} + +// ── Concrete evaluators ─────────────────────────────────────────────────────── + +export class JSCseEvaluator3 extends JSCseEvaluatorBase { + protected readonly chapter = Chapter.SOURCE_3; + constructor(conductor: IRunnerPlugin) { + super(conductor); + this.initContext(); + } +} + +export class JSCseEvaluator4 extends JSCseEvaluatorBase { + protected readonly chapter = Chapter.SOURCE_4; + constructor(conductor: IRunnerPlugin) { + super(conductor); + this.initContext(); + } +} diff --git a/src/conductor/SourceEvaluator1.ts b/src/conductor/SourceEvaluator1.ts new file mode 100644 index 000000000..d57a94ac4 --- /dev/null +++ b/src/conductor/SourceEvaluator1.ts @@ -0,0 +1,29 @@ +import { BasicEvaluator } from '@sourceacademy/conductor/runner'; +import { createContext, parseError, runFilesInContext } from '../index'; +import { Chapter } from '../langs'; + +export class SourceEvaluator1 extends BasicEvaluator { + private context = createContext(Chapter.SOURCE_1); + + async evaluateChunk(chunk: string): Promise { + try { + const result = await runFilesInContext({ '/code.js': chunk }, '/code.js', this.context); + + if (result.status === 'finished') { + return result.value; + } + + this.conductor.sendOutput(`Error: ${parseError(this.context.errors)}`); + this.context.errors = []; + } catch (e) { + const msg = + this.context.errors.length > 0 + ? parseError(this.context.errors) + : e instanceof Error + ? e.message + : String(e); + this.conductor.sendOutput(`Error: ${msg}`); + this.context.errors = []; + } + } +} diff --git a/src/conductor/evaluator.ts b/src/conductor/evaluator.ts new file mode 100644 index 000000000..642b3fb1a --- /dev/null +++ b/src/conductor/evaluator.ts @@ -0,0 +1,4 @@ +// @ts-expect-error — __EVALUATOR__ is replaced at build time by @rollup/plugin-replace +import { __EVALUATOR__ } from './index'; + +export default __EVALUATOR__; diff --git a/src/conductor/index.ts b/src/conductor/index.ts new file mode 100644 index 000000000..e66bbe86e --- /dev/null +++ b/src/conductor/index.ts @@ -0,0 +1,2 @@ +export { SourceEvaluator1 } from './SourceEvaluator1'; +export { JSCseEvaluator3, JSCseEvaluator4 } from './JSCseEvaluator'; diff --git a/src/conductor/initialise.ts b/src/conductor/initialise.ts new file mode 100644 index 000000000..c056a019e --- /dev/null +++ b/src/conductor/initialise.ts @@ -0,0 +1,5 @@ +import { initialise } from '@sourceacademy/conductor/runner'; +// @ts-expect-error — __EVALUATOR__ is replaced at build time by @rollup/plugin-replace +import { __EVALUATOR__ } from './index'; + +initialise(__EVALUATOR__); diff --git a/src/stepper/__tests__/stepper_full.test.ts b/src/stepper/__tests__/stepper_full.test.ts index 8a848b4b2..1234aa741 100644 --- a/src/stepper/__tests__/stepper_full.test.ts +++ b/src/stepper/__tests__/stepper_full.test.ts @@ -1,6 +1,6 @@ import * as acorn from 'acorn'; -import { generate as customGenerate } from '../utils'; import { describe, expect, test } from 'vitest'; +import { generate as customGenerate } from '../utils'; import createContext from '../../createContext'; import { mockContext } from '../../utils/testing/mocks'; import { convert } from '../generator'; diff --git a/src/stepper/generator.ts b/src/stepper/generator.ts index 9e36c1913..385628a48 100644 --- a/src/stepper/generator.ts +++ b/src/stepper/generator.ts @@ -8,8 +8,8 @@ Every class should have the following properties */ import type es from 'estree'; -import { generate } from './utils'; import assert from '../utils/assert'; +import { generate } from './utils'; import { isBuiltinFunction } from './builtins'; import type { StepperBaseNode } from './interface'; import { StepperArrayExpression } from './nodes/Expression/ArrayExpression'; diff --git a/src/stepper/interface.ts b/src/stepper/interface.ts index 8b9e2f31c..7f45d5b29 100644 --- a/src/stepper/interface.ts +++ b/src/stepper/interface.ts @@ -1,6 +1,6 @@ import type { BaseNode, Comment, SourceLocation } from 'estree'; -import { generate } from './utils'; import type { Node, ReplResult } from '../types'; +import { generate } from './utils'; import type { StepperExpression, StepperPattern } from './nodes'; import type { RedexInfo } from '.'; diff --git a/yarn.lock b/yarn.lock index a6aff1a93..08df22a3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -224,6 +224,188 @@ __metadata: languageName: node linkType: hard +"@esbuild/aix-ppc64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/aix-ppc64@npm:0.25.12" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/android-arm64@npm:0.25.12" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/android-arm@npm:0.25.12" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/android-x64@npm:0.25.12" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/darwin-arm64@npm:0.25.12" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/darwin-x64@npm:0.25.12" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/freebsd-arm64@npm:0.25.12" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/freebsd-x64@npm:0.25.12" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-arm64@npm:0.25.12" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-arm@npm:0.25.12" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-ia32@npm:0.25.12" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-loong64@npm:0.25.12" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@esbuild/linux-mips64el@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-mips64el@npm:0.25.12" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-ppc64@npm:0.25.12" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-riscv64@npm:0.25.12" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-s390x@npm:0.25.12" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/linux-x64@npm:0.25.12" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/netbsd-arm64@npm:0.25.12" + conditions: os=netbsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/netbsd-x64@npm:0.25.12" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/openbsd-arm64@npm:0.25.12" + conditions: os=openbsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/openbsd-x64@npm:0.25.12" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openharmony-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/openharmony-arm64@npm:0.25.12" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/sunos-x64@npm:0.25.12" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/win32-arm64@npm:0.25.12" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/win32-ia32@npm:0.25.12" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.25.12": + version: 0.25.12 + resolution: "@esbuild/win32-x64@npm:0.25.12" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.8.0": version: 4.9.0 resolution: "@eslint-community/eslint-utils@npm:4.9.0" @@ -427,6 +609,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.13 + resolution: "@jridgewell/gen-mapping@npm:0.3.13" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10c0/9a7d65fb13bd9aec1fbab74cda08496839b7e2ceb31f5ab922b323e94d7c481ce0fc4fd7e12e2610915ed8af51178bdc61e168e92a8c8b8303b030b03489b13b + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.2 resolution: "@jridgewell/resolve-uri@npm:3.1.2" @@ -434,6 +626,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.11 + resolution: "@jridgewell/source-map@npm:0.3.11" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + checksum: 10c0/50a4fdafe0b8f655cb2877e59fe81320272eaa4ccdbe6b9b87f10614b2220399ae3e05c16137a59db1f189523b42c7f88bd097ee991dbd7bc0e01113c583e844 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.14": version: 1.5.4 resolution: "@jridgewell/sourcemap-codec@npm:1.5.4" @@ -441,14 +643,14 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.5.5": +"@jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5": version: 1.5.5 resolution: "@jridgewell/sourcemap-codec@npm:1.5.5" checksum: 10c0/f9e538f302b63c0ebc06eecb1dd9918dd4289ed36147a0ddce35d6ea4d7ebbda243cda7b2213b6a5e1d8087a298d5cf630fb2bd39329cdecb82017023f6081a0 languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.31": +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.31": version: 0.3.31 resolution: "@jridgewell/trace-mapping@npm:0.3.31" dependencies: @@ -665,6 +867,308 @@ __metadata: languageName: node linkType: hard +"@rollup/plugin-alias@npm:^5.1.1": + version: 5.1.1 + resolution: "@rollup/plugin-alias@npm:5.1.1" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/00592400563b65689631e820bd72ff440f5cd21021bbd2f21b8558582ab58fd109067da77000091e40fcb8c20cabcd3a09b239a30e012bb47f6bc1a15b68ca59 + languageName: node + linkType: hard + +"@rollup/plugin-commonjs@npm:^28.0.3": + version: 28.0.9 + resolution: "@rollup/plugin-commonjs@npm:28.0.9" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + commondir: "npm:^1.0.1" + estree-walker: "npm:^2.0.2" + fdir: "npm:^6.2.0" + is-reference: "npm:1.2.1" + magic-string: "npm:^0.30.3" + picomatch: "npm:^4.0.2" + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/b7af70614a53c549a1ba1e9647879b644bcf44ec78850f04018b929f4ee414274f867fa438308409a06ef8a3a179ed24c25e4f8ef77eb341dfddd2b0cb88c389 + languageName: node + linkType: hard + +"@rollup/plugin-inject@npm:^5.0.4": + version: 5.0.5 + resolution: "@rollup/plugin-inject@npm:5.0.5" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + estree-walker: "npm:^2.0.2" + magic-string: "npm:^0.30.3" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/22d10cf44fa56a6683d5ac4df24a9003379b3dcaae9897f5c30c844afc2ebca83cfaa5557f13a1399b1c8a0d312c3217bcacd508b7ebc4b2cbee401bd1ec8be2 + languageName: node + linkType: hard + +"@rollup/plugin-json@npm:^6.1.0": + version: 6.1.0 + resolution: "@rollup/plugin-json@npm:6.1.0" + dependencies: + "@rollup/pluginutils": "npm:^5.1.0" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/9400c431b5e0cf3088ba2eb2d038809a2b0fb2a84ed004997da85582f48cd64958ed3168893c4f2c8109e38652400ed68282d0c92bf8ec07a3b2ef2e1ceab0b7 + languageName: node + linkType: hard + +"@rollup/plugin-node-resolve@npm:^16.0.1": + version: 16.0.3 + resolution: "@rollup/plugin-node-resolve@npm:16.0.3" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + "@types/resolve": "npm:1.20.2" + deepmerge: "npm:^4.2.2" + is-module: "npm:^1.0.0" + resolve: "npm:^1.22.1" + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/5bafff8e51cd28b5b3b8f415c30a893f5bfdb1a54469e00b3dc6530f26051620f3dfa172f40544361948b46cc3070cb34fd44ade66d38c0677d74c846fbc58dc + languageName: node + linkType: hard + +"@rollup/plugin-replace@npm:^6.0.3": + version: 6.0.3 + resolution: "@rollup/plugin-replace@npm:6.0.3" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + magic-string: "npm:^0.30.3" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/93217c52fe86b03363bc534b5f07963ac4fd6b91f19f6070a66809b0c65a036b3b234624a65a8bfcc01a8dc0e42838feae03c021b0d1e5e91753c503c4d70cd6 + languageName: node + linkType: hard + +"@rollup/plugin-terser@npm:^1.0.0": + version: 1.0.0 + resolution: "@rollup/plugin-terser@npm:1.0.0" + dependencies: + serialize-javascript: "npm:^7.0.3" + smob: "npm:^1.0.0" + terser: "npm:^5.17.4" + peerDependencies: + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/08be445cc2e0677132ee06cdebbcd1b6cd3ab22e220fcd89d8a22eaf9ee501a940f425931ac65c65ab113803ad31a895f2575716248609c882c8e562fd6cc2d4 + languageName: node + linkType: hard + +"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.1.0": + version: 5.4.0 + resolution: "@rollup/pluginutils@npm:5.4.0" + dependencies: + "@types/estree": "npm:^1.0.0" + estree-walker: "npm:^2.0.2" + picomatch: "npm:^4.0.2" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/ccc2cbd3a05df642df60ab05ffb81b2e564bd945e2a118bb8a474ea75b941033c8f44273133d4865643cca1492d0c80b14de1281f74779a64285a80fc3a194d8 + languageName: node + linkType: hard + +"@rollup/rollup-android-arm-eabi@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.62.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-android-arm64@npm:4.62.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.62.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.62.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-arm64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.62.0" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-x64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-freebsd-x64@npm:4.62.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.62.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.62.0" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.62.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.62.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-loong64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.62.0" + conditions: os=linux & cpu=loong64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-loong64-musl@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-loong64-musl@npm:4.62.0" + conditions: os=linux & cpu=loong64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-ppc64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.62.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-ppc64-musl@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.62.0" + conditions: os=linux & cpu=ppc64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.62.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-musl@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.62.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-s390x-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.62.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.62.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.62.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-openbsd-x64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-openbsd-x64@npm:4.62.0" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-openharmony-arm64@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-openharmony-arm64@npm:4.62.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.62.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.62.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-gnu@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-win32-x64-gnu@npm:4.62.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.62.0": + version: 4.62.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.62.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@rtsao/scc@npm:^1.1.0": version: 1.1.0 resolution: "@rtsao/scc@npm:1.1.0" @@ -672,6 +1176,30 @@ __metadata: languageName: node linkType: hard +"@sourceacademy/common-cse-machine@npm:^0.1.0": + version: 0.1.0 + resolution: "@sourceacademy/common-cse-machine@npm:0.1.0" + checksum: 10c0/7c31a0629e15b6d1c9d8a67228d290555003c4862e7298ef591fe4a33cb2ccc3372675d7165029af3ad47dd68b6cc116f4ca8843e5a8306c0f62531c5c01fd4a + languageName: node + linkType: hard + +"@sourceacademy/conductor@https://github.com/source-academy/conductor.git#0.5.0": + version: 0.5.0 + resolution: "@sourceacademy/conductor@https://github.com/source-academy/conductor.git#commit=2349aa912b32ff4f8b5bad2666243c6adad5677e" + checksum: 10c0/6f17b0f9bbd4630d73a3c4df043e05140f9c77b735fba4956442d3574c54f5918dd6113b3d52b1ed4238febc9ff2c03676c0200f7f1c5b5a3bc5eea92ecebea9 + languageName: node + linkType: hard + +"@sourceacademy/runner-cse-machine@npm:^1.0.0": + version: 1.0.0 + resolution: "@sourceacademy/runner-cse-machine@npm:1.0.0" + peerDependencies: + "@sourceacademy/common-cse-machine": ">=0.1.0" + "@sourceacademy/conductor": ">=0.3.0" + checksum: 10c0/9ff119df2783e9c2fc21a8107c5e87df26a914880bda442a9ddd562c39bb56b3889ee88bdaa1810a10206184ab15fabf6d6a95644e88d5dbe206525cbf409930 + languageName: node + linkType: hard + "@standard-schema/spec@npm:^1.1.0": version: 1.1.0 resolution: "@standard-schema/spec@npm:1.1.0" @@ -725,7 +1253,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:^1.0.0, @types/estree@npm:^1.0.5, @types/estree@npm:^1.0.6": +"@types/estree@npm:*, @types/estree@npm:1.0.9, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.5, @types/estree@npm:^1.0.6": version: 1.0.9 resolution: "@types/estree@npm:1.0.9" checksum: 10c0/3ad3286ca2988cd550dafb8f2ad599c8474868e954fa601a36655bdfefd8039f7c714b8c1c7f2ae219ffbd58bd4660e66fa7479a0120fc02d4777057d4865387 @@ -786,6 +1314,13 @@ __metadata: languageName: node linkType: hard +"@types/resolve@npm:1.20.2": + version: 1.20.2 + resolution: "@types/resolve@npm:1.20.2" + checksum: 10c0/c5b7e1770feb5ccfb6802f6ad82a7b0d50874c99331e0c9b259e415e55a38d7a86ad0901c57665d93f75938be2a6a0bc9aa06c9749192cadb2e4512800bbc6e6 + languageName: node + linkType: hard + "@typescript-eslint/eslint-plugin@npm:8.60.1": version: 8.60.1 resolution: "@typescript-eslint/eslint-plugin@npm:8.60.1" @@ -1525,6 +2060,13 @@ __metadata: languageName: node linkType: hard +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 10c0/124fff9d66d691a86d3b062eff4663fe437a9d9ee4b47b1b9e97f5a5d14f6d5399345db80f796827be7c95e70a8e765dd404b7c3ff3b3324f98e9b0c8826cc34 + languageName: node + linkType: hard + "cacache@npm:^19.0.1": version: 19.0.1 resolution: "cacache@npm:19.0.1" @@ -1656,6 +2198,20 @@ __metadata: languageName: node linkType: hard +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: 10c0/74c781a5248c2402a0a3e966a0a2bba3c054aad144f5c023364be83265e796b20565aa9feff624132ff629aa64e16999fa40a743c10c12f7c61e96a794b99288 + languageName: node + linkType: hard + +"commondir@npm:^1.0.1": + version: 1.0.1 + resolution: "commondir@npm:1.0.1" + checksum: 10c0/33a124960e471c25ee19280c9ce31ccc19574b566dc514fe4f4ca4c34fa8b0b57cf437671f5de380e11353ea9426213fca17687dd2ef03134fea2dbc53809fd6 + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -1796,7 +2352,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^4.4.3": +"debug@npm:^4.4.0, debug@npm:^4.4.3": version: 4.4.3 resolution: "debug@npm:4.4.3" dependencies: @@ -1822,6 +2378,13 @@ __metadata: languageName: node linkType: hard +"deepmerge@npm:^4.2.2": + version: 4.3.1 + resolution: "deepmerge@npm:4.3.1" + checksum: 10c0/e53481aaf1aa2c4082b5342be6b6d8ad9dfe387bc92ce197a66dea08bd4265904a087e75e464f14d1347cf2ac8afe1e4c16b266e0561cc5df29382d3c5f80044 + languageName: node + linkType: hard + "define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.4": version: 1.1.4 resolution: "define-data-property@npm:1.1.4" @@ -2022,6 +2585,13 @@ __metadata: languageName: node linkType: hard +"es-module-lexer@npm:^1.6.0": + version: 1.7.0 + resolution: "es-module-lexer@npm:1.7.0" + checksum: 10c0/4c935affcbfeba7fb4533e1da10fa8568043df1e3574b869385980de9e2d475ddc36769891936dbb07036edb3c3786a8b78ccf44964cd130dedc1f2c984b6c7b + languageName: node + linkType: hard + "es-module-lexer@npm:^2.0.0": version: 2.0.0 resolution: "es-module-lexer@npm:2.0.0" @@ -2070,6 +2640,95 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:^0.25.0": + version: 0.25.12 + resolution: "esbuild@npm:0.25.12" + dependencies: + "@esbuild/aix-ppc64": "npm:0.25.12" + "@esbuild/android-arm": "npm:0.25.12" + "@esbuild/android-arm64": "npm:0.25.12" + "@esbuild/android-x64": "npm:0.25.12" + "@esbuild/darwin-arm64": "npm:0.25.12" + "@esbuild/darwin-x64": "npm:0.25.12" + "@esbuild/freebsd-arm64": "npm:0.25.12" + "@esbuild/freebsd-x64": "npm:0.25.12" + "@esbuild/linux-arm": "npm:0.25.12" + "@esbuild/linux-arm64": "npm:0.25.12" + "@esbuild/linux-ia32": "npm:0.25.12" + "@esbuild/linux-loong64": "npm:0.25.12" + "@esbuild/linux-mips64el": "npm:0.25.12" + "@esbuild/linux-ppc64": "npm:0.25.12" + "@esbuild/linux-riscv64": "npm:0.25.12" + "@esbuild/linux-s390x": "npm:0.25.12" + "@esbuild/linux-x64": "npm:0.25.12" + "@esbuild/netbsd-arm64": "npm:0.25.12" + "@esbuild/netbsd-x64": "npm:0.25.12" + "@esbuild/openbsd-arm64": "npm:0.25.12" + "@esbuild/openbsd-x64": "npm:0.25.12" + "@esbuild/openharmony-arm64": "npm:0.25.12" + "@esbuild/sunos-x64": "npm:0.25.12" + "@esbuild/win32-arm64": "npm:0.25.12" + "@esbuild/win32-ia32": "npm:0.25.12" + "@esbuild/win32-x64": "npm:0.25.12" + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-arm64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-arm64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/openharmony-arm64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 10c0/c205357531423220a9de8e1e6c6514242bc9b1666e762cd67ccdf8fdfdc3f1d0bd76f8d9383958b97ad4c953efdb7b6e8c1f9ca5951cd2b7c5235e8755b34a6b + languageName: node + linkType: hard + "escape-string-regexp@npm:^2.0.0": version: 2.0.0 resolution: "escape-string-regexp@npm:2.0.0" @@ -2262,6 +2921,13 @@ __metadata: languageName: node linkType: hard +"estree-walker@npm:^2.0.2": + version: 2.0.2 + resolution: "estree-walker@npm:2.0.2" + checksum: 10c0/53a6c54e2019b8c914dc395890153ffdc2322781acf4bd7d1a32d7aedc1710807bdcd866ac133903d5629ec601fbb50abe8c2e5553c7f5a0afdd9b6af6c945af + languageName: node + linkType: hard + "estree-walker@npm:^3.0.3": version: 3.0.3 resolution: "estree-walker@npm:3.0.3" @@ -2356,7 +3022,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.4.4, fdir@npm:^6.5.0": +"fdir@npm:^6.2.0, fdir@npm:^6.4.4, fdir@npm:^6.5.0": version: 6.5.0 resolution: "fdir@npm:6.5.0" peerDependencies: @@ -2466,7 +3132,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:~2.3.3": +"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -2476,7 +3142,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@npm%3A~2.3.3#optional!builtin": +"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.3#optional!builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" dependencies: @@ -2552,6 +3218,15 @@ __metadata: languageName: node linkType: hard +"get-tsconfig@npm:^4.10.0": + version: 4.14.0 + resolution: "get-tsconfig@npm:4.14.0" + dependencies: + resolve-pkg-maps: "npm:^1.0.0" + checksum: 10c0/abc2b9275468eb589079a0b7a95eb5107c14fdd0ca6dda1bff116fe774ea1f79975421dcb22a0c86b4f820fcc69a7655dddf9b6d6a8a2c06fcb59e19794c0724 + languageName: node + linkType: hard + "getpass@npm:^0.1.1": version: 0.1.7 resolution: "getpass@npm:0.1.7" @@ -2959,6 +3634,13 @@ __metadata: languageName: node linkType: hard +"is-module@npm:^1.0.0": + version: 1.0.0 + resolution: "is-module@npm:1.0.0" + checksum: 10c0/795a3914bcae7c26a1c23a1e5574c42eac13429625045737bf3e324ce865c0601d61aee7a5afbca1bee8cb300c7d9647e7dc98860c9bdbc3b7fdc51d8ac0bffc + languageName: node + linkType: hard + "is-negative-zero@npm:^2.0.3": version: 2.0.3 resolution: "is-negative-zero@npm:2.0.3" @@ -2990,6 +3672,15 @@ __metadata: languageName: node linkType: hard +"is-reference@npm:1.2.1": + version: 1.2.1 + resolution: "is-reference@npm:1.2.1" + dependencies: + "@types/estree": "npm:*" + checksum: 10c0/7dc819fc8de7790264a0a5d531164f9f5b9ef5aa1cd05f35322d14db39c8a2ec78fd5d4bf57f9789f3ddd2b3abeea7728432b759636157a42db12a9e8c3b549b + languageName: node + linkType: hard + "is-regex@npm:^1.2.1": version: 1.2.1 resolution: "is-regex@npm:1.2.1" @@ -3163,6 +3854,15 @@ __metadata: dependencies: "@babel/parser": "npm:^7.19.4" "@commander-js/extra-typings": "npm:^14.0.0" + "@rollup/plugin-alias": "npm:^5.1.1" + "@rollup/plugin-commonjs": "npm:^28.0.3" + "@rollup/plugin-json": "npm:^6.1.0" + "@rollup/plugin-node-resolve": "npm:^16.0.1" + "@rollup/plugin-replace": "npm:^6.0.3" + "@rollup/plugin-terser": "npm:^1.0.0" + "@sourceacademy/common-cse-machine": "npm:^0.1.0" + "@sourceacademy/conductor": "https://github.com/source-academy/conductor.git#0.5.0" + "@sourceacademy/runner-cse-machine": "npm:^1.0.0" "@ts-morph/bootstrap": "npm:^0.18.0" "@types/estree": "npm:^1.0.5" "@types/lodash": "npm:^4.14.202" @@ -3178,6 +3878,7 @@ __metadata: astring: "npm:^1.4.3" commander: "npm:^14.0.0" coveralls: "npm:^3.1.0" + esbuild: "npm:^0.25.0" eslint: "npm:^9.39.1" eslint-plugin-import: "npm:^2.32.0" globals: "npm:^17.0.0" @@ -3186,7 +3887,11 @@ __metadata: jsdoc: "npm:4.0.5" jsdom: "npm:^29.0.0" lodash: "npm:^4.17.21" + path-browserify: "npm:^1.0.1" prettier: "npm:^3.6.2" + rollup: "npm:^4.59.0" + rollup-plugin-esbuild: "npm:^6.2.1" + rollup-plugin-polyfill-node: "npm:^0.13.0" source-map: "npm:0.7.6" typescript: "npm:^6.0.2" typescript-eslint: "npm:^8.46.3" @@ -3569,7 +4274,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.21": +"magic-string@npm:^0.30.21, magic-string@npm:^0.30.3": version: 0.30.21 resolution: "magic-string@npm:0.30.21" dependencies: @@ -4317,6 +5022,27 @@ __metadata: languageName: node linkType: hard +"resolve-pkg-maps@npm:^1.0.0": + version: 1.0.0 + resolution: "resolve-pkg-maps@npm:1.0.0" + checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab + languageName: node + linkType: hard + +"resolve@npm:^1.22.1": + version: 1.22.12 + resolution: "resolve@npm:1.22.12" + dependencies: + es-errors: "npm:^1.3.0" + is-core-module: "npm:^2.16.1" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/b16dc9b537c02e8c3388f7d3dcff9741d3071625f9a97ac1c885f2b0ca51e78df22328fb6d6ef214dd9101fb7cfc19aa2836fe3410402a94f3f7b8639c7149bf + languageName: node + linkType: hard + "resolve@npm:^1.22.4": version: 1.22.10 resolution: "resolve@npm:1.22.10" @@ -4330,6 +5056,20 @@ __metadata: languageName: node linkType: hard +"resolve@patch:resolve@npm%3A^1.22.1#optional!builtin": + version: 1.22.12 + resolution: "resolve@patch:resolve@npm%3A1.22.12#optional!builtin::version=1.22.12&hash=c3c19d" + dependencies: + es-errors: "npm:^1.3.0" + is-core-module: "npm:^2.16.1" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/fc6519984ae1f894d877c0060ba8b1f5ba3bc0e85a02f74e141929c118c23d74d9735619a9cc2965397387e514884245c65d72a40731dcb6cfc84c7bcdc8321e + languageName: node + linkType: hard + "resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": version: 1.22.10 resolution: "resolve@patch:resolve@npm%3A1.22.10#optional!builtin::version=1.22.10&hash=c3c19d" @@ -4415,6 +5155,122 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-esbuild@npm:^6.2.1": + version: 6.2.1 + resolution: "rollup-plugin-esbuild@npm:6.2.1" + dependencies: + debug: "npm:^4.4.0" + es-module-lexer: "npm:^1.6.0" + get-tsconfig: "npm:^4.10.0" + unplugin-utils: "npm:^0.2.4" + peerDependencies: + esbuild: ">=0.18.0" + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 + checksum: 10c0/cbde8deb1926756b02ba6d5c4b400a54e8a7636669fb74f4350138091a31d58df8423cf7b2b16315a5118476d3789aca2942eab37c66adfeb7ec209bb61566cf + languageName: node + linkType: hard + +"rollup-plugin-polyfill-node@npm:^0.13.0": + version: 0.13.0 + resolution: "rollup-plugin-polyfill-node@npm:0.13.0" + dependencies: + "@rollup/plugin-inject": "npm:^5.0.4" + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 + checksum: 10c0/a6d7746d73b48869c2650d733a4f1bf4cd8613669959811485e866c13b6462465b227f9923a21521013cfc85dd23c28b5ccee1c1359584f1ccf6320e7c823fb3 + languageName: node + linkType: hard + +"rollup@npm:^4.59.0": + version: 4.62.0 + resolution: "rollup@npm:4.62.0" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.62.0" + "@rollup/rollup-android-arm64": "npm:4.62.0" + "@rollup/rollup-darwin-arm64": "npm:4.62.0" + "@rollup/rollup-darwin-x64": "npm:4.62.0" + "@rollup/rollup-freebsd-arm64": "npm:4.62.0" + "@rollup/rollup-freebsd-x64": "npm:4.62.0" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.62.0" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.62.0" + "@rollup/rollup-linux-arm64-gnu": "npm:4.62.0" + "@rollup/rollup-linux-arm64-musl": "npm:4.62.0" + "@rollup/rollup-linux-loong64-gnu": "npm:4.62.0" + "@rollup/rollup-linux-loong64-musl": "npm:4.62.0" + "@rollup/rollup-linux-ppc64-gnu": "npm:4.62.0" + "@rollup/rollup-linux-ppc64-musl": "npm:4.62.0" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.62.0" + "@rollup/rollup-linux-riscv64-musl": "npm:4.62.0" + "@rollup/rollup-linux-s390x-gnu": "npm:4.62.0" + "@rollup/rollup-linux-x64-gnu": "npm:4.62.0" + "@rollup/rollup-linux-x64-musl": "npm:4.62.0" + "@rollup/rollup-openbsd-x64": "npm:4.62.0" + "@rollup/rollup-openharmony-arm64": "npm:4.62.0" + "@rollup/rollup-win32-arm64-msvc": "npm:4.62.0" + "@rollup/rollup-win32-ia32-msvc": "npm:4.62.0" + "@rollup/rollup-win32-x64-gnu": "npm:4.62.0" + "@rollup/rollup-win32-x64-msvc": "npm:4.62.0" + "@types/estree": "npm:1.0.9" + fsevents: "npm:~2.3.2" + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-freebsd-arm64": + optional: true + "@rollup/rollup-freebsd-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-loong64-gnu": + optional: true + "@rollup/rollup-linux-loong64-musl": + optional: true + "@rollup/rollup-linux-ppc64-gnu": + optional: true + "@rollup/rollup-linux-ppc64-musl": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-riscv64-musl": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-openbsd-x64": + optional: true + "@rollup/rollup-openharmony-arm64": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-gnu": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 10c0/0baa149f615152c0f86c44b237674cbac31d945ab721c257f73a844cc43d04a0f8613edbda4eaa2a376285286eac12e4f27060fc88a8f504f4ed235f6fc9b10f + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -4508,6 +5364,13 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:^7.0.3": + version: 7.0.5 + resolution: "serialize-javascript@npm:7.0.5" + checksum: 10c0/7b7818e5267f6d474ec7a56d36ba69dd712726a13eab37706ec94615fb7ca8945471f2b7fb0dc9dbe8c79c1930c1079d97f66f91315c8c8c2ca6c38898cec96f + languageName: node + linkType: hard + "set-function-length@npm:^1.2.2": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" @@ -4641,6 +5504,13 @@ __metadata: languageName: node linkType: hard +"smob@npm:^1.0.0": + version: 1.6.2 + resolution: "smob@npm:1.6.2" + checksum: 10c0/a9cad85a18bc8e3f33759b0608ba3fec53b1af8fa760b9d110c7bf87018f14f0ed0789d173bef647646c143c6d417c60ba47c30056731a051f79048f2f233446 + languageName: node + linkType: hard + "socks-proxy-agent@npm:^8.0.3": version: 8.0.5 resolution: "socks-proxy-agent@npm:8.0.5" @@ -4669,6 +5539,16 @@ __metadata: languageName: node linkType: hard +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d + languageName: node + linkType: hard + "source-map@npm:0.7.6": version: 0.7.6 resolution: "source-map@npm:0.7.6" @@ -4676,6 +5556,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard + "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -4865,6 +5752,20 @@ __metadata: languageName: node linkType: hard +"terser@npm:^5.17.4": + version: 5.48.0 + resolution: "terser@npm:5.48.0" + dependencies: + "@jridgewell/source-map": "npm:^0.3.3" + acorn: "npm:^8.15.0" + commander: "npm:^2.20.0" + source-map-support: "npm:~0.5.20" + bin: + terser: bin/terser + checksum: 10c0/d6ee713ea09a2b83b461ccbf1b76bd673a5090b3076ec13db7edc6d6470ab940d21c87b8d1ad82523b7cf02d9be07393fcdd334bde8f589e9bc3804da6fc32d2 + languageName: node + linkType: hard + "tinybench@npm:^2.9.0": version: 2.9.0 resolution: "tinybench@npm:2.9.0" @@ -5177,6 +6078,16 @@ __metadata: languageName: node linkType: hard +"unplugin-utils@npm:^0.2.4": + version: 0.2.5 + resolution: "unplugin-utils@npm:0.2.5" + dependencies: + pathe: "npm:^2.0.3" + picomatch: "npm:^4.0.3" + checksum: 10c0/51541892216a0505210866f956228ffe8c64792b0f7397d919e68aece7ac18cc4bed9cceaf0b59f777183701e4b1f2d95776b18e7d4a75ac64e2cfa4737bd9e5 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1"