@algorandfoundation/puya-ts 1.2.0-beta.22 → 1.2.0-beta.23

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,8 +1,8 @@
1
1
  import 'crypto';
2
2
  import 'node:worker_threads';
3
- export { c as createAnalyserService } from './analyser-service-DgJ4IAaP.js';
3
+ export { c as createAnalyserService } from './analyser-service-BFKP7nFu.js';
4
4
  import './contract-class-model-CY9ZMyyU.js';
5
- import './options-CRbi1zSh.js';
5
+ import './options-D_9OI_e6.js';
6
6
  import 'pathe';
7
7
  import 'typescript';
8
8
  import 'node:util';
package/bin/puyats-ls.mjs CHANGED
@@ -4,10 +4,10 @@ import { ArgumentParser, BooleanOptionalAction } from 'argparse';
4
4
  import { b as packageVersion, a as appVersion } from '../semver-BlMeOfo8.js';
5
5
  import { c as checkNodeVersion } from '../check-node-version-DHwzT8GC.js';
6
6
  import { __esDecorate, __runInitializers } from 'tslib';
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-DgJ4IAaP.js';
8
- import { r as resolvePuyaPath } from '../resolve-puya-path-BKsfk4qd.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-BFKP7nFu.js';
8
+ import { r as resolvePuyaPath } from '../resolve-puya-path-BnON0byV.js';
9
9
  import EventEmitter from 'node:events';
10
- import { a8 as DefaultMap } from '../options-CRbi1zSh.js';
10
+ import { a8 as DefaultMap } from '../options-D_9OI_e6.js';
11
11
  import 'typescript';
12
12
  import 'node:fs';
13
13
  import 'node:util';
package/bin/run-cli.mjs CHANGED
@@ -12,11 +12,11 @@ import 'argparse';
12
12
  import '../semver-BlMeOfo8.js';
13
13
  import 'fs';
14
14
  import 'node:url';
15
- import '../compile-D_9hW58g.js';
15
+ import '../compile-MzeR7I1-.js';
16
16
  import '../arc4-clientgen-Tbipufvi.js';
17
17
  import '@algorandfoundation/algokit-utils/abi';
18
18
  import 'fs/promises';
19
- import '../options-CRbi1zSh.js';
19
+ import '../options-D_9OI_e6.js';
20
20
  import 'arcsecond';
21
21
  import 'tslib';
22
22
  import 'node:buffer';
@@ -29,7 +29,7 @@ import 'net';
29
29
  import 'change-case';
30
30
  import 'glob';
31
31
  import 'minimatch';
32
- import '../resolve-puya-path-BKsfk4qd.js';
32
+ import '../resolve-puya-path-BnON0byV.js';
33
33
  import 'signal-exit';
34
34
  import 'tar';
35
35
  import 'node:zlib';
@@ -18,6 +18,7 @@ export interface BuildCommandArgs {
18
18
  output_destructured_ir: boolean;
19
19
  output_memory_ir: boolean;
20
20
  output_bytecode: boolean;
21
+ output_assembly_report: boolean;
21
22
  out_dir: string;
22
23
  debug_level: string;
23
24
  optimization_level: string;
package/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { l as logger, A as AbsolutePath, a as LoggingContext, L as LogLevel } from './contract-class-model-CY9ZMyyU.js';
2
2
  import { BooleanOptionalAction, ArgumentParser } from 'argparse';
3
3
  import { a as appVersion } from './semver-BlMeOfo8.js';
4
- import { c as compile } from './compile-D_9hW58g.js';
5
- import { $ as defaultPuyaOptions, Y as processInputPaths, W as CompileOptions, a0 as parseCliTemplateVar, a1 as LocalsCoalescingStrategy } from './options-CRbi1zSh.js';
4
+ import { c as compile } from './compile-MzeR7I1-.js';
5
+ import { $ as defaultPuyaOptions, Y as processInputPaths, W as CompileOptions, a0 as parseCliTemplateVar, a1 as LocalsCoalescingStrategy } from './options-D_9OI_e6.js';
6
6
  import { a as addEnumArg, C as ConsoleLogSink, c as convertInt } from './util-BmUgKp-7.js';
7
7
  import { c as checkNodeVersion } from './check-node-version-DHwzT8GC.js';
8
8
  import 'typescript';
@@ -17,7 +17,7 @@ import 'node:url';
17
17
  import './arc4-clientgen-Tbipufvi.js';
18
18
  import '@algorandfoundation/algokit-utils/abi';
19
19
  import 'fs/promises';
20
- import './resolve-puya-path-BKsfk4qd.js';
20
+ import './resolve-puya-path-BnON0byV.js';
21
21
  import 'tslib';
22
22
  import 'signal-exit';
23
23
  import 'cross-spawn';
@@ -112,6 +112,11 @@ function addBuildCommand(parser) {
112
112
  help: 'Output AVM bytecode',
113
113
  default: defaultPuyaOptions.outputBytecode,
114
114
  });
