Skip to content

Commit 6f32ea1

Browse files
authored
Merge pull request #40 from algorandfoundation/refactor/import
refactor: use import replacement to swap in stub implementations
2 parents 2040373 + 01b3738 commit 6f32ea1

File tree

99 files changed

+825
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+825
-702
lines changed

.tstoolkitrc.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const config: TsToolkitConfig = {
1010
exports: {
1111
'.': 'index.ts',
1212
'./runtime-helpers': 'runtime-helpers.ts',
13+
'./internal': 'internal.ts',
14+
'./internal/arc4': 'internal-arc4.ts',
15+
'./internal/op': 'internal-op.ts',
1316
'./test-transformer': 'test-transformer/index.ts',
1417
},
1518
},

eslint.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { FlatCompat } from '@eslint/eslintrc'
2+
import js from '@eslint/js'
13
import globals from 'globals'
24
import path from 'node:path'
35
import { fileURLToPath } from 'node:url'
4-
import js from '@eslint/js'
5-
import { FlatCompat } from '@eslint/eslintrc'
66

77
const __filename = fileURLToPath(import.meta.url)
88
const __dirname = path.dirname(__filename)
@@ -33,5 +33,8 @@ export default [
3333
...globals.node,
3434
},
3535
},
36+
rules: {
37+
'@typescript-eslint/consistent-type-imports': 'error',
38+
},
3639
},
3740
]

examples/calculator/contract.algo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { assert, BaseContract, Bytes, err, log, op, Txn, uint64, Uint64 } from '@algorandfoundation/algorand-typescript'
1+
import type { uint64 } from '@algorandfoundation/algorand-typescript'
2+
import { assert, BaseContract, Bytes, err, log, op, Txn, Uint64 } from '@algorandfoundation/algorand-typescript'
23

34
const ADD = Uint64(1)
45
const SUB = Uint64(2)

examples/htlc-logicsig/signature.algo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Account, Bytes, Global, LogicSig, op, TransactionType, Txn, Uint64, uint64 } from '@algorandfoundation/algorand-typescript'
1+
import type { uint64 } from '@algorandfoundation/algorand-typescript'
2+
import { Account, Bytes, Global, LogicSig, op, TransactionType, Txn, Uint64 } from '@algorandfoundation/algorand-typescript'
23

34
export default class HashedTimeLockedLogicSig extends LogicSig {
45
program(): boolean | uint64 {

examples/scratch-storage/contract.algo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { arc4, assert, BaseContract, Bytes, op, uint64, Uint64 } from '@algorandfoundation/algorand-typescript'
1+
import type { uint64 } from '@algorandfoundation/algorand-typescript'
2+
import { arc4, assert, BaseContract, Bytes, op, Uint64 } from '@algorandfoundation/algorand-typescript'
23

34
export class ScratchSlotsContract extends arc4.Contract {
45
@arc4.abimethod()

examples/zk-whitelist/contract.algo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { uint64 } from '@algorandfoundation/algorand-typescript'
12
import {
23
abimethod,
34
Account,
@@ -13,7 +14,6 @@ import {
1314
OpUpFeeSource,
1415
TemplateVar,
1516
Txn,
16-
uint64,
1717
} from '@algorandfoundation/algorand-typescript'
1818

1919
const curveMod = 21888242871839275222246405745257275088548364400416034343698204186575808495617n

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"tslib": "^2.6.2"
6565
},
6666
"dependencies": {
67-
"@algorandfoundation/algorand-typescript": "^1.0.0-beta.9",
67+
"@algorandfoundation/algorand-typescript": "^1.0.0-beta.10",
6868
"@algorandfoundation/puya-ts": "^1.0.0-beta.13",
6969
"elliptic": "^6.5.7",
7070
"js-sha256": "^0.11.0",

rollup.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const config: RollupOptions = {
88
input: {
99
index: 'src/index.ts',
1010
'runtime-helpers': 'src/runtime-helpers.ts',
11+
'internal': 'src/internal.ts',
12+
'internal/arc4': 'src/internal-arc4.ts',
13+
'internal/op': 'src/internal-op.ts',
1114
'test-transformer/index': 'src/test-transformer/index.ts',
1215
},
1316
output: [

src/abi-metadata.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { BaseContract, Contract } from '@algorandfoundation/algorand-typescript'
2-
import { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4'
1+
import type { BaseContract, Contract } from '@algorandfoundation/algorand-typescript'
2+
import type { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4'
33
import js_sha512 from 'js-sha512'
4-
import { TypeInfo } from './encoders'
4+
import type { TypeInfo } from './encoders'
55
import { getArc4TypeName as getArc4TypeNameForARC4Encoded } from './impl/encoded-types'
6-
import { DeliberateAny } from './typescript-helpers'
6+
import type { DeliberateAny } from './typescript-helpers'
77

88
export interface AbiMetadata {
99
methodName: string

0 commit comments

Comments
 (0)