@algorandfoundation/puya-ts 1.2.0-beta.6 → 1.2.0-beta.7

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.
@@ -1,7 +1,7 @@
1
1
  import 'crypto';
2
2
  import 'node:worker_threads';
3
- export { c as createAnalyserService } from './analyser-service-_vXhzOY0.js';
4
- import './options-COFRHTFQ.js';
3
+ export { c as createAnalyserService } from './analyser-service-Cifw26x1.js';
4
+ import './options-CJdnAUbx.js';
5
5
  import 'pathe';
6
6
  import 'typescript';
7
7
  import 'node:util';
@@ -15,7 +15,7 @@ export declare const classBuilderForUintNAlias: (aliasClass: LibClassType, alias
15
15
  newCall(args: ReadonlyArray<NodeBuilder>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation): InstanceBuilder;
16
16
  call(args: ReadonlyArray<NodeBuilder>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation<import("typescript").CallExpression>): NodeBuilder;
17
17
  readonly sourceLocation: SourceLocation;
18
- readonly typeDescription: string;
18
+ get typeDescription(): string;
19
19
  taggedTemplate(head: string, spans: ReadonlyArray<readonly [InstanceBuilder, string]>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation): InstanceBuilder;
20
20
  hasProperty(_name: string): boolean;
21
21
  memberAccess(name: string, sourceLocation: SourceLocation): NodeBuilder;
package/bin/puyats-ls.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { cY as LogLevel, d8 as distinct, cZ as logger, d9 as DefaultMap, da as zipStrict, C as Constants } from '../options-COFRHTFQ.js';
2
+ import { cP as LogLevel, d9 as distinct, c_ as logger, da as DefaultMap, db as zipStrict, C as Constants } from '../options-CJdnAUbx.js';
3
3
  import { ArgumentParser, BooleanOptionalAction } from 'argparse';
4
- import { b as packageVersion, a as appVersion, r as resolvePuyaPath } from '../resolve-puya-path-DtTAMi0Y.js';
5
- import { c as checkNodeVersion } from '../check-node-version-CNvxI8_l.js';
4
+ import { b as packageVersion, a as appVersion, r as resolvePuyaPath } from '../resolve-puya-path-PXFxrpdO.js';
5
+ import { c as checkNodeVersion } from '../check-node-version-BeAm9-W7.js';
6
6
  import { __esDecorate, __runInitializers } from 'tslib';
7
- import { r as requireMain, c as createAnalyserService, a as createNormalisedTextDocumentConnection, n as normalisedUri, i as isCodeFixData } from '../analyser-service-_vXhzOY0.js';
7
+ import { r as requireMain, l as logCaughtExpression, L as LogExceptions, c as createAnalyserService, a as createNormalisedTextDocumentConnection, n as normalisedUri, i as isCodeFixData } from '../analyser-service-Cifw26x1.js';
8
8
  import EventEmitter from 'node:events';
9
9
  import 'arcsecond';
10
10
  import 'node:fs';
@@ -370,33 +370,6 @@ class CompileTriggerQueue {
370
370
  }
371
371
  }
372
372
 