115
+ parser.add_argument('--output-assembly-report', {
116
+ action: BooleanOptionalAction,
117
+ help: 'Output "human-readable" source map for advanced debugging purposes.',
118
+ default: defaultPuyaOptions.outputAssemblyReport,
119
+ });
115
120
  parser.add_argument('--out-dir', {
116
121
  action: 'store',
117
122
  help: 'Where to output builder artifacts. Can use [name] placeholder to include contract name in path',
@@ -195,6 +200,7 @@ async function buildCommand(args) {
195
200
  outputMemoryIr: args.output_memory_ir,
196
201
  outputBytecode: args.output_bytecode,
197
202
  outputSourceMap: args.output_source_map,
203
+ outputAssemblyReport: args.output_assembly_report,
198
204
  debugLevel: convertInt(args.debug_level),
199
205
  optimizationLevel: convertInt(args.optimization_level),
200
206
  treatWarningsAsErrors: args.treat_warnings_as_errors,
package/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","sources":["../src/cli/build-command.ts","../src/cli/parse.ts","../src/cli.ts"],"sourcesContent":["import type { ArgumentParser } from 'argparse'\nimport { BooleanOptionalAction } from 'argparse'\nimport { compile } from '../compile'\nimport { processInputPaths } from '../input-paths/process-input-paths'\nimport { logger, LoggingContext, LogLevel } from '../logger'\nimport { ConsoleLogSink } from '../logger/sinks/console-log-sink'\nimport { CompileOptions, defaultPuyaOptions, LocalsCoalescingStrategy } from '../options'\n\nimport { AbsolutePath } from '../util/absolute-path'\nimport { parseCliTemplateVar } from '../util/template-var-cli-parser'\nimport { addEnumArg, convertInt } from './util'\n\nexport interface BuildCommandArgs {\n command: 'build'\n log_level: LogLevel\n output_awst: boolean\n output_awst_json: boolean\n dry_run: boolean\n skip_version_check: boolean\n output_teal: boolean\n output_source_map: boolean\n output_arc32: boolean\n output_arc56: boolean\n output_client: boolean\n output_ssa_ir: boolean\n output_optimization_ir: boolean\n output_destructured_ir: boolean\n output_memory_ir: boolean\n output_bytecode: boolean\n out_dir: string\n debug_level: string\n optimization_level: string\n treat_warnings_as_errors: boolean\n target_avm_version: string\n cli_template_definitions: string[]\n validate_abi_args: boolean\n validate_abi_return: boolean\n template_vars_prefix: string\n locals_coalescing_strategy: LocalsCoalescingStrategy\n paths: string[]\n puya_path: string\n}\n\nexport function addBuildCommand(parser: ArgumentParser) {\n addEnumArg(parser, {\n name: '--log-level',\n default: LogLevel.Info,\n enumType: LogLevel,\n help: 'The minimum log level to output',\n })\n\n parser.add_argument('--output-awst', {\n help: 'Output debugging awst file per parsed file',\n default: false,\n action: BooleanOptionalAction,\n })\n\n parser.add_argument('--output-awst-json', {\n action: BooleanOptionalAction,\n default: false,\n help: 'Output debugging awst json file per parsed file',\n })\n\n parser.add_argument('--dry-run', {\n action: BooleanOptionalAction,\n default: false,\n help: \"Just parse typescript files, don't invoke puya compiler\",\n })\n parser.add_argument('--skip-version-check', {\n action: BooleanOptionalAction,\n default: false,\n help: \"Don't verify installed puya compiler version matches targeted version\",\n })\n parser.add_argument('--output-teal', {\n action: BooleanOptionalAction,\n help: 'Output TEAL code',\n default: defaultPuyaOptions.outputTeal,\n })\n parser.add_argument('--output-source-map', {\n action: BooleanOptionalAction,\n help: 'Output debug source maps ',\n default: defaultPuyaOptions.outputSourceMap,\n })\n parser.add_argument('--output-arc32', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.arc32.json ARC-32 app spec file. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputArc32,\n })\n parser.add_argument('--output-arc56', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.arc56.json ARC-56 app spec file. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputArc56,\n })\n parser.add_argument('--output-client', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.client.ts Algorand TypeScript contract client for typed ARC-4 ABI calls. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputClient,\n })\n parser.add_argument('--output-ssa-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR (in SSA form) before optimisations',\n default: defaultPuyaOptions.outputSsaIr,\n })\n parser.add_argument('--output-optimization-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR after each optimization',\n default: defaultPuyaOptions.outputOptimizationIr,\n })\n parser.add_argument('--output-destructured-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR after SSA destructuring and before MIR',\n default: defaultPuyaOptions.outputDestructuredIr,\n })\n parser.add_argument('--output-memory-ir', {\n action: BooleanOptionalAction,\n help: 'Output MIR before lowering to TealOps',\n default: defaultPuyaOptions.outputMemoryIr,\n })\n parser.add_argument('--output-bytecode', {\n action: BooleanOptionalAction,\n help: 'Output AVM bytecode',\n default: defaultPuyaOptions.outputBytecode,\n })\n\n parser.add_argument('--out-dir', {\n action: 'store',\n help: 'Where to output builder artifacts. Can use [name] placeholder to include contract name in path',\n default: 'out',\n })\n\n parser.add_argument('--debug-level', {\n default: defaultPuyaOptions.debugLevel.toString(),\n choices: ['0', '1', '2'],\n help: 'Output debug information level, 0 = none, 1 = debug, 2 = reserved for future use',\n })\n parser.add_argument('--optimization-level', {\n default: defaultPuyaOptions.optimizationLevel.toString(),\n choices: ['0', '1', '2'],\n help: 'Set optimization level of output TEAL / AVM bytecode, 0 = none, 1 = normal, 2 = intensive',\n })\n parser.add_argument('--treat-warnings-as-errors', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.treatWarningsAsErrors,\n help: 'Report and treat all warnings emitted by the compiler as errors',\n })\n parser.add_argument('--target-avm-version', {\n default: defaultPuyaOptions.targetAvmVersion.toString(),\n choices: ['10', '11', '12', '13'],\n help: 'Select the targeted AVM version for compilation output',\n })\n\n parser.add_argument('--cli-template-definitions', {\n metavar: 'VAR=VALUE',\n nargs: '+',\n help: 'Define template vars for use when assembling via --output-bytecode, should be specified without the prefix (see --template-vars-prefix)',\n })\n\n parser.add_argument('--validate-abi-args', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.validateAbiArgs,\n help: 'Validates ABI transaction arguments by ensuring they are encoded correctly',\n })\n\n parser.add_argument('--validate-abi-return', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.validateAbiReturn,\n help: \"Validates encoding of ABI return values when using convertBytes with 'log' `prefix` option, arc4.abiCall, and strongly typed contract to contract calls\",\n })\n\n parser.add_argument('--template-vars-prefix', {\n help: 'Define the prefix to use with --template-var',\n default: defaultPuyaOptions.templateVarsPrefix,\n })\n\n addEnumArg(parser, {\n name: '--locals-coalescing-strategy',\n enumType: LocalsCoalescingStrategy,\n help: 'Strategy choice for out-of-ssa local variable coalescing. The best choice for your app is best determined through experimentation',\n default: defaultPuyaOptions.localsCoalescingStrategy,\n })\n\n parser.add_argument('paths', {\n metavar: 'PATHS',\n nargs: '*',\n help: 'The path, or paths to search for compatible .algo.ts files',\n default: ['.'],\n })\n\n parser.add_argument('--puya-path', {\n help: 'The path to Puya. If not provided, puya-ts will automatically download the appropriate binary for your system',\n })\n}\n\nexport async function buildCommand(args: BuildCommandArgs) {\n const logCtx = LoggingContext.create()\n return logCtx.run(async () => {\n logger.configure([new ConsoleLogSink(args.log_level, AbsolutePath.resolve({ path: '' }))])\n try {\n const filePaths = processInputPaths({ paths: args.paths, outDir: args.out_dir })\n\n await compile(\n new CompileOptions({\n filePaths,\n outputAwst: args.output_awst,\n outputAwstJson: args.output_awst_json,\n\n skipVersionCheck: args.skip_version_check,\n dryRun: args.dry_run,\n logLevel: args.log_level,\n\n outputTeal: args.output_teal,\n outputArc32: args.output_arc32,\n outputArc56: args.output_arc56,\n outputClient: args.output_client,\n outputSsaIr: args.output_ssa_ir,\n outputOptimizationIr: args.output_optimization_ir,\n outputDestructuredIr: args.output_destructured_ir,\n outputMemoryIr: args.output_memory_ir,\n outputBytecode: args.output_bytecode,\n outputSourceMap: args.output_source_map,\n debugLevel: convertInt(args.debug_level),\n optimizationLevel: convertInt(args.optimization_level),\n treatWarningsAsErrors: args.treat_warnings_as_errors,\n targetAvmVersion: convertInt(args.target_avm_version),\n cliTemplateDefinitions: Object.fromEntries(args.cli_template_definitions?.map(parseCliTemplateVar) ?? []),\n templateVarsPrefix: args.template_vars_prefix,\n localsCoalescingStrategy: args.locals_coalescing_strategy,\n customPuyaPath: args.puya_path,\n validateAbiArgs: args.validate_abi_args,\n validateAbiReturn: args.validate_abi_return,\n }),\n )\n logCtx.exitIfErrors()\n } catch (e) {\n if (e instanceof Error) {\n logger.error(e)\n } else {\n throw e\n }\n }\n })\n}\n","import { ArgumentParser } from 'argparse'\nimport { appVersion } from './app-version'\nimport type { BuildCommandArgs } from './build-command'\nimport { addBuildCommand, buildCommand } from './build-command'\nimport { checkNodeVersion } from './check-node-version'\n\nexport async function parseCliArguments() {\n checkNodeVersion()\n const parser = new ArgumentParser({\n prog: 'puya-ts',\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.set_defaults({\n command: 'build',\n })\n addBuildCommand(parser)\n const result: PuyaTsCommand = parser.parse_args()\n switch (result.command) {\n case 'build':\n await buildCommand(result)\n break\n case 'version':\n /* eslint-disable-next-line no-console */\n console.log(appVersion())\n break\n default:\n parser.print_help()\n break\n }\n}\n\ntype PuyaTsCommand = NoCommandArgs | BuildCommandArgs | VersionCommand\ninterface NoCommandArgs {\n command: 'none'\n}\ninterface VersionCommand {\n command: 'version'\n}\n","import './util/polyfills'\nimport { parseCliArguments } from './cli/parse'\n\nvoid parseCliArguments()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CM,SAAU,eAAe,CAAC,MAAsB,EAAA;IACpD,UAAU,CAAC,MAAM,EAAE;AACjB,QAAA,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,QAAQ,CAAC,IAAI;AACtB,QAAA,QA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],"sourcesContent":["import type { ArgumentParser } from 'argparse'\nimport { BooleanOptionalAction } from 'argparse'\nimport { compile } from '../compile'\nimport { processInputPaths } from '../input-paths/process-input-paths'\nimport { logger, LoggingContext, LogLevel } from '../logger'\nimport { ConsoleLogSink } from '../logger/sinks/console-log-sink'\nimport { CompileOptions, defaultPuyaOptions, LocalsCoalescingStrategy } from '../options'\n\nimport { AbsolutePath } from '../util/absolute-path'\nimport { parseCliTemplateVar } from '../util/template-var-cli-parser'\nimport { addEnumArg, convertInt } from './util'\n\nexport interface BuildCommandArgs {\n command: 'build'\n log_level: LogLevel\n output_awst: boolean\n output_awst_json: boolean\n dry_run: boolean\n skip_version_check: boolean\n output_teal: boolean\n output_source_map: boolean\n output_arc32: boolean\n output_arc56: boolean\n output_client: boolean\n output_ssa_ir: boolean\n output_optimization_ir: boolean\n output_destructured_ir: boolean\n output_memory_ir: boolean\n output_bytecode: boolean\n output_assembly_report: boolean\n out_dir: string\n debug_level: string\n optimization_level: string\n treat_warnings_as_errors: boolean\n target_avm_version: string\n cli_template_definitions: string[]\n validate_abi_args: boolean\n validate_abi_return: boolean\n template_vars_prefix: string\n locals_coalescing_strategy: LocalsCoalescingStrategy\n paths: string[]\n puya_path: string\n}\n\nexport function addBuildCommand(parser: ArgumentParser) {\n addEnumArg(parser, {\n name: '--log-level',\n default: LogLevel.Info,\n enumType: LogLevel,\n help: 'The minimum log level to output',\n })\n\n parser.add_argument('--output-awst', {\n help: 'Output debugging awst file per parsed file',\n default: false,\n action: BooleanOptionalAction,\n })\n\n parser.add_argument('--output-awst-json', {\n action: BooleanOptionalAction,\n default: false,\n help: 'Output debugging awst json file per parsed file',\n })\n\n parser.add_argument('--dry-run', {\n action: BooleanOptionalAction,\n default: false,\n help: \"Just parse typescript files, don't invoke puya compiler\",\n })\n parser.add_argument('--skip-version-check', {\n action: BooleanOptionalAction,\n default: false,\n help: \"Don't verify installed puya compiler version matches targeted version\",\n })\n parser.add_argument('--output-teal', {\n action: BooleanOptionalAction,\n help: 'Output TEAL code',\n default: defaultPuyaOptions.outputTeal,\n })\n parser.add_argument('--output-source-map', {\n action: BooleanOptionalAction,\n help: 'Output debug source maps ',\n default: defaultPuyaOptions.outputSourceMap,\n })\n parser.add_argument('--output-arc32', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.arc32.json ARC-32 app spec file. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputArc32,\n })\n parser.add_argument('--output-arc56', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.arc56.json ARC-56 app spec file. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputArc56,\n })\n parser.add_argument('--output-client', {\n action: BooleanOptionalAction,\n help: 'Output {contract}.client.ts Algorand TypeScript contract client for typed ARC-4 ABI calls. Only applicable to ARC4 contracts ',\n default: defaultPuyaOptions.outputClient,\n })\n parser.add_argument('--output-ssa-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR (in SSA form) before optimisations',\n default: defaultPuyaOptions.outputSsaIr,\n })\n parser.add_argument('--output-optimization-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR after each optimization',\n default: defaultPuyaOptions.outputOptimizationIr,\n })\n parser.add_argument('--output-destructured-ir', {\n action: BooleanOptionalAction,\n help: 'Output IR after SSA destructuring and before MIR',\n default: defaultPuyaOptions.outputDestructuredIr,\n })\n parser.add_argument('--output-memory-ir', {\n action: BooleanOptionalAction,\n help: 'Output MIR before lowering to TealOps',\n default: defaultPuyaOptions.outputMemoryIr,\n })\n parser.add_argument('--output-bytecode', {\n action: BooleanOptionalAction,\n help: 'Output AVM bytecode',\n default: defaultPuyaOptions.outputBytecode,\n })\n parser.add_argument('--output-assembly-report', {\n action: BooleanOptionalAction,\n help: 'Output \"human-readable\" source map for advanced debugging purposes.',\n default: defaultPuyaOptions.outputAssemblyReport,\n })\n\n parser.add_argument('--out-dir', {\n action: 'store',\n help: 'Where to output builder artifacts. Can use [name] placeholder to include contract name in path',\n default: 'out',\n })\n\n parser.add_argument('--debug-level', {\n default: defaultPuyaOptions.debugLevel.toString(),\n choices: ['0', '1', '2'],\n help: 'Output debug information level, 0 = none, 1 = debug, 2 = reserved for future use',\n })\n parser.add_argument('--optimization-level', {\n default: defaultPuyaOptions.optimizationLevel.toString(),\n choices: ['0', '1', '2'],\n help: 'Set optimization level of output TEAL / AVM bytecode, 0 = none, 1 = normal, 2 = intensive',\n })\n parser.add_argument('--treat-warnings-as-errors', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.treatWarningsAsErrors,\n help: 'Report and treat all warnings emitted by the compiler as errors',\n })\n parser.add_argument('--target-avm-version', {\n default: defaultPuyaOptions.targetAvmVersion.toString(),\n choices: ['10', '11', '12', '13'],\n help: 'Select the targeted AVM version for compilation output',\n })\n\n parser.add_argument('--cli-template-definitions', {\n metavar: 'VAR=VALUE',\n nargs: '+',\n help: 'Define template vars for use when assembling via --output-bytecode, should be specified without the prefix (see --template-vars-prefix)',\n })\n\n parser.add_argument('--validate-abi-args', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.validateAbiArgs,\n help: 'Validates ABI transaction arguments by ensuring they are encoded correctly',\n })\n\n parser.add_argument('--validate-abi-return', {\n action: BooleanOptionalAction,\n default: defaultPuyaOptions.validateAbiReturn,\n help: \"Validates encoding of ABI return values when using convertBytes with 'log' `prefix` option, arc4.abiCall, and strongly typed contract to contract calls\",\n })\n\n parser.add_argument('--template-vars-prefix', {\n help: 'Define the prefix to use with --template-var',\n default: defaultPuyaOptions.templateVarsPrefix,\n })\n\n addEnumArg(parser, {\n name: '--locals-coalescing-strategy',\n enumType: LocalsCoalescingStrategy,\n help: 'Strategy choice for out-of-ssa local variable coalescing. The best choice for your app is best determined through experimentation',\n default: defaultPuyaOptions.localsCoalescingStrategy,\n })\n\n parser.add_argument('paths', {\n metavar: 'PATHS',\n nargs: '*',\n help: 'The path, or paths to search for compatible .algo.ts files',\n default: ['.'],\n })\n\n parser.add_argument('--puya-path', {\n help: 'The path to Puya. If not provided, puya-ts will automatically download the appropriate binary for your system',\n })\n}\n\nexport async function buildCommand(args: BuildCommandArgs) {\n const logCtx = LoggingContext.create()\n return logCtx.run(async () => {\n logger.configure([new ConsoleLogSink(args.log_level, AbsolutePath.resolve({ path: '' }))])\n try {\n const filePaths = processInputPaths({ paths: args.paths, outDir: args.out_dir })\n\n await compile(\n new CompileOptions({\n filePaths,\n outputAwst: args.output_awst,\n outputAwstJson: args.output_awst_json,\n\n skipVersionCheck: args.skip_version_check,\n dryRun: args.dry_run,\n logLevel: args.log_level,\n\n outputTeal: args.output_teal,\n outputArc32: args.output_arc32,\n outputArc56: args.output_arc56,\n outputClient: args.output_client,\n outputSsaIr: args.output_ssa_ir,\n outputOptimizationIr: args.output_optimization_ir,\n outputDestructuredIr: args.output_destructured_ir,\n outputMemoryIr: args.output_memory_ir,\n outputBytecode: args.output_bytecode,\n outputSourceMap: args.output_source_map,\n outputAssemblyReport: args.output_assembly_report,\n debugLevel: convertInt(args.debug_level),\n optimizationLevel: convertInt(args.optimization_level),\n treatWarningsAsErrors: args.treat_warnings_as_errors,\n targetAvmVersion: convertInt(args.target_avm_version),\n cliTemplateDefinitions: Object.fromEntries(args.cli_template_definitions?.map(parseCliTemplateVar) ?? []),\n templateVarsPrefix: args.template_vars_prefix,\n localsCoalescingStrategy: args.locals_coalescing_strategy,\n customPuyaPath: args.puya_path,\n validateAbiArgs: args.validate_abi_args,\n validateAbiReturn: args.validate_abi_return,\n }),\n )\n logCtx.exitIfErrors()\n } catch (e) {\n if (e instanceof Error) {\n logger.error(e)\n } else {\n throw e\n }\n }\n })\n}\n","import { ArgumentParser } from 'argparse'\nimport { appVersion } from './app-version'\nimport type { BuildCommandArgs } from './build-command'\nimport { addBuildCommand, buildCommand } from './build-command'\nimport { checkNodeVersion } from './check-node-version'\n\nexport async function parseCliArguments() {\n checkNodeVersion()\n const parser = new ArgumentParser({\n prog: 'puya-ts',\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.set_defaults({\n command: 'build',\n })\n addBuildCommand(parser)\n const result: PuyaTsCommand = parser.parse_args()\n switch (result.command) {\n case 'build':\n await buildCommand(result)\n break\n case 'version':\n /* eslint-disable-next-line no-console */\n console.log(appVersion())\n break\n default:\n parser.print_help()\n break\n }\n}\n\ntype PuyaTsCommand = NoCommandArgs | BuildCommandArgs | VersionCommand\ninterface NoCommandArgs {\n command: 'none'\n}\ninterface VersionCommand {\n command: 'version'\n}\n","import './util/polyfills'\nimport { parseCliArguments } from './cli/parse'\n\nvoid parseCliArguments()\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CM,SAAU,eAAe,CAAC,MAAsB,EAAA;IACpD,UAAU,CAAC,MAAM,EAAE;AACjB,QAAA,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,QAAQ,CAAC,IAAI;AACtB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,IAAI,EAAE,iCAAiC;AACxC,KAAA,CAAC;AAEF,IAAA,MAAM,CAAC,YAAY,CAAC,eAAe,EAAE;AACnC,QAAA,IAAI,EAAE,4CAA4C;AAClD,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,MAAM,EAAE,qBAAqB;AAC9B,KAAA,CAAC;AAEF,IAAA,MAAM,CAAC,YAAY,CAAC,oBAAoB,EAAE;AACxC,QAAA,MAAM,EAAE,qBAAqB;AAC7B,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,IAAI,EAAE,iDAAiD;AACxD,KAAA,CAAC;AAEF,IAAA,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE;AAC/B,QAAA,MAAM,EAAE,qBAAqB;AAC7B,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,IAAI,EAAE,yDAAyD;AAChE,KAAA,CAAC;AACF,IAAA,MAAM,CAAC,YAAY,CAAC,sBAAsB,EAAE;AAC1C,QAAA,MAAM,EAAE,qBAAqB;AAC7B,QAAA,OAAO,EAA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AA,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;AAChC,QAAA,IAAI,EAAE,SAAS;AAChB,KAAA,CAAC;AAEF,IAAA,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE;AAC/B,QAAA,MAAM,EAAE,aAAa;AACrB,QAAA,IAAI,EAAE,0BAA0B;AAChC,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,IAAI,EAAE,SAAS;AAChB,KAAA,CAAC;IACF,MAAM,CAAC,YAAY,CAAC;AAClB,QAAA,OAAO,EAAE,OAAO;AACjB,KAAA,CAAC;IACF,eAAe,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,MAAM,GAAkB,MAAM,CAAC,UAAU,EAAE;AACjD,IAAA,QAAQ,MAAM,CAAC,OAAO;AACpB,QAAA,KAAK,OAAO;AACV,YAAA,MAAM,YAAY,CAAC,MAAM,CAAC;YAC1B;AACF,QAAA,KAAK,SAAS;;AAEZ,YAAA,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;YACzB;AACF,QAAA;YACE,MAAM,CAAC,UAAU,EAAE;YACnB;;AAEN;;AChCA,KAAK,iBAAiB,EAAE"}
@@ -1,9 +1,9 @@
1
1
  import { a as writeARC4Clients } from './arc4-clientgen-Tbipufvi.js';
2
- import { a2 as PuyaService, a3 as deserializeAndLog, Z as registerPTypes, a4 as createTsProgram, a5 as buildAwst, a6 as validateAwst, _ as typeRegistry } from './options-CRbi1zSh.js';
2
+ import { a2 as PuyaService, a3 as deserializeAndLog, Z as registerPTypes, a4 as createTsProgram, a5 as buildAwst, a6 as validateAwst, _ as typeRegistry } from './options-D_9OI_e6.js';
3
3
  import { a as appVersion } from './semver-BlMeOfo8.js';
4
4
  import { cg as mkDirIfNotExists, L as LogLevel, a as LoggingContext, l as logger } from './contract-class-model-CY9ZMyyU.js';
5
5
  import ts from 'typescript';
6
- import { r as resolvePuyaPath } from './resolve-puya-path-BKsfk4qd.js';
6
+ import { r as resolvePuyaPath } from './resolve-puya-path-BnON0byV.js';
7
7
 
8
8
  function buildCompilationSetMapping({ awst, inputPaths, compilationSet, }) {
9
9
  const setIds = new Set(compilationSet.compilationOutputSet.map((s) => s.id));
@@ -110,4 +110,4 @@ async function compile(options, puyaService) {
110
110
  }
111
111
 
112
112
  export { compile as c };
113
- //# sourceMappingURL=compile-D_9hW58g.js.map
113
+ //# sourceMappingURL=compile-MzeR7I1-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile-D_9hW58g.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 return response\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 { writeARC4Clients } from './arc4-clientgen'\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 const compileResult = await puyaCompile({\n options,\n moduleAwst,\n programDirectory: programResult.programDirectory,\n compilationSet,\n sourceFiles: programResult.sourceFiles,\n puyaService,\n })\n\n if (options.outputClient) {\n await writeARC4Clients(compilationSet, options.filePaths, compileResult.arc56)\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,MAA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apping.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 return response\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 { writeARC4Clients } from './arc4-clientgen'\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 const compileResult = await puyaCompile({\n options,\n moduleAwst,\n programDirectory: programResult.programDirectory,\n compilationSet,\n sourceFiles: programResult.sourceFiles,\n puyaService,\n })\n\n if (options.outputClient) {\n await writeARC4Clients(compilationSet, options.filePaths, compileResult.arc56)\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,EAA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E,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,aAAa,GAAG,MAAM,WAAW,CAAC;YACtC,OAAO;YACP,UAAU;YACV,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;YAChD,cAAc;YACd,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,WAAW;AACZ,SAAA,CAAC;AAEF,QAAA,IAAI,OAAO,CAAC,YAAY,EAAE;AACxB,YAAA,MAAM,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC;QAChF;IACF;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.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { o as ABICompatibleInstanceType, q as ALL_OP_ENUMS, r as AccountFunction, s as AnyPType, t as ApplicationFunctionType, u as ApplicationTxnFunction, w as ApprovalProgram, x as ArrayGeneric, y as ArrayLiteralPType, z as ArrayPType, B as AssetConfigTxnFunction, D as AssetFreezeTxnFunction, E as AssetFunction, F as AssetTransferTxnFunction, G as BaseContractClassType, H as BigIntLiteralPType, J as BigIntPType, K as BigUintFunction, M as BooleanFunction, N as BoxGeneric, Q as BoxMapGeneric, R as BoxMapPType, S as BoxPType, T as BytesFunction, U as BytesGeneric, V as BytesPType, W as ClassMethodDecoratorContext, X as ClearStateProgram, Y as ClusteredContractClassType, Z as ClusteredPrototype, _ as ContractClassPType, $ as FixedArrayGeneric, a0 as FixedArrayPType, a1 as FunctionPType, a2 as GeneratorGeneric, a3 as GeneratorType, a4 as GenericPType, a5 as GlobalStateGeneric, a6 as GlobalStateType, a7 as GroupTransactionPType, a8 as ImmutableObjectPType, a9 as InnerTransactionPType, aa as InstanceType, ab as InternalType, ac as IntersectionPType, ad as IntrinsicEnumType, ae as IntrinsicFunctionGroupType, af as IntrinsicFunctionGroupTypeType, ag as IntrinsicFunctionType, ah as IntrinsicFunctionTypeType, ai as IterableIteratorGeneric, aj as IterableIteratorType, ak as ItxnParamsPType, al as KeyRegistrationTxnFunction, am as LibClassType, an as LibFunctionType, ao as LibObjType, ap as LocalStateGeneric, aq as LocalStateType, ar as LogicSigPType, as as MutableObjectPType, at as MutableTuplePType, au as NamespacePType, av as NumberPType, aw as NumericLiteralPType, ax as ObjectLiteralPType, ay as ObjectWithOptionalFieldsType, az as PType, aA as PaymentTxnFunction, aB as PolytypeClassMethodHelper, aC as PromiseGeneric, aD as PromiseType, aE as ReadonlyArrayGeneric, aF as ReadonlyArrayPType, aG as ReadonlyGeneric, aH as ReadonlyTuplePType, aI as ReferenceArrayGeneric, aJ as ReferenceArrayType, 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 Uint64EnumMemberLiteralType, aT as Uint64EnumMemberType, aU as Uint64EnumType, aV as Uint64Function, aW as UnionPType, aX as UnsupportedType, e as accountPType, h as anyGtxnType, aY as anyItxnParamsType, aZ as anyItxnType, a_ as anyPType, n as applicationCallGtxnType, a$ as applicationCallItxnFn, b0 as applicationCallItxnParamsType, b1 as applicationItxnType, f as applicationPType, b2 as arc28EmitFunction, b3 as arc4AbiMethodDecorator, b4 as arc4BareMethodDecorator, b5 as arc4BaseContractType, b6 as assertFunction, b7 as assertMatchFunction, i as assetConfigGtxnType, b8 as assetConfigItxnFn, b9 as assetConfigItxnParamsType, ba as assetConfigItxnType, m as assetFreezeGtxnType, bb as assetFreezeItxnFn, bc as assetFreezeItxnParamsType, bd as assetFreezeItxnType, g as assetPType, j as assetTransferGtxnType, be as assetTransferItxnFn, bf as assetTransferItxnParamsType, bg as assetTransferItxnType, bh as base64PType, bi as baseContractType, bj as bigIntPType, bk as biguintPType, bl as boolPType, bm as bytesPType, bn as bzeroFunction, bo as cloneFunctionPType, bp as compileFunctionType, bq as compiledContractType, br as compiledLogicSigType, bs as contractOptionsDecorator, bt as ecPType, bu as ecdsaPType, bv as ensureBudgetFunction, bw as errFunction, bx as esSymbol, by as inputOnlyObjects, bz as isArrayType, bA as isObjectType, bB as isTupleLike, bC as itoaMethod, bD as itxnComposePType, k as keyRegistrationGtxnType, bE as keyRegistrationItxnFn, bF as keyRegistrationItxnParamsType, bG as keyRegistrationItxnType, bH as logFunction, bI as loggedAssertFunction, bJ as loggedErrFunction, bK as logicSigBaseType, bL as logicSigOptionsDecorator, bM as matchFunction, bN as mimcConfigurationsPType, bO as neverPType, bP as nullPType, bQ as numberPType, bR as onCompleteActionType, bS as opUpFeeSourceType, p as paymentGtxnType, bT as paymentItxnFn, bU as paymentItxnParamsType, bV as paymentItxnType, bW as readonlyDecorator, bX as stringPType, bY as submitGroupItxnFunction, bZ as transactionTypeType, b_ as uint64PType, b$ as undefinedPType, c0 as unknownPType, c1 as urangeFunction, c2 as validateEncodingFunctionPType, v as voidPType, c3 as vrfVerifyPType, c4 as uint8ArrayToBigInt, c5 as uint8ArrayToBase64, c6 as uint8ArrayToBase32, c7 as uint8ArrayToUtf8, c8 as base64ToUint8Array, c9 as base32ToUint8Array, ca as bigIntToUint8Array, cb as utf8ToUint8Array } from './contract-class-model-CY9ZMyyU.js';
2
2
  export { A as AbsolutePath, L as LogLevel, cc as LogSource, a as LoggingContext, cd as SourceLocation } from './contract-class-model-CY9ZMyyU.js';
3
- import { A as ARC4ArrayType, a as ARC4BoolClass, b as ARC4EncodedType, c as ARC4InstanceType, d as ARC4StrClass, e as ARC4StructClass, f as ARC4StructType, g as ARC4TupleType, h as AddressClass, i as Arc4TupleGeneric, B as ByteClass, C as ContractProxyGeneric, j as ContractProxyType, D as DynamicArrayGeneric, k as DynamicArrayType, l as DynamicBytesConstructor, m as DynamicBytesType, S as StaticArrayGeneric, n as StaticArrayType, o as StaticBytesGeneric, p as StaticBytesType, T as TypedApplicationCallResponseGeneric, q as TypedApplicationCallResponseType, U as UFixedNxMGeneric, r as UFixedNxMType, s as UintN128Class, t as UintN16Class, u as UintN256Class, v as UintN32Class, w as UintN64Class, x as UintN8Class, y as UintNGeneric, z as UintNType, E as abiCallFunction, F as arc4AddressAlias, G as arc4BooleanType, H as arc4ByteAlias, I as arc4StringType, J as arc4StructBaseType, K as arc4Uint64, L as compileArc4Function, M as convertBytesFunction, N as decodeArc4Function, O as encodeArc4Function, P as methodSelectorFunction, Q as sizeOfFunction, R as uint8ArrayToHex, V as hexToUint8Array } from './options-CRbi1zSh.js';
4
- export { W as CompileOptions, X as TypeResolver, Y as processInputPaths, Z as registerPTypes, _ as typeRegistry } from './options-CRbi1zSh.js';
5
- export { c as compile } from './compile-D_9hW58g.js';
3
+ import { A as ARC4ArrayType, a as ARC4BoolClass, b as ARC4EncodedType, c as ARC4InstanceType, d as ARC4StrClass, e as ARC4StructClass, f as ARC4StructType, g as ARC4TupleType, h as AddressClass, i as Arc4TupleGeneric, B as ByteClass, C as ContractProxyGeneric, j as ContractProxyType, D as DynamicArrayGeneric, k as DynamicArrayType, l as DynamicBytesConstructor, m as DynamicBytesType, S as StaticArrayGeneric, n as StaticArrayType, o as StaticBytesGeneric, p as StaticBytesType, T as TypedApplicationCallResponseGeneric, q as TypedApplicationCallResponseType, U as UFixedNxMGeneric, r as UFixedNxMType, s as UintN128Class, t as UintN16Class, u as UintN256Class, v as UintN32Class, w as UintN64Class, x as UintN8Class, y as UintNGeneric, z as UintNType, E as abiCallFunction, F as arc4AddressAlias, G as arc4BooleanType, H as arc4ByteAlias, I as arc4StringType, J as arc4StructBaseType, K as arc4Uint64, L as compileArc4Function, M as convertBytesFunction, N as decodeArc4Function, O as encodeArc4Function, P as methodSelectorFunction, Q as sizeOfFunction, R as uint8ArrayToHex, V as hexToUint8Array } from './options-D_9OI_e6.js';
4
+ export { W as CompileOptions, X as TypeResolver, Y as processInputPaths, Z as registerPTypes, _ as typeRegistry } from './options-D_9OI_e6.js';
5
+ export { c as compile } from './compile-MzeR7I1-.js';
6
6
  import 'typescript';
7
7
  import 'node:fs';
8
8
  import 'node:util';
@@ -28,7 +28,7 @@ import 'fs';
28
28
  import 'fs/promises';
29
29
  import './semver-BlMeOfo8.js';
30
30
  import 'node:url';
31
- import './resolve-puya-path-BKsfk4qd.js';
31
+ import './resolve-puya-path-BnON0byV.js';
32
32
  import 'signal-exit';
33
33
  import 'tar';
34
34
  import 'node:zlib';
@@ -23225,6 +23225,7 @@ class CompileOptions {
23225
23225
  outputMemoryIr;
23226
23226
  outputBytecode;
23227
23227
  outputSourceMap;
23228
+ outputAssemblyReport;
23228
23229
  debugLevel;
23229
23230
  optimizationLevel;
23230
23231
  treatWarningsAsErrors;
@@ -23253,6 +23254,7 @@ class CompileOptions {
23253
23254
  this.outputMemoryIr = options.outputMemoryIr ?? false;
23254
23255
  this.outputBytecode = options.outputBytecode ?? false;
23255
23256
  this.outputSourceMap = options.outputSourceMap ?? false;
23257
+ this.outputAssemblyReport = options.outputAssemblyReport ?? defaultPuyaOptions.outputAssemblyReport;
23256
23258
  this.debugLevel = options.debugLevel ?? defaultPuyaOptions.debugLevel;
23257
23259
  this.optimizationLevel = options.optimizationLevel ?? defaultPuyaOptions.optimizationLevel;
23258
23260
  this.treatWarningsAsErrors = options.treatWarningsAsErrors ?? defaultPuyaOptions.treatWarningsAsErrors;
@@ -23290,6 +23292,7 @@ const defaultPuyaOptions = {
23290
23292
  outputDestructuredIr: false,
23291
23293
  outputMemoryIr: false,
23292
23294
  outputBytecode: false,
23295
+ outputAssemblyReport: false,
23293
23296
  debugLevel: 1,
23294
23297
  optimizationLevel: 1,
23295
23298
  treatWarningsAsErrors: false,
@@ -23311,6 +23314,7 @@ class PuyaOptions {
23311
23314
  outputMemoryIr;
23312
23315
  outputBytecode;
23313
23316
  outputSourceMap;
23317
+ outputAssemblyReport;
23314
23318
  debugLevel;
23315
23319
  optimizationLevel;
23316
23320
  treatWarningsAsErrors;
@@ -23332,6 +23336,7 @@ class PuyaOptions {
23332
23336
  this.outputDestructuredIr = options.outputDestructuredIr;
23333
23337
  this.outputMemoryIr = options.outputMemoryIr;
23334
23338
  this.outputBytecode = options.outputBytecode;
23339
+ this.outputAssemblyReport = options.outputAssemblyReport;
23335
23340
  this.debugLevel = options.debugLevel;
23336
23341
  this.optimizationLevel = options.optimizationLevel;
23337
23342
  this.treatWarningsAsErrors = options.treatWarningsAsErrors;
@@ -23346,4 +23351,4 @@ class PuyaOptions {
23346
23351
  }
23347
23352
 
23348
23353
  export { defaultPuyaOptions as $, ARC4ArrayType as A, ByteClass as B, ContractProxyGeneric as C, DynamicArrayGeneric as D, abiCallFunction as E, arc4AddressAlias as F, arc4BooleanType as G, arc4ByteAlias as H, arc4StringType as I, arc4StructBaseType as J, arc4Uint64 as K, compileArc4Function as L, convertBytesFunction as M, decodeArc4Function as N, encodeArc4Function as O, methodSelectorFunction as P, sizeOfFunction as Q, uint8ArrayToHex as R, StaticArrayGeneric as S, TypedApplicationCallResponseGeneric as T, UFixedNxMGeneric as U, hexToUint8Array as V, CompileOptions as W, TypeResolver as X, processInputPaths as Y, registerPTypes as Z, typeRegistry as _, ARC4BoolClass as a, parseCliTemplateVar as a0, LocalsCoalescingStrategy as a1, PuyaService as a2, deserializeAndLog as a3, createTsProgram as a4, buildAwst as a5, validateAwst as a6, sleep as a7, DefaultMap as a8, relinquishThread as a9, ARC4EncodedType as b, ARC4InstanceType as c, ARC4StrClass as d, ARC4StructClass as e, ARC4StructType as f, ARC4TupleType as g, AddressClass as h, Arc4TupleGeneric as i, ContractProxyType as j, DynamicArrayType as k, DynamicBytesConstructor as l, DynamicBytesType as m, StaticArrayType as n, StaticBytesGeneric as o, StaticBytesType as p, TypedApplicationCallResponseType as q, UFixedNxMType as r, UintN128Class as s, UintN16Class as t, UintN256Class as u, UintN32Class as v, UintN64Class as w, UintN8Class as x, UintNGeneric as y, UintNType as z };
23349
- //# sourceMappingURL=options-CRbi1zSh.js.map
23354
+ //# sourceMappingURL=options-D_9OI_e6.js.map