@algorandfoundation/puya-ts 1.2.0-beta.4 → 1.2.0-beta.41
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/README.md +7 -5
- package/{analyser-service-_vXhzOY0.js → analyser-service-DRDPe9MV.js} +45 -8
- package/analyser-service-DRDPe9MV.js.map +1 -0
- package/analyserService.mjs +7 -6
- package/analyserService.mjs.map +1 -1
- package/arc4-clientgen-sFEhO2LJ.js +324 -0
- package/arc4-clientgen-sFEhO2LJ.js.map +1 -0
- package/arc4-clientgen.d.ts +6 -0
- package/awst/intrinsic-factory.d.ts +4 -2
- package/awst/json-serialize-awst.d.ts +0 -1
- package/awst/node-factory.d.ts +1 -0
- package/awst/nodes.d.ts +26 -15
- package/awst/source-location.d.ts +0 -1
- package/awst/to-code-visitor.d.ts +3 -2
- package/awst/validation/arc4-approval-calls-router.d.ts +1 -1
- package/awst/validation/{awst-traverser.d.ts → function-traverser.d.ts} +4 -10
- package/awst/wtypes.d.ts +47 -45
- package/awst_build/arc4-util.d.ts +1 -38
- package/awst_build/ast-visitors/base-visitor.d.ts +0 -1
- package/awst_build/ast-visitors/class-definition-visitor.d.ts +721 -1
- package/awst_build/ast-visitors/contract-method-visitor.d.ts +3 -5
- package/awst_build/ast-visitors/function-visitor.d.ts +721 -1
- package/awst_build/ast-visitors/text-visitor.d.ts +721 -1
- package/awst_build/context/awst-build-context.d.ts +1 -1
- package/awst_build/eb/arc28/arc-28-emit-function-builder.d.ts +1 -2
- package/awst_build/eb/arc4/arrays.d.ts +2 -1
- package/awst_build/eb/arc4/c2c.d.ts +0 -17
- package/awst_build/eb/arc4/uintn.d.ts +1 -1
- package/awst_build/eb/arc4/util.d.ts +1 -0
- package/awst_build/eb/array-like/arrays.d.ts +3 -2
- package/awst_build/eb/array-like/util.d.ts +0 -1
- package/awst_build/eb/bytes-expression-builder.d.ts +0 -28
- package/awst_build/eb/contract-builder.d.ts +0 -11
- package/awst_build/eb/index.d.ts +0 -2
- package/awst_build/eb/literal/object-literal-expression-builder.d.ts +8 -4
- package/awst_build/eb/logged-error-builder.d.ts +11 -0
- package/awst_build/eb/objects/util.d.ts +0 -2
- package/awst_build/eb/op-module-builder.d.ts +0 -3
- package/awst_build/eb/storage/box/box.d.ts +1 -21
- package/awst_build/eb/storage/global-map.d.ts +21 -0
- package/awst_build/eb/storage/local-map.d.ts +21 -0
- package/awst_build/eb/string-expression-builder.d.ts +0 -6
- package/awst_build/eb/util/resolve-compat-builder.d.ts +0 -8
- package/awst_build/models/decorator-data.d.ts +1 -0
- package/awst_build/op-metadata.d.ts +4 -3
- package/awst_build/ptypes/arc4-types.d.ts +11 -7
- package/awst_build/ptypes/base.d.ts +5 -0
- package/awst_build/ptypes/for-export.d.ts +0 -1
- package/awst_build/ptypes/index.d.ts +103 -100
- package/awst_build/ptypes/util.d.ts +2 -2
- package/awst_build/ptypes/visitor.d.ts +3 -1
- package/awst_build/ptypes/visitors/default-visitor.d.ts +3 -1
- package/awst_build/ptypes/visitors/index-type-visitor.d.ts +0 -31
- package/awst_build/type-resolver.d.ts +1 -1
- package/bin/puyats-clientgen.d.ts +2 -0
- package/bin/puyats-clientgen.mjs +101 -0
- package/bin/puyats-clientgen.mjs.map +1 -0
- package/bin/puyats-ls.mjs +24 -49
- package/bin/puyats-ls.mjs.map +1 -1
- package/bin/run-cli.mjs +19 -13
- package/bin/run-cli.mjs.map +1 -1
- package/{check-node-version-CNvxI8_l.js → check-node-version-C1jtIFzd.js} +3 -3
- package/{check-node-version-CNvxI8_l.js.map → check-node-version-C1jtIFzd.js.map} +1 -1
- package/cli/build-command.d.ts +2 -0
- package/cli-ls.d.ts +1 -1
- package/cli.d.ts +1 -1
- package/cli.mjs +39 -79
- package/cli.mjs.map +1 -1
- package/clientgen.d.ts +1 -0
- package/code-fix/{invalid-non-null-assertion.d.ts → no-op-non-null-assertion.d.ts} +1 -1
- package/{compile-Bz8LVwK2.js → compile-D3rBypqy.js} +11 -4
- package/compile-D3rBypqy.js.map +1 -0
- package/compile.d.ts +1 -1
- package/constants.d.ts +7 -2
- package/contract-class-model-bHAozdbL.js +5456 -0
- package/contract-class-model-bHAozdbL.js.map +1 -0
- package/errors.d.ts +1 -6
- package/index.d.ts +1 -2
- package/index.mjs +36 -26
- package/index.mjs.map +1 -1
- package/language-server/analyser-service.d.ts +0 -1
- package/language-server/compile-trigger-queue.d.ts +2 -2
- package/language-server/puya-language-server.d.ts +0 -38
- package/logger/index.d.ts +0 -7
- package/{options-COFRHTFQ.js → options-lB3ucfHV.js} +2666 -8407
- package/options-lB3ucfHV.js.map +1 -0
- package/options.d.ts +8 -3
- package/package.json +20 -12
- package/puya/check-puya-version.d.ts +0 -13
- package/puya/index.d.ts +1 -1
- package/puya/log-deserializer.d.ts +0 -2
- package/puya/puya-service.d.ts +5 -1
- package/{resolve-puya-path-DtTAMi0Y.js → resolve-puya-path-CxwX2Y7m.js} +9 -45
- package/resolve-puya-path-CxwX2Y7m.js.map +1 -0
- package/semver-DSCCFKAJ.js +45 -0
- package/semver-DSCCFKAJ.js.map +1 -0
- package/util/base-85.d.ts +1 -4
- package/util/generate-temp-file.d.ts +0 -8
- package/util/index.d.ts +1 -3
- package/util/typed-message-port.d.ts +2 -2
- package/util-Dz5YVLPa.js +63 -0
- package/util-Dz5YVLPa.js.map +1 -0
- package/visitor/syntax-names.d.ts +194 -194
- package/visitor/visitor.d.ts +4 -4
- package/analyser-service-_vXhzOY0.js.map +0 -1
- package/compile-Bz8LVwK2.js.map +0 -1
- package/language-server/ls-logger.d.ts +0 -11
- package/options-COFRHTFQ.js.map +0 -1
- package/resolve-puya-path-DtTAMi0Y.js.map +0 -1
- package/util/arc4-signature-parser.d.ts +0 -14
- package/util/polyfills.d.ts +0 -1
package/README.md
CHANGED
|
@@ -10,9 +10,11 @@ Algorand TypeScript is compiled for execution on the AVM by PuyaTs, a TypeScript
|
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
|
13
|
-
- [Language Guide](https://algorandfoundation.github.io/puya-ts/
|
|
14
|
-
- [API
|
|
15
|
-
- [CLI Guide](https://algorandfoundation.github.io/puya-ts/
|
|
13
|
+
- [Language Guide](https://algorandfoundation.github.io/puya-ts/language-guide/)
|
|
14
|
+
- [API Reference](https://algorandfoundation.github.io/puya-ts/api/)
|
|
15
|
+
- [CLI Guide](https://algorandfoundation.github.io/puya-ts/cli/)
|
|
16
|
+
- [Migration Guides](https://algorandfoundation.github.io/puya-ts/migration-guides/)
|
|
17
|
+
- [Release Notes](https://github.com/algorandfoundation/puya-ts/releases)
|
|
16
18
|
- [Contribution Guide](CONTRIBUTING.md)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
For developing the documentation site locally, see the [docs README](docs/README.md).
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import require$$3__default, { randomUUID } from 'crypto';
|
|
2
2
|
import { parentPort, workerData, Worker } from 'node:worker_threads';
|
|
3
|
-
import {
|
|
3
|
+
import { f as AbsolutePath, b2 as LoggingContext, aa as Constants, aI as InternalError, b0 as LogLevel, ds as logger, de as isIn, b1 as LogSource } from './contract-class-model-bHAozdbL.js';
|
|
4
|
+
import { D as DefaultMap, a2 as registerPTypes, a6 as typeRegistry, C as CompileOptions, R as createTsProgram, a3 as relinquishThread, N as buildAwst, a8 as validateAwst, X as deserializeAndLog, P as PuyaService, a1 as processInputPaths } from './options-lB3ucfHV.js';
|
|
4
5
|
import pathe__default from 'pathe';
|
|
5
6
|
import ts from 'typescript';
|
|
6
7
|
import require$$0$2 from 'node:util';
|
|
@@ -80,8 +81,8 @@ function buildDependencyGraph(program) {
|
|
|
80
81
|
|
|
81
82
|
function createTypedMessagePort(x) {
|
|
82
83
|
return {
|
|
83
|
-
postMessage(message) {
|
|
84
|
-
x.postMessage(message);
|
|
84
|
+
postMessage(message, transfer) {
|
|
85
|
+
x.postMessage(message, transfer ?? []);
|
|
85
86
|
},
|
|
86
87
|
onMessage(listener) {
|
|
87
88
|
x.on('message', listener);
|
|
@@ -11123,6 +11124,33 @@ function mapPosition(position) {
|
|
|
11123
11124
|
};
|
|
11124
11125
|
}
|
|
11125
11126
|
|
|
11127
|
+
function LogExceptions(target) {
|
|
11128
|
+
return function (...args) {
|
|
11129
|
+
try {
|
|
11130
|
+
const result = target.apply(this, args);
|
|
11131
|
+
if (result instanceof Promise) {
|
|
11132
|
+
return result.catch((e) => {
|
|
11133
|
+
logCaughtExpression(e);
|
|
11134
|
+
process.exit(1);
|
|
11135
|
+
});
|
|
11136
|
+
}
|
|
11137
|
+
return result;
|
|
11138
|
+
}
|
|
11139
|
+
catch (e) {
|
|
11140
|
+
logCaughtExpression(e);
|
|
11141
|
+
process.exit(1);
|
|
11142
|
+
}
|
|
11143
|
+
};
|
|
11144
|
+
}
|
|
11145
|
+
function logCaughtExpression(e) {
|
|
11146
|
+
if (e instanceof Error) {
|
|
11147
|
+
logger.error(e);
|
|
11148
|
+
}
|
|
11149
|
+
else {
|
|
11150
|
+
logger.error(undefined, `Unknown error ${e}`);
|
|
11151
|
+
}
|
|
11152
|
+
}
|
|
11153
|
+
|
|
11126
11154
|
function normalisedUri(args) {
|
|
11127
11155
|
if ('fsPath' in args) {
|
|
11128
11156
|
const resolvedFileName = globSync(args.fsPath, { absolute: true })[0];
|
|
@@ -11268,11 +11296,18 @@ if (parentPort) {
|
|
|
11268
11296
|
]);
|
|
11269
11297
|
new AnalyseWorker(typedPort, workerData);
|
|
11270
11298
|
}
|
|
11299
|
+
function resolveTsxModulePath() {
|
|
11300
|
+
const resolve = import.meta.resolve ?? require.resolve;
|
|
11301
|
+
const tsx = resolve('tsx');
|
|
11302
|
+
if (tsx.startsWith('file://')) {
|
|
11303
|
+
return URI.parse(tsx).fsPath;
|
|
11304
|
+
}
|
|
11305
|
+
return tsx;
|
|
11306
|
+
}
|
|
11271
11307
|
function buildWorker({ workerData }) {
|
|
11272
11308
|
const workerFile = import.meta.filename ?? __filename;
|
|
11273
11309
|
if (workerFile.endsWith('.ts')) {
|
|
11274
|
-
const
|
|
11275
|
-
const tsx = resolve('tsx');
|
|
11310
|
+
const tsx = resolveTsxModulePath();
|
|
11276
11311
|
return new Worker(workerFile, {
|
|
11277
11312
|
execArgv: ['--require', tsx],
|
|
11278
11313
|
workerData,
|
|
@@ -11286,7 +11321,9 @@ function buildWorker({ workerData }) {
|
|
|
11286
11321
|
}
|
|
11287
11322
|
function createAnalyserService(options) {
|
|
11288
11323
|
const worker = buildWorker({ workerData: options });
|
|
11289
|
-
worker.on('error', (err) =>
|
|
11324
|
+
worker.on('error', (err) => {
|
|
11325
|
+
logCaughtExpression(err);
|
|
11326
|
+
});
|
|
11290
11327
|
const typedWorker = createTypedMessagePort(worker);
|
|
11291
11328
|
const responses = new Map();
|
|
11292
11329
|
typedWorker.onMessage((message) => {
|
|
@@ -11336,5 +11373,5 @@ function createAnalyserService(options) {
|
|
|
11336
11373
|
};
|
|
11337
11374
|
}
|
|
11338
11375
|
|
|
11339
|
-
export { createNormalisedTextDocumentConnection as a, createAnalyserService as c, isCodeFixData as i, normalisedUri as n, requireMain as r };
|
|
11340
|
-
//# sourceMappingURL=analyser-service-
|
|
11376
|
+
export { LogExceptions as L, createNormalisedTextDocumentConnection as a, createAnalyserService as c, isCodeFixData as i, logCaughtExpression as l, normalisedUri as n, requireMain as r };
|
|
11377
|
+
//# sourceMappingURL=analyser-service-DRDPe9MV.js.map
|