373
- function LogExceptions(target) {
374
- return function (...args) {
375
- try {
376
- const result = target.apply(this, args);
377
- if (result instanceof Promise) {
378
- return result.catch((e) => {
379
- logCaughtExpression(e);
380
- process.exit(1);
381
- });
382
- }
383
- return result;
384
- }
385
- catch (e) {
386
- logCaughtExpression(e);
387
- process.exit(1);
388
- }
389
- };
390
- }
391
- function logCaughtExpression(e) {
392
- if (e instanceof Error) {
393
- logger.error(e);
394
- }
395
- else {
396
- logger.error(undefined, `Unknown error ${e}`);
397
- }
398
- }
399
-
400
373
  let CompileWorker = (() => {
401
374
  let _instanceExtraInitializers = [];
402
375
  let _stop_decorators;
@@ -737,7 +710,7 @@ async function parseCliArguments() {
737
710
  dest: 'debugMode',
738
711
  action: BooleanOptionalAction,
739
712
  });
740
- const [result, _] = parser.parse_known_args();
713
+ const [result] = parser.parse_known_args();
741
714
  switch (result.command) {
742
715
  case 'version':
743
716
  /* eslint-disable-next-line no-console */
@@ -1 +1 @@
1
- {"version":3,"file":"puyats-ls.mjs","sources":["../../node_modules/vscode-languageserver-textdocument/lib/esm/main.js","../../node_modules/vscode-languageserver/node.js","../../src/logger/sinks/language-server-log-sink.ts","../../src/language-server/compile-trigger-queue.ts","../../src/language-server/util/log-exceptions.ts","../../src/language-server/compile-worker.ts","../../src/language-server/diagnostics-manager.ts","../../src/language-server/puya-language-server.ts","../../src/language-server/parse.ts","../../src/cli-ls.ts"],"sourcesContent":["/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nclass FullTextDocument {\n constructor(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n get uri() {\n return this._uri;\n }\n get languageId() {\n return this._languageId;\n }\n get version() {\n return this._version;\n }\n getText(range) {\n if (range) {\n const start = this.offsetAt(range.start);\n const end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n }\n update(changes, version) {\n for (const change of changes) {\n if (FullTextDocument.isIncremental(change)) {\n // makes sure start is before end\n const range = getWellformedRange(change.range);\n // update content\n const startOffset = this.offsetAt(range.start);\n const endOffset = this.offsetAt(range.end);\n this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\n // update the offsets\n const startLine = Math.max(range.start.line, 0);\n const endLine = Math.max(range.end.line, 0);\n let lineOffsets = this._lineOffsets;\n const addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\n if (endLine - startLine === addedLineOffsets.length) {\n for (let i = 0, len = addedLineOffsets.length; i < len; i++) {\n lineOffsets[i + startLine + 1] = addedLineOffsets[i];\n }\n }\n else {\n if (addedLineOffsets.length < 10000) {\n lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets);\n }\n else { // avoid too many arguments for splice\n this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\n }\n }\n const diff = change.text.length - (endOffset - startOffset);\n if (diff !== 0) {\n for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\n lineOffsets[i] = lineOffsets[i] + diff;\n }\n }\n }\n else if (FullTextDocument.isFull(change)) {\n this._content = change.text;\n this._lineOffsets = undefined;\n }\n else {\n throw new Error('Unknown change event received');\n }\n }\n this._version = version;\n }\n getLineOffsets() {\n if (this._lineOffsets === undefined) {\n this._lineOffsets = computeLineOffsets(this._content, true);\n }\n return this._lineOffsets;\n }\n positionAt(offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n const lineOffsets = this.getLineOffsets();\n let low = 0, high = lineOffsets.length;\n if (high === 0) {\n return { line: 0, character: offset };\n }\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n const line = low - 1;\n offset = this.ensureBeforeEOL(offset, lineOffsets[line]);\n return { line, character: offset - lineOffsets[line] };\n }\n offsetAt(position) {\n const lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n const lineOffset = lineOffsets[position.line];\n if (position.character <= 0) {\n return lineOffset;\n }\n const nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n const offset = Math.min(lineOffset + position.character, nextLineOffset);\n return this.ensureBeforeEOL(offset, lineOffset);\n }\n ensureBeforeEOL(offset, lineOffset) {\n while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) {\n offset--;\n }\n return offset;\n }\n get lineCount() {\n return this.getLineOffsets().length;\n }\n static isIncremental(event) {\n const candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n static isFull(event) {\n const candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n}\nexport var TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new text document.\n *\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's initial version number.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Updates a TextDocument by modifying its content.\n *\n * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\n * @param changes the changes to apply to the document.\n * @param version the changes version for the document.\n * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\n *\n */\n function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }\n TextDocument.update = update;\n function applyEdits(document, edits) {\n const text = document.getText();\n const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => {\n const diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n let lastModifiedOffset = 0;\n const spans = [];\n for (const e of sortedEdits) {\n const startOffset = document.offsetAt(e.range.start);\n if (startOffset < lastModifiedOffset) {\n throw new Error('Overlapping edit');\n }\n else if (startOffset > lastModifiedOffset) {\n spans.push(text.substring(lastModifiedOffset, startOffset));\n }\n if (e.newText.length) {\n spans.push(e.newText);\n }\n lastModifiedOffset = document.offsetAt(e.range.end);\n }\n spans.push(text.substr(lastModifiedOffset));\n return spans.join('');\n }\n TextDocument.applyEdits = applyEdits;\n})(TextDocument || (TextDocument = {}));\nfunction mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n const p = (data.length / 2) | 0;\n const left = data.slice(0, p);\n const right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n let leftIdx = 0;\n let rightIdx = 0;\n let i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n const ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n}\nfunction computeLineOffsets(text, isAtLineStart, textOffset = 0) {\n const result = isAtLineStart ? [textOffset] : [];\n for (let i = 0; i < text.length; i++) {\n const ch = text.charCodeAt(i);\n if (isEOL(ch)) {\n if (ch === 13 /* CharCode.CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* CharCode.LineFeed */) {\n i++;\n }\n result.push(textOffset + i + 1);\n }\n }\n return result;\n}\nfunction isEOL(char) {\n return char === 13 /* CharCode.CarriageReturn */ || char === 10 /* CharCode.LineFeed */;\n}\nfunction getWellformedRange(range) {\n const start = range.start;\n const end = range.end;\n if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\n return { start: end, end: start };\n }\n return range;\n}\nfunction getWellformedEdit(textEdit) {\n const range = getWellformedRange(textEdit.range);\n if (range !== textEdit.range) {\n return { newText: textEdit.newText, range };\n }\n return textEdit;\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","import type * as lsp from 'vscode-languageserver/node'\nimport type { LogEvent } from '../index'\nimport { LogLevel } from '../index'\nimport type { LogSink } from './index'\n\nexport class LanguageServerLogSink implements LogSink {\n constructor(private connection: lsp.Connection) {}\n\n minLogLevel = LogLevel.Debug\n\n add(e: LogEvent): void {\n if (e.sourceLocation) return // Ignore code specific logs\n\n switch (e.level) {\n case 'error':\n case 'info':\n case 'debug':\n this.connection.console[e.level](e.message)\n break\n case 'warning':\n this.connection.console.warn(e.message)\n break\n case 'critical':\n this.connection.console.error(e.message)\n break\n }\n }\n}\n","import EventEmitter from 'node:events'\nimport type * as lsp from 'vscode-languageserver/node'\nimport { distinct } from '../util'\n\nexport type WorkspaceCompileTrigger = {\n type: 'workspace'\n uris: lsp.URI[]\n}\nexport type FileCompileTrigger = {\n type: 'file'\n uris: lsp.URI[]\n}\n\nexport type CompileTrigger = WorkspaceCompileTrigger | FileCompileTrigger\n\ntype CompileTriggerQueueEvents = {\n itemEnqueued: [CompileTrigger]\n}\n\nexport class CompileTriggerQueue {\n private readonly queue: CompileTrigger[] = []\n private readonly events = new EventEmitter<CompileTriggerQueueEvents>()\n\n enqueue(trigger: CompileTrigger) {\n const lastInQueue = this.queue.at(-1)\n if (trigger.type === lastInQueue?.type) {\n this.queue.splice(-1, 1, {\n type: trigger.type,\n uris: lastInQueue.uris.concat(trigger.uris).filter(distinct()),\n })\n } else {\n this.queue.push(trigger)\n }\n this.events.emit('itemEnqueued', this.queue.at(-1)!)\n }\n\n tryDequeue(): CompileTrigger | undefined {\n return this.queue.shift()\n }\n\n onItemEnqueued(handler: (...args: CompileTriggerQueueEvents['itemEnqueued']) => void): lsp.Disposable {\n this.events.on('itemEnqueued', handler)\n return {\n dispose: () => {\n this.events.off('itemEnqueued', handler)\n },\n }\n }\n}\n","import type { DeliberateAny } from '../../typescript-helpers'\nimport { logger } from '../../logger'\n\nexport function LogExceptions<TThis, TArgs extends DeliberateAny[], TReturn>(target: (this: TThis, ...args: TArgs) => TReturn) {\n return function (this: TThis, ...args: TArgs): TReturn {\n try {\n const result = target.apply(this, args)\n if (result instanceof Promise) {\n return result.catch((e: unknown) => {\n logCaughtExpression(e)\n process.exit(1)\n }) as TReturn\n }\n return result\n } catch (e) {\n logCaughtExpression(e)\n process.exit(1)\n }\n }\n}\n\nexport function logCaughtExpression(e: unknown) {\n if (e instanceof Error) {\n logger.error(e)\n } else {\n logger.error(undefined, `Unknown error ${e}`)\n }\n}\n","import type { TextDocument } from 'vscode-languageserver-textdocument'\nimport type { TextDocuments } from 'vscode-languageserver/node.js'\nimport { logger } from '../logger'\nimport type { AnalyserService, OpenDocuments } from './analyser-service'\nimport type { CompileTrigger, CompileTriggerQueue } from './compile-trigger-queue'\nimport type { DiagnosticsManager } from './diagnostics-manager'\nimport { logCaughtExpression, LogExceptions } from './util/log-exceptions'\n\ntype ActiveBuild = {\n trigger: CompileTrigger\n abort: AbortController\n}\n\nexport class CompileWorker {\n stopping: boolean = false\n private stopped = Promise.withResolvers<void>()\n private sleeping: PromiseWithResolvers<void> | undefined = undefined\n private activeBuild: ActiveBuild | undefined = undefined\n constructor(\n private readonly queue: CompileTriggerQueue,\n private readonly analyserService: AnalyserService,\n private readonly documents: TextDocuments<TextDocument>,\n private readonly diagnostics: DiagnosticsManager,\n ) {\n this.queue.onItemEnqueued(this.onCompileTriggerQueueItemQueued.bind(this))\n }\n\n start() {\n setTimeout(async () => {\n while (!this.stopping) {\n try {\n const trigger = this.queue.tryDequeue()\n if (trigger) {\n logger.debug(undefined, `[Compile Worker] Found ${trigger.type} compile ${trigger.uris.join(', ')}`)\n this.activeBuild = { abort: new AbortController(), trigger }\n await this.compileWithService(trigger, this.activeBuild.abort.signal)\n delete this.activeBuild\n } else {\n logger.debug(undefined, `[Compile Worker] No work, sleeping`)\n this.sleeping = Promise.withResolvers()\n await this.sleeping.promise\n delete this.sleeping\n }\n } catch (e) {\n logCaughtExpression(e)\n }\n }\n this.stopped.resolve()\n })\n }\n\n @LogExceptions\n async stop() {\n this.stopping = true\n this.sleeping?.resolve()\n this.activeBuild?.abort.abort()\n await this.stopped.promise\n }\n\n onCompileTriggerQueueItemQueued(trigger: CompileTrigger) {\n if (this.activeBuild) {\n if (this.activeBuild.trigger.type === trigger.type) {\n if (new Set(trigger.uris).isSubsetOf(new Set(this.activeBuild.trigger.uris))) {\n logger.debug(undefined, `[Compile Worker] Aborting build, newer version of file is available`)\n this.activeBuild.abort.abort('Build superseded')\n }\n }\n }\n if (this.sleeping) {\n logger.debug(undefined, `[Compile Worker] New work, waking worker`)\n this.sleeping.resolve()\n }\n }\n\n private async compileWithService(trigger: CompileTrigger, abort: AbortSignal) {\n const openDocuments = this.documents.all().reduce((acc: OpenDocuments, cur) => {\n acc[cur.uri] = {\n contents: cur.getText(),\n version: cur.version,\n }\n return acc\n }, {})\n try {\n const results = await this.analyserService.analyse(\n {\n uris: trigger.uris,\n openDocuments,\n },\n abort,\n )\n for (const file of results) {\n this.diagnostics.setDiagnostics(file)\n }\n } catch (e) {\n if (e === 'aborted') return\n throw e\n }\n }\n}\n","import EventEmitter from 'node:events'\nimport type * as lsp from 'vscode-languageserver'\nimport { logger } from '../logger'\nimport { zipStrict } from '../util'\nimport { DefaultMap } from '../util/default-map'\n\nfunction diagnosticsAreSame(a: lsp.Diagnostic, b: lsp.Diagnostic) {\n return (\n a.message === b.message &&\n a.range.start.line === b.range.start.line &&\n a.range.start.character === b.range.start.character &&\n a.range.end.line === b.range.end.line &&\n a.range.end.character === b.range.end.character &&\n a.severity === b.severity\n )\n}\n\nfunction isSameOrMoreRecentVersion(prev: number | undefined, next: number | undefined): boolean {\n if (prev === undefined || next === undefined) return true\n return prev <= next\n}\n\nexport class SourceFileDiagnostics {\n private diagnostics: lsp.Diagnostic[] | 'pending' = 'pending'\n private version: number | undefined\n /**\n * Update the diagnostics for this file and return a boolean indicating if they have changed\n * @param version The file version used to generate these diagnostics\n * @param diagnostics\n */\n setDiagnostics({ version, diagnostics }: { diagnostics: lsp.Diagnostic[] | 'pending'; version: number | undefined }): boolean {\n // Ignore older diagnostics (even though this shouldn't happen)\n if (!isSameOrMoreRecentVersion(this.version, version)) return false\n if (diagnostics !== 'pending' && this.diagnostics !== 'pending' && diagnostics.length === this.diagnostics.length) {\n if (zipStrict(this.diagnostics, diagnostics).every(([l, r]) => diagnosticsAreSame(l, r))) {\n this.version = version\n return false\n }\n }\n this.diagnostics = diagnostics\n this.version = version\n\n return true\n }\n}\nexport type FileWithDiagnostics = {\n uri: lsp.DocumentUri\n version: number | undefined\n diagnostics: lsp.Diagnostic[]\n}\n\ntype DiagnosticEvents = {\n fileDiagnosticsChanged: [event: FileWithDiagnostics]\n}\n\nexport class DiagnosticsManager {\n private readonly sourceFiles = new DefaultMap<lsp.DocumentUri, SourceFileDiagnostics>()\n private readonly events = new EventEmitter<DiagnosticEvents>()\n\n setDiagnostics({\n uri,\n diagnostics,\n version,\n }: {\n uri: lsp.DocumentUri\n diagnostics: lsp.Diagnostic[] | 'pending'\n version: number | undefined\n }) {\n logger.debug(\n undefined,\n `[DiagMgr] Setting diagnostics for ${uri} ${version ?? '<no version>'} (${diagnostics === 'pending' ? 'pending' : diagnostics.length})`,\n )\n const fileDiagnostics = this.sourceFiles.getOrDefault(uri, () => new SourceFileDiagnostics())\n if (fileDiagnostics.setDiagnostics({ diagnostics, version })) {\n if (diagnostics === 'pending') return\n this.events.emit('fileDiagnosticsChanged', { uri, diagnostics, version })\n }\n }\n\n onFileDiagnosticsChanged(handler: (...args: DiagnosticEvents['fileDiagnosticsChanged']) => void): lsp.Disposable {\n this.events.on('fileDiagnosticsChanged', handler)\n return {\n dispose: () => {\n this.events.off('fileDiagnosticsChanged', handler)\n },\n }\n }\n}\n","import { TextDocument } from 'vscode-languageserver-textdocument'\nimport * as lsp from 'vscode-languageserver/node'\nimport { appVersion, packageVersion } from '../cli/app-version'\nimport { Constants } from '../constants'\nimport { logger, LogLevel } from '../logger'\nimport { LanguageServerLogSink } from '../logger/sinks/language-server-log-sink'\nimport { resolvePuyaPath } from '../puya/resolve-puya-path'\nimport type { AnalyserService } from './analyser-service'\nimport { createAnalyserService } from './analyser-service'\nimport { CompileTriggerQueue } from './compile-trigger-queue'\nimport { CompileWorker } from './compile-worker'\nimport type { FileWithDiagnostics } from './diagnostics-manager'\nimport { DiagnosticsManager } from './diagnostics-manager'\nimport { isCodeFixData } from './mapping'\nimport { LogExceptions } from './util/log-exceptions'\nimport { createNormalisedTextDocumentConnection, normalisedUri } from './util/uris'\n\ninterface LanguageServerConfiguration {\n // use LogLevel member names to maintain consistency with other extension settings\n logLevel?: Omit<keyof typeof LogLevel, 'Critical'>\n debounce?: number\n}\n\nconst resolveConnection = async (lspPort: number | undefined) => {\n if (!lspPort) {\n return lsp.createConnection(lsp.ProposedFeatures.all)\n }\n\n // When the debug env variable PUYA_TS_DEBUG_LSP_PORT is set, we start the server with socket transport.\n // Note: this is actually the opposite to how vscode-languageserver is designed.\n // Normally, the extension is the web socker server and the language server is the client.\n // Here, we flip it. This allows an easier debugging experience.\n // If changes are made to the language server, you can just restart the debugger\n // and choose the option \"Restart language server\" in the VS Code extension host instance.\n const transport = await lsp.createClientSocketTransport(lspPort)\n const protocol = await transport.onConnected()\n\n return lsp.createConnection(lsp.ProposedFeatures.all, protocol[0], protocol[1])\n}\n\nexport type LanguageServerOptions = {\n port?: number\n customPuyaPath?: string\n}\n\nconst PACKAGE_VERSION = packageVersion()\n\nexport class PuyaLanguageServer {\n readonly documents = new lsp.TextDocuments(TextDocument)\n readonly triggers = new CompileTriggerQueue()\n readonly workspaceFolders: lsp.URI[] = []\n readonly diagnosticsMgr: DiagnosticsManager\n readonly compileWorker: CompileWorker\n readonly analyserService: AnalyserService\n stopping = false\n\n constructor(\n public readonly connection: lsp.Connection,\n private readonly loggingSink: LanguageServerLogSink,\n puyaPath: string,\n ) {\n this.diagnosticsMgr = new DiagnosticsManager()\n this.analyserService = createAnalyserService({ puyaPath })\n this.compileWorker = new CompileWorker(this.triggers, this.analyserService, this.documents, this.diagnosticsMgr)\n\n connection.onInitialize(this.initialize.bind(this))\n connection.onInitialized(this.initialized.bind(this))\n connection.onCodeAction(this.codeAction.bind(this))\n connection.onDidChangeConfiguration(this.configurationChange.bind(this))\n this.documents.onDidChangeContent(this.documentDidChangeContent.bind(this))\n this.diagnosticsMgr.onFileDiagnosticsChanged(this.fileDiagnosticsChanged.bind(this))\n connection.onShutdown(this.shutdown.bind(this))\n }\n\n start() {\n this.documents.listen(createNormalisedTextDocumentConnection(this.connection))\n this.connection.listen()\n this.compileWorker.start()\n }\n\n async shutdown() {\n logger.debug(undefined, '[PuyaLanguageServer] Shutting down')\n this.stopping = true\n await this.compileWorker.stop()\n await this.analyserService.shutdown()\n logger.debug(undefined, '[PuyaLanguageServer] Shutdown')\n }\n\n initialize(params: lsp.InitializeParams): lsp.InitializeResult {\n this.workspaceFolders.push(...(params.workspaceFolders?.map((f) => normalisedUri({ uri: f.uri }).toString()) ?? []))\n this.triggers.enqueue({\n type: 'workspace',\n uris: this.workspaceFolders,\n })\n return {\n serverInfo: {\n name: 'Puya-TS Language Server',\n version: PACKAGE_VERSION,\n },\n capabilities: {\n textDocumentSync: lsp.TextDocumentSyncKind.Incremental,\n codeActionProvider: {\n resolveProvider: false,\n },\n },\n }\n }\n\n @LogExceptions\n initialized(params: lsp.InitializedParams) {\n logger.debug(undefined, `${Constants.languageServerSource}-ls initialized`)\n }\n\n @LogExceptions\n async fileDiagnosticsChanged(params: FileWithDiagnostics) {\n if (this.stopping) {\n logger.debug(undefined, `[Diagnostics Ignored (shutting down)]: ${params.uri}`)\n return\n }\n logger.debug(undefined, `[Diagnostics Changed]: ${params.uri}`)\n\n await this.connection.sendDiagnostics(params)\n logger.debug(undefined, `[Diagnostics Sent]: ${params.uri}`)\n }\n\n @LogExceptions\n documentDidChangeContent(params: lsp.TextDocumentChangeEvent<TextDocument>) {\n if (this.stopping) return\n const normalizedDocumentUri = normalisedUri({ uri: params.document.uri }).toString()\n logger.debug(undefined, `[Document Changed]: ${normalizedDocumentUri}`)\n this.diagnosticsMgr.setDiagnostics({ uri: normalizedDocumentUri, version: params.document.version, diagnostics: 'pending' })\n\n this.triggers.enqueue({\n type: 'file',\n uris: [normalizedDocumentUri],\n })\n }\n\n /**\n * Bound to connection.onCodeAction and called when a user hovers over a piece of code.\n *\n * Params includes the text range the user is hovering over and any diagnostics known to the\n * client at the time.\n *\n * Response should include actions the user can take and the command or text edits that should be\n * invoked/applied if selected\n * @param params\n */\n @LogExceptions\n codeAction(params: lsp.CodeActionParams): lsp.CodeAction[] {\n return params.context.diagnostics.flatMap((d): lsp.CodeAction | lsp.CodeAction[] => {\n if (isCodeFixData(d.data)) {\n return {\n title: d.data.message,\n kind: lsp.CodeActionKind.QuickFix,\n diagnostics: [d],\n edit: {\n changes: {\n [params.textDocument.uri]: [...d.data.edits],\n },\n },\n }\n }\n return []\n })\n }\n\n @LogExceptions\n configurationChange(params: lsp.DidChangeConfigurationParams) {\n const settings = params.settings as LanguageServerConfiguration\n const logLevel = LogLevel[settings.logLevel as keyof typeof LogLevel]\n if (logLevel !== undefined) {\n logger.debug(undefined, `setting log level to ${logLevel}`)\n this.loggingSink.minLogLevel = logLevel\n }\n }\n}\n\n// eslint-disable-next-line no-console\nconst cliLog = console.error\n\nexport async function startLanguageServer(options: LanguageServerOptions) {\n cliLog(`Puya-TS Language Server:\\n${appVersion({ withAVMVersion: false })}`)\n const connection = await resolveConnection(options.port)\n const languageServerSink = new LanguageServerLogSink(connection)\n logger.configure([languageServerSink])\n try {\n const puyaPath = await resolvePuyaPath(options)\n const server = new PuyaLanguageServer(connection, languageServerSink, puyaPath)\n server.start()\n } catch (e) {\n connection.console.error(`Unhandled exception ${e}`)\n }\n}\n","import { ArgumentParser, BooleanOptionalAction } from 'argparse'\nimport { appVersion } from '../cli/app-version'\nimport { checkNodeVersion } from '../cli/check-node-version'\nimport type { LanguageServerOptions } from './puya-language-server'\nimport { startLanguageServer } from './puya-language-server'\n\nexport async function parseCliArguments() {\n checkNodeVersion()\n const prog = 'puyats-ls'\n const parser = new ArgumentParser({\n prog,\n })\n\n parser.add_argument('--version', {\n action: 'store_const',\n help: 'Show application version',\n const: 'version',\n dest: 'command',\n })\n parser.add_argument('--debug-mode', {\n help: 'Start the language server in debug mode. Server will listen on the debug port (default 4001) for connections.',\n default: false,\n dest: 'debugMode',\n action: BooleanOptionalAction,\n })\n const [result, _] = parser.parse_known_args() as [PuyaTsCommand, unknown]\n\n switch (result.command) {\n case 'version':\n /* eslint-disable-next-line no-console */\n console.log(appVersion({ name: prog }))\n break\n default: {\n const options: LanguageServerOptions = {\n port: result.debugMode ? (parsePort(process.env.PUYA_TS_DEBUG_LSP_PORT) ?? 4001) : undefined,\n }\n\n await startLanguageServer(options)\n break\n }\n }\n}\n\ntype PuyaTsCommand = NoCommandArgs | VersionCommand\ninterface NoCommandArgs {\n command: 'none'\n debugMode: boolean\n}\ninterface VersionCommand {\n command: 'version'\n}\n\nfunction parsePort(value: string | undefined) {\n if (value === undefined) return undefined\n const val = Number(value)\n if (val > 0 && val < 2 ** 16 && Math.floor(val) === val) {\n return val\n }\n throw new Error(`Invalid port number ${value}`)\n}\n","import './util/polyfills'\nimport { parseCliArguments } from './language-server/parse'\n\nvoid parseCliArguments()\n"],"names":["require$$0","lsp.createConnection","lsp.ProposedFeatures","lsp.createClientSocketTransport","lsp.TextDocuments","lsp.TextDocumentSyncKind","lsp.CodeActionKind"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAM,gBAAgB,CAAC;AACvB,IAAI,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE;AACnD,QAAQ,IAAI,CAAC,IAAI,GAAG,GAAG;AACvB,QAAQ,IAAI,CAAC,WAAW,GAAG,UAAU;AACrC,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B,QAAQ,IAAI,CAAC,YAAY,GAAG,SAAS;AACrC,IAAI;AACJ,IAAI,IAAI,GAAG,GAAG;AACd,QAAQ,OAAO,IAAI,CAAC,IAAI;AACxB,IAAI;AACJ,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B,IAAI;AACJ,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,OAAO,IAAI,CAAC,QAAQ;AAC5B,IAAI;AACJ,IAAI,OAAO,CAAC,KAAK,EAAE;AACnB,QAAQ,IAAI,KAAK,EAAE;AACnB,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK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AWA,SAAS,SAAS,CAAC,KAAyB,EAAA;IAC1C,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AACzC,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;AACzB,IAAA,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;AACvD,QAAA,OAAO,GAAG;IACZ;AACA,IAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,CAAA,CAAE,CAAC;AACjD;;ACxDA,KAAK,iBAAiB,EAAE","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"puyats-ls.mjs","sources":["../../node_modules/vscode-languageserver-textdocument/lib/esm/main.js","../../node_modules/vscode-languageserver/node.js","../../src/logger/sinks/language-server-log-sink.ts","../../src/language-server/compile-trigger-queue.ts","../../src/language-server/compile-worker.ts","../../src/language-server/diagnostics-manager.ts","../../src/language-server/puya-language-server.ts","../../src/language-server/parse.ts","../../src/cli-ls.ts"],"sourcesContent":["/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nclass FullTextDocument {\n constructor(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n get uri() {\n return this._uri;\n }\n get languageId() {\n return this._languageId;\n }\n get version() {\n return this._version;\n }\n getText(range) {\n if (range) {\n const start = this.offsetAt(range.start);\n const end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n }\n update(changes, version) {\n for (const change of changes) {\n if (FullTextDocument.isIncremental(change)) {\n // makes sure start is before end\n const range = getWellformedRange(change.range);\n // update content\n const startOffset = this.offsetAt(range.start);\n const endOffset = this.offsetAt(range.end);\n this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\n // update the offsets\n const startLine = Math.max(range.start.line, 0);\n const endLine = Math.max(range.end.line, 0);\n let lineOffsets = this._lineOffsets;\n const addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\n if (endLine - startLine === addedLineOffsets.length) {\n for (let i = 0, len = addedLineOffsets.length; i < len; i++) {\n lineOffsets[i + startLine + 1] = addedLineOffsets[i];\n }\n }\n else {\n if (addedLineOffsets.length < 10000) {\n lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets);\n }\n else { // avoid too many arguments for splice\n this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\n }\n }\n const diff = change.text.length - (endOffset - startOffset);\n if (diff !== 0) {\n for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\n lineOffsets[i] = lineOffsets[i] + diff;\n }\n }\n }\n else if (FullTextDocument.isFull(change)) {\n this._content = change.text;\n this._lineOffsets = undefined;\n }\n else {\n throw new Error('Unknown change event received');\n }\n }\n this._version = version;\n }\n getLineOffsets() {\n if (this._lineOffsets === undefined) {\n this._lineOffsets = computeLineOffsets(this._content, true);\n }\n return this._lineOffsets;\n }\n positionAt(offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n const lineOffsets = this.getLineOffsets();\n let low = 0, high = lineOffsets.length;\n if (high === 0) {\n return { line: 0, character: offset };\n }\n while (low < high) {\n const mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n const line = low - 1;\n offset = this.ensureBeforeEOL(offset, lineOffsets[line]);\n return { line, character: offset - lineOffsets[line] };\n }\n offsetAt(position) {\n const lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n const lineOffset = lineOffsets[position.line];\n if (position.character <= 0) {\n return lineOffset;\n }\n const nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n const offset = Math.min(lineOffset + position.character, nextLineOffset);\n return this.ensureBeforeEOL(offset, lineOffset);\n }\n ensureBeforeEOL(offset, lineOffset) {\n while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) {\n offset--;\n }\n return offset;\n }\n get lineCount() {\n return this.getLineOffsets().length;\n }\n static isIncremental(event) {\n const candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n static isFull(event) {\n const candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n}\nexport var TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new text document.\n *\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's initial version number.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Updates a TextDocument by modifying its content.\n *\n * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\n * @param changes the changes to apply to the document.\n * @param version the changes version for the document.\n * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\n *\n */\n function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }\n TextDocument.update = update;\n function applyEdits(document, edits) {\n const text = document.getText();\n const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => {\n const diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n let lastModifiedOffset = 0;\n const spans = [];\n for (const e of sortedEdits) {\n const startOffset = document.offsetAt(e.range.start);\n if (startOffset < lastModifiedOffset) {\n throw new Error('Overlapping edit');\n }\n else if (startOffset > lastModifiedOffset) {\n spans.push(text.substring(lastModifiedOffset, startOffset));\n }\n if (e.newText.length) {\n spans.push(e.newText);\n }\n lastModifiedOffset = document.offsetAt(e.range.end);\n }\n spans.push(text.substr(lastModifiedOffset));\n return spans.join('');\n }\n TextDocument.applyEdits = applyEdits;\n})(TextDocument || (TextDocument = {}));\nfunction mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n const p = (data.length / 2) | 0;\n const left = data.slice(0, p);\n const right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n let leftIdx = 0;\n let rightIdx = 0;\n let i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n const ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n}\nfunction computeLineOffsets(text, isAtLineStart, textOffset = 0) {\n const result = isAtLineStart ? [textOffset] : [];\n for (let i = 0; i < text.length; i++) {\n const ch = text.charCodeAt(i);\n if (isEOL(ch)) {\n if (ch === 13 /* CharCode.CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* CharCode.LineFeed */) {\n i++;\n }\n result.push(textOffset + i + 1);\n }\n }\n return result;\n}\nfunction isEOL(char) {\n return char === 13 /* CharCode.CarriageReturn */ || char === 10 /* CharCode.LineFeed */;\n}\nfunction getWellformedRange(range) {\n const start = range.start;\n const end = range.end;\n if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\n return { start: end, end: start };\n }\n return range;\n}\nfunction getWellformedEdit(textEdit) {\n const range = getWellformedRange(textEdit.range);\n if (range !== textEdit.range) {\n return { newText: textEdit.newText, range };\n }\n return textEdit;\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","import type * as lsp from 'vscode-languageserver/node'\nimport type { LogEvent } from '../index'\nimport { LogLevel } from '../index'\nimport type { LogSink } from './index'\n\nexport class LanguageServerLogSink implements LogSink {\n constructor(private connection: lsp.Connection) {}\n\n minLogLevel = LogLevel.Debug\n\n add(e: LogEvent): void {\n if (e.sourceLocation) return // Ignore code specific logs\n\n switch (e.level) {\n case 'error':\n case 'info':\n case 'debug':\n this.connection.console[e.level](e.message)\n break\n case 'warning':\n this.connection.console.warn(e.message)\n break\n case 'critical':\n this.connection.console.error(e.message)\n break\n }\n }\n}\n","import EventEmitter from 'node:events'\nimport type * as lsp from 'vscode-languageserver/node'\nimport { distinct } from '../util'\n\nexport type WorkspaceCompileTrigger = {\n type: 'workspace'\n uris: lsp.URI[]\n}\nexport type FileCompileTrigger = {\n type: 'file'\n uris: lsp.URI[]\n}\n\nexport type CompileTrigger = WorkspaceCompileTrigger | FileCompileTrigger\n\ntype CompileTriggerQueueEvents = {\n itemEnqueued: [CompileTrigger]\n}\n\nexport class CompileTriggerQueue {\n private readonly queue: CompileTrigger[] = []\n private readonly events = new EventEmitter<CompileTriggerQueueEvents>()\n\n enqueue(trigger: CompileTrigger) {\n const lastInQueue = this.queue.at(-1)\n if (trigger.type === lastInQueue?.type) {\n this.queue.splice(-1, 1, {\n type: trigger.type,\n uris: lastInQueue.uris.concat(trigger.uris).filter(distinct()),\n })\n } else {\n this.queue.push(trigger)\n }\n this.events.emit('itemEnqueued', this.queue.at(-1)!)\n }\n\n tryDequeue(): CompileTrigger | undefined {\n return this.queue.shift()\n }\n\n onItemEnqueued(handler: (...args: CompileTriggerQueueEvents['itemEnqueued']) => void): lsp.Disposable {\n this.events.on('itemEnqueued', handler)\n return {\n dispose: () => {\n this.events.off('itemEnqueued', handler)\n },\n }\n }\n}\n","import type { TextDocument } from 'vscode-languageserver-textdocument'\nimport type { TextDocuments } from 'vscode-languageserver/node.js'\nimport { logger } from '../logger'\nimport type { AnalyserService, OpenDocuments } from './analyser-service'\nimport type { CompileTrigger, CompileTriggerQueue } from './compile-trigger-queue'\nimport type { DiagnosticsManager } from './diagnostics-manager'\nimport { logCaughtExpression, LogExceptions } from './util/log-exceptions'\n\ntype ActiveBuild = {\n trigger: CompileTrigger\n abort: AbortController\n}\n\nexport class CompileWorker {\n stopping: boolean = false\n private stopped = Promise.withResolvers<void>()\n private sleeping: PromiseWithResolvers<void> | undefined = undefined\n private activeBuild: ActiveBuild | undefined = undefined\n constructor(\n private readonly queue: CompileTriggerQueue,\n private readonly analyserService: AnalyserService,\n private readonly documents: TextDocuments<TextDocument>,\n private readonly diagnostics: DiagnosticsManager,\n ) {\n this.queue.onItemEnqueued(this.onCompileTriggerQueueItemQueued.bind(this))\n }\n\n start() {\n setTimeout(async () => {\n while (!this.stopping) {\n try {\n const trigger = this.queue.tryDequeue()\n if (trigger) {\n logger.debug(undefined, `[Compile Worker] Found ${trigger.type} compile ${trigger.uris.join(', ')}`)\n this.activeBuild = { abort: new AbortController(), trigger }\n await this.compileWithService(trigger, this.activeBuild.abort.signal)\n delete this.activeBuild\n } else {\n logger.debug(undefined, `[Compile Worker] No work, sleeping`)\n this.sleeping = Promise.withResolvers()\n await this.sleeping.promise\n delete this.sleeping\n }\n } catch (e) {\n logCaughtExpression(e)\n }\n }\n this.stopped.resolve()\n })\n }\n\n @LogExceptions\n async stop() {\n this.stopping = true\n this.sleeping?.resolve()\n this.activeBuild?.abort.abort()\n await this.stopped.promise\n }\n\n onCompileTriggerQueueItemQueued(trigger: CompileTrigger) {\n if (this.activeBuild) {\n if (this.activeBuild.trigger.type === trigger.type) {\n if (new Set(trigger.uris).isSubsetOf(new Set(this.activeBuild.trigger.uris))) {\n logger.debug(undefined, `[Compile Worker] Aborting build, newer version of file is available`)\n this.activeBuild.abort.abort('Build superseded')\n }\n }\n }\n if (this.sleeping) {\n logger.debug(undefined, `[Compile Worker] New work, waking worker`)\n this.sleeping.resolve()\n }\n }\n\n private async compileWithService(trigger: CompileTrigger, abort: AbortSignal) {\n const openDocuments = this.documents.all().reduce((acc: OpenDocuments, cur) => {\n acc[cur.uri] = {\n contents: cur.getText(),\n version: cur.version,\n }\n return acc\n }, {})\n try {\n const results = await this.analyserService.analyse(\n {\n uris: trigger.uris,\n openDocuments,\n },\n abort,\n )\n for (const file of results) {\n this.diagnostics.setDiagnostics(file)\n }\n } catch (e) {\n if (e === 'aborted') return\n throw e\n }\n }\n}\n","import EventEmitter from 'node:events'\nimport type * as lsp from 'vscode-languageserver'\nimport { logger } from '../logger'\nimport { zipStrict } from '../util'\nimport { DefaultMap } from '../util/default-map'\n\nfunction diagnosticsAreSame(a: lsp.Diagnostic, b: lsp.Diagnostic) {\n return (\n a.message === b.message &&\n a.range.start.line === b.range.start.line &&\n a.range.start.character === b.range.start.character &&\n a.range.end.line === b.range.end.line &&\n a.range.end.character === b.range.end.character &&\n a.severity === b.severity\n )\n}\n\nfunction isSameOrMoreRecentVersion(prev: number | undefined, next: number | undefined): boolean {\n if (prev === undefined || next === undefined) return true\n return prev <= next\n}\n\nexport class SourceFileDiagnostics {\n private diagnostics: lsp.Diagnostic[] | 'pending' = 'pending'\n private version: number | undefined\n /**\n * Update the diagnostics for this file and return a boolean indicating if they have changed\n * @param version The file version used to generate these diagnostics\n * @param diagnostics\n */\n setDiagnostics({ version, diagnostics }: { diagnostics: lsp.Diagnostic[] | 'pending'; version: number | undefined }): boolean {\n // Ignore older diagnostics (even though this shouldn't happen)\n if (!isSameOrMoreRecentVersion(this.version, version)) return false\n if (diagnostics !== 'pending' && this.diagnostics !== 'pending' && diagnostics.length === this.diagnostics.length) {\n if (zipStrict(this.diagnostics, diagnostics).every(([l, r]) => diagnosticsAreSame(l, r))) {\n this.version = version\n return false\n }\n }\n this.diagnostics = diagnostics\n this.version = version\n\n return true\n }\n}\nexport type FileWithDiagnostics = {\n uri: lsp.DocumentUri\n version: number | undefined\n diagnostics: lsp.Diagnostic[]\n}\n\ntype DiagnosticEvents = {\n fileDiagnosticsChanged: [event: FileWithDiagnostics]\n}\n\nexport class DiagnosticsManager {\n private readonly sourceFiles = new DefaultMap<lsp.DocumentUri, SourceFileDiagnostics>()\n private readonly events = new EventEmitter<DiagnosticEvents>()\n\n setDiagnostics({\n uri,\n diagnostics,\n version,\n }: {\n uri: lsp.DocumentUri\n diagnostics: lsp.Diagnostic[] | 'pending'\n version: number | undefined\n }) {\n logger.debug(\n undefined,\n `[DiagMgr] Setting diagnostics for ${uri} ${version ?? '<no version>'} (${diagnostics === 'pending' ? 'pending' : diagnostics.length})`,\n )\n const fileDiagnostics = this.sourceFiles.getOrDefault(uri, () => new SourceFileDiagnostics())\n if (fileDiagnostics.setDiagnostics({ diagnostics, version })) {\n if (diagnostics === 'pending') return\n this.events.emit('fileDiagnosticsChanged', { uri, diagnostics, version })\n }\n }\n\n onFileDiagnosticsChanged(handler: (...args: DiagnosticEvents['fileDiagnosticsChanged']) => void): lsp.Disposable {\n this.events.on('fileDiagnosticsChanged', handler)\n return {\n dispose: () => {\n this.events.off('fileDiagnosticsChanged', handler)\n },\n }\n }\n}\n","import { TextDocument } from 'vscode-languageserver-textdocument'\nimport * as lsp from 'vscode-languageserver/node'\nimport { appVersion, packageVersion } from '../cli/app-version'\nimport { Constants } from '../constants'\nimport { logger, LogLevel } from '../logger'\nimport { LanguageServerLogSink } from '../logger/sinks/language-server-log-sink'\nimport { resolvePuyaPath } from '../puya/resolve-puya-path'\nimport type { AnalyserService } from './analyser-service'\nimport { createAnalyserService } from './analyser-service'\nimport { CompileTriggerQueue } from './compile-trigger-queue'\nimport { CompileWorker } from './compile-worker'\nimport type { FileWithDiagnostics } from './diagnostics-manager'\nimport { DiagnosticsManager } from './diagnostics-manager'\nimport { isCodeFixData } from './mapping'\nimport { LogExceptions } from './util/log-exceptions'\nimport { createNormalisedTextDocumentConnection, normalisedUri } from './util/uris'\n\ninterface LanguageServerConfiguration {\n // use LogLevel member names to maintain consistency with other extension settings\n logLevel?: Omit<keyof typeof LogLevel, 'Critical'>\n debounce?: number\n}\n\nconst resolveConnection = async (lspPort: number | undefined) => {\n if (!lspPort) {\n return lsp.createConnection(lsp.ProposedFeatures.all)\n }\n\n // When the debug env variable PUYA_TS_DEBUG_LSP_PORT is set, we start the server with socket transport.\n // Note: this is actually the opposite to how vscode-languageserver is designed.\n // Normally, the extension is the web socker server and the language server is the client.\n // Here, we flip it. This allows an easier debugging experience.\n // If changes are made to the language server, you can just restart the debugger\n // and choose the option \"Restart language server\" in the VS Code extension host instance.\n const transport = await lsp.createClientSocketTransport(lspPort)\n const protocol = await transport.onConnected()\n\n return lsp.createConnection(lsp.ProposedFeatures.all, protocol[0], protocol[1])\n}\n\nexport type LanguageServerOptions = {\n port?: number\n customPuyaPath?: string\n}\n\nconst PACKAGE_VERSION = packageVersion()\n\nexport class PuyaLanguageServer {\n readonly documents = new lsp.TextDocuments(TextDocument)\n readonly triggers = new CompileTriggerQueue()\n readonly workspaceFolders: lsp.URI[] = []\n readonly diagnosticsMgr: DiagnosticsManager\n readonly compileWorker: CompileWorker\n readonly analyserService: AnalyserService\n stopping = false\n\n constructor(\n public readonly connection: lsp.Connection,\n private readonly loggingSink: LanguageServerLogSink,\n puyaPath: string,\n ) {\n this.diagnosticsMgr = new DiagnosticsManager()\n this.analyserService = createAnalyserService({ puyaPath })\n this.compileWorker = new CompileWorker(this.triggers, this.analyserService, this.documents, this.diagnosticsMgr)\n\n connection.onInitialize(this.initialize.bind(this))\n connection.onInitialized(this.initialized.bind(this))\n connection.onCodeAction(this.codeAction.bind(this))\n connection.onDidChangeConfiguration(this.configurationChange.bind(this))\n this.documents.onDidChangeContent(this.documentDidChangeContent.bind(this))\n this.diagnosticsMgr.onFileDiagnosticsChanged(this.fileDiagnosticsChanged.bind(this))\n connection.onShutdown(this.shutdown.bind(this))\n }\n\n start() {\n this.documents.listen(createNormalisedTextDocumentConnection(this.connection))\n this.connection.listen()\n this.compileWorker.start()\n }\n\n async shutdown() {\n logger.debug(undefined, '[PuyaLanguageServer] Shutting down')\n this.stopping = true\n await this.compileWorker.stop()\n await this.analyserService.shutdown()\n logger.debug(undefined, '[PuyaLanguageServer] Shutdown')\n }\n\n initialize(params: lsp.InitializeParams): lsp.InitializeResult {\n this.workspaceFolders.push(...(params.workspaceFolders?.map((f) => normalisedUri({ uri: f.uri }).toString()) ?? []))\n this.triggers.enqueue({\n type: 'workspace',\n uris: this.workspaceFolders,\n })\n return {\n serverInfo: {\n name: 'Puya-TS Language Server',\n version: PACKAGE_VERSION,\n },\n capabilities: {\n textDocumentSync: lsp.TextDocumentSyncKind.Incremental,\n codeActionProvider: {\n resolveProvider: false,\n },\n },\n }\n }\n\n @LogExceptions\n initialized(params: lsp.InitializedParams) {\n logger.debug(undefined, `${Constants.languageServerSource}-ls initialized`)\n }\n\n @LogExceptions\n async fileDiagnosticsChanged(params: FileWithDiagnostics) {\n if (this.stopping) {\n logger.debug(undefined, `[Diagnostics Ignored (shutting down)]: ${params.uri}`)\n return\n }\n logger.debug(undefined, `[Diagnostics Changed]: ${params.uri}`)\n\n await this.connection.sendDiagnostics(params)\n logger.debug(undefined, `[Diagnostics Sent]: ${params.uri}`)\n }\n\n @LogExceptions\n documentDidChangeContent(params: lsp.TextDocumentChangeEvent<TextDocument>) {\n if (this.stopping) return\n const normalizedDocumentUri = normalisedUri({ uri: params.document.uri }).toString()\n logger.debug(undefined, `[Document Changed]: ${normalizedDocumentUri}`)\n this.diagnosticsMgr.setDiagnostics({ uri: normalizedDocumentUri, version: params.document.version, diagnostics: 'pending' })\n\n this.triggers.enqueue({\n type: 'file',\n uris: [normalizedDocumentUri],\n })\n }\n\n /**\n * Bound to connection.onCodeAction and called when a user hovers over a piece of code.\n *\n * Params includes the text range the user is hovering over and any diagnostics known to the\n * client at the time.\n *\n * Response should include actions the user can take and the command or text edits that should be\n * invoked/applied if selected\n * @param params\n */\n @LogExceptions\n codeAction(params: lsp.CodeActionParams): lsp.CodeAction[] {\n return params.context.diagnostics.flatMap((d): lsp.CodeAction | lsp.CodeAction[] => {\n if (isCodeFixData(d.data)) {\n return {\n title: d.data.message,\n kind: lsp.CodeActionKind.QuickFix,\n diagnostics: [d],\n edit: {\n changes: {\n [params.textDocument.uri]: [...d.data.edits],\n },\n },\n }\n }\n return []\n })\n }\n\n @LogExceptions\n configurationChange(params: lsp.DidChangeConfigurationParams) {\n const settings = params.settings as LanguageServerConfiguration\n const logLevel = LogLevel[settings.logLevel as keyof typeof LogLevel]\n if (logLevel !== undefined) {\n logger.debug(undefined, `setting log level to ${logLevel}`)\n this.loggingSink.minLogLevel = logLevel\n }\n }\n}\n\n// eslint-disable-next-line no-console\nconst cliLog = console.error\n\nexport async function startLanguageServer(options: LanguageServerOptions) {\n cliLog(`Puya-TS Language Server:\\n${appVersion({ withAVMVersion: false })}`)\n const connection = await resolveConnection(options.port)\n const languageServerSink = new LanguageServerLogSink(connection)\n logger.configure([languageServerSink])\n try {\n const puyaPath = await resolvePuyaPath(options)\n const server = new PuyaLanguageServer(connection, languageServerSink, puyaPath)\n server.start()\n } catch (e) {\n connection.console.error(`Unhandled exception ${e}`)\n }\n}\n","import { ArgumentParser, BooleanOptionalAction } from 'argparse'\nimport { appVersion } from '../cli/app-version'\nimport { checkNodeVersion } from '../cli/check-node-version'\nimport type { LanguageServerOptions } from './puya-language-server'\nimport { startLanguageServer } from './puya-language-server'\n\nexport async function parseCliArguments() {\n checkNodeVersion()\n const prog = 'puyats-ls'\n const parser = new ArgumentParser({\n prog,\n })\n\n parser.add_argument('--version', {\n action: 'store_const',\n help: 'Show application version',\n const: 'version',\n dest: 'command',\n })\n parser.add_argument('--debug-mode', {\n help: 'Start the language server in debug mode. Server will listen on the debug port (default 4001) for connections.',\n default: false,\n dest: 'debugMode',\n action: BooleanOptionalAction,\n })\n const [result, _] = parser.parse_known_args() as [PuyaTsCommand, unknown]\n\n switch (result.command) {\n case 'version':\n /* eslint-disable-next-line no-console */\n console.log(appVersion({ name: prog }))\n break\n default: {\n const options: LanguageServerOptions = {\n port: result.debugMode ? (parsePort(process.env.PUYA_TS_DEBUG_LSP_PORT) ?? 4001) : undefined,\n }\n\n await startLanguageServer(options)\n break\n }\n }\n}\n\ntype PuyaTsCommand = NoCommandArgs | VersionCommand\ninterface NoCommandArgs {\n command: 'none'\n debugMode: boolean\n}\ninterface VersionCommand {\n command: 'version'\n}\n\nfunction parsePort(value: string | undefined) {\n if (value === undefined) return undefined\n const val = Number(value)\n if (val > 0 && val < 2 ** 16 && Math.floor(val) === val) {\n return val\n }\n throw new Error(`Invalid port number ${value}`)\n}\n","import './util/polyfills'\nimport { parseCliArguments } from './language-server/parse'\n\nvoid parseCliArguments()\n"],"names":["require$$0","lsp.createConnection","lsp.ProposedFeatures","lsp.createClientSocketTransport","lsp.TextDocuments","lsp.TextDocumentSyncKind","lsp.CodeActionKind"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAM,gBAAgB,CAAC;AACvB,IAAI,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE;AACnD,QAAQ,IAAI,CAAC,IAAI,GAAG,GAAG;AACvB,QAAQ,IAAI,CAAC,WAAW,GAAG,UAAU;AACrC,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO;AAC/B,QAAQ,IAAI,CAAC,YAAY,GAAG,SAAS;AACrC,IAAI;AACJ,IAAI,IAAI,GAAG,GAAG;AACd,QAAQ,OAAO,IAAI,CAAC,IAAI;AACxB,IAAI;AACJ,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B,IAAI;AACJ,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,OAAO,IAAI,CAAC,QAAQ;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QAAA,IAAI,EAAE,+GAA+G;AACrH,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,MAAM,EAAE,qBAAqB;AAC9B,KAAA,CAAC;IACF,MAAM,CAAC,MAAS,CAAC,GAAG,MAAM,CAAC,gBAAgB,EAA8B;AAEzE,IAAA,QAAQ,MAAM,CAAC,OAAO;AACpB,QAAA,KAAK,SAAS;;AAEZ,YAAA,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACvC;QACF,SAAS;AACP,YAAA,MAAM,OAAO,GAA0B;gBACrC,IAAI,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,IAAI,IAAI,IAAI,SAAS;aAC7F;AAED,YAAA,MAAM,mBAAmB,CAAC,OAAO,CAAC;YAClC;QACF;;AAEJ;AAWA,SAAS,SAAS,CAAC,KAAyB,EAAA;IAC1C,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AACzC,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;AACzB,IAAA,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;AACvD,QAAA,OAAO,GAAG;IACZ;AACA,IAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,CAAA,CAAE,CAAC;AACjD;;ACxDA,KAAK,iBAAiB,EAAE","x_google_ignoreList":[0,1]}
package/bin/run-cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import '../cli.mjs';
3
- import '../options-COFRHTFQ.js';
3
+ import '../options-CJdnAUbx.js';
4
4
  import 'arcsecond';
5
5
  import 'node:fs';
6
6
  import 'node:util';
@@ -21,13 +21,13 @@ import 'polytype';
21
21
  import 'glob';
22
22
  import 'minimatch';
23
23
  import 'argparse';
24
- import '../resolve-puya-path-DtTAMi0Y.js';
24
+ import '../resolve-puya-path-PXFxrpdO.js';
25
25
  import 'fs';
26
26
  import 'node:url';
27
27
  import 'signal-exit';
28
28
  import 'tar';
29
29
  import 'node:zlib';
30
- import '../compile-Bz8LVwK2.js';
30
+ import '../compile-BjiMmmUX.js';
31
31
  import 'chalk';
32
- import '../check-node-version-CNvxI8_l.js';
32
+ import '../check-node-version-BeAm9-W7.js';
33
33
  //# sourceMappingURL=run-cli.mjs.map
@@ -1,6 +1,6 @@
1
1
  import chalk from 'chalk';
2
- import { C as Constants } from './options-COFRHTFQ.js';
3
- import { p as parseSemVer } from './resolve-puya-path-DtTAMi0Y.js';
2
+ import { C as Constants } from './options-CJdnAUbx.js';
3
+ import { p as parseSemVer } from './resolve-puya-path-PXFxrpdO.js';
4
4
 
5
5
  function writeError(text) {
6
6
  // eslint-disable-next-line no-console
@@ -17,4 +17,4 @@ function checkNodeVersion() {
17
17
  }
18
18
 
19
19
  export { checkNodeVersion as c };
20
- //# sourceMappingURL=check-node-version-CNvxI8_l.js.map
20
+ //# sourceMappingURL=check-node-version-BeAm9-W7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-node-version-CNvxI8_l.js","sources":["../src/cli/check-node-version.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Constants } from '../constants'\nimport { parseSemVer } from '../puya/semver'\n\nfunction writeError(text: string) {\n // eslint-disable-next-line no-console\n console.error(chalk.red(text))\n}\n\nexport function checkNodeVersion() {\n const min = parseSemVer(Constants.minNodeVersion)\n const actual = parseSemVer(process.versions.node)\n\n if (\n actual.major < min.major ||\n (actual.major === min.major && actual.minor < min.minor) ||\n (actual.major === min.major && actual.minor === min.minor && actual.rev < min.rev)\n ) {\n writeError(\n `Installed node version ${process.versions.node} is older than the minimum required version ${Constants.minNodeVersion}. You may experience compatibility issues.`,\n )\n }\n}\n"],"names":[],"mappings":";;;;AAIA,SAAS,UAAU,CAAC,IAAY,EAAA;;IAE9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChC;SAEgB,gBAAgB,GAAA;IAC9B,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC;IACjD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEjD,IAAA,IACE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK;AACxB,SAAC,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACvD,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,EAClF;AACA,QAAA,UAAU,CACR,CAAA,uBAAA,EAA0B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA,4CAAA,EAA+C,SAAS,CAAC,cAAc,CAAA,0CAAA,CAA4C,CACnK;IACH;AACF;;;;"}
1
+ {"version":3,"file":"check-node-version-BeAm9-W7.js","sources":["../src/cli/check-node-version.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Constants } from '../constants'\nimport { parseSemVer } from '../puya/semver'\n\nfunction writeError(text: string) {\n // eslint-disable-next-line no-console\n console.error(chalk.red(text))\n}\n\nexport function checkNodeVersion() {\n const min = parseSemVer(Constants.minNodeVersion)\n const actual = parseSemVer(process.versions.node)\n\n if (\n actual.major < min.major ||\n (actual.major === min.major && actual.minor < min.minor) ||\n (actual.major === min.major && actual.minor === min.minor && actual.rev < min.rev)\n ) {\n writeError(\n `Installed node version ${process.versions.node} is older than the minimum required version ${Constants.minNodeVersion}. You may experience compatibility issues.`,\n )\n }\n}\n"],"names":[],"mappings":";;;;AAIA,SAAS,UAAU,CAAC,IAAY,EAAA;;IAE9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChC;SAEgB,gBAAgB,GAAA;IAC9B,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC;IACjD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEjD,IAAA,IACE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK;AACxB,SAAC,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACvD,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,EAClF;AACA,QAAA,UAAU,CACR,CAAA,uBAAA,EAA0B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA,4CAAA,EAA+C,SAAS,CAAC,cAAc,CAAA,0CAAA,CAA4C,CACnK;IACH;AACF;;;;"}
package/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { d1 as isMinLevel, cY as LogLevel, cS as LoggingContext, d2 as enumFromValue, d3 as defaultPuyaOptions, cZ as logger, cU as AbsolutePath, cR as processInputPaths, cT as CompileOptions, d4 as parseCliTemplateVar, d5 as LocalsCoalescingStrategy } from './options-COFRHTFQ.js';
1
+ import { d2 as isMinLevel, cP as LogLevel, cR as LoggingContext, d3 as enumFromValue, d4 as defaultPuyaOptions, c_ as logger, cN as AbsolutePath, cU as processInputPaths, cO as CompileOptions, d5 as parseCliTemplateVar, d6 as LocalsCoalescingStrategy } from './options-CJdnAUbx.js';
2
2
  import { BooleanOptionalAction, ArgumentParser } from 'argparse';
3
- import { a as appVersion } from './resolve-puya-path-DtTAMi0Y.js';
4
- import { c as compile } from './compile-Bz8LVwK2.js';
3
+ import { a as appVersion } from './resolve-puya-path-PXFxrpdO.js';
4
+ import { c as compile } from './compile-BjiMmmUX.js';
5
5
  import chalk from 'chalk';
6
- import { c as checkNodeVersion } from './check-node-version-CNvxI8_l.js';
6
+ import { c as checkNodeVersion } from './check-node-version-BeAm9-W7.js';
7
7
  import 'arcsecond';
8
8
  import 'node:fs';
9
9
  import 'node:util';
@@ -1,5 +1,5 @@
1
- import { cV as mkDirIfNotExists, cW as PuyaService, cX as deserializeAndLog, cY as LogLevel, cS as LoggingContext, cO as registerPTypes, cZ as logger, c_ as createTsProgram, c$ as buildAwst, d0 as validateAwst, cP as typeRegistry } from './options-COFRHTFQ.js';
2
- import { r as resolvePuyaPath, a as appVersion } from './resolve-puya-path-DtTAMi0Y.js';
1
+ import { cX as mkDirIfNotExists, cY as PuyaService, cZ as deserializeAndLog, cP as LogLevel, cR as LoggingContext, cV as registerPTypes, c_ as logger, c$ as createTsProgram, d0 as buildAwst, d1 as validateAwst, cW as typeRegistry } from './options-CJdnAUbx.js';
2
+ import { r as resolvePuyaPath, a as appVersion } from './resolve-puya-path-PXFxrpdO.js';
3
3
  import ts from 'typescript';
4
4
 
5
5
  function buildCompilationSetMapping({ awst, inputPaths, compilationSet, }) {
@@ -103,4 +103,4 @@ async function compile(options, puyaService) {
103
103
  }
104
104
 
105
105
  export { compile as c };
106
- //# sourceMappingURL=compile-Bz8LVwK2.js.map
106
+ //# sourceMappingURL=compile-BjiMmmUX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile-Bz8LVwK2.js","sources":["../src/puya/build-compilation-set-mapping.ts","../src/puya/index.ts","../src/compile.ts"],"sourcesContent":["import type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport type { AlgoFile, CompilationSetMapping } from '../options'\nimport { mkDirIfNotExists } from '../util'\n\nexport function buildCompilationSetMapping({\n awst,\n inputPaths,\n compilationSet,\n}: {\n awst: AWST[]\n inputPaths: AlgoFile[]\n compilationSet: CompilationSet\n}): CompilationSetMapping {\n const setIds = new Set(compilationSet.compilationOutputSet.map((s) => s.id))\n\n return awst.reduce((acc, cur) => {\n if (setIds.has(cur.id.toString())) {\n const matchedPath = inputPaths.find((p) => cur.sourceLocation.file && p.sourceFile.equals(cur.sourceLocation.file))\n if (matchedPath) {\n mkDirIfNotExists(matchedPath.outDir.toString())\n acc[cur.id.toString()] = matchedPath.outDir.toString()\n }\n }\n return acc\n }, {} as CompilationSetMapping)\n}\n","import ts from 'typescript'\nimport type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport { LogLevel } from '../logger'\nimport type { CompileOptions } from '../options'\nimport type { SourceFileMapping } from '../parser'\nimport type { AbsolutePath } from '../util/absolute-path'\nimport { buildCompilationSetMapping } from './build-compilation-set-mapping'\nimport { deserializeAndLog } from './log-deserializer'\nimport { PuyaService } from './puya-service'\nimport { resolvePuyaPath } from './resolve-puya-path'\n\nexport async function puyaCompile({\n moduleAwst,\n programDirectory,\n sourceFiles,\n options,\n compilationSet,\n puyaService,\n}: {\n moduleAwst: AWST[]\n programDirectory: AbsolutePath\n sourceFiles: SourceFileMapping\n options: CompileOptions\n compilationSet: CompilationSet\n puyaService?: PuyaService\n}) {\n const puyaPath = await resolvePuyaPath(options)\n const localPuyaService = puyaService ?? new PuyaService({ puyaPath })\n const puyaOptions = options.buildPuyaOptions(\n buildCompilationSetMapping({\n awst: moduleAwst,\n inputPaths: options.filePaths,\n compilationSet,\n }),\n )\n\n const response = await localPuyaService.compile({\n awst: moduleAwst,\n options: puyaOptions,\n base_path: programDirectory.toString(),\n log_level: getPuyaLogLevel(options.logLevel),\n source_annotations: getSourceFileContents(sourceFiles),\n })\n // Shutdown service if we created it locally\n if (puyaService === undefined) await localPuyaService.shutdown()\n for (const log of response.logs) {\n deserializeAndLog(log)\n }\n}\n\nfunction getPuyaLogLevel(logLevel: LogLevel): string {\n switch (logLevel) {\n case LogLevel.Debug:\n return 'debug'\n case LogLevel.Info:\n return 'info'\n case LogLevel.Warning:\n return 'warning'\n case LogLevel.Error:\n return 'error'\n case LogLevel.Critical:\n return 'critical'\n }\n}\nfunction getSourceFileContents(sourceFiles: SourceFileMapping) {\n return Object.fromEntries(\n Object.entries(sourceFiles).map(([key, value]) => {\n const source = ts.isSourceFile(value) ? value.getFullText().replace(/\\r\\n/g, '\\n').split(/\\n/g) : value\n return [key, source] as const\n }),\n )\n}\n","import type ts from 'typescript'\nimport type { AWST } from './awst/nodes'\nimport { validateAwst } from './awst/validation'\nimport { buildAwst } from './awst_build'\nimport type { CompilationSet } from './awst_build/models/contract-class-model'\nimport { registerPTypes } from './awst_build/ptypes/register'\nimport { typeRegistry } from './awst_build/type-registry'\nimport { appVersion } from './cli/app-version'\nimport { logger, LoggingContext } from './logger'\nimport type { CompileOptions } from './options'\nimport { createTsProgram } from './parser'\nimport { puyaCompile } from './puya'\nimport type { PuyaService } from './puya/puya-service'\nimport type { AbsolutePath } from './util/absolute-path'\n\nexport type CompileResult = {\n programDirectory: AbsolutePath\n awst?: AWST[]\n ast?: Record<string, ts.SourceFile>\n compilationSet?: CompilationSet\n}\n\nexport async function compile(options: CompileOptions, puyaService?: PuyaService): Promise<CompileResult> {\n const loggerCtx = LoggingContext.current\n if (options.treatWarningsAsErrors) loggerCtx.treatWarningsAsErrors = true\n\n registerPTypes(typeRegistry)\n logger.info(undefined, appVersion({ withAVMVersion: false }))\n const programResult = createTsProgram(options)\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to parse errors')\n return {\n programDirectory: programResult.programDirectory,\n ast: programResult.sourceFiles,\n }\n }\n const { moduleAwst, compilationSet } = buildAwst(programResult, options)\n validateAwst(moduleAwst)\n\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to errors')\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n }\n if (!options.dryRun) {\n await puyaCompile({\n options,\n moduleAwst,\n programDirectory: programResult.programDirectory,\n compilationSet,\n sourceFiles: programResult.sourceFiles,\n puyaService,\n })\n }\n\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,0BAA0B,CAAC,EACzC,IAAI,EACJ,UAAU,EACV,cAAc,GAKf,EAAA;IACC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAE5E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AAC9B,QAAA,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE;AACjC,YAAA,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YACnH,IAAI,WAAW,EAAE;gBACf,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC/C,gBAAA,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE;YACxD;QACF;AACA,QAAA,OAAO,GAAG;IACZ,CAAC,EAAE,EAA2B,CAAC;AACjC;;ACdO,eAAe,WAAW,CAAC,EAChC,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,GAQZ,EAAA;AACC,IAAA,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC;IAC/C,MAAM,gBAAgB,GAAG,WAAW,IAAI,IAAI,WAAW,CAA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AACnB,QAAA,MAAM,WAAW,CAAC;YAChB,OAAO;YACP,UAAU;YACV,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,cAAc;YACd,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,WAAW;AACZ,SAAA,CAAC;IACJ;IAEA,OAAO;QACL,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;AAChD,QAAA,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,aAAa,CAAC,WAAW;QAC9B,cAAc;KACf;AACH;;;;"}
1
+ {"version":3,"file":"compile-BjiMmmUX.js","sources":["../src/puya/build-compilation-set-mapping.ts","../src/puya/index.ts","../src/compile.ts"],"sourcesContent":["import type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport type { AlgoFile, CompilationSetMapping } from '../options'\nimport { mkDirIfNotExists } from '../util'\n\nexport function buildCompilationSetMapping({\n awst,\n inputPaths,\n compilationSet,\n}: {\n awst: AWST[]\n inputPaths: AlgoFile[]\n compilationSet: CompilationSet\n}): CompilationSetMapping {\n const setIds = new Set(compilationSet.compilationOutputSet.map((s) => s.id))\n\n return awst.reduce((acc, cur) => {\n if (setIds.has(cur.id.toString())) {\n const matchedPath = inputPaths.find((p) => cur.sourceLocation.file && p.sourceFile.equals(cur.sourceLocation.file))\n if (matchedPath) {\n mkDirIfNotExists(matchedPath.outDir.toString())\n acc[cur.id.toString()] = matchedPath.outDir.toString()\n }\n }\n return acc\n }, {} as CompilationSetMapping)\n}\n","import ts from 'typescript'\nimport type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport { LogLevel } from '../logger'\nimport type { CompileOptions } from '../options'\nimport type { SourceFileMapping } from '../parser'\nimport type { AbsolutePath } from '../util/absolute-path'\nimport { buildCompilationSetMapping } from './build-compilation-set-mapping'\nimport { deserializeAndLog } from './log-deserializer'\nimport { PuyaService } from './puya-service'\nimport { resolvePuyaPath } from './resolve-puya-path'\n\nexport async function puyaCompile({\n moduleAwst,\n programDirectory,\n sourceFiles,\n options,\n compilationSet,\n puyaService,\n}: {\n moduleAwst: AWST[]\n programDirectory: AbsolutePath\n sourceFiles: SourceFileMapping\n options: CompileOptions\n compilationSet: CompilationSet\n puyaService?: PuyaService\n}) {\n const puyaPath = await resolvePuyaPath(options)\n const localPuyaService = puyaService ?? new PuyaService({ puyaPath })\n const puyaOptions = options.buildPuyaOptions(\n buildCompilationSetMapping({\n awst: moduleAwst,\n inputPaths: options.filePaths,\n compilationSet,\n }),\n )\n\n const response = await localPuyaService.compile({\n awst: moduleAwst,\n options: puyaOptions,\n base_path: programDirectory.toString(),\n log_level: getPuyaLogLevel(options.logLevel),\n source_annotations: getSourceFileContents(sourceFiles),\n })\n // Shutdown service if we created it locally\n if (puyaService === undefined) await localPuyaService.shutdown()\n for (const log of response.logs) {\n deserializeAndLog(log)\n }\n}\n\nfunction getPuyaLogLevel(logLevel: LogLevel): string {\n switch (logLevel) {\n case LogLevel.Debug:\n return 'debug'\n case LogLevel.Info:\n return 'info'\n case LogLevel.Warning:\n return 'warning'\n case LogLevel.Error:\n return 'error'\n case LogLevel.Critical:\n return 'critical'\n }\n}\nfunction getSourceFileContents(sourceFiles: SourceFileMapping) {\n return Object.fromEntries(\n Object.entries(sourceFiles).map(([key, value]) => {\n const source = ts.isSourceFile(value) ? value.getFullText().replace(/\\r\\n/g, '\\n').split(/\\n/g) : value\n return [key, source] as const\n }),\n )\n}\n","import type ts from 'typescript'\nimport type { AWST } from './awst/nodes'\nimport { validateAwst } from './awst/validation'\nimport { buildAwst } from './awst_build'\nimport type { CompilationSet } from './awst_build/models/contract-class-model'\nimport { registerPTypes } from './awst_build/ptypes/register'\nimport { typeRegistry } from './awst_build/type-registry'\nimport { appVersion } from './cli/app-version'\nimport { logger, LoggingContext } from './logger'\nimport type { CompileOptions } from './options'\nimport { createTsProgram } from './parser'\nimport { puyaCompile } from './puya'\nimport type { PuyaService } from './puya/puya-service'\nimport type { AbsolutePath } from './util/absolute-path'\n\nexport type CompileResult = {\n programDirectory: AbsolutePath\n awst?: AWST[]\n ast?: Record<string, ts.SourceFile>\n compilationSet?: CompilationSet\n}\n\nexport async function compile(options: CompileOptions, puyaService?: PuyaService): Promise<CompileResult> {\n const loggerCtx = LoggingContext.current\n if (options.treatWarningsAsErrors) loggerCtx.treatWarningsAsErrors = true\n\n registerPTypes(typeRegistry)\n logger.info(undefined, appVersion({ withAVMVersion: false }))\n const programResult = createTsProgram(options)\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to parse errors')\n return {\n programDirectory: programResult.programDirectory,\n ast: programResult.sourceFiles,\n }\n }\n const { moduleAwst, compilationSet } = buildAwst(programResult, options)\n validateAwst(moduleAwst)\n\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to errors')\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n }\n if (!options.dryRun) {\n await puyaCompile({\n options,\n moduleAwst,\n programDirectory: programResult.programDirectory,\n compilationSet,\n sourceFiles: programResult.sourceFiles,\n puyaService,\n })\n }\n\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,0BAA0B,CAAC,EACzC,IAAI,EACJ,UAAU,EACV,cAAc,GAKf,EAAA;IACC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAE5E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AAC9B,QAAA,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE;AACjC,YAAA,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC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IAAI,SAAS,CAAC,SAAS,EAAE,EAAE;AACzB,QAAA,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,wCAAwC,CAAC;QAChE,OAAO;YACL,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,GAAG,EAAE,aAAa,CAAC,WAAW;SAC/B;IACH;AACA,IAAA,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;IACxE,YAAY,CAAC,UAAU,CAAC;AAExB,IAAA,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE;AACzB,QAAA,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC;QAC1D,OAAO;YACL,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;AAChD,YAAA,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,aAAa,CAAC,WAAW;YAC9B,cAAc;SACf;IACH;AACA,IAAA,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;AACnB,QAAA,MAAM,WAAW,CAAC;YAChB,OAAO;YACP,UAAU;YACV,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,cAAc;YACd,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,WAAW;AACZ,SAAA,CAAC;IACJ;IAEA,OAAO;QACL,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;AAChD,QAAA,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,aAAa,CAAC,WAAW;QAC9B,cAAc;KACf;AACH;;;;"}
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { typeRegistry } from './awst_build/type-registry';
7
7
  export { TypeResolver } from './awst_build/type-resolver';
8
8
  export { compile } from './compile';
9
9
  export { processInputPaths } from './input-paths/process-input-paths';
10
- export { LoggingContext } from './logger';
10
+ export { LoggingContext, LogLevel, LogSource, LogEvent } from './logger';
11
11
  export { CompileOptions } from './options';
12
12
  export { AbsolutePath } from './util/absolute-path';
13
13
  export declare const encodingUtil: {
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { A as ABICompatibleInstanceType, a as ALL_OP_ENUMS, b as ARC4ArrayType, c as ARC4BoolClass, d as ARC4EncodedType, e as ARC4InstanceType, f as ARC4StrClass, g as ARC4StructClass, h as ARC4StructType, i as ARC4TupleType, j as AccountFunction, k as AddressClass, l as AnyPType, m as ApplicationFunctionType, n as ApplicationTxnFunction, o as ApprovalProgram, p as Arc4TupleGeneric, q as ArrayGeneric, r as ArrayLiteralPType, s as ArrayPType, t as AssetConfigTxnFunction, u as AssetFreezeTxnFunction, v as AssetFunction, w as AssetTransferTxnFunction, B as BaseContractClassType, x as BigIntLiteralPType, y as BigIntPType, z as BigUintFunction, D as BooleanFunction, E as BoxGeneric, F as BoxMapGeneric, G as BoxMapPType, H as BoxPType, I as ByteClass, J as BytesFunction, K as BytesGeneric, L as BytesPType, M as ClassMethodDecoratorContext, N as ClearStateProgram, O as ClusteredContractClassType, P as ClusteredPrototype, Q as ContractClassPType, R as ContractProxyGeneric, S as ContractProxyType, T as DynamicArrayGeneric, U as DynamicArrayType, V as DynamicBytesConstructor, W as DynamicBytesType, X as FixedArrayGeneric, Y as FixedArrayPType, Z as FunctionPType, _ as GeneratorGeneric, $ as GeneratorType, a0 as GenericPType, a1 as GlobalStateGeneric, a2 as GlobalStateType, a3 as GroupTransactionPType, a4 as ImmutableObjectPType, a5 as InnerTransactionPType, a6 as InstanceType, a7 as InternalType, a8 as IntersectionPType, a9 as IntrinsicEnumType, aa as IntrinsicFunctionGroupType, ab as IntrinsicFunctionGroupTypeType, ac as IntrinsicFunctionType, ad as IntrinsicFunctionTypeType, ae as IterableIteratorGeneric, af as IterableIteratorType, ag as ItxnParamsPType, ah as KeyRegistrationTxnFunction, ai as LibClassType, aj as LibFunctionType, ak as LibObjType, al as LocalStateGeneric, am as LocalStateType, an as LogicSigPType, ao as MutableObjectPType, ap as MutableTuplePType, aq as NamespacePType, ar as NumberPType, as as NumericLiteralPType, at as ObjectLiteralPType, au as ObjectWithOptionalFieldsType, av as PType, aw as PaymentTxnFunction, ax as PolytypeClassMethodHelper, ay as PromiseGeneric, az as PromiseType, aA as ReadonlyArrayGeneric, aB as ReadonlyArrayPType, aC as ReadonlyGeneric, aD as ReadonlyTuplePType, aE as ReferenceArrayGeneric, aF as ReferenceArrayType, aG as StaticArrayGeneric, aH as StaticArrayType, aI as StaticBytesGeneric, aJ as StaticBytesType, aK as StringFunction, aL as SuperPrototypeSelector, aM as SuperPrototypeSelectorGeneric, aN as TemplateVarFunction, aO as TransactionFunction, aP as TransactionFunctionType, aQ as TransientType, aR as TypeParameterType, aS as TypedApplicationCallResponseGeneric, aT as TypedApplicationCallResponseType, aU as UFixedNxMGeneric, aV as UFixedNxMType, aW as Uint64EnumMemberLiteralType, aX as Uint64EnumMemberType, aY as Uint64EnumType, aZ as Uint64Function, a_ as UintN128Class, a$ as UintN16Class, b0 as UintN256Class, b1 as UintN32Class, b2 as UintN64Class, b3 as UintN8Class, b4 as UintNGeneric, b5 as UintNType, b6 as UnionPType, b7 as UnsupportedType, b8 as abiCallFunction, b9 as accountPType, ba as anyGtxnType, bb as anyItxnParamsType, bc as anyItxnType, bd as anyPType, be as applicationCallGtxnType, bf as applicationCallItxnFn, bg as applicationCallItxnParamsType, bh as applicationItxnType, bi as applicationPType, bj as arc28EmitFunction, bk as arc4AbiMethodDecorator, bl as arc4AddressAlias, bm as arc4BareMethodDecorator, bn as arc4BaseContractType, bo as arc4BooleanType, bp as arc4ByteAlias, bq as arc4StringType, br as arc4StructBaseType, bs as arc4Uint64, bt as assertFunction, bu as assertMatchFunction, bv as assetConfigGtxnType, bw as assetConfigItxnFn, bx as assetConfigItxnParamsType, by as assetConfigItxnType, bz as assetFreezeGtxnType, bA as assetFreezeItxnFn, bB as assetFreezeItxnParamsType, bC as assetFreezeItxnType, bD as assetPType, bE as assetTransferGtxnType, bF as assetTransferItxnFn, bG as assetTransferItxnParamsType, bH as assetTransferItxnType, bI as base64PType, bJ as baseContractType, bK as bigIntPType, bL as biguintPType, bM as boolPType, bN as bytesPType, bO as bzeroFunction, bP as cloneFunctionPType, bQ as compileArc4Function, bR as compileFunctionType, bS as compiledContractType, bT as compiledLogicSigType, bU as contractOptionsDecorator, bV as convertBytesFunction, bW as decodeArc4Function, bX as ecPType, bY as ecdsaPType, bZ as encodeArc4Function, b_ as ensureBudgetFunction, b$ as errFunction, c0 as esSymbol, c1 as inputOnlyObjects, c2 as isArrayType, c3 as isObjectType, c4 as isTupleLike, c5 as itoaMethod, c6 as itxnComposePType, c7 as keyRegistrationGtxnType, c8 as keyRegistrationItxnFn, c9 as keyRegistrationItxnParamsType, ca as keyRegistrationItxnType, cb as logFunction, cc as logicSigBaseType, cd as logicSigOptionsDecorator, ce as matchFunction, cf as methodSelectorFunction, cg as mimcConfigurationsPType, ch as neverPType, ci as nullPType, cj as numberPType, ck as onCompleteActionType, cl as opUpFeeSourceType, cm as paymentGtxnType, cn as paymentItxnFn, co as paymentItxnParamsType, cp as paymentItxnType, cq as ptypeToArc4EncodedType, cr as readonlyDecorator, cs as sizeOfFunction, ct as stringPType, cu as submitGroupItxnFunction, cv as transactionTypeType, cw as uint64PType, cx as undefinedPType, cy as unknownPType, cz as urangeFunction, cA as validateEncodingFunctionPType, cB as voidPType, cC as vrfVerifyPType, cD as uint8ArrayToBigInt, cE as uint8ArrayToBase64, cF as uint8ArrayToBase32, cG as uint8ArrayToHex, cH as uint8ArrayToUtf8, cI as base64ToUint8Array, cJ as base32ToUint8Array, cK as hexToUint8Array, cL as bigIntToUint8Array, cM as utf8ToUint8Array } from './options-COFRHTFQ.js';
2
- export { cU as AbsolutePath, cT as CompileOptions, cS as LoggingContext, cN as SourceLocation, cQ as TypeResolver, cR as processInputPaths, cO as registerPTypes, cP as typeRegistry } from './options-COFRHTFQ.js';
3
- export { c as compile } from './compile-Bz8LVwK2.js';
1
+ import { A as ABICompatibleInstanceType, a as ALL_OP_ENUMS, b as ARC4ArrayType, c as ARC4BoolClass, d as ARC4EncodedType, e as ARC4InstanceType, f as ARC4StrClass, g as ARC4StructClass, h as ARC4StructType, i as ARC4TupleType, j as AccountFunction, k as AddressClass, l as AnyPType, m as ApplicationFunctionType, n as ApplicationTxnFunction, o as ApprovalProgram, p as Arc4TupleGeneric, q as ArrayGeneric, r as ArrayLiteralPType, s as ArrayPType, t as AssetConfigTxnFunction, u as AssetFreezeTxnFunction, v as AssetFunction, w as AssetTransferTxnFunction, B as BaseContractClassType, x as BigIntLiteralPType, y as BigIntPType, z as BigUintFunction, D as BooleanFunction, E as BoxGeneric, F as BoxMapGeneric, G as BoxMapPType, H as BoxPType, I as ByteClass, J as BytesFunction, K as BytesGeneric, L as BytesPType, M as ClassMethodDecoratorContext, N as ClearStateProgram, O as ClusteredContractClassType, P as ClusteredPrototype, Q as ContractClassPType, R as ContractProxyGeneric, S as ContractProxyType, T as DynamicArrayGeneric, U as DynamicArrayType, V as DynamicBytesConstructor, W as DynamicBytesType, X as FixedArrayGeneric, Y as FixedArrayPType, Z as FunctionPType, _ as GeneratorGeneric, $ as GeneratorType, a0 as GenericPType, a1 as GlobalStateGeneric, a2 as GlobalStateType, a3 as GroupTransactionPType, a4 as ImmutableObjectPType, a5 as InnerTransactionPType, a6 as InstanceType, a7 as InternalType, a8 as IntersectionPType, a9 as IntrinsicEnumType, aa as IntrinsicFunctionGroupType, ab as IntrinsicFunctionGroupTypeType, ac as IntrinsicFunctionType, ad as IntrinsicFunctionTypeType, ae as IterableIteratorGeneric, af as IterableIteratorType, ag as ItxnParamsPType, ah as KeyRegistrationTxnFunction, ai as LibClassType, aj as LibFunctionType, ak as LibObjType, al as LocalStateGeneric, am as LocalStateType, an as LogicSigPType, ao as MutableObjectPType, ap as MutableTuplePType, aq as NamespacePType, ar as NumberPType, as as NumericLiteralPType, at as ObjectLiteralPType, au as ObjectWithOptionalFieldsType, av as PType, aw as PaymentTxnFunction, ax as PolytypeClassMethodHelper, ay as PromiseGeneric, az as PromiseType, aA as ReadonlyArrayGeneric, aB as ReadonlyArrayPType, aC as ReadonlyGeneric, aD as ReadonlyTuplePType, aE as ReferenceArrayGeneric, aF as ReferenceArrayType, aG as StaticArrayGeneric, aH as StaticArrayType, aI as StaticBytesGeneric, aJ as StaticBytesType, aK as StringFunction, aL as SuperPrototypeSelector, aM as SuperPrototypeSelectorGeneric, aN as TemplateVarFunction, aO as TransactionFunction, aP as TransactionFunctionType, aQ as TransientType, aR as TypeParameterType, aS as TypedApplicationCallResponseGeneric, aT as TypedApplicationCallResponseType, aU as UFixedNxMGeneric, aV as UFixedNxMType, aW as Uint64EnumMemberLiteralType, aX as Uint64EnumMemberType, aY as Uint64EnumType, aZ as Uint64Function, a_ as UintN128Class, a$ as UintN16Class, b0 as UintN256Class, b1 as UintN32Class, b2 as UintN64Class, b3 as UintN8Class, b4 as UintNGeneric, b5 as UintNType, b6 as UnionPType, b7 as UnsupportedType, b8 as abiCallFunction, b9 as accountPType, ba as anyGtxnType, bb as anyItxnParamsType, bc as anyItxnType, bd as anyPType, be as applicationCallGtxnType, bf as applicationCallItxnFn, bg as applicationCallItxnParamsType, bh as applicationItxnType, bi as applicationPType, bj as arc28EmitFunction, bk as arc4AbiMethodDecorator, bl as arc4AddressAlias, bm as arc4BareMethodDecorator, bn as arc4BaseContractType, bo as arc4BooleanType, bp as arc4ByteAlias, bq as arc4StringType, br as arc4StructBaseType, bs as arc4Uint64, bt as assertFunction, bu as assertMatchFunction, bv as assetConfigGtxnType, bw as assetConfigItxnFn, bx as assetConfigItxnParamsType, by as assetConfigItxnType, bz as assetFreezeGtxnType, bA as assetFreezeItxnFn, bB as assetFreezeItxnParamsType, bC as assetFreezeItxnType, bD as assetPType, bE as assetTransferGtxnType, bF as assetTransferItxnFn, bG as assetTransferItxnParamsType, bH as assetTransferItxnType, bI as base64PType, bJ as baseContractType, bK as bigIntPType, bL as biguintPType, bM as boolPType, bN as bytesPType, bO as bzeroFunction, bP as cloneFunctionPType, bQ as compileArc4Function, bR as compileFunctionType, bS as compiledContractType, bT as compiledLogicSigType, bU as contractOptionsDecorator, bV as convertBytesFunction, bW as decodeArc4Function, bX as ecPType, bY as ecdsaPType, bZ as encodeArc4Function, b_ as ensureBudgetFunction, b$ as errFunction, c0 as esSymbol, c1 as inputOnlyObjects, c2 as isArrayType, c3 as isObjectType, c4 as isTupleLike, c5 as itoaMethod, c6 as itxnComposePType, c7 as keyRegistrationGtxnType, c8 as keyRegistrationItxnFn, c9 as keyRegistrationItxnParamsType, ca as keyRegistrationItxnType, cb as logFunction, cc as logicSigBaseType, cd as logicSigOptionsDecorator, ce as matchFunction, cf as methodSelectorFunction, cg as mimcConfigurationsPType, ch as neverPType, ci as nullPType, cj as numberPType, ck as onCompleteActionType, cl as opUpFeeSourceType, cm as paymentGtxnType, cn as paymentItxnFn, co as paymentItxnParamsType, cp as paymentItxnType, cq as ptypeToArc4EncodedType, cr as readonlyDecorator, cs as sizeOfFunction, ct as stringPType, cu as submitGroupItxnFunction, cv as transactionTypeType, cw as uint64PType, cx as undefinedPType, cy as unknownPType, cz as urangeFunction, cA as validateEncodingFunctionPType, cB as voidPType, cC as vrfVerifyPType, cD as uint8ArrayToBigInt, cE as uint8ArrayToBase64, cF as uint8ArrayToBase32, cG as uint8ArrayToHex, cH as uint8ArrayToUtf8, cI as base64ToUint8Array, cJ as base32ToUint8Array, cK as hexToUint8Array, cL as bigIntToUint8Array, cM as utf8ToUint8Array } from './options-CJdnAUbx.js';
2
+ export { cN as AbsolutePath, cO as CompileOptions, cP as LogLevel, cQ as LogSource, cR as LoggingContext, cS as SourceLocation, cT as TypeResolver, cU as processInputPaths, cV as registerPTypes, cW as typeRegistry } from './options-CJdnAUbx.js';
3
+ export { c as compile } from './compile-BjiMmmUX.js';
4
4
  import 'arcsecond';
5
5
  import 'node:fs';
6
6
  import 'node:util';
@@ -20,7 +20,7 @@ import 'change-case';
20
20
  import 'polytype';
21
21
  import 'glob';
22
22
  import 'minimatch';
23
- import './resolve-puya-path-DtTAMi0Y.js';
23
+ import './resolve-puya-path-PXFxrpdO.js';
24
24
  import 'fs';
25
25
  import 'node:url';
26
26
  import 'signal-exit';
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/awst_build/ptypes/for-export.ts","../src/index.ts"],"sourcesContent":["/* This file aggregates all ptypes into a single export for external consumption of the compiler api */\nexport { ptypeToArc4EncodedType } from '../arc4-util'\nexport * from './arc4-types'\nexport * from './index'\n","import {\n base32ToUint8Array,\n base64ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n uint8ArrayToHex,\n uint8ArrayToUtf8,\n utf8ToUint8Array,\n} from './util'\nimport './util/polyfills'\n\nexport { SourceLocation } from './awst/source-location'\nexport * as ptypes from './awst_build/ptypes/for-export'\nexport { registerPTypes } from './awst_build/ptypes/register'\nexport { typeRegistry } from './awst_build/type-registry'\nexport { TypeResolver } from './awst_build/type-resolver'\nexport { compile } from './compile'\nexport { processInputPaths } from './input-paths/process-input-paths'\nexport { LoggingContext } from './logger'\nexport { CompileOptions } from './options'\nexport { AbsolutePath } from './util/absolute-path'\n\nexport const encodingUtil = {\n utf8ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n base32ToUint8Array,\n base64ToUint8Array,\n uint8ArrayToUtf8,\n uint8ArrayToHex,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyBO,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/awst_build/ptypes/for-export.ts","../src/index.ts"],"sourcesContent":["/* This file aggregates all ptypes into a single export for external consumption of the compiler api */\nexport { ptypeToArc4EncodedType } from '../arc4-util'\nexport * from './arc4-types'\nexport * from './index'\n","import {\n base32ToUint8Array,\n base64ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n uint8ArrayToHex,\n uint8ArrayToUtf8,\n utf8ToUint8Array,\n} from './util'\nimport './util/polyfills'\n\nexport { SourceLocation } from './awst/source-location'\nexport * as ptypes from './awst_build/ptypes/for-export'\nexport { registerPTypes } from './awst_build/ptypes/register'\nexport { typeRegistry } from './awst_build/type-registry'\nexport { TypeResolver } from './awst_build/type-resolver'\nexport { compile } from './compile'\nexport { processInputPaths } from './input-paths/process-input-paths'\nexport { LoggingContext, LogLevel, LogSource, LogEvent } from './logger'\nexport { CompileOptions } from './options'\nexport { AbsolutePath } from './util/absolute-path'\n\nexport const encodingUtil = {\n utf8ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n base32ToUint8Array,\n base64ToUint8Array,\n uint8ArrayToUtf8,\n uint8ArrayToHex,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyBO,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;;;;;"}