@algorandfoundation/puya-ts 1.2.0-beta.1 → 1.2.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{analyser-service-BZcL-Knr.js → analyser-service-_vXhzOY0.js} +2 -2
- package/{analyser-service-BZcL-Knr.js.map → analyser-service-_vXhzOY0.js.map} +1 -1
- package/analyserService.mjs +2 -2
- package/awst/node-factory.d.ts +7 -1
- package/awst/nodes.d.ts +26 -3
- package/awst/to-code-visitor.d.ts +1 -0
- package/awst/validation/awst-traverser.d.ts +2 -1
- package/bin/puyats-ls.mjs +4 -4
- package/bin/run-cli.mjs +4 -4
- package/{check-node-version-CGOXeiM5.js → check-node-version-CNvxI8_l.js} +3 -3
- package/{check-node-version-CGOXeiM5.js.map → check-node-version-CNvxI8_l.js.map} +1 -1
- package/cli/build-command.d.ts +1 -0
- package/cli.mjs +10 -4
- package/cli.mjs.map +1 -1
- package/{compile-DaTY9uyZ.js → compile-Bz8LVwK2.js} +5 -3
- package/compile-Bz8LVwK2.js.map +1 -0
- package/constants.d.ts +1 -1
- package/index.mjs +4 -4
- package/logger/index.d.ts +1 -0
- package/{options-5IubucAG.js → options-COFRHTFQ.js} +118 -31
- package/options-COFRHTFQ.js.map +1 -0
- package/options.d.ts +2 -0
- package/package.json +2 -2
- package/{resolve-puya-path-CWJmnrM0.js → resolve-puya-path-DtTAMi0Y.js} +3 -3
- package/resolve-puya-path-DtTAMi0Y.js.map +1 -0
- package/compile-DaTY9uyZ.js.map +0 -1
- package/options-5IubucAG.js.map +0 -1
- package/resolve-puya-path-CWJmnrM0.js.map +0 -1
package/analyserService.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'crypto';
|
|
2
2
|
import 'node:worker_threads';
|
|
3
|
-
export { c as createAnalyserService } from './analyser-service-
|
|
4
|
-
import './options-
|
|
3
|
+
export { c as createAnalyserService } from './analyser-service-_vXhzOY0.js';
|
|
4
|
+
import './options-COFRHTFQ.js';
|
|
5
5
|
import 'pathe';
|
|
6
6
|
import 'typescript';
|
|
7
7
|
import 'node:util';
|
package/awst/node-factory.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { Props } from '../typescript-helpers';
|
|
2
2
|
import type { Expression, Statement } from './nodes';
|
|
3
|
-
import { ARC4Decode, ARC4Encode, ArrayLength, ArrayReplace, AssignmentExpression, AssignmentStatement, BigUIntBinaryOperation, Block, BoolConstant, BooleanBinaryOperation, BytesComparisonExpression, BytesConstant, BytesEncoding, CheckedMaybe, CommaExpression, concreteNodes, Copy, ExpressionStatement, IntegerConstant, MethodDocumentation, Not, NumericComparisonExpression, ReinterpretCast, SingleEvaluation, StringConstant, SubmitInnerTransaction, TupleExpression, TupleItemExpression, UInt64BinaryOperation, VoidConstant } from './nodes';
|
|
3
|
+
import { ARC4Decode, ARC4Encode, ArrayLength, ArrayReplace, AssertExpression, AssignmentExpression, AssignmentStatement, BigUIntBinaryOperation, Block, BoolConstant, BooleanBinaryOperation, BytesComparisonExpression, BytesConstant, BytesEncoding, CheckedMaybe, CommaExpression, concreteNodes, Copy, ExpressionStatement, IntegerConstant, MethodDocumentation, Not, NumericComparisonExpression, ReinterpretCast, SingleEvaluation, StringConstant, SubmitInnerTransaction, TupleExpression, TupleItemExpression, UInt64BinaryOperation, VoidConstant } from './nodes';
|
|
4
4
|
import type { SourceLocation } from './source-location';
|
|
5
5
|
import { wtypes } from './wtypes';
|
|
6
6
|
type ConcreteNodes = typeof concreteNodes;
|
|
7
7
|
declare const explicitNodeFactory: {
|
|
8
|
+
assertExpression(props: {
|
|
9
|
+
condition: Expression | null;
|
|
10
|
+
sourceLocation: SourceLocation;
|
|
11
|
+
wtype: wtypes.WType;
|
|
12
|
+
errorMessage: string | null;
|
|
13
|
+
}): AssertExpression;
|
|
8
14
|
voidConstant(props: {
|
|
9
15
|
sourceLocation: SourceLocation;
|
|
10
16
|
}): VoidConstant;
|
package/awst/nodes.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export declare class AssertExpression extends Expression {
|
|
|
72
72
|
readonly condition: Expression | null;
|
|
73
73
|
readonly errorMessage: string | null;
|
|
74
74
|
readonly wtype: wtypes.WType;
|
|
75
|
+
readonly explicit: boolean;
|
|
75
76
|
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
76
77
|
}
|
|
77
78
|
export declare class IntegerConstant extends Expression {
|
|
@@ -124,10 +125,21 @@ export declare class TemplateVar extends Expression {
|
|
|
124
125
|
readonly name: string;
|
|
125
126
|
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
126
127
|
}
|
|
128
|
+
export declare class MethodSignatureString extends Node {
|
|
129
|
+
constructor(props: Props<MethodSignatureString>);
|
|
130
|
+
readonly value: string;
|
|
131
|
+
}
|
|
132
|
+
export declare class MethodSignature extends Node {
|
|
133
|
+
constructor(props: Props<MethodSignature>);
|
|
134
|
+
readonly name: string;
|
|
135
|
+
readonly argTypes: Array<wtypes.WType>;
|
|
136
|
+
readonly returnType: wtypes.WType;
|
|
137
|
+
readonly resourceEncoding: 'index' | 'value';
|
|
138
|
+
}
|
|
127
139
|
export declare class MethodConstant extends Expression {
|
|
128
140
|
constructor(props: Props<MethodConstant>);
|
|
129
141
|
readonly wtype: wtypes.WType;
|
|
130
|
-
readonly value:
|
|
142
|
+
readonly value: MethodSignature | MethodSignatureString;
|
|
131
143
|
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
132
144
|
}
|
|
133
145
|
export declare class AddressConstant extends Expression {
|
|
@@ -152,7 +164,7 @@ export declare class ARC4Decode extends Expression {
|
|
|
152
164
|
export declare class ARC4FromBytes extends Expression {
|
|
153
165
|
constructor(props: Props<ARC4FromBytes>);
|
|
154
166
|
readonly value: Expression;
|
|
155
|
-
readonly wtype: wtypes.
|
|
167
|
+
readonly wtype: wtypes.WType;
|
|
156
168
|
readonly validate: boolean;
|
|
157
169
|
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
158
170
|
}
|
|
@@ -222,6 +234,13 @@ export declare class UpdateInnerTransaction extends Expression {
|
|
|
222
234
|
readonly wtype: wtypes.WType;
|
|
223
235
|
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
224
236
|
}
|
|
237
|
+
export declare class StageInnerTransactions extends Expression {
|
|
238
|
+
constructor(props: Props<StageInnerTransactions>);
|
|
239
|
+
readonly itxns: Array<Expression>;
|
|
240
|
+
readonly startNewGroup: Expression;
|
|
241
|
+
readonly wtype: wtypes.WType;
|
|
242
|
+
accept<T>(visitor: ExpressionVisitor<T>): T;
|
|
243
|
+
}
|
|
225
244
|
export declare class GroupTransactionReference extends Expression {
|
|
226
245
|
constructor(props: Props<GroupTransactionReference>);
|
|
227
246
|
readonly index: Expression;
|
|
@@ -797,9 +816,9 @@ export declare class ARC4ABIMethodConfig {
|
|
|
797
816
|
readonly create: ARC4CreateOption;
|
|
798
817
|
readonly name: string;
|
|
799
818
|
readonly resourceEncoding: 'index' | 'value';
|
|
800
|
-
readonly validateEncoding: boolean | null;
|
|
801
819
|
readonly readonly: boolean;
|
|
802
820
|
readonly defaultArgs: Map<string, ABIMethodArgMemberDefault | ABIMethodArgConstantDefault>;
|
|
821
|
+
readonly validateEncoding: boolean | null;
|
|
803
822
|
}
|
|
804
823
|
export type Constant = IntegerConstant | DecimalConstant | BoolConstant | BytesConstant | AddressConstant | MethodConstant;
|
|
805
824
|
export type LValue = VarExpression | FieldExpression | IndexExpression | TupleExpression | AppStateExpression | AppAccountStateExpression | BoxValueExpression;
|
|
@@ -823,6 +842,8 @@ export declare const concreteNodes: {
|
|
|
823
842
|
readonly stringConstant: typeof StringConstant;
|
|
824
843
|
readonly voidConstant: typeof VoidConstant;
|
|
825
844
|
readonly templateVar: typeof TemplateVar;
|
|
845
|
+
readonly methodSignatureString: typeof MethodSignatureString;
|
|
846
|
+
readonly methodSignature: typeof MethodSignature;
|
|
826
847
|
readonly methodConstant: typeof MethodConstant;
|
|
827
848
|
readonly addressConstant: typeof AddressConstant;
|
|
828
849
|
readonly aRC4Encode: typeof ARC4Encode;
|
|
@@ -838,6 +859,7 @@ export declare const concreteNodes: {
|
|
|
838
859
|
readonly intrinsicCall: typeof IntrinsicCall;
|
|
839
860
|
readonly createInnerTransaction: typeof CreateInnerTransaction;
|
|
840
861
|
readonly updateInnerTransaction: typeof UpdateInnerTransaction;
|
|
862
|
+
readonly stageInnerTransactions: typeof StageInnerTransactions;
|
|
841
863
|
readonly groupTransactionReference: typeof GroupTransactionReference;
|
|
842
864
|
readonly checkedMaybe: typeof CheckedMaybe;
|
|
843
865
|
readonly tupleExpression: typeof TupleExpression;
|
|
@@ -953,6 +975,7 @@ export interface ExpressionVisitor<T> {
|
|
|
953
975
|
visitIntrinsicCall(expression: IntrinsicCall): T;
|
|
954
976
|
visitCreateInnerTransaction(expression: CreateInnerTransaction): T;
|
|
955
977
|
visitUpdateInnerTransaction(expression: UpdateInnerTransaction): T;
|
|
978
|
+
visitStageInnerTransactions(expression: StageInnerTransactions): T;
|
|
956
979
|
visitGroupTransactionReference(expression: GroupTransactionReference): T;
|
|
957
980
|
visitCheckedMaybe(expression: CheckedMaybe): T;
|
|
958
981
|
visitTupleExpression(expression: TupleExpression): T;
|
|
@@ -39,6 +39,7 @@ export declare class ToCodeVisitor implements nodes.RootNodeVisitor<string[]>, n
|
|
|
39
39
|
visitIntrinsicCall(expression: nodes.IntrinsicCall): string;
|
|
40
40
|
visitCreateInnerTransaction(expression: nodes.CreateInnerTransaction): string;
|
|
41
41
|
visitUpdateInnerTransaction(expression: nodes.UpdateInnerTransaction): string;
|
|
42
|
+
visitStageInnerTransactions(expression: nodes.StageInnerTransactions): string;
|
|
42
43
|
visitCheckedMaybe(expression: nodes.CheckedMaybe): string;
|
|
43
44
|
visitTupleExpression(expression: nodes.TupleExpression): string;
|
|
44
45
|
visitTupleItemExpression(expression: nodes.TupleItemExpression): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddressConstant, AppAccountStateExpression, AppStateExpression, AppStorageDefinition, ARC4Decode, ARC4Encode, ARC4FromBytes, ARC4Router, ArrayConcat, ArrayExtend, ArrayLength, ArrayPop, ArrayReplace, AssertExpression, AssignmentExpression, AssignmentStatement, BigUIntAugmentedAssignment, BigUIntBinaryOperation, BigUIntPostfixUnaryOperation, Block, BoolConstant, BooleanBinaryOperation, BoxPrefixedKeyExpression, BoxValueExpression, BytesAugmentedAssignment, BytesBinaryOperation, BytesComparisonExpression, BytesConstant, BytesUnaryOperation, CheckedMaybe, CommaExpression, CompiledContract, CompiledLogicSig, ConditionalExpression, Contract, ContractMemberNodeVisitor, ContractMethod, ConvertArray, Copy, CreateInnerTransaction, DecimalConstant, Emit, Enumeration, ExpressionStatement, ExpressionVisitor, FieldExpression, ForInLoop, Goto, GroupTransactionReference, IfElse, IndexExpression, InnerTransactionField, IntegerConstant, IntersectionSliceExpression, IntrinsicCall, LogicSignature, LoopContinue, LoopExit, MethodConstant, NamedTupleExpression, NewArray, NewStruct, Not, NumericComparisonExpression, PuyaLibCall, Range, ReinterpretCast, ReturnStatement, Reversed, RootNodeVisitor, SetInnerTransactionFields, SingleEvaluation, SizeOf, SliceExpression, StateDelete, StateExists, StateGet, StateGetEx, StatementVisitor, StringConstant, SubmitInnerTransaction, Subroutine, SubroutineCallExpression, Switch, TemplateVar, TupleExpression, TupleItemExpression, UInt64AugmentedAssignment, UInt64BinaryOperation, UInt64PostfixUnaryOperation, UInt64UnaryOperation, UpdateInnerTransaction, VarExpression, VoidConstant, WhileLoop } from '../nodes';
|
|
1
|
+
import type { AddressConstant, AppAccountStateExpression, AppStateExpression, AppStorageDefinition, ARC4Decode, ARC4Encode, ARC4FromBytes, ARC4Router, ArrayConcat, ArrayExtend, ArrayLength, ArrayPop, ArrayReplace, AssertExpression, AssignmentExpression, AssignmentStatement, BigUIntAugmentedAssignment, BigUIntBinaryOperation, BigUIntPostfixUnaryOperation, Block, BoolConstant, BooleanBinaryOperation, BoxPrefixedKeyExpression, BoxValueExpression, BytesAugmentedAssignment, BytesBinaryOperation, BytesComparisonExpression, BytesConstant, BytesUnaryOperation, CheckedMaybe, CommaExpression, CompiledContract, CompiledLogicSig, ConditionalExpression, Contract, ContractMemberNodeVisitor, ContractMethod, ConvertArray, Copy, CreateInnerTransaction, DecimalConstant, Emit, Enumeration, ExpressionStatement, ExpressionVisitor, FieldExpression, ForInLoop, Goto, GroupTransactionReference, IfElse, IndexExpression, InnerTransactionField, IntegerConstant, IntersectionSliceExpression, IntrinsicCall, LogicSignature, LoopContinue, LoopExit, MethodConstant, NamedTupleExpression, NewArray, NewStruct, Not, NumericComparisonExpression, PuyaLibCall, Range, ReinterpretCast, ReturnStatement, Reversed, RootNodeVisitor, SetInnerTransactionFields, SingleEvaluation, SizeOf, SliceExpression, StageInnerTransactions, StateDelete, StateExists, StateGet, StateGetEx, StatementVisitor, StringConstant, SubmitInnerTransaction, Subroutine, SubroutineCallExpression, Switch, TemplateVar, TupleExpression, TupleItemExpression, UInt64AugmentedAssignment, UInt64BinaryOperation, UInt64PostfixUnaryOperation, UInt64UnaryOperation, UpdateInnerTransaction, VarExpression, VoidConstant, WhileLoop } from '../nodes';
|
|
2
2
|
export declare class FunctionTraverser implements ExpressionVisitor<void>, StatementVisitor<void> {
|
|
3
3
|
visitExpressionStatement(statement: ExpressionStatement): void;
|
|
4
4
|
visitBlock(statement: Block): void;
|
|
@@ -37,6 +37,7 @@ export declare class FunctionTraverser implements ExpressionVisitor<void>, State
|
|
|
37
37
|
visitIntrinsicCall(expression: IntrinsicCall): void;
|
|
38
38
|
visitCreateInnerTransaction(expression: CreateInnerTransaction): void;
|
|
39
39
|
visitUpdateInnerTransaction(expression: UpdateInnerTransaction): void;
|
|
40
|
+
visitStageInnerTransactions(expression: StageInnerTransactions): void;
|
|
40
41
|
visitGroupTransactionReference(expression: GroupTransactionReference): void;
|
|
41
42
|
visitCheckedMaybe(expression: CheckedMaybe): void;
|
|
42
43
|
visitTupleExpression(expression: TupleExpression): void;
|
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-
|
|
2
|
+
import { cY as LogLevel, d8 as distinct, cZ as logger, d9 as DefaultMap, da as zipStrict, C as Constants } from '../options-COFRHTFQ.js';
|
|
3
3
|
import { ArgumentParser, BooleanOptionalAction } from 'argparse';
|
|
4
|
-
import { b as packageVersion, a as appVersion, r as resolvePuyaPath } from '../resolve-puya-path-
|
|
5
|
-
import { c as checkNodeVersion } from '../check-node-version-
|
|
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';
|
|
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-
|
|
7
|
+
import { r as requireMain, c as createAnalyserService, a as createNormalisedTextDocumentConnection, n as normalisedUri, i as isCodeFixData } from '../analyser-service-_vXhzOY0.js';
|
|
8
8
|
import EventEmitter from 'node:events';
|
|
9
9
|
import 'arcsecond';
|
|
10
10
|
import 'node:fs';
|
package/bin/run-cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import '../cli.mjs';
|
|
3
|
-
import '../options-
|
|
3
|
+
import '../options-COFRHTFQ.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-
|
|
24
|
+
import '../resolve-puya-path-DtTAMi0Y.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-
|
|
30
|
+
import '../compile-Bz8LVwK2.js';
|
|
31
31
|
import 'chalk';
|
|
32
|
-
import '../check-node-version-
|
|
32
|
+
import '../check-node-version-CNvxI8_l.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-
|
|
3
|
-
import { p as parseSemVer } from './resolve-puya-path-
|
|
2
|
+
import { C as Constants } from './options-COFRHTFQ.js';
|
|
3
|
+
import { p as parseSemVer } from './resolve-puya-path-DtTAMi0Y.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-
|
|
20
|
+
//# sourceMappingURL=check-node-version-CNvxI8_l.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-node-version-
|
|
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;;;;"}
|
package/cli/build-command.d.ts
CHANGED
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-
|
|
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';
|
|
2
2
|
import { BooleanOptionalAction, ArgumentParser } from 'argparse';
|
|
3
|
-
import { a as appVersion } from './resolve-puya-path-
|
|
4
|
-
import { c as compile } from './compile-
|
|
3
|
+
import { a as appVersion } from './resolve-puya-path-DtTAMi0Y.js';
|
|
4
|
+
import { c as compile } from './compile-Bz8LVwK2.js';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
|
-
import { c as checkNodeVersion } from './check-node-version-
|
|
6
|
+
import { c as checkNodeVersion } from './check-node-version-CNvxI8_l.js';
|
|
7
7
|
import 'arcsecond';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:util';
|
|
@@ -174,6 +174,11 @@ function addBuildCommand(parser) {
|
|
|
174
174
|
choices: ['0', '1', '2'],
|
|
175
175
|
help: 'Set optimization level of output TEAL / AVM bytecode, 0 = none, 1 = normal, 2 = intensive',
|
|
176
176
|
});
|
|
177
|
+
parser.add_argument('--treat-warnings-as-errors', {
|
|
178
|
+
action: BooleanOptionalAction,
|
|
179
|
+
default: defaultPuyaOptions.treatWarningsAsErrors,
|
|
180
|
+
help: 'Report and treat all warnings emitted by the compiler as errors',
|
|
181
|
+
});
|
|
177
182
|
parser.add_argument('--target-avm-version', {
|
|
178
183
|
default: defaultPuyaOptions.targetAvmVersion.toString(),
|
|
179
184
|
choices: ['10', '11', '12', '13'],
|
|
@@ -238,6 +243,7 @@ async function buildCommand(args) {
|
|
|
238
243
|
outputSourceMap: args.output_source_map,
|
|
239
244
|
debugLevel: convertInt(args.debug_level),
|
|
240
245
|
optimizationLevel: convertInt(args.optimization_level),
|
|
246
|
+
treatWarningsAsErrors: args.treat_warnings_as_errors,
|
|
241
247
|
targetAvmVersion: convertInt(args.target_avm_version),
|
|
242
248
|
cliTemplateDefinitions: Object.fromEntries(args.cli_template_definitions?.map(parseCliTemplateVar) ?? []),
|
|
243
249
|
templateVarsPrefix: args.template_vars_prefix,
|
package/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sources":["../src/logger/sinks/console-log-sink.ts","../src/cli/util.ts","../src/cli/build-command.ts","../src/cli/parse.ts","../src/cli.ts"],"sourcesContent":["import chalk from 'chalk'\nimport type { SourceLocation } from '../../awst/source-location'\nimport type { LogEvent } from '../index'\nimport { isMinLevel, LoggingContext, LogLevel } from '../index'\nimport type { LogSink } from './index'\nimport type { AbsolutePath } from '../../util/absolute-path'\n\ntype ColorFn = (text: string) => string\nconst levelConfig: Record<LogEvent['level'], { colorFn: ColorFn; writeFn: (...args: unknown[]) => void }> = {\n /* eslint-disable no-console */\n debug: { colorFn: chalk.green, writeFn: console.debug },\n info: { colorFn: chalk.green, writeFn: console.info },\n warning: { colorFn: chalk.yellow, writeFn: console.warn },\n error: { colorFn: chalk.red, writeFn: console.error },\n critical: { colorFn: chalk.red, writeFn: console.error },\n /* eslint-enable no-console */\n}\n\nexport class ConsoleLogSink implements LogSink {\n constructor(\n public readonly minLogLevel: LogLevel,\n private readonly pathsRelativeTo?: AbsolutePath,\n ) {}\n\n add(logEvent: LogEvent): void {\n const config = levelConfig[logEvent.level]\n\n let logText = `${config.colorFn(logEvent.level)}: ${logEvent.message}`\n if (logEvent.sourceLocation) {\n const sourceLocationText = logEvent.sourceLocation.toString({ pathsRelativeTo: this.pathsRelativeTo })\n const indentSize = sourceLocationText.length + logEvent.level.length + 4\n\n const sourceSummary = isMinLevel(logEvent.level, LogLevel.Warning) ? this.getSourceSummary(logEvent.sourceLocation, indentSize) : ''\n logText = `${sourceLocationText} ${logText}${sourceSummary}`\n }\n if (isMinLevel(LogLevel.Debug, this.minLogLevel) && logEvent.stack) {\n logText += `\\n ${logEvent.stack}`\n }\n config.writeFn(logText)\n }\n\n getSourceSummary(sourceLocation: SourceLocation, indent: number): string {\n const sourceFile = sourceLocation.file && LoggingContext.current.sourcesByPath[sourceLocation.file.toString()]\n if (!sourceFile || sourceLocation.scope === 'file') return ''\n\n const line = sourceFile[sourceLocation.line - 1]\n const trimmedLine = line.trimStart()\n const marker = `${''.padStart(sourceLocation.column - (line.length - trimmedLine.length))}^${''.padStart(Math.max(sourceLocation.endColumn - sourceLocation.column - 1, 0), '~')}`\n const indentChars = ''.padStart(indent, ' ')\n return `\\n${indentChars}${trimmedLine}\\n${indentChars}${marker}`\n }\n}\n","import type { ArgumentParser } from 'argparse'\nimport { enumFromValue } from '../util'\n\nexport function addEnumArg<T>(\n parser: ArgumentParser,\n { name, enumType, default: defaultValue, help }: { name: string; enumType: Record<string, string>; default?: T; help: string },\n) {\n parser.add_argument(name, {\n type: (v: string) => enumFromValue(v, enumType),\n choices: Array.from(Object.values(enumType)),\n default: defaultValue,\n help,\n })\n}\n\nexport function convertInt(val: string) {\n const res = Number(val)\n if (isNaN(res) || Math.round(res) !== res) {\n throw new Error(`'${val}' could not be converted to a number`)\n }\n return res\n}\n","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 { parseCliTemplateVar } from '../util/template-var-cli-parser'\nimport { addEnumArg, convertInt } from './util'\nimport { AbsolutePath } from '../util/absolute-path'\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_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 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-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('--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 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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,WAAW,GAA2F;;AAE1G,IAAA,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;AACvD,IAAA,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;AACrD,IAAA,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;AACzD,IAAA,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;AACrD,IAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;;CAEzD;MAEY,cAAc,CAAA;AAEP,IAAA,WAAA;AACC,IAAA,eAAA;IAFnB,WAAA,CACkB,WAAqB,EACpB,eAA8B,EAAA;QAD/B,IAAA,CAAA,WAAW,GAAX,WAAW;QACV,IAAA,CAAA,eAAe,GAAf,eAAe;IAC/B;AAEH,IAAA,GAAG,CAAC,QAAkB,EAAA;QACpB,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,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,EAAE;AACtB,gBAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACjB;iBAAO;AACL,gBAAA,MAAM,CAAC;YACT;QACF;AACF,IAAA,CAAC,CAAC;AACJ;;AC7NO,eAAe,iBAAiB,GAAA;AACrC,IAAA,gBAAgB,EAAE;AAClB,IAAA,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
|
+
{"version":3,"file":"cli.mjs","sources":["../src/logger/sinks/console-log-sink.ts","../src/cli/util.ts","../src/cli/build-command.ts","../src/cli/parse.ts","../src/cli.ts"],"sourcesContent":["import chalk from 'chalk'\nimport type { SourceLocation } from '../../awst/source-location'\nimport type { LogEvent } from '../index'\nimport { isMinLevel, LoggingContext, LogLevel } from '../index'\nimport type { LogSink } from './index'\nimport type { AbsolutePath } from '../../util/absolute-path'\n\ntype ColorFn = (text: string) => string\nconst levelConfig: Record<LogEvent['level'], { colorFn: ColorFn; writeFn: (...args: unknown[]) => void }> = {\n /* eslint-disable no-console */\n debug: { colorFn: chalk.green, writeFn: console.debug },\n info: { colorFn: chalk.green, writeFn: console.info },\n warning: { colorFn: chalk.yellow, writeFn: console.warn },\n error: { colorFn: chalk.red, writeFn: console.error },\n critical: { colorFn: chalk.red, writeFn: console.error },\n /* eslint-enable no-console */\n}\n\nexport class ConsoleLogSink implements LogSink {\n constructor(\n public readonly minLogLevel: LogLevel,\n private readonly pathsRelativeTo?: AbsolutePath,\n ) {}\n\n add(logEvent: LogEvent): void {\n const config = levelConfig[logEvent.level]\n\n let logText = `${config.colorFn(logEvent.level)}: ${logEvent.message}`\n if (logEvent.sourceLocation) {\n const sourceLocationText = logEvent.sourceLocation.toString({ pathsRelativeTo: this.pathsRelativeTo })\n const indentSize = sourceLocationText.length + logEvent.level.length + 4\n\n const sourceSummary = isMinLevel(logEvent.level, LogLevel.Warning) ? this.getSourceSummary(logEvent.sourceLocation, indentSize) : ''\n logText = `${sourceLocationText} ${logText}${sourceSummary}`\n }\n if (isMinLevel(LogLevel.Debug, this.minLogLevel) && logEvent.stack) {\n logText += `\\n ${logEvent.stack}`\n }\n config.writeFn(logText)\n }\n\n getSourceSummary(sourceLocation: SourceLocation, indent: number): string {\n const sourceFile = sourceLocation.file && LoggingContext.current.sourcesByPath[sourceLocation.file.toString()]\n if (!sourceFile || sourceLocation.scope === 'file') return ''\n\n const line = sourceFile[sourceLocation.line - 1]\n const trimmedLine = line.trimStart()\n const marker = `${''.padStart(sourceLocation.column - (line.length - trimmedLine.length))}^${''.padStart(Math.max(sourceLocation.endColumn - sourceLocation.column - 1, 0), '~')}`\n const indentChars = ''.padStart(indent, ' ')\n return `\\n${indentChars}${trimmedLine}\\n${indentChars}${marker}`\n }\n}\n","import type { ArgumentParser } from 'argparse'\nimport { enumFromValue } from '../util'\n\nexport function addEnumArg<T>(\n parser: ArgumentParser,\n { name, enumType, default: defaultValue, help }: { name: string; enumType: Record<string, string>; default?: T; help: string },\n) {\n parser.add_argument(name, {\n type: (v: string) => enumFromValue(v, enumType),\n choices: Array.from(Object.values(enumType)),\n default: defaultValue,\n help,\n })\n}\n\nexport function convertInt(val: string) {\n const res = Number(val)\n if (isNaN(res) || Math.round(res) !== res) {\n throw new Error(`'${val}' could not be converted to a number`)\n }\n return res\n}\n","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_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-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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,WAAW,GAA2F;;AAE1G,IAAA,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;AACvD,IAAA,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;AACrD,IAAA,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;AACzD,IAAA,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;AACrD,IAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE;;CAEzD;MAEY,cAAc,CAAA;AAEP,IAAA,WAAA;AACC,IAAA,eAAA;IAFnB,WAAA,CACkB,WAAqB,EACpB,eAA8B,EAAA;QAD/B,IAAA,CAAA,WAAW,GAAX,WAAW;QACV,IAAA,CAAA,eAAe,GAAf,eAAe;IAC/B;AAEH,IAAA,GAAG,CAAC,QAAkB,EAAA;QACpB,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;AAE1C,QAAA,IAAI,OAAO,GAAG,CAAA,EAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,E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,CACH;YACD,MAAM,CAAC,YAAY,EAAE;QACvB;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,IAAI,CAAC,YAAY,KAAK,EAAE;AACtB,gBAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACjB;iBAAO;AACL,gBAAA,MAAM,CAAC;YACT;QACF;AACF,IAAA,CAAC,CAAC;AACJ;;ACpOO,eAAe,iBAAiB,GAAA;AACrC,IAAA,gBAAgB,EAAE;AAClB,IAAA,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,5 +1,5 @@
|
|
|
1
|
-
import { cV as mkDirIfNotExists, cW as PuyaService, cX as deserializeAndLog, cY as LogLevel, cO as registerPTypes, cZ as logger, c_ as createTsProgram,
|
|
2
|
-
import { r as resolvePuyaPath, a as appVersion } from './resolve-puya-path-
|
|
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';
|
|
3
3
|
import ts from 'typescript';
|
|
4
4
|
|
|
5
5
|
function buildCompilationSetMapping({ awst, inputPaths, compilationSet, }) {
|
|
@@ -61,6 +61,8 @@ function getSourceFileContents(sourceFiles) {
|
|
|
61
61
|
|
|
62
62
|
async function compile(options, puyaService) {
|
|
63
63
|
const loggerCtx = LoggingContext.current;
|
|
64
|
+
if (options.treatWarningsAsErrors)
|
|
65
|
+
loggerCtx.treatWarningsAsErrors = true;
|
|
64
66
|
registerPTypes(typeRegistry);
|
|
65
67
|
logger.info(undefined, appVersion({ withAVMVersion: false }));
|
|
66
68
|
const programResult = createTsProgram(options);
|
|
@@ -101,4 +103,4 @@ async function compile(options, puyaService) {
|
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export { compile as c };
|
|
104
|
-
//# sourceMappingURL=compile-
|
|
106
|
+
//# sourceMappingURL=compile-Bz8LVwK2.js.map
|
|
@@ -0,0 +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 compil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,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/constants.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare const Constants: {
|
|
|
61
61
|
readonly zeroAddressB32: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ";
|
|
62
62
|
};
|
|
63
63
|
readonly supportedAvmVersions: readonly [10n, 11n, 12n, 13n];
|
|
64
|
-
readonly targetedPuyaVersion: "5.
|
|
64
|
+
readonly targetedPuyaVersion: "5.7.1";
|
|
65
65
|
readonly puyaGithubRepo: "algorandfoundation/puya";
|
|
66
66
|
readonly minNodeVersion: "20.11.1";
|
|
67
67
|
readonly languageServerSource: "puyats";
|
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-
|
|
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-
|
|
3
|
-
export { c as compile } from './compile-
|
|
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';
|
|
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-
|
|
23
|
+
import './resolve-puya-path-DtTAMi0Y.js';
|
|
24
24
|
import 'fs';
|
|
25
25
|
import 'node:url';
|
|
26
26
|
import 'signal-exit';
|
package/logger/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare const logger: PuyaLogger;
|
|
|
48
48
|
export declare const patchErrorLocation: <TArgs extends unknown[], TReturn>(action: (...args: TArgs) => TReturn, sourceLocation: SourceLocation) => (...args: TArgs) => TReturn;
|
|
49
49
|
export declare class LoggingContext {
|
|
50
50
|
#private;
|
|
51
|
+
treatWarningsAsErrors: boolean;
|
|
51
52
|
get logEvents(): readonly LogEvent[];
|
|
52
53
|
get logEventsByPath(): {
|
|
53
54
|
readonly [path: string]: readonly LogEvent[];
|